Location: PHPKode > projects > cataBlog > cataBlog-0.1-pre_alpha/0.1-pre_alpha/Module/cataBlog/Display.php
<?php
/**
 * @license PHP
 * @author  Jackson Miller <hide@address.com>
 * @version $Id: Display.php,v 1.2 2004/09/13 15:23:12 jaxn Exp $
 * @package cataBlog
 */

require_once('CEP/Module/cataBlog.php');
require_once('CEP/Library/cataBlog.php');
require_once('HTML/Template/Sigma.php');

/**
 * This class handles displaying content for cataBlog.
 * cataBlog_Display provides the follosing states:
 * - Archives
 * - renderList
 * - renderRead
 * - renderRecent (default)
 * 
 * @todo Add Sigma template caching
 */
class CEP_Module_cataBlog_Display extends CEP_Module_cataBlog {

    var $state = 'Recent';
    
    function _renderArchives() {
        $tpl = new HTML_Template_Sigma(CEP_DIR_TEMPLATES);
        $tpl->load('cataBlog.archives.html');
    }
    
    function _renderList() {
    }
    
    /**
     * @todo make a caching object property...
     */
    function _renderRead() {
        require_once(CEP_DIR_LIBRARY.'cataBlog/Entry.php');
        
        // load the cached object if it exists...
        if ($data = $this->cache->get('cataBlog.entry.'.$this->cep_get_vars['entryId'])) {
            $entry = unserialize($data);
        }
        // create a new data object (and cache it)
        else {
            $entry = new CEP_Library_cataBlog_Entry();
            $entry->entry_id = $this->cep_get_vars['entryId'];
            $entry->find(TRUE);
            
            // cache the object
            $data = serialize($entry);
            $this->cache->save($data);
        }
        
        // at this point the entry dataobject has all of the information that we need about this blog entry.
        // I would like to use HTML_Template_Flexy to pass the dataobject directly into the template.
    }
    
    function _renderRecent() {
    }
}
?>
Return current item: cataBlog