Skip to content

Commit 64fa916

Browse files
authored
Merge pull request #19 from mambax7/master
updates
2 parents 090462c + 8feefe9 commit 64fa916

12 files changed

Lines changed: 24 additions & 31 deletions

File tree

admin/admin.tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
$msgDBUpdated = '';
5252
foreach ($postTags as $tag => $tag_status) {
5353
$tag_obj = $tagHandler->get($tag);
54-
if (!($tag_obj instanceof Tag) || !$tag_obj->getVar('tag_id')) {
54+
if (!($tag_obj instanceof Tag\Tag) || !$tag_obj->getVar('tag_id')) {
5555
continue;
5656
}
5757
if ($tag_status < Constants::STATUS_ACTIVE) {

admin/syn.tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
$criteria->add(new \Criteria('l.tag_modid', $modid));
9393
}
9494
$tags = &$tagHandler->getByLimit(0, 0, $criteria, null, false);
95-
if (empty($tags) && count($tags) > 0) {
95+
if ($tags && is_array($tags)) {
9696
foreach (array_keys($tags) as $tag_id) {
9797
$tagHandler->update_stats($tag_id, (-1 == $modid) ? Constants::DEFAULT_ID : $tags[$tag_id]['modid']);
9898
}

blocks/block.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function tag_block_cloud_show($options, $dirname = '', $catid = 0)
157157
if (!empty($modid)) {
158158
/** @var \XoopsModuleHandler $moduleHandler */
159159
$moduleHandler = xoops_getHandler('module');
160-
if ($module_obj = $moduleHandler->get($modid)) {
160+
if (false !== ($module_obj = $moduleHandler->get($modid))) {
161161
$block['tag_dirname'] = $module_obj->getVar('dirname');
162162
}
163163
}
@@ -309,7 +309,7 @@ function tag_block_top_show($options, $dirname = '', $catid = 0)
309309
if (!empty($modid)) {
310310
/** @var \XoopsModuleHandler $moduleHandler */
311311
$moduleHandler = xoops_getHandler('module');
312-
if ($module_obj = $moduleHandler->get($modid)) {
312+
if (false !== ($module_obj = $moduleHandler->get($modid))) {
313313
$block['tag_dirname'] = $module_obj->getVar('dirname');
314314
}
315315
}
@@ -447,7 +447,7 @@ function tag_block_cumulus_show(array $options, $dirname = '', $catid = 0)
447447
if (!empty($modid)) {
448448
/** @var \XoopsModuleHandler $moduleHandler */
449449
$moduleHandler = xoops_getHandler('module');
450-
if ($module_obj = $moduleHandler->get($modid)) {
450+
if (false !== ($module_obj = $moduleHandler->get($modid))) {
451451
$block['tag_dirname'] = $module_obj->getVar('dirname');
452452
}
453453
}

class/Common/ServerStats.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static function getServerStats()
5555
$html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n";
5656
$html .= "<ul>\n";
5757

58-
$gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>';
58+
$gdlib = function_exists('gd_info') ? '<span style="color: #008000;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: #ff0000;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>';
5959
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib;
6060
if (function_exists('gd_info')) {
6161
if (true === ($gdlib = gd_info())) {
@@ -69,12 +69,12 @@ public static function getServerStats()
6969
// $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>';
7070
// $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals;
7171
//
72-
$downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>';
72+
$downloads = ini_get('file_uploads') ? '<span style="color: #008000;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: #ff0000;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>';
7373
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads;
7474

75-
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n";
76-
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n";
77-
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n";
75+
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: #0000ff;">' . ini_get('upload_max_filesize') . "</span></b>\n";
76+
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: #0000ff;">' . ini_get('post_max_size') . "</span></b>\n";
77+
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: #0000ff;">' . ini_get('memory_limit') . "</span></b>\n";
7878
$html .= "</ul>\n";
7979
$html .= "<ul>\n";
8080
$html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n";

class/FormTag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct($name, $size, $maxlength, $value = null, $catid = 0)
4949
}
5050
$value = empty($value) ? '' : $value;
5151
// itemid
52-
if (!empty($value) && is_numeric($value) && ($GLOBALS['xoopsModule'] instanceof XoopsModule)) {
52+
if (!empty($value) && is_numeric($value) && ($GLOBALS['xoopsModule'] instanceof \XoopsModule)) {
5353
$modid = $GLOBALS['xoopsModule']->getVar('mid');
5454
/** @var \XoopsModules\Tag\TagHandler $tagHandler */
5555
$tagHandler = Tag\Helper::getInstance()->getHandler('Tag'); // xoops_getModuleHandler('tag', 'tag');
@@ -72,7 +72,7 @@ public function render()
7272
{
7373
$delimiters = tag_get_delimiter();
7474
foreach (array_keys($delimiters) as $key) {
75-
$delimiters[$key] = "<em style='font-weight: bold; color: red; font-style: normal;'>" . htmlspecialchars($delimiters[$key], ENT_QUOTES | ENT_HTML5) . '</em>';
75+
$delimiters[$key] = "<em style='font-weight: bold; color: #ff0000; font-style: normal;'>" . htmlspecialchars($delimiters[$key], ENT_QUOTES | ENT_HTML5) . '</em>';
7676
}
7777
$render = "<input type='text' name='" . $this->getName() . "' id='" . $this->getName() . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . $this->getValue() . "' " . $this->getExtra() . '>';
7878
$render .= '<br>' . _MD_TAG_TAG_DELIMITER . ': [' . implode('], [', $delimiters) . ']';

class/TagHandler.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function updateByItem($tags, $itemid, $modid = '', $catid = 0)
105105
$moduleHandler = xoops_getHandler('module');
106106
$modid = ($module_obj = $moduleHandler->getByDirname($modid)) ? $module_obj->getVar('mid') : 0;
107107
}
108-
} elseif ($GLOBALS['xoopsModule'] instanceof XoopsModule) {
108+
} elseif ($GLOBALS['xoopsModule'] instanceof \XoopsModule) {
109109
$modid = $GLOBALS['xoopsModule']->getVar('mid');
110110
}
111111

@@ -195,6 +195,7 @@ public function updateByItem($tags, $itemid, $modid = '', $catid = 0)
195195
public function update_stats($tag_id, $modid = 0, $catid = 0)
196196
{
197197
$tag_id = (int)$tag_id;
198+
$tag_count = [];
198199
if (empty($tag_id)) {
199200
return true;
200201
}
@@ -273,7 +274,7 @@ public function &getByLimit(
273274
$start = null;
274275
$sort = '';
275276
$order = '';
276-
if (null !== $criteria && is_subclass_of($criteria, 'CriteriaCompo')) {
277+
if (null !== $criteria && $criteria instanceof \CriteriaCompo) {
277278
$sql .= ' ' . $criteria->renderWhere();
278279
$sort = $criteria->getSort();
279280
$order = $criteria->getOrder();
@@ -336,7 +337,7 @@ public function getCount(\CriteriaElement $criteria = null)
336337
$modid = (int)($modid);
337338
*/
338339
$sql = "SELECT COUNT(DISTINCT o.{$this->keyName})" . " FROM {$this->table} AS o LEFT JOIN {$this->table_link} AS l ON l.{$this->keyName} = o.{$this->keyName}";
339-
if ((null !== $criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
340+
if ((null !== $criteria) && $criteria instanceof \CriteriaElement) {
340341
$sql .= ' ' . $criteria->renderWhere();
341342
}
342343
/*
@@ -377,7 +378,7 @@ public function getItems(\CriteriaElement $criteria = null)
377378
$start = null;
378379
$sort = '';
379380
$order = '';
380-
if ((null !== $criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
381+
if ((null !== $criteria) && $criteria instanceof \CriteriaElement) {
381382
$sql .= ' ' . $criteria->renderWhere();
382383
$sort = $criteria->getSort();
383384
$order = $criteria->getOrder();

include/action.module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function xoops_module_pre_install_tag(\XoopsModule $module)
4949
$success = true;
5050
}
5151

52-
if (false === $success) {
52+
if (!$success) {
5353
$module->setErrors("This module requires XOOPS {$requiredVer}+ ({$currentVer} installed)");
5454

5555
return false;

include/functions.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,10 @@ function tag_getTagHandler()
5757
/**
5858
* Function to parse arguments for a page according to $_SERVER['REQUEST_URI']
5959
*
60-
* @var array $args_numeric array of numeric variable values
61-
* @var array $args array of indexed variables: name and value
62-
* @var array $args_string array of string variable values
6360
*
64-
* @param mixed $args_numeric
65-
* @param mixed $args
66-
* @param mixed $args_string
61+
* @param mixed $args_numeric array of numeric variable values
62+
* @param mixed $args array of indexed variables: name and value
63+
* @param mixed $args_string array of string variable values
6764
* @return bool true on args parsed
6865
*/
6966

include/onupdate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function xoops_module_update_tag(\XoopsModule $module, $previousVersion = null)
111111
// foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
112112
foreach (array_keys($configurator->oldFolders) as $i) {
113113
$tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]);
114-
/* @var $folderHandler XoopsObjectHandler */
114+
/* @var XoopsObjectHandler $folderHandler */
115115
$folderHandler = XoopsFile::getHandler('folder', $tempFolder);
116116
$folderHandler->delete($tempFolder);
117117
}

plugin/myalbum0.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@
3030
* uname
3131
* tags
3232
*
33-
* @var array $items associative array of items: [modid][catid][itemid]
3433
*
35-
*
36-
* @param mixed $items
34+
* @param mixed $items associative array of items: [modid][catid][itemid]
3735
* @return bool
3836
*/
3937
function myalbum0_tag_iteminfo(&$items)

0 commit comments

Comments
 (0)