@@ -85,6 +85,10 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * Constructor |
| 88 | + * @param string $title |
|
| 89 | + * @param integer $modid |
|
| 90 | + * @param string $permname |
|
| 91 | + * @param string $permdesc |
|
| 88 | 92 | */ |
| 89 | 93 | function MyXoopsGroupPermForm($title, $modid, $permname, $permdesc) |
| 90 | 94 | { |
@@ -117,6 +121,8 @@ discard block |
||
| 117 | 121 | * Add appendix |
| 118 | 122 | * |
| 119 | 123 | * @access public |
| 124 | + * @param string $permName |
|
| 125 | + * @param string $itemName |
|
| 120 | 126 | */ |
| 121 | 127 | function addAppendix($permName,$itemId,$itemName) |
| 122 | 128 | { |
@@ -249,6 +255,7 @@ discard block |
||
| 249 | 255 | |
| 250 | 256 | /** |
| 251 | 257 | * Constructor |
| 258 | + * @param string $name |
|
| 252 | 259 | */ |
| 253 | 260 | function MyXoopsGroupFormCheckBox($caption, $name, $groupId, $values = null) |
| 254 | 261 | { |
@@ -376,8 +376,10 @@ |
||
| 376 | 376 | $tree .= ' checked="checked"'; |
| 377 | 377 | } |
| 378 | 378 | $tree .= " />".$option['name']."<input type=\"hidden\" name=\"".$this->getName()."[parents][".$option['id']."]\" value=\"".implode(':', $parentIds)."\" /><input type=\"hidden\" name=\"".$this->getName()."[itemname][".$option['id']."]\" value=\"".htmlspecialchars($option['name'])."\" /><br />\n"; |
| 379 | - if ( isset( $option['children'] ) ) foreach ($option['children'] as $child) { |
|
| 379 | + if ( isset( $option['children'] ) ) { |
|
| 380 | + foreach ($option['children'] as $child) { |
|
| 380 | 381 | array_push($parentIds, $option['id']); |
| 382 | + } |
|
| 381 | 383 | $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
| 382 | 384 | } |
| 383 | 385 | } |
@@ -24,6 +24,7 @@ discard block |
||
| 24 | 24 | var $attachment_array = array(); |
| 25 | 25 | /** |
| 26 | 26 | * constructor |
| 27 | + * @param integer $id |
|
| 27 | 28 | */ |
| 28 | 29 | function __construct ($id = null) |
| 29 | 30 | { |
@@ -297,7 +298,7 @@ discard block |
||
| 297 | 298 | * create a new answer |
| 298 | 299 | * |
| 299 | 300 | * @param bool $isNew flag the new objects as "new"? |
| 300 | - * @return object sfAnswer |
|
| 301 | + * @return sfAnswer sfAnswer |
|
| 301 | 302 | */ |
| 302 | 303 | function &create($isNew = true) |
| 303 | 304 | { |
@@ -338,7 +339,7 @@ discard block |
||
| 338 | 339 | /** |
| 339 | 340 | * insert a new answer in the database |
| 340 | 341 | * |
| 341 | - * @param object $answer reference to the {@link sfAnswer} object |
|
| 342 | + * @param sfAnswer $answerObj reference to the {@link sfAnswer} object |
|
| 342 | 343 | * @param bool $force |
| 343 | 344 | * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
| 344 | 345 | */ |
@@ -414,8 +415,6 @@ discard block |
||
| 414 | 415 | /** |
| 415 | 416 | * delete an answer from the database |
| 416 | 417 | * |
| 417 | - * @param object $answer reference to the answer to delete |
|
| 418 | - * @param bool $force |
|
| 419 | 418 | * @return bool FALSE if failed. |
| 420 | 419 | */ |
| 421 | 420 | function deleteFaqAnswers(&$faqObj) |
@@ -476,7 +475,6 @@ discard block |
||
| 476 | 475 | /** |
| 477 | 476 | * retrieve 1 official answer (for now SmartFAQ only allow 1 official answer...) |
| 478 | 477 | * |
| 479 | - * @param object $criteria {@link CriteriaElement} conditions to be met |
|
| 480 | 478 | * @param int $faqid |
| 481 | 479 | * @return mixed reference to the {@link sfAnswer} object, FALSE if failed |
| 482 | 480 | */ |
@@ -495,7 +493,6 @@ discard block |
||
| 495 | 493 | /** |
| 496 | 494 | * retrieve all answers |
| 497 | 495 | * |
| 498 | - * @param object $criteria {@link CriteriaElement} conditions to be met |
|
| 499 | 496 | * @param int $faqid |
| 500 | 497 | * @return array array of {@link sfAnswer} objects |
| 501 | 498 | */ |
@@ -62,17 +62,24 @@ discard block |
||
| 62 | 62 | // attachment functions TODO: there should be a file/attachment management class |
| 63 | 63 | function getAttachment() |
| 64 | 64 | { |
| 65 | - if (count($this->attachment_array)) return $this->attachment_array; |
|
| 65 | + if (count($this->attachment_array)) { |
|
| 66 | + return $this->attachment_array; |
|
| 67 | + } |
|
| 66 | 68 | $attachment = $this->getVar('attachment'); |
| 67 | - if (empty($attachment)) $this->attachment_array = null; |
|
| 68 | - else $this->attachment_array = @unserialize(base64_decode($attachment)); |
|
| 69 | + if (empty($attachment)) { |
|
| 70 | + $this->attachment_array = null; |
|
| 71 | + } else { |
|
| 72 | + $this->attachment_array = @unserialize(base64_decode($attachment)); |
|
| 73 | + } |
|
| 69 | 74 | |
| 70 | 75 | return $this->attachment_array; |
| 71 | 76 | } |
| 72 | 77 | |
| 73 | 78 | function incrementDownload($attach_key) |
| 74 | 79 | { |
| 75 | - if (!$attach_key) return false; |
|
| 80 | + if (!$attach_key) { |
|
| 81 | + return false; |
|
| 82 | + } |
|
| 76 | 83 | $this->attachment_array[strval($attach_key)]['num_download'] ++; |
| 77 | 84 | |
| 78 | 85 | return $this->attachment_array[strval($attach_key)]['num_download']; |
@@ -80,9 +87,11 @@ discard block |
||
| 80 | 87 | |
| 81 | 88 | function saveAttachment() |
| 82 | 89 | { |
| 83 | - if (is_array($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 84 | - $attachment_save = base64_encode(serialize($this->attachment_array)); |
|
| 85 | - else $attachment_save = ''; |
|
| 90 | + if (is_array($this->attachment_array) && count($this->attachment_array) > 0) { |
|
| 91 | + $attachment_save = base64_encode(serialize($this->attachment_array)); |
|
| 92 | + } else { |
|
| 93 | + $attachment_save = ''; |
|
| 94 | + } |
|
| 86 | 95 | $this->setVar('attachment', $attachment_save); |
| 87 | 96 | $sql = "UPDATE " . $GLOBALS["xoopsDB"]->prefix("smartfaq_answers") . " SET attachment=" . $GLOBALS["xoopsDB"]->quoteString($attachment_save) . " WHERE post_id = " . $this->getVar('answerid'); |
| 88 | 97 | if (!$result = $GLOBALS["xoopsDB"]->queryF($sql)) { |
@@ -98,11 +107,18 @@ discard block |
||
| 98 | 107 | global $xoopsModuleConfig; |
| 99 | 108 | |
| 100 | 109 | $attach_old = $this->getAttachment(); |
| 101 | - if (!is_array($attach_old) || count($attach_old) < 1) return true; |
|
| 110 | + if (!is_array($attach_old) || count($attach_old) < 1) { |
|
| 111 | + return true; |
|
| 112 | + } |
|
| 102 | 113 | $this->attachment_array = array(); |
| 103 | 114 | |
| 104 | - if ($attach_array === null) $attach_array = array_keys($attach_old); // to delete all! |
|
| 105 | - if (!is_array($attach_array)) $attach_array = array($attach_array); |
|
| 115 | + if ($attach_array === null) { |
|
| 116 | + $attach_array = array_keys($attach_old); |
|
| 117 | + } |
|
| 118 | + // to delete all! |
|
| 119 | + if (!is_array($attach_array)) { |
|
| 120 | + $attach_array = array($attach_array); |
|
| 121 | + } |
|
| 106 | 122 | |
| 107 | 123 | foreach ($attach_old as $key => $attach) { |
| 108 | 124 | if (in_array($key, $attach_array)) { |
@@ -112,9 +128,11 @@ discard block |
||
| 112 | 128 | } |
| 113 | 129 | $this->attachment_array[$key] = $attach; |
| 114 | 130 | } |
| 115 | - if (is_array($this->attachment_array) && count($this->attachment_array) > 0) |
|
| 116 | - $attachment_save = base64_encode(serialize($this->attachment_array)); |
|
| 117 | - else $attachment_save = ''; |
|
| 131 | + if (is_array($this->attachment_array) && count($this->attachment_array) > 0) { |
|
| 132 | + $attachment_save = base64_encode(serialize($this->attachment_array)); |
|
| 133 | + } else { |
|
| 134 | + $attachment_save = ''; |
|
| 135 | + } |
|
| 118 | 136 | $this->setVar('attachment', $attachment_save); |
| 119 | 137 | |
| 120 | 138 | return true; |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | * create a new category |
| 229 | 229 | * |
| 230 | 230 | * @param bool $isNew flag the new objects as "new"? |
| 231 | - * @return object sfCategory |
|
| 231 | + * @return sfCategory sfCategory |
|
| 232 | 232 | */ |
| 233 | 233 | function &create($isNew = true) |
| 234 | 234 | { |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | /** |
| 271 | 271 | * insert a new category in the database |
| 272 | 272 | * |
| 273 | - * @param object $category reference to the {@link sfCategory} object |
|
| 273 | + * @param sfCategory $category reference to the {@link sfCategory} object |
|
| 274 | 274 | * @param bool $force |
| 275 | 275 | * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
| 276 | 276 | */ |
@@ -207,6 +207,9 @@ discard block |
||
| 207 | 207 | return $ret; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | + /** |
|
| 211 | + * @return integer |
|
| 212 | + */ |
|
| 210 | 213 | function uid() |
| 211 | 214 | { |
| 212 | 215 | return $this->getVar("uid"); |
@@ -619,7 +622,7 @@ discard block |
||
| 619 | 622 | /** |
| 620 | 623 | * insert a new faq in the database |
| 621 | 624 | * |
| 622 | - * @param object $faq reference to the {@link sfFaq} object |
|
| 625 | + * @param sfFaq $faq reference to the {@link sfFaq} object |
|
| 623 | 626 | * @param bool $force |
| 624 | 627 | * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
| 625 | 628 | */ |
@@ -164,6 +164,9 @@ discard block |
||
| 164 | 164 | return $fields; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | + /** |
|
| 168 | + * @param string $field |
|
| 169 | + */ |
|
| 167 | 170 | function fieldExists($field) |
| 168 | 171 | { |
| 169 | 172 | $existingFields = $this->getExistingFieldsArray(); |
@@ -620,7 +623,7 @@ discard block |
||
| 620 | 623 | /** |
| 621 | 624 | * Use to update a table |
| 622 | 625 | * |
| 623 | - * @param object $table {@link SmartDbTable} that will be updated |
|
| 626 | + * @param SmartDbTable $table {@link SmartDbTable} that will be updated |
|
| 624 | 627 | * |
| 625 | 628 | * @see SmartDbTable |
| 626 | 629 | * |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * Constructor |
| 24 | 24 | * |
| 25 | 25 | * @param string $uploadDir |
| 26 | - * @param array $allowedMimeTypes |
|
| 26 | + * @param integer $allowedMimeTypes |
|
| 27 | 27 | * @param int $maxFileSize |
| 28 | 28 | * @param int $maxWidth |
| 29 | 29 | * @param int $maxHeight |
@@ -581,6 +581,9 @@ |
||
| 581 | 581 | echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">"; |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | +/** |
|
| 585 | + * @param string $name |
|
| 586 | + */ |
|
| 584 | 587 | function sf_gethandler($name, $optional = false ) |
| 585 | 588 | { |
| 586 | 589 | static $handlers; |
@@ -68,7 +68,6 @@ |
||
| 68 | 68 | /** |
| 69 | 69 | * Display forrum button |
| 70 | 70 | * |
| 71 | - * @param string $image image/button name, without extension |
|
| 72 | 71 | * @param string $alt alt message |
| 73 | 72 | * @param boolean $asImage true for image mode; false for text mode |
| 74 | 73 | * @param string $extra extra attribute for the button |
@@ -123,7 +123,9 @@ |
||
| 123 | 123 | global $xoTheme, $xoopsConfig; |
| 124 | 124 | static $icon_handler; |
| 125 | 125 | |
| 126 | - if (isset($icon_handler)) return $icon_handler; |
|
| 126 | + if (isset($icon_handler)) { |
|
| 127 | + return $icon_handler; |
|
| 128 | + } |
|
| 127 | 129 | |
| 128 | 130 | if (!class_exists("NewbbIconHandler")) { |
| 129 | 131 | require_once dirname(__DIR__)."/class/icon.php"; |
@@ -20,8 +20,12 @@ |
||
| 20 | 20 | $op = 'form'; |
| 21 | 21 | |
| 22 | 22 | // Getting the operation we are doing |
| 23 | -if (isset($_GET['op'])) $op = $_GET['op']; |
|
| 24 | -if (isset($_POST['op'])) $op = $_POST['op']; |
|
| 23 | +if (isset($_GET['op'])) { |
|
| 24 | + $op = $_GET['op']; |
|
| 25 | +} |
|
| 26 | +if (isset($_POST['op'])) { |
|
| 27 | + $op = $_POST['op']; |
|
| 28 | +} |
|
| 25 | 29 | |
| 26 | 30 | // Getting the faqid |
| 27 | 31 | $faqid = isset($_GET['faqid'])? intval($_GET['faqid']) : 0; |