Source for file function.dbtypes.php
Documentation is available at function.dbtypes.php
* This file is a plugin for pnRender, the Zikula implementation of Smarty
* @package Xanthia_Templating_Environment
* @version $Id: function.dbtypes.php 24342 2008-06-06 12:03:14Z markwest $
* @author The Zikula development team
* @link http://www.zikula.org The Zikula Home Page
* @copyright Copyright (C) 2002 by the Zikula Development Team
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
* Smarty function to display a drop down list of database engines
* - assign: If set, the results are assigned to the corresponding variable instead of printed out
* - name: Name for the control
* - selected: Selected value
* <!--[dbtypes name=dbtype selectedValue=value]-->
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
* @return string the value of the last status message posted, or void if no status message exists
if (!isset ($params['name'])) {
if (!isset ($params['id'])) {
$params['id'] = $params['name'];
$sv = isset ($params['selectedValue']) ? $params['selectedValue'] : 'mysql';
$dbtypesdropdown = "<select name=\"$name\" id=\"$id\" onchange=\"dbtype_onchange()\">\n";
$sel = $sv== 'mysql' ? 'selected' : '';
$sel = $sv== 'mysqli' ? 'selected' : '';
$sel = $sv== 'mssql' ? 'selected' : '';
$sel = $sv== 'oci8' ? 'selected' : '';
$sel = $sv== 'oracle' ? 'selected' : '';
$sel = $sv== 'postgres' ? 'selected' : '';
$dbtypesdropdown .= "</select>\n";
if (isset ($params['assign'])) {
$smarty->assign($params['assign'], $dbtypesdropdown);
|