| Conditions | 4 |
| Paths | 4 |
| Total Lines | 30 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | function enable_step($old_state) |
||
|
|
|||
| 31 | { |
||
| 32 | switch ($old_state) |
||
| 33 | { |
||
| 34 | case '': // Empty means nothing has run yet |
||
| 35 | if (empty($old_state)) |
||
| 36 | { |
||
| 37 | global $db; |
||
| 38 | $fulltext = new \vse\similartopics\core\fulltext_support($db); |
||
| 39 | if ($fulltext->is_postgres()) |
||
| 40 | { |
||
| 41 | $this->container->get('user')->add_lang_ext('vse/similartopics', 'info_acp_similar_topics'); |
||
| 42 | $this->container->get('template')->assign_var('L_EXTENSION_ENABLE_SUCCESS', $this->container->get('user')->lang['EXTENSION_ENABLE_SUCCESS'] . |
||
| 43 | $this->container->get('user')->lang['PST_LOG_CREATE_INDEX'] ); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | // Run parent enable step method |
||
| 48 | return parent::enable_step($old_state); |
||
| 49 | |||
| 50 | break; |
||
| 51 | |||
| 52 | default: |
||
| 53 | |||
| 54 | // Run parent enable step method |
||
| 55 | return parent::enable_step($old_state); |
||
| 56 | |||
| 57 | break; |
||
| 58 | } |
||
| 59 | } |
||
| 60 | } |
||
| 61 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.