From e54f1bdac6a3f72ee769619402c4a8333f5b89ee Mon Sep 17 00:00:00 2001 From: mambax7 Date: Mon, 6 Jul 2020 06:05:21 -0400 Subject: [PATCH] camelCase --- admin/blockform.php | 42 +++++++++--------- admin/blocksadmin.php | 44 +++++++++---------- admin/category.php | 46 ++++++++++---------- admin/feedback.php | 8 ++-- admin/file.php | 12 +++--- admin/import/ams.php | 22 +++++----- admin/import/fmcontent.php | 20 ++++----- admin/import/news.php | 18 ++++---- admin/import/smartsection.php | 18 ++++---- admin/import/wfsection.php | 18 ++++---- admin/import/xfsection.php | 18 ++++---- admin/import/xnews.php | 22 +++++----- admin/item.php | 74 ++++++++++++++++---------------- admin/main.php | 16 +++---- admin/preferences.php | 20 +++++---- admin/trellostatus.php | 10 +++++ author_items.php | 6 +-- backend.php | 18 ++++---- blocks/items_columns.php | 4 +- blocks/items_menu.php | 8 ++-- blocks/latest_news.php | 2 +- category.php | 49 ++++++++++----------- class/Category.php | 2 +- class/Common/Meta.php | 14 +++--- class/Common/ModuleFeedback.php | 6 +-- class/Common/SysUtility.php | 50 +++++++++++----------- class/File.php | 4 +- class/FileHandler.php | 8 ++-- class/Form/CategoryForm.php | 16 +++---- class/Form/ItemForm.php | 4 +- class/Item.php | 22 +++++----- class/ItemHandler.php | 64 +++++++++++++-------------- class/MimetypeHandler.php | 6 +-- class/Resizer.php | 34 +++++++-------- class/Utility.php | 2 +- docs/ajaxrating.txt | 2 +- file.php | 6 +-- include/ajax_rating.php | 76 ++++++++++++++++----------------- include/ajax_upload.php | 18 ++++---- include/plugin.tag.php | 18 ++++---- index.php | 14 +++--- makepdf.php | 10 ++--- print.php | 6 +-- rate.php | 26 +++++------ search.php | 6 +-- submit.php | 12 +++--- templates/publisher_rss.tpl | 2 +- thumb.php | 36 ++++++++-------- 48 files changed, 487 insertions(+), 472 deletions(-) create mode 100644 admin/trellostatus.php diff --git a/admin/blockform.php b/admin/blockform.php index e8cca8b6..736b6147 100644 --- a/admin/blockform.php +++ b/admin/blockform.php @@ -24,8 +24,8 @@ if (isset($block['name'])) { $form->addElement(new \XoopsFormLabel(_AM_SYSTEM_BLOCKS_NAME, $block['name'])); } -$side_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'bside', $block['side']); -$side_select->addOptionArray( +$sideSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_TYPE, 'bside', $block['side']); +$sideSelect->addOptionArray( [ 0 => _AM_SYSTEM_BLOCKS_SBLEFT, 1 => _AM_SYSTEM_BLOCKS_SBRIGHT, @@ -37,27 +37,27 @@ 9 => _AM_SYSTEM_BLOCKS_CBBOTTOM, ] ); -$form->addElement($side_select); +$form->addElement($sideSelect); $form->addElement(new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight'])); $form->addElement(new \XoopsFormRadioYN(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible'])); -$mod_select = new \XoopsFormSelect(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); +$moduleSelect = new \XoopsFormSelect(constant('CO_' . $moduleDirNameUpper . '_' . 'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); /** @var \XoopsModuleHandler $moduleHandler */ $moduleHandler = xoops_getHandler('module'); $criteria = new \CriteriaCompo(new \Criteria('hasmain', 1)); $criteria->add(new \Criteria('isactive', 1)); -$module_list = $moduleHandler->getList($criteria); -$module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; -$module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; -ksort($module_list); -$mod_select->addOptionArray($module_list); -$form->addElement($mod_select); +$moduleList = $moduleHandler->getList($criteria); +$moduleList[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; +$moduleList[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; +ksort($moduleList); +$moduleSelect->addOptionArray($moduleList); +$form->addElement($moduleSelect); $form->addElement(new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'TITLE'), 'btitle', 50, 255, $block['title']), false); if ($block['is_custom']) { $textarea = new \XoopsFormDhtmlTextArea(_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70); $textarea->setDescription('' . _AM_SYSTEM_BLOCKS_USEFULTAGS . '
' . sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . ''); $form->addElement($textarea, true); - $ctype_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); - $ctype_select->addOptionArray( + $ctypeSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); + $ctypeSelect->addOptionArray( [ 'H' => _AM_SYSTEM_BLOCKS_HTML, 'P' => _AM_SYSTEM_BLOCKS_PHP, @@ -65,7 +65,7 @@ 'T' => _AM_SYSTEM_BLOCKS_AFNOSMILE, ] ); - $form->addElement($ctype_select); + $form->addElement($ctypeSelect); } else { if ('' !== $block['template']) { /** @var \XoopsTplfileHandler $tplfileHandler */ @@ -84,8 +84,8 @@ $form->addElement(new \XoopsFormLabel(_AM_SYSTEM_BLOCKS_OPTIONS, $block['edit_form'])); } } -$cache_select = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']); -$cache_select->addOptionArray( +$cacheSelect = new \XoopsFormSelect(_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']); +$cacheSelect->addOptionArray( [ '0' => _NOCACHE, '30' => sprintf(_SECONDS, 30), @@ -100,7 +100,7 @@ '2592000' => _MONTH, ] ); -$form->addElement($cache_select); +$form->addElement($cacheSelect); /** @var \XoopsGroupPermHandler $grouppermHandler */ $grouppermHandler = xoops_getHandler('groupperm'); @@ -120,11 +120,11 @@ //Submit buttons $buttonTray = new \XoopsFormElementTray('', ''); -$submit_button = new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'); -$buttonTray->addElement($submit_button); +$submitButton = new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit'); +$buttonTray->addElement($submitButton); -$cancel_button = new \XoopsFormButton('', '', _CANCEL, 'button'); -$cancel_button->setExtra('onclick="history.go(-1)"'); -$buttonTray->addElement($cancel_button); +$cancelButton = new \XoopsFormButton('', '', _CANCEL, 'button'); +$cancelButton->setExtra('onclick="history.go(-1)"'); +$buttonTray->addElement($cancelButton); $form->addElement($buttonTray); diff --git a/admin/blocksadmin.php b/admin/blocksadmin.php index 64df8f16..4388436e 100644 --- a/admin/blocksadmin.php +++ b/admin/blocksadmin.php @@ -75,10 +75,10 @@ function listBlocks() $groups = $memberHandler->getGroups(); $criteria = new \CriteriaCompo(new \Criteria('hasmain', 1)); $criteria->add(new \Criteria('isactive', 1)); - $module_list = $moduleHandler->getList($criteria); - $module_list[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; - $module_list[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; - ksort($module_list); + $moduleList = $moduleHandler->getList($criteria); + $moduleList[-1] = _AM_SYSTEM_BLOCKS_TOPPAGE; + $moduleList[0] = _AM_SYSTEM_BLOCKS_ALLPAGES; + ksort($moduleList); echo "

" . constant('CO_' . $moduleDirNameUpper . '_' . 'BADMIN') . '

'; // $moduleHandler = xoops_getHandler('module'); @@ -111,8 +111,8 @@ function listBlocks() . constant('CO_' . $moduleDirNameUpper . '_' . 'ACTION') . ' '; - $block_arr = \XoopsBlock::getByModule($xoopsModule->mid()); - $block_count = count($block_arr); + $blockArray = \XoopsBlock::getByModule($xoopsModule->mid()); + $blockCount = count($blockArray); $class = 'even'; $cachetimes = [ '0' => _NOCACHE, @@ -127,8 +127,8 @@ function listBlocks() '604800' => _WEEK, '2592000' => _MONTH, ]; - foreach ($block_arr as $i) { - $groups_perms = $grouppermHandler->getGroupIds('block_read', $i->getVar('bid')); + foreach ($blockArray as $i) { + $groupsPerms = $grouppermHandler->getGroupIds('block_read', $i->getVar('bid')); $sql = 'SELECT module_id FROM ' . $db->prefix('block_module_link') . ' WHERE block_id=' . $i->getVar('bid'); $result = $db->query($sql); $modules = []; @@ -136,12 +136,12 @@ function listBlocks() $modules[] = (int)$row['module_id']; } - $cachetime_options = ''; - foreach ($cachetimes as $cachetime => $cachetime_name) { + $cachetimeOptions = ''; + foreach ($cachetimes as $cachetime => $cachetimeName) { if ($i->getVar('bcachetime') == $cachetime) { - $cachetime_options .= "\n"; + $cachetimeOptions .= "\n"; } else { - $cachetime_options .= "\n"; + $cachetimeOptions .= "\n"; } } @@ -240,19 +240,19 @@ function listBlocks() . ''; echo "'; echo "'; // Cache lifetime - echo ' + echo ' '; // Actions @@ -313,7 +313,7 @@ function cloneBlock($bid) while (false !== ($row = $db->fetchArray($result))) { $modules[] = (int)$row['module_id']; } - $is_custom = ('C' === $myblock->getVar('block_type') || 'E' === $myblock->getVar('block_type')); + $isCustom = ('C' === $myblock->getVar('block_type') || 'E' === $myblock->getVar('block_type')); $block = [ 'title' => $myblock->getVar('title') . ' Clone', 'form_title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_CLONEBLOCK'), @@ -323,7 +323,7 @@ function cloneBlock($bid) 'visible' => $myblock->getVar('visible'), 'content' => $myblock->getVar('content', 'N'), 'modules' => $modules, - 'is_custom' => $is_custom, + 'is_custom' => $isCustom, 'ctype' => $myblock->getVar('c_type'), 'bcachetime' => $myblock->getVar('bcachetime'), 'op' => 'clone_ok', @@ -456,7 +456,7 @@ function editBlock($bid) while (false !== ($row = $db->fetchArray($result))) { $modules[] = (int)$row['module_id']; } - $is_custom = ('C' === $myblock->getVar('block_type') || 'E' === $myblock->getVar('block_type')); + $isCustom = ('C' === $myblock->getVar('block_type') || 'E' === $myblock->getVar('block_type')); $block = [ 'title' => $myblock->getVar('title'), 'form_title' => constant('CO_' . $moduleDirNameUpper . '_' . 'BLOCKS_EDITBLOCK'), @@ -466,7 +466,7 @@ function editBlock($bid) 'visible' => $myblock->getVar('visible'), 'content' => $myblock->getVar('content', 'N'), 'modules' => $modules, - 'is_custom' => $is_custom, + 'is_custom' => $isCustom, 'ctype' => $myblock->getVar('c_type'), 'bcachetime' => $myblock->getVar('bcachetime'), 'op' => 'edit_ok', @@ -506,10 +506,10 @@ function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $b $myblock->setVar('bcachetime', $bcachetime); //update block options if (isset($options)) { - $options_count = count($options); - if ($options_count > 0) { + $optionsCount = count($options); + if ($optionsCount > 0) { //Convert array values to comma-separated - for ($i = 0; $i < $options_count; ++$i) { + for ($i = 0; $i < $optionsCount; ++$i) { if (is_array($options[$i])) { $options[$i] = implode(',', $options[$i]); } diff --git a/admin/category.php b/admin/category.php index ba72561d..59d77c46 100644 --- a/admin/category.php +++ b/admin/category.php @@ -32,11 +32,11 @@ // Where do we start ? $startcategory = Request::getInt('startcategory', 0, 'GET'); -$categoryid = Request::getInt('categoryid', null); +$categoryId = Request::getInt('categoryid', null); switch ($op) { case 'del': - $categoryObj = $helper->getHandler('Category')->get($categoryid); + $categoryObj = $helper->getHandler('Category')->get($categoryId); $confirm = Request::getString('confirm', '', 'POST'); $name = Request::getString('name', '', 'POST'); if ($confirm) { @@ -52,19 +52,19 @@ break; case 'mod': //Added by fx2024 - $nb_subcats = Request::getInt('nb_subcats', 0, 'POST'); - $nb_subcats += Request::getInt('nb_sub_yet', 4, 'POST'); + $numberSubcats = Request::getInt('nb_subcats', 0, 'POST'); + $numberSubcats += Request::getInt('nb_sub_yet', 4, 'POST'); //end of fx2024 code Utility::cpHeader(); - Utility::editCategory(true, $categoryid, $nb_subcats); + Utility::editCategory(true, $categoryId, $numberSubcats); break; case 'addcategory': global $modify; $parentid = Request::getInt('parentid'); - if (0 != $categoryid) { - $categoryObj = $helper->getHandler('Category')->get($categoryid); + if (0 != $categoryId) { + $categoryObj = $helper->getHandler('Category')->get($categoryId); } else { $categoryObj = $helper->getHandler('Category')->create(); } @@ -72,23 +72,23 @@ // Uploading the image, if any // Retreive the filename to be uploaded $temp = Request::getArray('image_file', '', 'FILES'); - $image_file = $temp['name']; - if ($image_file) { + $imageFile = $temp['name']; + if ($imageFile) { // $filename = Request::getArray('xoops_upload_file', array(), 'POST')[0]; $temp2 = Request::getArray('xoops_upload_file', [], 'POST'); $filename = $temp2[0]; if ($filename) { // TODO : implement publisher mimetype management - $max_size = $helper->getConfig('maximum_filesize'); - $max_imgwidth = $helper->getConfig('maximum_image_width'); - $max_imgheight = $helper->getConfig('maximum_image_height'); - $allowed_mimetypes = Utility::getAllowedImagesTypes(); + $maxSize = $helper->getConfig('maximum_filesize'); + $maxImageWidth = $helper->getConfig('maximum_image_width'); + $maxImageHeight = $helper->getConfig('maximum_image_height'); + $allowedMimetypes = Utility::getAllowedImagesTypes(); if (('' == $temp['tmp_name']) || !is_readable($temp['tmp_name'])) { redirect_header('', 2, _AM_PUBLISHER_FILEUPLOAD_ERROR); } xoops_load('XoopsMediaUploader'); - $uploader = new \XoopsMediaUploader(Utility::getImageDir('category'), $allowed_mimetypes, $max_size, $max_imgwidth, $max_imgheight); + $uploader = new \XoopsMediaUploader(Utility::getImageDir('category'), $allowedMimetypes, $maxSize, $maxImageWidth, $maxImageHeight); if ($uploader->fetchMedia($filename) && $uploader->upload()) { $categoryObj->setVar('image', $uploader->getSavedFileName()); } else { @@ -120,11 +120,11 @@ $categoryObj->setVar('header', Request::getText('header', '', 'POST')); if ($categoryObj->isNew()) { - $redirect_msg = _AM_PUBLISHER_CATCREATED; - $redirect_to = 'category.php?op=mod'; + $redirectMsg = _AM_PUBLISHER_CATCREATED; + $redirectTo = 'category.php?op=mod'; } else { - $redirect_msg = _AM_PUBLISHER_COLMODIFIED; - $redirect_to = 'category.php'; + $redirectMsg = _AM_PUBLISHER_COLMODIFIED; + $redirectTo = 'category.php'; } if (!$categoryObj->store()) { @@ -156,13 +156,13 @@ } } //end of fx2024 code - redirect_header($redirect_to, 2, $redirect_msg); + redirect_header($redirectTo, 2, $redirectMsg); break; //Added by fx2024 case 'addsubcats': - $categoryid = 0; - $nb_subcats = Request::getInt('nb_subcats', 0, 'POST') + Request::getInt('nb_sub_yet', 0, 'POST'); + $categoryId = 0; + $numberSubcats = Request::getInt('nb_subcats', 0, 'POST') + Request::getInt('nb_sub_yet', 0, 'POST'); $categoryObj = $helper->getHandler('Category')->create(); $categoryObj->setVar('name', Request::getString('name', '', 'POST')); @@ -173,7 +173,7 @@ } Utility::cpHeader(); - Utility::editCategory(true, $categoryid, $nb_subcats, $categoryObj); + Utility::editCategory(true, $categoryId, $numberSubcats, $categoryObj); exit(); break; //end of fx2024 code @@ -214,7 +214,7 @@ echo ''; echo "" . _AM_PUBLISHER_NOCAT . ''; echo ''; - $categoryid = '0'; + $categoryId = '0'; } echo "\n"; require_once $GLOBALS['xoops']->path('class/pagenav.php'); diff --git a/admin/feedback.php b/admin/feedback.php index 00d78f53..63dbfb6f 100644 --- a/admin/feedback.php +++ b/admin/feedback.php @@ -58,14 +58,14 @@ $your_name = Request::getString('your_name', ''); $your_site = Request::getString('your_site', ''); - $your_mail = Request::getString('your_mail', ''); + $yourMail = Request::getString('your_mail', ''); $fb_type = Request::getString('fb_type', ''); $fb_content = Request::getText('fb_content', ''); $fb_content = str_replace(["\r\n", "\n", "\r"], '
', $fb_content); //clean line break from dhtmltextarea $title = constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_FOR') . $GLOBALS['xoopsModule']->getVar('dirname'); $body = constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME') . ': ' . $your_name . '
'; - $body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL') . ': ' . $your_mail . '
'; + $body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL') . ': ' . $yourMail . '
'; $body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE') . ': ' . $your_site . '
'; $body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE') . ': ' . $fb_type . '

'; $body .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT') . ':
'; @@ -73,7 +73,7 @@ $xoopsMailer = xoops_getMailer(); $xoopsMailer->useMail(); $xoopsMailer->setToEmails($GLOBALS['xoopsModule']->getInfo('author_mail')); - $xoopsMailer->setFromEmail($your_mail); + $xoopsMailer->setFromEmail($yourMail); $xoopsMailer->setFromName($your_name); $xoopsMailer->setSubject($title); $xoopsMailer->multimailer->isHTML(true); @@ -85,7 +85,7 @@ // show form with content again $feedback->name = $your_name; - $feedback->email = $your_mail; + $feedback->email = $yourMail; $feedback->site = $your_site; $feedback->type = $fb_type; $feedback->content = $fb_content; diff --git a/admin/file.php b/admin/file.php index be8bc504..b350ef6a 100644 --- a/admin/file.php +++ b/admin/file.php @@ -31,9 +31,9 @@ /** * @param bool $showmenu * @param int $fileid - * @param int $itemid + * @param int $itemId */ -function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0) +function publisher_editFile($showmenu = false, $fileid = 0, $itemId = 0) { $helper = Helper::getInstance(); require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); @@ -55,7 +55,7 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0) } else { // there's no parameter, so we're adding an item $fileObj = $helper->getHandler('File')->create(); - $fileObj->setVar('itemid', $itemid); + $fileObj->setVar('itemid', $itemId); echo "" . _AM_PUBLISHER_FILE_ADDING . ''; echo '' . _AM_PUBLISHER_FILE_ADDING_DSC . ''; Utility::openCollapsableBar('addfile', 'addfileicon', _AM_PUBLISHER_FILE_INFORMATIONS); @@ -86,15 +86,15 @@ function publisher_editFile($showmenu = false, $fileid = 0, $itemid = 0) break; case 'mod': $fileid = Request::getInt('fileid', 0, 'GET'); - $itemid = Request::getInt('itemid', 0, 'GET'); - if ((0 == $fileid) && (0 == $itemid)) { + $itemId = Request::getInt('itemid', 0, 'GET'); + if ((0 == $fileid) && (0 == $itemId)) { redirect_header('', 3, _AM_PUBLISHER_NOITEMSELECTED); } Utility::cpHeader(); require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); - publisher_editFile(true, $fileid, $itemid); + publisher_editFile(true, $fileid, $itemId); break; case 'modify': $fileid = Request::getInt('fileid', 0, 'POST'); diff --git a/admin/import/ams.php b/admin/import/ams.php index b7025300..b38aff2e 100644 --- a/admin/import/ams.php +++ b/admin/import/ams.php @@ -126,16 +126,16 @@ $sql = 'SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM ' . $GLOBALS['xoopsDB']->prefix('ams_topics') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('nw_stories') . ' AS art ON cat.topic_id=art.topicid GROUP BY art.topicid'; $result = $GLOBALS['xoopsDB']->query($sql); - $cat_cbox_options = []; + $catCboxOptions = []; - while (list($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result)) { - $cat_title = $myts->displayTarea($cat_title); - $cat_cbox_options[$cid] = "$cat_title ($art_count)"; + while (list($cid, $pid, $catTitle, $articleCount) = $GLOBALS['xoopsDB']->fetchRow($result)) { + $catTitle = $myts->displayTarea($catTitle); + $catCboxOptions[$cid] = "$catTitle ($articleCount)"; } - $cat_label = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); - $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); - $form->addElement($cat_label); + $catLabel = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $catCboxOptions)); + $catLabel->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); + $form->addElement($catLabel); // Publisher parent category $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix($helper->getModule()->dirname() . '_categories'), 'categoryid', 'parentid'); @@ -241,13 +241,13 @@ $imageHandler = xoops_getHandler('image'); $image = $imageHandler->create(); $image->setVar('image_name', $arrCat['topic_imgurl']);//'images/' . $uploader->getSavedFileName()); - $image->setVar('image_nicename', mb_substr($arrCat['topic_imgurl'],-13)); //$image_nicename); + $image->setVar('image_nicename', mb_substr($arrCat['topic_imgurl'],-13)); //$imageNiceName); $image->setVar('image_mimetype', 'image/'. mb_substr($arrCat['topic_imgurl'],-3));//$uploader->getMediaType()); // $image->setVar('image_created', time()); // $image_display = empty($image_display) ? 0 : 1; $image->setVar('image_display', 1); //$image_display); $image->setVar('image_weight', 0);//$image_weight); - $image->setVar('imgcat_id', $newid );//$imgcat_id); + $image->setVar('imgcat_id', $newid );//$imgcatId); if (!$imageHandler->insert($image)) { $err[] = sprintf(_FAILSAVEIMG, $image->getVar('image_nicename')); } @@ -353,7 +353,7 @@ // Linkes files $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('ams_article_files') . ' WHERE storyid=' . $arrArticle['storyid']; $resultFiles = $GLOBALS['xoopsDB']->query($sql); - $allowed_mimetypes = ''; + $allowedMimetypes = ''; while (false !== ($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles))) { $filename = $GLOBALS['xoops']->path('uploads/AMS/attached/' . $arrFile['downloadname']); if (file_exists($filename)) { @@ -371,7 +371,7 @@ $fileObj->setVar('filename', $arrFile['filerealname']); $fileObj->setVar('short_url', $arrFile['filerealname']); - if ($fileObj->store($allowed_mimetypes, true, false)) { + if ($fileObj->store($allowedMimetypes, true, false)) { echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } diff --git a/admin/import/fmcontent.php b/admin/import/fmcontent.php index d555e2b9..ef2b3c9d 100644 --- a/admin/import/fmcontent.php +++ b/admin/import/fmcontent.php @@ -72,11 +72,11 @@ . " AS art ON ((cat.topic_id=art.content_topic) AND (cat.topic_modid=art.content_modid)) WHERE cat.topic_modid={$fm_module_id} GROUP BY art.content_topic"; $result = $GLOBALS['xoopsDB']->query($sql); - $cat_cbox_options = []; + $catCboxOptions = []; - while (list($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result)) { - $cat_title = $myts->displayTarea($cat_title); - $cat_cbox_options[$cid] = "{$cat_title} ($art_count)"; + while (list($cid, $pid, $catTitle, $articleCount) = $GLOBALS['xoopsDB']->fetchRow($result)) { + $catTitle = $myts->displayTarea($catTitle); + $catCboxOptions[$cid] = "{$catTitle} ($articleCount)"; } // now get articles in the top level category (content_topic=0) $criteria = new \CriteriaCompo(); @@ -84,16 +84,16 @@ $criteria->add(new \Criteria('content_topic', 0)); $cnt_tla_contents = $fmContentHdlr->getCount($criteria); if ($cnt_tla_contents) { - $cat_cbox_options[0] = _AM_PUBLISHER_IMPORT_FMCONTENT_NAME . " ({$cnt_tla_contents})"; + $catCboxOptions[0] = _AM_PUBLISHER_IMPORT_FMCONTENT_NAME . " ({$cnt_tla_contents})"; } - natcasesort($cat_cbox_options); //put them in "alphabetical" order + natcasesort($catCboxOptions); //put them in "alphabetical" order - echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $fmContentCount, count($cat_cbox_options)) . ''; + echo "" . sprintf(_AM_PUBLISHER_IMPORT_MODULE_FOUND, $importFromModuleName, $fmContentCount, count($catCboxOptions)) . ''; $form = new \XoopsThemeForm(_AM_PUBLISHER_IMPORT_SETTINGS, 'import_form', PUBLISHER_ADMIN_URL . "/import/$scriptname"); - $cat_label = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); - $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); - $form->addElement($cat_label); + $catLabel = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $catCboxOptions)); + $catLabel->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); + $form->addElement($catLabel); // Publisher parent category xoops_load('tree'); diff --git a/admin/import/news.php b/admin/import/news.php index f153b937..3b4eb8d0 100644 --- a/admin/import/news.php +++ b/admin/import/news.php @@ -63,16 +63,16 @@ $sql = 'SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM ' . $GLOBALS['xoopsDB']->prefix('news_topics') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('news_stories') . ' AS art ON cat.topic_id=art.topicid GROUP BY art.topicid'; $result = $GLOBALS['xoopsDB']->query($sql); - $cat_cbox_options = []; + $catCboxOptions = []; - while (list($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result)) { - $cat_title = $myts->displayTarea($cat_title); - $cat_cbox_options[$cid] = "$cat_title ($art_count)"; + while (list($cid, $pid, $catTitle, $articleCount) = $GLOBALS['xoopsDB']->fetchRow($result)) { + $catTitle = $myts->displayTarea($catTitle); + $catCboxOptions[$cid] = "$catTitle ($articleCount)"; } - $cat_label = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); - $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); - $form->addElement($cat_label); + $catLabel = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $catCboxOptions)); + $catLabel->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); + $form->addElement($catLabel); // Publisher parent category $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix($helper->getModule()->getVar('dirname', 'n') . '_categories'), 'categoryid', 'parentid'); @@ -199,7 +199,7 @@ // Linkes files $sql = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('wfs_files').' WHERE articleid=' . $arrArticle['articleid']; $resultFiles = $GLOBALS['xoopsDB']->query ($sql); - $allowed_mimetypes = ''; + $allowedMimetypes = ''; while (false !== ($arrFile = $GLOBALS['xoopsDB']->fetchArray ($resultFiles))) { $filename = $GLOBALS['xoops']->path('modules/wfsection/cache/uploaded/' . $arrFile['filerealname']); @@ -216,7 +216,7 @@ $fileObj->setVar('counter', $arrFile['counter']); $fileObj->setVar('filename', $arrFile['filerealname']); - if ($fileObj->store($allowed_mimetypes, true, false)) { + if ($fileObj->store($allowedMimetypes, true, false)) { echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } diff --git a/admin/import/smartsection.php b/admin/import/smartsection.php index fe41e401..d4ba9047 100644 --- a/admin/import/smartsection.php +++ b/admin/import/smartsection.php @@ -62,16 +62,16 @@ $sql = 'SELECT cat.categoryid, cat.parentid, cat.name, COUNT(art.itemid) FROM ' . $GLOBALS['xoopsDB']->prefix('smartsection_categories') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('smartsection_items') . ' AS art ON cat.categoryid=art.categoryid GROUP BY art.categoryid'; $result = $GLOBALS['xoopsDB']->query($sql); - $cat_cbox_options = []; + $catCboxOptions = []; - while (list($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result)) { - $cat_title = $myts->displayTarea($cat_title); - $cat_cbox_options[$cid] = "$cat_title ($art_count)"; + while (list($cid, $pid, $catTitle, $articleCount) = $GLOBALS['xoopsDB']->fetchRow($result)) { + $catTitle = $myts->displayTarea($catTitle); + $catCboxOptions[$cid] = "$catTitle ($articleCount)"; } - $cat_label = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); - $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); - $form->addElement($cat_label); + $catLabel = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $catCboxOptions)); + $catLabel->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); + $form->addElement($catLabel); // Publisher parent category $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix($helper->getModule()->dirname() . '_categories'), 'categoryid', 'parentid'); @@ -180,7 +180,7 @@ // Linkes files $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('smartsection_files') . ' WHERE itemid=' . $arrArticle['itemid']; $resultFiles = $GLOBALS['xoopsDB']->query($sql); - $allowed_mimetypes = null; + $allowedMimetypes = null; while (false !== ($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles))) { $filename = $GLOBALS['xoops']->path('uploads/smartsection/' . $arrFile['filename']); if (file_exists($filename)) { @@ -190,7 +190,7 @@ $fileObj->setVars($arrFile); $fileObj->setVar('fileid', 0); - if ($fileObj->store($allowed_mimetypes, true, false)) { + if ($fileObj->store($allowedMimetypes, true, false)) { echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filename']) . '
'; } } diff --git a/admin/import/wfsection.php b/admin/import/wfsection.php index afcf2114..9107ef9f 100644 --- a/admin/import/wfsection.php +++ b/admin/import/wfsection.php @@ -63,14 +63,14 @@ $sql = 'SELECT cat.id, cat.pid, cat.title, COUNT(art.articleid) FROM ' . $GLOBALS['xoopsDB']->prefix('wfs_category') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wfs_article') . ' AS art ON cat.id=art.categoryid GROUP BY art.categoryid'; $result = $GLOBALS['xoopsDB']->query($sql); $cat_cbox_values = []; - $cat_cbox_options = []; - while (list($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result)) { - $cat_title = $myts->displayTarea($cat_title); - $cat_cbox_options[$cid] = "$cat_title ($art_count)"; + $catCboxOptions = []; + while (list($cid, $pid, $catTitle, $articleCount) = $GLOBALS['xoopsDB']->fetchRow($result)) { + $catTitle = $myts->displayTarea($catTitle); + $catCboxOptions[$cid] = "$catTitle ($articleCount)"; } - $cat_label = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); - $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); - $form->addElement($cat_label); + $catLabel = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $catCboxOptions)); + $catLabel->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); + $form->addElement($catLabel); // SmartFAQ parent category $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix($helper->getModule()->dirname() . '_categories'), 'categoryid', 'parentid'); @@ -195,7 +195,7 @@ $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('wfs_files') . ' WHERE articleid=' . $arrArticle['articleid']; $resultFiles = $GLOBALS['xoopsDB']->query($sql); - $allowed_mimetypes = ''; + $allowedMimetypes = ''; while (false !== ($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles))) { $filename = $GLOBALS['xoops']->path('modules/wfsection/cache/uploaded/' . $arrFile['filerealname']); if (file_exists($filename)) { @@ -212,7 +212,7 @@ $fileObj->setVar('counter', $arrFile['counter']); $fileObj->setVar('filename', $arrFile['filerealname']); - if ($fileObj->store($allowed_mimetypes, true, false)) { + if ($fileObj->store($allowedMimetypes, true, false)) { echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } diff --git a/admin/import/xfsection.php b/admin/import/xfsection.php index 81bb465d..082d961c 100644 --- a/admin/import/xfsection.php +++ b/admin/import/xfsection.php @@ -63,14 +63,14 @@ $sql = 'SELECT cat.id, cat.pid, cat.title, COUNT(art.articleid) FROM ' . $GLOBALS['xoopsDB']->prefix('xfs_category') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('xfs_article') . ' AS art ON cat.id=art.categoryid GROUP BY art.categoryid'; $result = $GLOBALS['xoopsDB']->query($sql); $cat_cbox_values = []; - $cat_cbox_options = []; - while (list($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result)) { - $cat_title = $myts->displayTarea($cat_title); - $cat_cbox_options[$cid] = "$cat_title ($art_count)"; + $catCboxOptions = []; + while (list($cid, $pid, $catTitle, $articleCount) = $GLOBALS['xoopsDB']->fetchRow($result)) { + $catTitle = $myts->displayTarea($catTitle); + $catCboxOptions[$cid] = "$catTitle ($articleCount)"; } - $cat_label = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); - $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); - $form->addElement($cat_label); + $catLabel = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $catCboxOptions)); + $catLabel->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); + $form->addElement($catLabel); // SmartFAQ parent category $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix($helper->getModule()->dirname() . '_categories'), 'categoryid', 'parentid'); @@ -194,7 +194,7 @@ $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xfs_files') . ' WHERE articleid=' . $arrArticle['articleid']; $resultFiles = $GLOBALS['xoopsDB']->query($sql); - $allowed_mimetypes = ''; + $allowedMimetypes = ''; while (false !== ($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles))) { $filename = $GLOBALS['xoops']->path('modules/xfsection/cache/uploaded/' . $arrFile['filerealname']); if (file_exists($filename)) { @@ -211,7 +211,7 @@ $fileObj->setVar('counter', $arrFile['counter']); $fileObj->setVar('filename', $arrFile['filerealname']); - if ($fileObj->store($allowed_mimetypes, true, false)) { + if ($fileObj->store($allowedMimetypes, true, false)) { echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } diff --git a/admin/import/xnews.php b/admin/import/xnews.php index ef4ed3c8..30df0367 100644 --- a/admin/import/xnews.php +++ b/admin/import/xnews.php @@ -127,16 +127,16 @@ $sql = 'SELECT cat.topic_id, cat.topic_pid, cat.topic_title, COUNT(art.storyid) FROM ' . $GLOBALS['xoopsDB']->prefix('nw_topics') . ' AS cat INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('nw_stories') . ' AS art ON cat.topic_id=art.topicid GROUP BY art.topicid'; $result = $GLOBALS['xoopsDB']->query($sql); - $cat_cbox_options = []; + $catCboxOptions = []; - while (list($cid, $pid, $cat_title, $art_count) = $GLOBALS['xoopsDB']->fetchRow($result)) { - $cat_title = $myts->displayTarea($cat_title); - $cat_cbox_options[$cid] = "$cat_title ($art_count)"; + while (list($cid, $pid, $catTitle, $articleCount) = $GLOBALS['xoopsDB']->fetchRow($result)) { + $catTitle = $myts->displayTarea($catTitle); + $catCboxOptions[$cid] = "$catTitle ($articleCount)"; } - $cat_label = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $cat_cbox_options)); - $cat_label->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); - $form->addElement($cat_label); + $catLabel = new \XoopsFormLabel(_AM_PUBLISHER_IMPORT_CATEGORIES, implode('
', $catCboxOptions)); + $catLabel->setDescription(_AM_PUBLISHER_IMPORT_CATEGORIES_DSC); + $form->addElement($catLabel); // Publisher parent category $mytree = new \XoopsTree($GLOBALS['xoopsDB']->prefix($helper->getModule()->dirname() . '_categories'), 'categoryid', 'parentid'); @@ -241,13 +241,13 @@ $imageHandler = xoops_getHandler('image'); $image = $imageHandler->create(); $image->setVar('image_name', $arrCat['topic_imgurl']);//'images/' . $uploader->getSavedFileName()); - $image->setVar('image_nicename', mb_substr($arrCat['topic_imgurl'],-13)); //$image_nicename); + $image->setVar('image_nicename', mb_substr($arrCat['topic_imgurl'],-13)); //$imageNiceName); $image->setVar('image_mimetype', 'image/'. mb_substr($arrCat['topic_imgurl'],-3));//$uploader->getMediaType()); // $image->setVar('image_created', time()); // $image_display = empty($image_display) ? 0 : 1; $image->setVar('image_display', 1); //$image_display); $image->setVar('image_weight', 0);//$image_weight); - $image->setVar('imgcat_id', $newid );//$imgcat_id); + $image->setVar('imgcat_id', $newid );//$imgcatId); if (!$imageHandler->insert($image)) { $err[] = sprintf(_FAILSAVEIMG, $image->getVar('image_nicename')); } @@ -352,7 +352,7 @@ // Linkes files $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('nw_stories_files') . ' WHERE storyid=' . $arrArticle['storyid']; $resultFiles = $GLOBALS['xoopsDB']->query($sql); - $allowed_mimetypes = ''; + $allowedMimetypes = ''; while (false !== ($arrFile = $GLOBALS['xoopsDB']->fetchArray($resultFiles))) { $filename = $GLOBALS['xoops']->path('uploads/xnews/attached/' . $arrFile['downloadname']); if (file_exists($filename)) { @@ -370,7 +370,7 @@ $fileObj->setVar('filename', $arrFile['filerealname']); $fileObj->setVar('short_url', $arrFile['filerealname']); - if ($fileObj->store($allowed_mimetypes, true, false)) { + if ($fileObj->store($allowedMimetypes, true, false)) { echo '    ' . sprintf(_AM_PUBLISHER_IMPORTED_ARTICLE_FILE, $arrFile['filerealname']) . '
'; } } diff --git a/admin/item.php b/admin/item.php index c146c8c2..ac2e1b83 100644 --- a/admin/item.php +++ b/admin/item.php @@ -32,8 +32,8 @@ redirect_header('item.php', 2, _CO_PUBLISHER_BAD_TOKEN); } -$itemid = Request::getInt('itemid', Request::getInt('itemid', 0, 'POST'), 'GET'); -$op = ($itemid > 0 || Request::getString('editor', '', 'POST')) ? 'mod' : ''; +$itemId = Request::getInt('itemid', Request::getInt('itemid', 0, 'POST'), 'GET'); +$op = ($itemId > 0 || Request::getString('editor', '', 'POST')) ? 'mod' : ''; //$op = Request::getString('op', $op, 'GET'); $op = Request::getString('op', Request::getString('op', $op, 'POST'), 'GET'); @@ -49,17 +49,17 @@ switch ($op) { case 'clone': - if (0 == $itemid) { + if (0 == $itemId) { $totalcategories = $helper->getHandler('Category')->getCategoriesCount(-1); if (0 == $totalcategories) { redirect_header('category.php?op=mod', 3, _AM_PUBLISHER_NEED_CATEGORY_ITEM); } } Utility::cpHeader(); - publisher_editItem(true, $itemid, true); + publisher_editItem(true, $itemId, true); break; case 'mod': - if (0 == $itemid) { + if (0 == $itemId) { $totalcategories = $helper->getHandler('Category')->getCategoriesCount(-1); if (0 == $totalcategories) { redirect_header('category.php?op=mod', 3, _AM_PUBLISHER_NEED_CATEGORY_ITEM); @@ -67,60 +67,60 @@ } Utility::cpHeader(); - publisher_editItem(true, $itemid); + publisher_editItem(true, $itemId); break; case 'additem': - $redirect_msg = $error_msg = ''; + $redirectMsg = $errorMsg = ''; // Creating the item object /** @var Publisher\Item $itemObj */ - if (0 != $itemid) { - $itemObj = $helper->getHandler('Item')->get($itemid); + if (0 != $itemId) { + $itemObj = $helper->getHandler('Item')->get($itemId); } else { $itemObj = $helper->getHandler('Item')->create(); } $itemObj->setVarsFromRequest(); - $old_status = $itemObj->status(); + $oldStatus = $itemObj->status(); $newStatus = Request::getInt('status', Constants::PUBLISHER_STATUS_PUBLISHED); //_PUBLISHER_STATUS_NOTSET; switch ($newStatus) { case Constants::PUBLISHER_STATUS_SUBMITTED: - $error_msg = _AM_PUBLISHER_ITEMNOTCREATED; - if (Constants::PUBLISHER_STATUS_NOTSET == $old_status) { - $error_msg = _AM_PUBLISHER_ITEMNOTUPDATED; + $errorMsg = _AM_PUBLISHER_ITEMNOTCREATED; + if (Constants::PUBLISHER_STATUS_NOTSET == $oldStatus) { + $errorMsg = _AM_PUBLISHER_ITEMNOTUPDATED; } - $redirect_msg = _AM_PUBLISHER_ITEM_RECEIVED_NEED_APPROVAL; + $redirectMsg = _AM_PUBLISHER_ITEM_RECEIVED_NEED_APPROVAL; break; case Constants::PUBLISHER_STATUS_PUBLISHED: - if ((Constants::PUBLISHER_STATUS_NOTSET == $old_status) || (Constants::PUBLISHER_STATUS_SUBMITTED == $old_status)) { - $redirect_msg = _AM_PUBLISHER_SUBMITTED_APPROVE_SUCCESS; + if ((Constants::PUBLISHER_STATUS_NOTSET == $oldStatus) || (Constants::PUBLISHER_STATUS_SUBMITTED == $oldStatus)) { + $redirectMsg = _AM_PUBLISHER_SUBMITTED_APPROVE_SUCCESS; $notifToDo = [Constants::PUBLISHER_NOTIFY_ITEM_PUBLISHED]; } else { - $redirect_msg = _AM_PUBLISHER_PUBLISHED_MOD_SUCCESS; + $redirectMsg = _AM_PUBLISHER_PUBLISHED_MOD_SUCCESS; } - $error_msg = _AM_PUBLISHER_ITEMNOTUPDATED; + $errorMsg = _AM_PUBLISHER_ITEMNOTUPDATED; break; case Constants::PUBLISHER_STATUS_OFFLINE: - $redirect_msg = _AM_PUBLISHER_OFFLINE_MOD_SUCCESS; - if (Constants::PUBLISHER_STATUS_NOTSET == $old_status) { - $redirect_msg = _AM_PUBLISHER_OFFLINE_CREATED_SUCCESS; + $redirectMsg = _AM_PUBLISHER_OFFLINE_MOD_SUCCESS; + if (Constants::PUBLISHER_STATUS_NOTSET == $oldStatus) { + $redirectMsg = _AM_PUBLISHER_OFFLINE_CREATED_SUCCESS; } - $error_msg = _AM_PUBLISHER_ITEMNOTUPDATED; + $errorMsg = _AM_PUBLISHER_ITEMNOTUPDATED; break; case Constants::PUBLISHER_STATUS_REJECTED: - $error_msg = _AM_PUBLISHER_ITEMNOTCREATED; - if (Constants::PUBLISHER_STATUS_NOTSET == $old_status) { - $error_msg = _AM_PUBLISHER_ITEMNOTUPDATED; + $errorMsg = _AM_PUBLISHER_ITEMNOTCREATED; + if (Constants::PUBLISHER_STATUS_NOTSET == $oldStatus) { + $errorMsg = _AM_PUBLISHER_ITEMNOTUPDATED; } - $redirect_msg = _AM_PUBLISHER_ITEM_REJECTED; + $redirectMsg = _AM_PUBLISHER_ITEM_REJECTED; break; } $itemObj->setVar('status', $newStatus); // Storing the item if (!$itemObj->store()) { - redirect_header('', 3, $error_msg . Utility::formatErrors($itemObj->getErrors())); + redirect_header('', 3, $errorMsg . Utility::formatErrors($itemObj->getErrors())); } // attach file if any @@ -136,11 +136,11 @@ $itemObj->sendNotifications($notifToDo); } - redirect_header('item.php', 2, $redirect_msg); + redirect_header('item.php', 2, $redirectMsg); break; case 'del': - $itemObj = $helper->getHandler('Item')->get($itemid); + $itemObj = $helper->getHandler('Item')->get($itemId); $confirm = Request::getInt('confirm', 0, 'POST'); if ($confirm) { @@ -209,7 +209,7 @@ echo ''; } } else { - $itemid = 0; + $itemId = 0; echo ''; echo "" . _AM_PUBLISHER_NOITEMS_SUBMITTED . ''; echo ''; @@ -263,7 +263,7 @@ echo ''; } } else { - $itemid = 0; + $itemId = 0; echo ''; echo "" . _AM_PUBLISHER_NOITEMS . ''; echo ''; @@ -317,7 +317,7 @@ echo ''; } } else { - $itemid = 0; + $itemId = 0; echo ''; echo "" . _AM_PUBLISHER_NOITEMS_OFFLINE . ''; echo ''; @@ -369,7 +369,7 @@ echo ''; } } else { - $itemid = 0; + $itemId = 0; echo ''; echo "" . _AM_PUBLISHER_NOITEMS_REJECTED . ''; echo ''; @@ -387,10 +387,10 @@ /** * @param bool $showmenu - * @param int $itemid + * @param int $itemId * @param bool $clone */ -function publisher_editItem($showmenu = false, $itemid = 0, $clone = false) +function publisher_editItem($showmenu = false, $itemId = 0, $clone = false) { $helper = Helper::getInstance(); global $publisherCurrentPage; @@ -402,10 +402,10 @@ function publisher_editItem($showmenu = false, $itemid = 0, $clone = false) // if there is a parameter, and the id exists, retrieve data: we're editing a item - if (0 !== $itemid) { + if (0 !== $itemId) { // Creating the ITEM object /** @var \XoopsModules\Publisher\Item $itemObj */ - $itemObj = $helper->getHandler('Item')->get($itemid); + $itemObj = $helper->getHandler('Item')->get($itemId); if (null === $itemObj) { redirect_header('item.php', 1, _AM_PUBLISHER_NOITEMSELECTED); diff --git a/admin/main.php b/admin/main.php index 4f7c9824..c034d320 100644 --- a/admin/main.php +++ b/admin/main.php @@ -30,14 +30,14 @@ // require_once dirname(__DIR__) . '/class/Utility.php'; require_once dirname(__DIR__) . '/include/common.php'; -$itemid = Request::getInt('itemid', 0, 'POST'); +$itemId = Request::getInt('itemid', 0, 'POST'); $pick = Request::getInt('pick', Request::getInt('pick', 0, 'GET'), 'POST'); $statussel = Request::getInt('statussel', Request::getInt('statussel', 0, 'GET'), 'POST'); $sortsel = Request::getString('sortsel', Request::getString('sortsel', 'itemid', 'GET'), 'POST'); $ordersel = Request::getString('ordersel', Request::getString('ordersel', 'DESC', 'GET'), 'POST'); -$module_id = $helper->getModule()->mid(); +$moduleId = $helper->getModule()->mid(); /** @var XoopsGroupPermHandler $grouppermHandler */ $grouppermHandler = xoops_getHandler('groupperm'); $groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS; @@ -159,31 +159,31 @@ $selectedtxt0 = 'selected'; $caption = _AM_PUBLISHER_ALL; $cond = ''; - $status_explaination = _AM_PUBLISHER_ALL_EXP; + $statusExplanation = _AM_PUBLISHER_ALL_EXP; break; case Constants::PUBLISHER_STATUS_SUBMITTED: $selectedtxt1 = 'selected'; $caption = _CO_PUBLISHER_SUBMITTED; $cond = ' WHERE status = ' . Constants::PUBLISHER_STATUS_SUBMITTED . ' '; - $status_explaination = _AM_PUBLISHER_SUBMITTED_EXP; + $statusExplanation = _AM_PUBLISHER_SUBMITTED_EXP; break; case Constants::PUBLISHER_STATUS_PUBLISHED: $selectedtxt2 = 'selected'; $caption = _CO_PUBLISHER_PUBLISHED; $cond = ' WHERE status = ' . Constants::PUBLISHER_STATUS_PUBLISHED . ' '; - $status_explaination = _AM_PUBLISHER_PUBLISHED_EXP; + $statusExplanation = _AM_PUBLISHER_PUBLISHED_EXP; break; case Constants::PUBLISHER_STATUS_OFFLINE: $selectedtxt3 = 'selected'; $caption = _CO_PUBLISHER_OFFLINE; $cond = ' WHERE status = ' . Constants::PUBLISHER_STATUS_OFFLINE . ' '; - $status_explaination = _AM_PUBLISHER_OFFLINE_EXP; + $statusExplanation = _AM_PUBLISHER_OFFLINE_EXP; break; case Constants::PUBLISHER_STATUS_REJECTED: $selectedtxt4 = 'selected'; $caption = _CO_PUBLISHER_REJECTED; $cond = ' WHERE status = ' . Constants::PUBLISHER_STATUS_REJECTED . ' '; - $status_explaination = _AM_PUBLISHER_REJECTED_ITEM_EXP; + $statusExplanation = _AM_PUBLISHER_REJECTED_ITEM_EXP; break; } @@ -315,7 +315,7 @@ echo ''; } echo "\n"; -echo "$status_explaination"; +echo "$statusExplanation"; $pagenav = new \XoopsPageNav($numrows, $helper->getConfig('idxcat_perpage'), $startentry, 'startentry', "statussel=$statussel&sortsel=$sortsel&ordersel=$ordersel"); if (1 == $helper->getConfig('format_image_nav')) { diff --git a/admin/preferences.php b/admin/preferences.php index 047ce27f..50098db9 100644 --- a/admin/preferences.php +++ b/admin/preferences.php @@ -65,7 +65,7 @@ $xv_configs = $module->getInfo('config'); $config_cats = $module->getInfo('configcat'); - if (!array_key_exists('others', $config_cats)) { + if (is_array($config_cats) && !array_key_exists('others', $config_cats)) { $config_cats['others'] = [ 'name' => _MI_PUBLISHER_CONFCAT_OTHERS, 'description' => _MI_PUBLISHER_CONFCAT_OTHERS_DSC, @@ -85,10 +85,12 @@ xoops_load('XoopsFormLoader'); - foreach ($config_cats as $formCat => $info) { - $$formCat = new \XoopsThemeForm($info['name'], 'pref_form_' . $formCat, 'preferences.php', 'post', true); + if (is_array($config_cats)) { + foreach ($config_cats as $formCat => $info) { + $$formCat = new \XoopsThemeForm($info['name'], 'pref_form_' . $formCat, 'preferences.php', 'post', true); + } + unset($formCat, $info); } - unset($formCat, $info); for ($i = 0; $i < $count; ++$i) { foreach ($xv_configs as $xv_config) { @@ -101,7 +103,7 @@ $formCat = $xv_config['category'] ?? ''; unset($xv_config); - if (!array_key_exists($formCat, $config_cats)) { + if (is_array($config_cats) && !array_key_exists($formCat, $config_cats)) { $formCat = 'others'; $cat_others_used = true; } @@ -176,9 +178,11 @@ break; } $hidden = new \XoopsFormHidden('conf_ids[]', $config[$i]->getVar('conf_id')); - $$formCat->addElement($ele); - $$formCat->addElement($hidden); - unset($ele, $hidden); + if (isset($$formCat) && null !== $$formCat) { + $$formCat->addElement($ele); + $$formCat->addElement($hidden); + unset($ele, $hidden); + } } Utility::cpHeader(); diff --git a/admin/trellostatus.php b/admin/trellostatus.php new file mode 100644 index 00000000..1b182a1e --- /dev/null +++ b/admin/trellostatus.php @@ -0,0 +1,10 @@ +editTaskStatus($statusId, $itemId); diff --git a/author_items.php b/author_items.php index 76967cd5..44c92919 100644 --- a/author_items.php +++ b/author_items.php @@ -57,8 +57,8 @@ $xoopsTpl->assign('permRating', $helper->getConfig('perm_rating')); xoops_load('XoopsUserUtility'); -$author_name = \XoopsUserUtility::getUnameFromId($uid, $helper->getConfig('format_realname'), true); -$xoopsTpl->assign('author_name_with_link', $author_name); +$authorName = \XoopsUserUtility::getUnameFromId($uid, $helper->getConfig('format_realname'), true); +$xoopsTpl->assign('author_name_with_link', $authorName); $xoopsTpl->assign('user_avatarurl', XOOPS_URL . '/uploads/' . $thisuser->getVar('user_avatar')); //$xoopsLocal = new \XoopsLocal(); $categories = []; @@ -121,7 +121,7 @@ unset($item); $xoopsTpl->assign('categories', $categories); -$title = _MD_PUBLISHER_ITEMS_SAME_AUTHOR . ' - ' . $author_name; +$title = _MD_PUBLISHER_ITEMS_SAME_AUTHOR . ' - ' . $authorName; /** * Generating meta information for this page diff --git a/backend.php b/backend.php index 9acf0977..e145f047 100644 --- a/backend.php +++ b/backend.php @@ -32,10 +32,10 @@ mb_http_output('pass'); } -$categoryid = Request::getInt('categoryid', -1, 'GET'); +$categoryId = Request::getInt('categoryid', -1, 'GET'); -if (-1 != $categoryid) { - $categoryObj = $helper->getHandler('Category')->get($categoryid); +if (-1 != $categoryId) { + $categoryObj = $helper->getHandler('Category')->get($categoryId); } header('Content-Type:text/xml; charset=' . _CHARSET); @@ -46,12 +46,12 @@ $myts = \MyTextSanitizer::getInstance(); if (!$tpl->is_cached('db:publisher_rss.tpl')) { // xoops_load('XoopsLocal'); - $channel_category = $helper->getModule()->name(); + $channelCategory = $helper->getModule()->name(); // Check if ML Hack is installed, and if yes, parse the $content in formatForML if (method_exists($myts, 'formatForML')) { $GLOBALS['xoopsConfig']['sitename'] = $myts->formatForML($GLOBALS['xoopsConfig']['sitename']); $GLOBALS['xoopsConfig']['slogan'] = $myts->formatForML($GLOBALS['xoopsConfig']['slogan']); - $channel_category = $myts->formatForML($channel_category); + $channelCategory = $myts->formatForML($channelCategory); } $tpl->assign('channel_charset', _CHARSET); $tpl->assign('channel_title', htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES | ENT_HTML5)); @@ -62,11 +62,11 @@ $tpl->assign('channel_webmaster', $GLOBALS['xoopsConfig']['adminmail'] . '( ' . htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES | ENT_HTML5) . ' )'); $tpl->assign('channel_editor', $GLOBALS['xoopsConfig']['adminmail'] . '( ' . htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES | ENT_HTML5) . ' )'); - if (-1 != $categoryid) { - $channel_category .= ' > ' . $categoryObj->name(); + if (-1 != $categoryId) { + $channelCategory .= ' > ' . $categoryObj->name(); } - $tpl->assign('channel_category', htmlspecialchars($channel_category, ENT_QUOTES | ENT_HTML5)); + $tpl->assign('channelCategory', htmlspecialchars($channelCategory, ENT_QUOTES | ENT_HTML5)); $tpl->assign('channel_generator', $helper->getModule()->name()); $tpl->assign('channel_language', _LANGCODE); $tpl->assign('image_url', XOOPS_URL . '/images/logo.png'); @@ -82,7 +82,7 @@ $height = round($height, 0, PHP_ROUND_HALF_UP); $tpl->assign('image_width', $width); $tpl->assign('image_height', $height); - $sarray = $helper->getHandler('Item')->getAllPublished(10, 0, $categoryid); + $sarray = $helper->getHandler('Item')->getAllPublished(10, 0, $categoryId); if (!empty($sarray) && is_array($sarray)) { $count = $sarray; foreach ($sarray as $item) { diff --git a/blocks/items_columns.php b/blocks/items_columns.php index df2814d7..b4bf72e3 100644 --- a/blocks/items_columns.php +++ b/blocks/items_columns.php @@ -114,8 +114,8 @@ function publisher_items_columns_show($options) //The Rest if ($scount > 1) { - // while ((list($itemid, $thisItem) = each($categoryItemsObj)) !== false) { - foreach ($categoryItemsObj as $itemid => $thisItem) { + // while ((list($itemId, $thisItem) = each($categoryItemsObj)) !== false) { + foreach ($categoryItemsObj as $itemId => $thisItem) { //TODO do I need to start with 2nd element? $subItem['title'] = $thisItem->getTitle(); $subItem['cleantitle'] = strip_tags($thisItem->getTitle()); diff --git a/blocks/items_menu.php b/blocks/items_menu.php index 08b97b3b..acbcc93e 100644 --- a/blocks/items_menu.php +++ b/blocks/items_menu.php @@ -50,13 +50,13 @@ function publisher_items_menu_show($options) $catLinkClass = 'menuMain'; - $categoryid = 0; + $categoryId = 0; if ($block['inModule']) { // Are we in a category and if yes, in which one ? - $categoryid = Request::getInt('categoryid', 0, 'GET'); + $categoryId = Request::getInt('categoryid', 0, 'GET'); - if (0 != $categoryid) { + if (0 != $categoryId) { // if we are in a category, then the $categoryObj is already defined in publisher/category.php global $categoryObj; $block['currentcat'] = $categoryObj->getCategoryLink('menuTop'); @@ -65,7 +65,7 @@ function publisher_items_menu_show($options) } foreach ($blockCategoriesObj as $catId => $blockCategoryObj) { - if ($catId != $categoryid) { + if ($catId != $categoryId) { $block['categories'][$catId]['categoryLink'] = $blockCategoryObj->getCategoryLink($catLinkClass); } } diff --git a/blocks/latest_news.php b/blocks/latest_news.php index b708dae4..530e12c0 100644 --- a/blocks/latest_news.php +++ b/blocks/latest_news.php @@ -96,7 +96,7 @@ function publisher_latest_news_show($options) $k = 0; $columns = []; - foreach ($itemsObj as $itemid => $itemObj) { + foreach ($itemsObj as $itemId => $itemObj) { $item = []; $item['itemurl'] = $itemObj->getItemUrl(); $item['title'] = $itemObj->getItemLink(); diff --git a/category.php b/category.php index fcb112e4..a59df44f 100644 --- a/category.php +++ b/category.php @@ -24,10 +24,11 @@ require_once __DIR__ . '/header.php'; -$categoryid = Request::getInt('categoryid', 0, 'GET'); +$categoryId = Request::getInt('categoryid', 0, 'GET'); // Creating the category object for the selected category -$categoryObj = $helper->getHandler('Category')->get($categoryid); +/** @var \XoopsModules\Publisher\Helper $helper */ +$categoryObj = $helper->getHandler('Category')->get($categoryId); // if the selected category was not found, exit if (!is_object($categoryObj) || $categoryObj->notLoaded()) { @@ -42,13 +43,13 @@ // At which record shall we start $start = Request::getInt('start', 0, 'GET'); -$item_page_id = Request::getInt('page', -1, 'GET'); +$itemPageId = Request::getInt('page', -1, 'GET'); $totalItems = $helper->getHandler('Category')->publishedItemsCount(); // if there is no Item under this categories or the sub-categories, exit // why? -if (!isset($totalItems[$categoryid]) || 0 == $totalItems[$categoryid]) { +if (!isset($totalItems[$categoryId]) || 0 == $totalItems[$categoryId]) { //redirect_header("index.php", 1, _MD_PUBLISHER_MAINNOFAQS); } @@ -62,7 +63,7 @@ require_once $GLOBALS['xoops']->path('header.php'); require_once PUBLISHER_ROOT_PATH . '/footer.php'; -$module_id = $helper->getModule()->getVar('mid'); +$moduleId = $helper->getModule()->getVar('mid'); // creating the Item objects that belong to the selected category switch ($helper->getConfig('format_order_by')) { @@ -96,7 +97,7 @@ break; } -$itemsObj = $helper->getHandler('Item')->getAllPublished($helper->getConfig('idxcat_index_perpage'), $start, $categoryid, $sort, $order); +$itemsObj = $helper->getHandler('Item')->getAllPublished($helper->getConfig('idxcat_index_perpage'), $start, $categoryId, $sort, $order); $totalItemOnPage = 0; if ($itemsObj) { @@ -120,8 +121,8 @@ $lastitemsize = (int)$helper->getConfig('idxcat_last_item_size'); // Creating the sub-categories objects that belong to the selected category -$subcatsObj = $helper->getHandler('Category')->getCategories(0, 0, $categoryid); -$total_subcats = count($subcatsObj); +$subcatsObj = $helper->getHandler('Category')->getCategories(0, 0, $categoryId); +$totalSubcats = count($subcatsObj); $total_items = 0; @@ -129,36 +130,36 @@ if ('no' !== $helper->getConfig('idxcat_show_subcats')) { // if this category has subcats - if (isset($subcatsObj) && $total_subcats > 0) { + if (isset($subcatsObj) && $totalSubcats > 0) { foreach ($subcatsObj as $key => $subcat) { // Get the items count of this very category - $subcat_total_items = $totalItems[$key] ?? 0; + $subcatTotalItems = $totalItems[$key] ?? 0; // Do we display empty sub-cats ? - if (($subcat_total_items > 0) || ('all' === $helper->getConfig('idxcat_show_subcats'))) { - $subcat_id = $subcat->getVar('categoryid'); + if (($subcatTotalItems > 0) || ('all' === $helper->getConfig('idxcat_show_subcats'))) { + $subcatId = $subcat->getVar('categoryid'); // if we retreived the last item object for this category - if (isset($lastItemObj[$subcat_id])) { - $subcat->setVar('last_itemid', $lastItemObj[$subcat_id]->itemid()); + if (isset($lastItemObj[$subcatId])) { + $subcat->setVar('last_itemid', $lastItemObj[$subcatId]->itemid()); $subcat->setVar('last_title_link', $lastItemObj[$key]->getItemLink(false, $lastitemsize)); } - $numItems = isset($totalItems[$subcat_id]) ? $totalItems[$key] : 0; + $numItems = isset($totalItems[$subcatId]) ? $totalItems[$key] : 0; $subcat->setVar('itemcount', $numItems); // Put this subcat in the smarty variable $subcategories[$key] = $subcat->toArraySimple(); //$total += $numItems; } - if ($subcat_total_items > 0) { - $subcat_id = $subcat->getVar('categoryid'); + if ($subcatTotalItems > 0) { + $subcatId = $subcat->getVar('categoryid'); // if we retreived the last item object for this category - if (isset($lastItemObj[$subcat_id])) { - $subcat->setVar('last_itemid', $lastItemObj[$subcat_id]->itemid()); + if (isset($lastItemObj[$subcatId])) { + $subcat->setVar('last_itemid', $lastItemObj[$subcatId]->itemid()); $subcat->setVar('last_title_link', $lastItemObj[$key]->getItemLink(false, $lastitemsize)); } - $numItems = isset($totalItems[$subcat_id]) ? $totalItems[$key] : 0; + $numItems = isset($totalItems[$subcatId]) ? $totalItems[$key] : 0; $subcat->setVar('itemcount', $numItems); // Put this subcat in the smarty variable $subcategories[$key] = $subcat->toArraySimple(); @@ -172,14 +173,14 @@ $category['subcats'] = $subcategories; $category['subcatscount'] = count($subcategories); -$thiscategory_itemcount = $totalItems[$categoryid] ?? 0; +$thiscategory_itemcount = $totalItems[$categoryId] ?? 0; $category['total'] = $thiscategory_itemcount; if (count($itemsObj) > 0) { /*$userids = []; if ($itemsObj) { foreach ($itemsObj as $key => $thisItem) { - $itemids[] = $thisItem->getVar('itemid'); + $itemIds[] = $thisItem->getVar('itemid'); $userids[$thisItem->uid()] = 1; } } @@ -218,7 +219,7 @@ $xoopsTpl->assign('lang_items_title', sprintf(_MD_PUBLISHER_ITEMS_TITLE, $categoryObj->name())); $xoopsTpl->assign('module_home', Publisher\Utility::moduleHome($helper->getConfig('format_linked_path'))); $xoopsTpl->assign('categoryPath', '
  • ' . $category['categoryPath'] . '
  • '); -$xoopsTpl->assign('selected_category', $categoryid); +$xoopsTpl->assign('selected_category', $categoryId); // The Navigation Bar require_once $GLOBALS['xoops']->path('class/pagenav.php'); @@ -238,7 +239,7 @@ // RSS Link if (1 == $helper->getConfig('idxcat_show_rss_link')) { - $link = sprintf("%s", PUBLISHER_URL . '/backend.php?categoryid=' . $categoryid, _MD_PUBLISHER_RSSFEED, PUBLISHER_URL . '/assets/images/rss.gif', _MD_PUBLISHER_RSSFEED); + $link = sprintf("%s", PUBLISHER_URL . '/backend.php?categoryid=' . $categoryId, _MD_PUBLISHER_RSSFEED, PUBLISHER_URL . '/assets/images/rss.gif', _MD_PUBLISHER_RSSFEED); $xoopsTpl->assign('rssfeed_link', $link); } diff --git a/class/Category.php b/class/Category.php index 1147a875..5eaa7d66 100644 --- a/class/Category.php +++ b/class/Category.php @@ -41,7 +41,7 @@ class Category extends \XoopsObject * @var array */ public $categoryPath = false; - public $categoryid; + public $categoryId; public $parentid; public $name; public $description; diff --git a/class/Common/Meta.php b/class/Common/Meta.php index 59a51f56..dc6d5500 100644 --- a/class/Common/Meta.php +++ b/class/Common/Meta.php @@ -15,11 +15,11 @@ final class Meta { /** - * @param string $locale_code + * @param string $localeCode * @return string */ - public static function getStatik($locale_code) + public static function getStatik($localeCode) { return ' @@ -29,7 +29,7 @@ public static function getStatik($locale_code) - '; + '; } /** @@ -83,20 +83,20 @@ public static function getDescription($desc) public static function getAlternate($langList) { - $LL = ''; + $alternateLangList = ''; if (\count($langList) > 1): foreach ($langList as $lang): - $LL .= ' + $alternateLangList .= ' '; endforeach; else: - $LL = ' + $alternateLangList = ' '; endif; - return $LL; + return $alternateLangList; } /** diff --git a/class/Common/ModuleFeedback.php b/class/Common/ModuleFeedback.php index d765b8c8..12b9d552 100644 --- a/class/Common/ModuleFeedback.php +++ b/class/Common/ModuleFeedback.php @@ -84,9 +84,9 @@ public function getFormFeedback($action = false) $your_site = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE'), 'your_site', 50, 255, $this->site); $your_site->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER') . '"'); $form->addElement($your_site); - $your_mail = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL'), 'your_mail', 50, 255, $this->email); - $your_mail->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER') . '"'); - $form->addElement($your_mail); + $yourMail = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL'), 'your_mail', 50, 255, $this->email); + $yourMail->setExtra('placeholder="' . \constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER') . '"'); + $form->addElement($yourMail); $fbtypeSelect = new \XoopsFormSelect(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE'), 'fb_type', $this->type); $fbtypeSelect->addOption('', ''); diff --git a/class/Common/SysUtility.php b/class/Common/SysUtility.php index 9b137aef..1e8ddaa0 100644 --- a/class/Common/SysUtility.php +++ b/class/Common/SysUtility.php @@ -73,58 +73,58 @@ public static function truncateHtml($text, $length = 100, $ending = '...', $exac } // splits all html-tags to scanable lines \preg_match_all('/(<.+?' . '>)?([^<>]*)/s', $text, $lines, \PREG_SET_ORDER); - $total_length = mb_strlen($ending); - $open_tags = []; + $totalLength = mb_strlen($ending); + $openTags = []; $truncate = ''; - foreach ($lines as $line_matchings) { + foreach ($lines as $lineMatchings) { // if there is any html-tag in this line, handle it and add it (uncounted) to the output - if (!empty($line_matchings[1])) { + if (!empty($lineMatchings[1])) { // if it's an "empty element" with or without xhtml-conform closing slash - if (\preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) { + if (\preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $lineMatchings[1])) { // do nothing // if tag is a closing tag - } elseif (\preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $line_matchings[1], $tag_matchings)) { - // delete tag from $open_tags list - $pos = \array_search($tag_matchings[1], $open_tags, true); + } elseif (\preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $lineMatchings[1], $tagMatchings)) { + // delete tag from $openTags list + $pos = \array_search($tagMatchings[1], $openTags, true); if (false !== $pos) { - unset($open_tags[$pos]); + unset($openTags[$pos]); } // if tag is an opening tag - } elseif (\preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $line_matchings[1], $tag_matchings)) { - // add tag to the beginning of $open_tags list - \array_unshift($open_tags, mb_strtolower($tag_matchings[1])); + } elseif (\preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $lineMatchings[1], $tagMatchings)) { + // add tag to the beginning of $openTags list + \array_unshift($openTags, mb_strtolower($tagMatchings[1])); } // add html-tag to $truncate'd text - $truncate .= $line_matchings[1]; + $truncate .= $lineMatchings[1]; } // calculate the length of the plain text part of the line; handle entities as one character - $content_length = mb_strlen(\preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2])); - if ($total_length + $content_length > $length) { + $content_length = mb_strlen(\preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $lineMatchings[2])); + if ($totalLength + $content_length > $length) { // the number of characters which are left - $left = $length - $total_length; - $entities_length = 0; + $left = $length - $totalLength; + $entitiesLength = 0; // search for html entities - if (\preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, \PREG_OFFSET_CAPTURE)) { + if (\preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $lineMatchings[2], $entities, \PREG_OFFSET_CAPTURE)) { // calculate the real length of all entities in the legal range foreach ($entities[0] as $entity) { - if ($left >= $entity[1] + 1 - $entities_length) { + if ($left >= $entity[1] + 1 - $entitiesLength) { $left--; - $entities_length += mb_strlen($entity[0]); + $entitiesLength += mb_strlen($entity[0]); } else { // no more characters left break; } } } - $truncate .= mb_substr($line_matchings[2], 0, $left + $entities_length); + $truncate .= mb_substr($lineMatchings[2], 0, $left + $entitiesLength); // maximum lenght is reached, so get off the loop break; } - $truncate .= $line_matchings[2]; - $total_length += $content_length; + $truncate .= $lineMatchings[2]; + $totalLength += $content_length; // if the maximum length is reached, get off the loop - if ($total_length >= $length) { + if ($totalLength >= $length) { break; } } @@ -147,7 +147,7 @@ public static function truncateHtml($text, $length = 100, $ending = '...', $exac $truncate .= $ending; if ($considerHtml) { // close all unclosed html-tags - foreach ($open_tags as $tag) { + foreach ($openTags as $tag) { $truncate .= ''; } } diff --git a/class/File.php b/class/File.php index 0d328085..7cc82290 100644 --- a/class/File.php +++ b/class/File.php @@ -127,7 +127,7 @@ public function storeUpload($postField, $allowedMimetypes, &$errors) { /** @var Publisher\MimetypeHandler $mimetypeHandler */ $mimetypeHandler = $this->helper->getHandler('Mimetype'); - $itemid = $this->getVar('itemid'); + $itemId = $this->getVar('itemid'); if (0 === \count($allowedMimetypes)) { $allowedMimetypes = $mimetypeHandler->getArrayByType(); } @@ -142,7 +142,7 @@ public function storeUpload($postField, $allowedMimetypes, &$errors) \xoops_load('XoopsMediaUploader'); $uploader = new \XoopsMediaUploader(Utility::getUploadDir() . '/', $allowedMimetypes, $maxfilesize, $maxfilewidth, $maxfileheight); if ($uploader->fetchMedia($postField)) { - $uploader->setTargetFileName($itemid . '_' . $uploader->getMediaName()); + $uploader->setTargetFileName($itemId . '_' . $uploader->getMediaName()); if ($uploader->upload()) { $this->setVar('filename', $uploader->getSavedFileName()); if ('' == $this->getVar('name')) { diff --git a/class/FileHandler.php b/class/FileHandler.php index 5983e167..878783ed 100644 --- a/class/FileHandler.php +++ b/class/FileHandler.php @@ -102,7 +102,7 @@ public function deleteItemFiles(\XoopsObject $itemObj) /** * retrieve all files * - * @param int $itemid + * @param int $itemId * @param int|array $status * @param int $limit * @param int $start @@ -112,7 +112,7 @@ public function deleteItemFiles(\XoopsObject $itemObj) * * @return array array of {@link File} objects */ - public function getAllFiles($itemid = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = []) + public function getAllFiles($itemId = 0, $status = -1, $limit = 0, $start = 0, $sort = 'datesub', $order = 'DESC', $category = []) { $files = []; @@ -143,9 +143,9 @@ public function getAllFiles($itemid = 0, $status = -1, $limit = 0, $start = 0, $ $criteriaCategory->add(new \Criteria('l.categoryid', $cat), 'OR'); } } - $criteriaItemid = new \Criteria('o.itemid', $itemid); + $criteriaItemid = new \Criteria('o.itemid', $itemId); $criteria = new \CriteriaCompo(); - if (0 != $itemid) { + if (0 != $itemId) { $criteria->add($criteriaItemid); } if ($hasStatusCriteria) { diff --git a/class/Form/CategoryForm.php b/class/Form/CategoryForm.php index 8d7adc0e..2eec7db4 100644 --- a/class/Form/CategoryForm.php +++ b/class/Form/CategoryForm.php @@ -141,8 +141,8 @@ public function createElements() $this->addElement($imageTray); // IMAGE UPLOAD - $max_size = 5000000; - $fileBox = new \XoopsFormFile(\_AM_PUBLISHER_IMAGE_UPLOAD, 'image_file', $max_size); + $maxSize = 5000000; + $fileBox = new \XoopsFormFile(\_AM_PUBLISHER_IMAGE_UPLOAD, 'image_file', $maxSize); $fileBox->setExtra("size ='45'"); $fileBox->setDescription(\_AM_PUBLISHER_IMAGE_UPLOAD_DSC); $this->addElement($fileBox); @@ -179,8 +179,8 @@ public function createElements() $groupsReadCheckbox = new \XoopsFormCheckBox('', 'groupsRead[]', $this->targetObject->getGroupsRead()); - foreach ($this->userGroups as $group_id => $group_name) { - $groupsReadCheckbox->addOption($group_id, $group_name); + foreach ($this->userGroups as $groupId => $groupName) { + $groupsReadCheckbox->addOption($groupId, $groupName); } $readPermissionsTray->addElement($groupsReadCheckbox); $this->addElement($readPermissionsTray); @@ -196,8 +196,8 @@ public function createElements() $submitPermissionsTray->addElement($selectAllSubmitCheckbox); $groupsSubmitCheckbox = new \XoopsFormCheckBox('', 'groupsSubmit[]', $this->targetObject->getGroupsSubmit()); - foreach ($this->userGroups as $group_id => $group_name) { - $groupsSubmitCheckbox->addOption($group_id, $group_name); + foreach ($this->userGroups as $groupId => $groupName) { + $groupsSubmitCheckbox->addOption($groupId, $groupName); } $submitPermissionsTray->addElement($groupsSubmitCheckbox); $this->addElement($submitPermissionsTray); @@ -214,8 +214,8 @@ public function createElements() $groupsModerationCheckbox = new \XoopsFormCheckBox('', 'groupsModeration[]', $this->targetObject->getGroupsModeration()); - foreach ($this->userGroups as $group_id => $group_name) { - $groupsModerationCheckbox->addOption($group_id, $group_name); + foreach ($this->userGroups as $groupId => $groupName) { + $groupsModerationCheckbox->addOption($groupId, $groupName); } $moderatePermissionsTray->addElement($groupsModerationCheckbox); $this->addElement($moderatePermissionsTray); diff --git a/class/Form/ItemForm.php b/class/Form/ItemForm.php index 1750abe2..37acd5df 100644 --- a/class/Form/ItemForm.php +++ b/class/Form/ItemForm.php @@ -233,8 +233,8 @@ public function createElements($obj) || $this->isGranted(Constants::PUBLISHER_DOIMAGE) || $this->isGranted(Constants::PUBLISHER_DOLINEBREAK)) { if ($this->isGranted(Constants::PUBLISHER_DOHTML)) { - $html_radio = new \XoopsFormRadioYN(\_CO_PUBLISHER_DOHTML, 'dohtml', $obj->dohtml(), _YES, _NO); - $this->addElement($html_radio); + $htmlRadio = new \XoopsFormRadioYN(\_CO_PUBLISHER_DOHTML, 'dohtml', $obj->dohtml(), _YES, _NO); + $this->addElement($htmlRadio); } if ($this->isGranted(Constants::PUBLISHER_DOSMILEY)) { $smiley_radio = new \XoopsFormRadioYN(\_CO_PUBLISHER_DOSMILEY, 'dosmiley', $obj->dosmiley(), _YES, _NO); diff --git a/class/Item.php b/class/Item.php index 8e671118..7a4159ea 100644 --- a/class/Item.php +++ b/class/Item.php @@ -254,8 +254,8 @@ public function getBody($maxLength = 0, $format = 'S', $stripTags = '') while (!(false === $wrapPos)) { $endWrapPos = mb_strpos($ret, ']', $wrapPos); if ($endWrapPos) { - $wrap_page_name = mb_substr($ret, $wrapPos + $wrapCodeLength, $endWrapPos - $wrapCodeLength - $wrapPos); - $wrapPages[] = $wrap_page_name; + $wrapPagename = mb_substr($ret, $wrapPos + $wrapCodeLength, $endWrapPos - $wrapCodeLength - $wrapPos); + $wrapPages[] = $wrapPagename; } $wrapPos = mb_strpos($ret, '[pagewrap=', $endWrapPos - 1); } @@ -718,10 +718,10 @@ public function buildMainText($itemPageId = -1, $body = null) public function getImages() { static $ret; - $itemid = $this->getVar('itemid'); - if (!isset($ret[$itemid])) { - $ret[$itemid]['main'] = ''; - $ret[$itemid]['others'] = []; + $itemId = $this->getVar('itemid'); + if (!isset($ret[$itemId])) { + $ret[$itemId]['main'] = ''; + $ret[$itemId]['others'] = []; $imagesIds = []; $image = $this->getVar('image'); $images = $this->getVar('images'); @@ -740,16 +740,16 @@ public function getImages() } foreach ($imageObjs as $id => $imageObj) { if ($id == $image) { - $ret[$itemid]['main'] = $imageObj; + $ret[$itemId]['main'] = $imageObj; } else { - $ret[$itemid]['others'][] = $imageObj; + $ret[$itemId]['others'][] = $imageObj; } unset($imageObj); } unset($imageObjs); } - return $ret[$itemid]; + return $ret[$itemId]; } /** @@ -1048,8 +1048,8 @@ public function accessGranted() public function setVarsFromRequest() { //Required fields - // if (!empty($categoryid = Request::getInt('categoryid', 0, 'POST'))) { - // $this->setVar('categoryid', $categoryid);} + // if (!empty($categoryId = Request::getInt('categoryid', 0, 'POST'))) { + // $this->setVar('categoryid', $categoryId);} if (\is_object($GLOBALS['xoopsUser'])) { $userTimeoffset = $GLOBALS['xoopsUser']->getVar('timezone_offset'); } else { diff --git a/class/ItemHandler.php b/class/ItemHandler.php index 46238fb5..2ae614f4 100644 --- a/class/ItemHandler.php +++ b/class/ItemHandler.php @@ -254,13 +254,13 @@ public function getCount(\CriteriaElement $criteria = null, $notNullFields = nul } /** - * @param int $categoryid + * @param int $categoryId * @param string|array $status * @param string|null $notNullFields * @param null|\CriteriaCompo $criteriaPermissions * @return \CriteriaCompo */ - private function getItemsCriteria($categoryid = -1, $status = '', $notNullFields = null, $criteriaPermissions = null) + private function getItemsCriteria($categoryId = -1, $status = '', $notNullFields = null, $criteriaPermissions = null) { // $notNullFields = (null !== $notNullFields) ?: ''; // global $publisherIsAdmin; @@ -277,8 +277,8 @@ private function getItemsCriteria($categoryid = -1, $status = '', $notNullFields // } // } $criteriaCategory = null; - if (isset($categoryid) && -1 != $categoryid) { - $criteriaCategory = new \Criteria('categoryid', $categoryid); + if (isset($categoryId) && -1 != $categoryId) { + $criteriaCategory = new \Criteria('categoryid', $categoryId); } $criteriaStatus = new \CriteriaCompo(); if (!empty($status) && \is_array($status)) { @@ -303,13 +303,13 @@ private function getItemsCriteria($categoryid = -1, $status = '', $notNullFields } /** - * @param $categoryid + * @param $categoryId * @param string $status * @param string|null $notNullFields * * @return int */ - public function getItemsCount($categoryid = -1, $status = '', $notNullFields = null) + public function getItemsCount($categoryId = -1, $status = '', $notNullFields = null) { $notNullFields = (null !== $notNullFields) ?: ''; $criteriaPermissions = null; @@ -325,11 +325,11 @@ public function getItemsCount($categoryid = -1, $status = '', $notNullFields = n } } // $ret = []; - $criteria = $this->getItemsCriteria($categoryid, $status, $notNullFields, $criteriaPermissions); + $criteria = $this->getItemsCriteria($categoryId, $status, $notNullFields, $criteriaPermissions); /* - if (isset($categoryid) && $categoryid != -1) { - $criteriaCategory = new \Criteria('categoryid', $categoryid); + if (isset($categoryId) && $categoryId != -1) { + $criteriaCategory = new \Criteria('categoryid', $categoryId); } $criteriaStatus = new \CriteriaCompo(); if (!empty($status) && is_array($status)) { @@ -358,7 +358,7 @@ public function getItemsCount($categoryid = -1, $status = '', $notNullFields = n /** * @param int $limit * @param int $start - * @param int $categoryid + * @param int $categoryId * @param string $sort * @param string $order * @param string|null $notNullFields @@ -368,7 +368,7 @@ public function getItemsCount($categoryid = -1, $status = '', $notNullFields = n * * @return array */ - public function getAllPublished($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none', $excludeExpired = true) + public function getAllPublished($limit = 0, $start = 0, $categoryId = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none', $excludeExpired = true) { $notNullFields = (null !== $notNullFields) ?: ''; $otherCriteria = new \CriteriaCompo(); @@ -384,13 +384,13 @@ public function getAllPublished($limit = 0, $start = 0, $categoryid = -1, $sort $otherCriteria->add($criteriaExpire); } - return $this->getItems($limit, $start, [Constants::PUBLISHER_STATUS_PUBLISHED], $categoryid, $sort, $order, $notNullFields, $asObject, $otherCriteria, $idKey); + return $this->getItems($limit, $start, [Constants::PUBLISHER_STATUS_PUBLISHED], $categoryId, $sort, $order, $notNullFields, $asObject, $otherCriteria, $idKey); } /** * @param int $limit * @param int $start - * @param int $categoryid + * @param int $categoryId * @param string $sort * @param string $order * @param string|null $notNullFields @@ -399,14 +399,14 @@ public function getAllPublished($limit = 0, $start = 0, $categoryid = -1, $sort * * @return array */ - public function getAllExpired($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none') + public function getAllExpired($limit = 0, $start = 0, $categoryId = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none') { $notNullFields = (null !== $notNullFields) ?: ''; $otherCriteria = new \CriteriaCompo(); $otherCriteria->add(new \Criteria('dateexpire', \time(), '<=')); $otherCriteria->add(new \Criteria('dateexpire', 0, '>')); - return $this->getItems($limit, $start, -1, $categoryid, $sort, $order, $notNullFields, $asObject, $otherCriteria, $idKey); + return $this->getItems($limit, $start, -1, $categoryId, $sort, $order, $notNullFields, $asObject, $otherCriteria, $idKey); } /** @@ -449,7 +449,7 @@ public function getNextPublished($obj) /** * @param int $limit * @param int $start - * @param int $categoryid + * @param int $categoryId * @param string $sort * @param string $order * @param string|null $notNullFields @@ -458,16 +458,16 @@ public function getNextPublished($obj) * * @return array */ - public function getAllSubmitted($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none') + public function getAllSubmitted($limit = 0, $start = 0, $categoryId = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $idKey = 'none') { $notNullFields = (null !== $notNullFields) ?: ''; - return $this->getItems($limit, $start, [Constants::PUBLISHER_STATUS_SUBMITTED], $categoryid, $sort, $order, $notNullFields, $asObject, null, $idKey); + return $this->getItems($limit, $start, [Constants::PUBLISHER_STATUS_SUBMITTED], $categoryId, $sort, $order, $notNullFields, $asObject, null, $idKey); } /** * @param int $limit * @param int $start - * @param int $categoryid + * @param int $categoryId * @param string $sort * @param string $order * @param string $notNullFields @@ -476,15 +476,15 @@ public function getAllSubmitted($limit = 0, $start = 0, $categoryid = -1, $sort * * @return array */ - public function getAllOffline($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = '', $asObject = true, $idKey = 'none') + public function getAllOffline($limit = 0, $start = 0, $categoryId = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = '', $asObject = true, $idKey = 'none') { - return $this->getItems($limit, $start, [Constants::PUBLISHER_STATUS_OFFLINE], $categoryid, $sort, $order, $notNullFields, $asObject, null, $idKey); + return $this->getItems($limit, $start, [Constants::PUBLISHER_STATUS_OFFLINE], $categoryId, $sort, $order, $notNullFields, $asObject, null, $idKey); } /** * @param int $limit * @param int $start - * @param int $categoryid + * @param int $categoryId * @param string $sort * @param string $order * @param string $notNullFields @@ -493,16 +493,16 @@ public function getAllOffline($limit = 0, $start = 0, $categoryid = -1, $sort = * * @return array */ - public function getAllRejected($limit = 0, $start = 0, $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = '', $asObject = true, $idKey = 'none') + public function getAllRejected($limit = 0, $start = 0, $categoryId = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = '', $asObject = true, $idKey = 'none') { - return $this->getItems($limit, $start, [Constants::PUBLISHER_STATUS_REJECTED], $categoryid, $sort, $order, $notNullFields, $asObject, null, $idKey); + return $this->getItems($limit, $start, [Constants::PUBLISHER_STATUS_REJECTED], $categoryId, $sort, $order, $notNullFields, $asObject, null, $idKey); } /** * @param int $limit * @param int $start * @param array|string $status - * @param int $categoryid + * @param int $categoryId * @param string $sort * @param string $order * @param string|null $notNullFields @@ -512,7 +512,7 @@ public function getAllRejected($limit = 0, $start = 0, $categoryid = -1, $sort = * @return array * @internal param bool $asObject */ - public function getItems($limit = 0, $start = 0, $status = '', $categoryid = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $otherCriteria = null, $idKey = 'none') + public function getItems($limit = 0, $start = 0, $status = '', $categoryId = -1, $sort = 'datesub', $order = 'DESC', $notNullFields = null, $asObject = true, $otherCriteria = null, $idKey = 'none') { $notNullFields = (null !== $notNullFields) ?: ''; $criteriaPermissions = null; @@ -528,10 +528,10 @@ public function getItems($limit = 0, $start = 0, $status = '', $categoryid = -1, } } - $criteria = $this->getItemsCriteria($categoryid, $status, $notNullFields, $criteriaPermissions); + $criteria = $this->getItemsCriteria($categoryId, $status, $notNullFields, $criteriaPermissions); /* - if (isset($categoryid) && $categoryid != -1) { - $criteriaCategory = new \Criteria('categoryid', $categoryid); + if (isset($categoryId) && $categoryId != -1) { + $criteriaCategory = new \Criteria('categoryid', $categoryId); } $criteriaStatus = new \CriteriaCompo(); if (!empty($status) && is_array($status)) { @@ -615,13 +615,13 @@ public function deleteAll(\CriteriaElement $criteria = null, $force = true, $asO } /** - * @param $itemid + * @param $itemId * * @return bool */ - public function updateCounter($itemid) + public function updateCounter($itemId) { - $sql = 'UPDATE ' . $this->db->prefix($this->helper->getDirname() . '_items') . ' SET counter=counter+1 WHERE itemid = ' . $itemid; + $sql = 'UPDATE ' . $this->db->prefix($this->helper->getDirname() . '_items') . ' SET counter=counter+1 WHERE itemid = ' . $itemId; if ($this->db->queryF($sql)) { return true; } diff --git a/class/MimetypeHandler.php b/class/MimetypeHandler.php index c94da16c..4b915151 100644 --- a/class/MimetypeHandler.php +++ b/class/MimetypeHandler.php @@ -163,11 +163,11 @@ public function getArray($mimeExt = null) public function checkMimeTypes($postField) { $ret = false; - $allowed_mimetypes = $this->getArrayByType(); - if (empty($allowed_mimetypes)) { + $allowedMimetypes = $this->getArrayByType(); + if (empty($allowedMimetypes)) { return $ret; } - foreach ($allowed_mimetypes as $mime) { + foreach ($allowedMimetypes as $mime) { if ($mime == $_FILES[$postField]['type']) { $ret = $mime; break; diff --git a/class/Resizer.php b/class/Resizer.php index fab6af3a..7e525726 100644 --- a/class/Resizer.php +++ b/class/Resizer.php @@ -63,27 +63,27 @@ public function resizeImage() // recalc image size based on this->maxWidth/this->maxHeight if ($width > $height) { if ($width < $this->maxWidth) { - $new_width = $width; + $newWidth = $width; } else { - $new_width = $this->maxWidth; - $divisor = $width / $new_width; - $new_height = \floor($height / $divisor); + $newWidth = $this->maxWidth; + $divisor = $width / $newWidth; + $newHeight = \floor($height / $divisor); } } elseif ($height < $this->maxHeight) { - $new_height = $height; + $newHeight = $height; } else { - $new_height = $this->maxHeight; - $divisor = $height / $new_height; - $new_width = \floor($width / $divisor); + $newHeight = $this->maxHeight; + $divisor = $height / $newHeight; + $newWidth = \floor($width / $divisor); } // Create a new temporary image. - $tmpimg = \imagecreatetruecolor($new_width, $new_height); + $tmpimg = \imagecreatetruecolor($newWidth, $newHeight); imagealphablending($tmpimg, false); imagesavealpha($tmpimg, true); // Copy and resize old image into new image. - \imagecopyresampled($tmpimg, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height); + \imagecopyresampled($tmpimg, $img, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); \unlink($this->endFile); //compressing the file @@ -139,23 +139,23 @@ public function resizeAndCrop() // RESIZE IMAGE AND PRESERVE PROPORTIONS $max_width_resize = $this->maxWidth; - $max_height_resize = $this->maxHeight; + $maxHeightResize = $this->maxHeight; if ($original_w > $original_h) { $max_height_ratio = $this->maxHeight / $original_h; $max_width_resize = (int)\round($original_w * $max_height_ratio); } else { $max_width_ratio = $this->maxWidth / $original_w; - $max_height_resize = (int)\round($original_h * $max_width_ratio); + $maxHeightResize = (int)\round($original_h * $max_width_ratio); } if ($max_width_resize < $this->maxWidth) { $max_height_ratio = $this->maxWidth / $max_width_resize; - $max_height_resize = (int)\round($this->maxHeight * $max_height_ratio); + $maxHeightResize = (int)\round($this->maxHeight * $max_height_ratio); $max_width_resize = $this->maxWidth; } // CREATE THE PROPORTIONAL IMAGE RESOURCE - $thumb = \imagecreatetruecolor($max_width_resize, $max_height_resize); - if (!\imagecopyresampled($thumb, $original, 0, 0, 0, 0, $max_width_resize, $max_height_resize, $original_w, $original_h)) { + $thumb = \imagecreatetruecolor($max_width_resize, $maxHeightResize); + if (!\imagecopyresampled($thumb, $original, 0, 0, 0, 0, $max_width_resize, $maxHeightResize, $original_w, $original_h)) { return false; } // CREATE THE CENTERED CROPPED IMAGE TO THE SPECIFIED DIMENSIONS @@ -166,10 +166,10 @@ public function resizeAndCrop() if ($this->maxWidth < $max_width_resize) { $max_width_offset = (int)\round(($max_width_resize - $this->maxWidth) / 2); } else { - $max_height_offset = (int)\round(($max_height_resize - $this->maxHeight) / 2); + $max_height_offset = (int)\round(($maxHeightResize - $this->maxHeight) / 2); } - if (!\imagecopy($final, $thumb, 0, 0, $max_width_offset, $max_height_offset, $max_width_resize, $max_height_resize)) { + if (!\imagecopy($final, $thumb, 0, 0, $max_width_offset, $max_height_offset, $max_width_resize, $maxHeightResize)) { return false; } // STORE THE FINAL IMAGE - WILL OVERWRITE $this->endFile diff --git a/class/Utility.php b/class/Utility.php index 6392c0cf..3424004e 100644 --- a/class/Utility.php +++ b/class/Utility.php @@ -341,7 +341,7 @@ public static function editCategory($showmenu = false, $categoryId = 0, $nbSubCa echo ''; } } else { - $itemid = -1; + $itemId = -1; echo ''; echo "" . \_AM_PUBLISHER_NOITEMS . ''; echo ''; diff --git a/docs/ajaxrating.txt b/docs/ajaxrating.txt index 26878bc9..28a18002 100644 --- a/docs/ajaxrating.txt +++ b/docs/ajaxrating.txt @@ -109,7 +109,7 @@ CREATE TABLE `ratings` ( $dbpass = '###'; $dbname = '###'; $tableName = 'ratings'; - $rating_unitwidth = 30; + $ratingUnitWidth = 30; ============================================================================= diff --git a/file.php b/file.php index e1eece90..9a15f456 100644 --- a/file.php +++ b/file.php @@ -81,15 +81,15 @@ $oldfile = $fileObj->getFilePath(); // Get available mimetypes for file uploading - $allowed_mimetypes = $helper->getHandler('Mimetype')->getArrayByType(); + $allowedMimetypes = $helper->getHandler('Mimetype')->getArrayByType(); // TODO : display the available mimetypes to the user $errors = []; // if ($helper->getConfig('perm_upload') && is_uploaded_file(Request::getArray('item_upload_file', array(), 'FILES')['tmp_name'])) { $temp = Request::getArray('item_upload_file', [], 'FILES'); if ($helper->getConfig('perm_upload') && is_uploaded_file($temp['tmp_name'])) { - if ($fileObj->checkUpload('item_upload_file', $allowed_mimetypes, $errors)) { - if ($fileObj->storeUpload('item_upload_file', $allowed_mimetypes, $errors)) { + if ($fileObj->checkUpload('item_upload_file', $allowedMimetypes, $errors)) { + if ($fileObj->storeUpload('item_upload_file', $allowedMimetypes, $errors)) { unlink($oldfile); } } diff --git a/include/ajax_rating.php b/include/ajax_rating.php index 1dfc108d..8fb15730 100644 --- a/include/ajax_rating.php +++ b/include/ajax_rating.php @@ -33,7 +33,7 @@ //getting the values $rating = Request::getInt('rating', 0, 'GET'); -$itemid = Request::getInt('itemid', 0, 'GET'); +$itemId = Request::getInt('itemid', 0, 'GET'); $helper->loadLanguage('main'); $groups = $GLOBALS['xoopsUser'] ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS; @@ -41,31 +41,31 @@ $grouppermHandler = $helper->getHandler('GroupPerm'); /** @var XoopsConfigHandler $configHandler */ $configHandler = xoops_getHandler('config'); -$module_id = $helper->getModule()->getVar('mid'); +$moduleId = $helper->getModule()->getVar('mid'); //Checking permissions -//if (!$helper->getConfig('perm_rating') || !$grouppermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $module_id)) { -// $output = "unit_long$itemid|" . _NOPERM . "\n"; +//if (!$helper->getConfig('perm_rating') || !$grouppermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $moduleId)) { +// $output = "unit_long$itemId|" . _NOPERM . "\n"; // echo $output; // exit(); //} try { - if (!$helper->getConfig('perm_rating') || !$grouppermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $module_id)) { + if (!$helper->getConfig('perm_rating') || !$grouppermHandler->checkRight('global', _PUBLISHER_RATE, $groups, $moduleId)) { throw new RuntimeException(_NOPERM); } } catch (\Throwable $e) { $helper->addLog($e); // redirect_header('', 1, _NOPERM); - $output = "unit_long$itemid|" . _NOPERM . "\n"; + $output = "unit_long$itemId|" . _NOPERM . "\n"; echo $output; } -$rating_unitwidth = 30; +$ratingUnitWidth = 30; $units = 5; //if ($rating > 5 || $rating < 1) { -// $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_BAD . "\n"; +// $output = "unit_long$itemId|" . _MD_PUBLISHER_VOTE_BAD . "\n"; // echo $output; // exit(); //} @@ -77,29 +77,29 @@ } catch (\Throwable $e) { $helper->addLog($e); // redirect_header('', 1, _NOPERM); - $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_BAD . "\n"; + $output = "unit_long$itemId|" . _MD_PUBLISHER_VOTE_BAD . "\n"; echo $output; } -$criteria = new \Criteria('itemid', $itemid); +$criteria = new \Criteria('itemid', $itemId); $ratingObjs = $helper->getHandler('Rating')->getObjects($criteria); $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; $count = count($ratingObjs); -$current_rating = 0; +$currentRating = 0; $voted = false; $ip = getenv('REMOTE_ADDR'); /** @var Publisher\Rating $ratingObj */ foreach ($ratingObjs as $ratingObj) { - $current_rating += $ratingObj->getVar('rate'); + $currentRating += $ratingObj->getVar('rate'); if ($ratingObj->getVar('ip') == $ip || ($uid > 0 && $uid == $ratingObj->getVar('uid'))) { $voted = true; } } //if ($voted) { -// $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_ALREADY . "\n"; +// $output = "unit_long$itemId|" . _MD_PUBLISHER_VOTE_ALREADY . "\n"; // echo $output; // exit(); //} @@ -111,49 +111,49 @@ } catch (\Throwable $e) { $helper->addLog($e); // redirect_header('', 1, _NOPERM); - $output = "unit_long$itemid|" . _MD_PUBLISHER_VOTE_ALREADY . "\n"; + $output = "unit_long$itemId|" . _MD_PUBLISHER_VOTE_ALREADY . "\n"; echo $output; } $newRatingObj = $helper->getHandler('Rating')->create(); -$newRatingObj->setVar('itemid', $itemid); +$newRatingObj->setVar('itemid', $itemId); $newRatingObj->setVar('ip', $ip); $newRatingObj->setVar('uid', $uid); $newRatingObj->setVar('rate', $rating); $newRatingObj->setVar('date', time()); $helper->getHandler('Rating')->insert($newRatingObj); -$current_rating += $rating; +$currentRating += $rating; ++$count; -$helper->getHandler('Item')->updateAll('rating', number_format($current_rating / $count, 4), $criteria, true); +$helper->getHandler('Item')->updateAll('rating', number_format($currentRating / $count, 4), $criteria, true); $helper->getHandler('Item')->updateAll('votes', $count, $criteria, true); $tense = 1 == $count ? _MD_PUBLISHER_VOTE_VOTE : _MD_PUBLISHER_VOTE_VOTES; //plural form votes/vote -// $new_back is what gets 'drawn' on your page after a successful 'AJAX/Javascript' vote -$new_back = []; - -$new_back[] .= '
    '; -$new_back[] .= '
    ' . _MD_PUBLISHER_VOTE_RATING . '
    '; -$new_back[] .= '
    1
    '; -$new_back[] .= '
    2
    '; -$new_back[] .= '
    3
    '; -$new_back[] .= '
    4
    '; -$new_back[] .= '
    5
    '; -$new_back[] .= '
    6
    '; -$new_back[] .= '
    7
    '; -$new_back[] .= '
    8
    '; -$new_back[] .= '
    9
    '; -$new_back[] .= '
    10
    '; -$new_back[] .= '
    '; -$new_back[] .= '
    ' . _MD_PUBLISHER_VOTE_RATING . ' ' . (0 !== $count ? number_format($current_rating / $count, 2) : 0) . '/' . $units . ' (' . $count . ' ' . $tense . ')
    '; -$new_back[] .= '
    ' . _MD_PUBLISHER_VOTE_THANKS . '
    '; - -$allnewback = implode("\n", $new_back); +// $newBack is what gets 'drawn' on your page after a successful 'AJAX/Javascript' vote +$newBack = []; + +$newBack[] .= '
    '; +$newBack[] .= '
    ' . _MD_PUBLISHER_VOTE_RATING . '
    '; +$newBack[] .= '
    1
    '; +$newBack[] .= '
    2
    '; +$newBack[] .= '
    3
    '; +$newBack[] .= '
    4
    '; +$newBack[] .= '
    5
    '; +$newBack[] .= '
    6
    '; +$newBack[] .= '
    7
    '; +$newBack[] .= '
    8
    '; +$newBack[] .= '
    9
    '; +$newBack[] .= '
    10
    '; +$newBack[] .= '
    '; +$newBack[] .= '
    ' . _MD_PUBLISHER_VOTE_RATING . ' ' . (0 !== $count ? number_format($currentRating / $count, 2) : 0) . '/' . $units . ' (' . $count . ' ' . $tense . ')
    '; +$newBack[] .= '
    ' . _MD_PUBLISHER_VOTE_THANKS . '
    '; + +$allnewback = implode("\n", $newBack); // ======================== //name of the div id to be updated | the html that needs to be changed -$output = "unit_long$itemid|$allnewback"; +$output = "unit_long$itemId|$allnewback"; echo $output; diff --git a/include/ajax_upload.php b/include/ajax_upload.php index 2fab85f0..3b90055c 100644 --- a/include/ajax_upload.php +++ b/include/ajax_upload.php @@ -37,15 +37,15 @@ } $filename = basename($_FILES['publisher_upload_file']['name']); -$image_nicename = Request::getString('image_nicename', '', 'POST'); -if ('' == $image_nicename || _CO_PUBLISHER_IMAGE_NICENAME == $image_nicename) { - $image_nicename = $filename; +$imageNiceName = Request::getString('image_nicename', '', 'POST'); +if ('' == $imageNiceName || _CO_PUBLISHER_IMAGE_NICENAME == $imageNiceName) { + $imageNiceName = $filename; } -$imgcat_id = Request::getInt('imgcat_id', 0, 'POST'); +$imgcatId = Request::getInt('imgcat_id', 0, 'POST'); $imgcatHandler = xoops_getHandler('imagecategory'); -$imgcat = $imgcatHandler->get($imgcat_id); +$imgcat = $imgcatHandler->get($imgcatId); $error = false; if (!is_object($imgcat)) { @@ -54,10 +54,10 @@ /** @var XoopsGroupPermHandler $imgcatpermHandler */ $imgcatpermHandler = xoops_getHandler('groupperm'); if (is_object($GLOBALS['xoopsUser'])) { - if (!$imgcatpermHandler->checkRight('imgcat_write', $imgcat_id, $GLOBALS['xoopsUser']->getGroups())) { + if (!$imgcatpermHandler->checkRight('imgcat_write', $imgcatId, $GLOBALS['xoopsUser']->getGroups())) { $error = _CO_PUBLISHER_IMAGE_CAT_NONE; } - } elseif (!$imgcatpermHandler->checkRight('imgcat_write', $imgcat_id, XOOPS_GROUP_ANONYMOUS)) { + } elseif (!$imgcatpermHandler->checkRight('imgcat_write', $imgcatId, XOOPS_GROUP_ANONYMOUS)) { $error = _CO_PUBLISHER_IMAGE_CAT_NOPERM; } } @@ -76,12 +76,12 @@ $savedFilename = $uploader->getSavedFileName(); $imageMimetype = $uploader->getMediaType(); $image->setVar('image_name', 'images/' . $savedFilename); - $image->setVar('image_nicename', $image_nicename); + $image->setVar('image_nicename', $imageNiceName); $image->setVar('image_mimetype', $imageMimetype); $image->setVar('image_created', time()); $image->setVar('image_display', 1); $image->setVar('image_weight', 0); - $image->setVar('imgcat_id', $imgcat_id); + $image->setVar('imgcat_id', $imgcatId); if ('db' === $imgcat->getVar('imgcat_storetype')) { $fp = @fopen($uploader->getSavedDestination(), 'rb'); $fbinary = @fread($fp, filesize($uploader->getSavedDestination())); diff --git a/include/plugin.tag.php b/include/plugin.tag.php index 98ab0100..17f70a1f 100644 --- a/include/plugin.tag.php +++ b/include/plugin.tag.php @@ -35,21 +35,21 @@ function publisher_tag_iteminfo(&$items) return false; } - $items_id = []; + $itemsIds = []; foreach (array_keys($items) as $cat_id) { // Some handling here to build the link upon cat_id // if cat_id is not used, just skip it - foreach (array_keys($items[$cat_id]) as $item_id) { + foreach (array_keys($items[$cat_id]) as $itemId) { // In article, the item_id is "art_id" - $items_id[] = (int)$item_id; + $itemsIds[] = (int)$itemId; } } - $items_id = array_unique($items_id); // remove duplicate ids + $itemsIds = array_unique($itemsIds); // remove duplicate ids $helper = \XoopsModules\Publisher\Helper::getInstance(); /** @var Publisher\ItemHandler $itemHandler */ $itemHandler = $helper->getHandler('Item'); - $criteria = new \Criteria('itemid', '(' . implode(', ', $items_id) . ')', 'IN'); + $criteria = new \Criteria('itemid', '(' . implode(', ', $itemsIds) . ')', 'IN'); $items_obj = $itemHandler->getObjects($criteria, 'itemid'); //make sure Tag module tag_parse_tag() can be found @@ -64,12 +64,12 @@ function publisher_tag_iteminfo(&$items) /** @var Publisher\Item $item_obj */ foreach (array_keys($items) as $cat_id) { - foreach (array_keys($items[$cat_id]) as $item_id) { - $item_obj = $items_obj[$item_id]; - $items[$cat_id][$item_id] = [ + foreach (array_keys($items[$cat_id]) as $itemId) { + $item_obj = $items_obj[$itemId]; + $items[$cat_id][$itemId] = [ 'title' => $item_obj->getVar('title'), 'uid' => $item_obj->getVar('uid'), - 'link' => "item.php?itemid={$item_id}", + 'link' => "item.php?itemid={$itemId}", 'time' => $item_obj->getVar('datesub'), 'tags' => $parse_function($item_obj->getVar('item_tag', 'n')), // optional 'content' => '', diff --git a/index.php b/index.php index 9ca18d1c..e42b0f06 100644 --- a/index.php +++ b/index.php @@ -88,17 +88,17 @@ if (isset($subcats[$catId])) { foreach ($subcats[$catId] as $key => $subcat) { // Get the items count of this very category - $subcat_total_items = $totalItems[$key] ?? 0; + $subcatTotalItems = $totalItems[$key] ?? 0; // Do we display empty sub-cats ? - if (($subcat_total_items > 0) || ('all' === $helper->getConfig('idxcat_show_subcats'))) { - $subcat_id = $subcat->getVar('categoryid'); + if (($subcatTotalItems > 0) || ('all' === $helper->getConfig('idxcat_show_subcats'))) { + $subcatId = $subcat->getVar('categoryid'); // if we retrieved the last item object for this category - if (isset($lastItemObj[$subcat_id])) { - $subcat->setVar('last_itemid', $lastItemObj[$subcat_id]->itemid()); - $subcat->setVar('last_title_link', $lastItemObj[$subcat_id]->getItemLink(false, $lastitemsize)); + if (isset($lastItemObj[$subcatId])) { + $subcat->setVar('last_itemid', $lastItemObj[$subcatId]->itemid()); + $subcat->setVar('last_title_link', $lastItemObj[$subcatId]->getItemLink(false, $lastitemsize)); } - $numItems = isset($totalItems[$subcat_id]) ? $totalItems[$key] : 0; + $numItems = isset($totalItems[$subcatId]) ? $totalItems[$key] : 0; $subcat->setVar('itemcount', $numItems); // Put this subcat in the smarty variable $categories[$catId]['subcats'][$key] = $subcat->toArrayTable(); diff --git a/makepdf.php b/makepdf.php index 02e12b29..cdc7e59d 100644 --- a/makepdf.php +++ b/makepdf.php @@ -15,9 +15,9 @@ require_once __DIR__ . '/header.php'; -$itemid = Request::getInt('itemid', 0, 'GET'); -$item_page_id = Request::getInt('page', -1, 'GET'); -if (0 == $itemid) { +$itemId = Request::getInt('itemid', 0, 'GET'); +$itemPageId = Request::getInt('page', -1, 'GET'); +if (0 == $itemId) { redirect_header('', 1, _MD_PUBLISHER_NOITEMSELECTED); } @@ -25,7 +25,7 @@ require_once XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php'; // Creating the item object for the selected item -$itemObj = $helper->getHandler('Item')->get($itemid); +$itemObj = $helper->getHandler('Item')->get($itemId); // if the selected item was not found, exit if (!$itemObj) { @@ -53,7 +53,7 @@ if ('' != $mainImage['image_path']) { $content .= '' . $myts->undoHtmlSpecialChars($mainImage['image_name']) . '
    '; } -$content .= '' . $myts->undoHtmlSpecialChars($itemObj->getTitle()) . ''; +$content .= '' . $myts->undoHtmlSpecialChars($itemObj->getTitle()) . ''; $content .= '
    ' . _CO_PUBLISHER_CATEGORY . ' : debug(3, "URL hostname {$this->url['host']} matches $site so allowing."); $allowed = true; } } if (!$allowed) { - return $this->error('You may not fetch images from that site. To enable this site in timthumb, you can either add it to $ALLOWED_SITES and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.'); + return $this->error('You may not fetch images from that site. To enable this site in timthumb, you can either add it to $allowedSites and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.'); } } } @@ -718,7 +718,7 @@ protected function processImageAndWriteToCache($localImage) // get standard input properties $newWidth = (int)abs($this->param('w', 0)); $newHeight = (int)abs($this->param('h', 0)); - $zoom_crop = (int)$this->param('zc', DEFAULT_ZC); + $zoomCrop = (int)$this->param('zc', DEFAULT_ZC); $quality = (int)abs($this->param('q', DEFAULT_Q)); $align = $this->cropTop ? 't' : $this->param('a', 'c'); $filters = $this->param('f', DEFAULT_F); @@ -759,7 +759,7 @@ protected function processImageAndWriteToCache($localImage) } // scale down and add borders - if (3 == $zoom_crop) { + if (3 == $zoomCrop) { $final_height = $height * ($newWidth / $width); if ($final_height > $newHeight) { @@ -796,7 +796,7 @@ protected function processImageAndWriteToCache($localImage) // Completely fill the background of the new image with allocated color. imagefill($canvas, 0, 0, $color); // scale down and add borders - if (2 == $zoom_crop) { + if (2 == $zoomCrop) { $final_height = $height * ($newWidth / $width); if ($final_height > $newHeight) { $origin_x = $newWidth / 2; @@ -812,7 +812,7 @@ protected function processImageAndWriteToCache($localImage) // Restore transparency blending imagesavealpha($canvas, true); - if ($zoom_crop > 0) { + if ($zoomCrop > 0) { $src_x = $src_y = 0; $src_w = $width; $src_h = $height; @@ -1299,7 +1299,7 @@ protected function sendImageHeaders($mimeType, $dataSize) if ('image/jpg' === mb_strtolower($mimeType)) { $mimeType = 'image/jpeg'; } - $gmdate_expires = gmdate('D, d M Y H:i:s', strtotime('now +10 days')) . ' GMT'; + $gmdateExpires = gmdate('D, d M Y H:i:s', strtotime('now +10 days')) . ' GMT'; $gmdate_modified = gmdate('D, d M Y H:i:s') . ' GMT'; // send content headers then display image header('Content-Type: ' . $mimeType); @@ -1314,7 +1314,7 @@ protected function sendImageHeaders($mimeType, $dataSize) } else { $this->debug(3, 'Browser caching is enabled'); header('Cache-Control: max-age=' . BROWSER_CACHE_MAX_AGE . ', must-revalidate'); - header('Expires: ' . $gmdate_expires); + header('Expires: ' . $gmdateExpires); } return true; @@ -1458,28 +1458,28 @@ protected function setMemoryLimit() } /** - * @param $size_str + * @param $sizeString * * @return int */ - protected static function returnBytes($size_str) + protected static function returnBytes($sizeString) { - switch (mb_substr($size_str, -1)) { + switch (mb_substr($sizeString, -1)) { case 'M': case 'm': - return (int)$size_str * 1048576; + return (int)$sizeString * 1048576; case 'K': case 'k': - return (int)$size_str * 1024; + return (int)$sizeString * 1024; case 'G': case 'g': - return (int)$size_str * 1073741824; + return (int)$sizeString * 1073741824; default: - return $size_str; + return $sizeString; } }