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 "
\n" - ."
\n" - ." XOOPS\n" - ."
\n" - .' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" - .'
'; +echo "
\n" . "
\n" . " XOOPS\n" . "
\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '
'; 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 = "" . _CO_PUBLISHER_EDITFILE . ""; - $delete = "" . _CO_PUBLISHER_DELETEFILE . ""; + $modify = "" . _CO_PUBLISHER_EDITFILE . ""; + $delete = "" . _CO_PUBLISHER_DELETEFILE . ""; $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 @@ +
1.03 Beta 2 (2016-03-20)
+- fixed: bugs on submit (mamba) +- replaced XoopsFormTag with TagFormTag (mamba) +- adjusted TCPDF location to /class/libraries/vendor/tecnickcom/tcpdf/ for Composer (mamba) +
1.03 Beta 1 (2016-03-19)
- fixed: deleting item image (ggoffy) - fixed: calling getSummary & getBody (bleekk) diff --git a/include/functions.php b/include/functions.php index 648064f0..a59e85fb 100644 --- a/include/functions.php +++ b/include/functions.php @@ -73,8 +73,8 @@ function publisherGetOrderBy($sort) /** * @credits Thanks to Mithandir * @param string $str - * @param int $start - * @param int $length + * @param int $start + * @param int $length * @param string $trimMarker * @return string */ @@ -158,7 +158,7 @@ function publisherGetAllowedImagesTypes() } /** - * @param bool $withLink + * @param bool $withLink * @return string */ function publisherModuleHome($withLink = true) @@ -221,8 +221,8 @@ function publisherCopyr($source, $dest) /** * .* @credits Thanks to the NewBB2 Development Team - * @param string $item - * @param bool $getStatus + * @param string $item + * @param bool $getStatus * @return bool|int|string */ function &publisherGetPathStatus($item, $getStatus = false) @@ -288,7 +288,7 @@ function publisherMkdir($target) /** * @credits Thanks to the NewBB2 Development Team * @param string $target - * @param int $mode + * @param int $mode * @return bool */ function publisherChmod($target, $mode = 0777) @@ -297,8 +297,8 @@ function publisherChmod($target, $mode = 0777) } /** - * @param bool $hasPath - * @param bool $item + * @param bool $hasPath + * @param bool $item * @return string */ function publisherGetUploadDir($hasPath = true, $item = false) @@ -322,7 +322,7 @@ function publisherGetUploadDir($hasPath = true, $item = false) /** * @param string $item - * @param bool $hasPath + * @param bool $hasPath * @return string */ function publisherGetImageDir($item = '', $hasPath = true) @@ -337,7 +337,7 @@ function publisherGetImageDir($item = '', $hasPath = true) } /** - * @param array $errors + * @param array $errors * @return string */ function publisherFormatErrors($errors = array()) @@ -402,9 +402,9 @@ function publisherUserIsModerator($itemObj) /** * Saves permissions for the selected category * - * @param array $groups : group with granted permission + * @param array $groups : group with granted permission * @param integer $categoryId : categoryid on which we are setting permissions - * @param string $permName : name of the permission + * @param string $permName : name of the permission * @return boolean : TRUE if the no errors occured */ function publisherSaveCategoryPermissions($groups, $categoryId, $permName) @@ -433,7 +433,7 @@ function publisherSaveCategoryPermissions($groups, $categoryId, $permName) * @param string $iconname * @param string $tabletitle * @param string $tabledsc - * @param bool $open + * @param bool $open * @return void */ function publisherOpenCollapsableBar($tablename = '', $iconname = '', $tabletitle = '', $tabledsc = '', $open = true) @@ -482,7 +482,7 @@ function publisherCloseCollapsableBar($name, $icon) /** * @param string $name * @param string $value - * @param int $time + * @param int $time * @return void */ function publisherSetCookieVar($name, $value, $time = 0) @@ -549,9 +549,9 @@ function publisherGetCurrentPage() /** * @param null|PublisherCategory $categoryObj - * @param int $selectedid - * @param int $level - * @param string $ret + * @param int $selectedid + * @param int $level + * @param string $ret * @return string */ function publisherAddCategoryOption(PublisherCategory $categoryObj, $selectedid = 0, $level = 0, $ret = '') @@ -583,9 +583,9 @@ function publisherAddCategoryOption(PublisherCategory $categoryObj, $selectedid } /** - * @param int $selectedid - * @param int $parentcategory - * @param bool $allCatOption + * @param int $selectedid + * @param int $parentcategory + * @param bool $allCatOption * @param string $selectname * @return string */ @@ -618,9 +618,9 @@ function publisherCreateCategorySelect($selectedid = 0, $parentcategory = 0, $al } /** - * @param int $selectedid - * @param int $parentcategory - * @param bool $allCatOption + * @param int $selectedid + * @param int $parentcategory + * @param bool $allCatOption * @return string */ function publisherCreateCategoryOptions($selectedid = 0, $parentcategory = 0, $allCatOption = true) @@ -645,7 +645,7 @@ function publisherCreateCategoryOptions($selectedid = 0, $parentcategory = 0, $a } /** - * @param array $errArray + * @param array $errArray * @param string $reseturl * @return void */ @@ -679,8 +679,8 @@ function publisherRenderErrors(&$errArray, $reseturl = '') * Generate publisher URL * * @param string $page - * @param array $vars - * @param bool $encodeAmp + * @param array $vars + * @param bool $encodeAmp * @return string * * @credit : xHelp module, developped by 3Dev @@ -720,8 +720,8 @@ function publisherTellAFriend($subject = '') } /** - * @param bool $another - * @param bool $withRedirect + * @param bool $another + * @param bool $withRedirect * @param $itemObj * @return bool|string */ @@ -885,7 +885,7 @@ function publisherCloseTags($string) } /** - * @param int $itemId + * @param int $itemId * @return string */ function publisherRatingBar($itemId) @@ -995,7 +995,7 @@ function publisherGetEditors($allowedEditors = null) /** * @param string $string - * @param int $length + * @param int $length * @return int */ function publisherStringToInt($string = '', $length = 5) @@ -1005,7 +1005,7 @@ function publisherStringToInt($string = '', $length = 5) for ($i = 0; $i < $length; ++$i) { $final .= (int)$string[$i]; } - return (int)($final); + return (int)$final; } /** diff --git a/include/plugin.tag.php b/include/plugin.tag.php index 4d262bf9..3cccb58c 100644 --- a/include/plugin.tag.php +++ b/include/plugin.tag.php @@ -50,8 +50,7 @@ function publisher_tag_iteminfo(&$items) 'link' => "item.php?itemid={$item_id}", 'time' => $item_obj->getVar('datesub'), 'tags' => tag_parse_tag($item_obj->getVar('item_tag', 'n')), // optional - 'content' => '' - ); + 'content' => ''); } } unset($items_obj); diff --git a/item.php b/item.php index 9f3d9798..1cd27c94 100644 --- a/item.php +++ b/item.php @@ -159,11 +159,10 @@ $itemPageId = 0; } include_once $GLOBALS['xoops']->path('class/pagenav.php'); -// $pagenav = new XoopsPageNav($itemObj->pagescount(), 1, $itemPageId, 'page', 'itemid=' . $itemObj->itemId()); + // $pagenav = new XoopsPageNav($itemObj->pagescount(), 1, $itemPageId, 'page', 'itemid=' . $itemObj->itemId()); $pagenav = new XoopsPageNav($itemObj->pagescount(), 1, $itemPageId, 'page', 'itemid=' . $itemObj->itemid()); //SMEDrieben changed ->itemId to ->itemid - $xoopsTpl->assign('pagenav', $pagenav->renderNav()); } diff --git a/language/english/common.php b/language/english/common.php index 854e5d88..9c16591a 100644 --- a/language/english/common.php +++ b/language/english/common.php @@ -20,14 +20,14 @@ define('_CO_PUBLISHER_ITEM_META_KEYWORDS_DSC', 'In order to help Search Engines, you can customize the keywords you would like to use for this article. If you leave this field empty when creating an article, it will automatically be populated with words from the Summary field of this article.'); define('_CO_PUBLISHER_ITEM_SHORT_URL', 'Short URL'); define('_CO_PUBLISHER_ITEM_SHORT_URL_DSC', 'When using the SEO features of this module, you can specify a Short URL for this article. This field is optional.'); -define('_CO_PUBLISHER_OFFLINE', 'Offline'); //define('_CO_PUBLISHER_PERMISSIONS_ITEM', 'Permissions'); //define('_CO_PUBLISHER_PERMISSIONS_ITEM_DSC', 'Groups that will have permissions to see this item.'); +define('_CO_PUBLISHER_SUBMITTED', 'Submitted'); define('_CO_PUBLISHER_PUBLISHED', 'Published'); +define('_CO_PUBLISHER_OFFLINE', 'Offline'); define('_CO_PUBLISHER_REJECTED', 'Rejected'); define('_CO_PUBLISHER_STATUS', 'Status'); define('_CO_PUBLISHER_STATUS_DSC', 'Select the status of this article'); -define('_CO_PUBLISHER_SUBMITTED', 'Submitted'); define('_CO_PUBLISHER_UID', 'Poster name'); define('_CO_PUBLISHER_UID_DSC', 'Select the name of the poster'); define('_CO_PUBLISHER_WEIGHT', 'Weight'); diff --git a/makepdf.php b/makepdf.php index 2846230d..029b18fa 100644 --- a/makepdf.php +++ b/makepdf.php @@ -12,9 +12,17 @@ if ($itemid == 0) { redirect_header('javascript:history.go(-1)', 1, _MD_PUBLISHER_NOITEMSELECTED); } -if (!is_file(XOOPS_PATH . '/vendor/tcpdf/tcpdf.php')) { - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/viewtopic.php?topic_id=' . $itemid, 3, 'TCPF for Xoops not installed in ./xoops_lib/vendor/'); + +//2.5.7 +//if (!is_file(XOOPS_PATH . '/vendor/tcpdf/tcpdf.php')) { +// redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/viewtopic.php?topic_id=' . $itemid, 3, 'TCPF for Xoops not installed in ./xoops_lib/vendor/'); +//} + +//2.5.8 +if (!is_file(XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')) { + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/viewtopic.php?topic_id=' . $itemid, 3, 'TCPF for XOOPS not installed in ./class/libraries/vendor/tecnickcom/tcpdf/'); } + // Creating the item object for the selected item $itemObj = $publisher->getHandler('item')->get($itemid); @@ -55,7 +63,12 @@ 'unit' => 'mm', 'rtl' => false //true if right to left ); -require_once(XOOPS_PATH . '/vendor/tcpdf/tcpdf.php'); +//2.5.7 +//require_once(XOOPS_PATH . '/vendor/tcpdf/tcpdf.php'); + +//2.5.8 +require_once(XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php'); + $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, _CHARSET, false); @@ -91,8 +104,14 @@ $pdf->setHeaderMargin(PDF_MARGIN_HEADER); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set image scale factor -$pdf->setHeaderFont(array(PDF_FONT_NAME_SUB, '', PDF_FONT_SIZE_SUB)); -$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); +//2.5.7 +//$pdf->setHeaderFont(array(PDF_FONT_NAME_SUB, '', PDF_FONT_SIZE_SUB)); +//$pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +//2.5.8 +$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + $pdf->setFooterData($tc = array(0, 64, 0), $lc = array(0, 64, 128)); //initialize document diff --git a/submit.php b/submit.php index 3d2507f6..3fde37a7 100644 --- a/submit.php +++ b/submit.php @@ -117,7 +117,7 @@ } //unset($element); -$itemUploadFile = XoopsRequest::getString('item_upload_file', '', 'FILES'); +$itemUploadFile = XoopsRequest::getArray('item_upload_file', array(), 'FILES'); //stripcslashes switch ($op) { @@ -145,7 +145,7 @@ $xoopsOption['template_main'] = 'publisher_submit.tpl'; include_once $GLOBALS['xoops']->path('header.php'); $xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js'); - $xoTheme->addScript(PUBLISHER_URL . '/assets/js/publisher.js'); + $xoTheme->addScript(PUBLISHER_URL . '/assets/js/publisher.js'); include_once PUBLISHER_ROOT_PATH . '/footer.php'; $categoryObj = $publisher->getHandler('category')->get(XoopsRequest::getInt('categoryid', 0, 'POST')); diff --git a/xoops_version.php b/xoops_version.php index f8a1ed8b..1bf95141 100644 --- a/xoops_version.php +++ b/xoops_version.php @@ -31,7 +31,7 @@ $modversion = array( 'name' => _MI_PUBLISHER_MD_NAME, 'version' => '1.03', - 'module_status' => 'Beta 1', + 'module_status' => 'Beta 2', 'release_date' => '2016/03/19', 'description' => _MI_PUBLISHER_MD_DESC, 'author' => 'Trabis (www.Xuups.com)', @@ -379,8 +379,8 @@ // group header $modversion['config'][] = array( 'name' => 'extrasystems_configs', - 'title' => ' _MI_PUBLISHER_CONFCAT_INDEXCAT', - 'description' => ' _MI_PUBLISHER_CONFCAT_INDEXCAT_DSC', + 'title' => '_MI_PUBLISHER_CONFCAT_INDEXCAT', + 'description' => '_MI_PUBLISHER_CONFCAT_INDEXCAT_DSC', 'formtype' => 'line_break', 'valuetype' => 'textbox', 'default' => 'even', @@ -900,9 +900,9 @@ 'formtype' => 'select', 'valuetype' => 'text', 'options' => array( - _MI_PUBLISHER_PUBLISHED => PublisherConstants::PUBLISHER_STATUS_PUBLISHED, - _MI_PUBLISHER_OFFLINE => PublisherConstants::PUBLISHER_STATUS_OFFLINE, _MI_PUBLISHER_SUBMITTED => PublisherConstants::PUBLISHER_STATUS_SUBMITTED, + _MI_PUBLISHER_PUBLISHED => PublisherConstants::PUBLISHER_STATUS_PUBLISHED, + _MI_PUBLISHER_OFFLINE => PublisherConstants::PUBLISHER_STATUS_OFFLINE, _MI_PUBLISHER_REJECTED => PublisherConstants::PUBLISHER_STATUS_REJECTED), 'default' => PublisherConstants::PUBLISHER_STATUS_SUBMITTED, 'category' => 'submit');