Changeset d7cbbe


Ignore:
Timestamp:
11/17/13 00:24:07 (6 years ago)
Author:
pierre-alain <pierre-alain@…>
Branches:
master
Children:
55ff97
Parents:
07671a
git-author:
pierre-alain <pierre-alain@…> (11/17/13 00:24:07)
git-committer:
pierre-alain <pierre-alain@…> (11/17/13 00:24:07)
Message:

cleaning and commenting

Location:
OWR
Files:
1 added
4 deleted
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • OWR/Includes/Themes/Original/Theme.php

    r07671a rd7cbbe  
    173173         
    174174        $noCacheDatas['unread_0'] = isset($datas['unreads'][0]) ? $datas['unreads'][0] : 0; 
     175        $noCacheDatas['bold_0'] = $noCacheDatas['unread_0'] > 0 ? ' class="bold"' : ''; 
    175176        $noCacheDatas['token'] = User::iGet()->getToken(); 
    176177        $noCacheDatas['userlogin'] = htmlentities(User::iGet()->getLogin(), ENT_COMPAT, 'UTF-8'); 
     
    189190 
    190191        $this->_view->addBlock('head', 'head', $this->_view->get('head', $datas, null, $noCacheDatas)); 
    191  
    192192        $this->_view->addBlock('board', 'header', $this->_view->get('board', $datas, null, $noCacheDatas)); 
    193  
    194         $this->_view->addBlock('menu_header', 'contents', $this->_view->get('menu_header', $datas, null, array_merge($noCacheDatas, array('bold' => $noCacheDatas['unread_0'] > 0 ? ' class="bold" ' : '')))); 
    195         $this->_view->addBlock('categories', 'contents', self::categories($datas, $noCacheDatas)); 
    196         $this->_view->addBlock('menu_tags', 'contents', $this->_view->get('menu_tags', $datas, null, $noCacheDatas)); 
    197         $this->_view->addBlock('tags', 'contents', self::tags($datas, $noCacheDatas)); 
    198         $this->_view->addBlock('menu_footer', 'contents', $this->_view->get('menu_footer', $datas, null, $noCacheDatas)); 
    199  
    200         $this->_view->addBlock('contents_header', 'contents', $this->_view->get('contents_header', $datas, null, $noCacheDatas)); 
    201         $this->_view->addBlock('posts', 'contents', self::posts($datas, $noCacheDatas)); 
    202         $this->_view->addBlock('contents_footer', 'contents', $this->_view->get('contents_footer', $datas, null, $noCacheDatas)); 
    203          
     193        $this->_view->addBlock('menu', 'contents', $this->_view->get('menu', $datas, null, $noCacheDatas)); 
     194        $this->_view->addBlock('content', 'contents', $this->_view->get('content', $datas, null, $noCacheDatas)); 
    204195        $this->_view->addBlock('footer', 'footer', $this->_view->get('footer', $datas, null, $noCacheDatas)); 
    205196 
  • OWR/Includes/Themes/Original/tpl/blocks/menu.html

    r7c60cc rd7cbbe  
     1<div id="container" class="container-fluid"> 
     2    <div class="row-fluid"> 
     3    <div class="span4"> 
     4        <div id="menu"> 
     5            <ul id="menu_container" class="menu_container"> 
     6                <li class="menu_part_title opac" id="menu_title_streams"><?php echo $this->_utilities->_('Streams');?></li> 
     7                <li class="noborder"> 
     8                    <ul class="menu_streams" id="menu_streams"> 
     9                        <li id="stream_0" class="groups"> 
     10                            <div class="groupname"> 
     11                                <a href="javascript:;"<OWR:NOCACHE NAME='bold_0'/> id="showStream_0" onclick="rP.showStream(0);" title="<?php echo $this->_utilities->_('Show all unread news');?>"><span id="current_0" class="current backgrounded"></span> <?php echo $this->_utilities->_('Not read');?> (<span id="unread_0"><OWR:NOCACHE NAME='unread_0'/></span>)</a> 
     12                                <br/> 
     13                                <a href="javascript:;" id="showStream_-1" onclick="rP.showStream(-1);" title="<?php echo $this->_utilities->_('Show all news');?>"><span class="current backgrounded hidden" id="current_-1"></span> <?php echo $this->_utilities->_('All news');?></a> 
     14                            </div> 
     15                            <div id="sprites_0" class="sprites_actions"> 
     16                                <a href="javascript:;" class="read backgrounded opac" onclick="rP.updateNews(0);" id="update_0" title="<?php echo $this->_utilities->_('Mark all the news as read');?>"></a> 
     17                                <a href="javascript:;" class="refresh backgrounded opac" onclick="rP.refreshStream(0);" id="refresh_0" title="<?php echo $this->_utilities->_('Force refresh of all streams');?>"></a> 
     18                                <a href="javascript:;" class="clean backgrounded opac" onclick="rP.clearStream(0);" id="clear_0" title="<?php echo $this->_utilities->_('Delete all news of all the streams');?>"></a> 
     19                                <a href="javascript:;" class="delete backgrounded opac" onclick="rP.deleteStream(0);" title="<?php echo $this->_utilities->_('Delete everything, categories included');?>"></a> 
     20                            </div> 
     21                        </li> 
     22<?php echo OWR\Themes::iGet()->categories($datas, $noCacheDatas);?> 
     23                    </ul> 
     24                </li> 
     25                <li class="menu_part_title opac" id="menu_title_tags"><?php echo $this->_utilities->_('Tags');?></li> 
     26                <li class="noborder"> 
     27                    <ul class="menu_streams" id="menu_tags"> 
     28<?php echo OWR\Themes::iGet()->tags($datas, $noCacheDatas);?> 
    129                    </ul> 
    230                </li> 
  • OWR/View.php

    r7c60cc rd7cbbe  
    7171    protected $_statusCode = 200; 
    7272 
     73    /** 
     74     * @var array stack of templates blocks 
     75     * @access protected 
     76     */ 
    7377    protected $_blocks = array(); 
    7478 
     
    110114        if(!isset($contents) || false === $contents) 
    111115        { // nothing found in cache 
    112             $contents = $this->_execute($tpl, $datas); 
     116            $contents = $this->_execute($tpl, $datas, $noCacheDatas); 
    113117 
    114118            if($cacheTime > 0) 
     
    138142     * @param string $tpl the template name 
    139143     * @param array $datas the datas 
     144     * @param array $noCacheDatas the datas that are not cached but replaced on-the-fly 
    140145     * @return string the template rendered 
    141146     */ 
    142     protected function _execute($tpl, array $datas) 
     147    protected function _execute($tpl, array $datas, array $noCacheDatas) 
    143148    { 
    144149        extract((array) $datas, EXTR_SKIP); 
     
    331336    } 
    332337 
     338    /** 
     339     * Adds a block to the stack 
     340     * 
     341     * @param string $name name of the block 
     342     * @param string $layout name of the layout containing the block 
     343     * @param string $content content of the block 
     344     * @param string $type type of the block 
     345     * @access public 
     346     */ 
    333347    public function addBlock($name, $layout, $content, $type = 'html') 
    334348    { 
     
    336350    } 
    337351 
     352    /** 
     353     * Returns all blocks from a layout 
     354     * 
     355     * @param string $layout name of the layout 
     356     * @access public 
     357     * @return string layout content or null 
     358     */ 
    338359    public function getBlocks($layout) 
    339360    { 
     
    341362    } 
    342363 
     364    /** 
     365     * Returns a block from a layout 
     366     * 
     367     * @param string $name name of the block 
     368     * @param string $layout name of the layout containing the block 
     369     * @access public 
     370     * @return string block content from the layout or null 
     371     */ 
    343372    public function getBlock($name, $layout) 
    344373    { 
     
    346375    } 
    347376 
     377    /** 
     378     * Renders blocks from a layout 
     379     * 
     380     * @param string $layout name of the layout containing the block 
     381     * @access public 
     382     */ 
    348383    public function renderBlocks($layout) 
    349384    { 
     
    353388    } 
    354389 
     390    /** 
     391     * Renders a block from a layout 
     392     * 
     393     * @param string $name name of the block 
     394     * @param string $layout name of the layout containing the block 
     395     * @access public 
     396     */ 
    355397    public function renderBlock($name, $layout) 
    356398    { 
     
    360402    } 
    361403 
     404    /** 
     405     * Returns translated text 
     406     * 
     407     * @param string $name name of the text 
     408     * @access public 
     409     * @return string translated text 
     410     */ 
    362411    public function _($name) 
    363412    { 
Note: See TracChangeset for help on using the changeset viewer.