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] |