@@ -17,21 +17,29 @@ discard block |
||
| 17 | 17 | parent::init(); |
| 18 | 18 | |
| 19 | 19 | // Check user is logged in and has permission to access to SEO Toolbox Admin |
| 20 | - if (!Member::currentUser()) return $this->redirect(Security::login_url().'?BackURL=/seotest'); |
|
| 21 | - if (!Permission::check('CMS_ACCESS_SEOToolboxAdmin')) return $this->redirect(self::getPermissionDeniedPage()->Link()); |
|
| 20 | + if (!Member::currentUser()) { |
|
| 21 | + return $this->redirect(Security::login_url().'?BackURL=/seotest'); |
|
| 22 | + } |
|
| 23 | + if (!Permission::check('CMS_ACCESS_SEOToolboxAdmin')) { |
|
| 24 | + return $this->redirect(self::getPermissionDeniedPage()->Link()); |
|
| 25 | + } |
|
| 22 | 26 | |
| 23 | 27 | Requirements::clear(); |
| 24 | 28 | |
| 25 | 29 | // Sprite Location needs to be dynamic as devs can install module in different locations |
| 26 | 30 | $sprite_path = $this->config()->get('sprite_path'); |
| 27 | - if ($sprite_path === null) $sprite_path = SEOTOOLBOX_DIR.'/css/icons/icon_sprite.png'; |
|
| 31 | + if ($sprite_path === null) { |
|
| 32 | + $sprite_path = SEOTOOLBOX_DIR.'/css/icons/icon_sprite.png'; |
|
| 33 | + } |
|
| 28 | 34 | Requirements::customCSS(".icon{width:16px;height: 16px;cursor:pointer;background: url(/{$sprite_path});}"); |
| 29 | 35 | |
| 30 | 36 | // CSS can be replaced by devs if they desire to change styling |
| 31 | 37 | Requirements::css(SEOTOOLBOX_DIR.'/third-party/bootstrap/css/bootstrap.min.css'); |
| 32 | 38 | Requirements::css(SEOTOOLBOX_DIR.'/third-party/bootstrap/css/bootstrap-theme.min.css'); |
| 33 | 39 | $css = $this->config()->get('css'); |
| 34 | - if ($css === null) $css = array(SEOTOOLBOX_DIR.'/fonts/lato/lato.css', SEOTOOLBOX_DIR.'/css/seotest.css'); |
|
| 40 | + if ($css === null) { |
|
| 41 | + $css = array(SEOTOOLBOX_DIR.'/fonts/lato/lato.css', SEOTOOLBOX_DIR.'/css/seotest.css'); |
|
| 42 | + } |
|
| 35 | 43 | Requirements::combine_files('seotest.css', $css); |
| 36 | 44 | |
| 37 | 45 | Requirements::combine_files('seotest.js', array( |
@@ -120,8 +128,9 @@ discard block |
||
| 120 | 128 | $phrases = array_merge($phrases, $matches[$commands['find_pos']]); |
| 121 | 129 | } |
| 122 | 130 | |
| 123 | - if (isset($commands['replace'])) |
|
| 124 | - $html = preg_replace($commands['replace'], ' ', $html); |
|
| 131 | + if (isset($commands['replace'])) { |
|
| 132 | + $html = preg_replace($commands['replace'], ' ', $html); |
|
| 133 | + } |
|
| 125 | 134 | } |
| 126 | 135 | |
| 127 | 136 | // Remove the empty elements |