Skip to content

Commit

Permalink
Merge pull request #29 from VSEphpbb/updates
Browse files Browse the repository at this point in the history
Move Config Settings to new position in the ACP
  • Loading branch information
EXreaction committed Oct 13, 2014
2 parents 79f8ed6 + d96a45e commit 14d1a62
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public function add_googleanalytics_configs($event)
// Load language file
$this->user->add_lang_ext('phpbb/googleanalytics', 'googleanalytics_acp');

// Add a config to the settings mode, after override_user_style
if ($event['mode'] == 'settings' && isset($event['display_vars']['vars']['override_user_style']))
// Add a config to the settings mode, after board_timezone
if ($event['mode'] == 'settings' && isset($event['display_vars']['vars']['board_timezone']))
{
// Store display_vars event in a local variable
$display_vars = $event['display_vars'];
Expand All @@ -98,8 +98,8 @@ public function add_googleanalytics_configs($event)
),
);

// Add the new config vars after override_user_style in the display_vars config array
$insert_after = array('after' => 'override_user_style');
// Add the new config vars after board_timezone in the display_vars config array
$insert_after = array('after' => 'board_timezone');
$display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $ga_config_vars, $insert_after);

// Update the display_vars event with the new array
Expand Down
8 changes: 4 additions & 4 deletions tests/event/listener_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ public function add_googleanalytics_configs_data()
return array(
array( // expected config and mode
'settings',
array('vars' => array('override_user_style' => array())),
array('override_user_style', 'googleanalytics_id'),
array('vars' => array('board_timezone' => array())),
array('board_timezone', 'googleanalytics_id'),
),
array( // unexpected mode
'foobar',
array('vars' => array('override_user_style' => array())),
array('override_user_style'),
array('vars' => array('board_timezone' => array())),
array('board_timezone'),
),
array( // unexpected config
'settings',
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/google_analytics_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public function test_set_acp_settings()
// Load ACP board settings page
$crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=settings&sid=' . $this->sid);

// Test that GA settings field is found in the correct position (after OVERRIDE_STYLE)
// Test that GA settings field is found in the correct position (after SYSTEM_TIMEZONE)
$nodes = $crawler->filter('#acp_board > fieldset > dl > dt > label')->extract(array('_text'));
foreach ($nodes as $key => $config_name)
{
if (strpos($config_name, $this->lang('OVERRIDE_STYLE')) !== 0)
if (strpos($config_name, $this->lang('SYSTEM_TIMEZONE')) !== 0)
{
continue;
}
Expand Down

0 comments on commit 14d1a62

Please # to comment.