Skip to content

Commit

Permalink
RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed May 26, 2015
1 parent 8d7c142 commit a38a4c4
Show file tree
Hide file tree
Showing 41 changed files with 247 additions and 210 deletions.
4 changes: 2 additions & 2 deletions publisher/admin/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

// Uploading the image, if any
// Retreive the filename to be uploaded
if (($image_file = XoopsRequest::getArray('image_file', '', 'FILES')['name'])) {
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
Expand Down Expand Up @@ -139,7 +139,7 @@

//Added by fx2024
$parentCat = $categoryObj->categoryid();
$sizeof = sizeof(XoopsRequest::getString('scname', '', 'POST'));
$sizeof = count(XoopsRequest::getString('scname', '', 'POST'));
for ($i = 0; $i < $sizeof; ++$i) {
if (XoopsRequest::getArray('scname', array(), 'POST')[$i] != '') {
$categoryObj = $publisher->getHandler('category')->create();
Expand Down
4 changes: 2 additions & 2 deletions publisher/admin/clone.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static function createLogo($dirname)
unset($func);
}

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"))) {
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;
}

Expand All @@ -175,7 +175,7 @@ public static function createLogo($dirname)
$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"));
imagepng($imageModule, $GLOBALS['xoops']->path("modules/" . $dirname . "/assets/images/module_logo.png"));
imagedestroy($imageModule);

return true;
Expand Down
20 changes: 10 additions & 10 deletions publisher/admin/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
case "importExecute":

$importfile = XoopsRequest::getString('importfile', 'nonselected', 'POST');
$importfile_path = $GLOBALS['xoops']->path("/modules/" . $publisher->getModule()->dirname() . "/admin/import/" . $importfile . ".php");
$importfile_path = $GLOBALS['xoops']->path("modules/" . $publisher->getModule()->dirname() . "/admin/import/" . $importfile . ".php");
include_once $importfile_path;
break;

Expand All @@ -44,11 +44,11 @@

xoops_load('XoopsFormLoader');

$module_handler = xoops_gethandler('module');
$moduleHandler = xoops_gethandler('module');

// WF-Section
/*$wfs_version = 0;
$moduleObj = $module_handler->getByDirname('wfsection');
$moduleObj = $moduleHandler->getByDirname('wfsection');
if ($moduleObj) {
$from_module_version = round($moduleObj->getVar('version') / 100, 2);
if (($from_module_version == 1.5) || $from_module_version == 1.04 || $from_module_version == 1.01 || $from_module_version == 2.07 || $from_module_version == 2.06) {
Expand All @@ -59,7 +59,7 @@

// News
$news_version = 0;
$moduleObj = $module_handler->getByDirname('news');
$moduleObj = $moduleHandler->getByDirname('news');
if ($moduleObj) {
$from_module_version = round($moduleObj->getVar('version') / 100, 2);
if (($from_module_version >= 1.1)) {
Expand All @@ -70,7 +70,7 @@

// xNews
$xnews_version = 0;
$moduleObj = $module_handler->getByDirname('xnews');
$moduleObj = $moduleHandler->getByDirname('xnews');
if ($moduleObj) {
$from_module_version = round($moduleObj->getVar('version') / 100, 2);
if (($from_module_version >= 1.1)) {
Expand All @@ -81,7 +81,7 @@

// AMS
$ams_version = 0;
$moduleObj = $module_handler->getByDirname('AMS');
$moduleObj = $moduleHandler->getByDirname('AMS');
if ($moduleObj) {
$from_module_version = round($moduleObj->getVar('version') / 100, 2);
if (($from_module_version >= 1.1)) {
Expand All @@ -92,7 +92,7 @@

// Smartsection
$smartsection_version = 0;
$moduleObj = $module_handler->getByDirname('smartsection');
$moduleObj = $moduleHandler->getByDirname('smartsection');
if ($moduleObj) {
$from_module_version = round($moduleObj->getVar('version') / 100, 2);
if (($from_module_version >= 1.1)) {
Expand All @@ -103,7 +103,7 @@

// C-Jay Content
$cjaycontent_version = 0;
$moduleObj = $module_handler->getByDirname('cjaycontent');
$moduleObj = $moduleHandler->getByDirname('cjaycontent');
if ($moduleObj) {
$from_module_version = round($moduleObj->getVar('version') / 100, 2);
if (($from_module_version >= 1.1)) {
Expand All @@ -114,7 +114,7 @@

// FmContent
$fmcontent_version = 0;
$moduleObj = $module_handler->getByDirname('fmcontent');
$moduleObj = $moduleHandler->getByDirname('fmcontent');
if ($moduleObj) {
$from_module_version = round($moduleObj->getVar('version') / 100, 2);
if (($from_module_version >= 1.1)) {
Expand All @@ -125,7 +125,7 @@

// XF-Section
/*$xfs_version = 0;
$moduleObj = $module_handler->getByDirname('xfsection');
$moduleObj = $moduleHandler->getByDirname('xfsection');
If ($moduleObj) {
$from_module_version = round($moduleObj->getVar('version') / 100, 2);
if ($from_module_version > 1.00) {
Expand Down
26 changes: 13 additions & 13 deletions publisher/admin/import/ams.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
include_once (dirname(dirname(__DIR__))) . '/include/common.php';
publisherOpenCollapsableBar('amsimportgo', 'amsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT);

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

$gperm_handler = xoops_gethandler('groupperm');
Expand All @@ -185,7 +185,7 @@
// get the total number of subcats for this category
// $criteria = new CriteriaCompo();
// $criteria->add(new Criteria('imagecategory', $catObj->getVar('cid'), '='));
// $childCount = intval($mylinksCatHandler->getCount($criteria));
// $childCount = (int)($mylinksCatHandler->getCount($criteria));

$criteria = new Criteria('imgcat_name', PUBLISHER_DIRNAME);
$imageCategoryId = $imageCategoryHandler->getObjects($criteria);
Expand Down Expand Up @@ -224,7 +224,7 @@

// Category image: copying to Publisher category uploads
if (($arrCat['topic_imgurl'] != 'blank.gif') && ($arrCat['topic_imgurl'] != '')) {
if (copy($GLOBALS['xoops']->path("/uploads/AMS/topics/" . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path("/uploads/" . PUBLISHER_DIRNAME . "/images/category/" . $arrCat['topic_imgurl']))) {
if (copy($GLOBALS['xoops']->path("uploads/AMS/topics/" . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path("uploads/" . PUBLISHER_DIRNAME . "/images/category/" . $arrCat['topic_imgurl']))) {
$categoryObj->setVar('image', $arrCat['topic_imgurl']);

//======== there is no need to add the category images to Image Manager, because they are handled directly from /images/category/ folder
Expand Down Expand Up @@ -259,8 +259,8 @@

//copy all images to Image Manager

$src = $GLOBALS['xoops']->path("/uploads/AMS/topics/");
$dst = $GLOBALS['xoops']->path("/uploads");
$src = $GLOBALS['xoops']->path("uploads/AMS/topics/");
$dst = $GLOBALS['xoops']->path("uploads");

PublisherUtilities::recurseCopy($src, $dst);

Expand Down Expand Up @@ -327,9 +327,9 @@
/*
// HTML Wrap
if ($arrArticle['htmlpage']) {
$pagewrap_filename = $GLOBALS['xoops']->path("/modules/wfsection/html/" .$arrArticle['htmlpage']);
$pagewrap_filename = $GLOBALS['xoops']->path("modules/wfsection/html/" .$arrArticle['htmlpage']);
if (file_exists($pagewrap_filename)) {
if (copy($pagewrap_filename, $GLOBALS['xoops']->path("/uploads/publisher/content/" . $arrArticle['htmlpage']))) {
if (copy($pagewrap_filename, $GLOBALS['xoops']->path("uploads/publisher/content/" . $arrArticle['htmlpage']))) {
$itemObj->setVar('body', "[pagewrap=" . $arrArticle['htmlpage'] . "]");
echo sprintf("&nbsp;&nbsp;&nbsp;&nbsp;" . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . "<br/>";
}
Expand All @@ -347,9 +347,9 @@
$resultFiles = $GLOBALS['xoopsDB']->query($sql);
$allowed_mimetypes = '';
while (($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles)) !== false) {
$filename = $GLOBALS['xoops']->path("/uploads/AMS/attached/" . $arrFile['downloadname']);
$filename = $GLOBALS['xoops']->path("uploads/AMS/attached/" . $arrFile['downloadname']);
if (file_exists($filename)) {
if (copy($filename, $GLOBALS['xoops']->path("/uploads/publisher/" . $arrFile['filerealname']))) {
if (copy($filename, $GLOBALS['xoops']->path("uploads/publisher/" . $arrFile['filerealname']))) {
$fileObj = $publisher->getHandler('file')->create();
$fileObj->setVar('name', $arrFile['filerealname']);
$fileObj->setVar('description', $arrFile['filerealname']);
Expand Down Expand Up @@ -411,15 +411,15 @@

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

$comment_handler = xoops_gethandler('comment');
$commentHandler = xoops_gethandler('comment');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('com_modid', $ams_module_id));
$comments = $comment_handler->getObjects($criteria);
$comments = $commentHandler->getObjects($criteria);
foreach ($comments as $comment) {
$comment->setVar('com_itemid', $newArticleArray[$comment->getVar('com_itemid')]);
$comment->setVar('com_modid', $publisher_module_id);
$comment->setNew();
if (!$comment_handler->insert($comment)) {
if (!$commentHandler->insert($comment)) {
echo "&nbsp;&nbsp;" . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "<br />";
} else {
echo "&nbsp;&nbsp;" . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "<br />";
Expand Down
14 changes: 7 additions & 7 deletions publisher/admin/import/cjaycontent.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@
_AM_PUBLISHER_IMPORT_RESULT
);

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

$gperm_handler = xoops_gethandler('groupperm');
Expand Down Expand Up @@ -151,9 +151,9 @@
/*
// HTML Wrap
if ($arrArticle['htmlpage']) {
$pagewrap_filename = $GLOBALS['xoops']->path("/modules/wfsection/html/" .$arrArticle['htmlpage']);
$pagewrap_filename = $GLOBALS['xoops']->path("modules/wfsection/html/" .$arrArticle['htmlpage']);
if (file_exists($pagewrap_filename)) {
if (copy($pagewrap_filename, $GLOBALS['xoops']->path("/uploads/publisher/content/" . $arrArticle['htmlpage']))) {
if (copy($pagewrap_filename, $GLOBALS['xoops']->path("uploads/publisher/content/" . $arrArticle['htmlpage']))) {
$itemObj->setVar('body', "[pagewrap=" . $arrArticle['htmlpage'] . "]");
echo sprintf("&nbsp;&nbsp;&nbsp;&nbsp;" . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . "<br/>";
}
Expand All @@ -178,15 +178,15 @@

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

$comment_handler = xoops_gethandler('comment');
$commentHandler = xoops_gethandler('comment');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('com_modid', $cjaycontent_module_id));
$comments = $comment_handler->getObjects($criteria);
$comments = $commentHandler->getObjects($criteria);
foreach ($comments as $comment) {
$comment->setVar('com_itemid', $newArticleArray[$comment->getVar('com_itemid')]);
$comment->setVar('com_modid', $publisher_module_id);
$comment->setNew();
if (!$comment_handler->insert($comment)) {
if (!$commentHandler->insert($comment)) {
echo "&nbsp;&nbsp;" . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "<br />";
} else {
echo "&nbsp;&nbsp;" . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "<br />";
Expand Down
14 changes: 7 additions & 7 deletions publisher/admin/import/fmcontent.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
//publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT);
publisherOpenCollapsableBar('fmimport', 'fmimporticon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_INFO);

$module_handler = xoops_gethandler('module');
$moduleObj = $module_handler->getByDirname('fmcontent');
$moduleHandler = xoops_gethandler('module');
$moduleObj = $moduleHandler->getByDirname('fmcontent');
$fm_module_id = $moduleObj->getVar('mid');

$fmTopicHdlr =& xoops_getmodulehandler('topic', 'fmcontent');
Expand Down Expand Up @@ -122,8 +122,8 @@
//publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT);
publisherOpenCollapsableBar('fmimportgo', 'fmimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT);

$module_handler = xoops_gethandler('module');
$moduleObj = $module_handler->getByDirname('fmcontent');
$moduleHandler = xoops_gethandler('module');
$moduleObj = $moduleHandler->getByDirname('fmcontent');
$fm_module_id = $moduleObj->getVar('mid');

$gperm_handler = xoops_gethandler('groupperm');
Expand Down Expand Up @@ -319,15 +319,15 @@

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

$comment_handler = xoops_gethandler('comment');
$commentHandler = xoops_gethandler('comment');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('com_modid', $fm_module_id));
$comments = $comment_handler->getObjects($criteria);
$comments = $commentHandler->getObjects($criteria);
foreach ($comments as $comment) {
$comment->setVar('com_itemid', $newArticleArray[$comment->getVar('com_itemid')]);
$comment->setVar('com_modid', $publisher_module_id);
$comment->setNew();
if (!$comment_handler->insert($comment)) {
if (!$commentHandler->insert($comment)) {
echo "&nbsp;&nbsp;" . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "<br />\n";
} else {
echo "&nbsp;&nbsp;" . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "<br />\n";
Expand Down
20 changes: 10 additions & 10 deletions publisher/admin/import/news.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
//publisher_adminMenu(-1, _AM_PUBLISHER_IMPORT);
publisherOpenCollapsableBar('newsimportgo', 'newsimportgoicon', sprintf(_AM_PUBLISHER_IMPORT_FROM, $importFromModuleName), _AM_PUBLISHER_IMPORT_RESULT);

$module_handler = xoops_gethandler('module');
$moduleObj = $module_handler->getByDirname('news');
$moduleHandler = xoops_gethandler('module');
$moduleObj = $moduleHandler->getByDirname('news');
$news_module_id = $moduleObj->getVar('mid');

$gperm_handler = xoops_gethandler('groupperm');
Expand Down Expand Up @@ -131,7 +131,7 @@

// Category image
if (($arrCat['topic_imgurl'] != 'blank.gif') && ($arrCat['topic_imgurl'] != '')) {
if (copy($GLOBALS['xoops']->path("/modules/news/assets/images/topics/" . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path("/uploads/publisher/images/category/" . $arrCat['topic_imgurl']))) {
if (copy($GLOBALS['xoops']->path("modules/news/assets/images/topics/" . $arrCat['topic_imgurl']), $GLOBALS['xoops']->path("uploads/publisher/images/category/" . $arrCat['topic_imgurl']))) {
$categoryObj->setVar('image', $arrCat['topic_imgurl']);
}
}
Expand Down Expand Up @@ -173,9 +173,9 @@
/*
// HTML Wrap
if ($arrArticle['htmlpage']) {
$pagewrap_filename = $GLOBALS['xoops']->path("/modules/wfsection/html/" .$arrArticle['htmlpage']);
$pagewrap_filename = $GLOBALS['xoops']->path("modules/wfsection/html/" .$arrArticle['htmlpage']);
if (file_exists($pagewrap_filename)) {
if (copy($pagewrap_filename, $GLOBALS['xoops']->path("/uploads/publisher/content/" . $arrArticle['htmlpage']))) {
if (copy($pagewrap_filename, $GLOBALS['xoops']->path("uploads/publisher/content/" . $arrArticle['htmlpage']))) {
$itemObj->setVar('body', "[pagewrap=" . $arrArticle['htmlpage'] . "]");
echo sprintf("&nbsp;&nbsp;&nbsp;&nbsp;" . _AM_PUBLISHER_IMPORT_ARTICLE_WRAP, $arrArticle['htmlpage']) . "<br/>";
}
Expand All @@ -194,9 +194,9 @@
$allowed_mimetypes = '';
while ($arrFile = $GLOBALS['xoopsDB']->fetchArray ($resultFiles)) {
$filename = $GLOBALS['xoops']->path("/modules/wfsection/cache/uploaded/" . $arrFile['filerealname']);
$filename = $GLOBALS['xoops']->path("modules/wfsection/cache/uploaded/" . $arrFile['filerealname']);
if (file_exists($filename)) {
if (copy($filename, $GLOBALS['xoops']->path("/uploads/publisher/" . $arrFile['filerealname']))) {
if (copy($filename, $GLOBALS['xoops']->path("uploads/publisher/" . $arrFile['filerealname']))) {
$fileObj = $publisher_file_handler->create();
$fileObj->setVar('name', $arrFile['fileshowname']);
$fileObj->setVar('description', $arrFile['filedescript']);
Expand Down Expand Up @@ -252,15 +252,15 @@

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

$comment_handler = xoops_gethandler('comment');
$commentHandler = xoops_gethandler('comment');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('com_modid', $news_module_id));
$comments = $comment_handler->getObjects($criteria);
$comments = $commentHandler->getObjects($criteria);
foreach ($comments as $comment) {
$comment->setVar('com_itemid', $newArticleArray[$comment->getVar('com_itemid')]);
$comment->setVar('com_modid', $publisher_module_id);
$comment->setNew();
if (!$comment_handler->insert($comment)) {
if (!$commentHandler->insert($comment)) {
echo "&nbsp;&nbsp;" . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . "<br />";
} else {
echo "&nbsp;&nbsp;" . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . "<br />";
Expand Down
Loading

0 comments on commit a38a4c4

Please sign in to comment.