Completed
Push — master ( deff52...719c50 )
by Michael
02:17
created
include/onupdate.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
     ob_start();
29 29
 
30
-    echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>';
30
+    echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>';
31 31
 
32 32
     // Adding partialview field
33 33
     $table = new Smartfaq\SmartDbTable('smartfaq_faq');
Please login to merge, or discard this patch.
include/oninstall.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
  */
31 31
 function xoops_module_pre_install_smartfaq(\XoopsModule $module)
32 32
 {
33
-    include __DIR__ . '/../preloads/autoloader.php';
33
+    include __DIR__.'/../preloads/autoloader.php';
34 34
     /** @var \XoopsModules\Smartfaq\Utility $utility */
35 35
     $utility = new \XoopsModules\Smartfaq\Utility();
36 36
     $xoopsSuccess = $utility::checkVerXoops($module);
37 37
     $phpSuccess   = $utility::checkVerPhp($module);
38 38
 
39
-    if (false !== $xoopsSuccess && false !==  $phpSuccess) {
40
-        $moduleTables =& $module->getInfo('tables');
39
+    if (false !== $xoopsSuccess && false !== $phpSuccess) {
40
+        $moduleTables = & $module->getInfo('tables');
41 41
         foreach ($moduleTables as $table) {
42
-            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
42
+            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';');
43 43
         }
44 44
     }
45 45
 
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
  */
56 56
 function xoops_module_install_smartfaq(\XoopsModule $module)
57 57
 {
58
-    require_once  __DIR__ . '/../../../mainfile.php';
59
-    require_once  __DIR__ . '/../include/config.php';
58
+    require_once  __DIR__.'/../../../mainfile.php';
59
+    require_once  __DIR__.'/../include/config.php';
60 60
 
61 61
     $moduleDirName = basename(dirname(__DIR__));
62 62
 
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
     $moduleId2    = $helper->getModule()->mid();
74 74
     $gpermHandler = xoops_getHandler('groupperm');
75 75
     // access rights ------------------------------------------
76
-    $gpermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
77
-    $gpermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
78
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
79
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
80
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
76
+    $gpermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
77
+    $gpermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
78
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
79
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId);
80
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
81 81
 
82 82
     //  ---  CREATE FOLDERS ---------------
83 83
     if (count($configurator->uploadFolders) > 0) {
@@ -89,14 +89,14 @@  discard block
 block discarded – undo
89 89
 
90 90
     //  ---  COPY blank.png FILES ---------------
91 91
     if (count($configurator->copyBlankFiles) > 0) {
92
-        $file = __DIR__ . '/../assets/images/blank.png';
92
+        $file = __DIR__.'/../assets/images/blank.png';
93 93
         foreach (array_keys($configurator->copyBlankFiles) as $i) {
94
-            $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
94
+            $dest = $configurator->copyBlankFiles[$i].'/blank.png';
95 95
             $utilityClass::copyFile($file, $dest);
96 96
         }
97 97
     }
98 98
     //delete .html entries from the tpl table
99
-    $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
99
+    $sql = 'DELETE FROM '.$xoopsDB->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'";
100 100
     $xoopsDB->queryF($sql);
101 101
 
102 102
     return true;
Please login to merge, or discard this patch.
include/request.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
 
13 13
 global $_POST;
14 14
 
15
-require_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
16
-require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
17
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
15
+require_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
16
+require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
17
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
18 18
 
19 19
 $form = new \XoopsThemeForm(_MD_SF_REQUEST, 'form', xoops_getenv('PHP_SELF'), 'post', true);
20 20
 // CATEGORY
Please login to merge, or discard this patch.
include/search.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
     for ($i = 0, $iMax = count($faqsObj); $i < $iMax; ++$i) {
28 28
         $ret[$i]['image'] = 'assets/images/smartfaq.gif';
29
-        $ret[$i]['link']  = 'faq.php?faqid=' . $faqsObj[$i]->faqid();
29
+        $ret[$i]['link']  = 'faq.php?faqid='.$faqsObj[$i]->faqid();
30 30
         $ret[$i]['title'] = $faqsObj[$i]->question(50);
31 31
         $ret[$i]['time']  = $faqsObj[$i]->getVar('datesub');
32 32
         $ret[$i]['uid']   = $faqsObj[$i]->uid();
Please login to merge, or discard this patch.
include/answer.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@
 block discarded – undo
13 13
 
14 14
 global $_POST;
15 15
 
16
-require_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
17
-require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
18
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
16
+require_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
17
+require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
18
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
19 19
 //require_once __DIR__ . '/functions.php';
20 20
 
21 21
 $mytree = new Smartfaq\Tree($xoopsDB->prefix('smartfaq_categories'), 'categoryid', 'parentid');
Please login to merge, or discard this patch.
include/submit.inc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 
13 13
 global $_POST, $xoopsDB;
14 14
 
15
-require_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
16
-require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
17
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
15
+require_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
16
+require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
17
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
18 18
 
19 19
 //require_once __DIR__ . '/functions.php';
20 20
 
@@ -73,18 +73,18 @@  discard block
 block discarded – undo
73 73
 //    $upload_tray->addElement(new \XoopsFormFile('', 'userfile', ($forum_obj->getVar('attach_maxkb') * 1024)));
74 74
 $upload_tray->addElement(new \XoopsFormFile('', 'userfile', $xoopsModuleConfig['max_image_size'] * 1024));
75 75
 $upload_tray->addElement(new \XoopsFormButton('', 'contents_upload', _MD_SF_UPLOAD, 'submit'));
76
-$upload_tray->addElement(new \XoopsFormLabel('<br><br>' . _MD_SF_MAX_FILESIZE . ':', $xoopsModuleConfig['max_image_size'] . 'Kb; '));
76
+$upload_tray->addElement(new \XoopsFormLabel('<br><br>'._MD_SF_MAX_FILESIZE.':', $xoopsModuleConfig['max_image_size'].'Kb; '));
77 77
 $extensions = trim(str_replace('|', ' ', $xoopsModuleConfig['attach_ext']));
78 78
 $extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions;
79
-$upload_tray->addElement(new \XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS . ':', $extensions));
80
-$upload_tray->addElement(new \XoopsFormLabel('<br>' . sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width'])));
79
+$upload_tray->addElement(new \XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS.':', $extensions));
80
+$upload_tray->addElement(new \XoopsFormLabel('<br>'.sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width'])));
81 81
 $form->addElement($upload_tray);
82 82
 //}
83 83
 
84 84
 if (!empty($attachments) && is_array($attachments) && count($attachments)) {
85 85
     $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_SF_ATTACHED_FILES, 'delete_attach[]');
86 86
     foreach ($attachments as $key => $attachment) {
87
-        $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['name_display'] . '</a><br>';
87
+        $attach = ' '._DELETE.' <a href='.XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachment['name_saved'].' rel="external">'.$attachment['name_display'].'</a><br>';
88 88
         $delete_attach_checkbox->addOption($key, $attach);
89 89
     }
90 90
     $form->addElement($delete_attach_checkbox);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     $delete_attach_checkbox = new \XoopsFormCheckBox(_MD_REMOVE, 'delete_tmp[]');
96 96
     $url_prefix             = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH);
97 97
     foreach ($attachments_tmp as $key => $attachment) {
98
-        $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>';
98
+        $attach = ' <a href="'.$url_prefix.'/'.$attachment[0].'" rel="external">'.$attachment[1].'</a><br>';
99 99
         $delete_attach_checkbox->addOption($key, $attach);
100 100
     }
101 101
     $form->addElement($delete_attach_checkbox);
Please login to merge, or discard this patch.
include/onuninstall.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 //    return true;
35 35
 
36 36
     $moduleDirName = basename(dirname(__DIR__));
37
-    $xsitemapHelper      = \Xmf\Module\Helper::getHelper($moduleDirName);
37
+    $xsitemapHelper = \Xmf\Module\Helper::getHelper($moduleDirName);
38 38
 
39 39
     /** @var XoopsModules\Smartfaq\Utility $utilityClass */
40
-    $utilityClass     = ucfirst($moduleDirName) . 'Utility';
40
+    $utilityClass = ucfirst($moduleDirName).'Utility';
41 41
     if (!class_exists($utilityClass)) {
42 42
         xoops_load('utility', $moduleDirName);
43 43
     }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         if ($dirInfo->isDir()) {
57 57
             // The directory exists so delete it
58 58
             if (false === $utilityClass::rrmdir($old_dir)) {
59
-                $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir));
59
+                $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $old_dir));
60 60
                 $success = false;
61 61
             }
62 62
         }
Please login to merge, or discard this patch.
include/functions.render.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
13 13
 
14
-defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php';
14
+defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php';
15 15
 define('NEWBB_FUNCTIONS_RENDER_LOADED', true);
16 16
 
17 17
 if (!defined('NEWBB_FUNCTIONS_RENDER')):
@@ -56,16 +56,16 @@  discard block
 block discarded – undo
56 56
             // decode xcode
57 57
             if (0 != $image) {
58 58
                 // image allowed
59
-                $text =& $myts->xoopsCodeDecode($text);
59
+                $text = & $myts->xoopsCodeDecode($text);
60 60
             } else {
61 61
                 // image not allowed
62
-                $text =& $myts->xoopsCodeDecode($text, 0);
62
+                $text = & $myts->xoopsCodeDecode($text, 0);
63 63
             }
64 64
         }
65 65
         if (0 != $br) {
66
-            $text =& $myts->nl2Br($text);
66
+            $text = & $myts->nl2Br($text);
67 67
         }
68
-        $text = $myts->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
68
+        $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18)
69 69
 
70 70
         return $text;
71 71
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}'>";
97 97
         if (empty($asImage)) {
98
-            $button = "<a href='{$link}' title='{$alt}' {$extra}>" . sf_displayImage($button, $alt, true) . '</a>';
98
+            $button = "<a href='{$link}' title='{$alt}' {$extra}>".sf_displayImage($button, $alt, true).'</a>';
99 99
         }
100 100
 
101 101
         return $button;
Please login to merge, or discard this patch.
include/displayfaqs.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 
27 27
 Smartfaq\Utility::collapsableBar('toptable', 'toptableicon');
28 28
 
29
-echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . $faqs_title . '</h3>';
29
+echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".$faqs_title.'</h3>';
30 30
 echo "<div id='toptable'>";
31
-echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $faqs_info . '</span>';
31
+echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$faqs_info.'</span>';
32 32
 
33 33
 // Get the total number of published FAQs
34 34
 $totalfaqs = $faqHandler->getFaqsCount($sel_cat, [Constants::SF_STATUS_PUBLISHED, Constants::SF_STATUS_NEW_ANSWER]);
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
 $allCats         = $categoryHandler->getObjects(null, true);
40 40
 echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
41 41
 echo '<tr>';
42
-echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>';
43
-echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
44
-echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>';
42
+echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>';
43
+echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
44
+echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>';
45 45
 
46
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>';
47
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>';
46
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>';
47
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>';
48 48
 
49
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
50
-echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
49
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
50
+echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
51 51
 echo '</tr>';
52 52
 if ($totalfaqs > 0) {
53 53
     global $pathIcon16, $smartModuleConfig;
54 54
     foreach ($faqsObj as $iValue) {
55 55
         $categoryObj = $allCats[$iValue->categoryid()];
56
-        $modify      = "<a href='faq.php?op=mod&amp;faqid=" . $iValue->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>";
57
-        $delete      = "<a href='faq.php?op=del&amp;faqid=" . $iValue->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_DELETEART . "'></a>";
56
+        $modify      = "<a href='faq.php?op=mod&amp;faqid=".$iValue->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>";
57
+        $delete      = "<a href='faq.php?op=del&amp;faqid=".$iValue->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_DELETEART."'></a>";
58 58
 
59 59
         //adding name of the Question Submitter
60 60
         $requester = Smartfaq\Utility::getLinkedUnameFromId($iValue->uid(), $smartModuleConfig['userealname']);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $criteria->add(new \Criteria('faqid', $iValue->faqid()));
68 68
         $criteria->add(new \Criteria('status', true));
69 69
 
70
-        $answerObjects =& $answerHandler->getObjects($criteria, true);
70
+        $answerObjects = & $answerHandler->getObjects($criteria, true);
71 71
 
72 72
         foreach (array_keys($answerObjects) as $j) {
73 73
             $answerObj = $answerObjects[$j];
@@ -82,26 +82,26 @@  discard block
 block discarded – undo
82 82
         }
83 83
 
84 84
         echo '<tr>';
85
-        echo "<td class='head' align='center'>" . $iValue->faqid() . '</td>';
86
-        echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
87
-        echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $iValue->faqid() . "'>" . $iValue->question(100) . '</a></td>';
85
+        echo "<td class='head' align='center'>".$iValue->faqid().'</td>';
86
+        echo "<td class='even' align='left'>".$categoryObj->name().'</td>';
87
+        echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$iValue->faqid()."'>".$iValue->question(100).'</a></td>';
88 88
 
89
-        echo "<td class='even' align='center'>" . $requester . '</td>';
90
-        echo "<td class='even' align='center'>" . $answerSubmitter . '</td>';
89
+        echo "<td class='even' align='center'>".$requester.'</td>';
90
+        echo "<td class='even' align='center'>".$answerSubmitter.'</td>';
91 91
 
92
-        echo "<td class='even' align='center'>" . $iValue->datesub('s') . '</td>';
92
+        echo "<td class='even' align='center'>".$iValue->datesub('s').'</td>';
93 93
         echo "<td class='even' align='center'> $modify $delete </td>";
94 94
         echo '</tr>';
95 95
     }
96 96
 } else {
97 97
     $faqid = -1;
98 98
     echo '<tr>';
99
-    echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQS . '</td>';
99
+    echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQS.'</td>';
100 100
     echo '</tr>';
101 101
 }
102 102
 echo "</table>\n";
103 103
 echo "<br>\n";
104 104
 
105 105
 $pagenav = new \XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq', $pagenav_extra_args);
106
-echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
106
+echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
107 107
 echo '</div>';
Please login to merge, or discard this patch.