Smarty
[ class tree: Smarty ] [ index: Smarty ] [ all elements ]

Source for file block.navbar.php

Documentation is available at block.navbar.php

  1. <?php 
  2. /**
  3.  * Smarty plugin
  4.  * @package Smarty
  5.  * @subpackage plugins
  6.  */
  7.  
  8. /**
  9.  * Smarty {navbar} block plugin
  10.  *
  11.  * Type:    block
  12.  * Name:    navbar
  13.  * Input:    set of links that are used for navigation purposes
  14.  */
  15. function smarty_block_navbar($params, $content, &$gBitSmarty) {
  16.     $links = smarty_block_navbar_get_links( $content );
  17.     $gBitSmarty->assign( 'links',$links );
  18.     return $gBitSmarty->fetch( 'bitpackage:kernel/navbar.tpl' );
  19. }
  20. function smarty_block_navbar_get_links( $content ) {
  21.     $links = array();
  22.     if( preg_match_all( "/<a.*?href=\".*?\">.*?<\/a>/i",$content,$res ) ) {
  23.         $res = $res[0];
  24.         $links = array_unique( $res );
  25.     }
  26.     return $links;
  27. }
  28. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:11 +0000 by phpDocumentor 1.5.0-lsces