Source for file function.html_select_modules.php
Documentation is available at function.html_select_modules.php
* Zikula Application Framework
* @copyright (c) 2004, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: outputfilter.pagevars.php 19321 2006-06-29 13:15:10Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Template_Plugins
* Smarty function to display a list box with a list of active modules
* either user or admin capable or all modules
* - name: Name for the control (optional) if not present then only the option tags are output
* - id: ID for the control
* - selected: Selected value
* - type: Type of modules to show (all = All modules, user = user capable modules, admin = admin capable modules)
* - assign: If set, the results are assigned to the corresponding variable instead of printed out
* <!--[html_select_modules name=mod selected=$mymod]-->
* <option value="">&bsp;</option>
* <!--[html_select_modules selected=$mythemechoice]-->
* @see function.html_select_modules.php::smarty_function_html_select_modules()
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
* @return string a drop down containing a list of modules
unset ($params['selected']);
// we'll make use of the html_options plugin to simplfiy this plugin
require_once $smarty->_get_plugin_filepath('function','html_options');
if (!isset ($type) || ($type != 'all' && $type != 'user' && $type != 'admin')) {
// process our list of modules for input to the html_options plugin
foreach ($modules as $module) {
$moduleslist[$module['name']] = $module['displayname'];
// get the formatted list
'selected' => isset ($selected) ? $selected : null,
'id' => isset ($id) ? $id : null),
$smarty->assign($assign, $output);
|