@@ -25,20 +25,20 @@ discard block |
||
| 25 | 25 | $theme_options = ''; |
| 26 | 26 | $theme_set_allowed = $xoops->getConfig('theme_set_allowed'); |
| 27 | 27 | foreach ($theme_set_allowed as $theme) { |
| 28 | - $theme_options .= '<option value="' . $theme . '"'; |
|
| 28 | + $theme_options .= '<option value="'.$theme.'"'; |
|
| 29 | 29 | if ($theme == $xoops->getConfig('theme_set')) { |
| 30 | 30 | $theme_options .= ' selected="selected"'; |
| 31 | 31 | } |
| 32 | - $theme_options .= '>' . $theme . '</option>'; |
|
| 32 | + $theme_options .= '>'.$theme.'</option>'; |
|
| 33 | 33 | } |
| 34 | 34 | $block = array(); |
| 35 | 35 | if ($options[0] == 1) { |
| 36 | - $block['theme_select'] = "<img vspace=\"2\" id=\"xoops_theme_img\" src=\"" . \XoopsBaseConfig::get('themes-url') . "/" . $xoops->getConfig('theme_set') . "/screenshot.png\" alt=\"screenshot\" width=\"" . (int)($options[1]) . "\" /><br /><select class=\"span2\" id=\"xoops_theme_select\" name=\"xoops_theme_select\" onchange=\"showImgSelected('xoops_theme_img', 'xoops_theme_select', 'themes', '/screenshot.png', '" . \XoopsBaseConfig::get('url') . "');\">" . $theme_options . "</select><br /><input type=\"submit\" value=\"" . XoopsLocale::A_GO . "\" />"; |
|
| 36 | + $block['theme_select'] = "<img vspace=\"2\" id=\"xoops_theme_img\" src=\"".\XoopsBaseConfig::get('themes-url')."/".$xoops->getConfig('theme_set')."/screenshot.png\" alt=\"screenshot\" width=\"".(int)($options[1])."\" /><br /><select class=\"span2\" id=\"xoops_theme_select\" name=\"xoops_theme_select\" onchange=\"showImgSelected('xoops_theme_img', 'xoops_theme_select', 'themes', '/screenshot.png', '".\XoopsBaseConfig::get('url')."');\">".$theme_options."</select><br /><input type=\"submit\" value=\"".XoopsLocale::A_GO."\" />"; |
|
| 37 | 37 | } else { |
| 38 | - $block['theme_select'] = '<select class="span2" name="xoops_theme_select" onchange="submit();" size="3">' . $theme_options . '</select>'; |
|
| 38 | + $block['theme_select'] = '<select class="span2" name="xoops_theme_select" onchange="submit();" size="3">'.$theme_options.'</select>'; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $block['theme_select'] .= '<br />(' . sprintf(SystemLocale::F_THEMES, '<strong>' . count($theme_set_allowed) . '</strong>') . ')<br />'; |
|
| 41 | + $block['theme_select'] .= '<br />('.sprintf(SystemLocale::F_THEMES, '<strong>'.count($theme_set_allowed).'</strong>').')<br />'; |
|
| 42 | 42 | return $block; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -46,6 +46,6 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $block_form = new Xoops\Form\BlockForm(); |
| 48 | 48 | $block_form->addElement(new Xoops\Form\RadioYesNo(SystemLocale::DISPLAY_SCREENSHOT_IMAGE, 'options[0]', $options[0])); |
| 49 | - $block_form->addElement( new Xoops\Form\Text(SystemLocale::SCREENSHOT_IMAGE_WIDTH, 'options[1]', 1, 3, $options[1]), true); |
|
| 49 | + $block_form->addElement(new Xoops\Form\Text(SystemLocale::SCREENSHOT_IMAGE_WIDTH, 'options[1]', 1, 3, $options[1]), true); |
|
| 50 | 50 | return $block_form->render(); |
| 51 | 51 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | if (is_array($menu) && !empty($menu)) { |
| 42 | 42 | $block['modules'][$i]['name'] = $menu['name']; |
| 43 | - $block['modules'][$i]['link'] = $xoops->url('modules/' . $dirname . '/' . $menu['link']); |
|
| 43 | + $block['modules'][$i]['link'] = $xoops->url('modules/'.$dirname.'/'.$menu['link']); |
|
| 44 | 44 | $block['modules'][$i]['image'] = $menu['image']; |
| 45 | 45 | $block['modules'][$i]['icon'] = 'glyphicon glyphicon-none'; |
| 46 | 46 | $block['modules'][$i]['dirname'] = $dirname; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $block['modules'][$i]['sublinks'][] = array( |
| 55 | 55 | 'name' => $sublink['name'], |
| 56 | 56 | 'title' => $sublink['name'], |
| 57 | - 'url' => $xoops->url('modules/' . $dirname . '/' . $sublink['url']) |
|
| 57 | + 'url' => $xoops->url('modules/'.$dirname.'/'.$sublink['url']) |
|
| 58 | 58 | ); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | // View Account |
| 68 | 68 | array_unshift($block['modules'], array( |
| 69 | 69 | 'name' => XoopsLocale::VIEW_ACCOUNT, |
| 70 | - 'link' => $xoops->url('userinfo.php?uid=' . $xoops->user->getVar('uid')), |
|
| 70 | + 'link' => $xoops->url('userinfo.php?uid='.$xoops->user->getVar('uid')), |
|
| 71 | 71 | 'icon' => 'glyphicon glyphicon-user', |
| 72 | 72 | 'title' => XoopsLocale::VIEW_ACCOUNT, |
| 73 | 73 | )); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $name = XoopsLocale::INBOX; |
| 101 | 101 | $class = ''; |
| 102 | 102 | if ($pm_count = $pm_handler->getCount($criteria)) { |
| 103 | - $name = XoopsLocale::INBOX . ' <span class="badge">' . $pm_count . '</span>'; |
|
| 103 | + $name = XoopsLocale::INBOX.' <span class="badge">'.$pm_count.'</span>'; |
|
| 104 | 104 | //$class = 'text-info'; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $members = ''; |
| 51 | 51 | for ($i = 0; $i < $total; ++$i) { |
| 52 | 52 | if ($onlines[$i]['online_uid'] > 0) { |
| 53 | - $members .= ' <a href="' . \XoopsBaseConfig::get('url') . '/userinfo.php?uid=' . $onlines[$i]['online_uid'] . '" title="' . $onlines[$i]['online_uname'] . '">' . $onlines[$i]['online_uname'] . '</a>,'; |
|
| 53 | + $members .= ' <a href="'.\XoopsBaseConfig::get('url').'/userinfo.php?uid='.$onlines[$i]['online_uid'].'" title="'.$onlines[$i]['online_uname'].'">'.$onlines[$i]['online_uname'].'</a>,'; |
|
| 54 | 54 | } else { |
| 55 | 55 | ++$guests; |
| 56 | 56 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $block['online_total'] = sprintf(XoopsLocale::F_USERS_ONLINE, $total); |
| 59 | 59 | if ($xoops->isModule()) { |
| 60 | 60 | $mytotal = $online_handler->getCount(new Criteria('online_module', $xoops->module->getVar('mid'))); |
| 61 | - $block['online_total'] .= ' (' . sprintf(XoopsLocale::F_USERS_BROWSING, $mytotal, $xoops->module->getVar('name')) . ')'; |
|
| 61 | + $block['online_total'] .= ' ('.sprintf(XoopsLocale::F_USERS_BROWSING, $mytotal, $xoops->module->getVar('name')).')'; |
|
| 62 | 62 | } |
| 63 | 63 | $block['lang_members'] = XoopsLocale::MEMBERS; |
| 64 | 64 | $block['lang_guests'] = XoopsLocale::GUESTS; |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | for ($i = 0; $i < $count; ++$i) { |
| 42 | 42 | $block['users'][$i]['rank'] = $i + 1; |
| 43 | 43 | if ($options[1] == 1) { |
| 44 | - $block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') !== 'blank.gif' ? \XoopsBaseConfig::get('uploads-url') . '/' . $topposters[$i]->getVar('user_avatar') : ''; |
|
| 44 | + $block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') !== 'blank.gif' ? \XoopsBaseConfig::get('uploads-url').'/'.$topposters[$i]->getVar('user_avatar') : ''; |
|
| 45 | 45 | } else { |
| 46 | 46 | $block['users'][$i]['avatar'] = ''; |
| 47 | 47 | } |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | return false; |
| 122 | 122 | } |
| 123 | 123 | $language = empty($language) ? $xoops->getConfig('language') : $language; |
| 124 | - $path = 'modules/' . $domain . '/language/'; |
|
| 125 | - if (XoopsLoad::fileExists($file = $xoops->path($path . $language . '/admin/' . $name . '.php'))) { |
|
| 124 | + $path = 'modules/'.$domain.'/language/'; |
|
| 125 | + if (XoopsLoad::fileExists($file = $xoops->path($path.$language.'/admin/'.$name.'.php'))) { |
|
| 126 | 126 | $ret = include_once $file; |
| 127 | 127 | } else { |
| 128 | - $ret = include_once $xoops->path($path . 'english/admin/' . $name . '.php'); |
|
| 128 | + $ret = include_once $xoops->path($path.'english/admin/'.$name.'.php'); |
|
| 129 | 129 | } |
| 130 | 130 | return $ret; |
| 131 | 131 | } |
@@ -138,16 +138,16 @@ discard block |
||
| 138 | 138 | public function adminVersion($version, $value = '') |
| 139 | 139 | { |
| 140 | 140 | static $tblVersion = array(); |
| 141 | - if (is_array($tblVersion) && array_key_exists($version . '.' . $value, $tblVersion)) { |
|
| 142 | - return $tblVersion[$version . '.' . $value]; |
|
| 141 | + if (is_array($tblVersion) && array_key_exists($version.'.'.$value, $tblVersion)) { |
|
| 142 | + return $tblVersion[$version.'.'.$value]; |
|
| 143 | 143 | } |
| 144 | 144 | $xoops = Xoops::getInstance(); |
| 145 | - $path = $xoops->path('modules/system/admin/' . $version . '/xoops_version.php'); |
|
| 145 | + $path = $xoops->path('modules/system/admin/'.$version.'/xoops_version.php'); |
|
| 146 | 146 | if (XoopsLoad::fileExists($path)) { |
| 147 | 147 | $modversion = array(); |
| 148 | 148 | include $path; |
| 149 | 149 | $retvalue = $modversion[$value]; |
| 150 | - $tblVersion[$version . '.' . $value] = $retvalue; |
|
| 150 | + $tblVersion[$version.'.'.$value] = $retvalue; |
|
| 151 | 151 | return $retvalue; |
| 152 | 152 | } |
| 153 | 153 | return ''; |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public function cleanCache($cache) |
| 175 | 175 | { |
| 176 | - $cachePath = \XoopsBaseConfig::get('var-path') . '/caches/'; |
|
| 176 | + $cachePath = \XoopsBaseConfig::get('var-path').'/caches/'; |
|
| 177 | 177 | $total_smarty_cache = 0; |
| 178 | 178 | $total_smarty_compile = 0; |
| 179 | 179 | $total_xoops_cache = 0; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | for ($i = 0; $i < count($cache); ++$i) { |
| 182 | 182 | switch ($cache[$i]) { |
| 183 | 183 | case 1: |
| 184 | - $files = glob($cachePath . 'smarty_cache/*.*'); |
|
| 184 | + $files = glob($cachePath.'smarty_cache/*.*'); |
|
| 185 | 185 | $total_smarty_cache = 0; |
| 186 | 186 | foreach ($files as $filename) { |
| 187 | 187 | if (basename(strtolower($filename)) !== 'index.html') { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | break; |
| 193 | 193 | |
| 194 | 194 | case 2: |
| 195 | - $files = glob($cachePath . 'smarty_compile/*.*'); |
|
| 195 | + $files = glob($cachePath.'smarty_compile/*.*'); |
|
| 196 | 196 | $total_smarty_compile = 0; |
| 197 | 197 | foreach ($files as $filename) { |
| 198 | 198 | if (basename(strtolower($filename)) !== 'index.html') { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | // ask the cache to clear itself |
| 207 | 207 | $status = Xoops::getInstance()->cache()->delete('system'); |
| 208 | 208 | // this section captures legacy cache use only |
| 209 | - $files = glob($cachePath . 'xoops_cache/*.*'); |
|
| 209 | + $files = glob($cachePath.'xoops_cache/*.*'); |
|
| 210 | 210 | $total_xoops_cache = 0; |
| 211 | 211 | foreach ($files as $filename) { |
| 212 | 212 | if (basename(strtolower($filename)) != 'index.html') { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | ++$total_xoops_cache; |
| 215 | 215 | } |
| 216 | 216 | } |
| 217 | - $total_xoops_cache = $status || ($total_xoops_cache>0); |
|
| 217 | + $total_xoops_cache = $status || ($total_xoops_cache > 0); |
|
| 218 | 218 | break; |
| 219 | 219 | } |
| 220 | 220 | } |
@@ -106,20 +106,20 @@ discard block |
||
| 106 | 106 | $module->setInfo('warning_update', true); |
| 107 | 107 | } |
| 108 | 108 | if (XoopsLoad::fileExists( |
| 109 | - \XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname') . '/icons/logo_small.png' |
|
| 109 | + \XoopsBaseConfig::get('root-path').'/modules/'.$module->getVar('dirname').'/icons/logo_small.png' |
|
| 110 | 110 | )) { |
| 111 | 111 | $module->setInfo( |
| 112 | 112 | 'logo_small', |
| 113 | - \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/icons/logo_small.png' |
|
| 113 | + \XoopsBaseConfig::get('url').'/modules/'.$module->getVar('dirname').'/icons/logo_small.png' |
|
| 114 | 114 | ); |
| 115 | 115 | } else { |
| 116 | - $module->setInfo('logo_small', \XoopsBaseConfig::get('url') . '/media/xoops/images/icons/16/default.png'); |
|
| 116 | + $module->setInfo('logo_small', \XoopsBaseConfig::get('url').'/media/xoops/images/icons/16/default.png'); |
|
| 117 | 117 | } |
| 118 | 118 | $module->setInfo('version', round($module->getVar('version') / 100, 2)); |
| 119 | 119 | $module->setInfo('update', XoopsLocale::formatTimestamp($module->getVar('last_update'), 's')); |
| 120 | 120 | $module->setInfo( |
| 121 | 121 | 'link_admin', |
| 122 | - \XoopsBaseConfig::get('url') . '/modules/' . $module->getVar('dirname') . '/' . $module->getInfo('adminindex') |
|
| 122 | + \XoopsBaseConfig::get('url').'/modules/'.$module->getVar('dirname').'/'.$module->getInfo('adminindex') |
|
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | 125 | if ($module->getVar('isactive')) { |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | ) { |
| 142 | 142 | $module->setInfo( |
| 143 | 143 | 'link_pref', |
| 144 | - \XoopsBaseConfig::get('url') . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' |
|
| 144 | + \XoopsBaseConfig::get('url').'/modules/system/admin.php?fct=preferences&op=showmod&mod=' |
|
| 145 | 145 | . $module->getVar('mid') |
| 146 | 146 | ); |
| 147 | 147 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $ret = array(); |
| 167 | 167 | $i = 0; |
| 168 | 168 | foreach ($this->modulesList as $file) { |
| 169 | - if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) { |
|
| 169 | + if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path').'/modules/'.$file.'/xoops_version.php')) { |
|
| 170 | 170 | clearstatcache(); |
| 171 | 171 | $file = trim($file); |
| 172 | 172 | if (!in_array($file, $this->modulesDirnames)) { |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $module->setVar('last_update', time()); |
| 214 | 214 | $install_script = $module->getInfo('onInstall'); |
| 215 | 215 | if ($install_script && trim($install_script) != '') { |
| 216 | - XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($install_script))); |
|
| 216 | + XoopsLoad::loadFile($xoops->path('modules/'.$mod.'/'.trim($install_script))); |
|
| 217 | 217 | } |
| 218 | 218 | $func = "xoops_module_pre_install_{$mod}"; |
| 219 | 219 | // If pre install function is defined, execute |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $schema_file = $module->getInfo('schema'); |
| 235 | 235 | $sql_file = $module->getInfo('sqlfile'); |
| 236 | 236 | if (!empty($schema_file)) { |
| 237 | - $schema_file_path = \XoopsBaseConfig::get('root-path') . '/modules/' . $mod . '/' . $schema_file; |
|
| 237 | + $schema_file_path = \XoopsBaseConfig::get('root-path').'/modules/'.$mod.'/'.$schema_file; |
|
| 238 | 238 | if (!XoopsLoad::fileExists($schema_file_path)) { |
| 239 | 239 | $this->error[] = |
| 240 | 240 | sprintf(SystemLocale::EF_SQL_FILE_NOT_FOUND, "<strong>{$schema_file}</strong>"); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | } elseif (is_array($sql_file) && !empty($sql_file[\XoopsBaseConfig::get('db-type')])) { |
| 248 | 248 | $xoops->deprecated('Install SQL files are deprecated since 2.6.0. Convert to portable Schemas'); |
| 249 | 249 | |
| 250 | - $sql_file_path = \XoopsBaseConfig::get('root-path') . '/modules/' . $mod . '/' . $sql_file[\XoopsBaseConfig::get('db-type')]; |
|
| 250 | + $sql_file_path = \XoopsBaseConfig::get('root-path').'/modules/'.$mod.'/'.$sql_file[\XoopsBaseConfig::get('db-type')]; |
|
| 251 | 251 | if (!XoopsLoad::fileExists($sql_file_path)) { |
| 252 | 252 | $this->error[] = |
| 253 | 253 | sprintf(SystemLocale::EF_SQL_FILE_NOT_FOUND, "<strong>{$sql_file_path}</strong>"); |
@@ -264,10 +264,10 @@ discard block |
||
| 264 | 264 | // [4] contains unprefixed table name |
| 265 | 265 | $prefixed_query = SqlUtility::prefixQuery($piece, $xoops->db()->prefix()); |
| 266 | 266 | if (!$prefixed_query) { |
| 267 | - $this->error[]['sub'] = '<span class="red">' . sprintf( |
|
| 267 | + $this->error[]['sub'] = '<span class="red">'.sprintf( |
|
| 268 | 268 | XoopsLocale::EF_INVALID_SQL, |
| 269 | - '<strong>' . $piece . '</strong>' |
|
| 270 | - ) . '</span>'; |
|
| 269 | + '<strong>'.$piece.'</strong>' |
|
| 270 | + ).'</span>'; |
|
| 271 | 271 | break; |
| 272 | 272 | } |
| 273 | 273 | // check if the table name is reserved |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $result = $xoops->db()->query($prefixed_query[0]); |
| 278 | 278 | } catch (Exception $e) { |
| 279 | 279 | $xoops->events()->triggerEvent('core.exception', $e); |
| 280 | - $result=false; |
|
| 280 | + $result = false; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | if (!$result) { |
@@ -287,13 +287,13 @@ discard block |
||
| 287 | 287 | if (!in_array($prefixed_query[4], $created_tables)) { |
| 288 | 288 | $this->trace[]['sub'] = sprintf( |
| 289 | 289 | XoopsLocale::SF_TABLE_CREATED, |
| 290 | - '<strong>' . $xoops->db()->prefix($prefixed_query[4]) . '</strong>' |
|
| 290 | + '<strong>'.$xoops->db()->prefix($prefixed_query[4]).'</strong>' |
|
| 291 | 291 | ); |
| 292 | 292 | $created_tables[] = $prefixed_query[4]; |
| 293 | 293 | } else { |
| 294 | 294 | $this->trace[]['sub'] = sprintf( |
| 295 | 295 | XoopsLocale::SF_DATA_INSERTED_TO_TABLE, |
| 296 | - '<strong>' . $xoops->db()->prefix($prefixed_query[4]) . '</strong>' |
|
| 296 | + '<strong>'.$xoops->db()->prefix($prefixed_query[4]).'</strong>' |
|
| 297 | 297 | ); |
| 298 | 298 | } |
| 299 | 299 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | // the table name is reserved, so halt the installation |
| 302 | 302 | $this->error[]['sub'] = sprintf( |
| 303 | 303 | SystemLocale::EF_TABLE_IS_RESERVED, |
| 304 | - '<strong>' . $prefixed_query[4] . '</strong>' |
|
| 304 | + '<strong>'.$prefixed_query[4].'</strong>' |
|
| 305 | 305 | ); |
| 306 | 306 | break; |
| 307 | 307 | } |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | if (count($this->error) > 0) { |
| 312 | 312 | foreach ($created_tables as $table) { |
| 313 | 313 | try { |
| 314 | - $xoops->db()->query('DROP TABLE ' . $xoops->db()->prefix($table)); |
|
| 314 | + $xoops->db()->query('DROP TABLE '.$xoops->db()->prefix($table)); |
|
| 315 | 315 | } catch (Exception $e) { |
| 316 | 316 | $xoops->events()->triggerEvent('core.exception', $e); |
| 317 | 317 | } |
@@ -326,25 +326,25 @@ discard block |
||
| 326 | 326 | if (!$module_handler->insertModule($module)) { |
| 327 | 327 | $this->error[] = sprintf( |
| 328 | 328 | XoopsLocale::EF_NOT_INSERTED_TO_DATABASE, |
| 329 | - '<strong>' . $module->getVar('name') . '</strong>' |
|
| 329 | + '<strong>'.$module->getVar('name').'</strong>' |
|
| 330 | 330 | ); |
| 331 | 331 | foreach ($created_tables as $ct) { |
| 332 | 332 | try { |
| 333 | - $xoops->db()->query('DROP TABLE ' . $xoops->db()->prefix($ct)); |
|
| 333 | + $xoops->db()->query('DROP TABLE '.$xoops->db()->prefix($ct)); |
|
| 334 | 334 | } catch (Exception $e) { |
| 335 | 335 | $xoops->events()->triggerEvent('core.exception', $e); |
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | - $this->error[] = sprintf(XoopsLocale::EF_NOT_INSTALLED, "<strong>" . $module->name() . "</strong>"); |
|
| 338 | + $this->error[] = sprintf(XoopsLocale::EF_NOT_INSTALLED, "<strong>".$module->name()."</strong>"); |
|
| 339 | 339 | $this->error[] = XoopsLocale::C_ERRORS; |
| 340 | 340 | unset($module); |
| 341 | 341 | unset($created_tables); |
| 342 | 342 | return false; |
| 343 | 343 | } |
| 344 | 344 | unset($created_tables); |
| 345 | - $this->trace[] = XoopsLocale::S_DATA_INSERTED . sprintf( |
|
| 345 | + $this->trace[] = XoopsLocale::S_DATA_INSERTED.sprintf( |
|
| 346 | 346 | SystemLocale::F_MODULE_ID, |
| 347 | - '<strong>' . $module->getVar('mid') . '</strong>' |
|
| 347 | + '<strong>'.$module->getVar('mid').'</strong>' |
|
| 348 | 348 | ); |
| 349 | 349 | $xoops->db()->beginTransaction(); |
| 350 | 350 | // install Templates |
@@ -376,14 +376,14 @@ discard block |
||
| 376 | 376 | $mperm->setVar('gperm_name', 'module_admin'); |
| 377 | 377 | $mperm->setVar('gperm_modid', 1); |
| 378 | 378 | if (!$gperm_handler->insert($mperm)) { |
| 379 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 379 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 380 | 380 | SystemLocale::EF_GROUP_ID_ADMIN_ACCESS_RIGHT_NOT_ADDED, |
| 381 | - '<strong>' . $mygroup . '</strong>' |
|
| 382 | - ) . '</span>'; |
|
| 381 | + '<strong>'.$mygroup.'</strong>' |
|
| 382 | + ).'</span>'; |
|
| 383 | 383 | } else { |
| 384 | 384 | $this->trace[]['sub'] = sprintf( |
| 385 | 385 | SystemLocale::SF_GROUP_ID_ADMIN_ACCESS_RIGHT_ADDED, |
| 386 | - '<strong>' . $mygroup . '</strong>' |
|
| 386 | + '<strong>'.$mygroup.'</strong>' |
|
| 387 | 387 | ); |
| 388 | 388 | } |
| 389 | 389 | unset($mperm); |
@@ -394,14 +394,14 @@ discard block |
||
| 394 | 394 | $mperm->setVar('gperm_name', 'module_read'); |
| 395 | 395 | $mperm->setVar('gperm_modid', 1); |
| 396 | 396 | if (!$gperm_handler->insert($mperm)) { |
| 397 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 397 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 398 | 398 | SystemLocale::EF_GROUP_ID_USER_ACCESS_RIGHT_NOT_ADDED, |
| 399 | - '<strong>' . $mygroup . '</strong>' |
|
| 400 | - ) . '</span>'; |
|
| 399 | + '<strong>'.$mygroup.'</strong>' |
|
| 400 | + ).'</span>'; |
|
| 401 | 401 | } else { |
| 402 | 402 | $this->trace[]['sub'] = sprintf( |
| 403 | 403 | SystemLocale::SF_GROUP_ID_USER_ACCESS_RIGHT_ADDED, |
| 404 | - '<strong>' . $mygroup . '</strong>' |
|
| 404 | + '<strong>'.$mygroup.'</strong>' |
|
| 405 | 405 | ); |
| 406 | 406 | } |
| 407 | 407 | unset($mperm); |
@@ -413,12 +413,12 @@ discard block |
||
| 413 | 413 | $bperm->setVar('gperm_modid', 1); |
| 414 | 414 | if (!$gperm_handler->insert($bperm)) { |
| 415 | 415 | $this->trace[]['sub'] = '<span class="red">' |
| 416 | - . SystemLocale::E_BLOCK_ACCESS_NOT_ADDED . ' Block ID: <strong>' |
|
| 417 | - . $blc . '</strong> Group ID: <strong>' . $mygroup . '</strong></span>'; |
|
| 416 | + . SystemLocale::E_BLOCK_ACCESS_NOT_ADDED.' Block ID: <strong>' |
|
| 417 | + . $blc.'</strong> Group ID: <strong>'.$mygroup.'</strong></span>'; |
|
| 418 | 418 | } else { |
| 419 | 419 | $this->trace[]['sub'] = SystemLocale::S_BLOCK_ACCESS_ADDED |
| 420 | - . sprintf(SystemLocale::F_BLOCK_ID, "<strong>" . $blc . "</strong>") |
|
| 421 | - . sprintf(SystemLocale::F_GROUP_ID, "<strong>" . $mygroup . "</strong>"); |
|
| 420 | + . sprintf(SystemLocale::F_BLOCK_ID, "<strong>".$blc."</strong>") |
|
| 421 | + . sprintf(SystemLocale::F_GROUP_ID, "<strong>".$mygroup."</strong>"); |
|
| 422 | 422 | } |
| 423 | 423 | unset($bperm); |
| 424 | 424 | } |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | $this->trace[] = sprintf( |
| 444 | 444 | XoopsLocale::SF_INSTALLED, |
| 445 | - '<strong>' . $module->getVar('name', 's') . '</strong>' |
|
| 445 | + '<strong>'.$module->getVar('name', 's').'</strong>' |
|
| 446 | 446 | ); |
| 447 | 447 | unset($blocks); |
| 448 | 448 | |
@@ -454,8 +454,8 @@ discard block |
||
| 454 | 454 | } else { |
| 455 | 455 | $this->error[] = sprintf( |
| 456 | 456 | XoopsLocale::EF_NOT_INSTALLED, |
| 457 | - '<strong>' . $mod . '</strong>' |
|
| 458 | - ) . " " . XoopsLocale::C_ERRORS; |
|
| 457 | + '<strong>'.$mod.'</strong>' |
|
| 458 | + )." ".XoopsLocale::C_ERRORS; |
|
| 459 | 459 | return false; |
| 460 | 460 | } |
| 461 | 461 | return false; |
@@ -478,22 +478,22 @@ discard block |
||
| 478 | 478 | if ($module->getVar('dirname') === 'system') { |
| 479 | 479 | $this->error[] = sprintf( |
| 480 | 480 | XoopsLocale::EF_NOT_UNINSTALLED, |
| 481 | - '<strong>' . $module->getVar('name') . '</strong>' |
|
| 482 | - ) . " " . XoopsLocale::C_ERRORS; |
|
| 483 | - $this->error[] = " - " . SystemLocale::E_SYSTEM_MODULE_CANNOT_BE_DEACTIVATED; |
|
| 481 | + '<strong>'.$module->getVar('name').'</strong>' |
|
| 482 | + )." ".XoopsLocale::C_ERRORS; |
|
| 483 | + $this->error[] = " - ".SystemLocale::E_SYSTEM_MODULE_CANNOT_BE_DEACTIVATED; |
|
| 484 | 484 | return false; |
| 485 | 485 | } elseif ($module->getVar('dirname') == $xoops->getConfig('startpage')) { |
| 486 | 486 | $this->error[] = sprintf( |
| 487 | 487 | XoopsLocale::EF_NOT_UNINSTALLED, |
| 488 | - '<strong>' . $module->getVar('name') . '</strong>' |
|
| 489 | - ) . " " . XoopsLocale::C_ERRORS; |
|
| 490 | - $this->error[] = " - " . SystemLocale::E_THIS_MODULE_IS_SET_AS_DEFAULT_START_PAGE; |
|
| 488 | + '<strong>'.$module->getVar('name').'</strong>' |
|
| 489 | + )." ".XoopsLocale::C_ERRORS; |
|
| 490 | + $this->error[] = " - ".SystemLocale::E_THIS_MODULE_IS_SET_AS_DEFAULT_START_PAGE; |
|
| 491 | 491 | return false; |
| 492 | 492 | } else { |
| 493 | 493 | // Load module specific install script if any |
| 494 | 494 | $uninstall_script = $module->getInfo('onUninstall'); |
| 495 | 495 | if ($uninstall_script && trim($uninstall_script) != '') { |
| 496 | - XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($uninstall_script))); |
|
| 496 | + XoopsLoad::loadFile($xoops->path('modules/'.$mod.'/'.trim($uninstall_script))); |
|
| 497 | 497 | } |
| 498 | 498 | $func = "xoops_module_pre_uninstall_{$mod}"; |
| 499 | 499 | // If pre uninstall function is defined, execute |
@@ -503,8 +503,8 @@ discard block |
||
| 503 | 503 | $this->error[] = sprintf(XoopsLocale::EF_NOT_EXECUTED, $func); |
| 504 | 504 | $this->error[] = sprintf( |
| 505 | 505 | XoopsLocale::EF_NOT_UNINSTALLED, |
| 506 | - '<strong>' . $module->getVar('name') . '</strong>' |
|
| 507 | - ) . " " . XoopsLocale::C_ERRORS; |
|
| 506 | + '<strong>'.$module->getVar('name').'</strong>' |
|
| 507 | + )." ".XoopsLocale::C_ERRORS; |
|
| 508 | 508 | $this->error = array_merge($this->error, $module->getErrors()); |
| 509 | 509 | return false; |
| 510 | 510 | } else { |
@@ -538,13 +538,13 @@ discard block |
||
| 538 | 538 | $toSchema->dropTable($xoops->db()->prefix($table)); |
| 539 | 539 | $this->trace[]['sub'] = sprintf( |
| 540 | 540 | XoopsLocale::SF_TABLE_DROPPED, |
| 541 | - '<strong>' . $xoops->db()->prefix($table) . '</strong>' |
|
| 541 | + '<strong>'.$xoops->db()->prefix($table).'</strong>' |
|
| 542 | 542 | ); |
| 543 | 543 | } else { |
| 544 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 544 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 545 | 545 | XoopsLocale::EF_TABLE_DROP_NOT_ALLOWED, |
| 546 | - '<strong>' . $xoops->db()->prefix($table) . '</strong>' |
|
| 547 | - ) . '</span>'; |
|
| 546 | + '<strong>'.$xoops->db()->prefix($table).'</strong>' |
|
| 547 | + ).'</span>'; |
|
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 | $synchronizer = new SingleDatabaseSynchronizer($xoops->db()); |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | // delete permissions if any |
| 555 | 555 | $gperm_handler = $xoops->getHandlerGroupPermission(); |
| 556 | 556 | if (false === $gperm_handler->deleteByModule($module->getVar('mid'))) { |
| 557 | - $this->trace[] = '<span class="red">' . SystemLocale::E_GROUP_PERMISSIONS_NOT_DELETED . '</span>'; |
|
| 557 | + $this->trace[] = '<span class="red">'.SystemLocale::E_GROUP_PERMISSIONS_NOT_DELETED.'</span>'; |
|
| 558 | 558 | } else { |
| 559 | 559 | $this->trace[] = SystemLocale::S_GROUP_PERMISSIONS_DELETED; |
| 560 | 560 | } |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | $this->deleteConfigs($module); |
| 564 | 564 | |
| 565 | 565 | // execute module specific install script if any |
| 566 | - $func = 'xoops_module_uninstall_' . $mod; |
|
| 566 | + $func = 'xoops_module_uninstall_'.$mod; |
|
| 567 | 567 | if (function_exists($func)) { |
| 568 | 568 | $result = $func($module); |
| 569 | 569 | if (!$result) { |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | $this->trace[] = sprintf( |
| 578 | 578 | XoopsLocale::SF_UNINSTALLED, |
| 579 | - '<strong>' . $module->getVar('name') . '</strong>' |
|
| 579 | + '<strong>'.$module->getVar('name').'</strong>' |
|
| 580 | 580 | ); |
| 581 | 581 | $xoops->events()->triggerEvent('system.module.uninstall', $module); |
| 582 | 582 | return $module; |
@@ -606,14 +606,14 @@ discard block |
||
| 606 | 606 | $module->setVar('last_update', time()); |
| 607 | 607 | |
| 608 | 608 | if (!$module_handler->insertModule($module)) { |
| 609 | - $this->error[] = sprintf(XoopsLocale::EF_NOT_UPDATED, "<strong>" . $module->getVar('name') . "</strong>"); |
|
| 609 | + $this->error[] = sprintf(XoopsLocale::EF_NOT_UPDATED, "<strong>".$module->getVar('name')."</strong>"); |
|
| 610 | 610 | return false; |
| 611 | 611 | } else { |
| 612 | 612 | // execute module specific preupdate script if any |
| 613 | 613 | $update_script = $module->getInfo('onUpdate'); |
| 614 | 614 | if (false != $update_script && trim($update_script) != '') { |
| 615 | - XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($update_script))); |
|
| 616 | - $func = 'xoops_module_pre_update_' . $mod; |
|
| 615 | + XoopsLoad::loadFile($xoops->path('modules/'.$mod.'/'.trim($update_script))); |
|
| 616 | + $func = 'xoops_module_pre_update_'.$mod; |
|
| 617 | 617 | if (function_exists($func)) { |
| 618 | 618 | $result = $func($module, $prev_version); |
| 619 | 619 | if (!$result) { |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | // update schema |
| 630 | 630 | $schema_file = $module->getInfo('schema'); |
| 631 | 631 | if (!empty($schema_file)) { |
| 632 | - $schema_file_path = \XoopsBaseConfig::get('root-path') . '/modules/' . $mod . '/' . $schema_file; |
|
| 632 | + $schema_file_path = \XoopsBaseConfig::get('root-path').'/modules/'.$mod.'/'.$schema_file; |
|
| 633 | 633 | if (!XoopsLoad::fileExists($schema_file_path)) { |
| 634 | 634 | $this->error[] = |
| 635 | 635 | sprintf(SystemLocale::EF_SQL_FILE_NOT_FOUND, "<strong>{$schema_file}</strong>"); |
@@ -662,8 +662,8 @@ discard block |
||
| 662 | 662 | // execute module specific update script if any |
| 663 | 663 | $update_script = $module->getInfo('onUpdate'); |
| 664 | 664 | if (false != $update_script && trim($update_script) != '') { |
| 665 | - XoopsLoad::loadFile($xoops->path('modules/' . $mod . '/' . trim($update_script))); |
|
| 666 | - $func = 'xoops_module_update_' . $mod; |
|
| 665 | + XoopsLoad::loadFile($xoops->path('modules/'.$mod.'/'.trim($update_script))); |
|
| 666 | + $func = 'xoops_module_update_'.$mod; |
|
| 667 | 667 | if (function_exists($func)) { |
| 668 | 668 | $result = $func($module, $prev_version); |
| 669 | 669 | if (!$result) { |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | } |
| 676 | 676 | } |
| 677 | 677 | } |
| 678 | - $this->trace[] = sprintf(XoopsLocale::SF_UPDATED, '<strong>' . $module->getVar('name', 's') . '</strong>'); |
|
| 678 | + $this->trace[] = sprintf(XoopsLocale::SF_UPDATED, '<strong>'.$module->getVar('name', 's').'</strong>'); |
|
| 679 | 679 | return $module; |
| 680 | 680 | } |
| 681 | 681 | } |
@@ -696,10 +696,10 @@ discard block |
||
| 696 | 696 | switch ($type) { |
| 697 | 697 | case 'blocks': |
| 698 | 698 | case 'admin': |
| 699 | - $path = $xoops->path('modules/' . $dirname . '/templates/' . $type . '/' . $template); |
|
| 699 | + $path = $xoops->path('modules/'.$dirname.'/templates/'.$type.'/'.$template); |
|
| 700 | 700 | break; |
| 701 | 701 | default: |
| 702 | - $path = $xoops->path('modules/' . $dirname . '/templates/' . $template); |
|
| 702 | + $path = $xoops->path('modules/'.$dirname.'/templates/'.$template); |
|
| 703 | 703 | break; |
| 704 | 704 | } |
| 705 | 705 | if (!XoopsLoad::fileExists($path)) { |
@@ -752,39 +752,39 @@ discard block |
||
| 752 | 752 | $tplfile->setVar('tpl_file', $tpl['file']); |
| 753 | 753 | $tplfile->setVar('tpl_desc', $tpl['description']); |
| 754 | 754 | if (!$tplfile_handler->insertTpl($tplfile)) { |
| 755 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 755 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 756 | 756 | SystemLocale::EF_TEMPLATE_NOT_ADDED_TO_DATABASE, |
| 757 | - '<strong>' . $tpl['file'] . '</strong>' |
|
| 758 | - ) . '</span>'; |
|
| 757 | + '<strong>'.$tpl['file'].'</strong>' |
|
| 758 | + ).'</span>'; |
|
| 759 | 759 | } else { |
| 760 | 760 | $newid = $tplfile->getVar('tpl_id'); |
| 761 | 761 | $this->trace[]['sub'] = sprintf( |
| 762 | 762 | SystemLocale::SF_TEMPLATE_ADDED, |
| 763 | - '<strong>' . $tpl['file'] . '</strong>' |
|
| 763 | + '<strong>'.$tpl['file'].'</strong>' |
|
| 764 | 764 | ); |
| 765 | 765 | if ($module->getVar('dirname') === 'system') { |
| 766 | 766 | if (!$xoops->templateTouch($newid)) { |
| 767 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 767 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 768 | 768 | SystemLocale::EF_TEMPLATE_NOT_RECOMPILED, |
| 769 | - '<strong>' . $tpl['file'] . '</strong>' |
|
| 770 | - ) . '</span>'; |
|
| 769 | + '<strong>'.$tpl['file'].'</strong>' |
|
| 770 | + ).'</span>'; |
|
| 771 | 771 | } else { |
| 772 | 772 | $this->trace[]['sub'] = sprintf( |
| 773 | 773 | SystemLocale::SF_TEMPLATE_RECOMPILED, |
| 774 | - '<strong>' . $tpl['file'] . '</strong>' |
|
| 774 | + '<strong>'.$tpl['file'].'</strong>' |
|
| 775 | 775 | ); |
| 776 | 776 | } |
| 777 | 777 | } else { |
| 778 | 778 | if ($xoops->config['template_set'] === 'default') { |
| 779 | 779 | if (!$xoops->templateTouch($newid)) { |
| 780 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 780 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 781 | 781 | SystemLocale::EF_TEMPLATE_NOT_RECOMPILED, |
| 782 | - '<strong>' . $tpl['file'] . '</strong>' |
|
| 783 | - ) . '</span>'; |
|
| 782 | + '<strong>'.$tpl['file'].'</strong>' |
|
| 783 | + ).'</span>'; |
|
| 784 | 784 | } else { |
| 785 | 785 | $this->trace[]['sub'] = sprintf( |
| 786 | 786 | SystemLocale::SF_TEMPLATE_RECOMPILED, |
| 787 | - '<strong>' . $tpl['file'] . '</strong>' |
|
| 787 | + '<strong>'.$tpl['file'].'</strong>' |
|
| 788 | 788 | ); |
| 789 | 789 | } |
| 790 | 790 | } |
@@ -792,10 +792,10 @@ discard block |
||
| 792 | 792 | } |
| 793 | 793 | unset($tpldata); |
| 794 | 794 | } else { |
| 795 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 795 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 796 | 796 | SystemLocale::EF_TEMPLATE_NOT_DELETED, |
| 797 | - '<strong>' . $tpl['file'] . '</strong>' |
|
| 798 | - ) . '</span>'; |
|
| 797 | + '<strong>'.$tpl['file'].'</strong>' |
|
| 798 | + ).'</span>'; |
|
| 799 | 799 | } |
| 800 | 800 | } |
| 801 | 801 | } |
@@ -884,17 +884,17 @@ discard block |
||
| 884 | 884 | $block_obj[0]->setVar('last_modified', time()); |
| 885 | 885 | |
| 886 | 886 | if (!$block_handler->insert($block_obj[0])) { |
| 887 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 887 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 888 | 888 | XoopsLocale::EF_NOT_UPDATED, |
| 889 | 889 | $block_obj[0]->getVar('name') |
| 890 | - ) . '</span>'; |
|
| 890 | + ).'</span>'; |
|
| 891 | 891 | } else { |
| 892 | 892 | $this->trace[]['sub'] = sprintf( |
| 893 | 893 | SystemLocale::SF_BLOCK_UPDATED, |
| 894 | - '<strong>' . $block_obj[0]->getVar('name') |
|
| 895 | - ) . '</strong>' . sprintf( |
|
| 894 | + '<strong>'.$block_obj[0]->getVar('name') |
|
| 895 | + ).'</strong>'.sprintf( |
|
| 896 | 896 | SystemLocale::F_BLOCK_ID, |
| 897 | - '<strong>' . $block_obj[0]->getVar('bid') . '</strong>' |
|
| 897 | + '<strong>'.$block_obj[0]->getVar('bid').'</strong>' |
|
| 898 | 898 | ); |
| 899 | 899 | |
| 900 | 900 | if (0 == $blockmodulelink_handler->getCount(new Criteria('block_id', $block_obj[0]->getVar('bid')))) { |
@@ -923,38 +923,38 @@ discard block |
||
| 923 | 923 | $tplfile_new->setVar('tpl_lastmodified', time()); |
| 924 | 924 | $tplfile_new->setVar('tpl_lastimported', 0); |
| 925 | 925 | if (!$tplfile_handler->insertTpl($tplfile_new)) { |
| 926 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 926 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 927 | 927 | SystemLocale::EF_TEMPLATE_NOT_UPDATED, |
| 928 | - '<strong>' . $block['template'] . '</strong>' |
|
| 929 | - ) . '</span>'; |
|
| 928 | + '<strong>'.$block['template'].'</strong>' |
|
| 929 | + ).'</span>'; |
|
| 930 | 930 | } else { |
| 931 | 931 | $this->trace[]['sub'] = sprintf( |
| 932 | 932 | SystemLocale::SF_TEMPLATE_UPDATED, |
| 933 | - '<strong>' . $block['template'] . '</strong>' |
|
| 933 | + '<strong>'.$block['template'].'</strong>' |
|
| 934 | 934 | ); |
| 935 | 935 | if ($module->getVar('dirname') === 'system') { |
| 936 | 936 | if (!$xoops->templateTouch($tplfile_new->getVar('tpl_id'))) { |
| 937 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 937 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 938 | 938 | SystemLocale::EF_TEMPLATE_NOT_RECOMPILED, |
| 939 | - '<strong>' . $block['template'] . '</strong>' |
|
| 940 | - ) . '</span>'; |
|
| 939 | + '<strong>'.$block['template'].'</strong>' |
|
| 940 | + ).'</span>'; |
|
| 941 | 941 | } else { |
| 942 | 942 | $this->trace[]['sub'] = sprintf( |
| 943 | 943 | SystemLocale::SF_TEMPLATE_RECOMPILED, |
| 944 | - '<strong>' . $block['template'] . '</strong>' |
|
| 944 | + '<strong>'.$block['template'].'</strong>' |
|
| 945 | 945 | ); |
| 946 | 946 | } |
| 947 | 947 | } else { |
| 948 | 948 | if ($xoops->config['template_set'] === 'default') { |
| 949 | 949 | if (!$xoops->templateTouch($tplfile_new->getVar('tpl_id'))) { |
| 950 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 950 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 951 | 951 | SystemLocale::EF_TEMPLATE_NOT_RECOMPILED, |
| 952 | - '<strong>' . $block['template'] . '</strong>' |
|
| 953 | - ) . '</span>'; |
|
| 952 | + '<strong>'.$block['template'].'</strong>' |
|
| 953 | + ).'</span>'; |
|
| 954 | 954 | } else { |
| 955 | 955 | $this->trace[]['sub'] = sprintf( |
| 956 | 956 | SystemLocale::SF_TEMPLATE_RECOMPILED, |
| 957 | - '<strong>' . $block['template'] . '</strong>' |
|
| 957 | + '<strong>'.$block['template'].'</strong>' |
|
| 958 | 958 | ); |
| 959 | 959 | } |
| 960 | 960 | } |
@@ -972,20 +972,20 @@ discard block |
||
| 972 | 972 | || !in_array($block->getVar('func_file'), $funcfiles) |
| 973 | 973 | ) { |
| 974 | 974 | if (!$block_handler->delete($block)) { |
| 975 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 975 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 976 | 976 | SystemLocale::EF_BLOCK_NOT_DELETED, |
| 977 | - "<strong>" . $block->getVar('name') . "</strong>" |
|
| 978 | - ) . sprintf( |
|
| 977 | + "<strong>".$block->getVar('name')."</strong>" |
|
| 978 | + ).sprintf( |
|
| 979 | 979 | SystemLocale::F_BLOCK_ID, |
| 980 | - "<strong>" . $block->getVar('bid') . "</strong>" |
|
| 981 | - ) . '</span>'; |
|
| 980 | + "<strong>".$block->getVar('bid')."</strong>" |
|
| 981 | + ).'</span>'; |
|
| 982 | 982 | } else { |
| 983 | 983 | $this->trace[]['sub'] = sprintf( |
| 984 | 984 | SystemLocale::SF_BLOCK_DELETED, |
| 985 | - '<strong>' . $block->getVar('name') . '</strong>' |
|
| 986 | - ) . ' ' . sprintf( |
|
| 985 | + '<strong>'.$block->getVar('name').'</strong>' |
|
| 986 | + ).' '.sprintf( |
|
| 987 | 987 | SystemLocale::F_BLOCK_ID, |
| 988 | - '<strong>' . $block->getVar('bid') . '</strong>' |
|
| 988 | + '<strong>'.$block->getVar('bid').'</strong>' |
|
| 989 | 989 | ); |
| 990 | 990 | if ($block->getVar('template') != '') { |
| 991 | 991 | $tplfiles = $tplfile_handler->find(null, 'block', $block->getVar('bid')); |
@@ -995,11 +995,11 @@ discard block |
||
| 995 | 995 | if (!$tplfile_handler->deleteTpl($tplfile)) { |
| 996 | 996 | $this->trace[]['sub'] = '<span class="red">' |
| 997 | 997 | . SystemLocale::E_BLOCK_TEMPLATE_DEPRECATED_NOT_REMOVED |
| 998 | - . '(ID: <strong>' . $tplfile->getVar('tpl_id') . '</strong>)</span>'; |
|
| 998 | + . '(ID: <strong>'.$tplfile->getVar('tpl_id').'</strong>)</span>'; |
|
| 999 | 999 | } else { |
| 1000 | 1000 | $this->trace[]['sub'] = sprintf( |
| 1001 | 1001 | SystemLocale::SF_BLOCK_TEMPLATE_DEPRECATED, |
| 1002 | - "<strong>" . $tplfile->getVar('tpl_file') . "</strong>" |
|
| 1002 | + "<strong>".$tplfile->getVar('tpl_file')."</strong>" |
|
| 1003 | 1003 | ); |
| 1004 | 1004 | } |
| 1005 | 1005 | } |
@@ -1028,20 +1028,20 @@ discard block |
||
| 1028 | 1028 | /* @var $block XoopsBlock */ |
| 1029 | 1029 | foreach ($blocks as $block) { |
| 1030 | 1030 | if (false === $block_handler->deleteBlock($block)) { |
| 1031 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 1031 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 1032 | 1032 | SystemLocale::EF_BLOCK_NOT_DELETED, |
| 1033 | - "<strong>" . $block->getVar('name') . "</strong>" |
|
| 1034 | - ) . sprintf( |
|
| 1033 | + "<strong>".$block->getVar('name')."</strong>" |
|
| 1034 | + ).sprintf( |
|
| 1035 | 1035 | SystemLocale::F_BLOCK_ID, |
| 1036 | - "<strong>" . $block->getVar('bid') . "</strong>" |
|
| 1037 | - ) . '</span>'; |
|
| 1036 | + "<strong>".$block->getVar('bid')."</strong>" |
|
| 1037 | + ).'</span>'; |
|
| 1038 | 1038 | } else { |
| 1039 | 1039 | $this->trace[]['sub'] = sprintf( |
| 1040 | 1040 | SystemLocale::SF_BLOCK_DELETED, |
| 1041 | - "<strong>" . $block->getVar('name') . "</strong>" |
|
| 1042 | - ) . sprintf( |
|
| 1041 | + "<strong>".$block->getVar('name')."</strong>" |
|
| 1042 | + ).sprintf( |
|
| 1043 | 1043 | SystemLocale::F_BLOCK_ID, |
| 1044 | - "<strong>" . $block->getVar('bid') . "</strong>" |
|
| 1044 | + "<strong>".$block->getVar('bid')."</strong>" |
|
| 1045 | 1045 | ); |
| 1046 | 1046 | } |
| 1047 | 1047 | if ($block->getVar('template') != '') { |
@@ -1049,20 +1049,20 @@ discard block |
||
| 1049 | 1049 | /* @var $template XoopsTplFile */ |
| 1050 | 1050 | foreach ($templates as $template) { |
| 1051 | 1051 | if (!$tplfile_handler->delete($template)) { |
| 1052 | - $this->trace[]['sub'] = '<span class="red">' . sprintf( |
|
| 1052 | + $this->trace[]['sub'] = '<span class="red">'.sprintf( |
|
| 1053 | 1053 | SystemLocale::EF_BLOCK_TEMPLATE_NOT_DELETED, |
| 1054 | 1054 | $template->getVar('tpl_file') |
| 1055 | - ) . sprintf( |
|
| 1055 | + ).sprintf( |
|
| 1056 | 1056 | SystemLocale::F_TEMPLATE_ID, |
| 1057 | - "<strong>" . $template->getVar('tpl_id') . "</strong>" |
|
| 1058 | - ) . '</span>'; |
|
| 1057 | + "<strong>".$template->getVar('tpl_id')."</strong>" |
|
| 1058 | + ).'</span>'; |
|
| 1059 | 1059 | } else { |
| 1060 | 1060 | $this->trace[]['sub'] = sprintf( |
| 1061 | 1061 | SystemLocale::SF_BLOCK_TEMPLATE_DELETED, |
| 1062 | - "<strong>" . $template->getVar('tpl_file') . "</strong>" |
|
| 1063 | - ) . sprintf( |
|
| 1062 | + "<strong>".$template->getVar('tpl_file')."</strong>" |
|
| 1063 | + ).sprintf( |
|
| 1064 | 1064 | SystemLocale::F_TEMPLATE_ID, |
| 1065 | - "<strong>" . $template->getVar('tpl_id') . "</strong>" |
|
| 1065 | + "<strong>".$template->getVar('tpl_id')."</strong>" |
|
| 1066 | 1066 | ); |
| 1067 | 1067 | } |
| 1068 | 1068 | } |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if (!$config_handler->deleteConfig($config)) { |
| 1093 | 1093 | $this->trace[]['sub'] = '<span class="red">' |
| 1094 | 1094 | . SystemLocale::E_CONFIG_DATA_NOT_DELETED |
| 1095 | - . sprintf(SystemLocale::F_CONFIG_ID, "<strong>" . $config->getVar('conf_id') . "</strong>") |
|
| 1095 | + . sprintf(SystemLocale::F_CONFIG_ID, "<strong>".$config->getVar('conf_id')."</strong>") |
|
| 1096 | 1096 | . '</span>'; |
| 1097 | 1097 | // save the name of config failed to delete for later use |
| 1098 | 1098 | $this->config_delng[] = $config->getVar('conf_name'); |
@@ -1101,7 +1101,7 @@ discard block |
||
| 1101 | 1101 | $this->config_old[$config->getVar('conf_name')]['formtype'] = $config->getVar('conf_formtype'); |
| 1102 | 1102 | $this->config_old[$config->getVar('conf_name')]['valuetype'] = $config->getVar('conf_valuetype'); |
| 1103 | 1103 | $this->trace[]['sub'] = SystemLocale::S_CONFIG_DATA_DELETED |
| 1104 | - . sprintf(SystemLocale::F_CONFIG_ID, "<strong>" . $config->getVar('conf_id') . "</strong>"); |
|
| 1104 | + . sprintf(SystemLocale::F_CONFIG_ID, "<strong>".$config->getVar('conf_id')."</strong>"); |
|
| 1105 | 1105 | } |
| 1106 | 1106 | } |
| 1107 | 1107 | } |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | $confop_msgs .= ' <strong>' |
| 1168 | 1168 | . \Xoops\Locale::translate($key, $module->getVar('dirname')) |
| 1169 | 1169 | . '</strong> '; |
| 1170 | - $confop_msgs .= XoopsLocale::C_VALUE . ' <strong>' . $value . '</strong> '; |
|
| 1170 | + $confop_msgs .= XoopsLocale::C_VALUE.' <strong>'.$value.'</strong> '; |
|
| 1171 | 1171 | unset($confop); |
| 1172 | 1172 | } |
| 1173 | 1173 | } |
@@ -1175,11 +1175,11 @@ discard block |
||
| 1175 | 1175 | if (false != $config_handler->insertConfig($confobj)) { |
| 1176 | 1176 | $this->trace[]['sub'] = sprintf( |
| 1177 | 1177 | SystemLocale::SF_CONFIG_ADDED, |
| 1178 | - "<strong>" . $config['name'] . "</strong>" |
|
| 1179 | - ) . $confop_msgs; |
|
| 1178 | + "<strong>".$config['name']."</strong>" |
|
| 1179 | + ).$confop_msgs; |
|
| 1180 | 1180 | } else { |
| 1181 | 1181 | $this->trace[]['sub'] = '<span class="red">' |
| 1182 | - . sprintf(SystemLocale::EF_CONFIG_NOT_ADDED, "<strong>" . $config['name'] . "</strong>") |
|
| 1182 | + . sprintf(SystemLocale::EF_CONFIG_NOT_ADDED, "<strong>".$config['name']."</strong>") |
|
| 1183 | 1183 | . '</span>'; |
| 1184 | 1184 | } |
| 1185 | 1185 | unset($confobj); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | // View Account |
| 29 | 29 | $ret[] = [ |
| 30 | 30 | 'name' => XoopsLocale::VIEW_ACCOUNT, |
| 31 | - 'link' => $xoops->url('userinfo.php?uid=' . $xoops->user->getVar('uid')), |
|
| 31 | + 'link' => $xoops->url('userinfo.php?uid='.$xoops->user->getVar('uid')), |
|
| 32 | 32 | 'icon' => 'glyphicon-user', |
| 33 | 33 | ]; |
| 34 | 34 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $name = XoopsLocale::INBOX; |
| 60 | 60 | if ($pm_count = $pm_handler->getCount($criteria)) { |
| 61 | - $name = XoopsLocale::INBOX . ' <span class="badge">' . $pm_count . '</span>'; |
|
| 61 | + $name = XoopsLocale::INBOX.' <span class="badge">'.$pm_count.'</span>'; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $ret[] = [ |
@@ -75,13 +75,13 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $xoops = \Xoops::getInstance(); |
| 78 | - $flagDir = $this->flagSource . $sizeDir . '/'; |
|
| 79 | - $flagFile = $flagDir . $countryCode . '.png'; |
|
| 78 | + $flagDir = $this->flagSource.$sizeDir.'/'; |
|
| 79 | + $flagFile = $flagDir.$countryCode.'.png'; |
|
| 80 | 80 | |
| 81 | 81 | $file = $xoops->path($flagFile); |
| 82 | 82 | // switch to unknown if file is not readable |
| 83 | 83 | if (!is_readable($file)) { |
| 84 | - $flagFile = $flagDir . '_unknown.png'; |
|
| 84 | + $flagFile = $flagDir.'_unknown.png'; |
|
| 85 | 85 | } |
| 86 | 86 | $url = $xoops->url($flagFile); |
| 87 | 87 | return $url; |
@@ -94,24 +94,24 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @var string[] |
| 96 | 96 | */ |
| 97 | - private $overrideMap = array ( |
|
| 98 | - 'AC' => 'SH', // *Ascension Island part of Saint Helena, Ascension and Tristan da Cunha |
|
| 99 | - 'BQ' => 'NL', // Caribbean Netherlands |
|
| 100 | - 'BV' => 'NO', // Bouvet Island, dependency of Norway |
|
| 101 | - 'CP' => 'FR', // *Clipperton Island, overseas possession of France |
|
| 102 | - 'DG' => 'GB', // *Diego Garcia, British Indian Ocean Territory disputed sovereignty |
|
| 103 | - 'EA' => 'ES', // *Ceuta & Melilla, Spanish cities on the north coast of Africa |
|
| 104 | - 'GF' => 'FR', // French Guiana, overseas region of France |
|
| 105 | - 'GP' => 'FR', // Guadeloupe, overseas region of France |
|
| 106 | - 'HM' => 'AU', // Heard & McDonald Islands, Australian external territory |
|
| 107 | - 'IO' => 'GB', // British Indian Ocean Territory |
|
| 108 | - 'PM' => 'FR', // St. Pierre & Miquelon, territorial overseas collectivity of France |
|
| 109 | - 'RE' => 'FR', // Réunion, overseas region of France |
|
| 110 | - 'SJ' => 'NO', // Svalbard & Jan Mayen, integrated parts of Norway not allocated to counties |
|
| 111 | - 'SX' => 'NL', // Sint Maarten, constituent country of the Kingdom of the Netherlands |
|
| 112 | - 'TA' => 'SH', // *Tristan da Cunha part of Saint Helena, Ascension and Tristan da Cunha |
|
| 113 | - 'UM' => 'US', // U.S. Outlying Islands |
|
| 114 | - 'XK' => '_kosovo', // (User-assigned range) temporary assigned code |
|
| 97 | + private $overrideMap = array( |
|
| 98 | + 'AC' => 'SH', // *Ascension Island part of Saint Helena, Ascension and Tristan da Cunha |
|
| 99 | + 'BQ' => 'NL', // Caribbean Netherlands |
|
| 100 | + 'BV' => 'NO', // Bouvet Island, dependency of Norway |
|
| 101 | + 'CP' => 'FR', // *Clipperton Island, overseas possession of France |
|
| 102 | + 'DG' => 'GB', // *Diego Garcia, British Indian Ocean Territory disputed sovereignty |
|
| 103 | + 'EA' => 'ES', // *Ceuta & Melilla, Spanish cities on the north coast of Africa |
|
| 104 | + 'GF' => 'FR', // French Guiana, overseas region of France |
|
| 105 | + 'GP' => 'FR', // Guadeloupe, overseas region of France |
|
| 106 | + 'HM' => 'AU', // Heard & McDonald Islands, Australian external territory |
|
| 107 | + 'IO' => 'GB', // British Indian Ocean Territory |
|
| 108 | + 'PM' => 'FR', // St. Pierre & Miquelon, territorial overseas collectivity of France |
|
| 109 | + 'RE' => 'FR', // Réunion, overseas region of France |
|
| 110 | + 'SJ' => 'NO', // Svalbard & Jan Mayen, integrated parts of Norway not allocated to counties |
|
| 111 | + 'SX' => 'NL', // Sint Maarten, constituent country of the Kingdom of the Netherlands |
|
| 112 | + 'TA' => 'SH', // *Tristan da Cunha part of Saint Helena, Ascension and Tristan da Cunha |
|
| 113 | + 'UM' => 'US', // U.S. Outlying Islands |
|
| 114 | + 'XK' => '_kosovo', // (User-assigned range) temporary assigned code |
|
| 115 | 115 | ); |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | list ($k, $v) = each($key); |
| 46 | 46 | |
| 47 | 47 | // Set string representation |
| 48 | - $key = $k . '[' . $v . ']'; |
|
| 48 | + $key = $k.'['.$v.']'; |
|
| 49 | 49 | |
| 50 | 50 | // Set expiration time to -1hr (will cause browser deletion) |
| 51 | 51 | setcookie($key, false, time() - 3600); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | foreach ($_COOKIE[$key] as $k => $v) |
| 61 | 61 | { |
| 62 | 62 | // Set string representation |
| 63 | - $cookie = $key . '[' . $k . ']'; |
|
| 63 | + $cookie = $key.'['.$k.']'; |
|
| 64 | 64 | |
| 65 | 65 | // Set expiration time to -1hr (will cause browser deletion) |
| 66 | 66 | setcookie($cookie, false, time() - 3600); |
@@ -138,12 +138,12 @@ discard block |
||
| 138 | 138 | public static function set( |
| 139 | 139 | $key, |
| 140 | 140 | $value, |
| 141 | - $expire = 0, /* Default expire time (session, 1 week = 604800) */ |
|
| 142 | - $path = '', /* Default path */ |
|
| 143 | - $domain = '', /* Default domain */ |
|
| 144 | - $secure = false, /* Does this cookie need a secure HTTPS connection? */ |
|
| 141 | + $expire = 0, /* Default expire time (session, 1 week = 604800) */ |
|
| 142 | + $path = '', /* Default path */ |
|
| 143 | + $domain = '', /* Default domain */ |
|
| 144 | + $secure = false, /* Does this cookie need a secure HTTPS connection? */ |
|
| 145 | 145 | $httponly = true /* Can non-HTTP services access this cookie (IE: javascript)? */ |
| 146 | - ){ |
|
| 146 | + ) { |
|
| 147 | 147 | // Make sure they aren't trying to set a reserved word |
| 148 | 148 | if (!in_array($key, self::$_reserved)) |
| 149 | 149 | { |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | list ($k, $v) = each($key); |
| 172 | 172 | |
| 173 | 173 | // Set string representation |
| 174 | - $key = $k . '[' . $v . ']'; |
|
| 174 | + $key = $k.'['.$v.']'; |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
@@ -95,11 +95,15 @@ discard block |
||
| 95 | 95 | list ($k, $v) = each($key); |
| 96 | 96 | |
| 97 | 97 | // Check for key/value pair and return |
| 98 | - if (isset($_COOKIE[$k][$v])) return true; |
|
| 98 | + if (isset($_COOKIE[$k][$v])) { |
|
| 99 | + return true; |
|
| 100 | + } |
|
| 99 | 101 | } |
| 100 | 102 | |
| 101 | 103 | // If key exists, return true |
| 102 | - else if (isset($_COOKIE[$key])) return true; |
|
| 104 | + else if (isset($_COOKIE[$key])) { |
|
| 105 | + return true; |
|
| 106 | + } |
|
| 103 | 107 | |
| 104 | 108 | // Key does not exist |
| 105 | 109 | return false; |
@@ -118,14 +122,20 @@ discard block |
||
| 118 | 122 | list ($k, $v) = each($key); |
| 119 | 123 | |
| 120 | 124 | // Check for key/value pair and return |
| 121 | - if (isset($_COOKIE[$k][$v])) return $_COOKIE[$k][$v]; |
|
| 125 | + if (isset($_COOKIE[$k][$v])) { |
|
| 126 | + return $_COOKIE[$k][$v]; |
|
| 127 | + } |
|
| 122 | 128 | } |
| 123 | 129 | |
| 124 | 130 | // Return single key if it's set |
| 125 | - else if (isset($_COOKIE[$key])) return $_COOKIE[$key]; |
|
| 131 | + else if (isset($_COOKIE[$key])) { |
|
| 132 | + return $_COOKIE[$key]; |
|
| 133 | + } |
|
| 126 | 134 | |
| 127 | 135 | // Otherwise return null |
| 128 | - else return null; |
|
| 136 | + else { |
|
| 137 | + return null; |
|
| 138 | + } |
|
| 129 | 139 | } |
| 130 | 140 | |
| 131 | 141 | // Return the cookie array |
@@ -155,7 +165,9 @@ discard block |
||
| 155 | 165 | } |
| 156 | 166 | |
| 157 | 167 | // Otherwise, throw an error |
| 158 | - else Error::warning('Could not set key -- it is reserved.', __CLASS__); |
|
| 168 | + else { |
|
| 169 | + Error::warning('Could not set key -- it is reserved.', __CLASS__); |
|
| 170 | + } |
|
| 159 | 171 | } |
| 160 | 172 | |
| 161 | 173 | // Converts strings to arrays (or vice versa if toString = true) |