From: <tr...@us...> - 2012-12-01 22:36:48
|
Revision: 10297 http://sourceforge.net/p/xoops/svn/10297 Author: trabis Date: 2012-12-01 22:36:45 +0000 (Sat, 01 Dec 2012) Log Message: ----------- publisher - updating permissions and category for performance Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/admin/category.php XoopsModules/publisher/trunk/publisher/archive.php XoopsModules/publisher/trunk/publisher/category.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/class/permission.php XoopsModules/publisher/trunk/publisher/include/common.php Modified: XoopsModules/publisher/trunk/publisher/admin/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/category.php 2012-12-01 15:55:26 UTC (rev 10296) +++ XoopsModules/publisher/trunk/publisher/admin/category.php 2012-12-01 22:36:45 UTC (rev 10297) @@ -109,25 +109,8 @@ $categoryObj->setVar('weight', isset($_POST['weight']) ? intval($_POST['weight']) : 1); // Groups and permissions - if (isset($_POST['groups_read'])) { - $categoryObj->setGroups_read($_POST['groups_read']); - } else { - $categoryObj->setGroups_read(); - } $grpread = isset($_POST['groups_read']) ? $_POST['groups_read'] : array(); - - if (isset($_POST['groups_submit'])) { - $categoryObj->setGroups_submit($_POST['groups_submit']); - } else { - $categoryObj->setGroups_submit(); - } $grpsubmit = isset($_POST['groups_submit']) ? $_POST['groups_submit'] : array(); - - if (isset($_POST['groups_moderation'])) { - $categoryObj->setGroups_moderation($_POST['groups_moderation']); - } else { - $categoryObj->setGroups_moderation(); - } $grpmoderation = isset($_POST['groups_moderation']) ? $_POST['groups_moderation'] : array(); @@ -167,9 +150,9 @@ exit; } // TODO : put this function in the category class - publisher_saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($categoryObj->getGroups_submit(), $categoryObj->categoryid(), 'item_submit'); - publisher_saveCategoryPermissions($categoryObj->getGroups_moderation(), $categoryObj->categoryid(), 'category_moderation'); + publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); + publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); + publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); //Added by fx2024 @@ -180,18 +163,15 @@ $categoryObj = $publisher->getHandler('category')->create(); $categoryObj->setVar('name', $_POST['scname'][$i]); $categoryObj->setVar('parentid', $parentCat); - $categoryObj->setGroups_read($grpread); - $categoryObj->setGroups_submit($grpsubmit); - $categoryObj->setGroups_moderation($grpmoderation); if (!$categoryObj->store()) { redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); exit; } // TODO : put this function in the category class - publisher_saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($categoryObj->getGroups_submit(), $categoryObj->categoryid(), 'item_submit'); - publisher_saveCategoryPermissions($categoryObj->getGroups_moderation(), $categoryObj->categoryid(), 'category_moderation'); + publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); + publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); + publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); } } //end of fx2024 code @@ -209,7 +189,6 @@ $categoryObj->setVar('name', $_POST['name']); $categoryObj->setVar('description', $_POST['description']); $categoryObj->setVar('weight', $_POST['weight']); - $categoryObj->setGroups_read(isset($_POST['groups_read']) ? $_POST['groups_read'] : array()); if (isset($parentCat)) { $categoryObj->setVar('parentid', $parentCat); } Modified: XoopsModules/publisher/trunk/publisher/archive.php =================================================================== --- XoopsModules/publisher/trunk/publisher/archive.php 2012-12-01 15:55:26 UTC (rev 10296) +++ XoopsModules/publisher/trunk/publisher/archive.php 2012-12-01 22:36:45 UTC (rev 10297) @@ -70,6 +70,7 @@ //Get all articles dates as an array to save memory $items = $publisher->getHandler('item')->getAll($criteria, array('datesub'), false); $itemsCount = count($items); + if (!($itemsCount > 0)) { redirect_header(XOOPS_URL, 2, _MD_PUBLISHER_NO_TOP_PERMISSIONS); exit; @@ -144,6 +145,7 @@ $criteria->add($critdatesub); $criteria->setSort('o.datesub'); $criteria->setOrder('DESC'); + $criteria->setLimit(3000); $storyarray = $itemhandler->getByLink($criteria); //Query Efficiency? $count = count($storyarray); Modified: XoopsModules/publisher/trunk/publisher/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/category.php 2012-12-01 15:55:26 UTC (rev 10296) +++ XoopsModules/publisher/trunk/publisher/category.php 2012-12-01 22:36:45 UTC (rev 10297) @@ -162,7 +162,7 @@ $category['total'] = $thiscategory_itemcount; if (count($itemsObj) > 0) { - $userids = array(); + /*$userids = array(); if ($itemsObj) { foreach ($itemsObj as $key => $thisitem) { $itemids[] = $thisitem->getVar('itemid'); @@ -170,7 +170,8 @@ } } $member_handler = xoops_gethandler('member'); - $users = $member_handler->getUsers(new Criteria('uid', "(" . implode(',', array_keys($userids)) . ")", "IN"), true); + //$users = $member_handler->getUsers(new Criteria('uid', "(" . implode(',', array_keys($userids)) . ")", "IN"), true); + */ // Adding the items of the selected category for ($i = 0; $i < $totalItemOnPage; $i++) { Modified: XoopsModules/publisher/trunk/publisher/class/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/category.php 2012-12-01 15:55:26 UTC (rev 10296) +++ XoopsModules/publisher/trunk/publisher/class/category.php 2012-12-01 22:36:45 UTC (rev 10297) @@ -32,21 +32,6 @@ /** * @var array */ - public $_groups_read = null; - - /** - * @var array - */ - public $_groups_submit = null; - - /** - * @var array - */ - public $_groups_moderation = null; - - /** - * @var array - */ public $_categoryPath = false; /** @@ -97,16 +82,6 @@ } /** - * Assigns permissions - */ - public function assignOtherProperties() - { - $this->_groups_read = $this->publisher->getHandler('permission')->getGrantedGroupsById('category_read', $this->categoryid()); - $this->_groups_submit = $this->publisher->getHandler('permission')->getGrantedGroupsById('item_submit', $this->categoryid()); - $this->_groups_moderation = $this->publisher->getHandler('permission')->getGrantedGroupsById('category_moderation', $this->categoryid()); - } - - /** * @return bool */ public function checkPermission() @@ -119,7 +94,7 @@ if (is_object($xoopsUser) && $xoopsUser->getVar('uid') == $this->moderator()) { return true; } - $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted = $this->publisher->getHandler('permission')->isGranted('category_read'); if (in_array($this->categoryid(), $categoriesGranted)) { $ret = true; } @@ -199,59 +174,26 @@ */ public function getGroups_read() { - if (count($this->_groups_read) < 1) { - $this->assignOtherProperties(); - } - return $this->_groups_read; + return $this->publisher->getHandler('permission')->getGrantedGroupsById('category_read', $this->categoryid()); } /** - * @param array $groups_read - */ - public function setGroups_read($groups_read = array('0')) - { - $this->_groups_read = $groups_read; - } - - /** * @return array|null */ public function getGroups_submit() { - if (count($this->_groups_submit) < 1) { - $this->assignOtherProperties(); - } - return $this->_groups_submit; + return $this->publisher->getHandler('permission')->getGrantedGroupsById('item_submit', $this->categoryid()); } /** - * @param array $groups_submit - */ - public function setGroups_submit($groups_submit = array('0')) - { - $this->_groups_submit = $groups_submit; - } - - /** * @return array|null */ public function getGroups_moderation() { - if (count($this->_groups_moderation) < 1) { - $this->assignOtherProperties(); - } - return $this->_groups_moderation; + return $this->publisher->getHandler('permission')->getGrantedGroupsById('category_moderation', $this->categoryid()); } /** - * @param array $groups_moderation - */ - public function setGroups_moderation($groups_moderation = array('0')) - { - $this->_groups_moderation = $groups_moderation; - } - - /** * @return string */ public function getCategoryUrl() @@ -412,10 +354,12 @@ */ public function &get($id) { - $obj = parent::get($id); - if (is_object($obj)) { - $obj->assignOtherProperties(); + static $cats; + if (isset($cats[$id])) { + return $cats[$id]; } + $obj = parent::get($id); + $cats[$id] = $obj; return $obj; } @@ -489,10 +433,7 @@ { $ret = array(); $theObjects = parent::getObjects($criteria, true); - $publisher_category_group = $this->publisher->getHandler('permission')->getGrantedGroups(); foreach ($theObjects as $theObject) { - $theObject->_groups_read = isset($publisher_category_group['category_read'][$theObject->categoryid()]) ? $publisher_category_group['category_read'][$theObject->categoryid()] : array(); - $theObject->_groups_submit = isset($publisher_category_group['item_submit'][$theObject->categoryid()]) ? $publisher_category_group['item_submit'][$theObject->categoryid()] : array(); if (!$id_as_key) { $ret[] = $theObject; } else { @@ -504,19 +445,6 @@ } /** - * @return array - */ - public function getAllCategoriesObj() - { - static $publisher_allCategoriesObj; - if (!isset($publisher_allCategoriesObj)) { - $publisher_allCategoriesObj = $this->getObjects(null, true); - $publisher_allCategoriesObj[0] = array(); - } - return $publisher_allCategoriesObj; - } - - /** * @param int $limit * @param int $start * @param int $parentid Modified: XoopsModules/publisher/trunk/publisher/class/item.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/item.php 2012-12-01 15:55:26 UTC (rev 10296) +++ XoopsModules/publisher/trunk/publisher/class/item.php 2012-12-01 22:36:45 UTC (rev 10297) @@ -77,7 +77,6 @@ foreach ($item->vars as $k => $v) { $this->assignVar($k, $v['value']); } - $this->assignOtherProperties(); } } @@ -94,15 +93,6 @@ } /** - * Just like the name says - */ - public function assignOtherProperties() - { - $publisher_allCategoriesObj = $this->publisher->getHandler('category')->getAllCategoriesObj(); - $this->_category = $publisher_allCategoriesObj[$this->getVar('categoryid')]; - } - - /** * @return null|PublisherCategory */ public function category() @@ -426,11 +416,7 @@ { global $xoopsConfig, $xoopsUser; $adminLinks = ''; - $groups = ($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; - $gperm_handler = xoops_gethandler('groupperm'); - $module_id = $this->publisher->getModule()->getVar('mid'); - // Do we have access to the parent category - if (is_object($xoopsUser) && (publisher_userIsAdmin() || publisher_userIsAuthor($this) || $gperm_handler->checkRight('item_submit', $this->categoryid(), $groups, $module_id))) { + if (is_object($xoopsUser) && (publisher_userIsAdmin() || publisher_userIsAuthor($this) || $this->publisher->getHandler('permission')->isGranted('item_submit', $this->categoryid()))) { if (publisher_userIsAdmin() || publisher_userIsAuthor($this) || publisher_userIsModerator($this)) { if ($this->publisher->getConfig('perm_edit') || publisher_userIsModerator($this) || publisher_userIsAdmin()) { // Edit button @@ -890,18 +876,14 @@ */ public function accessGranted() { - global $xoopsUser; if (publisher_userIsAdmin()) { return true; } if ($this->status() != _PUBLISHER_STATUS_PUBLISHED) { return false; } - $gperm_handler = xoops_gethandler('groupperm'); - $groups = $xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; - $module_id = $this->publisher->getModule()->getVar('mid'); // Do we have access to the parent category - if ($gperm_handler->checkRight('category_read', $this->categoryid(), $groups, $module_id)) { + if ($this->publisher->getHandler('permission')->isGranted('category_read', $this->categoryid())) { return true; } return false; @@ -1181,11 +1163,7 @@ $theObjects[$myrow['itemid']] = $item; unset($item); } - // since we need the categoryObj and the items permissions for all these items, let's - // fetch them only once ;-) - $publisher_allCategoriesObj = $this->publisher->getHandler('category')->getAllCategoriesObj(); foreach ($theObjects as $theObject) { - $theObject->_category = isset($publisher_allCategoriesObj[$theObject->getVar('categoryid')]) ? $publisher_allCategoriesObj[$theObject->getVar('categoryid')] : null; if ($id_key == 'none') { $ret[] = $theObject; } elseif ($id_key == 'itemid') { @@ -1621,7 +1599,8 @@ public function getLastPublishedByCat($status = array(_PUBLISHER_STATUS_PUBLISHED)) { $ret = array(); - $cat = array(); + /*$cat = array(); + $sql = "SELECT categoryid, MAX(datesub) as date FROM " . $this->db->prefix('publisher_items') . " WHERE status IN (" . implode(',', $status) . ") GROUP BY categoryid"; $result = $this->db->query($sql); while ($row = $this->db->fetchArray($result)) { @@ -1644,6 +1623,19 @@ $ret[$row['categoryid']] = $item; unset($item); } + */ + $sql = "SELECT mi.categoryid, mi.itemid, mi.title, mi.short_url, mi.uid, mi.datesub"; + $sql .= " FROM (SELECT categoryid, MAX(datesub) AS date FROM " . $this->db->prefix('publisher_items'); + $sql .= " WHERE status IN (" . implode(',', $status) . ")"; + $sql .= " GROUP BY categoryid)mo"; + $sql .= " JOIN " . $this->db->prefix('publisher_items') . " mi ON mi.datesub = mo.date"; + $result = $this->db->query($sql); + while ($row = $this->db->fetchArray($result)) { + $item = new PublisherItem(); + $item->assignVars($row); + $ret[$row['categoryid']] = $item; + unset($item); + } return $ret; } Modified: XoopsModules/publisher/trunk/publisher/class/permission.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/permission.php 2012-12-01 15:55:26 UTC (rev 10296) +++ XoopsModules/publisher/trunk/publisher/class/permission.php 2012-12-01 22:36:45 UTC (rev 10297) @@ -21,9 +21,7 @@ * @version $Id$ */ defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); - include_once dirname(dirname(__FILE__)) . '/include/common.php'; - class PublisherPermissionHandler extends XoopsObjectHandler { /** @@ -47,8 +45,30 @@ */ public function getGrantedGroupsById($gperm_name, $id) { - $groups = $this->getGrantedGroups($gperm_name); - return isset($groups[$id]) ? $groups[$id] : array(); + static $items; + if (isset($items[$gperm_name][$id])) { + return $items[$gperm_name][$id]; + } + $groups = array(); + $criteria = new CriteriaCompo(); + $criteria->add(new Criteria('gperm_modid', $this->publisher->getModule()->getVar('mid'))); + $criteria->add(new Criteria('gperm_name', $gperm_name)); + $criteria->add(new Criteria('gperm_itemid', $id)); + //Instead of calling groupperm handler and get objects, we will save some memory and do it our way + $db = XoopsDatabaseFactory::getDatabaseConnection(); + $limit = $start = 0; + $sql = 'SELECT gperm_groupid FROM ' . $db->prefix('group_permission'); + if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { + $sql .= ' ' . $criteria->renderWhere(); + $limit = $criteria->getLimit(); + $start = $criteria->getStart(); + } + $result = $db->query($sql, $limit, $start); + while ($myrow = $db->fetchArray($result)) { + $groups[$myrow['gperm_groupid']] = $myrow['gperm_groupid']; + } + $items[$gperm_name][$id] = $groups; + return $groups; } /** @@ -56,27 +76,20 @@ * * @return array */ - public function getGrantedGroups($gperm_name = '') + public function getGrantedGroups($gperm_name) { - static $groups; - static $publisher_all_permissions_fetched; - if ($gperm_name) { - if (isset($groups[$gperm_name])) { - return $groups[$gperm_name]; - } elseif (true === $publisher_all_permissions_fetched) { - //trying to get non existing permission - return array(); - } - } else if (true === $publisher_all_permissions_fetched) { - return $groups; + static $items; + if (isset($items[$gperm_name])) { + return $items[$gperm_name]; } - $publisher_all_permissions_fetched = true; + $groups = array(); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('gperm_modid', $this->publisher->getModule()->getVar('mid'))); + $criteria->add(new Criteria('gperm_name', $gperm_name)); //Instead of calling groupperm handler and get objects, we will save some memory and do it our way $db = XoopsDatabaseFactory::getDatabaseConnection(); $limit = $start = 0; - $sql = 'SELECT * FROM ' . $db->prefix('group_permission'); + $sql = 'SELECT gperm_groupid FROM ' . $db->prefix('group_permission'); if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { $sql .= ' ' . $criteria->renderWhere(); $limit = $criteria->getLimit(); @@ -84,10 +97,11 @@ } $result = $db->query($sql, $limit, $start); while ($myrow = $db->fetchArray($result)) { - $groups[$myrow['gperm_name']][$myrow['gperm_itemid']][] = $myrow['gperm_groupid']; + $groups[$myrow['gperm_groupid']] = $myrow['gperm_groupid']; } + $items[$gperm_name] = $groups; //Return the permission array - return $this->getGrantedGroups($gperm_name); + return $groups; } /** @@ -98,33 +112,36 @@ * * @return array */ - public function getGrantedItems($gperm_name, $id = null) + public function getGrantedItems($gperm_name, $id = 0) { + static $items; + if (isset($items[$gperm_name][$id])) { + return $items[$gperm_name][$id]; + } global $xoopsUser; - static $permissions; - if (!isset($permissions[$gperm_name]) || ($id != null && !isset($permissions[$gperm_name][$id]))) { - //Instead of calling groupperm handler and get objects, we will save some memory and do it our way - $criteria = new CriteriaCompo(new Criteria('gperm_name', $gperm_name)); - $criteria->add(new Criteria('gperm_modid', $this->publisher->getModule()->getVar('mid'))); - //Get user's groups - $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS); - $criteria2 = new CriteriaCompo(); - foreach ($groups as $gid) { - $criteria2->add(new Criteria('gperm_groupid', $gid), 'OR'); - } - $criteria->add($criteria2); - $db = XoopsDatabaseFactory::getDatabaseConnection(); - $sql = 'SELECT * FROM ' . $db->prefix('group_permission'); - $sql .= ' ' . $criteria->renderWhere(); - $result = $db->query($sql, 0, 0); - $permissions[$gperm_name] = array(); - while ($myrow = $db->fetchArray($result)) { - $permissions[$gperm_name][] = $myrow['gperm_itemid']; - } - $permissions[$gperm_name] = array_unique($permissions[$gperm_name]); + $ret = array(); + //Instead of calling groupperm handler and get objects, we will save some memory and do it our way + $criteria = new CriteriaCompo(new Criteria('gperm_name', $gperm_name)); + $criteria->add(new Criteria('gperm_modid', $this->publisher->getModule()->getVar('mid'))); + if ($id != 0) { + $criteria->add(new Criteria('gperm_itemid', $id)); } - //Return the permission array - return isset($permissions[$gperm_name]) ? $permissions[$gperm_name] : array(); + //Get user's groups + $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS); + $criteria2 = new CriteriaCompo(); + foreach ($groups as $gid) { + $criteria2->add(new Criteria('gperm_groupid', $gid), 'OR'); + } + $criteria->add($criteria2); + $db = XoopsDatabaseFactory::getDatabaseConnection(); + $sql = 'SELECT gperm_itemid FROM ' . $db->prefix('group_permission'); + $sql .= ' ' . $criteria->renderWhere(); + $result = $db->query($sql, 0, 0); + while ($myrow = $db->fetchArray($result)) { + $ret[$myrow['gperm_itemid']] = $myrow['gperm_itemid']; + } + $items[$gperm_name][$id] = $ret; + return $ret; } /** @@ -135,13 +152,20 @@ */ public function isGranted($gperm_name, $id = null) { - static $permissions; - if ($id == null) return false; - if (!isset($permissions[$gperm_name]) || !isset($permissions[$gperm_name][$id])) { - $userpermissions = in_array($id, $this->getGrantedItems($gperm_name)) ? true : false; - $permissions[$gperm_name][$id] = $userpermissions; + $permissions = $this->getGrantedItems($gperm_name, $id); + if ($id == null) { + if (!empty($permissions)) { + return true; + } else { + return false; + } + } else { + if (!empty($permissions) && isset ($permissions[$id])) { + return true; + } else { + return false; + } } - return $permissions[$gperm_name][$id]; } /** Modified: XoopsModules/publisher/trunk/publisher/include/common.php =================================================================== --- XoopsModules/publisher/trunk/publisher/include/common.php 2012-12-01 15:55:26 UTC (rev 10296) +++ XoopsModules/publisher/trunk/publisher/include/common.php 2012-12-01 22:36:45 UTC (rev 10297) @@ -39,7 +39,7 @@ include_once PUBLISHER_ROOT_PATH . '/class/publisher.php'; include_once PUBLISHER_ROOT_PATH . '/class/request.php'; -$debug = true; +$debug = false; $publisher = PublisherPublisher::getInstance($debug); //This is needed or it will not work in blocks. |
From: <tr...@us...> - 2012-12-12 23:26:44
|
Revision: 10373 http://sourceforge.net/p/xoops/svn/10373 Author: trabis Date: 2012-12-12 23:26:38 +0000 (Wed, 12 Dec 2012) Log Message: ----------- First publisher revision Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/admin/about.php XoopsModules/publisher/trunk/publisher/admin/admin_header.php XoopsModules/publisher/trunk/publisher/admin/category.php XoopsModules/publisher/trunk/publisher/admin/clone.php XoopsModules/publisher/trunk/publisher/admin/file.php XoopsModules/publisher/trunk/publisher/admin/import/news.php XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php XoopsModules/publisher/trunk/publisher/admin/import/xfsection.php XoopsModules/publisher/trunk/publisher/admin/import.php XoopsModules/publisher/trunk/publisher/admin/index.php XoopsModules/publisher/trunk/publisher/admin/item.php XoopsModules/publisher/trunk/publisher/admin/main.php XoopsModules/publisher/trunk/publisher/admin/menu.php XoopsModules/publisher/trunk/publisher/admin/mimetypes.php XoopsModules/publisher/trunk/publisher/admin/pagewrap.php XoopsModules/publisher/trunk/publisher/admin/permissions.php XoopsModules/publisher/trunk/publisher/admin/preferences.php XoopsModules/publisher/trunk/publisher/admin/pw_delete_file.php XoopsModules/publisher/trunk/publisher/admin/pw_upload_file.php XoopsModules/publisher/trunk/publisher/archive.php XoopsModules/publisher/trunk/publisher/author_items.php XoopsModules/publisher/trunk/publisher/backend.php XoopsModules/publisher/trunk/publisher/blocks/category_items_sel.php XoopsModules/publisher/trunk/publisher/blocks/date_to_date.php XoopsModules/publisher/trunk/publisher/blocks/items_columns.php XoopsModules/publisher/trunk/publisher/blocks/items_menu.php XoopsModules/publisher/trunk/publisher/blocks/items_new.php XoopsModules/publisher/trunk/publisher/blocks/items_random_item.php XoopsModules/publisher/trunk/publisher/blocks/items_recent.php XoopsModules/publisher/trunk/publisher/blocks/items_spot.php XoopsModules/publisher/trunk/publisher/blocks/latest_files.php XoopsModules/publisher/trunk/publisher/blocks/latest_news.php XoopsModules/publisher/trunk/publisher/blocks/search.php XoopsModules/publisher/trunk/publisher/category.php XoopsModules/publisher/trunk/publisher/class/blockform.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/file.php XoopsModules/publisher/trunk/publisher/class/form/category.php XoopsModules/publisher/trunk/publisher/class/form/file.php XoopsModules/publisher/trunk/publisher/class/form/item.php XoopsModules/publisher/trunk/publisher/class/groupperm.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/class/metagen.php XoopsModules/publisher/trunk/publisher/class/mimetype.php XoopsModules/publisher/trunk/publisher/class/permission.php XoopsModules/publisher/trunk/publisher/class/publisher.php XoopsModules/publisher/trunk/publisher/class/rating.php XoopsModules/publisher/trunk/publisher/class/request.php XoopsModules/publisher/trunk/publisher/class/themetabform.php XoopsModules/publisher/trunk/publisher/class/uploader.php XoopsModules/publisher/trunk/publisher/comment_delete.php XoopsModules/publisher/trunk/publisher/comment_edit.php XoopsModules/publisher/trunk/publisher/comment_new.php XoopsModules/publisher/trunk/publisher/comment_post.php XoopsModules/publisher/trunk/publisher/comment_reply.php XoopsModules/publisher/trunk/publisher/file.php XoopsModules/publisher/trunk/publisher/footer.php XoopsModules/publisher/trunk/publisher/header.php XoopsModules/publisher/trunk/publisher/include/ajax_rating.php XoopsModules/publisher/trunk/publisher/include/ajax_upload.php XoopsModules/publisher/trunk/publisher/include/comment_functions.php XoopsModules/publisher/trunk/publisher/include/common.php XoopsModules/publisher/trunk/publisher/include/notification.inc.php XoopsModules/publisher/trunk/publisher/include/plugin.tag.php XoopsModules/publisher/trunk/publisher/include/search.inc.php XoopsModules/publisher/trunk/publisher/include/seo.inc.php XoopsModules/publisher/trunk/publisher/include/update.php XoopsModules/publisher/trunk/publisher/index.php XoopsModules/publisher/trunk/publisher/item.php XoopsModules/publisher/trunk/publisher/list.tag.php XoopsModules/publisher/trunk/publisher/makepdf.php XoopsModules/publisher/trunk/publisher/notification_update.php XoopsModules/publisher/trunk/publisher/pop.php XoopsModules/publisher/trunk/publisher/print.php XoopsModules/publisher/trunk/publisher/rate.php XoopsModules/publisher/trunk/publisher/search.php XoopsModules/publisher/trunk/publisher/submit.php XoopsModules/publisher/trunk/publisher/view.tag.php XoopsModules/publisher/trunk/publisher/visit.php XoopsModules/publisher/trunk/publisher/xoops_version.php Added Paths: ----------- XoopsModules/publisher/trunk/publisher/class/utils.php XoopsModules/publisher/trunk/publisher/preloads/ XoopsModules/publisher/trunk/publisher/preloads/core.php XoopsModules/publisher/trunk/publisher/preloads/index.html Removed Paths: ------------- XoopsModules/publisher/trunk/publisher/class/highlighter.php XoopsModules/publisher/trunk/publisher/include/constants.php XoopsModules/publisher/trunk/publisher/include/functions.php XoopsModules/publisher/trunk/publisher/include/media.textsanitizer.php XoopsModules/publisher/trunk/publisher/include/seo_functions.php Modified: XoopsModules/publisher/trunk/publisher/admin/about.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/about.php 2012-12-12 22:08:20 UTC (rev 10372) +++ XoopsModules/publisher/trunk/publisher/admin/about.php 2012-12-12 23:26:38 UTC (rev 10373) @@ -20,13 +20,12 @@ * @version $Id$ */ -include_once dirname(__FILE__) . '/admin_header.php'; +include dirname(__FILE__) . '/admin_header.php'; +$xoops = Xoops::getInstance(); +$xoops->header(); -xoops_cp_header(); +$aboutAdmin = new XoopsModuleAdmin(); +$aboutAdmin->displayNavigation('about.php'); +$aboutAdmin->displayAbout('6KJ7RW5DR3VTJ', false); -$aboutAdmin = new ModuleAdmin(); - -echo $aboutAdmin->addNavigation('about.php'); -echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); - -xoops_cp_footer(); \ No newline at end of file +$xoops->footer(); \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/admin_header.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2012-12-12 22:08:20 UTC (rev 10372) +++ XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2012-12-12 23:26:38 UTC (rev 10373) @@ -20,27 +20,10 @@ */ include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; -include_once dirname(dirname(__FILE__)) . '/include/common.php'; -include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; -//xoops_loadLanguage('admin', PUBLISHER_DIRNAME); -xoops_loadLanguage('modinfo', PUBLISHER_DIRNAME); +$xoops = Xoops::getInstance(); +$publisher = Publisher::getInstance(); +$publisher->loadLanguage('modinfo'); -$imagearray = array( - 'editimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_edit.png' alt='" . _AM_PUBLISHER_ICO_EDIT . "' align='middle' />", - 'deleteimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_delete.png' alt='" . _AM_PUBLISHER_ICO_DELETE . "' align='middle' />", - 'online' => "<img src='" . PUBLISHER_IMAGES_URL . "/on.png' alt='" . _AM_PUBLISHER_ICO_ONLINE . "' align='middle' />", - 'offline' => "<img src='" . PUBLISHER_IMAGES_URL . "/off.png' alt='" . _AM_PUBLISHER_ICO_OFFLINE . "' align='middle' />", -); -if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))){ - include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); -}else{ - echo xoops_error('/Frameworks/moduleclasses/moduleadmin/ is required!!!'); -} -/* -$myts =& MyTextSanitizer::getInstance(); - -if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { - include_once(XOOPS_ROOT_PATH."/class/template.php"); - $xoopsTpl = new XoopsTpl(); -} */ \ No newline at end of file +XoopsLoad::loadFile($xoops->path(dirname(dirname(__FILE__)) . '/include/common.php')); +XoopsLoad::loadFile($xoops->path(XOOPS_ROOT_PATH . '/include/cp_header.php')); Modified: XoopsModules/publisher/trunk/publisher/admin/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/category.php 2012-12-12 22:08:20 UTC (rev 10372) +++ XoopsModules/publisher/trunk/publisher/admin/category.php 2012-12-12 23:26:38 UTC (rev 10373) @@ -21,6 +21,7 @@ include_once dirname(__FILE__) . '/admin_header.php'; +$xoops = Xoops::getInstance(); $op = PublisherRequest::getString('op'); $op = isset($_POST['editor']) ? 'mod' : $op; @@ -35,20 +36,19 @@ switch ($op) { case "del": - $categoryObj = $publisher->getHandler('category')->get($categoryid); + /* @var $categoryObj PublisherCategory */ + $categoryObj = $publisher->getCategoryHandler()->get($categoryid); $confirm = (isset($_POST['confirm'])) ? $_POST['confirm'] : 0; $name = (isset($_POST['name'])) ? $_POST['name'] : ''; if ($confirm) { - if (!$publisher->getHandler('category')->delete($categoryObj)) { - redirect_header("category.php", 1, _AM_PUBLISHER_DELETE_CAT_ERROR); - exit(); + if (!$publisher->getCategoryHandler()->delete($categoryObj)) { + $xoops->redirect("category.php", 1, _AM_PUBLISHER_DELETE_CAT_ERROR); } - redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_COLISDELETED, $name)); - exit(); + $xoops->redirect("category.php", 1, sprintf(_AM_PUBLISHER_COLISDELETED, $name)); } else { - xoops_cp_header(); - xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_PUBLISHER_DELETECOL . " '" . $categoryObj->name() . "'. <br /> <br />" . _AM_PUBLISHER_DELETE_CAT_CONFIRM, _AM_PUBLISHER_DELETE); - xoops_cp_footer(); + $xoops->header(); + $xoops->confirm(array('op' => 'del', 'categoryid' => $categoryObj->getVar('categoryid'), 'confirm' => 1, 'name' => $categoryObj->getVar('name')), 'category.php', _AM_PUBLISHER_DELETECOL . " '" . $categoryObj->getVar('name') . "'. <br /> <br />" . _AM_PUBLISHER_DELETE_CAT_CONFIRM, _AM_PUBLISHER_DELETE); + $xoops->footer(); } break; @@ -58,7 +58,7 @@ $nb_subcats = $nb_subcats + (isset($_POST['nb_sub_yet']) ? intval($_POST['nb_sub_yet']) : 4); //end of fx2024 code - publisher_cpHeader(); + PublisherUtils::cpHeader(); publisher_editCat(true, $categoryid, $nb_subcats); break; @@ -66,11 +66,11 @@ global $modify; $parentid = PublisherRequest::getInt('parentid'); - + /* @var $categoryObj PublisherCategory */ if ($categoryid != 0) { - $categoryObj = $publisher->getHandler('category')->get($categoryid); + $categoryObj = $publisher->getCategoryHandler()->get($categoryid); } else { - $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj = $publisher->getCategoryHandler()->create(); } // Uploading the image, if any @@ -82,20 +82,17 @@ $max_size = $publisher->getConfig('maximum_filesize'); $max_imgwidth = $publisher->getConfig('maximum_image_width'); $max_imgheight = $publisher->getConfig('maximum_image_height'); - $allowed_mimetypes = publisher_getAllowedImagesTypes(); + $allowed_mimetypes = PublisherUtils::getAllowedImagesTypes(); if ($_FILES[$filename]['tmp_name'] == "" || !is_readable($_FILES[$filename]['tmp_name'])) { - redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR); - exit(); + $xoops->redirect('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR); } - xoops_load('XoopsMediaUploader'); - $uploader = new XoopsMediaUploader(publisher_getImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); + $uploader = new PublisherUploader(PublisherUtils::getImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); if ($uploader->fetchMedia($filename) && $uploader->upload()) { $categoryObj->setVar('image', $uploader->getSavedFileName()); } else { - redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR . $uploader->getErrors()); - exit(); + $xoops->redirect('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR . $uploader->getErrors()); } } } else { @@ -146,37 +143,34 @@ } if (!$categoryObj->store()) { - redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_CATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); - exit; + $xoops->redirect("javascript:history.go(-1)", 3, _AM_PUBLISHER_CATEGORY_SAVE_ERROR . PublisherUtils::formatErrors($categoryObj->getErrors())); } // TODO : put this function in the category class - publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); - publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); + PublisherUtils::saveCategoryPermissions($grpread, $categoryObj->getVar('categoryid'), 'category_read'); + PublisherUtils::saveCategoryPermissions($grpsubmit, $categoryObj->getVar('categoryid'), 'item_submit'); + PublisherUtils::saveCategoryPermissions($grpmoderation, $categoryObj->getVar('categoryid'), 'category_moderation'); //Added by fx2024 - $parentCat = $categoryObj->categoryid(); + $parentCat = $categoryObj->getVar('categoryid'); $sizeof = sizeof($_POST['scname']); for ($i = 0; $i < $sizeof; $i++) { if ($_POST['scname'][$i] != '') { - $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj = $publisher->getCategoryHandler()->create(); $categoryObj->setVar('name', $_POST['scname'][$i]); $categoryObj->setVar('parentid', $parentCat); if (!$categoryObj->store()) { - redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); - exit; + $xoops->redirect("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . PublisherUtils::formatErrors($categoryObj->getErrors())); } // TODO : put this function in the category class - publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); - publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); + PublisherUtils::saveCategoryPermissions($grpread, $categoryObj->getVar('categoryid'), 'category_read'); + PublisherUtils::saveCategoryPermissions($grpsubmit, $categoryObj->getVar('categoryid'), 'item_submit'); + PublisherUtils::saveCategoryPermissions($grpmoderation, $categoryObj->getVar('categoryid'), 'category_moderation'); } } //end of fx2024 code - redirect_header($redirect_to, 2, $redirect_msg); - exit(); + $xoops->redirect($redirect_to, 2, $redirect_msg); break; //Added by fx2024 @@ -185,7 +179,7 @@ $categoryid = 0; $nb_subcats = intval($_POST['nb_subcats']) + $_POST['nb_sub_yet']; - $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj = $publisher->getCategoryHandler()->create(); $categoryObj->setVar('name', $_POST['name']); $categoryObj->setVar('description', $_POST['description']); $categoryObj->setVar('weight', $_POST['weight']); @@ -193,7 +187,7 @@ $categoryObj->setVar('parentid', $parentCat); } - publisher_cpHeader(); + PublisherUtils::cpHeader(); publisher_editCat(true, $categoryid, $nb_subcats, $categoryObj); exit(); @@ -201,12 +195,11 @@ //end of fx2024 code case "cancel": - redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_BACK2IDX, '')); - exit(); - + $xoops->redirect("category.php", 1, sprintf(_AM_PUBLISHER_BACK2IDX, '')); + break; case "default": default: - publisher_cpHeader(); + PublisherUtils::cpHeader(); //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES); echo "<br />\n"; @@ -216,9 +209,9 @@ echo "</div></form>"; // Creating the objects for top categories - $categoriesObj = $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0); + $categoriesObj = $publisher->getCategoryHandler()->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0); - publisher_openCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC); + PublisherUtils::openCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC); echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; echo "<tr>"; @@ -226,7 +219,7 @@ echo "<td width='60' class='bg3' width='65' align='center'><strong>" . _CO_PUBLISHER_WEIGHT . "</strong></td>"; echo "<td width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; echo "</tr>"; - $totalCategories = $publisher->getHandler('category')->getCategoriesCount(0); + $totalCategories = $publisher->getCategoryHandler()->getCategoriesCount(0); if (count($categoriesObj) > 0) { foreach ($categoriesObj as $key => $thiscat) { publisher_displayCategory($thiscat); @@ -238,30 +231,29 @@ $categoryid = '0'; } echo "</table>\n"; - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $pagenav = new XoopsPageNav($totalCategories, $publisher->getConfig('idxcat_perpage'), $startcategory, 'startcategory'); echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; echo "<br />"; - publisher_closeCollapsableBar('createdcategories', 'createdcategoriesicon'); + PublisherUtils::closeCollapsableBar('createdcategories', 'createdcategoriesicon'); echo "<br>"; //editcat(false); break; } -xoops_cp_footer(); +$xoops->footer(); -function publisher_displayCategory($categoryObj, $level = 0) +function publisher_displayCategory(PublisherCategory $categoryObj, $level = 0) { - $publisher = PublisherPublisher::getInstance(); + $publisher = Publisher::getInstance(); - $description = $categoryObj->description(); + $description = $categoryObj->getVar('description'); if (!XOOPS_USE_MULTIBYTES) { if (strlen($description) >= 100) { $description = substr($description, 0, (100 - 1)) . "..."; } } - $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "&parentid=" . $categoryObj->parentid() . "'><img src='" . PUBLISHER_URL . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITCOL . "' alt='" . _AM_PUBLISHER_EDITCOL . "' /></a>"; - $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . PUBLISHER_URL . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETECOL . "' alt='" . _AM_PUBLISHER_DELETECOL . "' /></a>"; + $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->getVar('categoryid') . "&parentid=" . $categoryObj->getVar('parentid') . "'><img src='" . PUBLISHER_URL . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITCOL . "' alt='" . _AM_PUBLISHER_EDITCOL . "' /></a>"; + $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->getVar('categoryid') . "'><img src='" . PUBLISHER_URL . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETECOL . "' alt='" . _AM_PUBLISHER_DELETECOL . "' /></a>"; $spaces = ''; for ($j = 0; $j < $level; $j++) { @@ -269,14 +261,14 @@ } echo "<tr>"; - echo "<td class='even' align='left'>" . $spaces . "<a href='" . PUBLISHER_URL . "/category.php?categoryid=" . $categoryObj->categoryid() . "'><img src='" . PUBLISHER_URL . "/images/links/subcat.gif' alt='' /> " . $categoryObj->name() . "</a></td>"; - echo "<td class='even' align='center'>" . $categoryObj->weight() . "</td>"; + echo "<td class='even' align='left'>" . $spaces . "<a href='" . PUBLISHER_URL . "/category.php?categoryid=" . $categoryObj->getVar('categoryid') . "'><img src='" . PUBLISHER_URL . "/images/links/subcat.gif' alt='' /> " . $categoryObj->getVar('name') . "</a></td>"; + echo "<td class='even' align='center'>" . $categoryObj->getVar('weight') . "</td>"; echo "<td class='even' align='center'> $modify $delete </td>"; echo "</tr>"; - $subCategoriesObj = $publisher->getHandler('category')->getCategories(0, 0, $categoryObj->categoryid()); + $subCategoriesObj = $publisher->getCategoryHandler()->getCategories(0, 0, $categoryObj->getVar('categoryid')); if (count($subCategoriesObj) > 0) { $level++; - foreach ($subCategoriesObj as $key => $thiscat) { + foreach ($subCategoriesObj as $thiscat) { publisher_displayCategory($thiscat, $level); } } @@ -285,19 +277,20 @@ function publisher_editCat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryObj = null) { - $publisher = PublisherPublisher::getInstance(); + $xoops = Xoops::getInstance(); + $publisher = Publisher::getInstance(); + /* @var $categoryObj PublisherCategory */ // if there is a parameter, and the id exists, retrieve data: we're editing a category if ($categoryid != 0) { // Creating the category object for the selected category - $categoryObj = $publisher->getHandler('category')->get($categoryid); + $categoryObj = $publisher->getCategoryHandler()->get($categoryid); if ($categoryObj->notLoaded()) { - redirect_header("category.php", 1, _AM_PUBLISHER_NOCOLTOEDIT); - exit(); + $xoops->redirect("category.php", 1, _AM_PUBLISHER_NOCOLTOEDIT); } } else { if (!$categoryObj) { - $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj = $publisher->getCategoryHandler()->create(); } } @@ -306,34 +299,36 @@ //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_EDITING); } echo "<br />\n"; - publisher_openCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO); + PublisherUtils::openCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO); } else { if ($showmenu) { //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_CREATINGNEW); } - publisher_openCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO); + PublisherUtils::openCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO); } - $sform = $categoryObj->getForm($nb_subcats); + /* @var $sform PublisherCategoryForm */ + $sform = $publisher->getForm($categoryObj, 'category'); + $sform->setSubCatsCount($nb_subcats); $sform->display(); if (!$categoryid) { - publisher_closeCollapsableBar('createtable', 'createtableicon'); + PublisherUtils::closeCollapsableBar('createtable', 'createtableicon'); } else { - publisher_closeCollapsableBar('edittable', 'edittableicon'); + PublisherUtils::closeCollapsableBar('edittable', 'edittableicon'); } //Added by fx2024 if ($categoryid) { $sel_cat = $categoryid; - publisher_openCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC); + PublisherUtils::openCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC); // Get the total number of sub-categories - $categoriesObj = $publisher->getHandler('category')->get($sel_cat); - $totalsubs = $publisher->getHandler('category')->getCategoriesCount($sel_cat); + $categoriesObj = $publisher->getCategoryHandler()->get($sel_cat); + $totalsubs = $publisher->getCategoryHandler()->getCategoriesCount($sel_cat); // creating the categories objects that are published - $subcatsObj = $publisher->getHandler('category')->getCategories(0, 0, $categoriesObj->categoryid()); - $totalSCOnPage = count($subcatsObj); + $subcatsObj = $publisher->getCategoryHandler()->getCategories(0, 0, $categoriesObj->getVar('categoryid')); + echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; echo "<tr>"; echo "<td width='60' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATID . "</strong></td>"; @@ -342,13 +337,14 @@ echo "<td width='60' class='bg3' align='right'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; echo "</tr>"; if ($totalsubs > 0) { + /* @var $subcat PublisherCategory */ foreach ($subcatsObj as $subcat) { - $modify = "<a href='category.php?op=mod&categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_MODIFY . "' alt='" . _AM_PUBLISHER_MODIFY . "' /></a>"; - $delete = "<a href='category.php?op=del&categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETE . "' alt='" . _AM_PUBLISHER_DELETE . "' /></a>"; + $modify = "<a href='category.php?op=mod&categoryid=" . $subcat->getVar('categoryid') . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_MODIFY . "' alt='" . _AM_PUBLISHER_MODIFY . "' /></a>"; + $delete = "<a href='category.php?op=del&categoryid=" . $subcat->getVar('categoryid') . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETE . "' alt='" . _AM_PUBLISHER_DELETE . "' /></a>"; echo "<tr>"; - echo "<td class='head' align='left'>" . $subcat->categoryid() . "</td>"; - echo "<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/category.php?categoryid=" . $subcat->categoryid() . "&parentid=" . $subcat->parentid() . "'>" . $subcat->name() . "</a></td>"; - echo "<td class='even' align='left'>" . $subcat->description() . "</td>"; + echo "<td class='head' align='left'>" . $subcat->getVar('categoryid') . "</td>"; + echo "<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/category.php?categoryid=" . $subcat->getVar('categoryid') . "&parentid=" . $subcat->getVar('parentid'). "'>" . $subcat->getVar('name') . "</a></td>"; + echo "<td class='even' align='left'>" . $subcat->getVar('description') . "</td>"; echo "<td class='even' align='right'> {$modify} {$delete} </td>"; echo "</tr>"; } @@ -359,16 +355,16 @@ } echo "</table>\n"; echo "<br />\n"; - publisher_closeCollapsableBar('subcatstable', 'subcatsicon'); + PublisherUtils::closeCollapsableBar('subcatstable', 'subcatsicon'); - publisher_openCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC); + PublisherUtils::openCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC); $startitem = PublisherRequest::getInt('startitem'); // Get the total number of published ITEMS - $totalitems = $publisher->getHandler('item')->getItemsCount($sel_cat, array(_PUBLISHER_STATUS_PUBLISHED)); + $totalitems = $publisher->getItemHandler()->getItemsCount($sel_cat, array(_PUBLISHER_STATUS_PUBLISHED)); // creating the items objects that are published - $itemsObj = $publisher->getHandler('item')->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $sel_cat); + $itemsObj = $publisher->getItemHandler()->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $sel_cat); $totalitemsOnPage = count($itemsObj); - $allcats = $publisher->getHandler('category')->getObjects(null, true); + $allcats = $publisher->getCategoryHandler()->getObjects(null, true); echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; echo "<tr>"; echo "<td width='40' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ITEMID . "</strong></td>"; @@ -379,19 +375,18 @@ echo "</tr>"; if ($totalitems > 0) { for ($i = 0; $i < $totalitemsOnPage; $i++) { - $categoryObj =& $allcats[$itemsObj[$i]->categoryid()]; - $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; - $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; + $categoryObj =& $allcats[$itemsObj[$i]->getVar('categoryid')]; + $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->getVar('itemid'). "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; + $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->getVar('itemid'). "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; echo "<tr>"; - echo "<td class='head' align='center'>" . $itemsObj[$i]->itemid() . "</td>"; - echo "<td class='even' align='left'>" . $categoryObj->name() . "</td>"; + echo "<td class='head' align='center'>" . $itemsObj[$i]->getVar('itemid'). "</td>"; + echo "<td class='even' align='left'>" . $categoryObj->getVar('name') . "</td>"; echo "<td class='even' align='left'>" . $itemsObj[$i]->getitemLink() . "</td>"; echo "<td class='even' align='center'>" . $itemsObj[$i]->datesub('s') . "</td>"; echo "<td class='even' align='center'> $modify $delete </td>"; echo "</tr>"; } } else { - $itemid = -1; echo "<tr>"; echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOITEMS . "</td>"; echo "</tr>"; @@ -400,7 +395,6 @@ echo "<br />\n"; $parentid = PublisherRequest::getInt('parentid'); $pagenav_extra_args = "op=mod&categoryid=$sel_cat&parentid=$parentid"; - xoops_load('XoopsPageNav'); $pagenav = new XoopsPageNav($totalitems, $publisher->getConfig('idxcat_perpage'), $startitem, 'startitem', $pagenav_extra_args); echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; echo "<input type='button' name='button' onclick=\"location='item.php?op=mod&categoryid=" . $sel_cat . "'\" value='" . _AM_PUBLISHER_CREATEITEM . "'> "; Modified: XoopsModules/publisher/trunk/publisher/admin/clone.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/clone.php 2012-12-12 22:08:20 UTC (rev 10372) +++ XoopsModules/publisher/trunk/publisher/admin/clone.php 2012-12-12 23:26:38 UTC (rev 10373) @@ -20,28 +20,28 @@ include_once dirname(__FILE__) . "/admin_header.php"; -publisher_cpHeader(); +$xoops = Xoops::getInstance(); +PublisherUtils::cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_CLONE); -publisher_openCollapsableBar('clone', 'cloneicon', _AM_PUBLISHER_CLONE, _AM_PUBLISHER_CLONE_DSC); +PublisherUtils::openCollapsableBar('clone', 'cloneicon', _AM_PUBLISHER_CLONE, _AM_PUBLISHER_CLONE_DSC); if (@$_POST['op'] == 'submit') { - if (!$GLOBALS['xoopsSecurity']->check()) { - redirect_header('clone.php', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); - exit(); + if (!$xoops->security()->check()) { + $xoops->redirect('clone.php', 3, implode('<br />', $xoops->security()->getErrors())); } $clone = $_POST['clone']; //check if name is valid if (empty($clone) || preg_match('/[^a-zA-Z0-9\_\-]/', $clone)) { - redirect_header('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_INVALIDNAME, $clone)); + $xoops->redirect('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_INVALIDNAME, $clone)); exit(); } // Check wether the cloned module exists or not if ($clone && is_dir(XOOPS_ROOT_PATH . '/modules/' . $clone)) { - redirect_header('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_EXISTS, $clone)); + $xoops->redirect('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_EXISTS, $clone)); } $patterns = array( @@ -67,7 +67,6 @@ echo $msg; } else { - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; $form = new XoopsThemeForm(sprintf(_AM_PUBLISHER_CLONE_TITLE, $publisher->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true); $clone = new XoopsFormText(_AM_PUBLISHER_CLONE_NAME, 'clone', 20, 20, ''); $clone->setDescription(_AM_PUBLISHER_CLONE_NAME_DSC); @@ -78,8 +77,8 @@ } // End of collapsable bar -publisher_closeCollapsableBar('clone', 'cloneicon'); -xoops_cp_footer(); +PublisherUtils::closeCollapsableBar('clone', 'cloneicon'); +$xoops->footer(); // work around for PHP < 5.0.x if (!function_exists('file_put_contents')) { @@ -162,6 +161,4 @@ imagepng($imageModule, XOOPS_ROOT_PATH . "/modules/" . $dirname . "/images/module_logo.png"); imagedestroy($imageModule); return true; -} - -?> \ No newline at end of file +} \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/file.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/file.php 2012-12-12 22:08:20 UTC (rev 10372) +++ XoopsModules/publisher/trunk/publisher/admin/file.php 2012-12-12 23:26:38 UTC (rev 10373) @@ -20,23 +20,24 @@ */ include_once dirname(__FILE__) . '/admin_header.php'; +$xoops = Xoops::getInstance(); $op = PublisherRequest::getString('op'); function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0) { - $publisher = PublisherPublisher::getInstance(); - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; + $publisher = Publisher::getInstance(); + $xoops = Xoops::getInstance(); // if there is a parameter, and the id exists, retrieve data: we're editing a file if ($fileid != 0) { // Creating the File object - $fileObj = $publisher->getHandler('file')->get($fileid); + /* @var $fileObj PublisherFile */ + $fileObj = $publisher->getFileHandler()->get($fileid); if ($fileObj->notLoaded()) { - redirect_header("javascript:history.go(-1)", 1, _AM_PUBLISHER_NOFILESELECTED); - exit(); + $xoops->redirect("javascript:history.go(-1)", 1, _AM_PUBLISHER_NOFILESELECTED); } if ($showmenu) { @@ -46,27 +47,27 @@ echo "<br />\n"; echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 06 0 0; '>" . _AM_PUBLISHER_FILE_EDITING . "</span>"; echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_EDITING_DSC . "</span>"; - publisher_openCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); + PublisherUtils::openCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); } else { // there's no parameter, so we're adding an item - $fileObj = $publisher->getHandler('file')->create(); + $fileObj = $publisher->getFileHandler()->create(); $fileObj->setVar('itemid', $itemid); if ($showmenu) { //publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_FILE_ADD); } echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 06 0 0; '>" . _AM_PUBLISHER_FILE_ADDING . "</span>"; echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_ADDING_DSC . "</span>"; - publisher_openCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); + PublisherUtils::openCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); } // FILES UPLOAD FORM - $files_form = $fileObj->getForm(); + $files_form = $publisher->getForm($fileObj, 'file'); $files_form->display(); if ($fileid != 0) { - publisher_closeCollapsableBar('editfile', 'editfileicon'); + PublisherUtils::closeCollapsableBar('editfile', 'editfileicon'); } else { - publisher_closeCollapsableBar('addfile', 'addfileicon'); + PublisherUtils::closeCollapsableBar('addfile', 'addfileicon'); } } @@ -75,12 +76,12 @@ /* -- Available operations -- */ switch ($op) { case "uploadfile"; - publisher_uploadFile(false, true, $false); + PublisherUtils::uploadFile(false, true, $false); exit; break; case "uploadanother"; - publisher_uploadFile(true, true, $false); + PublisherUtils::uploadFile(true, true, $false); exit; break; @@ -88,13 +89,10 @@ $fileid = isset($_GET['fileid']) ? $_GET['fileid'] : 0; $itemid = isset($_GET['itemid']) ? $_GET['itemid'] : 0; if (($fileid == 0) && ($itemid == 0)) { - redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_NOITEMSELECTED); - exit(); + $xoops->redirect("javascript:history.go(-1)", 3, _AM_PUBLISHER_NOITEMSELECTED); } - publisher_cpHeader(); - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; - + PublisherUtils::cpHeader(); publisher_editFile(true, $fileid, $itemid); break; @@ -102,10 +100,11 @@ $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0; // Creating the file object + /* @var $fileObj PublisherFile */ if ($fileid != 0) { - $fileObj = $publisher->getHandler('file')->get($fileid); + $fileObj = $publisher->getFileHandler()->get($fileid); } else { - $fileObj = $publisher->getHandler('file')->create(); + $fileObj = $publisher->getFileHandler()->create(); } // Putting the values in the file object @@ -115,11 +114,11 @@ // Storing the file if (!$fileObj->store()) { - redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid(), 3, _AM_PUBLISHER_FILE_EDITING_ERROR . publisher_formatErrors($fileObj->getErrors())); + $xoops->redirect('item.php?op=mod&itemid=' . $fileObj->getVar('itemid'), 3, _AM_PUBLISHER_FILE_EDITING_ERROR . PublisherUtils::formatErrors($fileObj->getErrors())); exit; } - redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid(), 2, _AM_PUBLISHER_FILE_EDITING_SUCCESS); + $xoops->redirect('item.php?op=mod&itemid=' . $fileObj->getVar('itemid'), 2, _AM_PUBLISHER_FILE_EDITING_SUCCESS); exit(); break; @@ -128,36 +127,30 @@ $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0; $fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : $fileid; - $fileObj = $publisher->getHandler('file')->get($fileid); + $fileObj = $publisher->getFileHandler()->get($fileid); $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; $title = isset($_POST['title']) ? $_POST['title'] : ''; if ($confirm) { - if (!$publisher->getHandler('file')->delete($fileObj)) { - redirect_header('item.php', 2, _AM_PUBLISHER_FILE_DELETE_ERROR); - exit; + if (!$publisher->getFileHandler()->delete($fileObj)) { + $xoops->redirect('item.php', 2, _AM_PUBLISHER_FILE_DELETE_ERROR); } - - redirect_header('item.php', 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->name())); - exit(); + $xoops->redirect('item.php', 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->getVar('name'))); } else { // no confirm: show deletion condition $fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : 0; - publisher_cpHeader(); - xoops_confirm(array('op' => 'del', 'fileid' => $fileObj->fileid(), 'confirm' => 1, 'name' => $fileObj->name()), 'file.php', _AM_PUBLISHER_DELETETHISFILE . " <br />" . $fileObj->name() . " <br /> <br />", _AM_PUBLISHER_DELETE); - xoops_cp_footer(); + PublisherUtils::cpHeader(); + $xoops->confirm(array('op' => 'del', 'fileid' => $fileObj->getVar('fileid'), 'confirm' => 1, 'name' => $fileObj->getVar('name')), 'file.php', _AM_PUBLISHER_DELETETHISFILE . " <br />" . $fileObj->getVar('name') . " <br /> <br />", _AM_PUBLISHER_DELETE); + $xoops->footer(); } - exit(); break; case "default": default: - publisher_cpHeader(); - //publisher_adminMenu(2, _AM_PUBLISHER_ITEMS); + PublisherUtils::cpHeader(); break; } -xoops_cp_footer(); -?> \ No newline at end of file +$xoops->footer(); \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/import/news.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/import/news.php 2012-12-12 22:08:20 UTC (rev 10372) +++ XoopsModules/publisher/trunk/publisher/admin/import/news.php 2012-12-12 23:26:38 UTC (rev 10373) @@ -34,11 +34,10 @@ } if ($op == 'start') { - xoops_load('XoopsFormLoader'); - publisher_cpHeader(); + PublisherUtils::cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisher_openCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); + PublisherUtils::openCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("topics")); list ($totalCat) = $xoopsDB->fetchRow($result); @@ -92,20 +91,20 @@ } } - publisher_closeCollapsableBar('newsimport', 'newsimporticon'); - xoops_cp_footer(); + PublisherUtils::closeCollapsableBar('newsimport', 'newsimporticon'); + $xoops->footer(); } if ($op == 'go') { - publisher_cpHeader(); + PublisherUtils::cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisher_openCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); + PublisherUtils::openCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); $module_handler = xoops_gethandler('module'); $moduleObj = $module_handler->getByDirname('news'); $news_module_id = $moduleObj->getVar('mid'); - $gperm_handler = xoops_gethandler('groupperm'); + $gperm_handler = $xoops->getHandlerGroupperm(); $cnt_imported_cat = 0; $cnt_imported_articles = 0; @@ -126,7 +125,7 @@ $newCat['oldid'] = $arrCat['topic_id']; $newCat['oldpid'] = $arrCat['topic_pid']; - $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj = $publisher->getCategoryHandler()->create(); $categoryObj->setVar('parentid', $arrCat['topic_pid']); $categoryObj->setVar('weight', 0); @@ -140,23 +139,23 @@ } } - if (!$publisher->getHandler('category')->insert($categoryObj)) { + if (!$publisher->getCategoryHandler()->insert($categoryObj)) { echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['topic_title']) . "<br/>"; continue; } - $newCat['newid'] = $categoryObj->categoryid(); + $newCat['newid'] = $categoryObj->getVar('categoryid'); $cnt_imported_cat++; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . "<br\>"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->getVar('name')) . "<br\>"; $sql = "SELECT * FROM " . $xoopsDB->prefix('stories') . " WHERE topicid=" . $arrCat['topic_id']; $resultArticles = $xoopsDB->query($sql); while ($arrArticle = $xoopsDB->fetchArray($resultArticles)) { // insert article - $itemObj = $publisher->getHandler('item')->create(); + $itemObj = $publisher->getItemHandler()->create(); - $itemObj->setVar('categoryid', $categoryObj->categoryid()); + $itemObj->setVar('categoryid', $categoryObj->getVar('categoryid')); $itemObj->setVar('title', $arrArticle['title']); $itemObj->setVar('uid', $arrArticle['uid']); $itemObj->setVar('summary', $arrArticle['hometext']); @@ -206,7 +205,7 @@ $fileObj->setVar('description', $arrFile['filedescript']); $fileObj->setVar('status', _PUBLISHER_STATUS_FILE_ACTIVE); $fileObj->setVar('uid', $arrArticle['uid']); - $fileObj->setVar('itemid', $itemObj->itemid()); + $fileObj->setVar('itemid', $itemObj->getVar('itemid')); $fileObj->setVar('mimetype', $arrFile['minetype']); $fileObj->setVar('datesub', $arrFile['date']); $fileObj->setVar('counter', $arrFile['counter']); @@ -219,7 +218,7 @@ } } */ - $newArticleArray[$arrArticle['storyid']] = $itemObj->itemid(); + $newArticleArray[$arrArticle['storyid']] = $itemObj->getVar('itemid'); echo " " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "<br />"; $cnt_imported_articles++; } @@ -228,9 +227,9 @@ // Saving category permissions $groupsIds = $gperm_handler->getGroupIds('news_view', $arrCat['topic_id'], $news_module_id); - publisher_saveCategoryPermissions($groupsIds, $categoryObj->categoryid(), 'category_read'); + PublisherUtils::saveCategoryPermissions($groupsIds, $categoryObj->getVar('categoryid'), 'category_read'); $groupsIds = $gperm_handler->getGroupIds('news_submit', $arrCat['topic_id'], $news_module_id); - publisher_saveCategoryPermissions($groupsIds, $categoryObj->categoryid(), 'item_submit'); + PublisherUtils::saveCategoryPermissions($groupsIds, $categoryObj->getVar('categoryid'), 'item_submit'); $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); @@ -247,7 +246,7 @@ } else { $newpid = $newCatArray[$oldpid]['newid']; } - $publisher->getHandler('category')->updateAll('parentid', $newpid, $criteria); + $publisher->getCategoryHandler()->updateAll('parentid', $newpid, $criteria); unset($criteria); } @@ -277,8 +276,8 @@ echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "<br/>"; echo "<br/><a href='" . PUBLISHER_URL . "/'>" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "</a><br/>"; - publisher_closeCollapsableBar('newsimportgo', 'newsimportgoicon'); - xoops_cp_footer(); + PublisherUtils::closeCollapsableBar('newsimportgo', 'newsimportgoicon'); + $xoops->footer(); } ?> \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php 2012-12-12 22:08:20 UTC (rev 10372) +++ XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php 2012-12-12 23:26:38 UTC (rev 10373) @@ -34,11 +34,10 @@ } if ($op == 'start') { - xoops_load('XoopsFormLoader'); - publisher_cpHeader(); + PublisherUtils::cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisher_openCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); + PublisherUtils::openCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("smartsection_categories")); list ($totalCat) = $xoopsDB->fetchRow($result); @@ -92,20 +91,20 @@ } } - publisher_closeCollapsableBar('newsimport', 'newsimporticon'); - xoops_cp_footer(); + PublisherUtils::closeCollapsableBar('newsimport', 'newsimporticon'); + $xoops->footer(); } if ($op == 'go') { - publisher_cpHeader(); + PublisherUtils::cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisher_openCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); + PublisherUtils::openCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); $module_handler = xoops_gethandler('module'); $moduleObj = $module_handler->getByDirname('smartsection'); $smartsection_module_id = $moduleObj->getVar('mid'); - $gperm_handler = xoops_gethandler('groupperm'); + $gperm_handler = $xoops->getHandlerGroupperm(); $cnt_imported_cat = 0; $cnt_imported_articles = 0; @@ -126,7 +125,7 @@ $newCat['oldid'] = $arrCat['categoryid']; $newCat['oldpid'] = $arrCat['parentid']; - $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj = $publisher->getCategoryHandler()->create(); $categoryObj->setVars($arrCat); $categoryObj->setVar('categoryid', 0); @@ -136,26 +135,26 @@ copy(XOOPS_ROOT_PATH . "/uploads/smartsection/images/category/" . $arrCat['image'], XOOPS_ROOT_PATH . "/uploads/publisher/images/category/" . $arrCat['image']); } - if (!$publisher->getHandler('category')->insert($categoryObj)) { + if (!$publisher->getCategoryHandler()->insert($categoryObj)) { echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['name']) . "<br/>"; continue; } - $newCat['newid'] = $categoryObj->categoryid(); + $newCat['newid'] = $categoryObj->getVar('categoryid'); $cnt_imported_cat++; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . "<br\>"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->getVar('name')) . "<br\>"; $sql = "SELECT * FROM " . $xoopsDB->prefix('smartsection_items') . " WHERE categoryid=" . $arrCat['categoryid']; $resultArticles = $xoopsDB->query($sql); while ($arrArticle = $xoopsDB->fetchArray($resultArticles)) { // insert article - $itemObj = $publisher->getHandler('item')->create(); + $itemObj = $publisher->getItemHandler()->create(); $itemObj->setVars($arrArticle); $itemObj->setVar('itemid', 0); - $itemObj->setVar('categoryid', $categoryObj->categoryid()); + $itemObj->setVar('categoryid', $categoryObj->getVar('categoryid')); // TODO: move article images to image manager @@ -187,7 +186,7 @@ $filename = XOOPS_ROOT_PATH . "/uploads/smartsection/" . $arrFile['filename']; if (file_exists($filename)) { if (copy($filename, XOOPS_ROOT_PATH . "/uploads/publisher/" . $arrFile['filename'])) { - $fileObj = $publisher->getHandler('file')->create(); + $fileObj = $publisher->getFileHandler()->create(); $fileObj->setVars($arrFile); $fileObj->setVar('fileid', 0); @@ -198,7 +197,7 @@ } } - $newArticleArray[$arrArticle['itemid']] = $itemObj->itemid(); + $newArticleArray[$arrArticle['itemid']] = $itemObj->getVar('itemid'); echo " " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "<br />"; $cnt_imported_articles++; } @@ -207,9 +206,9 @@ // Saving category permissions $groupsIds = $gperm_handler->getGroupIds('category_read', $arrCat['categoryid'], $smartsection_module_id); - publisher_saveCategoryPermissions($groupsIds, $categoryObj->categoryid(), 'category_read'); + PublisherUtils::saveCategoryPermissions($groupsIds, $categoryObj->getVar('categoryid'), 'category_read'); $groupsIds = $gperm_handler->getGroupIds('item_submit', $arrCat['categoryid'], $smartsection_module_id); - publisher_saveCategoryPermissions($groupsIds, $categoryObj->categoryid(), 'item_submit'); + PublisherUtils::saveCategoryPermissions($groupsIds, $categoryObj->getVar('categoryid'), 'item_submit'); $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); @@ -226,7 +225,7 @@ } else { $newpid = $newCatArray[$oldpid]['newid']; } - $publisher->getHandler('category')->updateAll('parentid', $newpid, $criteria); + $publisher->getCategoryHandler()->updateAll('parentid', $newpid, $criteria); unset($criteria); } @@ -256,8 +255,8 @@ echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "<br/>"; echo "<br/><a href='" . PUBLISHER_URL . "/'>" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "</a><br/>"; - publisher_closeCollapsableBar('newsimportgo', 'newsimportgoicon'); - xoops_cp_footer(); + PublisherUtils::closeCollapsableBar('newsimportgo', 'newsimportgoicon'); + $xoops->footer(); } ?> \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php 2012-12-12 22:08:20 UTC (rev 10372) +++ XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php 2012-12-12 23:26:38 UTC (rev 10373) @@ -34,11 +34,10 @@ } if ($op == 'start') { - xoops_load('XoopsFormLoader'); - publisher_cpHeader(); + PublisherUtils::cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisher_openCollapsableBar('wfsectionimport', 'wfsectionimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); + PublisherUtils::openCollapsableBar('wfsectionimport', 'wfsectionimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("wfs_category")); list ($totalCat) = $xoopsDB->fetchRow($result); @@ -90,14 +89,14 @@ } } - publisher_closeCollapsableBar('wfsectionimport', 'wfsectionimporticon'); - xoops_cp_footer(); + PublisherUtils::closeCollapsableBar('wfsectionimport', 'wfsectionimporticon'); + $xoops->footer(); } if ($op == 'go') { - publisher_cpHeader(); + PublisherUtils::cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisher_openCollapsableBar('wfsectionimportgo', 'wfsectionimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); + PublisherUtils::openCollapsableBar('wfsectionimportgo', 'wfsectionimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); $cnt_imported_cat = 0; $cnt_imported_articles = 0; @@ -116,7 +115,7 @@ $newCatArray = array(); while ($arrCat = $xoopsDB->fetchArray($resultCat)) { - $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj = $publisher->getCategoryHandler()->create(); $newCat = array(); @@ -145,22 +144,22 @@ continue; } - $newCat['newid'] = $categoryObj->categoryid(); + $newCat['newid'] = $categoryObj->getVar('categoryid'); // Saving category permissions - publisher_saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($categoryObj->getGroups_submit(), $categoryObj->categoryid(), 'item_submit'); + PublisherUtils::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->getVar('categoryid'), 'category_read'); + PublisherUtils::saveCategoryPermissions($categoryObj->getGroups_submit(), $categoryObj->getVar('categoryid'), 'item_submit'); $cnt_imported_cat++; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . "<br\>"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->getVar('name')) . "<br\>"; $sql = "SELECT * FROM " . $xoopsDB->prefix("wfs_article") . " WHERE categoryid=" . $arrCat['id'] . " ORDER BY weight"; $resultArticles = $xoopsDB->query($sql); while ($arrArticle = $xoopsDB->fetchArray($resultArticles)) { // insert article - $itemObj = $publisher->getHandler('item')->create(); + $itemObj = $publisher->getItemHandler()->create(); - $itemObj->setVar('categoryid', $categoryObj->categoryid()); + $itemObj->setVar('categoryid', $categoryOb... [truncated message content] |
From: <tr...@us...> - 2012-12-12 23:39:53
|
Revision: 10374 http://sourceforge.net/p/xoops/svn/10374 Author: trabis Date: 2012-12-12 23:39:48 +0000 (Wed, 12 Dec 2012) Log Message: ----------- I've accidentally committed 2.6 changes into this revision. I'm reverting it to 2.5.x state. New 2.6 publisher will be on 2.6 trunk Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/admin/about.php XoopsModules/publisher/trunk/publisher/admin/admin_header.php XoopsModules/publisher/trunk/publisher/admin/category.php XoopsModules/publisher/trunk/publisher/admin/clone.php XoopsModules/publisher/trunk/publisher/admin/file.php XoopsModules/publisher/trunk/publisher/admin/import/news.php XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php XoopsModules/publisher/trunk/publisher/admin/import/xfsection.php XoopsModules/publisher/trunk/publisher/admin/import.php XoopsModules/publisher/trunk/publisher/admin/index.php XoopsModules/publisher/trunk/publisher/admin/item.php XoopsModules/publisher/trunk/publisher/admin/main.php XoopsModules/publisher/trunk/publisher/admin/menu.php XoopsModules/publisher/trunk/publisher/admin/mimetypes.php XoopsModules/publisher/trunk/publisher/admin/pagewrap.php XoopsModules/publisher/trunk/publisher/admin/permissions.php XoopsModules/publisher/trunk/publisher/admin/preferences.php XoopsModules/publisher/trunk/publisher/admin/pw_delete_file.php XoopsModules/publisher/trunk/publisher/admin/pw_upload_file.php XoopsModules/publisher/trunk/publisher/archive.php XoopsModules/publisher/trunk/publisher/author_items.php XoopsModules/publisher/trunk/publisher/backend.php XoopsModules/publisher/trunk/publisher/blocks/category_items_sel.php XoopsModules/publisher/trunk/publisher/blocks/date_to_date.php XoopsModules/publisher/trunk/publisher/blocks/items_columns.php XoopsModules/publisher/trunk/publisher/blocks/items_menu.php XoopsModules/publisher/trunk/publisher/blocks/items_new.php XoopsModules/publisher/trunk/publisher/blocks/items_random_item.php XoopsModules/publisher/trunk/publisher/blocks/items_recent.php XoopsModules/publisher/trunk/publisher/blocks/items_spot.php XoopsModules/publisher/trunk/publisher/blocks/latest_files.php XoopsModules/publisher/trunk/publisher/blocks/latest_news.php XoopsModules/publisher/trunk/publisher/blocks/search.php XoopsModules/publisher/trunk/publisher/category.php XoopsModules/publisher/trunk/publisher/class/blockform.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/file.php XoopsModules/publisher/trunk/publisher/class/form/category.php XoopsModules/publisher/trunk/publisher/class/form/file.php XoopsModules/publisher/trunk/publisher/class/form/item.php XoopsModules/publisher/trunk/publisher/class/groupperm.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/class/metagen.php XoopsModules/publisher/trunk/publisher/class/mimetype.php XoopsModules/publisher/trunk/publisher/class/permission.php XoopsModules/publisher/trunk/publisher/class/publisher.php XoopsModules/publisher/trunk/publisher/class/rating.php XoopsModules/publisher/trunk/publisher/class/request.php XoopsModules/publisher/trunk/publisher/class/themetabform.php XoopsModules/publisher/trunk/publisher/class/uploader.php XoopsModules/publisher/trunk/publisher/comment_delete.php XoopsModules/publisher/trunk/publisher/comment_edit.php XoopsModules/publisher/trunk/publisher/comment_new.php XoopsModules/publisher/trunk/publisher/comment_post.php XoopsModules/publisher/trunk/publisher/comment_reply.php XoopsModules/publisher/trunk/publisher/file.php XoopsModules/publisher/trunk/publisher/footer.php XoopsModules/publisher/trunk/publisher/header.php XoopsModules/publisher/trunk/publisher/include/ajax_rating.php XoopsModules/publisher/trunk/publisher/include/ajax_upload.php XoopsModules/publisher/trunk/publisher/include/comment_functions.php XoopsModules/publisher/trunk/publisher/include/common.php XoopsModules/publisher/trunk/publisher/include/notification.inc.php XoopsModules/publisher/trunk/publisher/include/plugin.tag.php XoopsModules/publisher/trunk/publisher/include/search.inc.php XoopsModules/publisher/trunk/publisher/include/seo.inc.php XoopsModules/publisher/trunk/publisher/include/update.php XoopsModules/publisher/trunk/publisher/index.php XoopsModules/publisher/trunk/publisher/item.php XoopsModules/publisher/trunk/publisher/list.tag.php XoopsModules/publisher/trunk/publisher/makepdf.php XoopsModules/publisher/trunk/publisher/notification_update.php XoopsModules/publisher/trunk/publisher/pop.php XoopsModules/publisher/trunk/publisher/print.php XoopsModules/publisher/trunk/publisher/rate.php XoopsModules/publisher/trunk/publisher/search.php XoopsModules/publisher/trunk/publisher/submit.php XoopsModules/publisher/trunk/publisher/view.tag.php XoopsModules/publisher/trunk/publisher/visit.php XoopsModules/publisher/trunk/publisher/xoops_version.php Added Paths: ----------- XoopsModules/publisher/trunk/publisher/class/highlighter.php XoopsModules/publisher/trunk/publisher/include/constants.php XoopsModules/publisher/trunk/publisher/include/functions.php XoopsModules/publisher/trunk/publisher/include/media.textsanitizer.php XoopsModules/publisher/trunk/publisher/include/seo_functions.php Removed Paths: ------------- XoopsModules/publisher/trunk/publisher/class/utils.php XoopsModules/publisher/trunk/publisher/preloads/ Modified: XoopsModules/publisher/trunk/publisher/admin/about.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/about.php 2012-12-12 23:26:38 UTC (rev 10373) +++ XoopsModules/publisher/trunk/publisher/admin/about.php 2012-12-12 23:39:48 UTC (rev 10374) @@ -20,12 +20,13 @@ * @version $Id$ */ -include dirname(__FILE__) . '/admin_header.php'; -$xoops = Xoops::getInstance(); -$xoops->header(); +include_once dirname(__FILE__) . '/admin_header.php'; -$aboutAdmin = new XoopsModuleAdmin(); -$aboutAdmin->displayNavigation('about.php'); -$aboutAdmin->displayAbout('6KJ7RW5DR3VTJ', false); +xoops_cp_header(); -$xoops->footer(); \ No newline at end of file +$aboutAdmin = new ModuleAdmin(); + +echo $aboutAdmin->addNavigation('about.php'); +echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); + +xoops_cp_footer(); \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/admin_header.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2012-12-12 23:26:38 UTC (rev 10373) +++ XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2012-12-12 23:39:48 UTC (rev 10374) @@ -20,10 +20,27 @@ */ include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; +include_once dirname(dirname(__FILE__)) . '/include/common.php'; +include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; -$xoops = Xoops::getInstance(); -$publisher = Publisher::getInstance(); -$publisher->loadLanguage('modinfo'); +//xoops_loadLanguage('admin', PUBLISHER_DIRNAME); +xoops_loadLanguage('modinfo', PUBLISHER_DIRNAME); -XoopsLoad::loadFile($xoops->path(dirname(dirname(__FILE__)) . '/include/common.php')); -XoopsLoad::loadFile($xoops->path(XOOPS_ROOT_PATH . '/include/cp_header.php')); +$imagearray = array( + 'editimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_edit.png' alt='" . _AM_PUBLISHER_ICO_EDIT . "' align='middle' />", + 'deleteimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_delete.png' alt='" . _AM_PUBLISHER_ICO_DELETE . "' align='middle' />", + 'online' => "<img src='" . PUBLISHER_IMAGES_URL . "/on.png' alt='" . _AM_PUBLISHER_ICO_ONLINE . "' align='middle' />", + 'offline' => "<img src='" . PUBLISHER_IMAGES_URL . "/off.png' alt='" . _AM_PUBLISHER_ICO_OFFLINE . "' align='middle' />", +); +if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))){ + include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); +}else{ + echo xoops_error('/Frameworks/moduleclasses/moduleadmin/ is required!!!'); +} +/* +$myts =& MyTextSanitizer::getInstance(); + +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} */ \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/category.php 2012-12-12 23:26:38 UTC (rev 10373) +++ XoopsModules/publisher/trunk/publisher/admin/category.php 2012-12-12 23:39:48 UTC (rev 10374) @@ -21,7 +21,6 @@ include_once dirname(__FILE__) . '/admin_header.php'; -$xoops = Xoops::getInstance(); $op = PublisherRequest::getString('op'); $op = isset($_POST['editor']) ? 'mod' : $op; @@ -36,19 +35,20 @@ switch ($op) { case "del": - /* @var $categoryObj PublisherCategory */ - $categoryObj = $publisher->getCategoryHandler()->get($categoryid); + $categoryObj = $publisher->getHandler('category')->get($categoryid); $confirm = (isset($_POST['confirm'])) ? $_POST['confirm'] : 0; $name = (isset($_POST['name'])) ? $_POST['name'] : ''; if ($confirm) { - if (!$publisher->getCategoryHandler()->delete($categoryObj)) { - $xoops->redirect("category.php", 1, _AM_PUBLISHER_DELETE_CAT_ERROR); + if (!$publisher->getHandler('category')->delete($categoryObj)) { + redirect_header("category.php", 1, _AM_PUBLISHER_DELETE_CAT_ERROR); + exit(); } - $xoops->redirect("category.php", 1, sprintf(_AM_PUBLISHER_COLISDELETED, $name)); + redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_COLISDELETED, $name)); + exit(); } else { - $xoops->header(); - $xoops->confirm(array('op' => 'del', 'categoryid' => $categoryObj->getVar('categoryid'), 'confirm' => 1, 'name' => $categoryObj->getVar('name')), 'category.php', _AM_PUBLISHER_DELETECOL . " '" . $categoryObj->getVar('name') . "'. <br /> <br />" . _AM_PUBLISHER_DELETE_CAT_CONFIRM, _AM_PUBLISHER_DELETE); - $xoops->footer(); + xoops_cp_header(); + xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_PUBLISHER_DELETECOL . " '" . $categoryObj->name() . "'. <br /> <br />" . _AM_PUBLISHER_DELETE_CAT_CONFIRM, _AM_PUBLISHER_DELETE); + xoops_cp_footer(); } break; @@ -58,7 +58,7 @@ $nb_subcats = $nb_subcats + (isset($_POST['nb_sub_yet']) ? intval($_POST['nb_sub_yet']) : 4); //end of fx2024 code - PublisherUtils::cpHeader(); + publisher_cpHeader(); publisher_editCat(true, $categoryid, $nb_subcats); break; @@ -66,11 +66,11 @@ global $modify; $parentid = PublisherRequest::getInt('parentid'); - /* @var $categoryObj PublisherCategory */ + if ($categoryid != 0) { - $categoryObj = $publisher->getCategoryHandler()->get($categoryid); + $categoryObj = $publisher->getHandler('category')->get($categoryid); } else { - $categoryObj = $publisher->getCategoryHandler()->create(); + $categoryObj = $publisher->getHandler('category')->create(); } // Uploading the image, if any @@ -82,17 +82,20 @@ $max_size = $publisher->getConfig('maximum_filesize'); $max_imgwidth = $publisher->getConfig('maximum_image_width'); $max_imgheight = $publisher->getConfig('maximum_image_height'); - $allowed_mimetypes = PublisherUtils::getAllowedImagesTypes(); + $allowed_mimetypes = publisher_getAllowedImagesTypes(); if ($_FILES[$filename]['tmp_name'] == "" || !is_readable($_FILES[$filename]['tmp_name'])) { - $xoops->redirect('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR); + redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR); + exit(); } - $uploader = new PublisherUploader(PublisherUtils::getImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); + xoops_load('XoopsMediaUploader'); + $uploader = new XoopsMediaUploader(publisher_getImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); if ($uploader->fetchMedia($filename) && $uploader->upload()) { $categoryObj->setVar('image', $uploader->getSavedFileName()); } else { - $xoops->redirect('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR . $uploader->getErrors()); + redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR . $uploader->getErrors()); + exit(); } } } else { @@ -143,34 +146,37 @@ } if (!$categoryObj->store()) { - $xoops->redirect("javascript:history.go(-1)", 3, _AM_PUBLISHER_CATEGORY_SAVE_ERROR . PublisherUtils::formatErrors($categoryObj->getErrors())); + redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_CATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); + exit; } // TODO : put this function in the category class - PublisherUtils::saveCategoryPermissions($grpread, $categoryObj->getVar('categoryid'), 'category_read'); - PublisherUtils::saveCategoryPermissions($grpsubmit, $categoryObj->getVar('categoryid'), 'item_submit'); - PublisherUtils::saveCategoryPermissions($grpmoderation, $categoryObj->getVar('categoryid'), 'category_moderation'); + publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); + publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); + publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); //Added by fx2024 - $parentCat = $categoryObj->getVar('categoryid'); + $parentCat = $categoryObj->categoryid(); $sizeof = sizeof($_POST['scname']); for ($i = 0; $i < $sizeof; $i++) { if ($_POST['scname'][$i] != '') { - $categoryObj = $publisher->getCategoryHandler()->create(); + $categoryObj = $publisher->getHandler('category')->create(); $categoryObj->setVar('name', $_POST['scname'][$i]); $categoryObj->setVar('parentid', $parentCat); if (!$categoryObj->store()) { - $xoops->redirect("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . PublisherUtils::formatErrors($categoryObj->getErrors())); + redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); + exit; } // TODO : put this function in the category class - PublisherUtils::saveCategoryPermissions($grpread, $categoryObj->getVar('categoryid'), 'category_read'); - PublisherUtils::saveCategoryPermissions($grpsubmit, $categoryObj->getVar('categoryid'), 'item_submit'); - PublisherUtils::saveCategoryPermissions($grpmoderation, $categoryObj->getVar('categoryid'), 'category_moderation'); + publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); + publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); + publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); } } //end of fx2024 code - $xoops->redirect($redirect_to, 2, $redirect_msg); + redirect_header($redirect_to, 2, $redirect_msg); + exit(); break; //Added by fx2024 @@ -179,7 +185,7 @@ $categoryid = 0; $nb_subcats = intval($_POST['nb_subcats']) + $_POST['nb_sub_yet']; - $categoryObj = $publisher->getCategoryHandler()->create(); + $categoryObj = $publisher->getHandler('category')->create(); $categoryObj->setVar('name', $_POST['name']); $categoryObj->setVar('description', $_POST['description']); $categoryObj->setVar('weight', $_POST['weight']); @@ -187,7 +193,7 @@ $categoryObj->setVar('parentid', $parentCat); } - PublisherUtils::cpHeader(); + publisher_cpHeader(); publisher_editCat(true, $categoryid, $nb_subcats, $categoryObj); exit(); @@ -195,11 +201,12 @@ //end of fx2024 code case "cancel": - $xoops->redirect("category.php", 1, sprintf(_AM_PUBLISHER_BACK2IDX, '')); - break; + redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_BACK2IDX, '')); + exit(); + case "default": default: - PublisherUtils::cpHeader(); + publisher_cpHeader(); //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES); echo "<br />\n"; @@ -209,9 +216,9 @@ echo "</div></form>"; // Creating the objects for top categories - $categoriesObj = $publisher->getCategoryHandler()->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0); + $categoriesObj = $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0); - PublisherUtils::openCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC); + publisher_openCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC); echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; echo "<tr>"; @@ -219,7 +226,7 @@ echo "<td width='60' class='bg3' width='65' align='center'><strong>" . _CO_PUBLISHER_WEIGHT . "</strong></td>"; echo "<td width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; echo "</tr>"; - $totalCategories = $publisher->getCategoryHandler()->getCategoriesCount(0); + $totalCategories = $publisher->getHandler('category')->getCategoriesCount(0); if (count($categoriesObj) > 0) { foreach ($categoriesObj as $key => $thiscat) { publisher_displayCategory($thiscat); @@ -231,29 +238,30 @@ $categoryid = '0'; } echo "</table>\n"; + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; $pagenav = new XoopsPageNav($totalCategories, $publisher->getConfig('idxcat_perpage'), $startcategory, 'startcategory'); echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; echo "<br />"; - PublisherUtils::closeCollapsableBar('createdcategories', 'createdcategoriesicon'); + publisher_closeCollapsableBar('createdcategories', 'createdcategoriesicon'); echo "<br>"; //editcat(false); break; } -$xoops->footer(); +xoops_cp_footer(); -function publisher_displayCategory(PublisherCategory $categoryObj, $level = 0) +function publisher_displayCategory($categoryObj, $level = 0) { - $publisher = Publisher::getInstance(); + $publisher = PublisherPublisher::getInstance(); - $description = $categoryObj->getVar('description'); + $description = $categoryObj->description(); if (!XOOPS_USE_MULTIBYTES) { if (strlen($description) >= 100) { $description = substr($description, 0, (100 - 1)) . "..."; } } - $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->getVar('categoryid') . "&parentid=" . $categoryObj->getVar('parentid') . "'><img src='" . PUBLISHER_URL . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITCOL . "' alt='" . _AM_PUBLISHER_EDITCOL . "' /></a>"; - $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->getVar('categoryid') . "'><img src='" . PUBLISHER_URL . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETECOL . "' alt='" . _AM_PUBLISHER_DELETECOL . "' /></a>"; + $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "&parentid=" . $categoryObj->parentid() . "'><img src='" . PUBLISHER_URL . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITCOL . "' alt='" . _AM_PUBLISHER_EDITCOL . "' /></a>"; + $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . PUBLISHER_URL . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETECOL . "' alt='" . _AM_PUBLISHER_DELETECOL . "' /></a>"; $spaces = ''; for ($j = 0; $j < $level; $j++) { @@ -261,14 +269,14 @@ } echo "<tr>"; - echo "<td class='even' align='left'>" . $spaces . "<a href='" . PUBLISHER_URL . "/category.php?categoryid=" . $categoryObj->getVar('categoryid') . "'><img src='" . PUBLISHER_URL . "/images/links/subcat.gif' alt='' /> " . $categoryObj->getVar('name') . "</a></td>"; - echo "<td class='even' align='center'>" . $categoryObj->getVar('weight') . "</td>"; + echo "<td class='even' align='left'>" . $spaces . "<a href='" . PUBLISHER_URL . "/category.php?categoryid=" . $categoryObj->categoryid() . "'><img src='" . PUBLISHER_URL . "/images/links/subcat.gif' alt='' /> " . $categoryObj->name() . "</a></td>"; + echo "<td class='even' align='center'>" . $categoryObj->weight() . "</td>"; echo "<td class='even' align='center'> $modify $delete </td>"; echo "</tr>"; - $subCategoriesObj = $publisher->getCategoryHandler()->getCategories(0, 0, $categoryObj->getVar('categoryid')); + $subCategoriesObj = $publisher->getHandler('category')->getCategories(0, 0, $categoryObj->categoryid()); if (count($subCategoriesObj) > 0) { $level++; - foreach ($subCategoriesObj as $thiscat) { + foreach ($subCategoriesObj as $key => $thiscat) { publisher_displayCategory($thiscat, $level); } } @@ -277,20 +285,19 @@ function publisher_editCat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryObj = null) { - $xoops = Xoops::getInstance(); - $publisher = Publisher::getInstance(); - /* @var $categoryObj PublisherCategory */ + $publisher = PublisherPublisher::getInstance(); // if there is a parameter, and the id exists, retrieve data: we're editing a category if ($categoryid != 0) { // Creating the category object for the selected category - $categoryObj = $publisher->getCategoryHandler()->get($categoryid); + $categoryObj = $publisher->getHandler('category')->get($categoryid); if ($categoryObj->notLoaded()) { - $xoops->redirect("category.php", 1, _AM_PUBLISHER_NOCOLTOEDIT); + redirect_header("category.php", 1, _AM_PUBLISHER_NOCOLTOEDIT); + exit(); } } else { if (!$categoryObj) { - $categoryObj = $publisher->getCategoryHandler()->create(); + $categoryObj = $publisher->getHandler('category')->create(); } } @@ -299,36 +306,34 @@ //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_EDITING); } echo "<br />\n"; - PublisherUtils::openCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO); + publisher_openCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO); } else { if ($showmenu) { //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_CREATINGNEW); } - PublisherUtils::openCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO); + publisher_openCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO); } - /* @var $sform PublisherCategoryForm */ - $sform = $publisher->getForm($categoryObj, 'category'); - $sform->setSubCatsCount($nb_subcats); + $sform = $categoryObj->getForm($nb_subcats); $sform->display(); if (!$categoryid) { - PublisherUtils::closeCollapsableBar('createtable', 'createtableicon'); + publisher_closeCollapsableBar('createtable', 'createtableicon'); } else { - PublisherUtils::closeCollapsableBar('edittable', 'edittableicon'); + publisher_closeCollapsableBar('edittable', 'edittableicon'); } //Added by fx2024 if ($categoryid) { $sel_cat = $categoryid; - PublisherUtils::openCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC); + publisher_openCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC); // Get the total number of sub-categories - $categoriesObj = $publisher->getCategoryHandler()->get($sel_cat); - $totalsubs = $publisher->getCategoryHandler()->getCategoriesCount($sel_cat); + $categoriesObj = $publisher->getHandler('category')->get($sel_cat); + $totalsubs = $publisher->getHandler('category')->getCategoriesCount($sel_cat); // creating the categories objects that are published - $subcatsObj = $publisher->getCategoryHandler()->getCategories(0, 0, $categoriesObj->getVar('categoryid')); - + $subcatsObj = $publisher->getHandler('category')->getCategories(0, 0, $categoriesObj->categoryid()); + $totalSCOnPage = count($subcatsObj); echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; echo "<tr>"; echo "<td width='60' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATID . "</strong></td>"; @@ -337,14 +342,13 @@ echo "<td width='60' class='bg3' align='right'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; echo "</tr>"; if ($totalsubs > 0) { - /* @var $subcat PublisherCategory */ foreach ($subcatsObj as $subcat) { - $modify = "<a href='category.php?op=mod&categoryid=" . $subcat->getVar('categoryid') . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_MODIFY . "' alt='" . _AM_PUBLISHER_MODIFY . "' /></a>"; - $delete = "<a href='category.php?op=del&categoryid=" . $subcat->getVar('categoryid') . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETE . "' alt='" . _AM_PUBLISHER_DELETE . "' /></a>"; + $modify = "<a href='category.php?op=mod&categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_MODIFY . "' alt='" . _AM_PUBLISHER_MODIFY . "' /></a>"; + $delete = "<a href='category.php?op=del&categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETE . "' alt='" . _AM_PUBLISHER_DELETE . "' /></a>"; echo "<tr>"; - echo "<td class='head' align='left'>" . $subcat->getVar('categoryid') . "</td>"; - echo "<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/category.php?categoryid=" . $subcat->getVar('categoryid') . "&parentid=" . $subcat->getVar('parentid'). "'>" . $subcat->getVar('name') . "</a></td>"; - echo "<td class='even' align='left'>" . $subcat->getVar('description') . "</td>"; + echo "<td class='head' align='left'>" . $subcat->categoryid() . "</td>"; + echo "<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/category.php?categoryid=" . $subcat->categoryid() . "&parentid=" . $subcat->parentid() . "'>" . $subcat->name() . "</a></td>"; + echo "<td class='even' align='left'>" . $subcat->description() . "</td>"; echo "<td class='even' align='right'> {$modify} {$delete} </td>"; echo "</tr>"; } @@ -355,16 +359,16 @@ } echo "</table>\n"; echo "<br />\n"; - PublisherUtils::closeCollapsableBar('subcatstable', 'subcatsicon'); + publisher_closeCollapsableBar('subcatstable', 'subcatsicon'); - PublisherUtils::openCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC); + publisher_openCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC); $startitem = PublisherRequest::getInt('startitem'); // Get the total number of published ITEMS - $totalitems = $publisher->getItemHandler()->getItemsCount($sel_cat, array(_PUBLISHER_STATUS_PUBLISHED)); + $totalitems = $publisher->getHandler('item')->getItemsCount($sel_cat, array(_PUBLISHER_STATUS_PUBLISHED)); // creating the items objects that are published - $itemsObj = $publisher->getItemHandler()->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $sel_cat); + $itemsObj = $publisher->getHandler('item')->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $sel_cat); $totalitemsOnPage = count($itemsObj); - $allcats = $publisher->getCategoryHandler()->getObjects(null, true); + $allcats = $publisher->getHandler('category')->getObjects(null, true); echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; echo "<tr>"; echo "<td width='40' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ITEMID . "</strong></td>"; @@ -375,18 +379,19 @@ echo "</tr>"; if ($totalitems > 0) { for ($i = 0; $i < $totalitemsOnPage; $i++) { - $categoryObj =& $allcats[$itemsObj[$i]->getVar('categoryid')]; - $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->getVar('itemid'). "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; - $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->getVar('itemid'). "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; + $categoryObj =& $allcats[$itemsObj[$i]->categoryid()]; + $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; + $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; echo "<tr>"; - echo "<td class='head' align='center'>" . $itemsObj[$i]->getVar('itemid'). "</td>"; - echo "<td class='even' align='left'>" . $categoryObj->getVar('name') . "</td>"; + echo "<td class='head' align='center'>" . $itemsObj[$i]->itemid() . "</td>"; + echo "<td class='even' align='left'>" . $categoryObj->name() . "</td>"; echo "<td class='even' align='left'>" . $itemsObj[$i]->getitemLink() . "</td>"; echo "<td class='even' align='center'>" . $itemsObj[$i]->datesub('s') . "</td>"; echo "<td class='even' align='center'> $modify $delete </td>"; echo "</tr>"; } } else { + $itemid = -1; echo "<tr>"; echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOITEMS . "</td>"; echo "</tr>"; @@ -395,6 +400,7 @@ echo "<br />\n"; $parentid = PublisherRequest::getInt('parentid'); $pagenav_extra_args = "op=mod&categoryid=$sel_cat&parentid=$parentid"; + xoops_load('XoopsPageNav'); $pagenav = new XoopsPageNav($totalitems, $publisher->getConfig('idxcat_perpage'), $startitem, 'startitem', $pagenav_extra_args); echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; echo "<input type='button' name='button' onclick=\"location='item.php?op=mod&categoryid=" . $sel_cat . "'\" value='" . _AM_PUBLISHER_CREATEITEM . "'> "; Modified: XoopsModules/publisher/trunk/publisher/admin/clone.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/clone.php 2012-12-12 23:26:38 UTC (rev 10373) +++ XoopsModules/publisher/trunk/publisher/admin/clone.php 2012-12-12 23:39:48 UTC (rev 10374) @@ -20,28 +20,28 @@ include_once dirname(__FILE__) . "/admin_header.php"; -$xoops = Xoops::getInstance(); -PublisherUtils::cpHeader(); +publisher_cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_CLONE); -PublisherUtils::openCollapsableBar('clone', 'cloneicon', _AM_PUBLISHER_CLONE, _AM_PUBLISHER_CLONE_DSC); +publisher_openCollapsableBar('clone', 'cloneicon', _AM_PUBLISHER_CLONE, _AM_PUBLISHER_CLONE_DSC); if (@$_POST['op'] == 'submit') { - if (!$xoops->security()->check()) { - $xoops->redirect('clone.php', 3, implode('<br />', $xoops->security()->getErrors())); + if (!$GLOBALS['xoopsSecurity']->check()) { + redirect_header('clone.php', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); + exit(); } $clone = $_POST['clone']; //check if name is valid if (empty($clone) || preg_match('/[^a-zA-Z0-9\_\-]/', $clone)) { - $xoops->redirect('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_INVALIDNAME, $clone)); + redirect_header('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_INVALIDNAME, $clone)); exit(); } // Check wether the cloned module exists or not if ($clone && is_dir(XOOPS_ROOT_PATH . '/modules/' . $clone)) { - $xoops->redirect('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_EXISTS, $clone)); + redirect_header('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_EXISTS, $clone)); } $patterns = array( @@ -67,6 +67,7 @@ echo $msg; } else { + include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; $form = new XoopsThemeForm(sprintf(_AM_PUBLISHER_CLONE_TITLE, $publisher->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true); $clone = new XoopsFormText(_AM_PUBLISHER_CLONE_NAME, 'clone', 20, 20, ''); $clone->setDescription(_AM_PUBLISHER_CLONE_NAME_DSC); @@ -77,8 +78,8 @@ } // End of collapsable bar -PublisherUtils::closeCollapsableBar('clone', 'cloneicon'); -$xoops->footer(); +publisher_closeCollapsableBar('clone', 'cloneicon'); +xoops_cp_footer(); // work around for PHP < 5.0.x if (!function_exists('file_put_contents')) { @@ -161,4 +162,6 @@ imagepng($imageModule, XOOPS_ROOT_PATH . "/modules/" . $dirname . "/images/module_logo.png"); imagedestroy($imageModule); return true; -} \ No newline at end of file +} + +?> \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/file.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/file.php 2012-12-12 23:26:38 UTC (rev 10373) +++ XoopsModules/publisher/trunk/publisher/admin/file.php 2012-12-12 23:39:48 UTC (rev 10374) @@ -20,24 +20,23 @@ */ include_once dirname(__FILE__) . '/admin_header.php'; -$xoops = Xoops::getInstance(); $op = PublisherRequest::getString('op'); function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0) { - $publisher = Publisher::getInstance(); - $xoops = Xoops::getInstance(); + $publisher = PublisherPublisher::getInstance(); + include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; // if there is a parameter, and the id exists, retrieve data: we're editing a file if ($fileid != 0) { // Creating the File object - /* @var $fileObj PublisherFile */ - $fileObj = $publisher->getFileHandler()->get($fileid); + $fileObj = $publisher->getHandler('file')->get($fileid); if ($fileObj->notLoaded()) { - $xoops->redirect("javascript:history.go(-1)", 1, _AM_PUBLISHER_NOFILESELECTED); + redirect_header("javascript:history.go(-1)", 1, _AM_PUBLISHER_NOFILESELECTED); + exit(); } if ($showmenu) { @@ -47,27 +46,27 @@ echo "<br />\n"; echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 06 0 0; '>" . _AM_PUBLISHER_FILE_EDITING . "</span>"; echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_EDITING_DSC . "</span>"; - PublisherUtils::openCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); + publisher_openCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); } else { // there's no parameter, so we're adding an item - $fileObj = $publisher->getFileHandler()->create(); + $fileObj = $publisher->getHandler('file')->create(); $fileObj->setVar('itemid', $itemid); if ($showmenu) { //publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_FILE_ADD); } echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 06 0 0; '>" . _AM_PUBLISHER_FILE_ADDING . "</span>"; echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_ADDING_DSC . "</span>"; - PublisherUtils::openCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); + publisher_openCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); } // FILES UPLOAD FORM - $files_form = $publisher->getForm($fileObj, 'file'); + $files_form = $fileObj->getForm(); $files_form->display(); if ($fileid != 0) { - PublisherUtils::closeCollapsableBar('editfile', 'editfileicon'); + publisher_closeCollapsableBar('editfile', 'editfileicon'); } else { - PublisherUtils::closeCollapsableBar('addfile', 'addfileicon'); + publisher_closeCollapsableBar('addfile', 'addfileicon'); } } @@ -76,12 +75,12 @@ /* -- Available operations -- */ switch ($op) { case "uploadfile"; - PublisherUtils::uploadFile(false, true, $false); + publisher_uploadFile(false, true, $false); exit; break; case "uploadanother"; - PublisherUtils::uploadFile(true, true, $false); + publisher_uploadFile(true, true, $false); exit; break; @@ -89,10 +88,13 @@ $fileid = isset($_GET['fileid']) ? $_GET['fileid'] : 0; $itemid = isset($_GET['itemid']) ? $_GET['itemid'] : 0; if (($fileid == 0) && ($itemid == 0)) { - $xoops->redirect("javascript:history.go(-1)", 3, _AM_PUBLISHER_NOITEMSELECTED); + redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_NOITEMSELECTED); + exit(); } - PublisherUtils::cpHeader(); + publisher_cpHeader(); + include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; + publisher_editFile(true, $fileid, $itemid); break; @@ -100,11 +102,10 @@ $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0; // Creating the file object - /* @var $fileObj PublisherFile */ if ($fileid != 0) { - $fileObj = $publisher->getFileHandler()->get($fileid); + $fileObj = $publisher->getHandler('file')->get($fileid); } else { - $fileObj = $publisher->getFileHandler()->create(); + $fileObj = $publisher->getHandler('file')->create(); } // Putting the values in the file object @@ -114,11 +115,11 @@ // Storing the file if (!$fileObj->store()) { - $xoops->redirect('item.php?op=mod&itemid=' . $fileObj->getVar('itemid'), 3, _AM_PUBLISHER_FILE_EDITING_ERROR . PublisherUtils::formatErrors($fileObj->getErrors())); + redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid(), 3, _AM_PUBLISHER_FILE_EDITING_ERROR . publisher_formatErrors($fileObj->getErrors())); exit; } - $xoops->redirect('item.php?op=mod&itemid=' . $fileObj->getVar('itemid'), 2, _AM_PUBLISHER_FILE_EDITING_SUCCESS); + redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid(), 2, _AM_PUBLISHER_FILE_EDITING_SUCCESS); exit(); break; @@ -127,30 +128,36 @@ $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0; $fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : $fileid; - $fileObj = $publisher->getFileHandler()->get($fileid); + $fileObj = $publisher->getHandler('file')->get($fileid); $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; $title = isset($_POST['title']) ? $_POST['title'] : ''; if ($confirm) { - if (!$publisher->getFileHandler()->delete($fileObj)) { - $xoops->redirect('item.php', 2, _AM_PUBLISHER_FILE_DELETE_ERROR); + if (!$publisher->getHandler('file')->delete($fileObj)) { + redirect_header('item.php', 2, _AM_PUBLISHER_FILE_DELETE_ERROR); + exit; } - $xoops->redirect('item.php', 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->getVar('name'))); + + redirect_header('item.php', 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->name())); + exit(); } else { // no confirm: show deletion condition $fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : 0; - PublisherUtils::cpHeader(); - $xoops->confirm(array('op' => 'del', 'fileid' => $fileObj->getVar('fileid'), 'confirm' => 1, 'name' => $fileObj->getVar('name')), 'file.php', _AM_PUBLISHER_DELETETHISFILE . " <br />" . $fileObj->getVar('name') . " <br /> <br />", _AM_PUBLISHER_DELETE); - $xoops->footer(); + publisher_cpHeader(); + xoops_confirm(array('op' => 'del', 'fileid' => $fileObj->fileid(), 'confirm' => 1, 'name' => $fileObj->name()), 'file.php', _AM_PUBLISHER_DELETETHISFILE . " <br />" . $fileObj->name() . " <br /> <br />", _AM_PUBLISHER_DELETE); + xoops_cp_footer(); } + exit(); break; case "default": default: - PublisherUtils::cpHeader(); + publisher_cpHeader(); + //publisher_adminMenu(2, _AM_PUBLISHER_ITEMS); break; } -$xoops->footer(); \ No newline at end of file +xoops_cp_footer(); +?> \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/import/news.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/import/news.php 2012-12-12 23:26:38 UTC (rev 10373) +++ XoopsModules/publisher/trunk/publisher/admin/import/news.php 2012-12-12 23:39:48 UTC (rev 10374) @@ -34,10 +34,11 @@ } if ($op == 'start') { + xoops_load('XoopsFormLoader'); - PublisherUtils::cpHeader(); + publisher_cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - PublisherUtils::openCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); + publisher_openCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("topics")); list ($totalCat) = $xoopsDB->fetchRow($result); @@ -91,20 +92,20 @@ } } - PublisherUtils::closeCollapsableBar('newsimport', 'newsimporticon'); - $xoops->footer(); + publisher_closeCollapsableBar('newsimport', 'newsimporticon'); + xoops_cp_footer(); } if ($op == 'go') { - PublisherUtils::cpHeader(); + publisher_cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - PublisherUtils::openCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); + publisher_openCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); $module_handler = xoops_gethandler('module'); $moduleObj = $module_handler->getByDirname('news'); $news_module_id = $moduleObj->getVar('mid'); - $gperm_handler = $xoops->getHandlerGroupperm(); + $gperm_handler = xoops_gethandler('groupperm'); $cnt_imported_cat = 0; $cnt_imported_articles = 0; @@ -125,7 +126,7 @@ $newCat['oldid'] = $arrCat['topic_id']; $newCat['oldpid'] = $arrCat['topic_pid']; - $categoryObj = $publisher->getCategoryHandler()->create(); + $categoryObj = $publisher->getHandler('category')->create(); $categoryObj->setVar('parentid', $arrCat['topic_pid']); $categoryObj->setVar('weight', 0); @@ -139,23 +140,23 @@ } } - if (!$publisher->getCategoryHandler()->insert($categoryObj)) { + if (!$publisher->getHandler('category')->insert($categoryObj)) { echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['topic_title']) . "<br/>"; continue; } - $newCat['newid'] = $categoryObj->getVar('categoryid'); + $newCat['newid'] = $categoryObj->categoryid(); $cnt_imported_cat++; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->getVar('name')) . "<br\>"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . "<br\>"; $sql = "SELECT * FROM " . $xoopsDB->prefix('stories') . " WHERE topicid=" . $arrCat['topic_id']; $resultArticles = $xoopsDB->query($sql); while ($arrArticle = $xoopsDB->fetchArray($resultArticles)) { // insert article - $itemObj = $publisher->getItemHandler()->create(); + $itemObj = $publisher->getHandler('item')->create(); - $itemObj->setVar('categoryid', $categoryObj->getVar('categoryid')); + $itemObj->setVar('categoryid', $categoryObj->categoryid()); $itemObj->setVar('title', $arrArticle['title']); $itemObj->setVar('uid', $arrArticle['uid']); $itemObj->setVar('summary', $arrArticle['hometext']); @@ -205,7 +206,7 @@ $fileObj->setVar('description', $arrFile['filedescript']); $fileObj->setVar('status', _PUBLISHER_STATUS_FILE_ACTIVE); $fileObj->setVar('uid', $arrArticle['uid']); - $fileObj->setVar('itemid', $itemObj->getVar('itemid')); + $fileObj->setVar('itemid', $itemObj->itemid()); $fileObj->setVar('mimetype', $arrFile['minetype']); $fileObj->setVar('datesub', $arrFile['date']); $fileObj->setVar('counter', $arrFile['counter']); @@ -218,7 +219,7 @@ } } */ - $newArticleArray[$arrArticle['storyid']] = $itemObj->getVar('itemid'); + $newArticleArray[$arrArticle['storyid']] = $itemObj->itemid(); echo " " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "<br />"; $cnt_imported_articles++; } @@ -227,9 +228,9 @@ // Saving category permissions $groupsIds = $gperm_handler->getGroupIds('news_view', $arrCat['topic_id'], $news_module_id); - PublisherUtils::saveCategoryPermissions($groupsIds, $categoryObj->getVar('categoryid'), 'category_read'); + publisher_saveCategoryPermissions($groupsIds, $categoryObj->categoryid(), 'category_read'); $groupsIds = $gperm_handler->getGroupIds('news_submit', $arrCat['topic_id'], $news_module_id); - PublisherUtils::saveCategoryPermissions($groupsIds, $categoryObj->getVar('categoryid'), 'item_submit'); + publisher_saveCategoryPermissions($groupsIds, $categoryObj->categoryid(), 'item_submit'); $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); @@ -246,7 +247,7 @@ } else { $newpid = $newCatArray[$oldpid]['newid']; } - $publisher->getCategoryHandler()->updateAll('parentid', $newpid, $criteria); + $publisher->getHandler('category')->updateAll('parentid', $newpid, $criteria); unset($criteria); } @@ -276,8 +277,8 @@ echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "<br/>"; echo "<br/><a href='" . PUBLISHER_URL . "/'>" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "</a><br/>"; - PublisherUtils::closeCollapsableBar('newsimportgo', 'newsimportgoicon'); - $xoops->footer(); + publisher_closeCollapsableBar('newsimportgo', 'newsimportgoicon'); + xoops_cp_footer(); } ?> \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php 2012-12-12 23:26:38 UTC (rev 10373) +++ XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php 2012-12-12 23:39:48 UTC (rev 10374) @@ -34,10 +34,11 @@ } if ($op == 'start') { + xoops_load('XoopsFormLoader'); - PublisherUtils::cpHeader(); + publisher_cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - PublisherUtils::openCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); + publisher_openCollapsableBar('newsimport', 'newsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("smartsection_categories")); list ($totalCat) = $xoopsDB->fetchRow($result); @@ -91,20 +92,20 @@ } } - PublisherUtils::closeCollapsableBar('newsimport', 'newsimporticon'); - $xoops->footer(); + publisher_closeCollapsableBar('newsimport', 'newsimporticon'); + xoops_cp_footer(); } if ($op == 'go') { - PublisherUtils::cpHeader(); + publisher_cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - PublisherUtils::openCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); + publisher_openCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); $module_handler = xoops_gethandler('module'); $moduleObj = $module_handler->getByDirname('smartsection'); $smartsection_module_id = $moduleObj->getVar('mid'); - $gperm_handler = $xoops->getHandlerGroupperm(); + $gperm_handler = xoops_gethandler('groupperm'); $cnt_imported_cat = 0; $cnt_imported_articles = 0; @@ -125,7 +126,7 @@ $newCat['oldid'] = $arrCat['categoryid']; $newCat['oldpid'] = $arrCat['parentid']; - $categoryObj = $publisher->getCategoryHandler()->create(); + $categoryObj = $publisher->getHandler('category')->create(); $categoryObj->setVars($arrCat); $categoryObj->setVar('categoryid', 0); @@ -135,26 +136,26 @@ copy(XOOPS_ROOT_PATH . "/uploads/smartsection/images/category/" . $arrCat['image'], XOOPS_ROOT_PATH . "/uploads/publisher/images/category/" . $arrCat['image']); } - if (!$publisher->getCategoryHandler()->insert($categoryObj)) { + if (!$publisher->getHandler('category')->insert($categoryObj)) { echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_ERROR, $arrCat['name']) . "<br/>"; continue; } - $newCat['newid'] = $categoryObj->getVar('categoryid'); + $newCat['newid'] = $categoryObj->categoryid(); $cnt_imported_cat++; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->getVar('name')) . "<br\>"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . "<br\>"; $sql = "SELECT * FROM " . $xoopsDB->prefix('smartsection_items') . " WHERE categoryid=" . $arrCat['categoryid']; $resultArticles = $xoopsDB->query($sql); while ($arrArticle = $xoopsDB->fetchArray($resultArticles)) { // insert article - $itemObj = $publisher->getItemHandler()->create(); + $itemObj = $publisher->getHandler('item')->create(); $itemObj->setVars($arrArticle); $itemObj->setVar('itemid', 0); - $itemObj->setVar('categoryid', $categoryObj->getVar('categoryid')); + $itemObj->setVar('categoryid', $categoryObj->categoryid()); // TODO: move article images to image manager @@ -186,7 +187,7 @@ $filename = XOOPS_ROOT_PATH . "/uploads/smartsection/" . $arrFile['filename']; if (file_exists($filename)) { if (copy($filename, XOOPS_ROOT_PATH . "/uploads/publisher/" . $arrFile['filename'])) { - $fileObj = $publisher->getFileHandler()->create(); + $fileObj = $publisher->getHandler('file')->create(); $fileObj->setVars($arrFile); $fileObj->setVar('fileid', 0); @@ -197,7 +198,7 @@ } } - $newArticleArray[$arrArticle['itemid']] = $itemObj->getVar('itemid'); + $newArticleArray[$arrArticle['itemid']] = $itemObj->itemid(); echo " " . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->title()) . "<br />"; $cnt_imported_articles++; } @@ -206,9 +207,9 @@ // Saving category permissions $groupsIds = $gperm_handler->getGroupIds('category_read', $arrCat['categoryid'], $smartsection_module_id); - PublisherUtils::saveCategoryPermissions($groupsIds, $categoryObj->getVar('categoryid'), 'category_read'); + publisher_saveCategoryPermissions($groupsIds, $categoryObj->categoryid(), 'category_read'); $groupsIds = $gperm_handler->getGroupIds('item_submit', $arrCat['categoryid'], $smartsection_module_id); - PublisherUtils::saveCategoryPermissions($groupsIds, $categoryObj->getVar('categoryid'), 'item_submit'); + publisher_saveCategoryPermissions($groupsIds, $categoryObj->categoryid(), 'item_submit'); $newCatArray[$newCat['oldid']] = $newCat; unset($newCat); @@ -225,7 +226,7 @@ } else { $newpid = $newCatArray[$oldpid]['newid']; } - $publisher->getCategoryHandler()->updateAll('parentid', $newpid, $criteria); + $publisher->getHandler('category')->updateAll('parentid', $newpid, $criteria); unset($criteria); } @@ -255,8 +256,8 @@ echo sprintf(_AM_PUBLISHER_IMPORTED_ARTICLES, $cnt_imported_articles) . "<br/>"; echo "<br/><a href='" . PUBLISHER_URL . "/'>" . _AM_PUBLISHER_IMPORT_GOTOMODULE . "</a><br/>"; - PublisherUtils::closeCollapsableBar('newsimportgo', 'newsimportgoicon'); - $xoops->footer(); + publisher_closeCollapsableBar('newsimportgo', 'newsimportgoicon'); + xoops_cp_footer(); } ?> \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php 2012-12-12 23:26:38 UTC (rev 10373) +++ XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php 2012-12-12 23:39:48 UTC (rev 10374) @@ -34,10 +34,11 @@ } if ($op == 'start') { + xoops_load('XoopsFormLoader'); - PublisherUtils::cpHeader(); + publisher_cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - PublisherUtils::openCollapsableBar('wfsectionimport', 'wfsectionimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); + publisher_openCollapsableBar('wfsectionimport', 'wfsectionimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("wfs_category")); list ($totalCat) = $xoopsDB->fetchRow($result); @@ -89,14 +90,14 @@ } } - PublisherUtils::closeCollapsableBar('wfsectionimport', 'wfsectionimporticon'); - $xoops->footer(); + publisher_closeCollapsableBar('wfsectionimport', 'wfsectionimporticon'); + xoops_cp_footer(); } if ($op == 'go') { - PublisherUtils::cpHeader(); + publisher_cpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - PublisherUtils::openCollapsableBar('wfsectionimportgo', 'wfsectionimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); + publisher_openCollapsableBar('wfsectionimportgo', 'wfsectionimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT); $cnt_imported_cat = 0; $cnt_imported_articles = 0; @@ -115,7 +116,7 @@ $newCatArray = array(); while ($arrCat = $xoopsDB->fetchArray($resultCat)) { - $categoryObj = $publisher->getCategoryHandler()->create(); + $categoryObj = $publisher->getHandler('category')->create(); $newCat = array(); @@ -144,22 +145,22 @@ continue; } - $newCat['newid'] = $categoryObj->getVar('categoryid'); + $newCat['newid'] = $categoryObj->categoryid(); // Saving category permissions - PublisherUtils::saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->getVar('categoryid'), 'category_read'); - PublisherUtils::saveCategoryPermissions($categoryObj->getGroups_submit(), $categoryObj->getVar('categoryid'), 'item_submit'); + publisher_saveCategoryPermissions($categoryObj->getGroups_read(), $categoryObj->categoryid(), 'category_read'); + publisher_saveCategoryPermissions($categoryObj->getGroups_submit(), $categoryObj->categoryid(), 'item_submit'); $cnt_imported_cat++; - echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->getVar('name')) . "<br\>"; + echo sprintf(_AM_PUBLISHER_IMPORT_CATEGORY_SUCCESS, $categoryObj->name()) . "<br\>"; $sql = "SELECT * FROM " . $xoopsDB->prefix("wfs_article") . " WHERE categoryid=" . $arrCat['id'] . " ORDER BY weight"; $resultArticles = $xoopsDB->query($sql); while ($arrArticle = $xoopsDB->fetchArray($resultArticles)) { // insert article - $itemObj = $publisher->getItemHandler()->create(); + $itemObj = $publisher->getHandler('item')->create(); - $itemObj->setVar('categoryid', $categoryObj->getVar('categoryid')); + $itemObj->setVar('categoryid', $categoryObj->catego... [truncated message content] |
From: <tr...@us...> - 2013-01-03 19:31:26
|
Revision: 10645 http://sourceforge.net/p/xoops/svn/10645 Author: trabis Date: 2013-01-03 19:31:21 +0000 (Thu, 03 Jan 2013) Log Message: ----------- Fixing permissions error in categories. Passing permissions by reference to save memory. Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/archive.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/form/item.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/class/permission.php XoopsModules/publisher/trunk/publisher/include/functions.php Modified: XoopsModules/publisher/trunk/publisher/archive.php =================================================================== --- XoopsModules/publisher/trunk/publisher/archive.php 2013-01-03 16:09:42 UTC (rev 10644) +++ XoopsModules/publisher/trunk/publisher/archive.php 2013-01-03 19:31:21 UTC (rev 10645) @@ -134,7 +134,7 @@ $itemhandler->field_link = 'categoryid'; $itemhandler->field_object = 'categoryid'; // Categories for which user has access - $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted =& $publisher->getHandler('permission')->getGrantedItems('category_read'); $grantedCategories = new Criteria('l.categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); $criteria = new CriteriaCompo(); $criteria->add($grantedCategories, 'AND'); Modified: XoopsModules/publisher/trunk/publisher/class/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/category.php 2013-01-03 16:09:42 UTC (rev 10644) +++ XoopsModules/publisher/trunk/publisher/class/category.php 2013-01-03 19:31:21 UTC (rev 10645) @@ -94,7 +94,7 @@ if (is_object($xoopsUser) && $xoopsUser->getVar('uid') == $this->moderator()) { return true; } - $categoriesGranted = $this->publisher->getHandler('permission')->isGranted('category_read'); + $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (in_array($this->categoryid(), $categoriesGranted)) { $ret = true; } @@ -464,7 +464,7 @@ $criteria->add(new Criteria('parentid', $parentid)); } if (!$publisher_isAdmin) { - $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } @@ -502,7 +502,7 @@ $criteria->setSort('name'); $criteria->setOrder('ASC'); if (!$publisher_isAdmin) { - $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('item_submit'); + $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('item_submit'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } @@ -541,7 +541,7 @@ $criteria->setSort('name'); $criteria->setOrder('ASC'); if (!$publisher_isAdmin) { - $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } @@ -584,7 +584,7 @@ if (isset($parentid) && ($parentid != -1)) { $criteria->add(new criteria('parentid', $parentid)); if (!$publisher_isAdmin) { - $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } @@ -609,7 +609,7 @@ $criteria = new CriteriaCompo(new Criteria('parentid', "(" . implode(',', array_keys($categories)) . ")", 'IN')); $ret = array(); if (!$publisher_isAdmin) { - $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } Modified: XoopsModules/publisher/trunk/publisher/class/form/item.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/form/item.php 2013-01-03 16:09:42 UTC (rev 10644) +++ XoopsModules/publisher/trunk/publisher/class/form/item.php 2013-01-03 19:31:21 UTC (rev 10645) @@ -113,10 +113,8 @@ global $xoopsConfig, $xoopsUser; $publisher = PublisherPublisher::getInstance(); - $checkperm = $this->checkperm; $allowed_editors = publisher_getEditors($publisher->getHandler('permission')->getGrantedItems('editors')); - $form_view = $publisher->getHandler('permission')->getGrantedItems('form_view'); if (!is_object($xoopsUser)) { $group = array(XOOPS_GROUP_ANONYMOUS); Modified: XoopsModules/publisher/trunk/publisher/class/item.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-03 16:09:42 UTC (rev 10644) +++ XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-03 19:31:21 UTC (rev 10645) @@ -1221,7 +1221,7 @@ if (!$publisher_isAdmin) { $criteriaPermissions = new CriteriaCompo(); // Categories for which user has access - $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); $grantedCategories = new Criteria('categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); $criteriaPermissions->add($grantedCategories, 'AND'); } @@ -1373,7 +1373,7 @@ if (!$publisher_isAdmin) { $criteriaPermissions = new CriteriaCompo(); // Categories for which user has access - $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); $grantedCategories = new Criteria('categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); $criteriaPermissions->add($grantedCategories, 'AND'); } Modified: XoopsModules/publisher/trunk/publisher/class/permission.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/permission.php 2013-01-03 16:09:42 UTC (rev 10644) +++ XoopsModules/publisher/trunk/publisher/class/permission.php 2013-01-03 19:31:21 UTC (rev 10645) @@ -72,60 +72,24 @@ } /** - * @param string $gperm_name - * - * @return array - */ - public function getGrantedGroups($gperm_name) - { - static $items; - if (isset($items[$gperm_name])) { - return $items[$gperm_name]; - } - $groups = array(); - $criteria = new CriteriaCompo(); - $criteria->add(new Criteria('gperm_modid', $this->publisher->getModule()->getVar('mid'))); - $criteria->add(new Criteria('gperm_name', $gperm_name)); - //Instead of calling groupperm handler and get objects, we will save some memory and do it our way - $db = XoopsDatabaseFactory::getDatabaseConnection(); - $limit = $start = 0; - $sql = 'SELECT gperm_groupid FROM ' . $db->prefix('group_permission'); - if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { - $sql .= ' ' . $criteria->renderWhere(); - $limit = $criteria->getLimit(); - $start = $criteria->getStart(); - } - $result = $db->query($sql, $limit, $start); - while ($myrow = $db->fetchArray($result)) { - $groups[$myrow['gperm_groupid']] = $myrow['gperm_groupid']; - } - $items[$gperm_name] = $groups; - //Return the permission array - return $groups; - } - - /** * Returns permissions for a certain type * * @param string $gperm_name "global", "forum" or "topic" (should perhaps have "post" as well - but I don't know) - * @param int $id id of the item (forum, topic or possibly post) to get permissions for * * @return array */ - public function getGrantedItems($gperm_name, $id = 0) + public function getGrantedItems($gperm_name) { static $items; - if (isset($items[$gperm_name][$id])) { - return $items[$gperm_name][$id]; + if (isset($items[$gperm_name])) { + return $items[$gperm_name]; } global $xoopsUser; $ret = array(); //Instead of calling groupperm handler and get objects, we will save some memory and do it our way $criteria = new CriteriaCompo(new Criteria('gperm_name', $gperm_name)); $criteria->add(new Criteria('gperm_modid', $this->publisher->getModule()->getVar('mid'))); - if ($id != 0) { - $criteria->add(new Criteria('gperm_itemid', $id)); - } + //Get user's groups $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS); $criteria2 = new CriteriaCompo(); @@ -140,31 +104,26 @@ while ($myrow = $db->fetchArray($result)) { $ret[$myrow['gperm_itemid']] = $myrow['gperm_itemid']; } - $items[$gperm_name][$id] = $ret; + $items[$gperm_name] = $ret; return $ret; } /** - * @param string $gperm_name - * @param int|null $id + * @param string $gperm_name + * @param int $id * * @return bool */ - public function isGranted($gperm_name, $id = null) + public function isGranted($gperm_name, $id) { - $permissions = $this->getGrantedItems($gperm_name, $id); - if ($id == null) { - if (!empty($permissions)) { - return true; - } else { - return false; - } + if (!$id) { + return false; + } + $permissions =& $this->getGrantedItems($gperm_name); + if (!empty($permissions) && isset ($permissions[$id])) { + return true; } else { - if (!empty($permissions) && isset ($permissions[$id])) { - return true; - } else { - return false; - } + return false; } } Modified: XoopsModules/publisher/trunk/publisher/include/functions.php =================================================================== --- XoopsModules/publisher/trunk/publisher/include/functions.php 2013-01-03 16:09:42 UTC (rev 10644) +++ XoopsModules/publisher/trunk/publisher/include/functions.php 2013-01-03 19:31:21 UTC (rev 10645) @@ -383,7 +383,7 @@ function publisher_userIsModerator($itemObj) { $publisher = PublisherPublisher::getInstance(); - $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_moderation'); + $categoriesGranted =& $publisher->getHandler('permission')->getGrantedItems('category_moderation'); return (is_object($itemObj) && in_array($itemObj->categoryid(), $categoriesGranted)); } |
From: <tr...@us...> - 2013-01-03 20:52:34
|
Revision: 10647 http://sourceforge.net/p/xoops/svn/10647 Author: trabis Date: 2013-01-03 20:52:31 +0000 (Thu, 03 Jan 2013) Log Message: ----------- Improving memory usage. Fixing bug: all categories/items are shown in index page when user does not have any category access Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/category.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/index.php Modified: XoopsModules/publisher/trunk/publisher/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/category.php 2013-01-03 19:49:51 UTC (rev 10646) +++ XoopsModules/publisher/trunk/publisher/category.php 2013-01-03 20:52:31 UTC (rev 10647) @@ -102,7 +102,7 @@ if ($publisher->getConfig('idxcat_display_last_item') == 1) { // Get the last smartitem - $last_itemObj = $publisher->getHandler('item')->getLastPublishedByCat(); + $last_itemObj = $publisher->getHandler('item')->getLastPublishedByCat(array($categoryObj)); } $lastitemsize = intval($publisher->getConfig('idxcat_last_item_size')); Modified: XoopsModules/publisher/trunk/publisher/class/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/category.php 2013-01-03 19:49:51 UTC (rev 10646) +++ XoopsModules/publisher/trunk/publisher/class/category.php 2013-01-03 20:52:31 UTC (rev 10647) @@ -467,6 +467,8 @@ $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); + } else { + return array(); } if (is_object($xoopsUser)) { $criteria->add(new Criteria('moderator', $xoopsUser->getVar('uid')), 'OR'); @@ -505,6 +507,8 @@ $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('item_submit'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); + } else { + return $ret; } if (is_object($xoopsUser)) { $criteria->add(new Criteria('moderator', $xoopsUser->getVar('uid')), 'OR'); @@ -544,6 +548,8 @@ $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); + } else { + return $ret; } if (is_object($xoopsUser)) { $criteria->add(new Criteria('moderator', $xoopsUser->getVar('uid')), 'OR'); @@ -587,6 +593,8 @@ $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); + } else { + return 0; } if (is_object($xoopsUser)) { $criteria->add(new Criteria('moderator', $xoopsUser->getVar('uid')), 'OR'); @@ -612,7 +620,10 @@ $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); + } else { + return $ret; } + if (is_object($xoopsUser)) { $criteria->add(new Criteria('moderator', $xoopsUser->getVar('uid')), 'OR'); } Modified: XoopsModules/publisher/trunk/publisher/class/item.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-03 19:49:51 UTC (rev 10646) +++ XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-03 20:52:31 UTC (rev 10647) @@ -18,9 +18,7 @@ * @version $Id$ */ defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); - include_once dirname(dirname(__FILE__)) . '/include/common.php'; - class PublisherItem extends XoopsObject { /** @@ -1222,8 +1220,12 @@ $criteriaPermissions = new CriteriaCompo(); // Categories for which user has access $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); - $grantedCategories = new Criteria('categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); - $criteriaPermissions->add($grantedCategories, 'AND'); + if (!empty($categoriesGranted)) { + $grantedCategories = new Criteria('categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); + $criteriaPermissions->add($grantedCategories, 'AND'); + } else { + return 0; + } } if (isset($categoryid) && $categoryid != -1) { $criteriaCategory = new criteria('categoryid', $categoryid); @@ -1374,8 +1376,12 @@ $criteriaPermissions = new CriteriaCompo(); // Categories for which user has access $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); - $grantedCategories = new Criteria('categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); - $criteriaPermissions->add($grantedCategories, 'AND'); + if (!empty($grantedCategories)) { + $grantedCategories = new Criteria('categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); + $criteriaPermissions->add($grantedCategories, 'AND'); + } else { + return array(); + } } if (isset($categoryid) && ($categoryid != -1)) { $criteriaCategory = new criteria('categoryid', $categoryid); @@ -1592,13 +1598,21 @@ } /** - * @param array $status + * @param array $categoriesObj + * @param array $status * * @return array */ - public function getLastPublishedByCat($status = array(_PUBLISHER_STATUS_PUBLISHED)) + public function getLastPublishedByCat($categoriesObj, $status = array(_PUBLISHER_STATUS_PUBLISHED)) { $ret = array(); + $catIds = array(); + foreach ($categoriesObj as $category) { + $catIds[] = $category->getVar('categoryid'); + } + if (empty($catIds)) { + return $ret; + } /*$cat = array(); $sql = "SELECT categoryid, MAX(datesub) as date FROM " . $this->db->prefix('publisher_items') . " WHERE status IN (" . implode(',', $status) . ") GROUP BY categoryid"; @@ -1627,6 +1641,7 @@ $sql = "SELECT mi.categoryid, mi.itemid, mi.title, mi.short_url, mi.uid, mi.datesub"; $sql .= " FROM (SELECT categoryid, MAX(datesub) AS date FROM " . $this->db->prefix('publisher_items'); $sql .= " WHERE status IN (" . implode(',', $status) . ")"; + $sql .= " AND categoryid IN (" . implode(',', $catIds) . ")"; $sql .= " GROUP BY categoryid)mo"; $sql .= " JOIN " . $this->db->prefix('publisher_items') . " mi ON mi.datesub = mo.date"; $result = $this->db->query($sql); Modified: XoopsModules/publisher/trunk/publisher/index.php =================================================================== --- XoopsModules/publisher/trunk/publisher/index.php 2013-01-03 19:49:51 UTC (rev 10646) +++ XoopsModules/publisher/trunk/publisher/index.php 2013-01-03 20:52:31 UTC (rev 10647) @@ -65,7 +65,7 @@ if ($publisher->getConfig('idxcat_display_last_item') == 1) { // Get the last item in each category - $last_itemObj = $publisher->getHandler('item')->getLastPublishedByCat(); + $last_itemObj = $publisher->getHandler('item')->getLastPublishedByCat(array_merge($categoriesObj, $subcats)); } // Max size of the title in the last item column |
From: <tr...@us...> - 2013-01-04 19:22:51
|
Revision: 10661 http://sourceforge.net/p/xoops/svn/10661 Author: trabis Date: 2013-01-04 19:22:48 +0000 (Fri, 04 Jan 2013) Log Message: ----------- Fixing category permissions bug. Removing assign by reference for non variables. Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/admin/admin_header.php XoopsModules/publisher/trunk/publisher/admin/category.php XoopsModules/publisher/trunk/publisher/admin/item.php XoopsModules/publisher/trunk/publisher/admin/main.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/class/permission.php XoopsModules/publisher/trunk/publisher/include/functions.php Modified: XoopsModules/publisher/trunk/publisher/admin/admin_header.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2013-01-04 19:12:30 UTC (rev 10660) +++ XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2013-01-04 19:22:48 UTC (rev 10661) @@ -38,7 +38,7 @@ echo xoops_error('/Frameworks/moduleclasses/moduleadmin/ is required!!!'); } /* -$myts =& MyTextSanitizer::getInstance(); +$myts = MyTextSanitizer::getInstance(); if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { include_once(XOOPS_ROOT_PATH."/class/template.php"); Modified: XoopsModules/publisher/trunk/publisher/admin/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/category.php 2013-01-04 19:12:30 UTC (rev 10660) +++ XoopsModules/publisher/trunk/publisher/admin/category.php 2013-01-04 19:22:48 UTC (rev 10661) @@ -379,7 +379,7 @@ echo "</tr>"; if ($totalitems > 0) { for ($i = 0; $i < $totalitemsOnPage; $i++) { - $categoryObj =& $allcats[$itemsObj[$i]->categoryid()]; + $categoryObj = $allcats[$itemsObj[$i]->categoryid()]; $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; echo "<tr>"; Modified: XoopsModules/publisher/trunk/publisher/admin/item.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/item.php 2013-01-04 19:12:30 UTC (rev 10660) +++ XoopsModules/publisher/trunk/publisher/admin/item.php 2013-01-04 19:22:48 UTC (rev 10661) @@ -194,7 +194,7 @@ echo "</tr>"; if ($totalitems > 0) { for ($i = 0; $i < $totalItemsOnPage; $i++) { - $categoryObj =& $itemsObj[$i]->category(); + $categoryObj = $itemsObj[$i]->category(); $approve = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . PUBLISHER_URL . "/images/links/approve.gif' title='" . _AM_PUBLISHER_SUBMISSION_MODERATE . "' alt='" . _AM_PUBLISHER_SUBMISSION_MODERATE . "' /></a> "; $clone = ''; @@ -243,7 +243,7 @@ echo "</tr>"; if ($totalitems > 0) { for ($i = 0; $i < $totalItemsOnPage; $i++) { - $categoryObj =& $itemsObj[$i]->category(); + $categoryObj = $itemsObj[$i]->category(); $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . PUBLISHER_URL . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . PUBLISHER_URL . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; @@ -290,7 +290,7 @@ echo "</tr>"; if ($totalitems > 0) { for ($i = 0; $i < $totalItemsOnPage; $i++) { - $categoryObj =& $itemsObj[$i]->category(); + $categoryObj = $itemsObj[$i]->category(); $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . PUBLISHER_URL . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . PUBLISHER_URL . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; @@ -338,7 +338,7 @@ echo "</tr>"; if ($totalitems > 0) { for ($i = 0; $i < $totalItemsOnPage; $i++) { - $categoryObj =& $itemsObj[$i]->category(); + $categoryObj = $itemsObj[$i]->category(); $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . PUBLISHER_URL . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . PUBLISHER_URL . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; Modified: XoopsModules/publisher/trunk/publisher/admin/main.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/main.php 2013-01-04 19:12:30 UTC (rev 10660) +++ XoopsModules/publisher/trunk/publisher/admin/main.php 2013-01-04 19:22:48 UTC (rev 10661) @@ -226,7 +226,7 @@ for ($i = 0; $i < $totalItemsOnPage; $i++) { // Creating the category object to which this item is linked - $categoryObj =& $itemsObj[$i]->category(); + $categoryObj = $itemsObj[$i]->category(); $approve = ''; switch ($itemsObj[$i]->status()) { Modified: XoopsModules/publisher/trunk/publisher/class/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/category.php 2013-01-04 19:12:30 UTC (rev 10660) +++ XoopsModules/publisher/trunk/publisher/class/category.php 2013-01-04 19:22:48 UTC (rev 10661) @@ -94,7 +94,7 @@ if (is_object($xoopsUser) && $xoopsUser->getVar('uid') == $this->moderator()) { return true; } - $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (in_array($this->categoryid(), $categoriesGranted)) { $ret = true; } @@ -464,7 +464,7 @@ $criteria->add(new Criteria('parentid', $parentid)); } if (!$publisher_isAdmin) { - $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } else { @@ -504,7 +504,7 @@ $criteria->setSort('name'); $criteria->setOrder('ASC'); if (!$publisher_isAdmin) { - $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('item_submit'); + $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('item_submit'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } else { @@ -545,7 +545,7 @@ $criteria->setSort('name'); $criteria->setOrder('ASC'); if (!$publisher_isAdmin) { - $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } else { @@ -590,7 +590,7 @@ if (isset($parentid) && ($parentid != -1)) { $criteria->add(new criteria('parentid', $parentid)); if (!$publisher_isAdmin) { - $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } else { @@ -617,7 +617,7 @@ $criteria = new CriteriaCompo(new Criteria('parentid', "(" . implode(',', array_keys($categories)) . ")", 'IN')); $ret = array(); if (!$publisher_isAdmin) { - $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (count($categoriesGranted) > 0) { $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); } else { Modified: XoopsModules/publisher/trunk/publisher/class/item.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-04 19:12:30 UTC (rev 10660) +++ XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-04 19:22:48 UTC (rev 10661) @@ -1219,7 +1219,7 @@ if (!$publisher_isAdmin) { $criteriaPermissions = new CriteriaCompo(); // Categories for which user has access - $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); if (!empty($categoriesGranted)) { $grantedCategories = new Criteria('categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); $criteriaPermissions->add($grantedCategories, 'AND'); @@ -1375,8 +1375,8 @@ if (!$publisher_isAdmin) { $criteriaPermissions = new CriteriaCompo(); // Categories for which user has access - $categoriesGranted =& $this->publisher->getHandler('permission')->getGrantedItems('category_read'); - if (!empty($grantedCategories)) { + $categoriesGranted = $this->publisher->getHandler('permission')->getGrantedItems('category_read'); + if (!empty($categoriesGranted)) { $grantedCategories = new Criteria('categoryid', "(" . implode(',', $categoriesGranted) . ")", 'IN'); $criteriaPermissions->add($grantedCategories, 'AND'); } else { Modified: XoopsModules/publisher/trunk/publisher/class/permission.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/permission.php 2013-01-04 19:12:30 UTC (rev 10660) +++ XoopsModules/publisher/trunk/publisher/class/permission.php 2013-01-04 19:22:48 UTC (rev 10661) @@ -119,7 +119,7 @@ if (!$id) { return false; } - $permissions =& $this->getGrantedItems($gperm_name); + $permissions = $this->getGrantedItems($gperm_name); if (!empty($permissions) && isset ($permissions[$id])) { return true; } else { Modified: XoopsModules/publisher/trunk/publisher/include/functions.php =================================================================== --- XoopsModules/publisher/trunk/publisher/include/functions.php 2013-01-04 19:12:30 UTC (rev 10660) +++ XoopsModules/publisher/trunk/publisher/include/functions.php 2013-01-04 19:22:48 UTC (rev 10661) @@ -383,7 +383,7 @@ function publisher_userIsModerator($itemObj) { $publisher = PublisherPublisher::getInstance(); - $categoriesGranted =& $publisher->getHandler('permission')->getGrantedItems('category_moderation'); + $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_moderation'); return (is_object($itemObj) && in_array($itemObj->categoryid(), $categoriesGranted)); } |
From: <tr...@us...> - 2013-01-09 22:03:22
|
Revision: 10727 http://sourceforge.net/p/xoops/svn/10727 Author: trabis Date: 2013-01-09 22:03:19 +0000 (Wed, 09 Jan 2013) Log Message: ----------- Fixing bug in index page Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/index.php Modified: XoopsModules/publisher/trunk/publisher/class/item.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-09 21:43:27 UTC (rev 10726) +++ XoopsModules/publisher/trunk/publisher/class/item.php 2013-01-09 22:03:19 UTC (rev 10727) @@ -1607,8 +1607,11 @@ { $ret = array(); $catIds = array(); - foreach ($categoriesObj as $category) { - $catIds[] = $category->getVar('categoryid'); + foreach ($categoriesObj as $parentid) { + foreach ($parentid as $category) { + $catId = $category->getVar('categoryid'); + $catIds[$catId] = $catId; + } } if (empty($catIds)) { return $ret; Modified: XoopsModules/publisher/trunk/publisher/index.php =================================================================== --- XoopsModules/publisher/trunk/publisher/index.php 2013-01-09 21:43:27 UTC (rev 10726) +++ XoopsModules/publisher/trunk/publisher/index.php 2013-01-09 22:03:19 UTC (rev 10727) @@ -53,7 +53,7 @@ redirect_header("javascript:history.go(-1)", 2, _MD_PUBLISHER_NO_CAT_EXISTS); exit; } - //exit('here'); + // Get subcats of the top categories $subcats = $publisher->getHandler('category')->getSubCats($categoriesObj); @@ -65,7 +65,7 @@ if ($publisher->getConfig('idxcat_display_last_item') == 1) { // Get the last item in each category - $last_itemObj = $publisher->getHandler('item')->getLastPublishedByCat(array_merge($categoriesObj, $subcats)); + $last_itemObj = $publisher->getHandler('item')->getLastPublishedByCat(array_merge(array($categoriesObj), $subcats)); } // Max size of the title in the last item column |
From: <luc...@us...> - 2013-04-03 22:35:55
|
Revision: 11345 http://sourceforge.net/p/xoops/svn/11345 Author: luciorota Date: 2013-04-03 22:35:51 +0000 (Wed, 03 Apr 2013) Log Message: ----------- bugfix: create "/uploads/" . $xoopsModule->getVar('dirname') . "/content" directory on install Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/xoops_version.php Added Paths: ----------- XoopsModules/publisher/trunk/publisher/include/install.php Copied: XoopsModules/publisher/trunk/publisher/include/install.php (from rev 11343, XoopsModules/publisher/trunk/publisher/include/update.php) =================================================================== --- XoopsModules/publisher/trunk/publisher/include/install.php (rev 0) +++ XoopsModules/publisher/trunk/publisher/include/install.php 2013-04-03 22:35:51 UTC (rev 11345) @@ -0,0 +1,40 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author luciorota <luc...@gm...> + * @version $Id$ + */ + +function xoops_module_pre_install_publisher(&$xoopsModule) { + // NOP + return true; +} + + + +function xoops_module_install_publisher(&$xoopsModule) { + xoops_loadLanguage('modinfo', $xoopsModule->getVar('dirname')); + include_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar('dirname') . "/include/functions.php"; + + $ret = true; + $msg = ''; + // Create content directory + $dir = XOOPS_ROOT_PATH . "/uploads/" . $xoopsModule->getVar('dirname') . "/content"; + if (!publisher_mkdir($dir)) + $msg.= sprintf(_MI_AJAXFM_WARNING_DIRNOTCREATED, $dir); + if (empty($msg)) + return $ret; + else + return $msg; +} Modified: XoopsModules/publisher/trunk/publisher/xoops_version.php =================================================================== --- XoopsModules/publisher/trunk/publisher/xoops_version.php 2013-04-03 22:18:57 UTC (rev 11344) +++ XoopsModules/publisher/trunk/publisher/xoops_version.php 2013-04-03 22:35:51 UTC (rev 11345) @@ -1,1156 +1,1158 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package Publisher - * @since 1.0 - * @author trabis <lus...@gm...> - * @author The SmartFactory <www.smartfactory.ca> - * @version $Id$ - */ - -defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); -xoops_load('XoopsLocal'); - -$modversion['name'] = _MI_PUBLISHER_MD_NAME; -$modversion['version'] = 1.0; -$modversion['description'] = _MI_PUBLISHER_MD_DESC; -$modversion['author'] = "Xuups.com"; -$modversion['credits'] = "w4z004, hsalazar, Mithrandir, fx2024, Ackbarr, Mariuss, Marco, Michiel, phppp, outch, Xvitry, Catzwolf, Shine, McDonald, trabis, Mowaffak, Bandit-x, Shiva"; -$modversion['help'] = 'page=help'; -$modversion['license'] = 'GNU GPL 2.0'; -$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/"; -$modversion['official'] = 0; -$modversion['dirname'] = basename(dirname(__FILE__)); - -include_once XOOPS_ROOT_PATH . "/modules/" . $modversion['dirname'] . "/include/constants.php"; - -$logo_filename = $modversion['dirname'] . "_logo.png"; - -if (file_exists(XOOPS_ROOT_PATH . "/modules/" . $modversion['dirname'] . "/images/" . $logo_filename)) { - $modversion['image'] = "images/{$logo_filename}"; -} else { - $modversion['image'] = "images/module_logo.png"; -} -// Update -$modversion['onUpdate'] = 'include/update.php'; - -// Added by marcan for the About page in admin section -$modversion['adminMenu'] = "publisher_adminMenu"; -$modversion['developer_lead'] = "trabis"; -$modversion['developer_website_url'] = "http://www.xuups.com"; -$modversion['developer_website_name'] = "Xoops User Utilities"; -$modversion['developer_email'] = "lus...@gm..."; -$modversion['status_version'] = "RC"; -$modversion['status'] = "RC"; -$modversion['date'] = "2011-12-04"; - -//$modversion['warning'] = _MI_PUBLISHER_WARNING_BETA; - -$modversion['demo_site_url'] = ""; -$modversion['demo_site_name'] = ""; -$modversion['support_site_url'] = "http://www.xuups.com/modules/newbb/viewforum.php?forum=28"; -$modversion['support_site_name'] = "Xuups"; -$modversion['submit_bug'] = "http://www.xuups.com/modules/newbb/viewforum.php?forum=28"; -$modversion['submit_feature'] = "http://www.xuups.com/modules/newbb/viewforum.php?forum=28"; - -$modversion['people']['developers'][] = "trabis"; -$modversion['people']['developers'][] = "Mowaffak"; -$modversion['people']['developers'][] = "Bandit-x"; -$modversion['people']['developers'][] = "Shiva"; - -$modversion['people']['testers'][] = "urban, AEIOU, pacho, mariane"; -//$modversion['people']['translaters'][] = ""; -//$modversion['people']['documenters'][] = ""; - -$modversion['author_word'] = ""; - - -//about -$modversion['release_date'] = '2011/11/17'; -$modversion['module_status'] = "RC"; -$modversion['min_php'] = '5.2.0'; -$modversion['min_xoops'] = '2.5.0'; -$modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); -$modversion['min_admin'] = '1.1'; -$modversion['dirmoduleadmin'] = 'Frameworks/moduleclasses'; -$modversion['icons16'] = 'Frameworks/moduleclasses/icons/16'; -$modversion['icons32'] = 'Frameworks/moduleclasses/icons/32'; - -$modversion['author_word'] = ""; - -// Admin things -$modversion['hasAdmin'] = 1; -$modversion['adminindex'] = "admin/index.php"; -$modversion['adminmenu'] = "admin/menu.php"; -$modversion['system_menu'] = 1; - - -// Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin) -$modversion['sqlfile']['mysql'] = "sql/mysql.sql"; - -// Tables created by sql file (without prefix!) -$modversion['tables'][0] = "publisher_categories"; -$modversion['tables'][1] = "publisher_items"; -$modversion['tables'][2] = "publisher_files"; -$modversion['tables'][3] = "publisher_meta"; -$modversion['tables'][4] = "publisher_mimetypes"; -$modversion['tables'][5] = "publisher_rating"; - -// Search -$modversion['hasSearch'] = 1; -$modversion['search']['file'] = "include/search.inc.php"; -$modversion['search']['func'] = "publisher_search"; - -// Menu -$modversion['hasMain'] = 1; - -global $xoopsModule; -if (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $modversion['dirname']) { - global $xoopsModuleConfig, $xoopsUser; - $isAdmin = false; - if (is_object($xoopsUser)) { - $isAdmin = $xoopsUser->isAdmin($xoopsModule->getVar('mid')); - } - // Add the Submit new item button - $allowsubmit = (isset($xoopsModuleConfig['perm_submit']) && $xoopsModuleConfig['perm_submit'] == 1) ? true : false; - $anonpost = (isset($xoopsModuleConfig['permissions_anon_post']) && $xoopsModuleConfig['permissions_anon_post'] == 1) ? true : false; - if ($isAdmin || ($allowsubmit && (is_object($xoopsUser) || $anonpost))) { - $modversion['sub'][1]['name'] = _MI_PUBLISHER_SUB_SMNAME1; - $modversion['sub'][1]['url'] = "submit.php?op=add"; - } - - // Add the Search button - $allowsearch = (isset($xoopsModuleConfig['perm_search']) && $xoopsModuleConfig['perm_search'] == 1) ? true : false; - if ($allowsearch) { - $modversion['sub'][2]['name'] = _MI_PUBLISHER_SUB_SMNAME3; - $modversion['sub'][2]['url'] = "search.php"; - } -} -// Add the Archive button -$modversion['sub'][3]['name'] = _MI_PUBLISHER_SUB_ARCHIVE; -$modversion['sub'][3]['url'] = "archive.php"; - -$i = 0; - -$i++; -$modversion['blocks'][$i]['file'] = "items_new.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_ITEMSNEW; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_ITEMSNEW_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_items_new_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_items_new_edit"; -$modversion['blocks'][$i]['options'] = "0|datesub|0|5|65|none"; -$modversion['blocks'][$i]['template'] = "publisher_items_new.html"; - -$i++; -$modversion['blocks'][$i]['file'] = "items_recent.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_RECENTITEMS; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_RECENTITEMS_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_items_recent_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_items_recent_edit"; -$modversion['blocks'][$i]['options'] = "0|datesub|5|65"; -$modversion['blocks'][$i]['template'] = "publisher_items_recent.html"; - -$i++; -$modversion['blocks'][$i]['file'] = "items_spot.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_ITEMSPOT; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_ITEMSPOT_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_items_spot_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_items_spot_edit"; -$modversion['blocks'][$i]['options'] = "1|5|0|0|1|1|bullet|0|0"; -$modversion['blocks'][$i]['template'] = "publisher_items_spot.html"; - -$i++; -$modversion['blocks'][$i]['file'] = "items_random_item.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_ITEMSRANDOM_ITEM; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_ITEMSRANDOM_ITEM_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_items_random_item_show"; -$modversion['blocks'][$i]['template'] = "publisher_items_random_item.html"; - -$i++; -$modversion['blocks'][$i]['file'] = "items_menu.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_ITEMSMENU; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_ITEMSMENU_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_items_menu_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_items_menu_edit"; -$modversion['blocks'][$i]['options'] = "0|datesub|5"; -$modversion['blocks'][$i]['template'] = "publisher_items_menu.html"; - -$i++; -$modversion['blocks'][$i]['file'] = "latest_files.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_LATESTFILES; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_LATESTFILES_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_latest_files_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_latest_files_edit"; -$modversion['blocks'][$i]['options'] = "0|datesub|5|0"; -$modversion['blocks'][$i]['template'] = "publisher_latest_files.html"; - -$i++; -$modversion['blocks'][$i]['file'] = "date_to_date.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_DATE_TO_DATE; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_DATE_TO_DATE_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_date_to_date_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_date_to_date_edit"; -$modversion['blocks'][$i]['options'] = XoopsLocal::formatTimestamp(time(), 'm/j/Y') . "|" . XoopsLocal::formatTimestamp(time(), 'm/j/Y'); -$modversion['blocks'][$i]['template'] = "publisher_date_to_date.html"; - -$i++; -$modversion['blocks'][$i]['file'] = "items_columns.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_COLUMNS; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_COLUMNS_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_items_columns_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_items_columns_edit"; -$modversion['blocks'][$i]['options'] = "2|0|4|256|normal"; -$modversion['blocks'][$i]['template'] = "publisher_items_columns.html"; - -$i++; -$modversion['blocks'][$i]['file'] = "latest_news.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_LATEST_NEWS; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_LATEST_NEWS_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_latest_news_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_latest_news_edit"; -$modversion['blocks'][$i]['options'] = "0|6|2|300|0|0|100|30|published|1|120|120|1|dcdcdc|RIGHT|1|1|1|1|1|1|1|1|1|1|1|1|1|extended|"; -$modversion['blocks'][$i]['template'] = 'publisher_latest_news.html'; - -$i++; -$modversion['blocks'][$i]['file'] = "search.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_SEARCH; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_SEARCH_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_search_show"; -$modversion['blocks'][$i]['template'] = 'publisher_search_block.html'; - -$i++; -$modversion['blocks'][$i]['file'] = "category_items_sel.php"; -$modversion['blocks'][$i]['name'] = _MI_PUBLISHER_CATEGORY_ITEMS_SEL; -$modversion['blocks'][$i]['description'] = _MI_PUBLISHER_CATEGORY_ITEMS_SEL_DSC; -$modversion['blocks'][$i]['show_func'] = "publisher_category_items_sel_show"; -$modversion['blocks'][$i]['edit_func'] = "publisher_category_items_sel_edit"; -$modversion['blocks'][$i]['options'] = "0|datesub|5|65"; -$modversion['blocks'][$i]['template'] = "publisher_category_items_sel.html"; - -// Templates -$i = 0; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_header.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_HEADER_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_footer.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_FOOTER_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_singleitem.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_SINGLEITEM_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_categories_table.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_CATEGORIES_TABLE_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_display_list.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_DISPLAY_LIST_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_display_summary.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_DISPLAY_SUMMARY_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_display_full.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_DISPLAY_FULL_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_display_wfsection.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_DISPLAY_WFSECTION_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_item.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_ITEM_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_submit.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_SUBMIT_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_singleitem_block.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_SINGLEITEM_BLOCK_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_print.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_PRINT_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_rss.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_RSS_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_addfile.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_ADDFILE_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_search.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_SEARCH_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_author_items.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_AUTHOR_ITEMS_DSC; - -$i++; -$modversion['templates'][$i]['file'] = 'publisher_archive.html'; -$modversion['templates'][$i]['description'] = _MI_PUBLISHER_ARCHIVE__DSC; - -// Config categories -$i = 0; -$modversion['configcat']['seo']['name'] = _MI_PUBLISHER_CONFCAT_SEO; -$modversion['configcat']['seo']['description'] = _MI_PUBLISHER_CONFCAT_SEO_DSC; - -$i++; -$modversion['configcat']['indexcat']['name'] = _MI_PUBLISHER_CONFCAT_INDEXCAT; -$modversion['configcat']['indexcat']['description'] = _MI_PUBLISHER_CONFCAT_INDEXCAT_DSC; - -$i++; -$modversion['configcat']['index']['name'] = _MI_PUBLISHER_CONFCAT_INDEX; -$modversion['configcat']['index']['description'] = _MI_PUBLISHER_CONFCAT_INDEX_DSC; - -$i++; -$modversion['configcat']['category']['name'] = _MI_PUBLISHER_CONFCAT_CATEGORY; -$modversion['configcat']['category']['description'] = _MI_PUBLISHER_CONFCAT_CATEGORY_DSC; - -$i++; -$modversion['configcat']['item']['name'] = _MI_PUBLISHER_CONFCAT_ITEM; -$modversion['configcat']['item']['description'] = _MI_PUBLISHER_CONFCAT_ITEM_DSC; - -$i++; -$modversion['configcat']['print']['name'] = _MI_PUBLISHER_CONFCAT_PRINT; -$modversion['configcat']['print']['description'] = _MI_PUBLISHER_CONFCAT_PRINT_DSC; - -$i++; -$modversion['configcat']['search']['name'] = _MI_PUBLISHER_CONFCAT_SEARCH; -$modversion['configcat']['search']['description'] = _MI_PUBLISHER_CONFCAT_SEARCH_DSC; - -$i++; -$modversion['configcat']['submit']['name'] = _MI_PUBLISHER_CONFCAT_SUBMIT; -$modversion['configcat']['submit']['description'] = _MI_PUBLISHER_CONFCAT_SUBMIT_DSC; - -$i++; -$modversion['configcat']['permissions']['name'] = _MI_PUBLISHER_CONFCAT_PERMISSIONS; -$modversion['configcat']['permissions']['description'] = _MI_PUBLISHER_CONFCAT_PERMISSIONS_DSC; - -$i++; -$modversion['configcat']['format']['name'] = _MI_PUBLISHER_CONFCAT_FORMAT; -$modversion['configcat']['format']['description'] = _MI_PUBLISHER_CONFCAT_FORMAT_DSC; - -// Config Settings (only for modules that need config settings generated automatically) -$i = 0; - -################### SEO #################### -$i++; -$modversion['config'][$i]['name'] = 'seo_url_rewrite'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_URL_REWRITE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_URL_REWRITE_DSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = 'none'; -$modversion['config'][$i]['options'] = array( - _MI_PUBLISHER_URL_REWRITE_NONE => 'none', - _MI_PUBLISHER_URL_REWRITE_PATHINFO => 'path-info' -); - -// Is performing module install/update? -$isModuleAction = (!empty($_POST["fct"]) && "modulesadmin" == $_POST["fct"]) ? true : false; -if ($isModuleAction && (in_array(php_sapi_name(), array("apache", "apache2handler", "cgi-fcgi")))) { - $modversion['config'][$i]['options'][_MI_PUBLISHER_URL_REWRITE_HTACCESS] = 'htaccess'; -} -$modversion['config'][$i]['category'] = 'seo'; - -$i++; -$modversion['config'][$i]['name'] = 'seo_module_name'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_SEOMODNAME'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_SEOMODNAMEDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = $modversion['dirname']; -$modversion['config'][$i]['category'] = 'seo'; - -$i++; -$modversion['config'][$i]['name'] = 'seo_meta_keywords'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_SEO_METAKEYWORDS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_SEO_METAKEYWORDS_DSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = ''; -$modversion['config'][$i]['category'] = 'seo'; - -################### INDEX PAGE #################### -$i++; -$modversion['config'][$i]['name'] = 'index_title_and_welcome'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_WELCOME'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_WELCOMEDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'index'; - -$i++; -$modversion['config'][$i]['name'] = 'index_welcome_msg'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_INDEXMSG'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_INDEXMSGDSC'; -$modversion['config'][$i]['formtype'] = 'textarea'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = _MI_PUBLISHER_INDEXMSGDEF; -$modversion['config'][$i]['category'] = 'index'; - -$i++; -$modversion['config'][$i]['name'] = 'index_display_last_items'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_LASTITEMS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_LASTITEMSDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'index'; - -$i++; -$modversion['config'][$i]['name'] = 'index_footer'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_INDEXFOOTER'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_INDEXFOOTERDSC'; -$modversion['config'][$i]['formtype'] = 'textarea'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = ''; -$modversion['config'][$i]['category'] = 'index'; - - -################### CATEGORY PAGE #################### -// display_categeory_summary enabled by Freeform Solutions March 21 2006 -$i++; -$modversion['config'][$i]['name'] = 'cat_display_summary'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DCS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DCS_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'category'; - -$i++; -$modversion['config'][$i]['name'] = 'cat_list_image_width'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_CATLIST_IMG_W'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_CATLIST_IMG_WDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '90'; -$modversion['config'][$i]['category'] = 'category'; - -$i++; -$modversion['config'][$i]['name'] = 'cat_main_image_width'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_CATMAINIMG_W'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_CATMAINIMG_WDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '150'; -$modversion['config'][$i]['category'] = 'category'; - -################### ITEM PAGE #################### -$i++; -$modversion['config'][$i]['name'] = 'item_title_size'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_TITLE_SIZE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_TITLE_SIZEDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '60'; -$modversion['config'][$i]['category'] = 'item'; - -$i++; -$modversion['config'][$i]['name'] = 'item_disp_comment_link'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISCOM'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISCOMDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'item'; - -$i++; -$modversion['config'][$i]['name'] = 'item_disp_whowhen_link'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_WHOWHEN'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_WHOWHENDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'item'; - -$i++; -$modversion['config'][$i]['name'] = 'item_admin_hits'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ADMINHITS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ADMINHITSDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'item'; - -$i++; -$modversion['config'][$i]['name'] = 'item_footer'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ITEMFOOTER'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ITEMFOOTERDSC'; -$modversion['config'][$i]['formtype'] = 'textarea'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = ''; -$modversion['config'][$i]['category'] = 'item'; - -$i++; -$modversion['config'][$i]['name'] = 'item_other_items_type'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_OTHERITEMS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_OTHERITEMSDSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['options'] = array(_MI_PUBLISHER_OTHER_ITEMS_TYPE_NONE => 'none', - _MI_PUBLISHER_OTHER_ITEMS_TYPE_PREVIOUS_NEXT => 'previous_next', - _MI_PUBLISHER_OTHER_ITEMS_TYPE_ALL => 'all'); -$modversion['config'][$i]['default'] = 'previous_next'; -$modversion['config'][$i]['category'] = 'item'; - -################### INDEX AND CATEGORIES #################### -$i++; -$modversion['config'][$i]['name'] = 'idxcat_show_subcats'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_SHOW_SUBCATS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_SHOW_SUBCATS_DSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = 'all'; -$modversion['config'][$i]['options'] = array(_MI_PUBLISHER_SHOW_SUBCATS_NO => 'no', - _MI_PUBLISHER_SHOW_SUBCATS_NOTEMPTY => 'nonempty', - _MI_PUBLISHER_SHOW_SUBCATS_ALL => 'all', - _MI_PUBLISHER_SHOW_SUBCATS_NOMAIN => 'nomain'); -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_display_last_item'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_LASTITEM'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_LASTITEMDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_last_item_size'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_LASTITSIZE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_LASTITSIZEDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '50'; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_items_display_type'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISTYPE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISTYPEDSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['options'] = array(_MI_PUBLISHER_DISPLAYTYPE_SUMMARY => 'summary', - _MI_PUBLISHER_DISPLAYTYPE_FULL => 'full', - _MI_PUBLISHER_DISPLAYTYPE_LIST => 'list', - _MI_PUBLISHER_DISPLAYTYPE_WFSECTION => 'wfsection'); -$modversion['config'][$i]['default'] = 'summary'; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i] ['name'] = 'idxcat_display_subcat_dsc'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISSBCATDSC'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISSBCATDSCDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_display_date_col'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISDATECOL'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISDATECOLDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_display_hits_col'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_HITSCOL'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_HITSCOLDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_show_rss_link'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_SHOW_RSS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_SHOW_RSSDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_collaps_heading'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_COLLHEAD'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_COLLHEADDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_cat_perpage'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_CATPERPAGE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_CATPERPAGEDSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 15; -$modversion['config'][$i]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50); -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_perpage'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_PERPAGE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_PERPAGEDSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 15; -$modversion['config'][$i]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50); -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_index_perpage'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_PERPAGEINDEX'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_PERPAGEINDEXDSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 15; -$modversion['config'][$i]['options'] = array('5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '50' => 50); -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_partial_view_text'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_PV_TEXT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_PV_TEXTDSC'; -$modversion['config'][$i]['formtype'] = 'textarea'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = _MI_PUBLISHER_PV_TEXT_DEF; -$modversion['config'][$i]['category'] = 'indexcat'; - -$i++; -$modversion['config'][$i]['name'] = 'idxcat_display_art_count'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ARTCOUNT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ARTCOUNTDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'indexcat'; - -################### PRINT #################### -$i++; -$modversion['config'][$i]['name'] = 'print_header'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_HEADERPRINT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_HEADERPRINTDSC'; -$modversion['config'][$i]['formtype'] = 'textarea'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = ''; -$modversion['config'][$i]['category'] = 'print'; - -$i++; -$modversion['config'][$i]['name'] = 'print_logourl'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_PRINTLOGOURL'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_PRINTLOGOURLDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = XOOPS_URL . '/images/logo.gif'; -$modversion['config'][$i]['category'] = 'print'; - -$i++; -$modversion['config'][$i]['name'] = 'print_footer'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_FOOTERPRINT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_FOOTERPRINTDSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = 'item footer'; -$modversion['config'][$i]['options'] = array(_MI_PUBLISHER_ITEMFOOTER_SEL => 'item footer', - _MI_PUBLISHER_INDEXFOOTER_SEL => 'index footer', - _MI_PUBLISHER_BOTH_FOOTERS => 'both', - _MI_PUBLISHER_NO_FOOTERS => 'none'); -$modversion['config'][$i]['category'] = 'print'; - - -################### FORMAT #################### -$i++; -$modversion['config'][$i]['name'] = 'format_date'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DATEFORMAT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DATEFORMATDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = 'd-M-Y H:i'; -$modversion['config'][$i]['category'] = 'format'; - -$i++; -$modversion['config'][$i]['name'] = 'format_order_by'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ORDERBY'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ORDERBYDSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['options'] = array(_MI_PUBLISHER_ORDERBY_TITLE => 'title', - _MI_PUBLISHER_ORDERBY_DATE => 'date', - _MI_PUBLISHER_ORDERBY_WEIGHT => 'weight'); -$modversion['config'][$i]['default'] = 'date'; -$modversion['config'][$i]['category'] = 'format'; - -$i++; -$modversion['config'][$i]['name'] = 'format_image_nav'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_IMAGENAV'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_IMAGENAVDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'format'; - -$i++; -$modversion['config'][$i]['name'] = 'format_realname'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_USEREALNAME'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_USEREALNAMEDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'format'; - -$i++; -$modversion['config'][$i]['name'] = 'format_highlight_color'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_HLCOLOR'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_HLCOLORDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '#FFFF80'; -$modversion['config'][$i]['category'] = 'format'; - -$i++; -$modversion['config'][$i]['name'] = 'format_linked_path'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_LINKPATH'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_LINKPATHDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'format'; - -$i++; -$modversion['config'][$i]['name'] = 'format_breadcrumb_modname'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_BCRUMB'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_BCRUMBDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'format'; - -################### SEARCH #################### -$i++; -$modversion['config'][$i]['name'] = 'search_cat_path'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_PATHSEARCH'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_PATHSEARCHDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'search'; - -################### SUBMIT #################### -$i++; -$modversion['config'][$i]['name'] = 'submit_intro_msg'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_SUBMITMSG'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_SUBMITMSGDSC'; -$modversion['config'][$i]['formtype'] = 'textarea'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = _MI_PUBLISHER_SUBMITMSGDEF; -$modversion['config'][$i]['category'] = 'submit'; - -xoops_load('XoopsEditorHandler'); -$editor_handler = XoopsEditorHandler::getInstance(); -$i++; -$modversion['config'][$i]['name'] = 'submit_editor'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_EDITOR'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_EDITOR_DSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['options'] = array_flip($editor_handler->getList()); -$modversion['config'][$i]['default'] = 'dhtmltextarea'; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_editor_rows'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_EDITOR_ROWS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_EDITOR_ROWS_DSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '35'; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_editor_cols'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_EDITOR_COLS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_EDITOR_COlS_DSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '60'; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_editor_width'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_EDITOR_WIDTH'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_EDITOR_WIDTH_DSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '100%'; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_editor_height'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_EDITOR_HEIGHT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_EDITOR_HEIGHT_DSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '400px'; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_status'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_FORM_STATUS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_FORM_STATUS_DSC'; -$modversion['config'][$i]['formtype'] = 'select'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['options'] = array(_MI_PUBLISHER_PUBLISHED => _PUBLISHER_STATUS_PUBLISHED, - _MI_PUBLISHER_OFFLINE => _PUBLISHER_STATUS_OFFLINE, - _MI_PUBLISHER_SUBMITTED => _PUBLISHER_STATUS_SUBMITTED, - _MI_PUBLISHER_REJECTED => _PUBLISHER_STATUS_REJECTED); -$modversion['config'][$i]['default'] = _PUBLISHER_STATUS_SUBMITTED; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_allowcomments'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_FORM_ALLOWCOMMENTS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_FORM_ALLOWCOMMENTS_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_dohtml'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_FORM_DOHTML'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_FORM_DOHTML_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_dosmiley'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_FORM_DOSMILEY'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_FORM_DOSMILEY_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_doxcode'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_FORM_DOXCODE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_FORM_DOXCODE_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_doimage'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_FORM_DOIMAGE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_FORM_DOIMAGE_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'submit'; - -$i++; -$modversion['config'][$i]['name'] = 'submit_dobr'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_FORM_DOBR'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_FORM_DOBR_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'submit'; - -################### PERMISSIONS #################### -$i++; -$modversion['config'][$i]['name'] = 'perm_submit'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ALLOWSUBMIT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ALLOWSUBMITDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_edit'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ALLOWEDIT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ALLOWEDITDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_delete'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ALLOWDELETE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ALLOWDELETEDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_anon_submit'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ANONPOST'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ANONPOSTDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_upload'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_UPLOAD'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_UPLOADDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_clone'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_CLONE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_CLONEDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_rating'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ALLOWRATING'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ALLOWRATING_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_search'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ALLOWSEARCH'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ALLOWSEARCH_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_author_items'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_ALLOW_AUTHOR_ITEMS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_ALLOW_AUTHOR_ITEMS_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_com_art_level'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_COMMENTS'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_COMMENTSDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'permissions'; - -$i++; -$modversion['config'][$i]['name'] = 'perm_autoapprove'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_AUTOAPP'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_AUTOAPPDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'permissions'; - - -################### OTHERS #################### -$i++; -$modversion['config'][$i]['name'] = 'display_breadcrumb'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISPBREAD'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISPBREADDSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; - -$i++; -$modversion['config'][$i]['name'] = 'maximum_filesize'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_MAX_SIZE'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_MAX_SIZEDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '1000000'; - -$i++; -$modversion['config'][$i]['name'] = 'maximum_image_width'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_MAX_WIDTH'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_MAX_WIDTHDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '800'; - -$i++; -$modversion['config'][$i]['name'] = 'maximum_image_height'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_MAX_HEIGHT'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_MAX_HEIGHTDSC'; -$modversion['config'][$i]['formtype'] = 'textbox'; -$modversion['config'][$i]['valuetype'] = 'text'; -$modversion['config'][$i]['default'] = '800'; - -########### ADDED in final ############# -$i++; -$modversion['config'][$i]['name'] = 'item_disp_blocks_summary'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISP_BLOCK_SUM'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISP_BLOCK_SUM_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'item'; - -$i++; -$modversion['config'][$i]['name'] = 'index_disp_subtitle'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISP_INDEX_SUB'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISP_INDEX_SUB_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'index'; - -$i++; -$modversion['config'][$i]['name'] = 'cat_disp_subtitle'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISP_CAT_SUB'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISP_CAT_SUB_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 0; -$modversion['config'][$i]['category'] = 'category'; - -$i++; -$modversion['config'][$i]['name'] = 'item_disp_subtitle'; -$modversion['config'][$i]['title'] = '_MI_PUBLISHER_DISP_ITEM_SUB'; -$modversion['config'][$i]['description'] = '_MI_PUBLISHER_DISP_ITEM_SUB_DSC'; -$modversion['config'][$i]['formtype'] = 'yesno'; -$modversion['config'][$i]['valuetype'] = 'int'; -$modversion['config'][$i]['default'] = 1; -$modversion['config'][$i]['category'] = 'item'; - - -// Comments -$modversion['hasComments'] = 1; -$modversion['comments']['itemName'] = 'itemid'; -$modversion['comments']['pageName'] = 'item.php'; - -// Comment callback functions -$modversion['comments']['callbackFile'] = 'include/comment_functions.php'; -$modversion['comments']['callback']['approve'] = 'publisher_com_approve'; -$modversion['comments']['callback']['update'] = 'publisher_com_update'; - -// Notification -$modversion['hasNotification'] = 1; -$modversion['notification']['lookup_file'] = 'include/notification.inc.php'; -$modversion['notification']['lookup_func'] = 'publisher_notify_iteminfo'; - -$modversion['notification']['category'][1]['name'] = 'global_item'; -$modversion['notification']['category'][1]['title'] = _MI_PUBLISHER_GLOBAL_ITEM_NOTIFY; -$modversion['notification']['category'][1]['description'] = _MI_PUBLISHER_GLOBAL_ITEM_NOTIFY_DSC; -$modversion['notification']['category'][1]['subscribe_from'] = array('index.php', 'category.php', 'item.php'); - -$modversion['notification']['category'][2]['name'] = 'category_item'; -$modversion['notification']['category'][2]['title'] = _MI_PUBLISHER_CATEGORY_ITEM_NOTIFY; -$modversion['notification']['category'][2]['description'] = _MI_PUBLISHER_CATEGORY_ITEM_NOTIFY_DSC; -$modversion['notification']['category'][2]['subscribe_from'] = array('index.php', 'category.php', 'item.php'); -$modversion['notification']['category'][2]['item_name'] = 'categoryid'; -$modversion['notification']['category'][2]['allow_bookmark'] = 1; - -$modversion['notification']['category'][3]['name'] = 'item'; -$modversion['notification']['category'][3]['title'] = _MI_PUBLISHER_ITEM_NOTIFY; -$modversion['notification']['category'][3]['description'] = _MI_PUBLISHER_ITEM_NOTIFY_DSC; -$modversion['notification']['category'][3]['subscribe_from'] = array('item.php'); -$modversion['notification']['category'][3]['item_name'] = 'itemid'; -$modversion['notification']['category'][3]['allow_bookmark'] = 1; - -$modversion['notification']['event'][1]['name'] = 'category_created'; -$modversion['notification']['event'][1]['category'] = 'global_item'; -$modversion['notification']['event'][1]['title'] = _MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY; -$modversion['notification']['event'][1]['caption'] = _MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_CAP; -$modversion['notification']['event'][1]['description'] = _MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_DSC; -$modversion['notification']['event'][1]['mail_template'] = 'global_item_category_created'; -$modversion['notification']['event'][1]['mail_subject'] = _MI_PUBLISHER_GLOBAL_ITEM_CATEGORY_CREATED_NOTIFY_SBJ; - -$modversion['notification']['event'][2]['name'] = 'submitted'; -$modversion['notification']['event'][2]['category'] = 'global_item'; -$modversion['notification']['event'][2]['admin_only'] = 1; -$modversion['notification']['event'][2]['title'] = _MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY; -$modversion['notification']['event'][2]['caption'] = _MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_CAP; -$modversion['notification']['event'][2]['description'] = _MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_DSC; -$modversion['notification']['event'][2]['mail_template'] = 'global_item_submitted'; -$modversion['notification']['event'][2]['mail_subject'] = _MI_PUBLISHER_GLOBAL_ITEM_SUBMITTED_NOTIFY_SBJ; - -$modversion['notification']['event'][3]['name'] = 'published'; -$modversion['notification']['event'][3]['category'] = 'global_item'; -$modversion['notification']['event'][3]['title'] = _MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY; -$modversion['notification']['event'][3]['caption'] = _MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_CAP; -$modversion['notification']['event'][3]['description'] = _MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_DSC; -$modversion['notification']['event'][3]['mail_template'] = 'global_item_published'; -$modversion['notification']['event'][3]['mail_subject'] = _MI_PUBLISHER_GLOBAL_ITEM_PUBLISHED_NOTIFY_SBJ; - -$modversion['notification']['event'][4]['name'] = 'submitted'; -$modversion['notification']['event'][4]['category'] = 'category_item'; -$modversion['notification']['event'][4]['admin_only'] = 1; -$modversion['notification']['event'][4]['title'] = _MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY; -$modversion['notification']['event'][4]['caption'] = _MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_CAP; -$modversion['notification']['event'][4]['description'] = _MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_DSC; -$modversion['notification']['event'][4]['mail_template'] = 'category_item_submitted'; -$modversion['notification']['event'][4]['mail_subject'] = _MI_PUBLISHER_CATEGORY_ITEM_SUBMITTED_NOTIFY_SBJ; - -$modversion['notification']['event'][5]['name'] = 'published'; -$modversion['notification']['event'][5]['category'] = 'category_item'; -$modversion['notification']['event'][5]['title'] = _MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY; -$modversion['notification']['event'][5]['caption'] = _MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_CAP; -$modversion['notification']['event'][5]['description'] = _MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_DSC; -$modversion['notification']['event'][5]['mail_template'] = 'category_item_published'; -$modversion['notification']['event'][5]['mail_subject'] = _MI_PUBLISHER_CATEGORY_ITEM_PUBLISHED_NOTIFY_SBJ; - -$modversion['notification']['event'][6]['name'] = 'rejected'; -$modversion['notification']['event'][6]['category'] = 'item'; -$modversion['notification']['event'][6]['invisible'] = 1; -$modversion['notification']['event'][6]['title'] = _MI_PUBLISHER_ITEM_REJECTED_NOTIFY; -$modversion['notification']['event'][6]['caption'] = _MI_PUBLISHER_ITEM_REJECTED_NOTIFY_CAP; -$modversion['notification']['event'][6]['description'] = _MI_PUBLISHER_ITEM_REJECTED_NOTIFY_DSC; -$modversion['notification']['event'][6]['mail_template'] = 'item_rejected'; -$modversion['notification']['event'][6]['mail_subject'] = _MI_PUBLISHER_ITEM_REJECTED_NOTIFY_SBJ; - -$modversion['notification']['event'][7]['name'] = 'approved'; -$modversion['notification']['event'][7]['category'] = 'item'; -$modversion['notification']['event'][7]['invisible'] = 1; -$modversion['notification']['event'][7]['title'] = _MI_PUBLISHER_ITEM_APPROVED_NOTIFY; -$modversion['notification']['event'][7]['caption'] = _MI_PUBLISHER_ITEM_APPROVED_NOTIFY_CAP; -$modversion['notification']['event'][7]['description'] = _MI_PUBLISHER_ITEM_APPROVED_NOTIFY_DSC; -$modversion['notification']['event'][7]['mail_template'] = 'item_approved'; -$modversion['notification']['event'][7]['mail_subject'] = _MI_PUBLISHER_ITEM_APPROVED_NOTIFY_SBJ; \ No newline at end of file +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package Publisher + * @since 1.0 + * @author trabis <lus...@gm...> + * @author The SmartFactory <www.smartfactory.ca> + * @version $Id$ + */ + +defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); +xoops_load('XoopsLocal'); + +$modversion['name'] = _MI_PUBLISHER_MD_NAME; +$modversion['version'] = 1.0; +$modversion['description'] = _MI_PUBLISHER_MD_DESC; +$modversion['author'] = "Xuups.com"; +$modversion['credits'] = "w4z004, hsalazar, Mithrandir, fx2024, Ackbarr, Mariuss, Marco, Michiel, phppp, outch, Xvitry, Catzwolf, Shine, McDonald, trabis, Mowaffak, Bandit-x, Shiva"; +$modversion['help'] = 'page=help'; +$modversion['license'] = 'GNU GPL 2.0'; +$modversion['license_url'] = "www.gnu.org/licenses/gpl-2.0.html/"; +$modversion['official'] = 0; +$modversion['dirname'] = basename(dirname(__FILE__)); + +include_once XOOPS_ROOT_PATH . "/modules/" . $modversion['dirname'] . "/include/constants.php"; + +$logo_filename = $modversion['dirname'] . "_logo.png"; + +if (file_exists(XOOPS_ROOT_PATH . "/modules/" . $modversion['dirname'] . "/images/" . $logo_filename)) { + $modversion['image'] = "images/{$logo_filename}"; +} else { + $modversion['image'] = "images/module_logo.png"; +} +// Install +$modversion['onInstall'] = 'include/install.php'; +// Update +$modversion['onUpdate'] = 'include/update.php'; + +// Added by marcan for the About page in admin section +$modversion['adminMenu'] = "publisher_adminMenu"; +$modversion['developer_lead'] = "trabis"; +$modversion['developer_website_url'] = "http://www.xuups.com"; +$modversion['developer_website_name'] = "Xoops User Utilities"; +$modversion['developer_email'] = "lus...@gm..."; +$modversion['status_version'] = "RC"; +$modversion['status'] = "RC"; +$modversion['date'] = "2011-12-04"; + +//$modversion['warning'] = _MI_PUBLISHER_WARNING_BETA; + +$modversion['demo_site_url'] = ""; +$modversion['demo_site_name'] = ""; +$modversion['support_site_url'] = "http://www.xuups.com... [truncated message content] |
From: <be...@us...> - 2013-07-18 10:41:12
|
Revision: 11840 http://sourceforge.net/p/xoops/svn/11840 Author: beckmi Date: 2013-07-18 10:41:05 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Updating to 1.0 Final Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/blocks/items_spot.php XoopsModules/publisher/trunk/publisher/class/uploader.php XoopsModules/publisher/trunk/publisher/docs/changelog.txt XoopsModules/publisher/trunk/publisher/docs/credits.txt XoopsModules/publisher/trunk/publisher/language/english/help/help.html XoopsModules/publisher/trunk/publisher/language/english/modinfo.php XoopsModules/publisher/trunk/publisher/tcpdf/tcpdf.php XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_category_items_sel.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_recent.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_spot.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_latest_files.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_search_block.html XoopsModules/publisher/trunk/publisher/templates/publisher_addfile.html XoopsModules/publisher/trunk/publisher/templates/publisher_header.html XoopsModules/publisher/trunk/publisher/templates/publisher_item.html XoopsModules/publisher/trunk/publisher/templates/publisher_print.html XoopsModules/publisher/trunk/publisher/templates/publisher_singleitem.html XoopsModules/publisher/trunk/publisher/templates/publisher_singleitem_block.html XoopsModules/publisher/trunk/publisher/templates/publisher_submit.html XoopsModules/publisher/trunk/publisher/xoops_version.php Added Paths: ----------- XoopsModules/publisher/trunk/publisher/docs/ajaxrating.txt XoopsModules/publisher/trunk/publisher/docs/license.txt Removed Paths: ------------- XoopsModules/publisher/trunk/publisher/ajaxrating.txt XoopsModules/publisher/trunk/publisher/changelog.txt XoopsModules/publisher/trunk/publisher/docs/licence.txt Deleted: XoopsModules/publisher/trunk/publisher/ajaxrating.txt =================================================================== --- XoopsModules/publisher/trunk/publisher/ajaxrating.txt 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/ajaxrating.txt 2013-07-18 10:41:05 UTC (rev 11840) @@ -1,156 +0,0 @@ -(Unobtusive) AJAX Rating Bars v 1.2.2 (March 18 2007) -ryan masuga, ry...@ma... (http://www.masugadesign.com) - -Homepage for this script: -http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/ -============================================================================= -This (Unobtusive) AJAX Rating Bar script is licensed under the -Creative Commons Attribution 3.0 License - http://creativecommons.org/licenses/by/3.0/ - -What that means is: Use these files however you want, but don't redistribute -without the proper credits, please. I'd appreciate hearing from you if you're -using this script. Credits should include: -- Masuga Design (http://masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/) -- Komodo Media (http://komodomedia.com) -- Climax Designs (http://slim.climaxdesigns.com/). -- Ben Nolan (http://bennolan.com/behaviour/) for Behavio(u)r! - -Suggestions or improvements welcome - they only serve to make the script better. -============================================================================= ------------------------------------------------------------------------------ -The necessary files: - -PHP Files: - _config-rating.php - _drawrating.php - db.php - rpc.php - -CSS File: - rating.css (can mix into your own stylesheet(s)) - -Javascript files: - behaviour.js - rating.js - -Image files: - starrating.gif - working.gif - - -CHANGELOG: ------------------------------------------------------------------------------ -v 1.2.2 Updates (March 18, 2007): - - * ADDED: prefixed DB calls with $rating_dbname for better separation from other scripts - This will really help with Wordpress installs - As of 1.2.2 I don't think - you need to do any special tweaks. - - * UPDATED: changed some variable names so as not to confuse with other scripts - ------------------------------------------------------------------------------ -v 1.2.1 Updates (March 18, 2007): - - * ADDED: a new check to keep voters from faking the vote to something very high - * ADDED: a check to stop people from voting multiple times - * ADDED: example of using 'static' to the Read Me - - * UPDATED: Use echo now to render your star rater, because I'm using 'return' - instead of echo in the function - - * FIXED: bug where you couldn't have letters in your id. Now, letters and numbers only - * FIXED: issue with number of votes cast (i.e. '0') not showing up for new IDs - ------------------------------------------------------------------------------ -v 1.2 Updates (March 11, 2007): - - * ADDED: a couple checks to stop possible SQL injection hacks - * ADDED: 'rel="nofollow"' to the rendered rating bar links - * ADDED: Automatic inserting of ID's in the DB - * ADDED: New variables to make it easier to fix your paths! - * ADDED: Ability to call a rater "static" so you can't vote - (Might come in handy if someone needs to be logged in to vote...) - - * FIXED: SQL in this readme to use backticks for easier copy-n-paste - * FIXED: modified a couple CSS styles that were giving people headaches - ------------------------------------------------------------------------------ -v 1.1 Features: - * Uses unobtrusive Javascript, so ratings will still work if the user has Javascript off - (the script has been tested in IE 6, Safari, and FF). - * keeps Javascript out of the HTML, resulting in cleaner markup - * There are now some checks in place to discourage monkey-business, like negative numbers, or funky IP's - * IP lockout is now in the script - * You can now specify the number of units! If you want 5 stars, just add a 5, otherwise the script defaults to 10. - * Enter database info in one place rather than three places - * This script only uses ONE image -------------------------------------------------------------- - -INSTALLATION: - -============================================================================= -1. Make your table for the ratings in your db (you should be able to copy - and paste the following SQL) -============================================================================= -CREATE TABLE `ratings` ( - `id` varchar(11) NOT NULL, - `total_votes` int(11) NOT NULL default 0, - `total_value` int(11) NOT NULL default 0, - `used_ips` longtext, - PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=3; - - -============================================================================= -2. Enter your specific info into _config-rating.php -============================================================================= - $dbhost = 'localhost'; - $dbuser = '###'; - $dbpass = '###'; - $dbname = '###'; - $tableName = 'ratings'; - $rating_unitwidth = 30; - - -============================================================================= -3. Enter this line at the top of any page where you want - to have rating bars. -============================================================================= -<?php require('_drawrating.php'); ?> - - -============================================================================= -4. Point to the right Javascript and CSS files (you need - behavior.js, rating.js, and rating.css) -============================================================================= -<script type="text/javascript" language="javascript" src="js/behavior.js"></script> -<script type="text/javascript" language="javascript" src="js/rating.js"></script> -<link rel="stylesheet" type="text/css" href="css/rating.css" /> - -Remember to make sure to fix paths for the images as well. I kept behavior.js separate -from rating.js, because you can use it for other things! - - -============================================================================= -5. Drop the function wherever you want a rating bar to appear -============================================================================= -NOTE: As of version 1.2.1, use the echo statement! Also, if you use the static -parameter, you should always specify the 2nd parameter (number of units), even if -it is blank (which will default to 10 units) - -<?php echo rating_bar('8'); ?> - 10 stars (default), ID of 8 -<?php echo rating_bar('8xxa','5'); ?> - 5 stars, ID of 8xxa -<?php echo rating_bar('9a','5','static'); ?> - 5 stars, ID of 9a, static (non votable) -<?php echo rating_bar('9b',''); ?> - 10 stars, ID of 9b -<?php echo rating_bar('9c','8','static'); ?> - 8 stars, ID of 9c, static (non votable) - - -If you want to change how the rating bar is rendered, you will need to edit -the _drawrating.php file. Also, you might need to edit the bottom of the rpc.php -file at about line 52, where the $newback variable is. - - - - - - Modified: XoopsModules/publisher/trunk/publisher/blocks/items_spot.php =================================================================== --- XoopsModules/publisher/trunk/publisher/blocks/items_spot.php 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/blocks/items_spot.php 2013-07-18 10:41:05 UTC (rev 11840) @@ -99,6 +99,9 @@ $block['display_whowhen_link'] = $opt_display_poster; $block['display_comment_link'] = $opt_display_comment; $block['display_type'] = $opt_display_type; + + $block["publisher_url"] = PUBLISHER_URL; + return $block; } Deleted: XoopsModules/publisher/trunk/publisher/changelog.txt =================================================================== --- XoopsModules/publisher/trunk/publisher/changelog.txt 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/changelog.txt 2013-07-18 10:41:05 UTC (rev 11840) @@ -1,45 +0,0 @@ -<strong><u>=> Version 1.0 Beta (2010-04-02)</u></strong> -- Improved : Images sorted by Name in submit form (trabis) -- Added : Class for handling block forms (trabis) -- Fixed : Date to date block blank page (trabis) -- Fixed : Extra '-' in page title (trabis/mboyden) - -<strong><u>=> Version 1.0 Alpha (2009-08-24)</u></strong> -- Imported : smartsection Version 2.14 Final (trabis) -- Removed : dependecy from smartobject (trabis) -- Removed : unused files (trabis) -- Improved: renamed functions and clean code acording to XOOPS CODING STANDARDS (trabis) -- Added : xoops 2.3 compatibility (trabis) -- Added : missing index.html files in some folders (trabis) -- Added : text truncate option in spotlight block (trabis/Mowaffak) -- Changed : article submission for admins using submit.php (trabis/Mowaffak) -- Fixed : cannot show keyword in Japanese and multibyte language (ohwada/trabis) -- Fixed : keyword "abc" match "abccccc" (ohwada/trabis) -- Fixed : many Notice when "Disable comments" (ohwada/trabis) -- Fixed : missing argument when save file (ohwada/trabis) -- Fixed : undefined variable in admin's category (ohwada/trabis) -- Fixed : invalid argument when guest view (ohwada/trabis) -- Fixed : wrong style in print template file (ohwada/trabis) -- Fixed : parse error and Notice in print (ohwada/trabis) -- Fixed : enable "Print" and "PDF" (ohwada/trabis) -- Improved : Hide Read More link in spot block if no body and no truncate used (trabis/Mowaffak) -- Fixed : preview function was not working correctly (trabis) -- Improved : removed fpdf libray and added tcpdf library (trabis) -- Added : ajax rating (trabis) -- Added : Xoops 2.3 editors and access permissions (trabis) -- Added : easy module cloning from admin area with auto logo generation (trabis/Xoops French Team) -- Added : Second title (subtitle) for articles (Shiva) -- Fixed : english errors in language files (AEIOU) -- Added : module preferences separated by categories (trabis) -- Added : advanced search system (trabis/phppp) -- Added : Columns block (bandit-x/trabis) -- Added : Multi image support for articles, using core image manager (trabis) -- Improved : Added support for 'tellafriend' module from GIJOE instead of using mailto link (trabis/GIJOE) -- Added : Tabbed interface for submit pages (trabis) -- Added : Adding moderator per category (trabis) -- Added : Author alias (trabis) -- Added : Hide sub categories in main page only (Mowaffak) -- Added : Latest news block (trabis/bandit-x/Mowaffak) -- Added : Category selection block (trabis/Mowaffak) -- Added : Image manager / easy uploading (trabis) -- Fixed : Item name not available in comment notification (Phoenyx) \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/class/uploader.php =================================================================== --- XoopsModules/publisher/trunk/publisher/class/uploader.php 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/class/uploader.php 2013-07-18 10:41:05 UTC (rev 11840) @@ -202,7 +202,7 @@ $this->setErrors('There was a problem with your upload. Error: 0'); break; case 1: // uploaded file exceeds the upload_max_filesize directive in php.ini - //if ($this->noadmin_sizecheck) + //if ($this->noAdminSizeCheck) //{ // return true; //} Added: XoopsModules/publisher/trunk/publisher/docs/ajaxrating.txt =================================================================== --- XoopsModules/publisher/trunk/publisher/docs/ajaxrating.txt (rev 0) +++ XoopsModules/publisher/trunk/publisher/docs/ajaxrating.txt 2013-07-18 10:41:05 UTC (rev 11840) @@ -0,0 +1,156 @@ +(Unobtusive) AJAX Rating Bars v 1.2.2 (March 18 2007) +ryan masuga, ry...@ma... (http://www.masugadesign.com) + +Homepage for this script: +http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/ +============================================================================= +This (Unobtusive) AJAX Rating Bar script is licensed under the +Creative Commons Attribution 3.0 License - http://creativecommons.org/licenses/by/3.0/ + +What that means is: Use these files however you want, but don't redistribute +without the proper credits, please. I'd appreciate hearing from you if you're +using this script. Credits should include: +- Masuga Design (http://masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/) +- Komodo Media (http://komodomedia.com) +- Climax Designs (http://slim.climaxdesigns.com/). +- Ben Nolan (http://bennolan.com/behaviour/) for Behavio(u)r! + +Suggestions or improvements welcome - they only serve to make the script better. +============================================================================= +----------------------------------------------------------------------------- +The necessary files: + +PHP Files: + _config-rating.php + _drawrating.php + db.php + rpc.php + +CSS File: + rating.css (can mix into your own stylesheet(s)) + +Javascript files: + behaviour.js + rating.js + +Image files: + starrating.gif + working.gif + + +CHANGELOG: +----------------------------------------------------------------------------- +v 1.2.2 Updates (March 18, 2007): + + * ADDED: prefixed DB calls with $rating_dbname for better separation from other scripts + This will really help with Wordpress installs - As of 1.2.2 I don't think + you need to do any special tweaks. + + * UPDATED: changed some variable names so as not to confuse with other scripts + +----------------------------------------------------------------------------- +v 1.2.1 Updates (March 18, 2007): + + * ADDED: a new check to keep voters from faking the vote to something very high + * ADDED: a check to stop people from voting multiple times + * ADDED: example of using 'static' to the Read Me + + * UPDATED: Use echo now to render your star rater, because I'm using 'return' + instead of echo in the function + + * FIXED: bug where you couldn't have letters in your id. Now, letters and numbers only + * FIXED: issue with number of votes cast (i.e. '0') not showing up for new IDs + +----------------------------------------------------------------------------- +v 1.2 Updates (March 11, 2007): + + * ADDED: a couple checks to stop possible SQL injection hacks + * ADDED: 'rel="nofollow"' to the rendered rating bar links + * ADDED: Automatic inserting of ID's in the DB + * ADDED: New variables to make it easier to fix your paths! + * ADDED: Ability to call a rater "static" so you can't vote + (Might come in handy if someone needs to be logged in to vote...) + + * FIXED: SQL in this readme to use backticks for easier copy-n-paste + * FIXED: modified a couple CSS styles that were giving people headaches + +----------------------------------------------------------------------------- +v 1.1 Features: + * Uses unobtrusive Javascript, so ratings will still work if the user has Javascript off + (the script has been tested in IE 6, Safari, and FF). + * keeps Javascript out of the HTML, resulting in cleaner markup + * There are now some checks in place to discourage monkey-business, like negative numbers, or funky IP's + * IP lockout is now in the script + * You can now specify the number of units! If you want 5 stars, just add a 5, otherwise the script defaults to 10. + * Enter database info in one place rather than three places + * This script only uses ONE image +------------------------------------------------------------- + +INSTALLATION: + +============================================================================= +1. Make your table for the ratings in your db (you should be able to copy + and paste the following SQL) +============================================================================= +CREATE TABLE `ratings` ( + `id` varchar(11) NOT NULL, + `total_votes` int(11) NOT NULL default 0, + `total_value` int(11) NOT NULL default 0, + `used_ips` longtext, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=3; + + +============================================================================= +2. Enter your specific info into _config-rating.php +============================================================================= + $dbhost = 'localhost'; + $dbuser = '###'; + $dbpass = '###'; + $dbname = '###'; + $tableName = 'ratings'; + $rating_unitwidth = 30; + + +============================================================================= +3. Enter this line at the top of any page where you want + to have rating bars. +============================================================================= +<?php require('_drawrating.php'); ?> + + +============================================================================= +4. Point to the right Javascript and CSS files (you need + behavior.js, rating.js, and rating.css) +============================================================================= +<script type="text/javascript" language="javascript" src="js/behavior.js"></script> +<script type="text/javascript" language="javascript" src="js/rating.js"></script> +<link rel="stylesheet" type="text/css" href="css/rating.css" /> + +Remember to make sure to fix paths for the images as well. I kept behavior.js separate +from rating.js, because you can use it for other things! + + +============================================================================= +5. Drop the function wherever you want a rating bar to appear +============================================================================= +NOTE: As of version 1.2.1, use the echo statement! Also, if you use the static +parameter, you should always specify the 2nd parameter (number of units), even if +it is blank (which will default to 10 units) + +<?php echo rating_bar('8'); ?> - 10 stars (default), ID of 8 +<?php echo rating_bar('8xxa','5'); ?> - 5 stars, ID of 8xxa +<?php echo rating_bar('9a','5','static'); ?> - 5 stars, ID of 9a, static (non votable) +<?php echo rating_bar('9b',''); ?> - 10 stars, ID of 9b +<?php echo rating_bar('9c','8','static'); ?> - 8 stars, ID of 9c, static (non votable) + + +If you want to change how the rating bar is rendered, you will need to edit +the _drawrating.php file. Also, you might need to edit the bottom of the rpc.php +file at about line 52, where the $newback variable is. + + + + + + Modified: XoopsModules/publisher/trunk/publisher/docs/changelog.txt =================================================================== --- XoopsModules/publisher/trunk/publisher/docs/changelog.txt 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/docs/changelog.txt 2013-07-18 10:41:05 UTC (rev 11840) @@ -1,3 +1,6 @@ +<strong><u>=> Version 1.0 Final (2013-07-18)</u></strong> +- added missing URL for doc image in \blocks\items_spot.php + <strong><u>=> Version 1.0 RC (2011-12-04)</u></strong> - Converted to XOOPS 2.5.0 ModuleAdmin GUI Modified: XoopsModules/publisher/trunk/publisher/docs/credits.txt =================================================================== --- XoopsModules/publisher/trunk/publisher/docs/credits.txt 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/docs/credits.txt 2013-07-18 10:41:05 UTC (rev 11840) @@ -1,7 +1,5 @@ -This Module has been developed by Taiwen Jiang (phppp) +CREDITS: +=============== -Updates have been done by: - -Trabis -Voltan -Mamba \ No newline at end of file +This Module has been originally developed by Trabis from www.xuups.com, and was based on +SmartSection from SmartFactor, which was based in WF-Section and News. Deleted: XoopsModules/publisher/trunk/publisher/docs/licence.txt =================================================================== --- XoopsModules/publisher/trunk/publisher/docs/licence.txt 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/docs/licence.txt 2013-07-18 10:41:05 UTC (rev 11840) @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. Added: XoopsModules/publisher/trunk/publisher/docs/license.txt =================================================================== --- XoopsModules/publisher/trunk/publisher/docs/license.txt (rev 0) +++ XoopsModules/publisher/trunk/publisher/docs/license.txt 2013-07-18 10:41:05 UTC (rev 11840) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. Modified: XoopsModules/publisher/trunk/publisher/language/english/help/help.html =================================================================== --- XoopsModules/publisher/trunk/publisher/language/english/help/help.html 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/language/english/help/help.html 2013-07-18 10:41:05 UTC (rev 11840) @@ -10,9 +10,9 @@ <h4 class="odd">Description</h4><br/> - Publisher module is a Section Management System for your XOOPS Site.<br/><br/> + Publisher module is a Publishing Solution for your XOOPS Site.<br/><br/> - You can create articles in various categories<br/><br/> + You can create articles in various categories (columns) <br/><br/> <h4 class="odd">Operating instructions</h4><br/> Modified: XoopsModules/publisher/trunk/publisher/language/english/modinfo.php =================================================================== --- XoopsModules/publisher/trunk/publisher/language/english/modinfo.php 2013-07-17 18:24:25 UTC (rev 11839) +++ XoopsModules/publisher/trunk/publisher/language/english/modinfo.php 2013-07-18 10:41:05 UTC (rev 11840) @@ -126,7 +126,7 @@ define("_MI_PUBLISHER_MAX_SIZEDSC","Maximum size (in bytes) of a file that can be uploaded."); define("_MI_PUBLISHER_MAX_WIDTH","Maximum uploaded image width"); define("_MI_PUBLISHER_MAX_WIDTHDSC","Maximum width of an image file that can be uploaded."); -define("_MI_PUBLISHER_MD_DESC","Section Management System for your XOOPS Site"); +define("_MI_PUBLISHER_MD_DESC","Publishing Solution for your XOOPS Site"); define("_MI_PUBLISHE... [truncated message content] |
From: <be...@us...> - 2013-10-22 21:52:01
|
Revision: 12193 http://sourceforge.net/p/xoops/svn/12193 Author: beckmi Date: 2013-10-22 21:51:58 +0000 (Tue, 22 Oct 2013) Log Message: ----------- fixed two templates (bleekk) Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/docs/changelog.txt XoopsModules/publisher/trunk/publisher/templates/publisher_display_full.html XoopsModules/publisher/trunk/publisher/templates/publisher_display_summary.html XoopsModules/publisher/trunk/publisher/xoops_version.php Modified: XoopsModules/publisher/trunk/publisher/docs/changelog.txt =================================================================== --- XoopsModules/publisher/trunk/publisher/docs/changelog.txt 2013-10-22 17:13:44 UTC (rev 12192) +++ XoopsModules/publisher/trunk/publisher/docs/changelog.txt 2013-10-22 21:51:58 UTC (rev 12193) @@ -1,3 +1,6 @@ +<strong><u>=> Version 1.01 Final (2013-10-22)</u></strong> +- fixed two templates (bleekk) + <strong><u>=> Version 1.0 Final (2013-07-18)</u></strong> - added missing URL for doc image in \blocks\items_spot.php Modified: XoopsModules/publisher/trunk/publisher/templates/publisher_display_full.html =================================================================== --- XoopsModules/publisher/trunk/publisher/templates/publisher_display_full.html 2013-10-22 17:13:44 UTC (rev 12192) +++ XoopsModules/publisher/trunk/publisher/templates/publisher_display_full.html 2013-10-22 21:51:58 UTC (rev 12193) @@ -1,30 +1,57 @@ <{include file='db:publisher_header.html'}> -<!-- if we are on the index page OR inside a category that has subcats OR (inside a category with no subcats AND $display_category_summary is set to TRUE), let's display the summary table ! //--><{if $indexpage || $category.subcats || ($category && $display_category_summary)}> +<!-- if we are on the index page OR inside a category that has subcats OR (inside a category with no subcats + AND $display_category_summary is set to TRUE), let's display the summary table ! //--> -<{if $collapsable_heading == 1}> -<div class="publisher_collaps_title"> - <a href='javascript:;' onclick="toggle('toptable'); toggleIcon('toptableicon')"><img id='toptableicon' src='<{$publisher_url}>/images/links/close12.gif' alt=''/></a> <{$lang_category_summary}> -</div> -<div id='toptable'> - <span class="publisher_collaps_info""><{$lang_category_summary}></span> <!-- Content under the collapsable bar //--> <{/if}> +<{if $indexpage || $category.subcats || ($category && $display_category_summary)}> - <{include file='db:publisher_categories_table.html'}> + <{if $collapsable_heading == 1}> + <div class="publisher_collaps_title"> + <a href='javascript:;' onclick="toggle('toptable'); toggleIcon('toptableicon')"> + <img id='toptableicon' src='<{$publisher_url}>/images/links/close12.gif' alt=''/> + </a> + <{$lang_category_summary}> + </div> + <div id='toptable'> + <span class="publisher_collaps_info"> + <{$lang_category_summary}> + </span> + <!-- Content under the collapsable bar //--> + <{/if}> + + <{include file='db:publisher_categories_table.html'}> + + <{if $collapsable_heading == 1}> + </div> + <{/if}> + <br/><!-- End of if !$category || $category.subcats || ($category && $display_category_summary) //--> +<{/if}> +<{if $items}> + <{if $collapsable_heading == 1}> + <div class="publisher_collaps_title"> + <a href='javascript:;' onclick="toggle('bottomtable'); toggleIcon('bottomtableicon')";> + <img id='bottomtableicon' src='<{$publisher_url}>/images/links/close12.gif' alt=''/> + </a> + <{$lang_items_title}> + </div> + <div id='bottomtable'> + <span class="publisher_collaps_info"> + <{$smarty.const._MD_PUBLISHER_ITEMS_INFO}> + </span> + <{/if}> + <div align="right"><{$navbar}></div> + + <!-- Start item loop --> + <{foreach item=item from=$items}> + <{include file="db:publisher_singleitem.html" item=$item}> + <{/foreach}> <!-- End item loop --> + + <div align="right"><{$navbar}></div> + + <{if $collapsable_heading == 1}> + </div> + <{/if}><!-- end of if $items --> - <{if $collapsable_heading == 1}> -</div> <{/if}> -<br/><!-- End of if !$category || $category.subcats || ($category && $display_category_summary) //--><{/if}><{if $items}> <{if $collapsable_heading == 1}> -<div class="publisher_collaps_title"> - <a href='javascript:;' onclick="toggle('bottomtable'); toggleIcon('bottomtableicon')";><img id='bottomtableicon' src='<{$publisher_url}>/images/links/close12.gif' alt=''/></a> <{$lang_items_title}> -</div> -<div id='bottomtable'> - <span class="publisher_collaps_info"><{$smarty.const._MD_PUBLISHER_ITEMS_INFO}></span> <{/if}> - <div align="right"><{$navbar}></div> +<{/if}> - <!-- Start item loop --> <{foreach item=item from=$items}> <{include file="db:publisher_singleitem.html" item=$item}> <{/foreach}> <!-- End item loop --> - - <div align="right"><{$navbar}></div> - <{if $collapsable_heading == 1}> -</div> <{/if}><!-- end of if $items --> <{/if}> - <{include file='db:publisher_footer.html'}> \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/templates/publisher_display_summary.html =================================================================== --- XoopsModules/publisher/trunk/publisher/templates/publisher_display_summary.html 2013-10-22 17:13:44 UTC (rev 12192) +++ XoopsModules/publisher/trunk/publisher/templates/publisher_display_summary.html 2013-10-22 21:51:58 UTC (rev 12193) @@ -1,60 +1,90 @@ <{include file='db:publisher_header.html'}> -<!-- if we are on the index page OR inside a category that has subcats OR (inside a category with no subcats AND $display_category_summary is set to TRUE), let's display the summary table ! //--><{if $indexpage || $category.subcats || ($category && $display_category_summary)}> +<!-- if we are on the index page OR inside a category that has subcats OR + (inside a category with no subcats AND $display_category_summary is set to TRUE), + let's display the summary table ! //--> -<!-- let's begin the display of the other display type --> <{if $collapsable_heading == 1}> -<div class="publisher_collaps_title"> - <a href='javascript:;' onclick="toggle('toptable'); toggleIcon('toptableicon')"><img id='toptableicon' src='<{$publisher_url}>/images/links/close12.gif' alt=''/></a> <{$lang_category_summary}> -</div> -<div id='toptable'> - <span class="publisher_collaps_info""><{$lang_category_summary}></span> <!-- Content under the collapsable bar //--> <{/if}> +<{if $indexpage || $category.subcats || ($category && $display_category_summary)}> - <{include file='db:publisher_categories_table.html'}> + <!-- let's begin the display of the other display type --> + <{if $collapsable_heading == 1}> + <div class="publisher_collaps_title"> + <a href='javascript:;' onclick="toggle('toptable'); toggleIcon('toptableicon')"> + <img id='toptableicon' src='<{$publisher_url}>/images/links/close12.gif' alt=''/> + </a> <{$lang_category_summary}> + </div> + <div id='toptable'> + <span class="publisher_collaps_info"> + <{$lang_category_summary}> + </span> + <!-- Content under the collapsable bar //--> + <{/if}> + + <{include file='db:publisher_categories_table.html'}> + + <{if $collapsable_heading == 1}> + </div> + <{/if}> + <br/> +<!-- End of if !$category || $category.subcats || ($category && $display_category_summary) //--> +<{/if}> +<{if $items}> + <{if $collapsable_heading == 1}> + <div class="publisher_collaps_title"> + <a href='javascript:;' onclick="toggle('bottomtable'); toggleIcon('bottomtableicon')";> + <img id='bottomtableicon' src='<{$publisher_url}>/images/links/close12.gif' alt=''/> + </a> <{$lang_items_title}> + </div> + <div id='bottomtable'> + <span class="publisher_collaps_info"> + <{$smarty.const._MD_PUBLISHER_ITEMS_INFO}> + </span> + <{/if}> + <div align="right"><{$navbar}></div> + <table border="0" width="90%" cellspacing="1" cellpadding="3" align="center" class="outer"> + <tr> + <td align="left" class="itemHead" width='60%'> + <strong><{$smarty.const._CO_PUBLISHER_TITLE}></strong> + </td> + <{if $display_date_col == 1}> + <td align="center" class="itemHead" width="30%"> + <strong><{$smarty.const._MD_PUBLISHER_DATESUB}></strong> + </td> + <{/if}> + <{if $display_hits_col == 1}> + <td align="center" class="itemHead" width="10%"> + <strong><{$smarty.const._MD_PUBLISHER_HITS}></strong> + </td> + <{/if}> + </tr> + <!-- Start item loop --> + <{foreach item=item from=$items}> + <tr> + <td class="even" align="left"> + <strong><{$item.titlelink}></strong> + <{if $show_subtitle && $item.subtitle}> + <br /> + <em><{$item.subtitle}></em> + <{/if}> + </td> + <{if $display_date_col == 1}> + <td class="odd" align="left"> + <div align="center"><{$item.datesub}></div> + </td> + <{/if}> + <{if $display_hits_col == 1}> + <td class="odd" align="left"> + <div align="center"><{$item.counter}></div> + </td> + <{/if}> + </tr> + <{/foreach}> <!-- End item loop --> + <tr></tr> + </table> + <div align="right"><{$navbar}></div> + <{if $collapsable_heading == 1}> + </div> + <{/if}><!-- end of if $items --> +<{/if}> - <{if $collapsable_heading == 1}> -</div> <{/if}> -<br/><!-- End of if !$category || $category.subcats || ($category && $display_category_summary) //--><{/if}><{if $items}> <{if $collapsable_heading == 1}> -<div class="publisher_collaps_title"> - <a href='javascript:;' onclick="toggle('bottomtable'); toggleIcon('bottomtableicon')";><img id='bottomtableicon' src='<{$publisher_url}>/images/links/close12.gif' alt=''/></a> <{$lang_items_title}> -</div> -<div id='bottomtable'> - <span class="publisher_collaps_info"><{$smarty.const._MD_PUBLISHER_ITEMS_INFO}></span> <{/if}> - <div align="right"><{$navbar}></div> - <table border="0" width="90%" cellspacing="1" cellpadding="3" align="center" class="outer"> - <tr> - <td align="left" class="itemHead" width='60%'> - <strong><{$smarty.const._CO_PUBLISHER_TITLE}></strong></td> - <{if $display_date_col == 1}> - <td align="center" class="itemHead" width="30%"> - <strong><{$smarty.const._MD_PUBLISHER_DATESUB}></strong></td> - <{/if}> <{if $display_hits_col == 1}> - <td align="center" class="itemHead" width="10%"> - <strong><{$smarty.const._MD_PUBLISHER_HITS}></strong></td> - <{/if}> - </tr> - <!-- Start item loop --> <{foreach item=item from=$items}> - <tr> - <td class="even" align="left"> - <strong><{$item.titlelink}></strong> - <{if $show_subtitle && $item.subtitle}> - <br /><em><{$item.subtitle}></em> - <{/if}> - </td> - <{if $display_date_col == 1}> - <td class="odd" align="left"> - <div align="center"><{$item.datesub}></div> - </td> - <{/if}> <{if $display_hits_col == 1}> - <td class="odd" align="left"> - <div align="center"><{$item.counter}></div> - </td> - <{/if}> - </tr> - <{/foreach}> <!-- End item loop --> - <tr></tr> - </table> - <div align="right"><{$navbar}></div> - <{if $collapsable_heading == 1}> -</div> <{/if}><!-- end of if $items --> <{/if}> - <{include file='db:publisher_footer.html'}> \ No newline at end of file Modified: XoopsModules/publisher/trunk/publisher/xoops_version.php =================================================================== --- XoopsModules/publisher/trunk/publisher/xoops_version.php 2013-10-22 17:13:44 UTC (rev 12192) +++ XoopsModules/publisher/trunk/publisher/xoops_version.php 2013-10-22 21:51:58 UTC (rev 12193) @@ -23,7 +23,7 @@ xoops_load('XoopsLocal'); $modversion['name'] = _MI_PUBLISHER_MD_NAME; -$modversion['version'] = 1.0; +$modversion['version'] = 1.01; $modversion['description'] = _MI_PUBLISHER_MD_DESC; $modversion['author'] = "Trabis (www.Xuups.com)"; $modversion['credits'] = "w4z004, hsalazar, Mithrandir, fx2024, Ackbarr, Mariuss, Marco, Michiel, phppp, outch, Xvitry, Catzwolf, Shine, McDonald, trabis, Mowaffak, Bandit-x, Shiva"; @@ -53,9 +53,9 @@ $modversion['developer_website_url'] = "http://www.xuups.com"; $modversion['developer_website_name'] = "Xoops User Utilities"; $modversion['developer_email'] = "lus...@gm..."; -$modversion['status_version'] = "Final"; -$modversion['status'] = "Final"; -$modversion['date'] = "2011-12-04"; +$modversion['status_version'] = "Beta 1"; +$modversion['status'] = "Beta 1"; +$modversion['date'] = "2013-10-22"; //$modversion['warning'] = _MI_PUBLISHER_WARNING_BETA; @@ -79,8 +79,8 @@ //about -$modversion['release_date'] = '2013/07/18'; -$modversion['module_status'] = "Final"; +$modversion['release_date'] = '2013/10/22'; +$modversion['module_status'] = "Beta 1"; $modversion['min_php'] = '5.2.0'; $modversion['min_xoops'] = '2.5.6'; $modversion['min_db'] = array('mysql'=>'5.0.7', 'mysqli'=>'5.0.7'); |
From: <be...@us...> - 2014-06-22 02:42:32
|
Revision: 12629 http://sourceforge.net/p/xoops/svn/12629 Author: beckmi Date: 2014-06-22 02:42:25 +0000 (Sun, 22 Jun 2014) Log Message: ----------- updated to XOOPS 2.5.7 version of jQuery UI Tabs (noo-b/mamba) Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/admin/about.php XoopsModules/publisher/trunk/publisher/admin/admin_header.php XoopsModules/publisher/trunk/publisher/admin/category.php XoopsModules/publisher/trunk/publisher/admin/clone.php XoopsModules/publisher/trunk/publisher/admin/file.php XoopsModules/publisher/trunk/publisher/admin/import/news.php XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php XoopsModules/publisher/trunk/publisher/admin/import/xfsection.php XoopsModules/publisher/trunk/publisher/admin/import.php XoopsModules/publisher/trunk/publisher/admin/index.php XoopsModules/publisher/trunk/publisher/admin/item.php XoopsModules/publisher/trunk/publisher/admin/main.php XoopsModules/publisher/trunk/publisher/admin/menu.php XoopsModules/publisher/trunk/publisher/admin/mimetypes.php XoopsModules/publisher/trunk/publisher/admin/pagewrap.php XoopsModules/publisher/trunk/publisher/admin/permissions.php XoopsModules/publisher/trunk/publisher/admin/preferences.php XoopsModules/publisher/trunk/publisher/admin/pw_delete_file.php XoopsModules/publisher/trunk/publisher/admin/pw_upload_file.php XoopsModules/publisher/trunk/publisher/archive.php XoopsModules/publisher/trunk/publisher/author_items.php XoopsModules/publisher/trunk/publisher/backend.php XoopsModules/publisher/trunk/publisher/blocks/category_items_sel.php XoopsModules/publisher/trunk/publisher/blocks/date_to_date.php XoopsModules/publisher/trunk/publisher/blocks/items_columns.php XoopsModules/publisher/trunk/publisher/blocks/items_menu.php XoopsModules/publisher/trunk/publisher/blocks/items_new.php XoopsModules/publisher/trunk/publisher/blocks/items_random_item.php XoopsModules/publisher/trunk/publisher/blocks/items_recent.php XoopsModules/publisher/trunk/publisher/blocks/items_spot.php XoopsModules/publisher/trunk/publisher/blocks/latest_files.php XoopsModules/publisher/trunk/publisher/blocks/latest_news.php XoopsModules/publisher/trunk/publisher/blocks/search.php XoopsModules/publisher/trunk/publisher/category.php XoopsModules/publisher/trunk/publisher/class/blockform.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/file.php XoopsModules/publisher/trunk/publisher/class/form/category.php XoopsModules/publisher/trunk/publisher/class/form/file.php XoopsModules/publisher/trunk/publisher/class/form/item.php XoopsModules/publisher/trunk/publisher/class/formdatetime.php XoopsModules/publisher/trunk/publisher/class/groupperm.php XoopsModules/publisher/trunk/publisher/class/highlighter.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/class/metagen.php XoopsModules/publisher/trunk/publisher/class/mimetype.php XoopsModules/publisher/trunk/publisher/class/permission.php XoopsModules/publisher/trunk/publisher/class/publisher.php XoopsModules/publisher/trunk/publisher/class/rating.php XoopsModules/publisher/trunk/publisher/class/request.php XoopsModules/publisher/trunk/publisher/class/session.php XoopsModules/publisher/trunk/publisher/class/themetabform.php XoopsModules/publisher/trunk/publisher/class/uploader.php XoopsModules/publisher/trunk/publisher/comment_delete.php XoopsModules/publisher/trunk/publisher/comment_edit.php XoopsModules/publisher/trunk/publisher/comment_new.php XoopsModules/publisher/trunk/publisher/comment_post.php XoopsModules/publisher/trunk/publisher/comment_reply.php XoopsModules/publisher/trunk/publisher/docs/ajaxrating.txt XoopsModules/publisher/trunk/publisher/docs/changelog.txt XoopsModules/publisher/trunk/publisher/docs/install.txt XoopsModules/publisher/trunk/publisher/file.php XoopsModules/publisher/trunk/publisher/footer.php XoopsModules/publisher/trunk/publisher/header.php XoopsModules/publisher/trunk/publisher/include/ajax_rating.php XoopsModules/publisher/trunk/publisher/include/ajax_upload.php XoopsModules/publisher/trunk/publisher/include/comment_functions.php XoopsModules/publisher/trunk/publisher/include/common.php XoopsModules/publisher/trunk/publisher/include/constants.php XoopsModules/publisher/trunk/publisher/include/functions.php XoopsModules/publisher/trunk/publisher/include/install.php XoopsModules/publisher/trunk/publisher/include/media.textsanitizer.php XoopsModules/publisher/trunk/publisher/include/notification.inc.php XoopsModules/publisher/trunk/publisher/include/plugin.tag.php XoopsModules/publisher/trunk/publisher/include/search.inc.php XoopsModules/publisher/trunk/publisher/include/seo.inc.php XoopsModules/publisher/trunk/publisher/include/seo_functions.php XoopsModules/publisher/trunk/publisher/include/update.php XoopsModules/publisher/trunk/publisher/index.php XoopsModules/publisher/trunk/publisher/item.php XoopsModules/publisher/trunk/publisher/language/english/admin.php XoopsModules/publisher/trunk/publisher/language/english/blocks.php XoopsModules/publisher/trunk/publisher/language/english/common.php XoopsModules/publisher/trunk/publisher/language/english/main.php XoopsModules/publisher/trunk/publisher/language/english/modinfo.php XoopsModules/publisher/trunk/publisher/list.tag.php XoopsModules/publisher/trunk/publisher/makepdf.php XoopsModules/publisher/trunk/publisher/notification_update.php XoopsModules/publisher/trunk/publisher/pop.php XoopsModules/publisher/trunk/publisher/print.php XoopsModules/publisher/trunk/publisher/rate.php XoopsModules/publisher/trunk/publisher/search.php XoopsModules/publisher/trunk/publisher/sql/mysql.sql XoopsModules/publisher/trunk/publisher/submit.php XoopsModules/publisher/trunk/publisher/thumb.php XoopsModules/publisher/trunk/publisher/view.tag.php XoopsModules/publisher/trunk/publisher/visit.php XoopsModules/publisher/trunk/publisher/xoops_version.php Added Paths: ----------- XoopsModules/publisher/trunk/publisher/admin/import/ams.php XoopsModules/publisher/trunk/publisher/admin/import/ams0.php XoopsModules/publisher/trunk/publisher/admin/import/cjaycontent.php XoopsModules/publisher/trunk/publisher/admin/import/xnews.php XoopsModules/publisher/trunk/publisher/assets/ XoopsModules/publisher/trunk/publisher/assets/css/ XoopsModules/publisher/trunk/publisher/assets/css/images/ XoopsModules/publisher/trunk/publisher/assets/css/images/index.html XoopsModules/publisher/trunk/publisher/assets/css/images/ui-bg_flat_0_aaaaaa_40x100.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-bg_flat_75_ffffff_40x100.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-bg_glass_65_ffffff_1x400.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-bg_glass_75_dadada_1x400.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-bg_glass_95_fef1ec_1x400.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-icons_222222_256x240.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-icons_2e83ff_256x240.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-icons_454545_256x240.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-icons_888888_256x240.png XoopsModules/publisher/trunk/publisher/assets/css/images/ui-icons_cd0a0a_256x240.png XoopsModules/publisher/trunk/publisher/assets/css/index.html XoopsModules/publisher/trunk/publisher/assets/css/jquery.popeye.style.css XoopsModules/publisher/trunk/publisher/assets/css/publisher.css XoopsModules/publisher/trunk/publisher/assets/images/ XoopsModules/publisher/trunk/publisher/assets/images/VeraBd.ttf XoopsModules/publisher/trunk/publisher/assets/images/arrow-bg.png XoopsModules/publisher/trunk/publisher/assets/images/bg.gif XoopsModules/publisher/trunk/publisher/assets/images/blank.png XoopsModules/publisher/trunk/publisher/assets/images/bullet.gif XoopsModules/publisher/trunk/publisher/assets/images/button_delete.png XoopsModules/publisher/trunk/publisher/assets/images/button_edit.png XoopsModules/publisher/trunk/publisher/assets/images/dot-grey.gif XoopsModules/publisher/trunk/publisher/assets/images/gfx/ XoopsModules/publisher/trunk/publisher/assets/images/gfx/count-2.png XoopsModules/publisher/trunk/publisher/assets/images/gfx/enlarge-1.png XoopsModules/publisher/trunk/publisher/assets/images/gfx/enlarge-2.png XoopsModules/publisher/trunk/publisher/assets/images/gfx/index.html XoopsModules/publisher/trunk/publisher/assets/images/gfx/loading.gif XoopsModules/publisher/trunk/publisher/assets/images/gfx/next-1.png XoopsModules/publisher/trunk/publisher/assets/images/gfx/next-2.png XoopsModules/publisher/trunk/publisher/assets/images/gfx/next.gif XoopsModules/publisher/trunk/publisher/assets/images/gfx/prev-1.png XoopsModules/publisher/trunk/publisher/assets/images/gfx/prev-2.png XoopsModules/publisher/trunk/publisher/assets/images/gfx/prev.gif XoopsModules/publisher/trunk/publisher/assets/images/grad-bg.png XoopsModules/publisher/trunk/publisher/assets/images/icon/ XoopsModules/publisher/trunk/publisher/assets/images/icon/approve.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/cat.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/clone.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/close12.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/delete.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/delete.png XoopsModules/publisher/trunk/publisher/assets/images/icon/doc.png XoopsModules/publisher/trunk/publisher/assets/images/icon/edit.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/edit.png XoopsModules/publisher/trunk/publisher/assets/images/icon/editcopy.png XoopsModules/publisher/trunk/publisher/assets/images/icon/file.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/friend.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/index.html XoopsModules/publisher/trunk/publisher/assets/images/icon/newanswer.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/open12.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/pdf.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/print.gif XoopsModules/publisher/trunk/publisher/assets/images/icon/subcat.gif XoopsModules/publisher/trunk/publisher/assets/images/icon32/ XoopsModules/publisher/trunk/publisher/assets/images/icon32/editcopy.png XoopsModules/publisher/trunk/publisher/assets/images/icon32/folder_txt.png XoopsModules/publisher/trunk/publisher/assets/images/icon32/index.html XoopsModules/publisher/trunk/publisher/assets/images/important-32.png XoopsModules/publisher/trunk/publisher/assets/images/index.html XoopsModules/publisher/trunk/publisher/assets/images/item_icon.gif XoopsModules/publisher/trunk/publisher/assets/images/left_both.gif XoopsModules/publisher/trunk/publisher/assets/images/links/ XoopsModules/publisher/trunk/publisher/assets/images/links/approve.gif XoopsModules/publisher/trunk/publisher/assets/images/links/cat.gif XoopsModules/publisher/trunk/publisher/assets/images/links/clone.gif XoopsModules/publisher/trunk/publisher/assets/images/links/close12.gif XoopsModules/publisher/trunk/publisher/assets/images/links/delete.gif XoopsModules/publisher/trunk/publisher/assets/images/links/delete.png XoopsModules/publisher/trunk/publisher/assets/images/links/doc.png XoopsModules/publisher/trunk/publisher/assets/images/links/edit.gif XoopsModules/publisher/trunk/publisher/assets/images/links/edit.png XoopsModules/publisher/trunk/publisher/assets/images/links/editcopy.png XoopsModules/publisher/trunk/publisher/assets/images/links/file.gif XoopsModules/publisher/trunk/publisher/assets/images/links/friend.gif XoopsModules/publisher/trunk/publisher/assets/images/links/index.html XoopsModules/publisher/trunk/publisher/assets/images/links/newanswer.gif XoopsModules/publisher/trunk/publisher/assets/images/links/next.gif XoopsModules/publisher/trunk/publisher/assets/images/links/open12.gif XoopsModules/publisher/trunk/publisher/assets/images/links/pdf.gif XoopsModules/publisher/trunk/publisher/assets/images/links/previous.gif XoopsModules/publisher/trunk/publisher/assets/images/links/print.gif XoopsModules/publisher/trunk/publisher/assets/images/links/subcat.gif XoopsModules/publisher/trunk/publisher/assets/images/loadingbar.gif XoopsModules/publisher/trunk/publisher/assets/images/module_logo.png XoopsModules/publisher/trunk/publisher/assets/images/no.gif XoopsModules/publisher/trunk/publisher/assets/images/off.png XoopsModules/publisher/trunk/publisher/assets/images/on.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/ XoopsModules/publisher/trunk/publisher/assets/images/popeye/bg1.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/compact3.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/enlarge3.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/index.html XoopsModules/publisher/trunk/publisher/assets/images/popeye/loading3.gif XoopsModules/publisher/trunk/publisher/assets/images/popeye/next3.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/prev3.png XoopsModules/publisher/trunk/publisher/assets/images/right_both.gif XoopsModules/publisher/trunk/publisher/assets/images/rss.gif XoopsModules/publisher/trunk/publisher/assets/images/span-bg.gif XoopsModules/publisher/trunk/publisher/assets/images/starrating.gif XoopsModules/publisher/trunk/publisher/assets/images/transparent_bg.png XoopsModules/publisher/trunk/publisher/assets/images/working.gif XoopsModules/publisher/trunk/publisher/assets/index.html XoopsModules/publisher/trunk/publisher/assets/js/ XoopsModules/publisher/trunk/publisher/assets/js/ajaxupload.3.9.js XoopsModules/publisher/trunk/publisher/assets/js/behavior.js XoopsModules/publisher/trunk/publisher/assets/js/cookies.js XoopsModules/publisher/trunk/publisher/assets/js/funcs.js XoopsModules/publisher/trunk/publisher/assets/js/index.html XoopsModules/publisher/trunk/publisher/assets/js/jquery.easing.js XoopsModules/publisher/trunk/publisher/assets/js/jquery.popeye-2.0.4.js XoopsModules/publisher/trunk/publisher/assets/js/publisher.js XoopsModules/publisher/trunk/publisher/assets/js/rating.js XoopsModules/publisher/trunk/publisher/assets/js/script.easing.js XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_category_items_sel.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_date_to_date.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_columns.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_menu.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_new.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_random_item.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_recent.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_spot.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_latest_files.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_latest_news.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_search_block.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_addfile.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_archive.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_author_items.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_categories_table.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_display_full.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_display_list.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_display_summary.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_display_wfsection.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_footer.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_header.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_item.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_print.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_rss.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_search.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_singleitem.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_singleitem_block.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_submit.tpl XoopsModules/publisher/trunk/publisher/tests/ XoopsModules/publisher/trunk/publisher/tests/index.html Removed Paths: ------------- XoopsModules/publisher/trunk/publisher/css/ XoopsModules/publisher/trunk/publisher/images/ XoopsModules/publisher/trunk/publisher/js/ XoopsModules/publisher/trunk/publisher/tcpdf/ XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_category_items_sel.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_date_to_date.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_columns.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_menu.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_new.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_random_item.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_recent.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_spot.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_latest_files.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_latest_news.html XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_search_block.html XoopsModules/publisher/trunk/publisher/templates/publisher_addfile.html XoopsModules/publisher/trunk/publisher/templates/publisher_archive.html XoopsModules/publisher/trunk/publisher/templates/publisher_author_items.html XoopsModules/publisher/trunk/publisher/templates/publisher_categories_table.html XoopsModules/publisher/trunk/publisher/templates/publisher_display_full.html XoopsModules/publisher/trunk/publisher/templates/publisher_display_list.html XoopsModules/publisher/trunk/publisher/templates/publisher_display_summary.html XoopsModules/publisher/trunk/publisher/templates/publisher_display_wfsection.html XoopsModules/publisher/trunk/publisher/templates/publisher_footer.html XoopsModules/publisher/trunk/publisher/templates/publisher_header.html XoopsModules/publisher/trunk/publisher/templates/publisher_item.html XoopsModules/publisher/trunk/publisher/templates/publisher_print.html XoopsModules/publisher/trunk/publisher/templates/publisher_rss.html XoopsModules/publisher/trunk/publisher/templates/publisher_search.html XoopsModules/publisher/trunk/publisher/templates/publisher_singleitem.html XoopsModules/publisher/trunk/publisher/templates/publisher_singleitem_block.html XoopsModules/publisher/trunk/publisher/templates/publisher_submit.html Modified: XoopsModules/publisher/trunk/publisher/admin/about.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/about.php 2014-06-22 02:35:42 UTC (rev 12628) +++ XoopsModules/publisher/trunk/publisher/admin/about.php 2014-06-22 02:42:25 UTC (rev 12629) @@ -1,32 +1,32 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - -/** - * Publisher - * - * @copyright The XOOPS Project (http://www.xoops.org) - * @license GNU GPL (http://www.gnu.org/licenses/gpl-2.0.html/) - * @package Publisher - * @since 1.0 - * @author Mage, Mamba - * @version $Id$ - */ - -include_once dirname(__FILE__) . '/admin_header.php'; - -xoops_cp_header(); - -$aboutAdmin = new ModuleAdmin(); - -echo $aboutAdmin->addNavigation('about.php'); -echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); - -xoops_cp_footer(); \ No newline at end of file +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +*/ + +/** + * Publisher + * + * @copyright The XOOPS Project (http://www.xoops.org) + * @license GNU GPL (http://www.gnu.org/licenses/gpl-2.0.html/) + * @package Publisher + * @since 1.0 + * @author Mage, Mamba + * @version $Id$ + */ + +include_once dirname(__FILE__) . '/admin_header.php'; + +xoops_cp_header(); + +$aboutAdmin = new ModuleAdmin(); + +echo $aboutAdmin->addNavigation('about.php'); +echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); + +xoops_cp_footer(); Modified: XoopsModules/publisher/trunk/publisher/admin/admin_header.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2014-06-22 02:35:42 UTC (rev 12628) +++ XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2014-06-22 02:42:25 UTC (rev 12629) @@ -1,46 +1,46 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package Publisher - * @since 1.0 - * @author trabis <lus...@gm...> - * @author The SmartFactory <www.smartfactory.ca> - * @version $Id$ - */ - -include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; -include_once dirname(dirname(__FILE__)) . '/include/common.php'; -include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; - -//xoops_loadLanguage('admin', PUBLISHER_DIRNAME); -xoops_loadLanguage('modinfo', PUBLISHER_DIRNAME); - -$imagearray = array( - 'editimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_edit.png' alt='" . _AM_PUBLISHER_ICO_EDIT . "' align='middle' />", - 'deleteimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_delete.png' alt='" . _AM_PUBLISHER_ICO_DELETE . "' align='middle' />", - 'online' => "<img src='" . PUBLISHER_IMAGES_URL . "/on.png' alt='" . _AM_PUBLISHER_ICO_ONLINE . "' align='middle' />", - 'offline' => "<img src='" . PUBLISHER_IMAGES_URL . "/off.png' alt='" . _AM_PUBLISHER_ICO_OFFLINE . "' align='middle' />", -); -if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))){ - include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); -}else{ - echo xoops_error('/Frameworks/moduleclasses/moduleadmin/ is required!!!'); -} -/* -$myts = MyTextSanitizer::getInstance(); - -if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { - include_once(XOOPS_ROOT_PATH."/class/template.php"); - $xoopsTpl = new XoopsTpl(); -} */ \ No newline at end of file +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package Publisher + * @since 1.0 + * @author trabis <lus...@gm...> + * @author The SmartFactory <www.smartfactory.ca> + * @version $Id$ + */ + +include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; +include_once dirname(dirname(__FILE__)) . '/include/common.php'; +include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; + +//xoops_loadLanguage('admin', PUBLISHER_DIRNAME); +xoops_loadLanguage('modinfo', PUBLISHER_DIRNAME); + +$imagearray = array( + 'editimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_edit.png' alt='" . _AM_PUBLISHER_ICO_EDIT . "' align='middle' />", + 'deleteimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_delete.png' alt='" . _AM_PUBLISHER_ICO_DELETE . "' align='middle' />", + 'online' => "<img src='" . PUBLISHER_IMAGES_URL . "/on.png' alt='" . _AM_PUBLISHER_ICO_ONLINE . "' align='middle' />", + 'offline' => "<img src='" . PUBLISHER_IMAGES_URL . "/off.png' alt='" . _AM_PUBLISHER_ICO_OFFLINE . "' align='middle' />", +); +if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))) { + include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); +} else { + echo xoops_error('/Frameworks/moduleclasses/moduleadmin/ is required!!!'); +} +/* +$myts = MyTextSanitizer::getInstance(); + +if (!isset($xoopsTpl) || !is_object($xoopsTpl)) { + include_once(XOOPS_ROOT_PATH."/class/template.php"); + $xoopsTpl = new XoopsTpl(); +} */ Modified: XoopsModules/publisher/trunk/publisher/admin/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/category.php 2014-06-22 02:35:42 UTC (rev 12628) +++ XoopsModules/publisher/trunk/publisher/admin/category.php 2014-06-22 02:42:25 UTC (rev 12629) @@ -1,410 +1,410 @@ -<?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ - -/** - * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package Publisher - * @since 1.0 - * @author trabis <lus...@gm...> - * @author The SmartFactory <www.smartfactory.ca> - * @version $Id$ - */ - -include_once dirname(__FILE__) . '/admin_header.php'; - -$op = PublisherRequest::getString('op'); - -$op = isset($_POST['editor']) ? 'mod' : $op; -if (isset($_POST['addcategory'])) { - $op = 'addcategory'; -} - -// Where do we start ? -$startcategory = PublisherRequest::getInt('startcategory'); -$categoryid = PublisherRequest::getInt('categoryid'); - -switch ($op) { - - case "del": - $categoryObj = $publisher->getHandler('category')->get($categoryid); - $confirm = (isset($_POST['confirm'])) ? $_POST['confirm'] : 0; - $name = (isset($_POST['name'])) ? $_POST['name'] : ''; - if ($confirm) { - if (!$publisher->getHandler('category')->delete($categoryObj)) { - redirect_header("category.php", 1, _AM_PUBLISHER_DELETE_CAT_ERROR); - exit(); - } - redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_COLISDELETED, $name)); - exit(); - } else { - xoops_cp_header(); - xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_PUBLISHER_DELETECOL . " '" . $categoryObj->name() . "'. <br /> <br />" . _AM_PUBLISHER_DELETE_CAT_CONFIRM, _AM_PUBLISHER_DELETE); - xoops_cp_footer(); - } - break; - - case "mod": - //Added by fx2024 - $nb_subcats = isset($_POST['nb_subcats']) ? intval($_POST['nb_subcats']) : 0; - $nb_subcats = $nb_subcats + (isset($_POST['nb_sub_yet']) ? intval($_POST['nb_sub_yet']) : 4); - //end of fx2024 code - - publisher_cpHeader(); - publisher_editCat(true, $categoryid, $nb_subcats); - break; - - case "addcategory": - global $modify; - - $parentid = PublisherRequest::getInt('parentid'); - - if ($categoryid != 0) { - $categoryObj = $publisher->getHandler('category')->get($categoryid); - } else { - $categoryObj = $publisher->getHandler('category')->create(); - } - - // Uploading the image, if any - // Retreive the filename to be uploaded - if (isset($_FILES['image_file']['name']) && $_FILES['image_file']['name'] != "") { - $filename = $_POST["xoops_upload_file"][0]; - if (!empty($filename) || $filename != "") { - // TODO : implement publisher mimetype management - $max_size = $publisher->getConfig('maximum_filesize'); - $max_imgwidth = $publisher->getConfig('maximum_image_width'); - $max_imgheight = $publisher->getConfig('maximum_image_height'); - $allowed_mimetypes = publisher_getAllowedImagesTypes(); - - if ($_FILES[$filename]['tmp_name'] == "" || !is_readable($_FILES[$filename]['tmp_name'])) { - redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR); - exit(); - } - - xoops_load('XoopsMediaUploader'); - $uploader = new XoopsMediaUploader(publisher_getImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); - if ($uploader->fetchMedia($filename) && $uploader->upload()) { - $categoryObj->setVar('image', $uploader->getSavedFileName()); - } else { - redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR . $uploader->getErrors()); - exit(); - } - } - } else { - if (isset($_POST['image'])) { - $categoryObj->setVar('image', $_POST['image']); - } - } - $categoryObj->setVar('parentid', (isset($_POST['parentid'])) ? intval($_POST['parentid']) : 0); - - $applyall = isset($_POST['applyall']) ? intval($_POST['applyall']) : 0; - $categoryObj->setVar('weight', isset($_POST['weight']) ? intval($_POST['weight']) : 1); - - // Groups and permissions - $grpread = isset($_POST['groups_read']) ? $_POST['groups_read'] : array(); - $grpsubmit = isset($_POST['groups_submit']) ? $_POST['groups_submit'] : array(); - $grpmoderation = isset($_POST['groups_moderation']) ? $_POST['groups_moderation'] : array(); - - - $categoryObj->setVar('name', $_POST['name']); - - //Added by skalpa: custom template support - if (isset($_POST['template'])) { - $categoryObj->setVar('template', $_POST['template']); - } - - if (isset($_POST['meta_description'])) { - $categoryObj->setVar('meta_description', $_POST['meta_description']); - } - if (isset($_POST['meta_keywords'])) { - $categoryObj->setVar('meta_keywords', $_POST['meta_keywords']); - } - if (isset($_POST['short_url'])) { - $categoryObj->setVar('short_url', $_POST['short_url']); - } - $categoryObj->setVar('moderator', intval($_POST['moderator'])); - $categoryObj->setVar('description', $_POST['description']); - - if (isset($_POST['header'])) { - $categoryObj->setVar('header', $_POST['header']); - } - - if ($categoryObj->isNew()) { - $redirect_msg = _AM_PUBLISHER_CATCREATED; - $redirect_to = 'category.php?op=mod'; - } else { - $redirect_msg = _AM_PUBLISHER_COLMODIFIED; - $redirect_to = 'category.php'; - } - - if (!$categoryObj->store()) { - redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_CATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); - exit; - } - // TODO : put this function in the category class - publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); - publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); - - - //Added by fx2024 - $parentCat = $categoryObj->categoryid(); - $sizeof = sizeof($_POST['scname']); - for ($i = 0; $i < $sizeof; $i++) { - if ($_POST['scname'][$i] != '') { - $categoryObj = $publisher->getHandler('category')->create(); - $categoryObj->setVar('name', $_POST['scname'][$i]); - $categoryObj->setVar('parentid', $parentCat); - - if (!$categoryObj->store()) { - redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); - exit; - } - // TODO : put this function in the category class - publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); - publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); - } - } - //end of fx2024 code - redirect_header($redirect_to, 2, $redirect_msg); - exit(); - break; - - //Added by fx2024 - - case "addsubcats": - $categoryid = 0; - $nb_subcats = intval($_POST['nb_subcats']) + $_POST['nb_sub_yet']; - - $categoryObj = $publisher->getHandler('category')->create(); - $categoryObj->setVar('name', $_POST['name']); - $categoryObj->setVar('description', $_POST['description']); - $categoryObj->setVar('weight', $_POST['weight']); - if (isset($parentCat)) { - $categoryObj->setVar('parentid', $parentCat); - } - - publisher_cpHeader(); - publisher_editCat(true, $categoryid, $nb_subcats, $categoryObj); - exit(); - - break; - //end of fx2024 code - - case "cancel": - redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_BACK2IDX, '')); - exit(); - - case "default": - default: - publisher_cpHeader(); - //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES); - - echo "<br />\n"; - echo "<form><div style=\"margin-bottom: 12px;\">"; - echo "<input type='button' name='button' onclick=\"location='category.php?op=mod'\" value='" . _AM_PUBLISHER_CATEGORY_CREATE . "'> "; - //echo "<input type='button' name='button' onclick=\"location='item.php?op=mod'\" value='" . _AM_PUBLISHER_CREATEITEM . "'> "; - echo "</div></form>"; - - // Creating the objects for top categories - $categoriesObj = $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0); - - publisher_openCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC); - - echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; - echo "<tr>"; - echo "<th class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMCATEGORYNAME . "</strong></td>"; - echo "<th width='60' class='bg3' width='65' align='center'><strong>" . _CO_PUBLISHER_WEIGHT . "</strong></td>"; - echo "<th width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; - echo "</tr>"; - $totalCategories = $publisher->getHandler('category')->getCategoriesCount(0); - if (count($categoriesObj) > 0) { - foreach ($categoriesObj as $key => $thiscat) { - publisher_displayCategory($thiscat); - } - } else { - echo "<tr>"; - echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOCAT . "</td>"; - echo "</tr>"; - $categoryid = '0'; - } - echo "</table>\n"; - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; - $pagenav = new XoopsPageNav($totalCategories, $publisher->getConfig('idxcat_perpage'), $startcategory, 'startcategory'); - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; - echo "<br />"; - publisher_closeCollapsableBar('createdcategories', 'createdcategoriesicon'); - echo "<br>"; - //editcat(false); - break; -} - -xoops_cp_footer(); - -function publisher_displayCategory($categoryObj, $level = 0) -{ - $publisher = PublisherPublisher::getInstance(); - - $description = $categoryObj->description(); - if (!XOOPS_USE_MULTIBYTES) { - if (strlen($description) >= 100) { - $description = substr($description, 0, (100 - 1)) . "..."; - } - } - $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "&parentid=" . $categoryObj->parentid() . "'><img src='" . PUBLISHER_URL . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITCOL . "' alt='" . _AM_PUBLISHER_EDITCOL . "' /></a>"; - $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . PUBLISHER_URL . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETECOL . "' alt='" . _AM_PUBLISHER_DELETECOL . "' /></a>"; - - $spaces = ''; - for ($j = 0; $j < $level; $j++) { - $spaces .= ' '; - } - - echo "<tr>"; - echo "<td class='even' align='left'>" . $spaces . "<a href='" . PUBLISHER_URL . "/category.php?categoryid=" . $categoryObj->categoryid() . "'><img src='" . PUBLISHER_URL . "/images/links/subcat.gif' alt='' /> " . $categoryObj->name() . "</a></td>"; - echo "<td class='even' align='center'>" . $categoryObj->weight() . "</td>"; - echo "<td class='even' align='center'> $modify $delete </td>"; - echo "</tr>"; - $subCategoriesObj = $publisher->getHandler('category')->getCategories(0, 0, $categoryObj->categoryid()); - if (count($subCategoriesObj) > 0) { - $level++; - foreach ($subCategoriesObj as $key => $thiscat) { - publisher_displayCategory($thiscat, $level); - } - } - unset($categoryObj); -} - -function publisher_editCat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryObj = null) -{ - $publisher = PublisherPublisher::getInstance(); - - // if there is a parameter, and the id exists, retrieve data: we're editing a category - if ($categoryid != 0) { - // Creating the category object for the selected category - $categoryObj = $publisher->getHandler('category')->get($categoryid); - if ($categoryObj->notLoaded()) { - redirect_header("category.php", 1, _AM_PUBLISHER_NOCOLTOEDIT); - exit(); - } - } else { - if (!$categoryObj) { - $categoryObj = $publisher->getHandler('category')->create(); - } - } - - if ($categoryid != 0) { - if ($showmenu) { - //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_EDITING); - } - echo "<br />\n"; - publisher_openCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO); - } else { - if ($showmenu) { - //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_CREATINGNEW); - } - publisher_openCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO); - } - - $sform = $categoryObj->getForm($nb_subcats); - $sform->display(); - - if (!$categoryid) { - publisher_closeCollapsableBar('createtable', 'createtableicon'); - } else { - publisher_closeCollapsableBar('edittable', 'edittableicon'); - } - - //Added by fx2024 - if ($categoryid) { - $sel_cat = $categoryid; - - publisher_openCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC); - // Get the total number of sub-categories - $categoriesObj = $publisher->getHandler('category')->get($sel_cat); - $totalsubs = $publisher->getHandler('category')->getCategoriesCount($sel_cat); - // creating the categories objects that are published - $subcatsObj = $publisher->getHandler('category')->getCategories(0, 0, $categoriesObj->categoryid()); - $totalSCOnPage = count($subcatsObj); - echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; - echo "<tr>"; - echo "<td width='60' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATID . "</strong></td>"; - echo "<td width='20%' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATCOLNAME . "</strong></td>"; - echo "<td class='bg3' align='left'><strong>" . _AM_PUBLISHER_SUBDESCRIPT . "</strong></td>"; - echo "<td width='60' class='bg3' align='right'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; - echo "</tr>"; - if ($totalsubs > 0) { - foreach ($subcatsObj as $subcat) { - $modify = "<a href='category.php?op=mod&categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_MODIFY . "' alt='" . _AM_PUBLISHER_MODIFY . "' /></a>"; - $delete = "<a href='category.php?op=del&categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETE . "' alt='" . _AM_PUBLISHER_DELETE . "' /></a>"; - echo "<tr>"; - echo "<td class='head' align='left'>" . $subcat->categoryid() . "</td>"; - echo "<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/category.php?categoryid=" . $subcat->categoryid() . "&parentid=" . $subcat->parentid() . "'>" . $subcat->name() . "</a></td>"; - echo "<td class='even' align='left'>" . $subcat->description() . "</td>"; - echo "<td class='even' align='right'> {$modify} {$delete} </td>"; - echo "</tr>"; - } - } else { - echo "<tr>"; - echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOSUBCAT . "</td>"; - echo "</tr>"; - } - echo "</table>\n"; - echo "<br />\n"; - publisher_closeCollapsableBar('subcatstable', 'subcatsicon'); - - publisher_openCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC); - $startitem = PublisherRequest::getInt('startitem'); - // Get the total number of published ITEMS - $totalitems = $publisher->getHandler('item')->getItemsCount($sel_cat, array(_PUBLISHER_STATUS_PUBLISHED)); - // creating the items objects that are published - $itemsObj = $publisher->getHandler('item')->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $sel_cat); - $totalitemsOnPage = count($itemsObj); - $allcats = $publisher->getHandler('category')->getObjects(null, true); - echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; - echo "<tr>"; - echo "<td width='40' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ITEMID . "</strong></td>"; - echo "<td width='20%' class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMCOLNAME . "</strong></td>"; - echo "<td class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMDESC . "</strong></td>"; - echo "<td width='90' class='bg3' align='center'><strong>" . _AM_PUBLISHER_CREATED . "</strong></td>"; - echo "<td width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; - echo "</tr>"; - if ($totalitems > 0) { - for ($i = 0; $i < $totalitemsOnPage; $i++) { - $categoryObj = $allcats[$itemsObj[$i]->categoryid()]; - $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; - $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; - echo "<tr>"; - echo "<td class='head' align='center'>" . $itemsObj[$i]->itemid() . "</td>"; - echo "<td class='even' align='left'>" . $categoryObj->name() . "</td>"; - echo "<td class='even' align='left'>" . $itemsObj[$i]->getitemLink() . "</td>"; - echo "<td class='even' align='center'>" . $itemsObj[$i]->datesub('s') . "</td>"; - echo "<td class='even' align='center'> $modify $delete </td>"; - echo "</tr>"; - } - } else { - $itemid = -1; - echo "<tr>"; - echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOITEMS . "</td>"; - echo "</tr>"; - } - echo "</table>\n"; - echo "<br />\n"; - $parentid = PublisherRequest::getInt('parentid'); - $pagenav_extra_args = "op=mod&categoryid=$sel_cat&parentid=$parentid"; - xoops_load('XoopsPageNav'); - $pagenav = new XoopsPageNav($totalitems, $publisher->getConfig('idxcat_perpage'), $startitem, 'startitem', $pagenav_extra_args); - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; - echo "<input type='button' name='button' onclick=\"location='item.php?op=mod&categoryid=" . $sel_cat . "'\" value='" . _AM_PUBLISHER_CREATEITEM . "'> "; - echo "</div>"; - } - //end of fx2024 code -} \ No newline at end of file +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package Publisher + * @since 1.0 + * @author trabis <lus...@gm...> + * @author The SmartFactory <www.smartfactory.ca> + * @version $Id$ + */ + +include_once dirname(__FILE__) . '/admin_header.php'; + +$op = PublisherRequest::getString('op'); + +$op = isset($_POST['editor']) ? 'mod' : $op; +if (isset($_POST['addcategory'])) { + $op = 'addcategory'; +} + +// Where do we start ? +$startcategory = PublisherRequest::getInt('startcategory'); +$categoryid = PublisherRequest::getInt('categoryid'); + +switch ($op) { + + case "del": + $categoryObj = $publisher->getHandler('category')->get($categoryid); + $confirm = (isset($_POST['confirm'])) ? $_POST['confirm'] : 0; + $name = (isset($_POST['name'])) ? $_POST['name'] : ''; + if ($confirm) { + if (!$publisher->getHandler('category')->delete($categoryObj)) { + redirect_header("category.php", 1, _AM_PUBLISHER_DELETE_CAT_ERROR); + exit(); + } + redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_COLISDELETED, $name)); + exit(); + } else { + xoops_cp_header(); + xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_PUBLISHER_DELETECOL . " '" . $categoryObj->name() . "'. <br /> <br />" . _AM_PUBLISHER_DELETE_CAT_CONFIRM, _AM_PUBLISHER_DELETE); + xoops_cp_footer(); + } + break; + + case "mod": + //Added by fx2024 + $nb_subcats = isset($_POST['nb_subcats']) ? intval($_POST['nb_subcats']) : 0; + $nb_subcats = $nb_subcats + (isset($_POST['nb_sub_yet']) ? intval($_POST['nb_sub_yet']) : 4); + //end of fx2024 code + + publisher_cpHeader(); + publisher_editCat(true, $categoryid, $nb_subcats); + break; + + case "addcategory": + global $modify; + + $parentid = PublisherRequest::getInt('parentid'); + + if ($categoryid != 0) { + $categoryObj = $publisher->getHandler('category')->get($categoryid); + } else { + $categoryObj = $publisher->getHandler('category')->create(); + } + + // Uploading the image, if any + // Retreive the filename to be uploaded + if (isset($_FILES['image_file']['name']) && $_FILES['image_file']['name'] != "") { + $filename = $_POST["xoops_upload_file"][0]; + if (!empty($filename) || $filename != "") { + // TODO : implement publisher mimetype management + $max_size = $publisher->getConfig('maximum_filesize'); + $max_imgwidth = $publisher->getConfig('maximum_image_width'); + $max_imgheight = $publisher->getConfig('maximum_image_height'); + $allowed_mimetypes = publisher_getAllowedImagesTypes(); + + if ($_FILES[$filename]['tmp_name'] == "" || !is_readable($_FILES[$filename]['tmp_name'])) { + redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR); + exit(); + } + + xoops_load('XoopsMediaUploader'); + $uploader = new XoopsMediaUploader(publisher_getImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); + if ($uploader->fetchMedia($filename) && $uploader->upload()) { + $categoryObj->setVar('image', $uploader->getSavedFileName()); + } else { + redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR . $uploader->getErrors()); + exit(); + } + } + } else { + if (isset($_POST['image'])) { + $categoryObj->setVar('image', $_POST['image']); + } + } + $categoryObj->setVar('parentid', (isset($_POST['parentid'])) ? intval($_POST['parentid']) : 0); + + $applyall = isset($_POST['applyall']) ? intval($_POST['applyall']) : 0; + $categoryObj->setVar('weight', isset($_POST['weight']) ? intval($_POST['weight']) : 1); + + // Groups and permissions + $grpread = isset($_POST['groups_read']) ? $_POST['groups_read'] : array(); + $grpsubmit = isset($_POST['groups_submit']) ? $_POST['groups_submit'] : array(); + $grpmoderation = isset($_POST['groups_moderation']) ? $_POST['groups_moderation'] : array(); + + $categoryObj->setVar('name', $_POST['name']); + + //Added by skalpa: custom template support + if (isset($_POST['template'])) { + $categoryObj->setVar('template', $_POST['template']); + } + + if (isset($_POST['meta_description'])) { + $categoryObj->setVar('meta_description', $_POST['meta_description']); + } + if (isset($_POST['meta_keywords'])) { + $categoryObj->setVar('meta_keywords', $_POST['meta_keywords']); + } + if (isset($_POST['short_url'])) { + $categoryObj->setVar('short_url', $_POST['short_url']); + } + $categoryObj->setVar('moderator', intval($_POST['moderator'])); + $categoryObj->setVar('description', $_POST['description']); + + if (isset($_POST['header'])) { + $categoryObj->setVar('header', $_POST['header']); + } + + if ($categoryObj->isNew()) { + $redirect_msg = _AM_PUBLISHER_CATCREATED; + $redirect_to = 'category.php?op=mod'; + } else { + $redirect_msg = _AM_PUBLISHER_COLMODIFIED; + $redirect_to = 'category.php'; + } + + if (!$categoryObj->store()) { + redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_CATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); + exit; + } + // TODO : put this function in the category class + publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); + publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); + publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); + + //Added by fx2024 + $parentCat = $categoryObj->categoryid(); + $sizeof = sizeof($_POST['scname']); + for ($i = 0; $i < $sizeof; ++$i) { + if ($_POST['scname'][$i] != '') { + $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj->setVar('name', $_POST['scname'][$i]); + $categoryObj->setVar('parentid', $parentCat); + + if (!$categoryObj->store()) { + redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); + exit; + } + // TODO : put this function in the category class + publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); + publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); + publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); + } + } + //end of fx2024 code + redirect_header($redirect_to, 2, $redirect_msg); + exit(); + break; + + //Added by fx2024 + + case "addsubcats": + $categoryid = 0; + $nb_subcats = intval($_POST['nb_subcats']) + $_POST['nb_sub_yet']; + + $categoryObj = $publisher->getHandler('category')->create(); + $categoryObj->setVar('name', $_POST['name']); + $categoryObj->setVar('description', $_POST['description']); + $categoryObj->setVar('weight', $_POST['weight']); + if (isset($parentCat)) { + $categoryObj->setVar('parentid', $parentCat); + } + + publisher_cpHeader(); + publisher_editCat(true, $categoryid, $nb_subcats, $categoryObj); + exit(); + + break; + //end of fx2024 code + + case "cancel": + redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_BACK2IDX, '')); + exit(); + + case "default": + default: + publisher_cpHeader(); + //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES); + + echo "<br />\n"; + echo "<form><div style=\"margin-bottom: 12px;\">"; + echo "<input type='button' name='button' onclick=\"location='category.php?op=mod'\" value='" . _AM_PUBLISHER_CATEGORY_CREATE . "'> "; + //echo "<input type='button' name='button' onclick=\"location='item.php?op=mod'\" value='" . _AM_PUBLISHER_CREATEITEM . "'> "; + echo "</div></form>"; + + // Creating the objects for top categories + $categoriesObj = $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0); + + publisher_openCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC); + + echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; + echo "<tr>"; + echo "<th width='20' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ITEMCATEGORY_ID . "</strong></td>"; + echo "<th class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMCATEGORYNAME . "</strong></td>"; + echo "<th width='60' class='bg3' width='65' align='center'><strong>" . _CO_PUBLISHER_WEIGHT . "</strong></td>"; + echo "<th width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; + echo "</tr>"; + $totalCategories = $publisher->getHandler('category')->getCategoriesCount(0); + if (count($categoriesObj) > 0) { + foreach ($categoriesObj as $key => $thiscat) { + publisher_displayCategory($thiscat); + } + } else { + echo "<tr>"; + echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOCAT . "</td>"; + echo "</tr>"; + $categoryid = '0'; + } + echo "</table>\n"; + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + $pagenav = new XoopsPageNav($totalCategories, $publisher->getConfig('idxcat_perpage'), $startcategory, 'startcategory'); + echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; + echo "<br />"; + publisher_closeCollapsableBar('createdcategories', 'createdcategoriesicon'); + echo "<br>"; + //editcat(false); + break; +} + +xoops_cp_footer(); + +function publisher_displayCategory($categoryObj, $level = 0) +{ + $publisher = PublisherPublisher::getInstance(); + + $description = $categoryObj->description(); + if (!XOOPS_USE_MULTIBYTES) { + if (strlen($description) >= 100) { + $description = substr($description, 0, (100 - 1)) . "..."; + } + } + $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "&parentid=" . $categoryObj->parentid() . "'><img src='" . PUBLISHER_URL . "/assets/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITCOL . "' alt='" . _AM_PUBLISHER_EDITCOL . "' /></a>"; + $delete = "<a href='category.php?op=del&categoryid=" . $categ... [truncated message content] |
From: <be...@us...> - 2015-05-26 09:32:39
|
Revision: 13069 http://sourceforge.net/p/xoops/svn/13069 Author: beckmi Date: 2015-05-26 09:32:35 +0000 (Tue, 26 May 2015) Log Message: ----------- 1.02 RC-1 for XOOPS 2.5.7.1 (see changelog.txt) Modified Paths: -------------- XoopsModules/publisher/trunk/publisher/admin/about.php XoopsModules/publisher/trunk/publisher/admin/admin_header.php XoopsModules/publisher/trunk/publisher/admin/category.php XoopsModules/publisher/trunk/publisher/admin/clone.php XoopsModules/publisher/trunk/publisher/admin/file.php XoopsModules/publisher/trunk/publisher/admin/import/ams.php XoopsModules/publisher/trunk/publisher/admin/import/cjaycontent.php XoopsModules/publisher/trunk/publisher/admin/import/news.php XoopsModules/publisher/trunk/publisher/admin/import/smartsection.php XoopsModules/publisher/trunk/publisher/admin/import/wfsection.php XoopsModules/publisher/trunk/publisher/admin/import/xfsection.php XoopsModules/publisher/trunk/publisher/admin/import/xnews.php XoopsModules/publisher/trunk/publisher/admin/import.php XoopsModules/publisher/trunk/publisher/admin/index.php XoopsModules/publisher/trunk/publisher/admin/item.php XoopsModules/publisher/trunk/publisher/admin/main.php XoopsModules/publisher/trunk/publisher/admin/menu.php XoopsModules/publisher/trunk/publisher/admin/mimetypes.php XoopsModules/publisher/trunk/publisher/admin/pagewrap.php XoopsModules/publisher/trunk/publisher/admin/permissions.php XoopsModules/publisher/trunk/publisher/admin/preferences.php XoopsModules/publisher/trunk/publisher/admin/pw_delete_file.php XoopsModules/publisher/trunk/publisher/admin/pw_upload_file.php XoopsModules/publisher/trunk/publisher/archive.php XoopsModules/publisher/trunk/publisher/assets/css/jquery.popeye.style.css XoopsModules/publisher/trunk/publisher/assets/css/publisher.css XoopsModules/publisher/trunk/publisher/assets/images/popeye/loading3.gif XoopsModules/publisher/trunk/publisher/assets/js/behavior.js XoopsModules/publisher/trunk/publisher/assets/js/funcs.js XoopsModules/publisher/trunk/publisher/assets/js/rating.js XoopsModules/publisher/trunk/publisher/assets/js/script.easing.js XoopsModules/publisher/trunk/publisher/author_items.php XoopsModules/publisher/trunk/publisher/backend.php XoopsModules/publisher/trunk/publisher/blocks/category_items_sel.php XoopsModules/publisher/trunk/publisher/blocks/date_to_date.php XoopsModules/publisher/trunk/publisher/blocks/items_columns.php XoopsModules/publisher/trunk/publisher/blocks/items_menu.php XoopsModules/publisher/trunk/publisher/blocks/items_new.php XoopsModules/publisher/trunk/publisher/blocks/items_random_item.php XoopsModules/publisher/trunk/publisher/blocks/items_recent.php XoopsModules/publisher/trunk/publisher/blocks/items_spot.php XoopsModules/publisher/trunk/publisher/blocks/latest_files.php XoopsModules/publisher/trunk/publisher/blocks/latest_news.php XoopsModules/publisher/trunk/publisher/blocks/search.php XoopsModules/publisher/trunk/publisher/category.php XoopsModules/publisher/trunk/publisher/class/blockform.php XoopsModules/publisher/trunk/publisher/class/category.php XoopsModules/publisher/trunk/publisher/class/file.php XoopsModules/publisher/trunk/publisher/class/form/category.php XoopsModules/publisher/trunk/publisher/class/form/file.php XoopsModules/publisher/trunk/publisher/class/form/item.php XoopsModules/publisher/trunk/publisher/class/formdatetime.php XoopsModules/publisher/trunk/publisher/class/groupperm.php XoopsModules/publisher/trunk/publisher/class/highlighter.php XoopsModules/publisher/trunk/publisher/class/item.php XoopsModules/publisher/trunk/publisher/class/metagen.php XoopsModules/publisher/trunk/publisher/class/mimetype.php XoopsModules/publisher/trunk/publisher/class/permission.php XoopsModules/publisher/trunk/publisher/class/publisher.php XoopsModules/publisher/trunk/publisher/class/rating.php XoopsModules/publisher/trunk/publisher/class/session.php XoopsModules/publisher/trunk/publisher/class/themetabform.php XoopsModules/publisher/trunk/publisher/class/uploader.php XoopsModules/publisher/trunk/publisher/comment_delete.php XoopsModules/publisher/trunk/publisher/comment_edit.php XoopsModules/publisher/trunk/publisher/comment_new.php XoopsModules/publisher/trunk/publisher/comment_post.php XoopsModules/publisher/trunk/publisher/comment_reply.php XoopsModules/publisher/trunk/publisher/docs/changelog.txt XoopsModules/publisher/trunk/publisher/docs/readme.txt XoopsModules/publisher/trunk/publisher/file.php XoopsModules/publisher/trunk/publisher/footer.php XoopsModules/publisher/trunk/publisher/header.php XoopsModules/publisher/trunk/publisher/include/ajax_rating.php XoopsModules/publisher/trunk/publisher/include/ajax_upload.php XoopsModules/publisher/trunk/publisher/include/comment_functions.php XoopsModules/publisher/trunk/publisher/include/common.php XoopsModules/publisher/trunk/publisher/include/functions.php XoopsModules/publisher/trunk/publisher/include/media.textsanitizer.php XoopsModules/publisher/trunk/publisher/include/notification.inc.php XoopsModules/publisher/trunk/publisher/include/plugin.tag.php XoopsModules/publisher/trunk/publisher/include/search.inc.php XoopsModules/publisher/trunk/publisher/include/seo.inc.php XoopsModules/publisher/trunk/publisher/include/seo_functions.php XoopsModules/publisher/trunk/publisher/index.php XoopsModules/publisher/trunk/publisher/item.php XoopsModules/publisher/trunk/publisher/language/english/admin.php XoopsModules/publisher/trunk/publisher/language/english/blocks.php XoopsModules/publisher/trunk/publisher/language/english/common.php XoopsModules/publisher/trunk/publisher/language/english/help/help.html XoopsModules/publisher/trunk/publisher/language/english/main.php XoopsModules/publisher/trunk/publisher/language/english/modinfo.php XoopsModules/publisher/trunk/publisher/list.tag.php XoopsModules/publisher/trunk/publisher/makepdf.php XoopsModules/publisher/trunk/publisher/notification_update.php XoopsModules/publisher/trunk/publisher/pop.php XoopsModules/publisher/trunk/publisher/print.php XoopsModules/publisher/trunk/publisher/rate.php XoopsModules/publisher/trunk/publisher/search.php XoopsModules/publisher/trunk/publisher/submit.php XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_category_items_sel.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_columns.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_new.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_recent.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_items_spot.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_latest_news.tpl XoopsModules/publisher/trunk/publisher/templates/blocks/publisher_search_block.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_addfile.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_archive.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_display_full.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_display_list.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_display_summary.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_display_wfsection.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_header.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_item.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_print.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_rss.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_search.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_singleitem.tpl XoopsModules/publisher/trunk/publisher/templates/publisher_submit.tpl XoopsModules/publisher/trunk/publisher/thumb.php XoopsModules/publisher/trunk/publisher/view.tag.php XoopsModules/publisher/trunk/publisher/visit.php XoopsModules/publisher/trunk/publisher/xoops_version.php Added Paths: ----------- XoopsModules/publisher/trunk/publisher/admin/import/fmcontent.php XoopsModules/publisher/trunk/publisher/assets/css/jquery.popeye.css XoopsModules/publisher/trunk/publisher/assets/css/style.css XoopsModules/publisher/trunk/publisher/assets/images/logo.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/compact1.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/compact2.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/compact4.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/enlarge1.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/enlarge2.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/enlarge4.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/loading1.gif XoopsModules/publisher/trunk/publisher/assets/images/popeye/loading2.gif XoopsModules/publisher/trunk/publisher/assets/images/popeye/next1.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/pause3.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/play3.png XoopsModules/publisher/trunk/publisher/assets/images/popeye/prev1.png XoopsModules/publisher/trunk/publisher/assets/js/jquery.popeye-2.1.js XoopsModules/publisher/trunk/publisher/assets/js/jquery.popeye-2.1.min.js XoopsModules/publisher/trunk/publisher/class/constants.php XoopsModules/publisher/trunk/publisher/class/plugins/ XoopsModules/publisher/trunk/publisher/class/plugins/plugin.tag.php XoopsModules/publisher/trunk/publisher/class/utilities.php XoopsModules/publisher/trunk/publisher/config/ XoopsModules/publisher/trunk/publisher/config/index.html XoopsModules/publisher/trunk/publisher/include/config.php XoopsModules/publisher/trunk/publisher/include/oninstall.php XoopsModules/publisher/trunk/publisher/include/onupdate.php XoopsModules/publisher/trunk/publisher/tests/todo.txt Removed Paths: ------------- XoopsModules/publisher/trunk/publisher/admin/import/ams0.php XoopsModules/publisher/trunk/publisher/assets/images/module_logo.png XoopsModules/publisher/trunk/publisher/assets/js/jquery.popeye-2.0.4.js XoopsModules/publisher/trunk/publisher/class/request.php XoopsModules/publisher/trunk/publisher/include/constants.php XoopsModules/publisher/trunk/publisher/include/install.php XoopsModules/publisher/trunk/publisher/include/update.php Modified: XoopsModules/publisher/trunk/publisher/admin/about.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/about.php 2015-05-25 21:36:01 UTC (rev 13068) +++ XoopsModules/publisher/trunk/publisher/admin/about.php 2015-05-26 09:32:35 UTC (rev 13069) @@ -1,14 +1,14 @@ <?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. +/** + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - /** * Publisher * @@ -20,7 +20,7 @@ * @version $Id$ */ -include_once dirname(__FILE__) . '/admin_header.php'; +include_once __DIR__ . '/admin_header.php'; xoops_cp_header(); @@ -29,4 +29,11 @@ echo $aboutAdmin->addNavigation('about.php'); echo $aboutAdmin->renderabout('6KJ7RW5DR3VTJ', false); +// if (version_compare(PHP_VERSION, '5.4.0') >= 0) { +// echo 'I am at least PHP version 5.4.0, my version: ' . PHP_VERSION . "\n"; +// } else { +// echo 'I am using PHP lower than 5.4, my version: ' . PHP_VERSION . "\n"; +// } + + xoops_cp_footer(); Modified: XoopsModules/publisher/trunk/publisher/admin/admin_header.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2015-05-25 21:36:01 UTC (rev 13068) +++ XoopsModules/publisher/trunk/publisher/admin/admin_header.php 2015-05-26 09:32:35 UTC (rev 13069) @@ -1,12 +1,12 @@ <?php -/* - You may not change or alter any portion of this comment or credits - of supporting developers from this source code or any supporting source code - which is considered copyrighted (c) material of the original comment or credit authors. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +/** + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** @@ -19,24 +19,21 @@ * @version $Id$ */ -include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/mainfile.php'; -include_once dirname(dirname(__FILE__)) . '/include/common.php'; -include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; +include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; +include_once dirname(__DIR__) . '/include/common.php'; +include_once $GLOBALS['xoops']->path('include/cp_header.php'); //xoops_loadLanguage('admin', PUBLISHER_DIRNAME); xoops_loadLanguage('modinfo', PUBLISHER_DIRNAME); $imagearray = array( - 'editimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_edit.png' alt='" . _AM_PUBLISHER_ICO_EDIT . "' align='middle' />", + 'editimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_edit.png' alt='" . _AM_PUBLISHER_ICO_EDIT . "' align='middle' />", 'deleteimg' => "<img src='" . PUBLISHER_IMAGES_URL . "/button_delete.png' alt='" . _AM_PUBLISHER_ICO_DELETE . "' align='middle' />", - 'online' => "<img src='" . PUBLISHER_IMAGES_URL . "/on.png' alt='" . _AM_PUBLISHER_ICO_ONLINE . "' align='middle' />", - 'offline' => "<img src='" . PUBLISHER_IMAGES_URL . "/off.png' alt='" . _AM_PUBLISHER_ICO_OFFLINE . "' align='middle' />", + 'online' => "<img src='" . PUBLISHER_IMAGES_URL . "/on.png' alt='" . _AM_PUBLISHER_ICO_ONLINE . "' align='middle' />", + 'offline' => "<img src='" . PUBLISHER_IMAGES_URL . "/off.png' alt='" . _AM_PUBLISHER_ICO_OFFLINE . "' align='middle' />", ); -if ( file_exists($GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'))) { - include_once $GLOBALS['xoops']->path('/Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); -} else { - echo xoops_error('/Frameworks/moduleclasses/moduleadmin/ is required!!!'); -} +include_once $GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php'); + /* $myts = MyTextSanitizer::getInstance(); Modified: XoopsModules/publisher/trunk/publisher/admin/category.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/category.php 2015-05-25 21:36:01 UTC (rev 13068) +++ XoopsModules/publisher/trunk/publisher/admin/category.php 2015-05-26 09:32:35 UTC (rev 13069) @@ -19,32 +19,30 @@ * @version $Id$ */ -include_once dirname(__FILE__) . '/admin_header.php'; +include_once __DIR__ . '/admin_header.php'; -$op = PublisherRequest::getString('op'); +$op = XoopsRequest::getString('op', '', 'GET'); -$op = isset($_POST['editor']) ? 'mod' : $op; -if (isset($_POST['addcategory'])) { - $op = 'addcategory'; -} +$op = (XoopsRequest::getString('editor', '', 'POST')) ? 'mod' : $op; +$op = (XoopsRequest::getString('addcategory', '', 'POST')) ? 'addcategory' : $op; // Where do we start ? -$startcategory = PublisherRequest::getInt('startcategory'); -$categoryid = PublisherRequest::getInt('categoryid'); +$startcategory = XoopsRequest::getInt('startcategory', 0, 'GET'); +$categoryid = XoopsRequest::getInt('categoryid'); switch ($op) { case "del": $categoryObj = $publisher->getHandler('category')->get($categoryid); - $confirm = (isset($_POST['confirm'])) ? $_POST['confirm'] : 0; - $name = (isset($_POST['name'])) ? $_POST['name'] : ''; + $confirm = XoopsRequest::getInt('confirm', '', 'POST'); + $name = XoopsRequest::getString('name', '', 'POST'); if ($confirm) { if (!$publisher->getHandler('category')->delete($categoryObj)) { redirect_header("category.php", 1, _AM_PUBLISHER_DELETE_CAT_ERROR); - exit(); +// exit(); } redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_COLISDELETED, $name)); - exit(); +// exit(); } else { xoops_cp_header(); xoops_confirm(array('op' => 'del', 'categoryid' => $categoryObj->categoryid(), 'confirm' => 1, 'name' => $categoryObj->name()), 'category.php', _AM_PUBLISHER_DELETECOL . " '" . $categoryObj->name() . "'. <br /> <br />" . _AM_PUBLISHER_DELETE_CAT_CONFIRM, _AM_PUBLISHER_DELETE); @@ -54,18 +52,18 @@ case "mod": //Added by fx2024 - $nb_subcats = isset($_POST['nb_subcats']) ? intval($_POST['nb_subcats']) : 0; - $nb_subcats = $nb_subcats + (isset($_POST['nb_sub_yet']) ? intval($_POST['nb_sub_yet']) : 4); + $nb_subcats = XoopsRequest::getInt('nb_subcats', 0, 'POST'); + $nb_subcats = $nb_subcats + (XoopsRequest::getInt('nb_sub_yet', 4, 'POST')); //end of fx2024 code - publisher_cpHeader(); - publisher_editCat(true, $categoryid, $nb_subcats); + publisherCpHeader(); + PublisherUtilities::editCategory(true, $categoryid, $nb_subcats); break; case "addcategory": global $modify; - $parentid = PublisherRequest::getInt('parentid'); + $parentid = XoopsRequest::getInt('parentid'); if ($categoryid != 0) { $categoryObj = $publisher->getHandler('category')->get($categoryid); @@ -75,136 +73,121 @@ // Uploading the image, if any // Retreive the filename to be uploaded - if (isset($_FILES['image_file']['name']) && $_FILES['image_file']['name'] != "") { - $filename = $_POST["xoops_upload_file"][0]; - if (!empty($filename) || $filename != "") { + if ($image_file = XoopsRequest::getArray('image_file', '', 'FILES')['name']) { +// $filename = XoopsRequest::getArray('xoops_upload_file', array(), 'POST')[0]; + if ($filename = XoopsRequest::getArray('xoops_upload_file', array(), 'POST')[0]) { // TODO : implement publisher mimetype management - $max_size = $publisher->getConfig('maximum_filesize'); - $max_imgwidth = $publisher->getConfig('maximum_image_width'); - $max_imgheight = $publisher->getConfig('maximum_image_height'); - $allowed_mimetypes = publisher_getAllowedImagesTypes(); + $max_size = $publisher->getConfig('maximum_filesize'); + $max_imgwidth = $publisher->getConfig('maximum_image_width'); + $max_imgheight = $publisher->getConfig('maximum_image_height'); + $allowed_mimetypes = publisherGetAllowedImagesTypes(); - if ($_FILES[$filename]['tmp_name'] == "" || !is_readable($_FILES[$filename]['tmp_name'])) { + if (!($tmp_name = (XoopsRequest::getArray('filename', array(), 'FILES')['tmp_name'])) || !is_readable($tmp_name)) { redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR); - exit(); +// exit(); } xoops_load('XoopsMediaUploader'); - $uploader = new XoopsMediaUploader(publisher_getImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); + $uploader = new XoopsMediaUploader(publisherGetImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); if ($uploader->fetchMedia($filename) && $uploader->upload()) { $categoryObj->setVar('image', $uploader->getSavedFileName()); } else { redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR . $uploader->getErrors()); - exit(); +// exit(); } } } else { - if (isset($_POST['image'])) { - $categoryObj->setVar('image', $_POST['image']); - } + $categoryObj->setVar('image', XoopsRequest::getString('image', '', 'POST')); } - $categoryObj->setVar('parentid', (isset($_POST['parentid'])) ? intval($_POST['parentid']) : 0); + $categoryObj->setVar('parentid', (XoopsRequest::getInt('parentid', 0, 'POST'))); - $applyall = isset($_POST['applyall']) ? intval($_POST['applyall']) : 0; - $categoryObj->setVar('weight', isset($_POST['weight']) ? intval($_POST['weight']) : 1); + $applyall = XoopsRequest::getInt('applyall', 0, 'POST'); + $categoryObj->setVar('weight', XoopsRequest::getInt('weight', 1, 'POST')); // Groups and permissions - $grpread = isset($_POST['groups_read']) ? $_POST['groups_read'] : array(); - $grpsubmit = isset($_POST['groups_submit']) ? $_POST['groups_submit'] : array(); - $grpmoderation = isset($_POST['groups_moderation']) ? $_POST['groups_moderation'] : array(); + $grpread = XoopsRequest::getArray('groupsRead', array(), 'POST'); + $grpsubmit = XoopsRequest::getArray('groupsSubmit', array(), 'POST'); + $grpmoderation = XoopsRequest::getArray('groupsModeration', array(), 'POST'); - $categoryObj->setVar('name', $_POST['name']); + $categoryObj->setVar('name', XoopsRequest::getString('name', '', 'POST')); //Added by skalpa: custom template support - if (isset($_POST['template'])) { - $categoryObj->setVar('template', $_POST['template']); - } + $categoryObj->setVar('template', XoopsRequest::getString('template', '', 'POST')); + $categoryObj->setVar('meta_description', XoopsRequest::getString('meta_description', '', 'POST')); + $categoryObj->setVar('meta_keywords', XoopsRequest::getString('meta_keywords', '', 'POST')); + $categoryObj->setVar('short_url', XoopsRequest::getString('short_url', '', 'POST')); + $categoryObj->setVar('moderator', XoopsRequest::getInt('moderator', 0, 'POST')); + $categoryObj->setVar('description', XoopsRequest::getString('description', '', 'POST')); + $categoryObj->setVar('header', XoopsRequest::getString('header', '', 'POST')); - if (isset($_POST['meta_description'])) { - $categoryObj->setVar('meta_description', $_POST['meta_description']); - } - if (isset($_POST['meta_keywords'])) { - $categoryObj->setVar('meta_keywords', $_POST['meta_keywords']); - } - if (isset($_POST['short_url'])) { - $categoryObj->setVar('short_url', $_POST['short_url']); - } - $categoryObj->setVar('moderator', intval($_POST['moderator'])); - $categoryObj->setVar('description', $_POST['description']); - - if (isset($_POST['header'])) { - $categoryObj->setVar('header', $_POST['header']); - } - if ($categoryObj->isNew()) { $redirect_msg = _AM_PUBLISHER_CATCREATED; - $redirect_to = 'category.php?op=mod'; + $redirect_to = 'category.php?op=mod'; } else { $redirect_msg = _AM_PUBLISHER_COLMODIFIED; - $redirect_to = 'category.php'; + $redirect_to = 'category.php'; } if (!$categoryObj->store()) { - redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_CATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); - exit; + redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_CATEGORY_SAVE_ERROR . publisherFormatErrors($categoryObj->getErrors())); +// exit; } // TODO : put this function in the category class - publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); - publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); + publisherSaveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); + publisherSaveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); + publisherSaveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); //Added by fx2024 $parentCat = $categoryObj->categoryid(); - $sizeof = sizeof($_POST['scname']); + $sizeof = count(XoopsRequest::getString('scname', '', 'POST')); for ($i = 0; $i < $sizeof; ++$i) { - if ($_POST['scname'][$i] != '') { + if (XoopsRequest::getArray('scname', array(), 'POST')[$i] != '') { $categoryObj = $publisher->getHandler('category')->create(); - $categoryObj->setVar('name', $_POST['scname'][$i]); + $categoryObj->setVar('name', XoopsRequest::getArray('scname', array(), 'POST')[$i]); $categoryObj->setVar('parentid', $parentCat); if (!$categoryObj->store()) { - redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . publisher_formatErrors($categoryObj->getErrors())); - exit; + redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_SUBCATEGORY_SAVE_ERROR . publisherFormatErrors($categoryObj->getErrors())); +// exit; } // TODO : put this function in the category class - publisher_saveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); - publisher_saveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); - publisher_saveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); + publisherSaveCategoryPermissions($grpread, $categoryObj->categoryid(), 'category_read'); + publisherSaveCategoryPermissions($grpsubmit, $categoryObj->categoryid(), 'item_submit'); + publisherSaveCategoryPermissions($grpmoderation, $categoryObj->categoryid(), 'category_moderation'); } } //end of fx2024 code redirect_header($redirect_to, 2, $redirect_msg); - exit(); +// exit(); break; //Added by fx2024 case "addsubcats": $categoryid = 0; - $nb_subcats = intval($_POST['nb_subcats']) + $_POST['nb_sub_yet']; + $nb_subcats = XoopsRequest::getInt('nb_subcats', 0, 'POST') + XoopsRequest::getInt('nb_sub_yet', 0, 'POST'); $categoryObj = $publisher->getHandler('category')->create(); - $categoryObj->setVar('name', $_POST['name']); - $categoryObj->setVar('description', $_POST['description']); - $categoryObj->setVar('weight', $_POST['weight']); + $categoryObj->setVar('name', XoopsRequest::getString('name', '', 'POST')); + $categoryObj->setVar('description', XoopsRequest::getString('description', '', 'POST')); + $categoryObj->setVar('weight', XoopsRequest::getInt('weight', 0, 'POST')); if (isset($parentCat)) { $categoryObj->setVar('parentid', $parentCat); } - publisher_cpHeader(); - publisher_editCat(true, $categoryid, $nb_subcats, $categoryObj); + publisherCpHeader(); + PublisherUtilities::editCategory(true, $categoryid, $nb_subcats, $categoryObj); exit(); - break; //end of fx2024 code case "cancel": redirect_header("category.php", 1, sprintf(_AM_PUBLISHER_BACK2IDX, '')); - exit(); - +// exit(); + break; case "default": default: - publisher_cpHeader(); + publisherCpHeader(); //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES); echo "<br />\n"; @@ -216,7 +199,7 @@ // Creating the objects for top categories $categoriesObj = $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0); - publisher_openCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC); + publisherOpenCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC); echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; echo "<tr>"; @@ -228,8 +211,9 @@ $totalCategories = $publisher->getHandler('category')->getCategoriesCount(0); if (count($categoriesObj) > 0) { foreach ($categoriesObj as $key => $thiscat) { - publisher_displayCategory($thiscat); + PublisherUtilities::displayCategory($thiscat); } + unset($key, $thiscat); } else { echo "<tr>"; echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOCAT . "</td>"; @@ -237,174 +221,14 @@ $categoryid = '0'; } echo "</table>\n"; - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; + include_once $GLOBALS['xoops']->path('class/pagenav.php'); $pagenav = new XoopsPageNav($totalCategories, $publisher->getConfig('idxcat_perpage'), $startcategory, 'startcategory'); echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; echo "<br />"; - publisher_closeCollapsableBar('createdcategories', 'createdcategoriesicon'); + publisherCloseCollapsableBar('createdcategories', 'createdcategoriesicon'); echo "<br>"; //editcat(false); break; } xoops_cp_footer(); - -function publisher_displayCategory($categoryObj, $level = 0) -{ - $publisher = PublisherPublisher::getInstance(); - - $description = $categoryObj->description(); - if (!XOOPS_USE_MULTIBYTES) { - if (strlen($description) >= 100) { - $description = substr($description, 0, (100 - 1)) . "..."; - } - } - $modify = "<a href='category.php?op=mod&categoryid=" . $categoryObj->categoryid() . "&parentid=" . $categoryObj->parentid() . "'><img src='" . PUBLISHER_URL . "/assets/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITCOL . "' alt='" . _AM_PUBLISHER_EDITCOL . "' /></a>"; - $delete = "<a href='category.php?op=del&categoryid=" . $categoryObj->categoryid() . "'><img src='" . PUBLISHER_URL . "/assets/images/links/delete.png' title='" . _AM_PUBLISHER_DELETECOL . "' alt='" . _AM_PUBLISHER_DELETECOL . "' /></a>"; - - $spaces = ''; - for ($j = 0; $j < $level; $j++) { - $spaces .= ' '; - } - - echo "<tr>"; - echo "<td class='even' align='center'>" . $categoryObj->categoryid() . "</td>"; - echo "<td class='even' align='left'>" . $spaces . "<a href='" . PUBLISHER_URL . "/category.php?categoryid=" . $categoryObj->categoryid() . "'><img src='" . PUBLISHER_URL . "/assets/images/links/subcat.gif' alt='' /> " . $categoryObj->name() . "</a></td>"; - echo "<td class='even' align='center'>" . $categoryObj->weight() . "</td>"; - echo "<td class='even' align='center'> $modify $delete </td>"; - echo "</tr>"; - $subCategoriesObj = $publisher->getHandler('category')->getCategories(0, 0, $categoryObj->categoryid()); - if (count($subCategoriesObj) > 0) { - $level++; - foreach ($subCategoriesObj as $key => $thiscat) { - publisher_displayCategory($thiscat, $level); - } - } - unset($categoryObj); -} - -function publisher_editCat($showmenu = false, $categoryid = 0, $nb_subcats = 4, $categoryObj = null) -{ - $publisher = PublisherPublisher::getInstance(); - - // if there is a parameter, and the id exists, retrieve data: we're editing a category - if ($categoryid != 0) { - // Creating the category object for the selected category - $categoryObj = $publisher->getHandler('category')->get($categoryid); - if ($categoryObj->notLoaded()) { - redirect_header("category.php", 1, _AM_PUBLISHER_NOCOLTOEDIT); - exit(); - } - } else { - if (!$categoryObj) { - $categoryObj = $publisher->getHandler('category')->create(); - } - } - - if ($categoryid != 0) { - if ($showmenu) { - //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_EDITING); - } - echo "<br />\n"; - publisher_openCollapsableBar('edittable', 'edittableicon', _AM_PUBLISHER_EDITCOL, _AM_PUBLISHER_CATEGORY_EDIT_INFO); - } else { - if ($showmenu) { - //publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES . " > " . _AM_PUBLISHER_CREATINGNEW); - } - publisher_openCollapsableBar('createtable', 'createtableicon', _AM_PUBLISHER_CATEGORY_CREATE, _AM_PUBLISHER_CATEGORY_CREATE_INFO); - } - - $sform = $categoryObj->getForm($nb_subcats); - $sform->display(); - - if (!$categoryid) { - publisher_closeCollapsableBar('createtable', 'createtableicon'); - } else { - publisher_closeCollapsableBar('edittable', 'edittableicon'); - } - - //Added by fx2024 - if ($categoryid) { - $sel_cat = $categoryid; - - publisher_openCollapsableBar('subcatstable', 'subcatsicon', _AM_PUBLISHER_SUBCAT_CAT, _AM_PUBLISHER_SUBCAT_CAT_DSC); - // Get the total number of sub-categories - $categoriesObj = $publisher->getHandler('category')->get($sel_cat); - $totalsubs = $publisher->getHandler('category')->getCategoriesCount($sel_cat); - // creating the categories objects that are published - $subcatsObj = $publisher->getHandler('category')->getCategories(0, 0, $categoriesObj->categoryid()); - $totalSCOnPage = count($subcatsObj); - echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; - echo "<tr>"; - echo "<td width='60' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATID . "</strong></td>"; - echo "<td width='20%' class='bg3' align='left'><strong>" . _AM_PUBLISHER_CATCOLNAME . "</strong></td>"; - echo "<td class='bg3' align='left'><strong>" . _AM_PUBLISHER_SUBDESCRIPT . "</strong></td>"; - echo "<td width='60' class='bg3' align='right'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; - echo "</tr>"; - if ($totalsubs > 0) { - foreach ($subcatsObj as $subcat) { - $modify = "<a href='category.php?op=mod&categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/assets/images/links/edit.gif' title='" . _AM_PUBLISHER_MODIFY . "' alt='" . _AM_PUBLISHER_MODIFY . "' /></a>"; - $delete = "<a href='category.php?op=del&categoryid=" . $subcat->categoryid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/assets/images/links/delete.png' title='" . _AM_PUBLISHER_DELETE . "' alt='" . _AM_PUBLISHER_DELETE . "' /></a>"; - echo "<tr>"; - echo "<td class='head' align='left'>" . $subcat->categoryid() . "</td>"; - echo "<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/category.php?categoryid=" . $subcat->categoryid() . "&parentid=" . $subcat->parentid() . "'>" . $subcat->name() . "</a></td>"; - echo "<td class='even' align='left'>" . $subcat->description() . "</td>"; - echo "<td class='even' align='right'> {$modify} {$delete} </td>"; - echo "</tr>"; - } - } else { - echo "<tr>"; - echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOSUBCAT . "</td>"; - echo "</tr>"; - } - echo "</table>\n"; - echo "<br />\n"; - publisher_closeCollapsableBar('subcatstable', 'subcatsicon'); - - publisher_openCollapsableBar('bottomtable', 'bottomtableicon', _AM_PUBLISHER_CAT_ITEMS, _AM_PUBLISHER_CAT_ITEMS_DSC); - $startitem = PublisherRequest::getInt('startitem'); - // Get the total number of published ITEMS - $totalitems = $publisher->getHandler('item')->getItemsCount($sel_cat, array(_PUBLISHER_STATUS_PUBLISHED)); - // creating the items objects that are published - $itemsObj = $publisher->getHandler('item')->getAllPublished($publisher->getConfig('idxcat_perpage'), $startitem, $sel_cat); - $totalitemsOnPage = count($itemsObj); - $allcats = $publisher->getHandler('category')->getObjects(null, true); - echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; - echo "<tr>"; - echo "<td width='40' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ITEMID . "</strong></td>"; - echo "<td width='20%' class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMCOLNAME . "</strong></td>"; - echo "<td class='bg3' align='left'><strong>" . _AM_PUBLISHER_ITEMDESC . "</strong></td>"; - echo "<td width='90' class='bg3' align='center'><strong>" . _AM_PUBLISHER_CREATED . "</strong></td>"; - echo "<td width='60' class='bg3' align='center'><strong>" . _AM_PUBLISHER_ACTION . "</strong></td>"; - echo "</tr>"; - if ($totalitems > 0) { - for ($i = 0; $i < $totalitemsOnPage; ++$i) { - $categoryObj = $allcats[$itemsObj[$i]->categoryid()]; - $modify = "<a href='item.php?op=mod&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/assets/images/links/edit.gif' title='" . _AM_PUBLISHER_EDITITEM . "' alt='" . _AM_PUBLISHER_EDITITEM . "' /></a>"; - $delete = "<a href='item.php?op=del&itemid=" . $itemsObj[$i]->itemid() . "'><img src='" . XOOPS_URL . "/modules/" . $publisher->getModule()->dirname() . "/assets/images/links/delete.png' title='" . _AM_PUBLISHER_DELETEITEM . "' alt='" . _AM_PUBLISHER_DELETEITEM . "'/></a>"; - echo "<tr>"; - echo "<td class='head' align='center'>" . $itemsObj[$i]->itemid() . "</td>"; - echo "<td class='even' align='left'>" . $categoryObj->name() . "</td>"; - echo "<td class='even' align='left'>" . $itemsObj[$i]->getitemLink() . "</td>"; - echo "<td class='even' align='center'>" . $itemsObj[$i]->datesub('s') . "</td>"; - echo "<td class='even' align='center'> $modify $delete </td>"; - echo "</tr>"; - } - } else { - $itemid = -1; - echo "<tr>"; - echo "<td class='head' align='center' colspan= '7'>" . _AM_PUBLISHER_NOITEMS . "</td>"; - echo "</tr>"; - } - echo "</table>\n"; - echo "<br />\n"; - $parentid = PublisherRequest::getInt('parentid'); - $pagenav_extra_args = "op=mod&categoryid=$sel_cat&parentid=$parentid"; - xoops_load('XoopsPageNav'); - $pagenav = new XoopsPageNav($totalitems, $publisher->getConfig('idxcat_perpage'), $startitem, 'startitem', $pagenav_extra_args); - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; - echo "<input type='button' name='button' onclick=\"location='item.php?op=mod&categoryid=" . $sel_cat . "'\" value='" . _AM_PUBLISHER_CREATEITEM . "'> "; - echo "</div>"; - } - //end of fx2024 code -} Modified: XoopsModules/publisher/trunk/publisher/admin/clone.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/clone.php 2015-05-25 21:36:01 UTC (rev 13068) +++ XoopsModules/publisher/trunk/publisher/admin/clone.php 2015-05-26 09:32:35 UTC (rev 13069) @@ -18,45 +18,45 @@ * @version $Id$ */ -include_once dirname(__FILE__) . "/admin_header.php"; +include_once __DIR__ . "/admin_header.php"; -publisher_cpHeader(); +publisherCpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_CLONE); -publisher_openCollapsableBar('clone', 'cloneicon', _AM_PUBLISHER_CLONE, _AM_PUBLISHER_CLONE_DSC); +publisherOpenCollapsableBar('clone', 'cloneicon', _AM_PUBLISHER_CLONE, _AM_PUBLISHER_CLONE_DSC); -if (@$_POST['op'] == 'submit') { - +if ('submit' == XoopsRequest::getString('op', '', 'POST')) { if (!$GLOBALS['xoopsSecurity']->check()) { redirect_header('clone.php', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())); - exit(); +// exit(); } - $clone = $_POST['clone']; +// $clone = $_POST['clone']; + $clone = XoopsRequest::getString('clone', '', 'POST'); //check if name is valid if (empty($clone) || preg_match('/[^a-zA-Z0-9\_\-]/', $clone)) { redirect_header('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_INVALIDNAME, $clone)); - exit(); +// exit(); } // Check wether the cloned module exists or not - if ($clone && is_dir(XOOPS_ROOT_PATH . '/modules/' . $clone)) { + if ($clone && is_dir($GLOBALS['xoops']->path('modules/' . $clone))) { redirect_header('clone.php', 3, sprintf(_AM_PUBLISHER_CLONE_EXISTS, $clone)); } $patterns = array( - strtolower(PUBLISHER_DIRNAME) => strtolower($clone), - strtoupper(PUBLISHER_DIRNAME) => strtoupper($clone), + strtolower(PUBLISHER_DIRNAME) => strtolower($clone), + strtoupper(PUBLISHER_DIRNAME) => strtoupper($clone), ucfirst(strtolower(PUBLISHER_DIRNAME)) => ucfirst(strtolower($clone)) ); - $patKeys = array_keys($patterns); + $patKeys = array_keys($patterns); $patValues = array_values($patterns); - publisher_cloneFileFolder(PUBLISHER_ROOT_PATH); - $logocreated = publisher_createLogo(strtolower($clone)); + PublisherClone::cloneFileFolder(PUBLISHER_ROOT_PATH); + $logocreated = PublisherClone::createLogo(strtolower($clone)); $msg = ""; - if (is_dir(XOOPS_ROOT_PATH . '/modules/' . strtolower($clone))) { + if (is_dir($GLOBALS['xoops']->path('modules/' . strtolower($clone)))) { $msg .= sprintf(_AM_PUBLISHER_CLONE_CONGRAT, "<a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin'>" . ucfirst(strtolower($clone)) . "</a>") . "<br />\n"; if (!$logocreated) { $msg .= _AM_PUBLISHER_CLONE_IMAGEFAIL; @@ -67,8 +67,8 @@ echo $msg; } else { - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; - $form = new XoopsThemeForm(sprintf(_AM_PUBLISHER_CLONE_TITLE, $publisher->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true); + include_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); + $form = new XoopsThemeForm(sprintf(_AM_PUBLISHER_CLONE_TITLE, $publisher->getModule()->getVar('name', 'E')), 'clone', 'clone.php', 'post', true); $clone = new XoopsFormText(_AM_PUBLISHER_CLONE_NAME, 'clone', 20, 20, ''); $clone->setDescription(_AM_PUBLISHER_CLONE_NAME_DSC); $form->addElement($clone, true); @@ -78,89 +78,106 @@ } // End of collapsable bar -publisher_closeCollapsableBar('clone', 'cloneicon'); +publisherCloseCollapsableBar('clone', 'cloneicon'); xoops_cp_footer(); // work around for PHP < 5.0.x +/* if (!function_exists('file_put_contents')) { function file_put_contents($filename, $data, $file_append = false) { - if ($fp = fopen($filename, (!$file_append ? 'w+' : 'a+'))) { + if ($fp == fopen($filename, (!$file_append ? 'w+' : 'a+'))) { fputs($fp, $data); fclose($fp); } } } +*/ +/** + * Class PublisherClone + */ +class PublisherClone +{ + // recursive clonning script -function publisher_cloneFileFolder($path) -{ + /** + * @param $path + */ + public static function cloneFileFolder($path) + { global $patKeys; global $patValues; - $newPath = str_replace($patKeys[0], $patValues[0], $path); + $newPath = str_replace($patKeys[0], $patValues[0], $path); - if (is_dir($path)) { - // create new dir - mkdir($newPath); + if (is_dir($path)) { + // create new dir + mkdir($newPath); - // check all files in dir, and process it - if ($handle = opendir($path)) { - while ($file = readdir($handle)) { - if ($file != '.' && $file != '..' && $file != '.svn') { - publisher_cloneFileFolder("{$path}/{$file}"); + // check all files in dir, and process it + if ($handle == opendir($path)) { + while (($file = readdir($handle)) !== false) { + if ($file != '.' && $file != '..' && $file != '.svn') { + self::cloneFileFolder("{$path}/{$file}"); + } } + closedir($handle); } - closedir($handle); - } - } else { - - if (preg_match('/(.jpg|.gif|.png|.zip)$/i', $path)) { - // image - copy($path, $newPath); } else { - // file, read it - $content = file_get_contents($path); - $content = str_replace($patKeys, $patValues, $content); - file_put_contents($newPath, $content); + if (preg_match('/(.jpg|.gif|.png|.zip)$/i', $path)) { + // image + copy($path, $newPath); + } else { + // file, read it + $content = file_get_contents($path); + $content = str_replace($patKeys, $patValues, $content); + file_put_contents($newPath, $content); + } } } -} -function publisher_createLogo($dirname) -{ - if (!extension_loaded("gd")) { - return false; - } else { - $required_functions = array("imagecreatetruecolor", "imagecolorallocate", "imagefilledrectangle", "imagejpeg", "imagedestroy", "imageftbbox"); - foreach ($required_functions as $func) { - if (!function_exists($func)) { - return false; + /** + * @param $dirname + * + * @return bool + */ + public static function createLogo($dirname) + { + if (!extension_loaded("gd")) { + return false; + } else { + $required_functions = array("imagecreatetruecolor", "imagecolorallocate", "imagefilledrectangle", "imagejpeg", "imagedestroy", "imageftbbox"); + foreach ($required_functions as $func) { + if (!function_exists($func)) { + return false; + } } + unset($func); } - } - if (!file_exists($imageBase = XOOPS_ROOT_PATH . "/modules/" . $dirname . "/assets/images/module_logo.png") || !file_exists($font = XOOPS_ROOT_PATH . "/modules/" . $dirname . "/assets/images/VeraBd.ttf")) { - return false; - } + if (!file_exists($imageBase = $GLOBALS['xoops']->path("modules/" . $dirname . "/assets/images/module_logo.png")) || !file_exists($font = $GLOBALS['xoops']->path("modules/" . $dirname . "/assets/images/VeraBd.ttf"))) { + return false; + } - $imageModule = imagecreatefrompng($imageBase); + $imageModule = imagecreatefrompng($imageBase); - //Erase old text - $grey_color = imagecolorallocate($imageModule, 237, 237, 237); - imagefilledrectangle($imageModule, 5, 35, 85, 46, $grey_color); + //Erase old text + $grey_color = imagecolorallocate($imageModule, 237, 237, 237); + imagefilledrectangle($imageModule, 5, 35, 85, 46, $grey_color); - // Write text - $text_color = imagecolorallocate($imageModule, 0, 0, 0); - $space_to_border = (80 - strlen($dirname) * 6.5) / 2; - imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $text_color, $font, ucfirst($dirname), array()); + // Write text + $text_color = imagecolorallocate($imageModule, 0, 0, 0); + $space_to_border = (80 - strlen($dirname) * 6.5) / 2; + imagefttext($imageModule, 8.5, 0, $space_to_border, 45, $text_color, $font, ucfirst($dirname), array()); - // Set transparency color - $white = imagecolorallocatealpha($imageModule, 255, 255, 255, 127); - imagefill($imageModule, 0, 0, $white); - imagecolortransparent($imageModule, $white); - imagepng($imageModule, XOOPS_ROOT_PATH . "/modules/" . $dirname . "/assets/images/module_logo.png"); - imagedestroy($imageModule); + // Set transparency color + $white = imagecolorallocatealpha($imageModule, 255, 255, 255, 127); + imagefill($imageModule, 0, 0, $white); + imagecolortransparent($imageModule, $white); + imagepng($imageModule, $GLOBALS['xoops']->path("modules/" . $dirname . "/assets/images/module_logo.png")); + imagedestroy($imageModule); - return true; + return true; + } } Modified: XoopsModules/publisher/trunk/publisher/admin/file.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/file.php 2015-05-25 21:36:01 UTC (rev 13068) +++ XoopsModules/publisher/trunk/publisher/admin/file.php 2015-05-26 09:32:35 UTC (rev 13069) @@ -19,24 +19,28 @@ * @version $Id$ */ -include_once dirname(__FILE__) . '/admin_header.php'; +include_once __DIR__ . '/admin_header.php'; -$op = PublisherRequest::getString('op'); +$op = XoopsRequest::getString('op'); +/** + * @param bool $showmenu + * @param int $fileid + * @param int $itemid + */ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0) { $publisher = PublisherPublisher::getInstance(); - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; + include_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); // if there is a parameter, and the id exists, retrieve data: we're editing a file if ($fileid != 0) { - // Creating the File object $fileObj = $publisher->getHandler('file')->get($fileid); if ($fileObj->notLoaded()) { redirect_header("javascript:history.go(-1)", 1, _AM_PUBLISHER_NOFILESELECTED); - exit(); +// exit(); } if ($showmenu) { @@ -44,9 +48,9 @@ } echo "<br />\n"; - echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 06 0 0; '>" . _AM_PUBLISHER_FILE_EDITING . "</span>"; + echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 6px 0 0; '>" . _AM_PUBLISHER_FILE_EDITING . "</span>"; echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_EDITING_DSC . "</span>"; - publisher_openCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); + publisherOpenCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); } else { // there's no parameter, so we're adding an item $fileObj = $publisher->getHandler('file')->create(); @@ -54,9 +58,9 @@ if ($showmenu) { //publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_FILE_ADD); } - echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 06 0 0; '>" . _AM_PUBLISHER_FILE_ADDING . "</span>"; + echo "<span style='color: #2F5376; font-weight: bold; font-size: 16px; margin: 6px 6px 0 0; '>" . _AM_PUBLISHER_FILE_ADDING . "</span>"; echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_FILE_ADDING_DSC . "</span>"; - publisher_openCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); + publisherOpenCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); } // FILES UPLOAD FORM @@ -64,9 +68,9 @@ $files_form->display(); if ($fileid != 0) { - publisher_closeCollapsableBar('editfile', 'editfileicon'); + publisherCloseCollapsableBar('editfile', 'editfileicon'); } else { - publisher_closeCollapsableBar('addfile', 'addfileicon'); + publisherCloseCollapsableBar('addfile', 'addfileicon'); } } @@ -75,31 +79,31 @@ /* -- Available operations -- */ switch ($op) { case "uploadfile"; - publisher_uploadFile(false, true, $false); + publisherUploadFile(false, true, $false); exit; break; case "uploadanother"; - publisher_uploadFile(true, true, $false); + publisherUploadFile(true, true, $false); exit; break; case "mod": - $fileid = isset($_GET['fileid']) ? $_GET['fileid'] : 0; - $itemid = isset($_GET['itemid']) ? $_GET['itemid'] : 0; + $fileid = XoopsRequest::getInt('fileid', 0, 'GET'); + $itemid = XoopsRequest::getInt('itemid', 0, 'GET'); if (($fileid == 0) && ($itemid == 0)) { redirect_header("javascript:history.go(-1)", 3, _AM_PUBLISHER_NOITEMSELECTED); - exit(); +// exit(); } - publisher_cpHeader(); - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; + publisherCpHeader(); + include_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); publisher_editFile(true, $fileid, $itemid); break; case "modify": - $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0; + $fileid = XoopsRequest::getInt('fileid', 0, 'POST'); // Creating the file object if ($fileid != 0) { @@ -109,43 +113,43 @@ } // Putting the values in the file object - $fileObj->setVar('name', $_POST['name']); - $fileObj->setVar('description', $_POST['description']); - $fileObj->setVar('status', intval($_POST['file_status'])); + $fileObj->setVar('name', XoopsRequest::getString('name', '', 'POST')); + $fileObj->setVar('description', XoopsRequest::getString('description', '', 'POST')); + $fileObj->setVar('status', XoopsRequest::getInt('status', 0, 'POST')); // Storing the file if (!$fileObj->store()) { - redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid(), 3, _AM_PUBLISHER_FILE_EDITING_ERROR . publisher_formatErrors($fileObj->getErrors())); - exit; + redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid(), 3, _AM_PUBLISHER_FILE_EDITING_ERROR . publisherFormatErrors($fileObj->getErrors())); +// exit; } redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid(), 2, _AM_PUBLISHER_FILE_EDITING_SUCCESS); - exit(); +// exit(); break; case "del": - $fileid = isset($_POST['fileid']) ? intval($_POST['fileid']) : 0; - $fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : $fileid; + $fileid = XoopsRequest::getInt('fileid', 0, 'POST'); + $fileid = XoopsRequest::getInt('fileid', $fileid, 'GET'); $fileObj = $publisher->getHandler('file')->get($fileid); - $confirm = isset($_POST['confirm']) ? $_POST['confirm'] : 0; - $title = isset($_POST['title']) ? $_POST['title'] : ''; + $confirm = XoopsRequest::getInt('confirm', 0, 'POST'); + $title = XoopsRequest::getString('title', '', 'POST'); if ($confirm) { if (!$publisher->getHandler('file')->delete($fileObj)) { redirect_header('item.php', 2, _AM_PUBLISHER_FILE_DELETE_ERROR); - exit; +// exit; } redirect_header('item.php', 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->name())); - exit(); +// exit(); } else { // no confirm: show deletion condition - $fileid = isset($_GET['fileid']) ? intval($_GET['fileid']) : 0; + $fileid = XoopsRequest::getInt('fileid', 0, 'GET'); - publisher_cpHeader(); + publisherCpHeader(); xoops_confirm(array('op' => 'del', 'fileid' => $fileObj->fileid(), 'confirm' => 1, 'name' => $fileObj->name()), 'file.php', _AM_PUBLISHER_DELETETHISFILE . " <br />" . $fileObj->name() . " <br /> <br />", _AM_PUBLISHER_DELETE); xoops_cp_footer(); } @@ -155,7 +159,7 @@ case "default": default: - publisher_cpHeader(); + publisherCpHeader(); //publisher_adminMenu(2, _AM_PUBLISHER_ITEMS); break; } Modified: XoopsModules/publisher/trunk/publisher/admin/import/ams.php =================================================================== --- XoopsModules/publisher/trunk/publisher/admin/import/ams.php 2015-05-25 21:36:01 UTC (rev 13068) +++ XoopsModules/publisher/trunk/publisher/admin/import/ams.php 2015-05-26 09:32:35 UTC (rev 13069) @@ -20,52 +20,32 @@ * @version $Id$ */ -include_once dirname(dirname(__FILE__)) . '/admin_header.php'; +include_once dirname(__DIR__) . '/admin_header.php'; $myts = MyTextSanitizer::getInstance(); -$importFromModuleName = "xNews " . @$_POST['ams_version']; +$importFromModuleName = "xNews " . XoopsRequest::getString('ams_version', '', 'POST'); $scriptname = "ams.php"; -$op = 'start'; +$op = ('go' == XoopsRequest::getString('op', '', 'POST')) ? 'go' : 'start'; -if (isset($_POST['op']) && ($_POST['op'] == 'go')) { - $op = $_POST['op']; -} - -function recurse_copy($src,$dst) -{ - $dir = opendir($src); -// @mkdir($dst); - while (false !== ( $file = readdir($dir)) ) { - if (( $file != '.' ) && ( $file != '..' )) { - if ( is_dir($src . '/' . $file) ) { - recurse_copy($src . '/' . $file,$dst . '/' . $file); - } else { - copy($src . '/' . $file,$dst . '/' . $file); - } - } - } - closedir($dir); -} - if ($op == 'start') { xoops_load('XoopsFormLoader'); - publisher_cpHeader(); + publisherCpHeader(); //publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT); - publisher_openCollapsableBar('amsimport', 'amsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); + publisherOpenCollapsableBar('amsimport', 'amsimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO); - $result = $xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("ams_topics")); - list ($totalCat) = $xoopsDB->fetchRow($result); + $result = $GLOBALS['xoopsDB']->query("SELECT COUNT(*) FROM " . $GLOBALS['xoopsDB']->prefix("ams_topics")); + list ($totalCat) = $GLOBALS['xoopsDB']->fetchRow($result); if ($totalCat == 0) { echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . _AM_PUBLISHER_IMPORT_NO_CATEGORY . "</span>"; } else { - include_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; + include_once $GLOBALS['xoops']->path('class/xoopstree.php'); - $result = $xoopsDB->query... [truncated message content] |