Skip to content

Commit

Permalink
notifications, responsive image
Browse files Browse the repository at this point in the history
  • Loading branch information
mambax7 committed May 8, 2018
1 parent 1b3c5da commit 2b16251
Show file tree
Hide file tree
Showing 38 changed files with 107 additions and 43 deletions.
1 change: 1 addition & 0 deletions admin/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*/
function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0)
{
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');

Expand Down
1 change: 1 addition & 0 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//require_once dirname(__DIR__) . '/class/Utility.php';

xoops_cp_header();
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
$helper->loadLanguage('main');
$adminObject = \Xmf\Module\Admin::getInstance();
Expand Down
1 change: 1 addition & 0 deletions admin/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@
*/
function publisher_editItem($showmenu = false, $itemid = 0, $clone = false)
{
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
global $publisherCurrentPage;

Expand Down
1 change: 1 addition & 0 deletions admin/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

$moduleDirName = basename(dirname(__DIR__));

/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

// get path to icons
Expand Down
1 change: 1 addition & 0 deletions admin/permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

Publisher\Utility::cpHeader();
//publisher_adminMenu(3, _AM_PUBLISHER_PERMISSIONS);
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

// View Categories permissions
Expand Down
3 changes: 2 additions & 1 deletion admin/preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

require_once __DIR__ . '/admin_header.php';

$helper = Publisher\Helper::getInstance();
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

$module = $helper->getModule();
$modId = $module->mid();
Expand Down
1 change: 1 addition & 0 deletions admin/pw_upload_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function publisher_pagewrap_upload(&$errors)
// require_once PUBLISHER_ROOT_PATH . '/class/uploader.php';
xoops_load('XoopsMediaUploader');

/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
$postField = 'fileupload';

Expand Down
6 changes: 6 additions & 0 deletions assets/css/publisher.css
Original file line number Diff line number Diff line change
Expand Up @@ -919,3 +919,9 @@ display: block;
}
.btn{border-radius: 4px;}

.image img, .imagesp img, .images img, .imagess img, .illustration img, .illustrationy img {
max-width: 575px;
}
.wrap img, .wrap1 img {
max-width: 525px;
}
1 change: 1 addition & 0 deletions backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

use Xmf\Request;
use XoopsModules\Publisher;

require_once __DIR__ . '/header.php';
//xoops_load('XoopsLocal'); //mb
Expand Down
1 change: 1 addition & 0 deletions blocks/category_items_sel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*/
function publisher_category_items_sel_show($options)
{
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

$block = $item = [];
Expand Down
1 change: 1 addition & 0 deletions blocks/date_to_date.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
function publisher_date_to_date_show($options)
{
$myts = \MyTextSanitizer::getInstance();
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

$block = $newItems = [];
Expand Down
1 change: 1 addition & 0 deletions blocks/items_columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
function publisher_items_columns_show($options)
{
// global $xoTheme;
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

//Column Settings
Expand Down
1 change: 1 addition & 0 deletions blocks/items_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function publisher_items_menu_show($options)
{
$block = [];

/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

// Getting all top cats
Expand Down
1 change: 1 addition & 0 deletions blocks/items_new.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*/
function publisher_items_new_show($options)
{
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

$selectedcatids = explode(',', $options[0]);
Expand Down
1 change: 1 addition & 0 deletions blocks/items_random_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
function publisher_items_random_item_show($options)
{
$block = [];
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
// creating the ITEM object
$itemsObj = $helper->getHandler('Item')->getRandomItem('', [Constants::PUBLISHER_STATUS_PUBLISHED]);
Expand Down
1 change: 1 addition & 0 deletions blocks/items_recent.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*/
function publisher_items_recent_show($options)
{
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
$myts = \MyTextSanitizer::getInstance();

Expand Down
4 changes: 3 additions & 1 deletion blocks/items_spot.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
function publisher_items_spot_show($options)
{
// global $xoTheme;
$helper = Publisher\Helper::getInstance();
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
$optDisplayLast = $options[0];
$optItemsCount = $options[1];
$optCategoryId = $options[2];
Expand Down Expand Up @@ -127,6 +128,7 @@ function publisher_items_spot_edit($options)
$autoEle = new \XoopsFormRadioYN(_MB_PUBLISHER_AUTO_LAST_ITEMS, 'options[0]', $options[0]);
$countEle = new \XoopsFormText(_MB_PUBLISHER_LAST_ITEMS_COUNT, 'options[1]', 2, 255, $options[1]);
$catEle = new \XoopsFormLabel(_MB_PUBLISHER_SELECTCAT, Publisher\Utility::createCategorySelect($options[2], 0, true, 'options[2]'));
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
$criteria = new \CriteriaCompo();
$criteria->setSort('datesub');
Expand Down
1 change: 1 addition & 0 deletions blocks/latest_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*/
function publisher_latest_files_show($options)
{
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

/**
Expand Down
1 change: 1 addition & 0 deletions blocks/latest_news.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function publisher_latest_news_show($options)
{
$block = [];

/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
$helper->loadLanguage('main');
// xoops_loadLanguage('main', 'publisher');
Expand Down
3 changes: 2 additions & 1 deletion blocks/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
function publisher_search_show($options)
{
$block = [];
$helper = Publisher\Helper::getInstance();
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
$categories = $helper->getHandler('Category')->getCategoriesForSearch();
if (0 == count($categories)) {
return $block;
Expand Down
2 changes: 1 addition & 1 deletion class/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Helper extends \Xmf\Module\Helper
* @internal param $debug
* @param bool $debug
*/
protected function __construct($debug = false)
public function __construct($debug = false)
{
$this->debug = $debug;
$moduleDirName = basename(dirname(__DIR__));
Expand Down
1 change: 1 addition & 0 deletions class/Seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public static function getTitle($title = '', $withExt = true)
*/
public static function generateUrl($op, $id, $shortUrl = '')
{
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();
if ('none' !== $helper->getConfig('seo_url_rewrite')) {
if (!empty($shortUrl)) {
Expand Down
4 changes: 4 additions & 0 deletions comment_new.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
*/

use Xmf\Request;
use XoopsModules\Publisher;

require_once dirname(dirname(__DIR__)) . '/mainfile.php';
require_once __DIR__ . '/include/common.php';

/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

$com_itemid = Request::getInt('com_itemid', 0, 'GET');
if ($com_itemid > 0) {
$itemObj = $helper->getHandler('Item')->get($com_itemid);
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<h5>1.06 Beta 4 [2018-05-07]</h5> Dev: Xoops 2.5.9, PHP 7.2.5
<hr>
- fixed notifications bug (mamba)
- added responsive image (mamba)


<h5>1.06 Beta 3 [2018-03-15]</h5> Dev: Xoops 2.5.9, PHP 7.2.3
<hr>
- added Constants (mamba)
Expand Down
2 changes: 1 addition & 1 deletion file.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use XoopsModules\Publisher;

require_once __DIR__ . '/header.php';
$helper = Publisher\Helper::getInstance();

$helper->loadLanguage('admin');
//xoops_loadLanguage('admin', PUBLISHER_DIRNAME);

Expand Down
4 changes: 4 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
* @author The SmartFactory <www.smartfactory.ca>
*/

use XoopsModules\Publisher;

// defined('XOOPS_ROOT_PATH') || die('Restricted access');

require_once __DIR__ . '/include/common.php';

/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

$xoTheme->addStylesheet(PUBLISHER_URL . '/assets/css/publisher.css');
//$xoTheme->addStylesheet(PUBLISHER_URL . '/assets/css/jquery.popeye.style.css');
Expand Down
5 changes: 5 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,16 @@
* @author trabis <[email protected]>
*/

use XoopsModules\Publisher;

require_once dirname(dirname(__DIR__)) . '/mainfile.php';
require_once __DIR__ . '/include/common.php';

$myts = \MyTextSanitizer::getInstance();

/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

if ('none' !== $helper->getConfig('seo_url_rewrite')) {
require_once PUBLISHER_ROOT_PATH . '/include/seo.inc.php';
}
1 change: 1 addition & 0 deletions include/ajax_rating.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use XoopsModules\Publisher;

require_once dirname(__DIR__) . '/header.php';
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

error_reporting(0);
Expand Down
4 changes: 2 additions & 2 deletions include/comment_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

function publisher_com_update($itemId, $totalNum)
{
global $module;
global $xoopsModule;
$db = \XoopsDatabaseFactory::getDatabaseConnection();
$sql = 'UPDATE ' . $db->prefix($module->getVar('dirname', 'n') . '_items') . ' SET comments = ' . $totalNum . ' WHERE itemid = ' . $itemId;
$sql = 'UPDATE ' . $db->prefix($xoopsModule->getVar('dirname', 'n') . '_items') . ' SET comments = ' . $totalNum . ' WHERE itemid = ' . $itemId;
$db->query($sql);
}

Expand Down
6 changes: 3 additions & 3 deletions include/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName);
define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName);
define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName);
define($moduleDirNameUpper . '_IMAGES_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
define($moduleDirNameUpper . '_IMAGES_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images/');
define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
define($moduleDirNameUpper . '_IMAGES_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images');
define($moduleDirNameUpper . '_IMAGES_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin');
define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
Expand Down
9 changes: 6 additions & 3 deletions include/notification.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ function publisher_notify_iteminfo($category, $itemId)
return $item;
}

global $module;
global $xoopsModule;
/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

if ('category' === $category) {
// Assume we have a valid category id
$sql = 'SELECT name, short_url FROM ' . $GLOBALS['xoopsDB']->prefix($module->getVar('dirname', 'n') . '_categories') . ' WHERE categoryid = ' . $itemId;
$sql = 'SELECT name, short_url FROM ' . $GLOBALS['xoopsDB']->prefix($helper->getDirname() . '_categories') . ' WHERE categoryid = ' . $itemId;
$result = $GLOBALS['xoopsDB']->query($sql); // TODO: error check
$resultArray = $GLOBALS['xoopsDB']->fetchArray($result);
$item['name'] = $resultArray['name'];
Expand All @@ -54,7 +57,7 @@ function publisher_notify_iteminfo($category, $itemId)

if ('item' === $category) {
// Assume we have a valid story id
$sql = 'SELECT title, short_url FROM ' . $GLOBALS['xoopsDB']->prefix($module->getVar('dirname', 'n') . '_items') . ' WHERE itemid = ' . $itemId;
$sql = 'SELECT title, short_url FROM ' . $GLOBALS['xoopsDB']->prefix($helper->getDirname() . '_items') . ' WHERE itemid = ' . $itemId;
$result = $GLOBALS['xoopsDB']->query($sql); // TODO: error check
$resultArray = $GLOBALS['xoopsDB']->fetchArray($result);
$item['name'] = $resultArray['title'];
Expand Down
3 changes: 2 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@

// Hide sub categories in main page only - hacked by Mowaffak
if ('nomain' === $helper->getConfig('idxcat_show_subcats')) {
$helper->setConfig('idxcat_show_subcats', 'no');
// $GLOBALS['xoopsModuleConfig']->setConfig('idxcat_show_subcats', 'no');
$GLOBALS['xoopsModuleConfig']['idxcat_show_subcats'] = 'no';
}

$categories = [];
Expand Down
12 changes: 5 additions & 7 deletions item.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
// exit();
}

/** @var Publisher\Helper $helper */
$helper = Publisher\Helper::getInstance();

// Creating the item object for the selected item
$itemObj = $helper->getHandler('Item')->get($itemId);

Expand All @@ -52,6 +55,7 @@
//$xoTheme->addStylesheet(PUBLISHER_URL . '/assets/css/jquery.popeye.style.css');
//$xoTheme->addStylesheet(PUBLISHER_URL . '/assets/css/publisher.css');


require_once PUBLISHER_ROOT_PATH . '/footer.php';

// Creating the category object that holds the selected item
Expand Down Expand Up @@ -259,10 +263,4 @@
}

$xoopsTpl->assign('item', $item);
require_once $GLOBALS['xoops']->path('footer.php');
?>
<!--<script type="text/javascript">-->
<!-- $(document).ready(function () {-->
<!-- $("img").addClass("img-responsive");-->
<!-- });-->
<!--</script>-->
require_once XOOPS_ROOT_PATH . '/footer.php';
9 changes: 9 additions & 0 deletions language/english/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,12 @@
define('CO_' . $moduleDirNameUpper . '_DISCLAIMER', 'Disclaimer');
define('CO_' . $moduleDirNameUpper . '_LICENSE', 'License');
define('CO_' . $moduleDirNameUpper . '_SUPPORT', 'Support');


//Sample Data
define('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA', 'Add Sample Data (will delete ALL current data)');
define('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS', 'Sample Date uploaded successfully');
define('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA', 'Export Tables to YAML');
define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', 'Show Sample Button?');
define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.');

1 change: 0 additions & 1 deletion makepdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
error_reporting(E_ALL);

require_once __DIR__ . '/header.php';
$helper = Publisher\Helper::getInstance();

$itemid = Request::getInt('itemid', 0, 'GET');
$item_page_id = Request::getInt('page', -1, 'GET');
Expand Down
Loading

0 comments on commit 2b16251

Please sign in to comment.