Completed
Pull Request — master (#1)
by Michael
02:28
created
class/contents.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
 
96 96
         include_once $GLOBALS['xoops']->path('/class/xoopsformloader.php');
97 97
 
98
-        $caption = ($this->isNew()) ? _AM_XOOPSFAQ_CREATE_NEW: sprintf(_AM_XOOPSFAQ_MODIFY_ITEM, $this->getVar('contents_title'));
98
+        $caption = ($this->isNew()) ? _AM_XOOPSFAQ_CREATE_NEW : sprintf(_AM_XOOPSFAQ_MODIFY_ITEM, $this->getVar('contents_title'));
99 99
         $form = new XoopsThemeForm($caption, 'content', $_SERVER['REQUEST_URI'], 'post', true);
100 100
 //        $form->addElement(new XoopsFormHiddenToken());
101 101
         $form->addElement(new xoopsFormHidden('op', 'save'));
102 102
         $form->addElement(new xoopsFormHidden('contents_id', $this->getVar('contents_id', 'e')));
103 103
 
104 104
         // Active
105
-        $contents_active = new XoopsFormRadioYN(_AM_XOOPSFAQ_E_CONTENTS_ACTIVE, 'contents_active', $this->getVar('contents_active', 'e'),   ' ' . _YES . '', ' ' . _NO . '' );
105
+        $contents_active = new XoopsFormRadioYN(_AM_XOOPSFAQ_E_CONTENTS_ACTIVE, 'contents_active', $this->getVar('contents_active', 'e'), ' ' . _YES . '', ' ' . _NO . '');
106 106
         $contents_active->setDescription(_AM_XOOPSFAQ_E_CONTENTS_ACTIVE_DESC);
107 107
         $form->addElement($contents_active, false);
108 108
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $form->addElement($contents_weight, false);
128 128
 
129 129
         // Editor
130
-        $options_tray  = new XoopsFormElementTray(_AM_XOOPSFAQ_E_CONTENTS_CONTENT, '<br>');
130
+        $options_tray = new XoopsFormElementTray(_AM_XOOPSFAQ_E_CONTENTS_CONTENT, '<br>');
131 131
         if (class_exists('XoopsFormEditor')) {
132 132
 //            $editorConfigs = array('editor' => $GLOBALS['xoopsConfig']['general_editor'],
133 133
             $editorConfigs = array('editor' => $xfHelper->getConfig('use_wysiwyg', 'dhtmltextarea'),
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             $criteria->setStart(0);
255 255
             $criteria->setLimit(0);
256 256
         } else {
257
-            $obj['list']  = $this->getObjects($sort, false);
257
+            $obj['list'] = $this->getObjects($sort, false);
258 258
         }
259 259
         $obj['list'] = $this->getObjects($criteria, false);
260 260
         $obj['count'] = (false !== $obj['list']) ? count($obj['list']) : 0;
Please login to merge, or discard this patch.
class/utility.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                 self::rrmdir($fObj->getPathname());
183 183
             }
184 184
         }
185
-        $iterator = null;   // clear iterator Obj to close file/directory
185
+        $iterator = null; // clear iterator Obj to close file/directory
186 186
         return rmdir($src); // remove the directory & return results
187 187
     }
188 188
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                 self::rmove($fObj->getPathname(), $dest . '/' . $fObj->getFilename());
222 222
             }
223 223
         }
224
-        $iterator = null;   // clear iterator Obj to close file/directory
224
+        $iterator = null; // clear iterator Obj to close file/directory
225 225
         return rmdir($src); // remove the directory & return results
226 226
     }
227 227
 
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
 
256 256
         // Open the source directory to read in files
257 257
         $iterator = new DirectoryIterator($src);
258
-        foreach($iterator as $fObj) {
259
-            if($fObj->isFile()) {
258
+        foreach ($iterator as $fObj) {
259
+            if ($fObj->isFile()) {
260 260
                 copy($fObj->getPathname(), $dest . '/' . $fObj->getFilename());
261
-            } else if(!$fObj->isDot() && $fObj->isDir()) {
262
-                self::rcopy($fObj->getPathname(), $dest . '/' . $fObj-getFilename());
261
+            } else if (!$fObj->isDot() && $fObj->isDir()) {
262
+                self::rcopy($fObj->getPathname(), $dest . '/' . $fObj - getFilename());
263 263
             }
264 264
         }
265 265
         return true;
@@ -281,19 +281,19 @@  discard block
 block discarded – undo
281 281
         xoops_loadLanguage('admin', $moduleDirName);
282 282
         $ret = '';
283 283
         if (null !== $value) {
284
-            foreach($icon_array as $_op => $icon) {
284
+            foreach ($icon_array as $_op => $icon) {
285 285
                 if (false === strpos($icon, '.')) {
286 286
                     $iconName = $icon;
287 287
                     $iconExt = 'png';
288 288
                 } else {
289
-                    $iconName = substr($icon, 0, strlen($icon)-strrchr($icon, '.'));
289
+                    $iconName = substr($icon, 0, strlen($icon) - strrchr($icon, '.'));
290 290
                     $iconExt  = substr(strrchr($icon, '.'), 1);
291 291
                 }
292 292
                 $url = (!is_numeric($_op)) ? $_op . '?' . $param . '=' . $value : xoops_getenv('PHP_SELF') . '?op=' . $iconName . '&amp;' . $param . '=' . $value;
293 293
                 if (null !== $extra) {
294 294
                     $url .= ' ' . $extra;
295 295
                 }
296
-                $title = constant (htmlspecialchars(mb_strtoupper('_XO_LA_' . $iconName)));
296
+                $title = constant(htmlspecialchars(mb_strtoupper('_XO_LA_' . $iconName)));
297 297
                 $img = '<img src="' . Xmf\Module\Admin::iconUrl($iconName . '.' . $iconExt, '16') . '"'
298 298
                      . ' title ="' . $title . '"'
299 299
                      . ' alt = "' . $title . '"'
Please login to merge, or discard this patch.
blocks/xoopsfaq_rand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
         $xpFaqObj = $xpFaqObjArray[$faqNum];
75 75
         $faq      = $myts->displayTarea($xpFaqObj->getVar('contents_title'));
76 76
         $txtAns   = strip_tags($xpFaqObj->getVar('contents_contents')); // get rid of html for block
77
-        $faqAns   = $myts->displayTarea(xoops_substr($txtAns, 0, $options[0]), 0, 0 ,0 ,0 ,0);
77
+        $faqAns   = $myts->displayTarea(xoops_substr($txtAns, 0, $options[0]), 0, 0, 0, 0, 0);
78 78
 
79 79
         $xfCatHandler = $xfHelper->getHandler('category');
80 80
         $catObj       = $xfCatHandler->get($xpFaqObj->getVar('contents_cid'));
81 81
         $cid          = $catObj->getVar('category_id');
82
-        $block = array( 'title' => _MB_XOOPSFAQ_RANDOM_TITLE,
82
+        $block = array('title' => _MB_XOOPSFAQ_RANDOM_TITLE,
83 83
                           'faq' => $faq,
84 84
                        'faqans' => $faqAns,
85 85
                      'morelink' => $xfHelper->url('index.php?cat_id=' . $cid . '#q' . $xpFaqObj->getVar('contents_id')),
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     $formSelect->addOptionArray($optionArray);
115 115
     $selOptions = (false === strpos($options[1], ',')) ? $options[1] : explode(',', $options[1]);
116 116
     $formSelect->setValue($selOptions);
117
-    $selectCat   = $formSelect->render();
117
+    $selectCat = $formSelect->render();
118 118
 
119 119
     $form = '<div class="line140">'
120 120
           . _MB_XOOPSFAQ_CHARS . '&nbsp;'
Please login to merge, or discard this patch.
blocks/xoopsfaq_recent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             $faqTitle = $myts->displayTarea($faqObj->getVar('contents_title'));
82 82
             if (!empty($options[1])) {
83 83
                 $txtAns   = strip_tags($faqObj->getVar('contents_contents')); // get rid of html for block
84
-                $faqAns   = $myts->displayTarea(xoops_substr($txtAns, 0, $options[1]), 0, 0 ,0 ,0 ,0);
84
+                $faqAns   = $myts->displayTarea(xoops_substr($txtAns, 0, $options[1]), 0, 0, 0, 0, 0);
85 85
             } else {
86 86
                 $faqAns   = $myts->displayTarea($faqObj->getVar('contents_contents'),
87 87
                             (int)$faqObj->getVar('dohtml'),
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     $formSelect->addOptionArray($optionArray);
126 126
     $selOptions = (false === strpos($options[3], ',')) ? $options[3] : explode(',', $options[3]);
127 127
     $formSelect->setValue($selOptions);
128
-    $selectCat   = $formSelect->render();
128
+    $selectCat = $formSelect->render();
129 129
 
130 130
     $ychck = (isset($options[2]) && ($options[2] > 0)) ? ' checked' : '';
131 131
     $nchck = !empty($ychck) ? '' : ' checked';
Please login to merge, or discard this patch.
include/onupdate.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
130 130
         $oldFiles = array($xfHelper->path('include/functions.php'),
131 131
                             $xsHelper->path('class/utilities.php')
132 132
         );
133
-        foreach($oldFiles as $file) {
133
+        foreach ($oldFiles as $file) {
134 134
             if (is_file($file)) {
135 135
                 if (false === ($delOk = unlink($file))) {
136 136
                     $module->setErrors(sprintf(_AM_XOOPSFAQ_ERROR_BAD_REMOVE, $file));
Please login to merge, or discard this patch.
include/search.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         return $ret;
44 44
     }
45 45
 
46
-    $moduleDirName = basename(dirname(__DIR__)) ;
46
+    $moduleDirName = basename(dirname(__DIR__));
47 47
     xoops_load('constants', $moduleDirName);
48 48
 
49 49
     $xfHelper = Xmf\Module\Helper::getHelper($moduleDirName);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     $catCount   = !empty($catArray) ? count($catArray) : 0;
70 70
     $totalLimit = (int)$limit - $catCount;
71 71
     foreach ($catArray as $cId => $cat) {
72
-        $ret[] = array ('image' => 'assets/images/folder.png',
72
+        $ret[] = array('image' => 'assets/images/folder.png',
73 73
                          'link' => $xfHelper->url('index.php?cat_id=' . $cId),
74 74
                         'title' => $cat['category_title'],
75 75
         );
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     }
100 100
     $contentArray = $xfFaqHandler->getAll($criteria, $contentFields, false);
101 101
     foreach ($contentArray as $content) {
102
-        $ret[] = array ('image' => 'assets/images/question2.gif',
102
+        $ret[] = array('image' => 'assets/images/question2.gif',
103 103
                          'link' => $xfHelper->url('index.php?cat_id=' . $content['contents_cid'] . '#q' . $content['contents_id']),
104 104
                         'title' => $content['contents_title'],
105 105
                          'time' => $content['contents_publish'],
Please login to merge, or discard this patch.
include/rss.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     $retVal = array();
53 53
 
54 54
     foreach ($contentObjs as $contentObj) {
55
-        $retVal[] = array ('image' => '',
55
+        $retVal[] = array('image' => '',
56 56
                            'title' => $contentObj->getVar('contents_title'),
57 57
                             'link' => $contentObj->getVar('contents_contents'),
58 58
                             'time' => $contentObj->getVar('contents_publish'),
Please login to merge, or discard this patch.
admin/category.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
         break;
81 81
 
82 82
     case 'save':
83
-        if ( ($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity) ) {
84
-            if ( !$GLOBALS['xoopsSecurity']->check() ) {
83
+        if (($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity)) {
84
+            if (!$GLOBALS['xoopsSecurity']->check()) {
85 85
                 // failed xoops security check
86 86
                 $xfHelper->redirect('admin/index.php', 3, $GLOBALS['xoopsSecurity']->getErrors(true));
87 87
             }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     case 'default':
110 110
     default:
111 111
         $adminObject->displayNavigation('category.php');
112
-        $adminObject->addItemButton(_XO_XOOPSFAQ_ADDCAT, 'category.php?op=edit', 'add' , '');
112
+        $adminObject->addItemButton(_XO_XOOPSFAQ_ADDCAT, 'category.php?op=edit', 'add', '');
113 113
         $adminObject->displayButton('left');
114 114
         $xfCatHandler->displayAdminListing('order');
115 115
         break;
Please login to merge, or discard this patch.
admin/main.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
         $catCount = $xfCatHandler->getCount();
100 100
         $adminObject->displayNavigation(basename(__FILE__));
101 101
         if (!empty($catCount)) {
102
-            $adminObject->addItemButton(_AM_XOOPSFAQ_CREATE_NEW, basename(__FILE__) . '?op=edit', 'add' , '');
102
+            $adminObject->addItemButton(_AM_XOOPSFAQ_CREATE_NEW, basename(__FILE__) . '?op=edit', 'add', '');
103 103
             $adminObject->displayButton('left');
104 104
         }
105 105
         $xfFaqHandler->displayAdminListing('weight');
Please login to merge, or discard this patch.