diff --git a/admin/admin_footer.php b/admin/admin_footer.php index 6c70767c..81441fd9 100644 --- a/admin/admin_footer.php +++ b/admin/admin_footer.php @@ -14,18 +14,13 @@ * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @package * @since - * @author XOOPS Development Team - * @version $Id $ + * @author XOOPS Development Team + * @version $Id $ */ global $xoopsModule; -$pathIcon32 = XOOPS_URL .'/' . $xoopsModule->getInfo('sysIcons32'); +$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('sysIcons32'); -echo "
'; +echo " '; xoops_cp_footer(); diff --git a/class/category.php b/class/category.php index d93879ba..62772251 100644 --- a/class/category.php +++ b/class/category.php @@ -66,7 +66,7 @@ public function __construct() /** * @param string $method - * @param array $args + * @param array $args * * @return mixed */ @@ -379,7 +379,9 @@ public function __construct(XoopsDatabase $db) * * @param int $id itemid of the user * - * @return mixed reference to the {@link PublisherCategory} object, FALSE if failed + * @param null $fields + * @return mixed reference to the PublisherCategory object, FALSE if failed + * object, FALSE if failed */ public function get($id = null, $fields = null) { @@ -396,9 +398,8 @@ public function get($id = null, $fields = null) /** * insert a new category in the database * - * @param object $category reference to the {@link PublisherCategory} object - * @param bool $force - * + * @param object|XoopsObject $category reference to the {@link PublisherCategory} + * @param bool $force * @return bool FALSE if failed, TRUE if already present and unchanged or successful */ public function insert(XoopsObject $category, $force = false) //insert(&$category, $force = false) @@ -426,7 +427,7 @@ public function insert(XoopsObject $category, $force = false) //insert(&$categor * delete a category from the database * * @param XoopsObject $category reference to the category to delete - * @param bool $force + * @param bool $force * * @return bool FALSE if failed. */ @@ -458,14 +459,15 @@ public function delete(XoopsObject $category, $force = false) //delete(&$categor * retrieve categories from the database * * @param CriteriaElement $criteria {@link CriteriaElement} conditions to be met - * @param bool $idAsKey use the categoryid as key for the array? + * @param bool $idAsKey use the categoryid as key for the array? * - * @return array array of {@link XoopsItem} objects + * @param bool $as_object + * @return array array of XoopsItem objects */ public function &getObjects(CriteriaElement $criteria = null, $idAsKey = false, $as_object = true) //&getObjects($criteria = null, $idAsKey = false) { $ret = array(); - $theObjects = parent::getObjects($criteria, true); + $theObjects =& parent::getObjects($criteria, true); foreach ($theObjects as $theObject) { if (!$idAsKey) { $ret[] = $theObject; @@ -479,12 +481,12 @@ public function &getObjects(CriteriaElement $criteria = null, $idAsKey = false, } /** - * @param int $limit - * @param int $start - * @param int $parentid + * @param int $limit + * @param int $start + * @param int $parentid * @param string $sort * @param string $order - * @param bool $idAsKey + * @param bool $idAsKey * * @return array */ @@ -690,11 +692,13 @@ public function getSubCats($categories) * * @param CriteriaElement $criteria {@link CriteriaElement} * + * @param bool $force + * @param bool $asObject * @return bool FALSE if deletion failed */ public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) //deleteAll($criteria = null) { - $categories = $this->getObjects($criteria); + $categories =& $this->getObjects($criteria); foreach ($categories as $category) { if (!$this->delete($category)) { return false; @@ -715,7 +719,7 @@ public function publishedItemsCount($catId = 0) } /** - * @param int $catId + * @param int $catId * @param string $status * * @return mixed diff --git a/class/file.php b/class/file.php index b2a6dd80..c9234157 100644 --- a/class/file.php +++ b/class/file.php @@ -65,7 +65,7 @@ public function __construct($id = null) /** * @param string $method - * @param array $args + * @param array $args * * @return mixed */ @@ -78,8 +78,8 @@ public function __call($method, $args) /** * @param string $postField - * @param array $allowedMimetypes - * @param array $errors + * @param array $allowedMimetypes + * @param array $errors * * @return bool */ @@ -110,8 +110,8 @@ public function checkUpload($postField, $allowedMimetypes = array(), &$errors) /** * @param string $postField - * @param array $allowedMimetypes - * @param array $errors + * @param array $allowedMimetypes + * @param array $errors * * @return bool */ @@ -153,8 +153,8 @@ public function storeUpload($postField, $allowedMimetypes = array(), &$errors) /** * @param null|array $allowedMimetypes - * @param bool $force - * @param bool $doupload + * @param bool $force + * @param bool $doupload * * @return bool */ @@ -162,7 +162,7 @@ public function store($allowedMimetypes = null, $force = true, $doupload = true) { if ($this->isNew()) { $errors = array(); - $ret = true; + $ret = true; if ($doupload) { $ret = $this->storeUpload('item_upload_file', $allowedMimetypes, $errors); } @@ -302,12 +302,12 @@ public function __construct(XoopsDatabase $db) /** * delete a file from the database * - * @param object $file reference to the file to delete - * @param bool $force + * @param XoopsObject $file reference to the file to delete + * @param bool $force * * @return bool FALSE if failed. */ - public function delete(&$file, $force = false) + public function delete(XoopsObject $file, $force = false) //delete(&$file, $force = false) { $ret = false; // Delete the actual file @@ -330,7 +330,7 @@ public function deleteItemFiles(&$itemObj) if (strtolower(get_class($itemObj)) !== 'publisheritem') { return false; } - $files =& $this->getAllFiles($itemObj->itemid()); + $files = $this->getAllFiles($itemObj->itemid()); $result = true; foreach ($files as $file) { if (!$this->delete($file)) { @@ -344,17 +344,17 @@ public function deleteItemFiles(&$itemObj) /** * retrieve all files * - * @param int $itemid - * @param int $status - * @param int $limit - * @param int $start + * @param int $itemid + * @param int $status + * @param int $limit + * @param int $start * @param string $sort * @param string $order - * @param array $category + * @param array $category * * @return array array of {@link PublisherFile} objects */ - public function &getAllFiles($itemid = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = array()) + public function getAllFiles($itemid = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = array()) { global $xoopsDB; $files = array(); diff --git a/class/form/category.php b/class/form/category.php index ea549c4f..5ed4d46a 100644 --- a/class/form/category.php +++ b/class/form/category.php @@ -84,7 +84,7 @@ public function createElements() // EDITOR $groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS; - $gpermHandler =& $this->publisher->getHandler('groupperm'); + $gpermHandler = $this->publisher->getHandler('groupperm'); $moduleId = $this->publisher->getModule()->mid(); $allowedEditors = publisherGetEditors($gpermHandler->getItemIds('editors', $groups, $moduleId)); $nohtml = false; diff --git a/class/form/item.php b/class/form/item.php index 831fff8e..a364f34d 100644 --- a/class/form/item.php +++ b/class/form/item.php @@ -163,7 +163,7 @@ public function createElements($obj) // TAGS if (xoops_isActiveModule('tag') && $this->isGranted(PublisherConstants::PUBLISHER_ITEM_TAG)) { include_once $GLOBALS['xoops']->path('modules/tag/include/formtag.php'); - $textTags = new XoopsFormTag('item_tag', 60, 255, $obj->getVar('item_tag', 'e'), 0); + $textTags = new TagFormTag('item_tag', 60, 255, $obj->getVar('item_tag', 'e'), 0); $this->addElement($textTags); } @@ -285,9 +285,9 @@ public function createElements($obj) // STATUS if ($this->isGranted(PublisherConstants::PUBLISHER_STATUS)) { $options = array( + PublisherConstants::PUBLISHER_STATUS_SUBMITTED => _CO_PUBLISHER_SUBMITTED, PublisherConstants::PUBLISHER_STATUS_PUBLISHED => _CO_PUBLISHER_PUBLISHED, PublisherConstants::PUBLISHER_STATUS_OFFLINE => _CO_PUBLISHER_OFFLINE, - PublisherConstants::PUBLISHER_STATUS_SUBMITTED => _CO_PUBLISHER_SUBMITTED, PublisherConstants::PUBLISHER_STATUS_REJECTED => _CO_PUBLISHER_REJECTED); $statusSelect = new XoopsFormSelect(_CO_PUBLISHER_STATUS, 'status', $obj->getVar('status')); $statusSelect->addOptionArray($options); @@ -515,8 +515,8 @@ public function createElements($obj) $table .= ''; foreach ($filesObj as $fileObj) { - $modify = ""; - $delete = ""; + $modify = ""; + $delete = ""; $not_visible = ''; if ($fileObj->status() == 0) { $not_visible = ""; diff --git a/class/groupperm.php b/class/groupperm.php index 95375a3a..bdd5f3db 100644 --- a/class/groupperm.php +++ b/class/groupperm.php @@ -34,14 +34,16 @@ class PublisherGroupPermHandler extends XoopsGroupPermHandler /** * Check permission * - * @param string $gpermName Name of permission - * @param int $gpermItemId ID of an item - * @param int /array $gpermGroupId A group ID or an array of group IDs - * @param int $gpermModId ID of a module + * @param string $gpermName Name of permission + * @param int $gpermItemId ID of an item + * @param $gpermGroupId + * @param int $gpermModId ID of a module * + * @param bool $trueifadmin * @return bool TRUE if permission is enabled + * @internal param $int /array $gpermGroupId A group ID or an array of group IDs */ - public function checkRight($gpermName, $gpermItemId, $gpermGroupId, $gpermModId = 1) + public function checkRight($gpermName, $gpermItemId, $gpermGroupId, $gpermModId = 1, $trueifadmin = true) //checkRight($gpermName, $gpermItemId, $gpermGroupId, $gpermModId = 1) { $criteria = new CriteriaCompo(new Criteria('gperm_modid', $gpermModId)); $criteria->add(new Criteria('gperm_name', $gpermName)); diff --git a/class/item.php b/class/item.php index 10a8edfd..c1bdf646 100644 --- a/class/item.php +++ b/class/item.php @@ -88,7 +88,7 @@ public function __construct($id = null) /** * @param string $method - * @param array $args + * @param array $args * * @return mixed */ @@ -112,7 +112,7 @@ public function getCategory() } /** - * @param int $maxLength + * @param int $maxLength * @param string $format * * @return mixed|string @@ -132,7 +132,7 @@ public function getTitle($maxLength = 0, $format = 'S') } /** - * @param int $maxLength + * @param int $maxLength * @param string $format * * @return mixed|string @@ -152,7 +152,7 @@ public function getSubtitle($maxLength = 0, $format = 'S') } /** - * @param int $maxLength + * @param int $maxLength * @param string $format * @param string $stripTags * @@ -177,7 +177,7 @@ public function getSummary($maxLength = 0, $format = 'S', $stripTags = '') } /** - * @param int $maxLength + * @param int $maxLength * @param bool $fullSummary * * @return mixed|string @@ -231,7 +231,7 @@ public function wrapPage($fileName) /** * This method returns the body to be displayed. Not to be used for editing * - * @param int $maxLength + * @param int $maxLength * @param string $format * @param string $stripTags * @@ -564,7 +564,7 @@ public function getItemUrl() /** * @param bool $class - * @param int $maxsize + * @param int $maxsize * * @return string */ @@ -625,7 +625,7 @@ public function plainMaintext($body = null) } /** - * @param int $itemPageId + * @param int $itemPageId * @param null|string $body * * @return string @@ -696,9 +696,9 @@ public function getImages() /** * @param string $display - * @param int $maxCharTitle - * @param int $maxCharSummary - * @param bool $fullSummary + * @param int $maxCharTitle + * @param int $maxCharSummary + * @param bool $fullSummary * * @return array */ @@ -780,7 +780,7 @@ public function toArrayFull($item) /** * @param array $item - * @param int $itemPageId + * @param int $itemPageId * * @return array */ @@ -848,7 +848,7 @@ public function getOtherImages($item = array()) } /** - * @param string $content + * @param string $content * @param string|array $keywords * * @return Text @@ -916,7 +916,7 @@ protected function convertForJapanese($str) /** * @param string $title - * @param bool $checkperm + * @param bool $checkperm * * @return PublisherItemForm */ @@ -1095,7 +1095,7 @@ public function __construct(XoopsDatabase $db) * * @return object */ - public function &create($isNew = true) + public function create($isNew = true) { $obj = parent::create($isNew); if ($isNew) { @@ -1110,7 +1110,9 @@ public function &create($isNew = true) * * @param int $id itemid of the user * - * @return mixed reference to the {@link PublisherItem} object, FALSE if failed + * @param null $fields + * @return mixed reference to the PublisherItem object, FALSE if failed + * object, FALSE if failed */ public function get($id = null, $fields = null) { @@ -1126,7 +1128,7 @@ public function get($id = null, $fields = null) * insert a new item in the database * * @param XoopsObject $item reference to the {@link PublisherItem} object - * @param bool $force + * @param bool $force * * @return bool FALSE if failed, TRUE if already present and unchanged or successful */ @@ -1162,7 +1164,7 @@ public function insert(XoopsObject $item, $force = false) //insert(&$item, $for * delete an item from the database * * @param XoopsObject $item reference to the ITEM to delete - * @param bool $force + * @param bool $force * * @return bool FALSE if failed. */ @@ -1190,10 +1192,11 @@ public function delete(XoopsObject $item, $force = false) * retrieve items from the database * * @param CriteriaElement $criteria {@link CriteriaElement} conditions to be met - * @param string $idKey what shall we use as array key ? none, itemid, categoryid + * @param bool|string $idKey what shall we use as array key ? none, itemid, categoryid + * @param bool $as_object * @param string $notNullFields - * - * @return array array of {@link PublisherItem} objects + * @return array array of PublisherItem objects + * objects */ public function &getObjects(CriteriaElement $criteria = null, $idKey = false, $as_object = true, $notNullFields = '') //&getObjects($criteria = null, $idKey = 'none', $notNullFields = '') { @@ -1277,9 +1280,9 @@ public function getCount(CriteriaElement $criteria = null, $notNullFields = '') } /** - * @param int $categoryid - * @param string $status - * @param string $notNullFields + * @param int $categoryid + * @param string $status + * @param string $notNullFields * @param $criteriaPermissions * @return CriteriaCompo */ @@ -1377,13 +1380,13 @@ public function getItemsCount($categoryid = -1, $status = '', $notNullFields = ' } /** - * @param int $limit - * @param int $start - * @param int $categoryid + * @param int $limit + * @param int $start + * @param int $categoryid * @param string $sort * @param string $order * @param string $notNullFields - * @param bool $asObject + * @param bool $asObject * @param string $idKey * * @return array @@ -1433,13 +1436,13 @@ public function getNextPublished($obj) } /** - * @param int $limit - * @param int $start - * @param int $categoryid + * @param int $limit + * @param int $start + * @param int $categoryid * @param string $sort * @param string $order * @param string $notNullFields - * @param bool $asObject + * @param bool $asObject * @param string $idKey * * @return array @@ -1450,13 +1453,13 @@ public function getAllSubmitted($limit = 0, $start = 0, $categoryid = -1, $sort } /** - * @param int $limit - * @param int $start - * @param int $categoryid + * @param int $limit + * @param int $start + * @param int $categoryid * @param string $sort * @param string $order * @param string $notNullFields - * @param bool $asObject + * @param bool $asObject * @param string $idKey * * @return array @@ -1467,13 +1470,13 @@ public function getAllOffline($limit = 0, $start = 0, $categoryid = -1, $sort = } /** - * @param int $limit - * @param int $start - * @param int $categoryid + * @param int $limit + * @param int $start + * @param int $categoryid * @param string $sort * @param string $order * @param string $notNullFields - * @param bool $asObject + * @param bool $asObject * @param string $idKey * * @return array @@ -1484,15 +1487,15 @@ public function getAllRejected($limit = 0, $start = 0, $categoryid = -1, $sort = } /** - * @param int $limit - * @param int $start + * @param int $limit + * @param int $start * @param string $status - * @param int $categoryid + * @param int $categoryid * @param string $sort * @param string $order * @param string $notNullFields - * @param bool $asObject - * @param null $otherCriteria + * @param bool $asObject + * @param null $otherCriteria * @param string $idKey * @return array * @internal param bool $asObject @@ -1554,7 +1557,7 @@ public function getItems($limit = 0, $start = 0, $status = '', $categoryid = -1, /** * @param string $field * @param string $status - * @param int $categoryId + * @param int $categoryId * * @return bool */ @@ -1582,6 +1585,8 @@ public function getRandomItem($field = '', $status = '', $categoryId = -1) * * @param CriteriaElement $criteria {@link CriteriaElement} * + * @param bool $force + * @param bool $asObject * @return bool FALSE if deletion failed */ public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) //deleteAll($criteria = null) @@ -1612,7 +1617,7 @@ public function updateCounter($itemid) /** * @param string|array $notNullFields - * @param bool $withAnd + * @param bool $withAnd * * @return string */ @@ -1634,13 +1639,13 @@ public function notNullFieldClause($notNullFields = '', $withAnd = false) } /** - * @param array $queryarray + * @param array $queryarray * @param string $andor - * @param int $limit - * @param int $offset - * @param int $userid - * @param array $categories - * @param int $sortby + * @param int $limit + * @param int $offset + * @param int $userid + * @param array $categories + * @param int $sortby * @param string $searchin * @param string $extra * @@ -1822,9 +1827,9 @@ public function countArticlesByCat($parentid, $catsCount, $spaces = '') } /** - * @param int $catId + * @param int $catId * @param array $status - * @param bool $inSubCat + * @param bool $inSubCat * * @return array */ diff --git a/class/mimetype.php b/class/mimetype.php index 6fd8b78f..dfaa54a1 100644 --- a/class/mimetype.php +++ b/class/mimetype.php @@ -68,7 +68,8 @@ public function init(XoopsDatabase $db) /** * create a new object * - * @return object {@link publisherBaseObject} + * @param bool $isNew + * @return object publisherBaseObject * @access public */ public function create($isNew = true) @@ -81,6 +82,7 @@ public function create($isNew = true) * * @param int $id ID * + * @param null $fields * @return mixed object if id exists, false if not * @access public */ @@ -106,9 +108,11 @@ public function get($id = null, $fields = null) /** * retrieve objects from the database * - * @param object $criteria {@link CriteriaElement} conditions to be met - * @param bool $idAsKey Should the department ID be used as array key + * @param CriteriaElement|object $criteria {@link CriteriaElement} + * conditions to be met + * @param bool $idAsKey Should the department ID be used as array key * + * @param bool $asObject * @return array array of objects * @access public */ @@ -143,7 +147,7 @@ public function &getObjects(CriteriaElement $criteria = null, $idAsKey = false, /** * @param XoopsObject $obj - * @param bool $force + * @param bool $force * * @return bool|void */ @@ -235,8 +239,8 @@ public function getCount(CriteriaElement $criteria = null) //getCount($criteria /** * delete object based on id * - * @param XoopsObject $obj {@link XoopsObject} to delete - * @param bool $force override XOOPS delete protection + * @param XoopsObject $obj {@link XoopsObject} to delete + * @param bool $force override XOOPS delete protection * * @return bool deletion successful? * @access public @@ -262,8 +266,10 @@ public function delete(XoopsObject $obj, $force = false) //delete(&$obj, $force /** * delete department matching a set of conditions * - * @param object $criteria {@link CriteriaElement} + * @param CriteriaElement|object $criteria {@link CriteriaElement} * + * @param bool $force + * @param bool $asObject * @return bool FALSE if deletion failed * @access public */ @@ -285,8 +291,9 @@ public function deleteAll(CriteriaElement $criteria = null, $force = true, $asOb * * @param string $fieldname * @param string $fieldvalue - * @param object $criteria {@link CriteriaElement} + * @param CriteriaElement|object $criteria {@link CriteriaElement} * + * @param bool $force * @return bool FALSE if update failed * @access public */ @@ -411,7 +418,8 @@ public function __construct(XoopsDatabase $db) * * @param int $id ID of mimetype * - * @return object {@link PublisherMimetype} + * @param null $fields + * @return object PublisherMimetype * @access public */ public function get($id = null, $fields = null) @@ -436,9 +444,13 @@ public function get($id = null, $fields = null) /** * retrieve objects from the database * - * @param object $criteria {@link CriteriaElement} conditions to be met + * @param CriteriaElement|object $criteria {@link CriteriaElement} + * conditions to be met * - * @return array array of {@link PublisherMimetype} objects + * @param bool $idAsKey + * @param bool $asObject + * @return array array of PublisherMimetype objects + * objects * @access public */ public function &getObjects(CriteriaElement $criteria = null, $idAsKey = false, $asObject = true) //&getObjects($criteria = null) @@ -549,7 +561,7 @@ public function getArrayByType() * Create a "select" SQL query * * @param null|object $criteria {@link CriteriaElement} to match - * @param bool $join + * @param bool $join * * @return string string SQL query * @access private diff --git a/class/themetabform.php b/class/themetabform.php index 86e177ba..bf3d7f72 100644 --- a/class/themetabform.php +++ b/class/themetabform.php @@ -97,7 +97,7 @@ class PublisherThemeTabForm extends XoopsForm * @param string $name * @param string $action * @param string $method - * @param bool $addtoken + * @param bool $addtoken * @param string $summary */ public function __construct($title, $name, $action, $method = 'post', $addtoken = false, $summary = '') @@ -147,8 +147,8 @@ public function assign(XoopsTpl $tpl) $elements[$i]['tab'] = $tab; continue; } - $eleName = $ele->getName(); - $eleDescription = $ele->getDescription(); + $eleName = $ele->getName(); + $eleDescription = $ele->getDescription(); $n = $eleName ?: $i; $elements[$n]['name'] = $eleName; $elements[$n]['caption'] = $ele->getCaption(); @@ -189,7 +189,7 @@ public function startTab($tabText) */ public function endTabs() { - $temp = $this->endFormTabs(); + $temp = $this->endFormTabs(); $this->addElement($temp); } @@ -203,7 +203,7 @@ public function endTabs() public function startFormTabs($tabText) { $this->formTabs[] = $tabText; - $ret = 'addTab'; + $ret = 'addTab'; return $ret; } @@ -282,7 +282,7 @@ public function getMethod() * Add an element to the form * * @param object $formElement reference to a {@link XoopsFormElement} - * @param bool $required is this a "required" element? + * @param bool $required is this a "required" element? */ public function addElement($formElement, $required = false) { @@ -351,7 +351,7 @@ public function getElementNames() */ public function &getElementByName($name) { - $elements = $this->getElements(true); + $elements =& $this->getElements(true); $count = count($elements); for ($i = 0; $i < $count; ++$i) { if ($name == $elements[$i]->getName(false)) { @@ -400,8 +400,8 @@ public function setElementValues($values) /** * Gets the "value" attribute of a form element * - * @param string $name the "name" attribute of a form element - * @param bool $encode To sanitizer the text? + * @param string $name the "name" attribute of a form element + * @param bool $encode To sanitizer the text? * * @return string the "value" attribute assigned to a form element, null if not set */ @@ -554,7 +554,7 @@ public function renderValidationJS($withtags = true) } $formname = $this->getName(); $js .= "function xoopsFormValidate_{$formname}() { var myform = window.document.{$formname}; "; - $elements = $this->getElements(true); + $elements =& $this->getElements(true); foreach ($elements as $elt) { if (method_exists($elt, 'renderValidationJS')) { $js .= $elt->renderValidationJS(); diff --git a/docs/changelog.txt b/docs/changelog.txt index f25080fc..b1197b8b 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,3 +1,8 @@ +