@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $retVal['parent'][] = [ |
| 45 | 45 | 'id' => $id, |
| 46 | 46 | 'title' => $myts->htmlSpecialChars($title), |
| 47 | - 'url' => $helper->url('index.php?cat_id=' . $id), |
|
| 47 | + 'url' => $helper->url('index.php?cat_id='.$id), |
|
| 48 | 48 | ]; |
| 49 | 49 | } |
| 50 | 50 | return $retVal; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | if ($dirInfo->isDir()) { |
| 54 | 54 | // The directory exists so delete it |
| 55 | 55 | if (false === $utility::rrmdir($old_dir)) { |
| 56 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
| 56 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
| 57 | 57 | $success = false; |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | use XoopsModules\Xoopsfaq; |
| 21 | 21 | |
| 22 | -require dirname(__DIR__) . '/preloads/autoloader.php'; |
|
| 22 | +require dirname(__DIR__).'/preloads/autoloader.php'; |
|
| 23 | 23 | |
| 24 | 24 | $moduleDirName = basename(dirname(__DIR__)); |
| 25 | 25 | $moduleDirNameUpper = mb_strtoupper($moduleDirName); |
@@ -44,33 +44,33 @@ discard block |
||
| 44 | 44 | //$pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
| 45 | 45 | //$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
| 46 | 46 | |
| 47 | -if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
|
| 48 | - define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
|
| 49 | - define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
| 50 | - define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
| 51 | - define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/'); |
|
| 52 | - define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
|
| 53 | - define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images'); |
|
| 54 | - define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
|
| 55 | - define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
|
| 56 | - define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
|
| 47 | +if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) { |
|
| 48 | + define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__))); |
|
| 49 | + define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
| 50 | + define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
| 51 | + define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/'); |
|
| 52 | + define($moduleDirNameUpper.'_IMAGE_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/'); |
|
| 53 | + define($moduleDirNameUpper.'_IMAGE_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images'); |
|
| 54 | + define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/'); |
|
| 55 | + define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/'); |
|
| 56 | + define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php'); |
|
| 57 | 57 | // define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
| 58 | - define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
| 59 | - define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
| 60 | - define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', $pathIcon32 . '/xoopsmicrobutton.gif'); |
|
| 61 | - define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
|
| 58 | + define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
| 59 | + define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
| 60 | + define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', $pathIcon32.'/xoopsmicrobutton.gif'); |
|
| 61 | + define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $icons = [ |
| 65 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
|
| 66 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
|
| 67 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
|
| 68 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
|
| 69 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
|
| 70 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
|
| 71 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
|
| 72 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
|
| 73 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
|
| 65 | + 'edit' => "<img src='".$pathIcon16."/edit.png' alt="._EDIT."' align='middle'>", |
|
| 66 | + 'delete' => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>", |
|
| 67 | + 'clone' => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>", |
|
| 68 | + 'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>", |
|
| 69 | + 'print' => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>", |
|
| 70 | + 'pdf' => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>", |
|
| 71 | + 'add' => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>", |
|
| 72 | + '0' => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>", |
|
| 73 | + '1' => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>", |
|
| 74 | 74 | ]; |
| 75 | 75 | |
| 76 | 76 | $debug = false; |
@@ -83,12 +83,12 @@ discard block |
||
| 83 | 83 | $GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | -$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
|
| 86 | +$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL.'/modules/'.$moduleDirName); |
|
| 87 | 87 | // Local icons path |
| 88 | 88 | if (is_object($helper->getModule())) { |
| 89 | 89 | $pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
| 90 | 90 | $pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
| 91 | 91 | |
| 92 | - $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
| 92 | + $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16); |
|
| 93 | 93 | $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
| 94 | 94 | } |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $queryarrayHold = $queryarray; |
| 66 | 66 | if ((is_array($queryarray)) && !empty($queryarray)) { |
| 67 | - $criteria->add(new \Criteria('category_title', '%' . $queryarray[0] . '%', 'LIKE')); |
|
| 67 | + $criteria->add(new \Criteria('category_title', '%'.$queryarray[0].'%', 'LIKE')); |
|
| 68 | 68 | array_shift($queryarray); //get rid of first element |
| 69 | 69 | foreach ($queryarray as $query) { |
| 70 | - $criteria->add(new \Criteria('category_title', '%' . $query . '%', 'LIKE'), $andor); |
|
| 70 | + $criteria->add(new \Criteria('category_title', '%'.$query.'%', 'LIKE'), $andor); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | $catArray = $contentsHandler->getAll($criteria, $contentFields, false); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | foreach ($catArray as $cId => $cat) { |
| 77 | 77 | $ret[] = [ |
| 78 | 78 | 'image' => 'assets/images/folder.png', |
| 79 | - 'link' => $helper->url('index.php?cat_id=' . $cId), |
|
| 79 | + 'link' => $helper->url('index.php?cat_id='.$cId), |
|
| 80 | 80 | 'title' => $cat['category_title'], |
| 81 | 81 | ]; |
| 82 | 82 | } |
@@ -94,20 +94,20 @@ discard block |
||
| 94 | 94 | $criteria->setStart((int)$offset); |
| 95 | 95 | |
| 96 | 96 | if ((is_array($queryarray)) && !empty($queryarray)) { |
| 97 | - $criteria->add(new \Criteria('contents_title', '%' . $queryarray[0] . '%', 'LIKE')); |
|
| 98 | - $criteria->add(new \Criteria('contents_contents', '%' . $queryarray[0] . '%', 'LIKE'), 'OR'); |
|
| 97 | + $criteria->add(new \Criteria('contents_title', '%'.$queryarray[0].'%', 'LIKE')); |
|
| 98 | + $criteria->add(new \Criteria('contents_contents', '%'.$queryarray[0].'%', 'LIKE'), 'OR'); |
|
| 99 | 99 | array_shift($queryarray); //get rid of first element |
| 100 | 100 | |
| 101 | 101 | foreach ($queryarray as $query) { |
| 102 | - $criteria->add(new \Criteria('contents_title', '%' . $query . '%', 'LIKE'), $andor); |
|
| 103 | - $criteria->add(new \Criteria('contents_contents', '%' . $query . '%', 'LIKE'), 'OR'); |
|
| 102 | + $criteria->add(new \Criteria('contents_title', '%'.$query.'%', 'LIKE'), $andor); |
|
| 103 | + $criteria->add(new \Criteria('contents_contents', '%'.$query.'%', 'LIKE'), 'OR'); |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | $contentArray = $contentsHandler->getAll($criteria, $contentFields, false); |
| 107 | 107 | foreach ($contentArray as $content) { |
| 108 | 108 | $ret[] = [ |
| 109 | 109 | 'image' => 'assets/images/question2.gif', |
| 110 | - 'link' => $helper->url('index.php?cat_id=' . $content['contents_cid'] . '#q' . $content['contents_id']), |
|
| 110 | + 'link' => $helper->url('index.php?cat_id='.$content['contents_cid'].'#q'.$content['contents_id']), |
|
| 111 | 111 | 'title' => $content['contents_title'], |
| 112 | 112 | 'time' => $content['contents_publish'], |
| 113 | 113 | ]; |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | if ((!defined('XOOPS_ROOT_PATH')) |
| 30 | 30 | || !($GLOBALS['xoopsUser'] instanceof XoopsUser) |
| 31 | 31 | || !($GLOBALS['xoopsUser']->isAdmin())) { |
| 32 | - exit('Restricted access' . PHP_EOL); |
|
| 32 | + exit('Restricted access'.PHP_EOL); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if ((!defined('XOOPS_ROOT_PATH')) |
| 32 | 32 | || !($GLOBALS['xoopsUser'] instanceof XoopsUser) |
| 33 | 33 | || !($GLOBALS['xoopsUser']->isAdmin())) { |
| 34 | - exit('Restricted access' . PHP_EOL); |
|
| 34 | + exit('Restricted access'.PHP_EOL); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $queryarrayHold = $queryarray; |
| 66 | 66 | if ((is_array($queryarray)) && !empty($queryarray)) { |
| 67 | - $criteria->add(new \Criteria('category_title', '%' . $queryarray[0] . '%', 'LIKE')); |
|
| 67 | + $criteria->add(new \Criteria('category_title', '%'.$queryarray[0].'%', 'LIKE')); |
|
| 68 | 68 | array_shift($queryarray); //get rid of first element |
| 69 | 69 | foreach ($queryarray as $query) { |
| 70 | - $criteria->add(new \Criteria('category_title', '%' . $query . '%', 'LIKE'), $andor); |
|
| 70 | + $criteria->add(new \Criteria('category_title', '%'.$query.'%', 'LIKE'), $andor); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | $catArray = $contentsHandler->getAll($criteria, $contentFields, false); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | foreach ($catArray as $cId => $cat) { |
| 77 | 77 | $ret[] = [ |
| 78 | 78 | 'image' => 'assets/images/folder.png', |
| 79 | - 'link' => $helper->url('index.php?cat_id=' . $cId), |
|
| 79 | + 'link' => $helper->url('index.php?cat_id='.$cId), |
|
| 80 | 80 | 'title' => $cat['category_title'], |
| 81 | 81 | ]; |
| 82 | 82 | } |
@@ -94,20 +94,20 @@ discard block |
||
| 94 | 94 | $criteria->setStart((int)$offset); |
| 95 | 95 | |
| 96 | 96 | if ((is_array($queryarray)) && !empty($queryarray)) { |
| 97 | - $criteria->add(new \Criteria('contents_title', '%' . $queryarray[0] . '%', 'LIKE')); |
|
| 98 | - $criteria->add(new \Criteria('contents_contents', '%' . $queryarray[0] . '%', 'LIKE'), 'OR'); |
|
| 97 | + $criteria->add(new \Criteria('contents_title', '%'.$queryarray[0].'%', 'LIKE')); |
|
| 98 | + $criteria->add(new \Criteria('contents_contents', '%'.$queryarray[0].'%', 'LIKE'), 'OR'); |
|
| 99 | 99 | array_shift($queryarray); //get rid of first element |
| 100 | 100 | |
| 101 | 101 | foreach ($queryarray as $query) { |
| 102 | - $criteria->add(new \Criteria('contents_title', '%' . $query . '%', 'LIKE'), $andor); |
|
| 103 | - $criteria->add(new \Criteria('contents_contents', '%' . $query . '%', 'LIKE'), 'OR'); |
|
| 102 | + $criteria->add(new \Criteria('contents_title', '%'.$query.'%', 'LIKE'), $andor); |
|
| 103 | + $criteria->add(new \Criteria('contents_contents', '%'.$query.'%', 'LIKE'), 'OR'); |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | $contentArray = $contentsHandler->getAll($criteria, $contentFields, false); |
| 107 | 107 | foreach ($contentArray as $content) { |
| 108 | 108 | $ret[] = [ |
| 109 | 109 | 'image' => 'assets/images/question2.gif', |
| 110 | - 'link' => $helper->url('index.php?cat_id=' . $content['contents_cid'] . '#q' . $content['contents_id']), |
|
| 110 | + 'link' => $helper->url('index.php?cat_id='.$content['contents_cid'].'#q'.$content['contents_id']), |
|
| 111 | 111 | 'title' => $content['contents_title'], |
| 112 | 112 | 'time' => $content['contents_publish'], |
| 113 | 113 | ]; |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | if (!empty($catsToUse)) { |
| 73 | - $criteria->add(new \Criteria('contents_cid', '(' . implode(',', $catsToUse) . ')', 'IN')); |
|
| 73 | + $criteria->add(new \Criteria('contents_cid', '('.implode(',', $catsToUse).')', 'IN')); |
|
| 74 | 74 | } else { |
| 75 | 75 | return $block; |
| 76 | 76 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | if (!empty($catsToUse)) { |
| 68 | - $criteria->add(new \Criteria('contents_cid', '(' . implode(',', $catsToUse) . ')', 'IN')); |
|
| 68 | + $criteria->add(new \Criteria('contents_cid', '('.implode(',', $catsToUse).')', 'IN')); |
|
| 69 | 69 | } else { |
| 70 | 70 | return $block; |
| 71 | 71 | } |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | 'title' => _MB_XOOPSFAQ_RANDOM_TITLE, |
| 87 | 87 | 'faq' => $faq, |
| 88 | 88 | 'faqans' => $faqAns, |
| 89 | - 'morelink' => $helper->url('index.php?cat_id=' . $cid . '#q' . $xpFaqObj->getVar('contents_id')), |
|
| 89 | + 'morelink' => $helper->url('index.php?cat_id='.$cid.'#q'.$xpFaqObj->getVar('contents_id')), |
|
| 90 | 90 | 'linktxt' => _MB_XOOPSFAQ_SEE_MORE, |
| 91 | - 'catlink' => $helper->url('index.php?cat_id=' . $cid), |
|
| 91 | + 'catlink' => $helper->url('index.php?cat_id='.$cid), |
|
| 92 | 92 | 'cattxt' => $catObj->getVar('category_title'), |
| 93 | 93 | ]; |
| 94 | 94 | unset($xpFaqObj, $catObj); |
@@ -122,6 +122,6 @@ discard block |
||
| 122 | 122 | $formSelect->setValue($selOptions); |
| 123 | 123 | $selectCat = $formSelect->render(); |
| 124 | 124 | |
| 125 | - $form = '<div class="line140">' . _MB_XOOPSFAQ_CHARS . ' ' . '<input type="number" name="options[0]" value="' . $options[0] . '" style="width: 5em;" min="0" class="right"> ' . _MB_XOOPSFAQ_LENGTH . '<br><br>' . _MB_XOOPSFAQ_ALL_CATS_INTRO . ' ' . $selectCat . '</div>'; |
|
| 125 | + $form = '<div class="line140">'._MB_XOOPSFAQ_CHARS.' '.'<input type="number" name="options[0]" value="'.$options[0].'" style="width: 5em;" min="0" class="right"> '._MB_XOOPSFAQ_LENGTH.'<br><br>'._MB_XOOPSFAQ_ALL_CATS_INTRO.' '.$selectCat.'</div>'; |
|
| 126 | 126 | return $form; |
| 127 | 127 | } |