* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This contains functions needed to generate html output.
*
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This contains functions needed to generate html output.
*
- var $tag, $text, $style, $class,
+ var $tag, $text, $style, $class,
$id, $html_el = array(), $javascript, $xtr_prop;
function html($tag='', $text='', $style ='', $class='', $id='',
$id, $html_el = array(), $javascript, $xtr_prop;
function html($tag='', $text='', $style ='', $class='', $id='',
- $new_html_el = array();
- $new_html_el[] = $el;
- foreach ($this->html_el as $html_el) {
- $new_html_el[] = $html_el;
- }
- $this->html_el = $new_html_el;
+ $new_html_el = array();
+ $new_html_el[] = $el;
+ foreach ($this->html_el as $html_el) {
+ $new_html_el[] = $html_el;
+ }
+ $this->html_el = $new_html_el;
function AddChild($tag='', $text='', $style ='', $class='', $id='',
$xtr_prop = '', $javascript = '') {
$el = new html ($tag, $text, $style, $class, $id, $xtr_prop, $javascript);
$this->htmlAdd($el);
}
function AddChild($tag='', $text='', $style ='', $class='', $id='',
$xtr_prop = '', $javascript = '') {
$el = new html ($tag, $text, $style, $class, $id, $xtr_prop, $javascript);
$this->htmlAdd($el);
}
- if ($this->html_el[$i]->id == $id) {
- $ret = $this->html_el[$i];
- return $ret;
- } else if (count($this->html_el[$i]->html_el)) {
- $el = $this->html_el[$i]->FindId($id);
- }
- if ($el) return $el;
+ if ($this->html_el[$i]->id == $id) {
+ $ret = $this->html_el[$i];
+ return $ret;
+ } else if (count($this->html_el[$i]->html_el)) {
+ $el = $this->html_el[$i]->FindId($id);
+ }
+ if ($el) return $el;
function InsToId( $el, $id, $last=true) {
$html_el = &$this->FindId($id);
if ($html_el) {
$html_el->htmlAdd($el, $last);
}
function InsToId( $el, $id, $last=true) {
$html_el = &$this->FindId($id);
if ($html_el) {
$html_el->htmlAdd($el, $last);
}
$el = new html ('script',$s,'','','',array('language' => 'JavaScript',
'type' => 'text/javascript'));
$this->htmlAdd($el);
}
$el = new html ('script',$s,'','','',array('language' => 'JavaScript',
'type' => 'text/javascript'));
$this->htmlAdd($el);
}
function echoHtml( $usecss=false, $indent='x') {
if ($indent == 'x') {
$indent = ''; $indentmore = '';
function echoHtml( $usecss=false, $indent='x') {
if ($indent == 'x') {
$indent = ''; $indentmore = '';
if ($javascript) {
$js = '';
foreach ($javascript as $k => $v) { /* here we put the onclick, onmouseover etc entries */
$js.=' '.$k.'="'.$v.'";';
}
}
if ($javascript) {
$js = '';
foreach ($javascript as $k => $v) { /* here we put the onclick, onmouseover etc entries */
$js.=' '.$k.'="'.$v.'";';
}
}
}
if ($style && !$usecss && !is_array($style)) {
/* last premisse is to prevent 'style="Array"' in the output */
}
if ($style && !$usecss && !is_array($style)) {
/* last premisse is to prevent 'style="Array"' in the output */