[Pieforms-commit] SF.net SVN: pieforms: [77] pieforms-php5/trunk/src/pieform/elements/image. php
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2006-12-06 22:02:33
|
Revision: 77 http://svn.sourceforge.net/pieforms/?rev=77&view=rev Author: oracleshinoda Date: 2006-12-06 14:02:27 -0800 (Wed, 06 Dec 2006) Log Message: ----------- Added an image element, for input type='image' buttons. Added Paths: ----------- pieforms-php5/trunk/src/pieform/elements/image.php Added: pieforms-php5/trunk/src/pieform/elements/image.php =================================================================== --- pieforms-php5/trunk/src/pieform/elements/image.php (rev 0) +++ pieforms-php5/trunk/src/pieform/elements/image.php 2006-12-06 22:02:27 UTC (rev 77) @@ -0,0 +1,45 @@ +<?php +/** + * This program is part of Pieforms + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * @package pieform + * @subpackage element + * @author Nigel McNie <ni...@ca...> + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2006 Catalyst IT Ltd http://catalyst.net.nz + * + */ + +/** + * Renders an <input type="image"> button + * + * @param array $element The element to render + * @param Pieform $form The form to render the element for + * @return string The HTML for the element + */ +function pieform_render_image($element, Pieform $form) { + return '<input type="image" src="' . Pieform::hsc($element['src']) . '"' + . Pieform::element_attributes($element) + . ' value="' . Pieform::hsc($form->get_value($element)) . '">'; +} + +function pieform_render_image_set_attributes($element) { + $element['ajaxmessages'] = true; + return $element; +} + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |