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

Source for file function.pnformcontextmenuseparator.php

Documentation is available at function.pnformcontextmenuseparator.php

  1. <?php
  2. /**
  3.  * Context menu plugin
  4.  *
  5.  * @copyright (c) 2006, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: function.pnformdateinput.php 21129 2007-01-19 19:08:26Z jornlind $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @author Jorn Wildt
  10.  * @package Zikula_Template_Plugins
  11.  * @subpackage Functions
  12.  */
  13.  
  14.  
  15. /**
  16.  * Context menu separator
  17.  *
  18.  * This plugin represents a menu item.
  19.  *
  20.  * @see pnFormContextMenu
  21.  *
  22.  * @package pnForm
  23.  * @subpackage Plugins
  24.  */
  25. {
  26.     function getFilename()
  27.     {
  28.         return __FILE__;
  29.     }
  30.  
  31.  
  32.     function render(&$render)
  33.     {
  34.         $contextMenu =$this->getParentContextMenu();
  35.  
  36.         // Avoid creating menu multiple times if included in a repeated template
  37.         if (!$contextMenu->firstTime())
  38.             return '';
  39.  
  40.         return "<li class=\"separator\">&nbsp;</li>";
  41.     }
  42.  
  43.  
  44.     function getParentContextMenu()
  45.     {
  46.         // Locate parent context menu
  47.         $contextMenu &$this->parentPlugin;
  48.  
  49.         while ($contextMenu != null  &&  strcasecmp(get_class($contextMenu)'pnformcontextmenu'!= 0)
  50.             $contextMenu &$contextMenu->parentPlugin;
  51.  
  52.         return $contextMenu;
  53.     }
  54. }
  55.  
  56.  
  57. function smarty_function_pnformcontextmenuseparator($params&$render)
  58. {
  59.     return $render->pnFormRegisterPlugin('pnFormContextMenuSeparator'$params);
  60. }

Documentation generated on Fri, 18 Jul 2008 21:45:47 +0200 by phpDocumentor 1.4.1