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

Source for file function.html_select_modulestylesheets.php

Documentation is available at function.html_select_modulestylesheets.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright (c) 2004, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: function.html_select_modulestylesheets.php 24342 2008-06-06 12:03:14Z markwest $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @package Zikula_Template_Plugins
  10.  * @subpackage Functions
  11.  */
  12.  
  13. /**
  14.  * Smarty function to display a drop down list of module stylesheets
  15.  *
  16.  * Available parameters:
  17.  *   - modname   The module name to show the styles for
  18.  *   - assign:   If set, the results are assigned to the corresponding variable instead of printed out
  19.  *   - id:       ID for the control
  20.  *   - name:     Name for the control
  21.  *   - exclude   Comma seperated list of files to exclude (optional)
  22.  *   - selected: Selected value
  23.  *
  24.  * Example
  25.  *   <!--[modstyleslist name=modulestylesheet selected=navtabs.css]-->
  26.  *
  27.  *
  28.  * @author       Mark West
  29.  * @since        24 July 2005
  30.  * @param        array       $params      All attributes passed to this function from the template
  31.  * @param        object      &$smarty     Reference to the Smarty object
  32.  * @return       string      the value of the last status message posted, or void if no status message exists
  33.  */
  34. function smarty_function_html_select_modulestylesheets($params&$smarty)
  35. {
  36.     extract($params);
  37.  
  38.     unset($params['name']);
  39.     unset($params['id']);
  40.     unset($params['selected']);
  41.     unset($params['modname']);
  42.  
  43.     if (!isset($modname)) {
  44.         $smarty->trigger_error('html_select_modulestylesheets: parameter [modname] required');
  45.         return false;
  46.     }
  47.  
  48.     if (!isset($name)) {
  49.         $name null;
  50.     }
  51.     if (!isset($selected)) {
  52.         $selected null;
  53.     }
  54.  
  55.     if (isset($exclude)) {
  56.         $exclude explode(','trim($exclude));
  57.     else {
  58.         $exclude array();
  59.     }
  60.  
  61.     $modstyleslist pnModAPIFunc('Admin''admin''getmodstyles'array('modname' => $modname'exclude' => $exclude));
  62.  
  63.     require_once $smarty->_get_plugin_filepath('function','html_options');
  64.     $output smarty_function_html_options(array('values'  => $modstyleslist,
  65.                                                  'output'  => $modstyleslist,
  66.                                                  'selected' => $selected,
  67.                                                  'name'     => $name,
  68.                                                  'id'       => isset($id$id null),
  69.                                                  $smarty);
  70.  
  71.     if (isset($assign)) {
  72.         $smarty->assign($assign$output);
  73.     else {
  74.         return $output;
  75.     }
  76. }

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