Skip to content

Commit

Permalink
Miscellaneous PHPDoc and parameter mess cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ringmaster committed May 23, 2013
1 parent e55ba07 commit 4f92daf
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion tests.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ public function filter_admin_access( $access, $page, $post_type )
public function action_init()
{
$this->add_template('tests_admin', dirname($this->get_file()) . '/plugin_admin.php');
$this->add_rule(
new RewriteRule(
array(
'name' => 'display_tests',
'parse_regex' => '#^admin/tests/?$#i',
'build_str' => 'admin/tests',
'handler' => 'PluginHandler',
'action' => 'display_tests',
'priority' => 0,
'is_active' => 0,
'rule_class' => RewriteRule::RULE_CUSTOM,
'description' => '',
'parameters' => '',
)
),
'display_tests'
);
}

public function action_admin_header( $theme )
Expand All @@ -35,6 +52,16 @@ public function action_admin_header( $theme )
}
}

public function filter_admin_access_tokens($require_any, $page, $type)
{
if($page == 'admin') {
if(Controller::get_var('page') == 'tests') {
$require_any = array( 'manage_plugins' => true );
}
}
return $require_any;
}

public function filter_adminhandler_post_loadplugins_main_menu( array $menu )
{
$item_menu = array( 'tests' =>
Expand All @@ -60,7 +87,7 @@ public function filter_adminhandler_post_loadplugins_main_menu( array $menu )
/**
* @todo Removing initial newline shouldn't be necessary, find out what's causing it
*/
public function action_admin_theme_get_tests( AdminHandler $handler, Theme $theme )
public function theme_route_display_tests( Theme $theme )
{
$url = $this->get_url('/index.php?c=symbolic&o=1&d=1');

Expand Down

0 comments on commit 4f92daf

Please sign in to comment.