Changeset 887

Show
Ignore:
Timestamp:
09/03/08 16:01:01 (3 months ago)
Author:
MattRead
Message:

plugin:plugin_directory updating rewrites and templates

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/plugin_directory/trunk/plugin_directory.plugin.php

    r886 r887  
    7575        // put together our rule 
    7676        $rule['name'] = 'display_plugin'; 
    77         $rule['parse_regex'] = '%^packages/browse(?:page/(?P<page>[2-9]|[1-9][0-9]+))?/?$%'; 
    78         $rule['build_str'] = 'packages/browse'; 
     77        $rule['parse_regex'] = '%^explore/plugins/(?P<slug>.+)/?$%'; 
     78        $rule['build_str'] = 'explore/plugins/{$slug}'; 
    7979        $rule['handler'] = 'UserThemeHandler'; 
    80         $rule['action'] = 'display_packages'; 
     80        $rule['action'] = 'display_plugin'; 
    8181        $rule['priority'] = 3; 
    8282        $rule['description'] = 'Plugin Repo Server Browser'; 
     
    8484        // add our rule to the stack 
    8585        $rules[] = $rule; 
     86         
     87        // put together our rule 
     88        $rule['name'] = 'display_plugins'; 
     89        $rule['parse_regex'] = '%^explore/plugins/?$%'; 
     90        $rule['build_str'] = 'explore/plugins/'; 
     91        $rule['handler'] = 'UserThemeHandler'; 
     92        $rule['action'] = 'display_plugins'; 
     93        $rule['priority'] = 3; 
     94        $rule['description'] = 'Plugin Repo Server Browser'; 
     95 
     96        // add our rule to the stack 
     97        $rules[] = $rule; 
    8698 
    8799        // and pass it along 
     
    90102    } 
    91103 
    92     public function filter_theme_act_display_packages( $handled, $theme ) 
     104    /** 
     105     * @ todo make uoe own template for these 
     106     */ 
     107    public function filter_theme_act_display_plugins( $handled, $theme ) 
    93108    { 
    94109        $theme->posts = Posts::get( array( 'content_type' => 'plugin', 'limit' => 20 ) ); 
    95         $theme->display( 'packages' ); 
     110        $theme->display( 'home' ); 
     111        return true; 
     112    } 
     113     
     114    public function filter_theme_act_display_plugin( $handled, $theme ) 
     115    { 
     116        $theme->post = Post::get( array( 'content_type' => 'plugin' ) ); 
     117        $theme->display( 'entry.single' ); 
    96118        return true; 
    97119    }