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

Source for file function.pnformcategorycheckboxlist.php

Documentation is available at function.pnformcategorycheckboxlist.php

  1. <?php
  2. /**
  3.  * Category checkbox list plugin
  4.  *
  5.  * @copyright (c) 2006, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: function.pnformdropdownlist.php 22138 2007-06-01 10:19:14Z markwest $
  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. /** Make sure to use require_once() instead of Loader::requireOnce() since "function.xxx.php"
  15.  is loaded by Smarty (the base render class) with the use of require_once(). We do not want to
  16.  get in conflict with that.*/
  17. require_once 'system/pnForm/plugins/function.pnformcheckboxlist.php';
  18. require_once 'system/pnForm/plugins/function.pnformcategoryselector.php';
  19.  
  20.  
  21. /**
  22.  * Category selector
  23.  *
  24.  * This plugin creates a category selector using a series of checkboxes
  25.  *
  26.  * @package pnForm
  27.  * @subpackage Plugins
  28.  */
  29. {
  30.     var $editLink;
  31.     var $category;
  32.  
  33.     
  34.     function getFilename()
  35.     {
  36.         return __FILE__;
  37.     }
  38.  
  39.  
  40.     function load(&$render$params)
  41.     {
  42.         pnFormCategorySelector::loadParameters($thisfalse$params);
  43.         parent::load($render$params);
  44.     }
  45.  
  46.  
  47.     function render(&$render)
  48.     {
  49.         $result parent::render($render);
  50.  
  51.         if ($this->editLink && !empty($this->category
  52.             && SecurityUtil::checkPermission'Categories::'"$this->category[id]::"ACCESS_EDIT)) 
  53.         {
  54.             $url DataUtil::formatForDisplay(pnModURL ('Categories''user''edit'array('dr' => $this->category['id'])));
  55.             $result .= "<a href=\"$url\">_EDIT '</a>';
  56.         }
  57.  
  58.         return $result;
  59.     }
  60. }
  61.  
  62.  
  63. function smarty_function_pnformcategorycheckboxlist($params&$render)
  64. {
  65.     return $render->pnFormRegisterPlugin('pnFormCategoryCheckboxList'$params);
  66. }

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