Source for file function.pnbutton.php
Documentation is available at function.pnbutton.php
* Zikula Application Framework
* @copyright (c) 2004, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: function.pnbutton.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Template_Plugins
* Smarty function to display an image form submission button
* BEWARE: Internt Explorer 6.x does NOT work especially well with <button> tags!
* - assign if set, the button will be assigned to this variable
* - type if set, the type of button that will be generated (default: submit)
* - mode if set, the type of HTML element to be used (default: <button>). Values = [button|input]
* - name if set, the name of button that will be generated (default: value of 'type' parameter)
* - value if set, the value of button that will be generated
* - id if set, the ID of button
* - class if set, the class of button
* - src image source name
* - alt if set, the constant that will be used for the alt attribute
* - title if set, the constant that will be used for the title attribute
* - constants if false then both alt and title will be assumed to be the final strings not constants
* - gt if true assume that gettext translation should be looked up for alt and title
* @param array $params All attributes passed to this function from the template
* @param object $smarty Reference to the Smarty object
* @return string the version string
// we're going to make use of pnimg for path searching
require_once $smarty->_get_plugin_filepath('function', 'pnimg');
if (!isset ($constants) || !is_bool($constants)) {
if (isset ($gt) && is_bool($gt) && $gt) {
$gt ? $alt = _("Submit") : $alt = _SUBMIT;
$gt ? $title = _("Submit") : $title = _SUBMIT;
// call the pnimg plugin and work out the src from the assigned template vars
smarty_function_pnimg(array('assign' => 'buttonsrc', 'src' => $src, 'set' => $set, 'modname' => 'core'), $smarty);
$imgvars = $smarty->get_template_vars('buttonsrc');
$imgsrc = $imgvars['src'];
$smarty->assign($assign, $return);
|