PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm2 » Bug #8626

new subtype: ximage for <img ....>

Details

Request #8626new subtype: ximage for <img ....>
Submitted2006-09-03 19:16 UTC
Fromb_j at tar dot hu
Assignedavb
StatusClosed
PackageHTML_QuickForm2
PHP VersionIrrelevant
Roadmaps0.6.0

Comments

[2006-09-03 19:16 UTC] b_j at tar dot hu

Description:
------------
HTML/QuickForm/ximage.php:
<?php
require_once 'HTML/QuickForm/element.php';
class HTML_QuickForm_ximage extends HTML_QuickForm_element
{
function HTML_QuickForm_ximage($elementName = null, $src='', $attributes = null){
$this->HTML_QuickForm_element($elementName, null, $attributes);
$this->setSource($src);
$this->setType('ximage');
}
function setType($type){
$this->_type = $type;
//$this->updateAttributes(array('type'=>$type));
} // end func setType
function setSource($src){
$this->updateAttributes(array('src' => $src));
} // end func setSource
function setBorder($border){
$this->updateAttributes(array('border' => $border));
} // end func setBorder
function setAlign($align){
$this->updateAttributes(array('align' => $align));
} // end func setAlign
function setHeight($height){
$this->updateAttributes(array('height' => $height));
}
function setWidth($width){
$this->updateAttributes(array('width' => $width));
}
function freeze(){
return false;
} //end func freeze
function toHtml(){
$this->setType(null);
return '<IMG' . $this->getAttributes(true) . ' />';
}
function getFrozenHtml(){
return $this->toHtml();
}
function setName($name){
$this->updateAttributes(array('name' => $name));
}
function getName(){
return $this->getAttribute('name');
}

}
?>
HTML/QuickForm.php:
....
//Hungarian translation:
var $_jsPrefix = 'Rossz adat';
var $_jsPostfix = 'Javítani kell ezt az adatot';
var $_requiredNote = '<span style="font-size:80%; color:#ff0000;">*</span>'.
'<span style="font-size:80%;"> Kötelezõ mezõ</span>';
....
$GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'] =
array(
'group' =>array('HTML/QuickForm/group.php','HTML_QuickForm_group'),
'hidden' =>array('HTML/QuickForm/hidden.php','HTML_QuickForm_hidden'),
'reset' =>array('HTML/QuickForm/reset.php','HTML_QuickForm_reset'),
'checkbox' =>array('HTML/QuickForm/checkbox.php','HTML_QuickForm_checkbox'),
'file' =>array('HTML/QuickForm/file.php','HTML_QuickForm_file'),
'image' =>array('HTML/QuickForm/image.php','HTML_QuickForm_image'),
'password' =>array('HTML/QuickForm/password.php','HTML_QuickForm_password'),
'radio' =>array('HTML/QuickForm/radio.php','HTML_QuickForm_radio'),
'button' =>array('HTML/QuickForm/button.php','HTML_QuickForm_button'),
'submit' =>array('HTML/QuickForm/submit.php','HTML_QuickForm_submit'),
'select' =>array('HTML/QuickForm/select.php','HTML_QuickForm_select'),
'hiddenselect' =>array('HTML/QuickForm/hiddenselect.php','HTML_QuickForm_hiddenselect'),
'text' =>array('HTML/QuickForm/text.php','HTML_QuickForm_text'),
'textarea' =>array('HTML/QuickForm/textarea.php','HTML_QuickForm_textarea'),
'link' =>array('HTML/QuickForm/link.php','HTML_QuickForm_link'),
'advcheckbox' =>array('HTML/QuickForm/advcheckbox.php','HTML_QuickForm_advcheckbox'),
'date' =>array('HTML/QuickForm/date.php','HTML_QuickForm_date'),
'static' =>array('HTML/QuickForm/static.php','HTML_QuickForm_static'),
'header' =>array('HTML/QuickForm/header.php', 'HTML_QuickForm_header'),
'html' =>array('HTML/QuickForm/html.php', 'HTML_QuickForm_html'),
'hierselect' =>array('HTML/QuickForm/hierselect.php', 'HTML_QuickForm_hierselect'),
'autocomplete' =>array('HTML/QuickForm/autocomplete.php', 'HTML_QuickForm_autocomplete'),
'xbutton' =>array('HTML/QuickForm/xbutton.php','HTML_QuickForm_xbutton'),
//BJ
'ximage' =>array('HTML/QuickForm/ximage.php','HTML_QuickForm_ximage')
);
....