Completed
Pull Request — master (#144)
by Michael
03:13
created
class/Files/CreateHtmlSmartyCodes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
         $str = '';
93 93
         foreach ($attributes as $name => $value) {
94 94
             if ('_' !== $name) {
95
-                $str .= ' ' . $name . '="' . $value . '"';
95
+                $str .= ' '.$name.'="'.$value.'"';
96 96
             }
97 97
         }
98 98
 
Please login to merge, or discard this patch.
class/Files/Language/LanguageHelp.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,9 +110,9 @@
 block discarded – undo
110 110
 </div>
111 111
 EOT;
112 112
         if ('english' !== $language) {
113
-            $this->create($moduleDirname, 'language/' . $language . '/help', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
113
+            $this->create($moduleDirname, 'language/'.$language.'/help', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
114 114
         }
115
-        $this->create($moduleDirname, 'language/' . $GLOBALS['xoopsConfig']['language'] . '/help', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
115
+        $this->create($moduleDirname, 'language/'.$GLOBALS['xoopsConfig']['language'].'/help', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
116 116
 
117 117
         return $this->renderFile();
118 118
     }
Please login to merge, or discard this patch.
class/Files/Language/LanguageMailTpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
 webmaster
102 102
 {X_ADMINMAIL}
103 103
 EOT;
104
-        $this->create($moduleDirname, 'language/' . $GLOBALS['xoopsConfig']['language'] . '/mail_template', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
104
+        $this->create($moduleDirname, 'language/'.$GLOBALS['xoopsConfig']['language'].'/mail_template', $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
105 105
 
106 106
         return $this->renderFile();
107 107
     }
Please login to merge, or discard this patch.
class/Form/SimpleForm.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,16 +41,16 @@
 block discarded – undo
41 41
      */
42 42
     public function render()
43 43
     {
44
-        $ret = ($this->getTitle() ? '<div class=" center head ">' . $this->getTitle() . '</div>' : '');
45
-        $ret .= '<form name="' . $this->getName() . '" id="' . $this->getName() . '" action="' . $this->getAction() . '" method="' . $this->getMethod() . '"' . $this->getExtra() . '>' . NWLINE;
44
+        $ret = ($this->getTitle() ? '<div class=" center head ">'.$this->getTitle().'</div>' : '');
45
+        $ret .= '<form name="'.$this->getName().'" id="'.$this->getName().'" action="'.$this->getAction().'" method="'.$this->getMethod().'"'.$this->getExtra().'>'.NWLINE;
46 46
         foreach ($this->getElements() as $ele) {
47 47
             if (!$ele->isHidden()) {
48
-                $ret .= '<div class="' . $ele->getClass() . '"><strong>' . $ele->getCaption() . '</strong>' . $ele->render() . '</div>' . NWLINE;
48
+                $ret .= '<div class="'.$ele->getClass().'"><strong>'.$ele->getCaption().'</strong>'.$ele->render().'</div>'.NWLINE;
49 49
             } else {
50 50
                 $ret .= $ele->render();
51 51
             }
52 52
         }
53
-        $ret .= NWLINE . '</form>';
53
+        $ret .= NWLINE.'</form>';
54 54
 
55 55
         return $ret;
56 56
     }
Please login to merge, or discard this patch.
class/Form/FormRadio.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
                 }
52 52
                 $ret .= '<td class="radio">';
53 53
             }
54
-            $ret .= '<input type="radio" name="' . $ele_name . '" id="' . $ele_name . '[' . $value . ']' . $id_ele . '" title = "' . htmlspecialchars($ele_title, ENT_QUOTES) . '" value="' . htmlspecialchars($value, ENT_QUOTES) . '"';
54
+            $ret .= '<input type="radio" name="'.$ele_name.'" id="'.$ele_name.'['.$value.']'.$id_ele.'" title = "'.htmlspecialchars($ele_title, ENT_QUOTES).'" value="'.htmlspecialchars($value, ENT_QUOTES).'"';
55 55
             if (isset($ele_value) && $value == $ele_value) {
56 56
                 $ret .= ' checked';
57 57
             }
58
-            $ret .= $ele_extra . ' />' . "<label name='xolb_{$ele_name}' for='" . $ele_name . '[' . $value . ']' . $id_ele . "'><span><span></span></span>" . $name . '</label>' . $ele_delimeter;
58
+            $ret .= $ele_extra.' />'."<label name='xolb_{$ele_name}' for='".$ele_name.'['.$value.']'.$id_ele."'><span><span></span></span>".$name.'</label>'.$ele_delimeter;
59 59
             if (!empty($this->columns)) {
60 60
                 $ret .= '</td>';
61 61
                 if (0 == ++$i % $this->columns) {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         if (!empty($this->columns)) {
67 67
             $span = $i % $this->columns;
68 68
             if ($span) {
69
-                $ret .= '<td colspan="' . ($this->columns - $span) . '"></td></tr>';
69
+                $ret .= '<td colspan="'.($this->columns - $span).'"></td></tr>';
70 70
             }
71 71
             $ret .= '</table>';
72 72
         }
Please login to merge, or discard this patch.
preloads/autoloader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
  * @see http://www.php-fig.org/psr/psr-4/examples/
5 5
  */
6 6
 spl_autoload_register(
7
-    static function ($class) {
7
+    static function($class) {
8 8
         // project-specific namespace prefix
9
-        $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__)));
9
+        $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__)));
10 10
 
11 11
         // base directory for the namespace prefix
12
-        $baseDir = __DIR__ . '/../class/';
12
+        $baseDir = __DIR__.'/../class/';
13 13
 
14 14
         // does the class use the namespace prefix?
15 15
         $len = mb_strlen($prefix);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         // replace the namespace prefix with the base directory, replace namespace
25 25
         // separators with directory separators in the relative class name, append
26 26
         // with .php
27
-        $file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php';
27
+        $file = $baseDir.str_replace('\\', '/', $relativeClass).'.php';
28 28
 
29 29
         // if the file exists, require it
30 30
         if (file_exists($file)) {
Please login to merge, or discard this patch.
admin/building.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
  */
26 26
 $GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_building.tpl';
27 27
 
28
-include __DIR__ . '/header.php';
28
+include __DIR__.'/header.php';
29 29
 $op        = \Xmf\Request::getString('op', 'default');
30 30
 $mid       = \Xmf\Request::getInt('mod_id');
31 31
 $moduleObj = $helper->getHandler('Modules')->get($mid);
32
-$cachePath = XOOPS_VAR_PATH . '/caches/tdmcreate_cache';
32
+$cachePath = XOOPS_VAR_PATH.'/caches/tdmcreate_cache';
33 33
 // Clear cache
34
-if (file_exists($cache = $cachePath . '/classpaths.cache')) {
34
+if (file_exists($cache = $cachePath.'/classpaths.cache')) {
35 35
     unlink($cache);
36 36
 }
37
-if (!file_exists($indexFile = $cachePath . '/index.html')) {
37
+if (!file_exists($indexFile = $cachePath.'/index.html')) {
38 38
     copy('index.html', $indexFile);
39 39
 }
40 40
 // Switch option
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
         // Get var module dirname
46 46
         $moduleDirname = $moduleObj->getVar('mod_dirname');
47 47
         // Directories for copy from to
48
-        $fromDir = TDMC_UPLOAD_REPOSITORY_PATH . '/' . mb_strtolower($moduleDirname);
49
-        $toDir   = XOOPS_ROOT_PATH . '/modules/' . mb_strtolower($moduleDirname);
48
+        $fromDir = TDMC_UPLOAD_REPOSITORY_PATH.'/'.mb_strtolower($moduleDirname);
49
+        $toDir   = XOOPS_ROOT_PATH.'/modules/'.mb_strtolower($moduleDirname);
50 50
         // include_once TDMC_CLASS_PATH . '/building.php';
51 51
         if (isset($moduleDirname)) {
52 52
             // Clear this module if it's in repository
@@ -108,4 +108,4 @@  discard block
 block discarded – undo
108 108
         $GLOBALS['xoopsTpl']->assign('form', $form->render());
109 109
         break;
110 110
 }
111
-include __DIR__ . '/footer.php';
111
+include __DIR__.'/footer.php';
Please login to merge, or discard this patch.
admin/tables.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  */
25 25
 $GLOBALS['xoopsOption']['template_main'] = 'tdmcreate_tables.tpl';
26 26
 
27
-include __DIR__ . '/header.php';
27
+include __DIR__.'/header.php';
28 28
 // Recovered value of arguments op in the URL $
29 29
 $op = \Xmf\Request::getString('op', 'list');
30 30
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $adminObject->addItemButton(_AM_TDMCREATE_ADD_TABLE, 'tables.php?op=new', 'add');
52 52
         $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
53 53
         $GLOBALS['xoopsTpl']->assign('tdmc_upload_imgmod_url', TDMC_UPLOAD_IMGMOD_URL);
54
-        $GLOBALS['xoopsTpl']->assign('modPathIcon16', TDMC_URL . '/' . $modPathIcon16);
54
+        $GLOBALS['xoopsTpl']->assign('modPathIcon16', TDMC_URL.'/'.$modPathIcon16);
55 55
         // Get the list of modules
56 56
         $modulesCount = $helper->getHandler('Modules')->getCountModules();
57 57
         // Redirect if there aren't modules
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
                 unset($module);
91 91
             }
92 92
             if ($modulesCount > $limit) {
93
-                include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
94
-                $pagenav = new \XoopsPageNav($modulesCount, $limit, $start, 'start', 'op=list&limit=' . $limit);
93
+                include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
94
+                $pagenav = new \XoopsPageNav($modulesCount, $limit, $start, 'start', 'op=list&limit='.$limit);
95 95
                 $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
96 96
             }
97 97
         } else {
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             ]
146 146
         );
147 147
         //Form table_image
148
-        include_once XOOPS_ROOT_PATH . '/class/uploader.php';
148
+        include_once XOOPS_ROOT_PATH.'/class/uploader.php';
149 149
         $uploaddir = is_dir(XOOPS_ICONS32_PATH) ? XOOPS_ICONS32_PATH : TDMC_UPLOAD_IMGTAB_PATH;
150 150
         $uploader  = new \XoopsMediaUploader(
151 151
             $uploaddir, $helper->getConfig('mimetypes'), $helper->getConfig('maxsize'), null, null
@@ -187,18 +187,18 @@  discard block
 block discarded – undo
187 187
         if ($tables->insert($tablesObj)) {
188 188
             if ($tablesObj->isNew()) {
189 189
                 $tableTid    = $GLOBALS['xoopsDB']->getInsertId();
190
-                $tableAction = '&field_mid=' . $tableMid . '&field_tid=' . $tableTid . '&field_numb=' . $tableNumbFields . '&field_name=' . $tableFieldname;
190
+                $tableAction = '&field_mid='.$tableMid.'&field_tid='.$tableTid.'&field_numb='.$tableNumbFields.'&field_name='.$tableFieldname;
191 191
                 // Fields Elements Handler
192 192
                 $fieldelementObj = $helper->getHandler('Fieldelements')->create();
193 193
                 $fieldelementObj->setVar('fieldelement_mid', $tableMid);
194 194
                 $fieldelementObj->setVar('fieldelement_tid', $tableTid);
195
-                $fieldelementObj->setVar('fieldelement_name', 'Table : ' . ucfirst($_POST['table_name']));
196
-                $fieldelementObj->setVar('fieldelement_value', 'XoopsFormTables-' . ucfirst($_POST['table_name']));
195
+                $fieldelementObj->setVar('fieldelement_name', 'Table : '.ucfirst($_POST['table_name']));
196
+                $fieldelementObj->setVar('fieldelement_value', 'XoopsFormTables-'.ucfirst($_POST['table_name']));
197 197
                 // Insert new field element id for table name
198 198
                 if (!$helper->getHandler('Fieldelements')->insert($fieldelementObj)) {
199
-                    $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors() . ' Field element');
199
+                    $GLOBALS['xoopsTpl']->assign('error', $fieldelementObj->getHtmlErrors().' Field element');
200 200
                 }
201
-                redirect_header('fields.php?op=new' . $tableAction, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_CREATED_OK, $_POST['table_name']));
201
+                redirect_header('fields.php?op=new'.$tableAction, 5, sprintf(_AM_TDMCREATE_TABLE_FORM_CREATED_OK, $_POST['table_name']));
202 202
             } else {
203 203
                 redirect_header('tables.php', 5, sprintf(_AM_TDMCREATE_TABLE_FORM_UPDATED_OK, $_POST['table_name']));
204 204
             }
@@ -270,9 +270,9 @@  discard block
 block discarded – undo
270 270
         if ($mid > 0) {
271 271
             $modulesObj = $helper->getHandler('Modules')->get($mid);
272 272
             foreach ($modArray as $modField) {
273
-                if (isset($_POST['mod_' . $modField])) {
274
-                    $mField = $modulesObj->getVar('mod_' . $modField);
275
-                    $modulesObj->setVar('mod_' . $modField, !$mField);
273
+                if (isset($_POST['mod_'.$modField])) {
274
+                    $mField = $modulesObj->getVar('mod_'.$modField);
275
+                    $modulesObj->setVar('mod_'.$modField, !$mField);
276 276
                 }
277 277
             }
278 278
             if ($helper->getHandler('Modules')->insert($modulesObj)) {
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
         if ($tid > 0) {
286 286
             $tablesObj = $helper->getHandler('Tables')->get($tid);
287 287
             foreach ($tableArray as $tableField) {
288
-                if (isset($_POST['table_' . $tableField])) {
289
-                    $tblField = $tablesObj->getVar('table_' . $tableField);
290
-                    $tablesObj->setVar('table_' . $tableField, !$tblField);
288
+                if (isset($_POST['table_'.$tableField])) {
289
+                    $tblField = $tablesObj->getVar('table_'.$tableField);
290
+                    $tablesObj->setVar('table_'.$tableField, !$tblField);
291 291
                 }
292 292
             }
293 293
             if ($helper->getHandler('Tables')->insert($tablesObj)) {
@@ -297,4 +297,4 @@  discard block
 block discarded – undo
297 297
         }
298 298
         break;
299 299
 }
300
-include __DIR__ . '/footer.php';
300
+include __DIR__.'/footer.php';
Please login to merge, or discard this patch.
admin/feedback.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 use Xmf\Request;
23 23
 
24
-include __DIR__ . '/header.php';
24
+include __DIR__.'/header.php';
25 25
 
26 26
 $adminObject = \Xmf\Module\Admin::getInstance();
27 27
 
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
         $fb_content = Request::getText('fb_content', '');
61 61
         $fb_content = str_replace(["\r\n", "\n", "\r"], '<br>', $fb_content); //clean line break from dhtmltextarea
62 62
 
63
-        $title       = constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_FOR') . $GLOBALS['xoopsModule']->getVar('dirname');
64
-        $body        = constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME') . ': ' . $your_name . '<br>';
65
-        $body        .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL') . ': ' . $your_mail . '<br>';
66
-        $body        .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE') . ': ' . $your_site . '<br>';
67
-        $body        .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE') . ': ' . $fb_type . '<br><br>';
68
-        $body        .= constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT') . ':<br>';
63
+        $title       = constant('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_FOR').$GLOBALS['xoopsModule']->getVar('dirname');
64
+        $body        = constant('CO_'.$moduleDirNameUpper.'_'.'FB_NAME').': '.$your_name.'<br>';
65
+        $body        .= constant('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL').': '.$your_mail.'<br>';
66
+        $body        .= constant('CO_'.$moduleDirNameUpper.'_'.'FB_SITE').': '.$your_site.'<br>';
67
+        $body        .= constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE').': '.$fb_type.'<br><br>';
68
+        $body        .= constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_CONTENT').':<br>';
69 69
         $body        .= $fb_content;
70 70
         $xoopsMailer = xoops_getMailer();
71 71
         $xoopsMailer->useMail();
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $xoopsMailer->setBody($body);
78 78
         $ret = $xoopsMailer->send();
79 79
         if ($ret) {
80
-            redirect_header('index.php', 3, constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_SUCCESS'));
80
+            redirect_header('index.php', 3, constant('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_SUCCESS'));
81 81
         }
82 82
 
83 83
         // show form with content again
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
         $feedback->type    = $fb_type;
88 88
         $feedback->content = $fb_content;
89 89
         echo '<div align="center" style="width: 80%; padding: 10px; border: 2px solid #ff0000; color: #ff0000; margin-right:auto;margin-left:auto;">
90
-            <h3>' . constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SEND_ERROR') . '</h3>
90
+            <h3>' . constant('CO_'.$moduleDirNameUpper.'_'.'FB_SEND_ERROR').'</h3>
91 91
             </div>';
92 92
         $form = $feedback->getFormFeedback();
93 93
         $form->display();
94 94
 
95 95
         break;
96 96
 }
97
-require __DIR__ . '/footer.php';
97
+require __DIR__.'/footer.php';
Please login to merge, or discard this patch.