Assembla home | Assembla project page
 

Changeset 129

Show
Ignore:
Timestamp:
07/20/07 14:57:58 (1 year ago)
Author:
AD7six
Message:

Nav component updated to write to the cache instead of the session

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branch/controllers/components/nav.php

    r115 r129  
    1212        var $components = array('Session', 'RequestHandler', 'othAuth'); 
    1313 
    14         var $cacheMedium = 'session'; 
     14        var $cacheMedium = 'cache'; 
     15        var $cacheDuration = '+1 week'; 
     16 
     17        function getCachePath() { 
     18                $path[] = 'element_data'; 
     19                $path[] = $this->name; 
     20                $path[] = $this->othAuth->user('id');  //$this->Session->read('User.id'); 
     21                $cachePath = implode($path, '_') . '.cache'; 
     22                $this->cachePath = $cachePath; 
     23                return $cachePath; 
     24        } 
     25 
    1526        /** 
    1627         * Data retrieval method 
     
    3849                        $data[]['Menu'] = array('name' => 'logout', 'parent_id' => null, 'url' => array('controller' => 'users', 'action' => 'logout')); 
    3950                } else { 
    40                         $data[]['Menu'] = array('name' => 'login', 'parent_id' => null, 'url' => array('controller' => 'users', 'action' => 'login')); 
     51                        $data[]['Menu'] = array('name' => 'login', 'parent_id' => null, 'url' => array(CAKE_ADMIN => false, 'plugin' => false, 'controller' => 'users', 'action' => 'login')); 
    4152                } 
    4253                return $data;