@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $data = Data::get('dateFields', $locale); |
83 | 83 | |
84 | 84 | $diff = $dateStart->diff($dateEnd, false); |
85 | - $past = (boolean) $diff->invert; |
|
85 | + $past = (boolean)$diff->invert; |
|
86 | 86 | $value = 0; |
87 | 87 | $key = ''; |
88 | 88 | if ($diff->y != 0) { |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | $key = 'second'; |
105 | 105 | $value = $diff->s + round($diff->f, 0); |
106 | 106 | } |
107 | - if ($value==0) { |
|
107 | + if ($value == 0) { |
|
108 | 108 | $key = 'second'; |
109 | 109 | $relKey = 'relative-type-0'; |
110 | 110 | $relPattern = null; |
111 | - } elseif ($key === 'day' && $value >1 && $value <7) { |
|
111 | + } elseif ($key === 'day' && $value > 1 && $value < 7) { |
|
112 | 112 | $dow = $dateEnd->format('N') - 1; |
113 | 113 | $days = array('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'); |
114 | 114 | $key = $days[$dow]; |
@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | } else { |
122 | 122 | $relKey = ($past) ? 'relativeTime-type-past' : 'relativeTime-type-future'; |
123 | 123 | $rule = Plural::getRuleOfType($value, Plural::RULETYPE_CARDINAL, $locale); |
124 | - $relPattern = 'relativeTimePattern-count-' . $rule; |
|
124 | + $relPattern = 'relativeTimePattern-count-'.$rule; |
|
125 | 125 | } |
126 | 126 | } |
127 | - if (!empty($width) && array_key_exists($key . '-' . $width, $data)) { |
|
128 | - $key .= '-' . $width; |
|
127 | + if (!empty($width) && array_key_exists($key.'-'.$width, $data)) { |
|
128 | + $key .= '-'.$width; |
|
129 | 129 | } |
130 | 130 | if (empty($relPattern)) { |
131 | 131 | $relativeString = $data[$key][$relKey]; |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | |
235 | 235 | $locales = array($locale, $language); |
236 | 236 | foreach ($locales as $name) { |
237 | - $i18nScript = 'media/jquery/ui/i18n/datepicker-' . $name . '.js'; |
|
237 | + $i18nScript = 'media/jquery/ui/i18n/datepicker-'.$name.'.js'; |
|
238 | 238 | if (file_exists($xoops->path($i18nScript))) { |
239 | 239 | $xoops->theme()->addBaseScriptAssets($i18nScript); |
240 | 240 | return; |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | } |
339 | 339 | |
340 | 340 | foreach ($pieces as $i => $piece) { |
341 | - $piece = (int) ltrim($piece, '0'); |
|
341 | + $piece = (int)ltrim($piece, '0'); |
|
342 | 342 | switch ($order[$i]) { |
343 | 343 | case 'd': |
344 | 344 | $day = $piece; |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | } |
353 | 353 | } |
354 | 354 | if ($year < 100) { |
355 | - if ($year<70) { |
|
355 | + if ($year < 70) { |
|
356 | 356 | $year += 2000; |
357 | 357 | } else { |
358 | 358 | $year += 1900; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | } |
446 | 446 | |
447 | 447 | foreach ($pieces as $i => $piece) { |
448 | - $piece = (int) ltrim($piece, '0'); |
|
448 | + $piece = (int)ltrim($piece, '0'); |
|
449 | 449 | switch ($order[$i]) { |
450 | 450 | case 'h': |
451 | 451 | $hour = $piece; |
@@ -178,13 +178,13 @@ discard block |
||
178 | 178 | $columnList = ''; |
179 | 179 | $firstComma = ''; |
180 | 180 | foreach ($columns as $col) { |
181 | - $columnList .= $firstComma . $this->quoteIndexColumnName($col); |
|
181 | + $columnList .= $firstComma.$this->quoteIndexColumnName($col); |
|
182 | 182 | $firstComma = ', '; |
183 | 183 | } |
184 | 184 | if (isset($this->tables[$table])) { |
185 | 185 | if (isset($this->tables[$table]['create']) && $this->tables[$table]['create']) { |
186 | 186 | $this->tables[$table]['keys'][$name]['columns'] = $columnList; |
187 | - $this->tables[$table]['keys'][$name]['unique'] = (bool) $unique; |
|
187 | + $this->tables[$table]['keys'][$name]['unique'] = (bool)$unique; |
|
188 | 188 | } else { |
189 | 189 | $add = ($unique ? 'ADD UNIQUE INDEX' : 'ADD INDEX'); |
190 | 190 | $this->queue[] = "ALTER TABLE `{$this->tables[$table]['name']}` {$add} `{$name}` ({$columnList})"; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | $lengthPosition = strpos($column, '('); |
214 | 214 | if ($lengthPosition) { |
215 | - $length = ' ' . substr($column, $lengthPosition); |
|
215 | + $length = ' '.substr($column, $lengthPosition); |
|
216 | 216 | $column = substr($column, 0, $lengthPosition); |
217 | 217 | } |
218 | 218 | $quotedName = "`{$column}`{$length}"; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | |
351 | 351 | return true; |
352 | 352 | } else { |
353 | - $this->queue[] = "ALTER TABLE `{$tableDef['name']}` " . |
|
353 | + $this->queue[] = "ALTER TABLE `{$tableDef['name']}` ". |
|
354 | 354 | "CHANGE COLUMN `{$column}` `{$newName}` {$attributes} "; |
355 | 355 | // loop thru and find the column |
356 | 356 | foreach ($tableDef['columns'] as &$col) { |
@@ -817,8 +817,8 @@ discard block |
||
817 | 817 | $sql = 'SELECT TABLE_NAME, ENGINE, CHARACTER_SET_NAME '; |
818 | 818 | $sql .= ' FROM `INFORMATION_SCHEMA`.`TABLES` t, '; |
819 | 819 | $sql .= ' `INFORMATION_SCHEMA`.`COLLATIONS` c '; |
820 | - $sql .= ' WHERE t.TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
821 | - $sql .= ' AND t.TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
820 | + $sql .= ' WHERE t.TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
821 | + $sql .= ' AND t.TABLE_NAME = \''.$this->name($table).'\' '; |
|
822 | 822 | $sql .= ' AND t.TABLE_COLLATION = c.COLLATION_NAME '; |
823 | 823 | |
824 | 824 | $result = $this->execSql($sql); |
@@ -830,21 +830,21 @@ discard block |
||
830 | 830 | return true; |
831 | 831 | } |
832 | 832 | $tableDef['name'] = $tableSchema['TABLE_NAME']; |
833 | - $tableDef['options'] = 'ENGINE=' . $tableSchema['ENGINE'] . ' ' |
|
834 | - . 'DEFAULT CHARSET=' . $tableSchema['CHARACTER_SET_NAME']; |
|
833 | + $tableDef['options'] = 'ENGINE='.$tableSchema['ENGINE'].' ' |
|
834 | + . 'DEFAULT CHARSET='.$tableSchema['CHARACTER_SET_NAME']; |
|
835 | 835 | |
836 | 836 | $sql = 'SELECT * '; |
837 | 837 | $sql .= ' FROM `INFORMATION_SCHEMA`.`COLUMNS` '; |
838 | - $sql .= ' WHERE TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
839 | - $sql .= ' AND TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
838 | + $sql .= ' WHERE TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
839 | + $sql .= ' AND TABLE_NAME = \''.$this->name($table).'\' '; |
|
840 | 840 | $sql .= ' ORDER BY `ORDINAL_POSITION` '; |
841 | 841 | |
842 | 842 | $result = $this->execSql($sql); |
843 | 843 | |
844 | 844 | while ($column = $this->fetch($result)) { |
845 | - $attributes = ' ' . $column['COLUMN_TYPE'] . ' ' |
|
845 | + $attributes = ' '.$column['COLUMN_TYPE'].' ' |
|
846 | 846 | . (($column['IS_NULLABLE'] === 'NO') ? ' NOT NULL ' : '') |
847 | - . (($column['COLUMN_DEFAULT'] === null) ? '' : " DEFAULT '" . $column['COLUMN_DEFAULT'] . "' ") |
|
847 | + . (($column['COLUMN_DEFAULT'] === null) ? '' : " DEFAULT '".$column['COLUMN_DEFAULT']."' ") |
|
848 | 848 | . $column['EXTRA']; |
849 | 849 | |
850 | 850 | $columnDef = array( |
@@ -858,8 +858,8 @@ discard block |
||
858 | 858 | $sql = 'SELECT `INDEX_NAME`, `SEQ_IN_INDEX`, `NON_UNIQUE`, '; |
859 | 859 | $sql .= ' `COLUMN_NAME`, `SUB_PART` '; |
860 | 860 | $sql .= ' FROM `INFORMATION_SCHEMA`.`STATISTICS` '; |
861 | - $sql .= ' WHERE TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
862 | - $sql .= ' AND TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
861 | + $sql .= ' WHERE TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
862 | + $sql .= ' AND TABLE_NAME = \''.$this->name($table).'\' '; |
|
863 | 863 | $sql .= ' ORDER BY `INDEX_NAME`, `SEQ_IN_INDEX` '; |
864 | 864 | |
865 | 865 | $result = $this->execSql($sql); |
@@ -876,13 +876,13 @@ discard block |
||
876 | 876 | $lastKey = $key['INDEX_NAME']; |
877 | 877 | $keyCols = $key['COLUMN_NAME']; |
878 | 878 | if (!empty($key['SUB_PART'])) { |
879 | - $keyCols .= ' (' . $key['SUB_PART'] . ')'; |
|
879 | + $keyCols .= ' ('.$key['SUB_PART'].')'; |
|
880 | 880 | } |
881 | 881 | $keyUnique = !$key['NON_UNIQUE']; |
882 | 882 | } else { |
883 | - $keyCols .= ', ' . $key['COLUMN_NAME']; |
|
883 | + $keyCols .= ', '.$key['COLUMN_NAME']; |
|
884 | 884 | if (!empty($key['SUB_PART'])) { |
885 | - $keyCols .= ' (' . $key['SUB_PART'] . ')'; |
|
885 | + $keyCols .= ' ('.$key['SUB_PART'].')'; |
|
886 | 886 | } |
887 | 887 | } |
888 | 888 | }; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | 24 | $xoops = Xoops::getInstance(); |
25 | 25 | $xoops->header(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /*$db = $xoopsDB; |
29 | 29 | $db->prefix('protector_log'); |
30 | 30 | $rs = $db->query("SELECT count(lid) FROM " . $db->prefix('protector_log'));*/ |
31 | -$rs = $xoops->db()->query("SELECT count(lid) FROM " . $xoops->db()->prefix('protector_log')); |
|
31 | +$rs = $xoops->db()->query("SELECT count(lid) FROM ".$xoops->db()->prefix('protector_log')); |
|
32 | 32 | //$table = $xoops->db()->prefix('protector_log'); |
33 | 33 | //$rs = $xoops->db()->query($alterSql); |
34 | 34 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $indexAdmin->displayNavigation('index.php'); |
39 | 39 | |
40 | 40 | $indexAdmin->addInfoBox(_MI_PROTECTOR_ADMININDEX, 'off'); |
41 | -$indexAdmin->addInfoBoxLine(sprintf(_AM_PROTECTOR_NBALERT, '<span class="red">' . $numrows . '</span>'), 'off'); |
|
41 | +$indexAdmin->addInfoBoxLine(sprintf(_AM_PROTECTOR_NBALERT, '<span class="red">'.$numrows.'</span>'), 'off'); |
|
42 | 42 | |
43 | 43 | $indexAdmin->displayIndex(); |
44 | 44 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function getSize() |
59 | 59 | { |
60 | - return (int) $this->get('size'); |
|
60 | + return (int)$this->get('size'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function getMaxlength() |
69 | 69 | { |
70 | - return (int) $this->get('maxlength'); |
|
70 | + return (int)$this->get('maxlength'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getPlaceholder() |
79 | 79 | { |
80 | - return (string) $this->get('placeholder'); |
|
80 | + return (string)$this->get('placeholder'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | { |
90 | 90 | $dataList = $this->isDatalist(); |
91 | 91 | if (!empty($dataList)) { |
92 | - $this->add('list', 'list_' . $this->getName()); |
|
92 | + $this->add('list', 'list_'.$this->getName()); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | $attributes = $this->renderAttributeString(); |
96 | - return '<input ' . $attributes . ' ' . $this->getExtra() .' >'; |
|
96 | + return '<input '.$attributes.' '.$this->getExtra().' >'; |
|
97 | 97 | } |
98 | 98 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | if (is_array($caption)) { |
38 | 38 | parent::__construct($caption); |
39 | - $value = $this->get('value',''); |
|
39 | + $value = $this->get('value', ''); |
|
40 | 40 | if (empty($value)) { |
41 | 41 | $this->set('value', '#FFFFFF'); |
42 | 42 | } |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | if ($xoops->theme()) { |
65 | 65 | $xoops->theme()->addScript('include/color-picker.js'); |
66 | 66 | } else { |
67 | - echo '<script type="text/javascript" src="' . $xoops->url('/include/color-picker.js') . '"></script>'; |
|
67 | + echo '<script type="text/javascript" src="'.$xoops->url('/include/color-picker.js').'"></script>'; |
|
68 | 68 | } |
69 | 69 | $temp = $this->get('value', ''); |
70 | 70 | if (!empty($temp)) { |
71 | - $this->set('style', 'background-color:' . $temp . ';'); |
|
71 | + $this->set('style', 'background-color:'.$temp.';'); |
|
72 | 72 | } |
73 | 73 | $ret = '<div>'; |
74 | 74 | $attributes = $this->renderAttributeString(); |
75 | - $ret .= '<input ' . $attributes . ' ' . $this->getExtra() .' >'; |
|
75 | + $ret .= '<input '.$attributes.' '.$this->getExtra().' >'; |
|
76 | 76 | $ret .= '<span>'; |
77 | 77 | $ret .= '<button type="button" '; |
78 | - $ret .= 'data-toggle="tooltip" data-placement="left" title="' . \XoopsLocale::A_SELECT . '" '; |
|
78 | + $ret .= 'data-toggle="tooltip" data-placement="left" title="'.\XoopsLocale::A_SELECT.'" '; |
|
79 | 79 | $ret .= 'onclick="return TCP.popup(\''; |
80 | - $ret .= $xoops->url('/include/') . '\',document.getElementById(\'' . $this->getName() . '\'));">'; |
|
80 | + $ret .= $xoops->url('/include/').'\',document.getElementById(\''.$this->getName().'\'));">'; |
|
81 | 81 | $ret .= '<span>...</span></button>'; |
82 | 82 | $ret .= '</span></div>'; |
83 | 83 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function getType() |
60 | 60 | { |
61 | - return (string) $this->get('type', ''); |
|
61 | + return (string)$this->get('type', ''); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -69,18 +69,18 @@ discard block |
||
69 | 69 | public function defaultRender() |
70 | 70 | { |
71 | 71 | $ret = ''; |
72 | - $class = 'class="' . $this->getClass() . '"'; |
|
72 | + $class = 'class="'.$this->getClass().'"'; |
|
73 | 73 | |
74 | 74 | $attributes = $this->renderAttributeString(); |
75 | 75 | |
76 | - if ((bool) $this->get(':showdelete', false)) { |
|
77 | - $ret .= '<input type="submit"' . $class . ' name="delete" id="delete" value="' |
|
78 | - . \XoopsLocale::A_DELETE . '" onclick="this.form.elements.op.value=\'delete\'">'; |
|
76 | + if ((bool)$this->get(':showdelete', false)) { |
|
77 | + $ret .= '<input type="submit"'.$class.' name="delete" id="delete" value="' |
|
78 | + . \XoopsLocale::A_DELETE.'" onclick="this.form.elements.op.value=\'delete\'">'; |
|
79 | 79 | } |
80 | - $ret .= ' <input type="button" ' . $class . ' value="' . \XoopsLocale::A_CANCEL |
|
80 | + $ret .= ' <input type="button" '.$class.' value="'.\XoopsLocale::A_CANCEL |
|
81 | 81 | . '" onclick="history.go(-1);return true;" />' |
82 | - . ' <input type="reset"' . $class . ' name="reset" id="reset" value="' . \XoopsLocale::A_RESET . '" />' |
|
83 | - . ' <input ' . $attributes . $this->getExtra() . ' />'; |
|
82 | + . ' <input type="reset"'.$class.' name="reset" id="reset" value="'.\XoopsLocale::A_RESET.'" />' |
|
83 | + . ' <input '.$attributes.$this->getExtra().' />'; |
|
84 | 84 | return $ret; |
85 | 85 | } |
86 | 86 | } |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | parent::__construct([]); |
54 | 54 | $this->setCaption($caption); |
55 | 55 | $this->setWithDefaults('name', $name, 'name_error'); |
56 | - $this->set('size', empty($size) ? 32 : (int) $size); |
|
57 | - $this->set('maxlength', empty($maxlength) ? 64 : (int) $maxlength); |
|
56 | + $this->set('size', empty($size) ? 32 : (int)$size); |
|
57 | + $this->set('maxlength', empty($maxlength) ? 64 : (int)$maxlength); |
|
58 | 58 | $this->setValue($value); |
59 | 59 | $this->setWithDefaults('autocomplete', $autoComplete, 'off', ['on', 'off']); |
60 | 60 | if (!empty($placeholder)) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function getSize() |
73 | 73 | { |
74 | - return (int) $this->get('size', 32); |
|
74 | + return (int)$this->get('size', 32); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function getMaxlength() |
83 | 83 | { |
84 | - return (int) $this->get('maxlength', 64); |
|
84 | + return (int)$this->get('maxlength', 64); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -92,6 +92,6 @@ discard block |
||
92 | 92 | public function defaultRender() |
93 | 93 | { |
94 | 94 | $attributes = $this->renderAttributeString(); |
95 | - return '<input ' . $attributes . $this->getExtra() .' >'; |
|
95 | + return '<input '.$attributes.$this->getExtra().' >'; |
|
96 | 96 | } |
97 | 97 | } |
@@ -53,6 +53,6 @@ |
||
53 | 53 | public function defaultRender() |
54 | 54 | { |
55 | 55 | $attributes = $this->renderAttributeString(); |
56 | - return '<input ' . $attributes . $this->getExtra() .' >'; |
|
56 | + return '<input '.$attributes.$this->getExtra().' >'; |
|
57 | 57 | } |
58 | 58 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $dataList = $this->isDatalist(); |
61 | 61 | if (!empty($dataList)) { |
62 | - $this->add('list', 'list_' . $this->getName()); |
|
62 | + $this->add('list', 'list_'.$this->getName()); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $this->suppressRender(['value']); |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | $xoops->theme()->addScript( |
73 | 73 | '', |
74 | 74 | '', |
75 | - ' $(function() { $( "#' . $this->get('id') . '" ).datepicker({' . |
|
76 | - 'showOn: "focus", changeYear: true, constrainInput: false ' . |
|
75 | + ' $(function() { $( "#'.$this->get('id').'" ).datepicker({'. |
|
76 | + 'showOn: "focus", changeYear: true, constrainInput: false '. |
|
77 | 77 | ' }); }); ' |
78 | 78 | ); |
79 | 79 | $ret = '<div>'; |
80 | - $ret .= '<input ' . $attributes . ' value="' . $display_value . '" ' . $this->getExtra() .' >'; |
|
80 | + $ret .= '<input '.$attributes.' value="'.$display_value.'" '.$this->getExtra().' >'; |
|
81 | 81 | $ret .= '<span>'; |
82 | 82 | $ret .= '<button type="button" '; |
83 | - $ret .= 'data-toggle="tooltip" data-placement="left" title="' . \XoopsLocale::A_SELECT . '" '; |
|
84 | - $ret .= 'onclick="$( \'#' . $this->get('id') . '\' ).datepicker( \'show\' );"> '; |
|
83 | + $ret .= 'data-toggle="tooltip" data-placement="left" title="'.\XoopsLocale::A_SELECT.'" '; |
|
84 | + $ret .= 'onclick="$( \'#'.$this->get('id').'\' ).datepicker( \'show\' );"> '; |
|
85 | 85 | $ret .= '<span>...</span></button>'; |
86 | 86 | $ret .= '</span></div>'; |
87 | 87 |