Skip to content

Commit

Permalink
Merge mambax7/publisher changes
Browse files Browse the repository at this point in the history
  • Loading branch information
geekwright committed May 29, 2016
1 parent 4edd4f8 commit a27cfae
Show file tree
Hide file tree
Showing 107 changed files with 990 additions and 741 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/mambax7/publisher.svg?style=flat)](https://scrutinizer-ci.com/g/mambax7/publisher/?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/grade/2d27c0023ee54f0b9ba2b5d17a68b2a5)](https://www.codacy.com/app/mambax7/publisher)
[![Code Climate](https://img.shields.io/codeclimate/github/mambax7/publisher.svg?style=flat)](https://codeclimate.com/github/mambax7/publisher)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/9dc918fe-ea63-4675-832c-8f6c74cdf78f/mini.png)](https://insight.sensiolabs.com/projects/9dc918fe-ea63-4675-832c-8f6c74cdf78f)
[![Latest Pre-Resease](https://img.shields.io/github/tag/XoopsModules25x/publisher.svg?style=flat)](https://github.com/XoopsModules25x/publisher/tags/)
[![Latest Version](https://img.shields.io/github/release/XoopsModules25x/publisher.svg?style=flat)](https://github.com/XoopsModules25x/publisher/releases/)

Expand All @@ -16,4 +17,4 @@ To contribute to the Tutorial, [fork it on GitHub](https://github.com/XoopsDocs/

Please visit us on http://xoops.org

The upcoming "next generation" version of XOOPS CMS is being crafted on GitHub at: https://github.com/XOOPS
The upcoming "next generation" version of XOOPS CMS is being crafted on GitHub at: https://github.com/XOOPS
3 changes: 1 addition & 2 deletions admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @package Publisher
* @since 1.0
* @author Mage, Mamba
* @version $Id: about.php 10374 2012-12-12 23:39:48Z trabis $
*/

include_once __DIR__ . '/admin_header.php';
Expand All @@ -26,7 +25,7 @@

$aboutAdmin = new ModuleAdmin();

echo $aboutAdmin->addNavigation('about.php');
echo $aboutAdmin->addNavigation(basename(__FILE__));
echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false);

// if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
Expand Down
12 changes: 9 additions & 3 deletions admin/admin_footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,23 @@
*/

/**
* @copyright The XOOPS Project http://sourceforge.net/projects/xoops/
* @copyright XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @package
* @since
* @author XOOPS Development Team
* @version $Id $
*/

global $xoopsModule;
$pathIcon32 = XOOPS_URL . '/' . $xoopsModule->getInfo('sysIcons32');

echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>';
echo "<div class='adminfooter'>\n" .
" <div style='text-align: center;'>\n" .
" <a href='http://www.xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" .
" </div>\n" .
' ' .
_AM_MODULEADMIN_ADMIN_FOOTER .
"\n" .
'</div>';

xoops_cp_footer();
4 changes: 2 additions & 2 deletions admin/admin_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @since 1.0
* @author trabis <[email protected]>
* @author The SmartFactory <www.smartfactory.ca>
* @version $Id: admin_header.php 10661 2013-01-04 19:22:48Z trabis $
*/

include_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
Expand All @@ -35,7 +34,8 @@
'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' />");
'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');
//ModuleAdmin::loadLanguage();
Expand Down
8 changes: 4 additions & 4 deletions admin/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @since 1.0
* @author trabis <[email protected]>
* @author The SmartFactory <www.smartfactory.ca>
* @version $Id: category.php 10661 2013-01-04 19:22:48Z trabis $
*/

include_once __DIR__ . '/admin_header.php';
Expand Down Expand Up @@ -44,7 +43,8 @@
// 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_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;
Expand Down Expand Up @@ -192,7 +192,7 @@
publisherCpHeader();
//publisher_adminMenu(1, _AM_PUBLISHER_CATEGORIES);

echo "<br />\n";
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 . "'>&nbsp;&nbsp;";
//echo "<input type='button' name='button' onclick=\"location='item.php?op=mod'\" value='" . _AM_PUBLISHER_CREATEITEM . "'>&nbsp;&nbsp;";
Expand Down Expand Up @@ -226,7 +226,7 @@
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 />';
echo '<br>';
publisherCloseCollapsableBar('createdcategories', 'createdcategoriesicon');
echo '<br>';
//editcat(false);
Expand Down
14 changes: 8 additions & 6 deletions admin/clone.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* @package Publisher
* @since 1.0
* @author trabis <[email protected]>
* @version $Id: clone.php 10374 2012-12-12 23:39:48Z trabis $
*/

include_once __DIR__ . '/admin_header.php';
Expand All @@ -26,7 +25,7 @@

if ('submit' === XoopsRequest::getString('op', '', 'POST')) {
if (!$GLOBALS['xoopsSecurity']->check()) {
redirect_header('clone.php', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
redirect_header('clone.php', 3, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
// exit();
}

Expand All @@ -47,7 +46,8 @@
$patterns = array(
strtolower(PUBLISHER_DIRNAME) => strtolower($clone),
strtoupper(PUBLISHER_DIRNAME) => strtoupper($clone),
ucfirst(strtolower(PUBLISHER_DIRNAME)) => ucfirst(strtolower($clone)));
ucfirst(strtolower(PUBLISHER_DIRNAME)) => ucfirst(strtolower($clone))
);

$patKeys = array_keys($patterns);
$patValues = array_values($patterns);
Expand All @@ -56,7 +56,7 @@

$msg = '';
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";
$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;
}
Expand Down Expand Up @@ -86,7 +86,7 @@
function file_put_contents($filename, $data, $file_append = false)
{
if ($fp == fopen($filename, (!$file_append ? 'w+' : 'a+'))) {
fputs($fp, $data);
fwrite($fp, $data);
fclose($fp);
}
}
Expand Down Expand Up @@ -154,7 +154,9 @@ public static function createLogo($dirname)
// unset($func);
}

if (!file_exists($imageBase = $GLOBALS['xoops']->path('modules/' . $dirname . '/assets/images/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/logo.png')) ||
!file_exists($font = $GLOBALS['xoops']->path('modules/' . $dirname . '/assets/images/VeraBd.ttf'))
) {
return false;
}

Expand Down
13 changes: 6 additions & 7 deletions admin/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @since 1.0
* @author trabis <[email protected]>
* @author The SmartFactory <www.smartfactory.ca>
* @version $Id: file.php 10374 2012-12-12 23:39:48Z trabis $
*/

include_once __DIR__ . '/admin_header.php';
Expand All @@ -43,7 +42,7 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
// exit();
}

echo "<br />\n";
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);
Expand Down Expand Up @@ -111,11 +110,11 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)

// Storing the file
if (!$fileObj->store()) {
redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid().'#tab_2', 3, _AM_PUBLISHER_FILE_EDITING_ERROR . publisherFormatErrors($fileObj->getErrors()));
redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid() . '#tab_2', 3, _AM_PUBLISHER_FILE_EDITING_ERROR . publisherFormatErrors($fileObj->getErrors()));
// exit;
}

redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid().'#tab_2', 2, _AM_PUBLISHER_FILE_EDITING_SUCCESS);
redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid() . '#tab_2', 2, _AM_PUBLISHER_FILE_EDITING_SUCCESS);
// exit();
break;

Expand All @@ -130,18 +129,18 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)

if ($confirm) {
if (!$publisher->getHandler('file')->delete($fileObj)) {
redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid().'#tab_2', 2, _AM_PUBLISHER_FILE_DELETE_ERROR);
redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid() . '#tab_2', 2, _AM_PUBLISHER_FILE_DELETE_ERROR);
// exit;
}

redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid().'#tab_2', 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->name()));
redirect_header('item.php?op=mod&itemid=' . $fileObj->itemid() . '#tab_2', 2, sprintf(_AM_PUBLISHER_FILEISDELETED, $fileObj->name()));
// exit();
} else {
// no confirm: show deletion condition
$fileid = XoopsRequest::getInt('fileid', 0, 'GET');

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_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();
}

Expand Down
1 change: 0 additions & 1 deletion admin/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @since 1.0
* @author trabis <[email protected]>
* @author The SmartFactory <www.smartfactory.ca>
* @version $Id: import.php 12825 2014-10-31 02:42:34Z zyspec $
*/

include_once __DIR__ . '/admin_header.php';
Expand Down
15 changes: 7 additions & 8 deletions admin/import/ams.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @author trabis <[email protected]>
* @author The SmartFactory <www.smartfactory.ca>
* @author Marius Scurtescu <[email protected]>
* @version $Id: ams.php 10374 2012-12-12 23:39:48Z trabis $
*/

include_once dirname(__DIR__) . '/admin_header.php';
Expand Down Expand Up @@ -58,7 +57,7 @@
// add 'publisher' category to 'imagecategory' table

// if (!$GLOBALS['xoopsSecurity']->check()) {
// redirect_header('admin.php?fct=images', 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
// redirect_header('admin.php?fct=images', 3, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
// }

$imageCategoryHandler = xoops_getHandler('imagecategory');
Expand Down Expand Up @@ -128,7 +127,7 @@
$cat_cbox_options[$cid] = "$cat_title ($art_count)";
}

$cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('<br />', $cat_cbox_options));
$cat_label = new XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('<br>', $cat_cbox_options));
$cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC);
$form->addElement($cat_label);

Expand Down Expand Up @@ -362,7 +361,7 @@
$fileObj->setVar('short_url', $arrFile['filerealname']);

if ($fileObj->store($allowed_mimetypes, true, false)) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '<br />';
echo '&nbsp;&nbsp;&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '<br>';
}
}
}
Expand All @@ -371,7 +370,7 @@
//------------------------

$newArticleArray[$arrArticle['storyid']] = $itemObj->itemid();
echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->getTitle()) . '<br />';
echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->getTitle()) . '<br>';
++$cnt_imported_articles;
}
}
Expand Down Expand Up @@ -406,7 +405,7 @@
unset($oldid, $newCat);

// Looping through the comments to link them to the new articles and module
echo _AM_PUBLISHER_IMPORT_COMMENTS . '<br />';
echo _AM_PUBLISHER_IMPORT_COMMENTS . '<br>';

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

Expand All @@ -419,9 +418,9 @@
$comment->setVar('com_modid', $publisher_module_id);
$comment->setNew();
if (!$commentHandler->insert($comment)) {
echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '<br />';
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 />';
echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '<br>';
}
}
// unset($comment);
Expand Down
9 changes: 4 additions & 5 deletions admin/import/cjaycontent.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @author trabis <[email protected]>
* @author The SmartFactory <www.smartfactory.ca>
* @author Marius Scurtescu <[email protected]>
* @version $Id: cjaycontent.php 10374 2012-12-12 23:39:48Z trabis $
*/

include_once dirname(__DIR__) . '/admin_header.php';
Expand Down Expand Up @@ -146,15 +145,15 @@
continue;
} else {
$newArticleArray[$arrArticle['id']] = $itemObj->itemid();
echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->getTitle()) . '<br />';
echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE, $itemObj->getTitle()) . '<br>';
++$cnt_imported_articles;
}
}

echo '<br/>';

// Looping through the comments to link them to the new articles and module
echo _AM_PUBLISHER_IMPORT_COMMENTS . '<br />';
echo _AM_PUBLISHER_IMPORT_COMMENTS . '<br>';

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

Expand All @@ -167,9 +166,9 @@
$comment->setVar('com_modid', $publisher_module_id);
$comment->setNew();
if (!$commentHandler->insert($comment)) {
echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT_ERROR, $comment->getVar('com_title')) . '<br />';
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 />';
echo '&nbsp;&nbsp;' . sprintf(_AM_PUBLISHER_IMPORTED_COMMENT, $comment->getVar('com_title')) . '<br>';
}
}
// unset($comment);
Expand Down
Loading

0 comments on commit a27cfae

Please sign in to comment.