Login   Register  
PHP Classes
elePHPant
Icontem

File: plugins/block.p_alternating.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Anderson A. Meggiolaro  >  Paginator Iterator  >  plugins/block.p_alternating.php  >  Download  
File: plugins/block.p_alternating.php
Role: Auxiliary script
Content type: text/plain
Description: Alternating Template
Class: Paginator Iterator
Iterate over listings split in page using Smarty
Author: By
Last change:
Date: 2008-08-07 06:24
Size: 424 bytes
 

Contents

Class file image Download
<?php

function smarty_block_p_alternating($params$content, &$smarty)
{
    static 
$flag;

    if(
is_null($content)) {
        return;
    }
    
    if(!
$flag)
    {
        
$flag=1;
        return;
    }

    
$parent_params=smarty_get_parent_plugin_params($smarty'p_iterator');
    if(!
$smarty->_paginator[$parent_params['id']]['is_alternating'])
        return;

    
$smarty->_paginator[$parent_params['id']]['content'].=$content;
    return;
}

?>