Changeset 2806

Show
Ignore:
Timestamp:
11/13/08 18:51:49 (8 weeks ago)
Author:
chrismeller
Message:

Moving the admin stacks initialization into AdminHandler's constructor, where it should have been to begin with.

If you need stacks from a plugin, call the AdminHandler::setup_stacks() method, then check the stack.

Location:
trunk/htdocs
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/index.php

    r2764 r2806  
    192192header( 'Content-Type: text/html;charset=utf-8' ); 
    193193 
    194 // setup some initial stacks 
    195 AdminHandler::setup_stacks(); 
    196  
    197194/** 
    198195 * Include all the active plugins. 
  • trunk/htdocs/system/classes/adminhandler.php

    r2801 r2806  
    6060        // Create an instance of the active public theme so that its plugin functions are implemented 
    6161        $this->active_theme = Themes::create(); 
     62 
     63        // setup the stacks for javascript in the admin - it's a method so a plugin can call it externally 
     64        self::setup_stacks(); 
    6265    } 
    6366 
     
    7174        $theme_dir = Plugins::filter( 'admin_theme_dir', Site::get_dir( 'admin_theme', TRUE ) ); 
    7275        $this->theme = Themes::create( 'admin', 'RawPHPEngine', $theme_dir ); 
    73          
    74         // Add some default js 
    75         $this->setup_stacks(); 
     76 
    7677        // Add some default stylesheets 
    7778        Stack::add('admin_stylesheet', array(Site::get_url('admin_theme') . '/css/admin.css', 'screen'), 'admin'); 
    7879 
    79       // Add some default template variables 
     80        // Add some default template variables 
    8081        $this->set_admin_template_vars( $this->theme ); 
    8182        $this->theme->admin_type = $type; 
     
    676677    { 
    677678        extract( $this->handler_vars ); 
    678          
     679 
    679680        $wsse = Utils::WSSE( $nonce, $timestamp ); 
    680681        if ( $PasswordDigest != $wsse['digest'] ) { 
    681682            Utils::redirect( URL::get( 'admin', 'page=users' ) ); 
    682683        } 
    683          
     684 
    684685        // Keep track of whether we actually need to update any fields 
    685686        $update = FALSE; 
    686687        $results = array( 'page' => 'user' ); 
    687688        $currentuser = User::identify(); 
    688          
     689 
    689690        $fields = array( 'user_id' => 'id', 'delete' => NULL, 'username' => 'username', 'displayname' => 'displayname', 'email' => 'email', 'imageurl' => 'imageurl', 'pass1' => NULL, 'locale_tz' => 'locale_tz', 'locale_date_format' => 'locale_date_format', 'locale_time_format' => 'locale_time_format' ); 
    690691        $fields = Plugins::filter( 'adminhandler_post_user_fields', $fields ); 
     
    23282329    { 
    23292330        $this->theme->wsse = Utils::WSSE(); /* @TODO: What the heck is this doing here? */ 
    2330          
     2331 
    23312332        $this->theme->tags = Tags::get(); 
    23322333        $this->theme->max = Tags::max_count(); 
    2333          
     2334 
    23342335        $this->display( 'tags' ); 
    23352336    } 
     
    25772578        return false; 
    25782579    } 
    2579      
     2580 
    25802581    /** 
    25812582     * Setup the default admin javascript stack here so that it can be called