Skip to content

Commit

Permalink
1.03 Beta 1 XOOPS 2.5.8, PHP7
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed Mar 19, 2016
1 parent ca3f3fb commit 3c943ff
Show file tree
Hide file tree
Showing 79 changed files with 568 additions and 615 deletions.
10 changes: 8 additions & 2 deletions admin/admin_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
*/

include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
include_once $GLOBALS['xoops']->path('www/include/cp_functions.php');
include_once $GLOBALS['xoops']->path('www/include/cp_header.php');
include_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php');

xoops_load('XoopsRequest');

include_once dirname(__DIR__) . '/include/config.php';
include_once $GLOBALS['xoops']->path('include/cp_header.php');

//xoops_loadLanguage('admin', PUBLISHER_DIRNAME);
xoops_loadLanguage('modinfo', PUBLISHER_DIRNAME);
Expand All @@ -31,8 +36,9 @@
'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' />");
include_once $GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php');

include_once $GLOBALS['xoops']->path('Frameworks/moduleclasses/moduleadmin/moduleadmin.php');
//ModuleAdmin::loadLanguage();
/*
$myts = MyTextSanitizer::getInstance();
Expand Down
26 changes: 13 additions & 13 deletions admin/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@

include_once __DIR__ . '/admin_header.php';

$op = XoopsRequest::getString('op', (XoopsRequest::getString('op', '', 'POST')), 'GET');
$op = XoopsRequest::getString('op', XoopsRequest::getString('op', '', 'POST'), 'GET');

$op = (XoopsRequest::getString('editor', '', 'POST')) ? 'mod' : $op;
$op = (XoopsRequest::getString('addcategory', '', 'POST')) ? 'addcategory' : $op;
$op = XoopsRequest::getString('editor', '', 'POST') ? 'mod' : $op;
$op = XoopsRequest::getString('addcategory', '', 'POST') ? 'addcategory' : $op;

// Where do we start ?
$startcategory = XoopsRequest::getInt('startcategory', 0, 'GET');
$categoryid = XoopsRequest::getInt('categoryid');

switch ($op) {
case 'del':
$categoryObj =& $publisher->getHandler('category')->get($categoryid);
$categoryObj = $publisher->getHandler('category')->get($categoryid);
$confirm = XoopsRequest::getInt('confirm', '', 'POST');
$name = XoopsRequest::getString('name', '', 'POST');
if ($confirm) {
Expand All @@ -52,7 +52,7 @@
case 'mod':
//Added by fx2024
$nb_subcats = XoopsRequest::getInt('nb_subcats', 0, 'POST');
$nb_subcats += (XoopsRequest::getInt('nb_sub_yet', 4, 'POST'));
$nb_subcats += XoopsRequest::getInt('nb_sub_yet', 4, 'POST');
//end of fx2024 code

publisherCpHeader();
Expand All @@ -65,9 +65,9 @@
$parentid = XoopsRequest::getInt('parentid');

if ($categoryid != 0) {
$categoryObj =& $publisher->getHandler('category')->get($categoryid);
$categoryObj = $publisher->getHandler('category')->get($categoryid);
} else {
$categoryObj =& $publisher->getHandler('category')->create();
$categoryObj = $publisher->getHandler('category')->create();
}

// Uploading the image, if any
Expand All @@ -82,7 +82,7 @@
$max_imgwidth = $publisher->getConfig('maximum_image_width');
$max_imgheight = $publisher->getConfig('maximum_image_height');
$allowed_mimetypes = publisherGetAllowedImagesTypes();
if (!is_readable($temp['tmp_name']) || ($temp['tmp_name'] == '')) {
if (($temp['tmp_name'] == '') || !is_readable($temp['tmp_name'])) {
redirect_header('javascript:history.go(-1)', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR);
// exit();
}
Expand All @@ -99,7 +99,7 @@
} else {
$categoryObj->setVar('image', XoopsRequest::getString('image', '', 'POST'));
}
$categoryObj->setVar('parentid', (XoopsRequest::getInt('parentid', 0, 'POST')));
$categoryObj->setVar('parentid', XoopsRequest::getInt('parentid', 0, 'POST'));

$applyall = XoopsRequest::getInt('applyall', 0, 'POST');
$categoryObj->setVar('weight', XoopsRequest::getInt('weight', 1, 'POST'));
Expand Down Expand Up @@ -143,7 +143,7 @@
for ($i = 0; $i < $sizeof; ++$i) {
$temp = XoopsRequest::getArray('scname', array(), 'POST');
if ($temp[$i] != '') {
$categoryObj =& $publisher->getHandler('category')->create();
$categoryObj = $publisher->getHandler('category')->create();
$temp2 = XoopsRequest::getArray('scname', array(), 'POST');
$categoryObj->setVar('name', $temp2[$i]);
$categoryObj->setVar('parentid', $parentCat);
Expand All @@ -169,7 +169,7 @@
$categoryid = 0;
$nb_subcats = XoopsRequest::getInt('nb_subcats', 0, 'POST') + XoopsRequest::getInt('nb_sub_yet', 0, 'POST');

$categoryObj =& $publisher->getHandler('category')->create();
$categoryObj = $publisher->getHandler('category')->create();
$categoryObj->setVar('name', XoopsRequest::getString('name', '', 'POST'));
$categoryObj->setVar('description', XoopsRequest::getString('description', '', 'POST'));
$categoryObj->setVar('weight', XoopsRequest::getInt('weight', 0, 'POST'));
Expand Down Expand Up @@ -199,7 +199,7 @@
echo '</div></form>';

// Creating the objects for top categories
$categoriesObj =& $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0);
$categoriesObj = $publisher->getHandler('category')->getCategories($publisher->getConfig('idxcat_perpage'), $startcategory, 0);

publisherOpenCollapsableBar('createdcategories', 'createdcategoriesicon', _AM_PUBLISHER_CATEGORIES_TITLE, _AM_PUBLISHER_CATEGORIES_DSC);

Expand All @@ -210,7 +210,7 @@
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);
$totalCategories = $publisher->getHandler('category')->getCategoriesCount(0);
if (count($categoriesObj) > 0) {
foreach ($categoriesObj as $key => $thiscat) {
PublisherUtilities::displayCategory($thiscat);
Expand Down
19 changes: 6 additions & 13 deletions admin/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,27 @@
*/
function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
{
$publisher =& PublisherPublisher::getInstance();
$publisher = PublisherPublisher::getInstance();
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);
$fileObj = $publisher->getHandler('file')->get($fileid);

if ($fileObj->notLoaded()) {
redirect_header('javascript:history.go(-1)', 1, _AM_PUBLISHER_NOFILESELECTED);
// exit();
}

if ($showmenu) {
//publisher_adminMenu(2, _AM_PUBLISHER_FILE . " > " . _AM_PUBLISHER_EDITING);
}

echo "<br />\n";
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>';
publisherOpenCollapsableBar('editfile', 'editfileicon', _AM_PUBLISHER_FILE_INFORMATIONS);
} else {
// there's no parameter, so we're adding an item
$fileObj =& $publisher->getHandler('file')->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 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>';
publisherOpenCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS);
Expand Down Expand Up @@ -106,9 +99,9 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)

// Creating the file object
if ($fileid != 0) {
$fileObj =& $publisher->getHandler('file')->get($fileid);
$fileObj = $publisher->getHandler('file')->get($fileid);
} else {
$fileObj =& $publisher->getHandler('file')->create();
$fileObj = $publisher->getHandler('file')->create();
}

// Putting the values in the file object
Expand All @@ -130,7 +123,7 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
$fileid = XoopsRequest::getInt('fileid', 0, 'POST');
$fileid = XoopsRequest::getInt('fileid', $fileid, 'GET');

$fileObj =& $publisher->getHandler('file')->get($fileid);
$fileObj = $publisher->getHandler('file')->get($fileid);

$confirm = XoopsRequest::getInt('confirm', 0, 'POST');
$title = XoopsRequest::getString('title', '', 'POST');
Expand Down
2 changes: 1 addition & 1 deletion admin/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

xoops_load('XoopsFormLoader');

$moduleHandler =& xoops_getHandler('module');
$moduleHandler = xoops_getHandler('module');

// WF-Section
/*$wfs_version = 0;
Expand Down
24 changes: 12 additions & 12 deletions admin/import/ams.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
// redirect_header('admin.php?fct=images', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
// }

$imageCategoryHandler =& xoops_getHandler('imagecategory');
$imageCategoryHandler = xoops_getHandler('imagecategory');
$imagecategory =& $imageCategoryHandler->create();
// $imagecategory->setVar('imgcat_name', $imgcat_name);
$imagecategory->setVar('imgcat_name', PUBLISHER_DIRNAME); //$imgcat_name);
Expand All @@ -81,7 +81,7 @@
}

$newid = $imagecategory->getVar('imgcat_id');
$imagecategorypermHandler =& xoops_getHandler('groupperm');
$imagecategorypermHandler = xoops_getHandler('groupperm');
if (!isset($readgroup)) {
$readgroup = array();
}
Expand Down Expand Up @@ -158,14 +158,14 @@
if ($op === 'go') {
publisherCpHeader();
//publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT);
include_once (dirname(dirname(__DIR__))) . '/include/common.php';
include_once dirname(dirname(__DIR__)) . '/include/common.php';
publisherOpenCollapsableBar('amsimportgo', 'amsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT);

$moduleHandler =& xoops_getHandler('module');
$moduleHandler = xoops_getHandler('module');
$moduleObj = $moduleHandler->getByDirname('ams');
$ams_module_id = $moduleObj->getVar('mid');

$gpermHandler =& xoops_getHandler('groupperm');
$gpermHandler = xoops_getHandler('groupperm');

$cnt_imported_cat = 0;
$cnt_imported_articles = 0;
Expand All @@ -179,7 +179,7 @@
$newCatArray = array();
$newArticleArray = array();

$imageCategoryHandler =& xoops_getHandler('imagecategory');
$imageCategoryHandler = xoops_getHandler('imagecategory');
// $criteria = new criteriaCombo;

// get the total number of subcats for this category
Expand Down Expand Up @@ -213,7 +213,7 @@
$newCat['oldid'] = $arrCat['topic_id'];
$newCat['oldpid'] = $arrCat['topic_pid'];

$categoryObj =& $publisher->getHandler('category')->create();
$categoryObj = $publisher->getHandler('category')->create();

$categoryObj->setVar('parentid', $arrCat['topic_pid']);
$categoryObj->setVar('image', $arrCat['topic_imgurl']);
Expand All @@ -231,7 +231,7 @@

/*
$imageHandler =& xoops_getHandler('image');
$imageHandler = xoops_getHandler('image');
$image =& $imageHandler->create();
$image->setVar('image_name', $arrCat['topic_imgurl']);//'images/' . $uploader->getSavedFileName());
$image->setVar('image_nicename', substr($arrCat['topic_imgurl'],-13)); //$image_nicename);
Expand Down Expand Up @@ -288,7 +288,7 @@
$resultArticles = $GLOBALS['xoopsDB']->query($sql);
while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) {
// insert article
$itemObj =& $publisher->getHandler('item')->create();
$itemObj = $publisher->getHandler('item')->create();

$itemObj->setVar('categoryid', $categoryObj->categoryid());
$itemObj->setVar('title', $arrArticle['title']);
Expand All @@ -307,7 +307,7 @@
$itemObj->setVar('notifypub', $arrArticle['notifypub']);
//-------- image

$imgHandler =& xoops_getHandler('image');
$imgHandler = xoops_getHandler('image');

// $criteria = new Criteria('image_name', $arrArticle['picture']);
$imageId = $imgHandler->getObjects($criteria);
Expand Down Expand Up @@ -349,7 +349,7 @@
$filename = $GLOBALS['xoops']->path('uploads/AMS/attached/' . $arrFile['downloadname']);
if (file_exists($filename)) {
if (copy($filename, $GLOBALS['xoops']->path('uploads/publisher/' . $arrFile['filerealname']))) {
$fileObj =& $publisher->getHandler('file')->create();
$fileObj = $publisher->getHandler('file')->create();
$fileObj->setVar('name', $arrFile['filerealname']);
$fileObj->setVar('description', $arrFile['filerealname']);
$fileObj->setVar('status', PublisherConstants::PUBLISHER_STATUS_FILE_ACTIVE);
Expand Down Expand Up @@ -410,7 +410,7 @@

$publisher_module_id = $publisher->getModule()->mid();

$commentHandler =& xoops_getHandler('comment');
$commentHandler = xoops_getHandler('comment');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('com_modid', $ams_module_id));
$comments = $commentHandler->getObjects($criteria);
Expand Down
10 changes: 5 additions & 5 deletions admin/import/cjaycontent.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@
if ($op === 'go') {
publisherCpHeader();
//publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT);
include_once (dirname(dirname(__DIR__))) . '/include/common.php';
include_once dirname(dirname(__DIR__)) . '/include/common.php';
publisherOpenCollapsableBar('cjaycontentimportgo', 'cjaycontentimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT);

$moduleHandler =& xoops_getHandler('module');
$moduleHandler = xoops_getHandler('module');
$moduleObj = $moduleHandler->getByDirname('cjaycontent');
$cjaycontent_module_id = $moduleObj->getVar('mid');

$gpermHandler =& xoops_getHandler('groupperm');
$gpermHandler = xoops_getHandler('groupperm');

$cnt_imported_articles = 0;

Expand All @@ -103,7 +103,7 @@
$resultArticles = $GLOBALS['xoopsDB']->query($sql);
while (($arrArticle = $GLOBALS['xoopsDB']->fetchArray($resultArticles)) !== false) {
// insert article
$itemObj =& $publisher->getHandler('item')->create();
$itemObj = $publisher->getHandler('item')->create();
$itemObj->setVar('itemid', $arrArticle['id']);
// $itemObj->setVar('categoryid', $categoryObj->categoryid());
$itemObj->setVar('title', $arrArticle['title']);
Expand Down Expand Up @@ -158,7 +158,7 @@

$publisher_module_id = $publisher->getModule()->mid();

$commentHandler =& xoops_getHandler('comment');
$commentHandler = xoops_getHandler('comment');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('com_modid', $cjaycontent_module_id));
$comments = $commentHandler->getObjects($criteria);
Expand Down
Loading

0 comments on commit 3c943ff

Please sign in to comment.