function append($content) { if ($this->sub) { return $this->sub->insert($content, 1); } return parent::append($content); }
/** * @override */ function PreRender($args = array()) { if (count($args) > 0) { $controller =& $args[0]; // just to render close button with the right id if (!is_null($this->CloseButton)) { $temp = array($this->CloseButton => $this->CloseButtonAction); $this->Buttons = array_merge($this->Buttons, $temp); } $rem = system_is_ajax_call() ? ".remove()" : ''; $close_action = "\$('#{$this->id}').dialog('close'){$rem};"; foreach ($this->Buttons as $label => $action) { if (!starts_with($action, '[jscode]') && !starts_with($action, 'function')) { $action = "function(){ {$action} }"; } $this->Buttons[$label] = str_replace("{close_action}", $close_action, $action); } $this->Options['buttons'] = $this->Buttons; $tmp = $this->_script; $this->_script = array(); $this->script("try{ \$('#{$this->id}').dialog(" . system_to_json($this->Options) . "); }catch(ex){ wdf.debug(ex); }"); $this->script("\$('#{$this->id}').parent().find('.ui-dialog-buttonpane .ui-button').click(function(){ \$(this).parent().find('.ui-button').button('disable'); });"); $this->_script = array_merge($this->_script, $tmp); foreach ($this->_script as $s) { $controller->addDocReady($s); } } return parent::PreRender($args); }
/** * @override */ function PreRender($args = array()) { $opts = array(); if ($this->min !== false) { $opts['min'] = $this->min; } if ($this->max !== false) { $opts['max'] = $this->max; } if ($this->value !== false) { $opts['value'] = $this->value; } if ($this->range !== false) { $opts['range'] = $this->range; } if ($this->onslide !== false) { $opts['slide'] = $this->onslide; } if ($this->values !== false) { if (!is_array($this->values)) { $this->values = array($this->values); } $opts['values'] = "[" . implode(",", $this->values) . "]"; } $opts = array_merge($opts, $this->Options); if ($opts['value'] > $opts['max']) { $opts['value'] = $opts['max']; } if ($opts['value'] < $opts['min']) { $opts['value'] = $opts['min']; } $opts = system_to_json($opts); $this->script("\$('#{$this->id}').slider({$opts});"); parent::PreRender($args); }
/** * @override */ function PreRender($args = array()) { foreach ($this->_sections as $section => $section_content) { $this->content("<h3>{$section}</h3>"); $this->content($section_content); } parent::PreRender($args); }
/** * @param bool $is_sub_navigation If true acts as submenu */ function __initialize($is_sub_navigation = false) { global $CONFIG; parent::__initialize("ul"); if (!$is_sub_navigation) { $this->script("\$('#" . $this->id . "').navigation({root_uri:'" . $CONFIG['system']['console_uri'] . "',item_width:130});"); } }
/** * @override */ function PreRender($args = array()) { foreach ($this->_sections as $section => $section_content) { $this->content("<h3>{$section}</h3>"); $this->content($section_content); } $this->script("\$('#" . $this->id . "').accordion(" . system_to_json($this->Options) . ")"); parent::PreRender($args); }
/** * @param float $defvalue Initial value * @param string $onchange onChange JS code */ function __initialize($defvalue = 0, $onchange = "") { parent::__initialize("div"); $this->InitFunctionName = false; $defvalue = floatval(str_replace(",", ".", $defvalue)); $e = floor($defvalue); $c = round($defvalue - $e, 2) * 100; $id = $this->id; $this->class = "currencyinput ui-widget-content ui-widget ui-corner-all"; $this->css("border", "1px solid transparent"); $this->onmouseover = "\$(this).css({border:''});"; $this->onmouseout = "\$(this).css({border:'1px solid transparent'});"; $euro = new uiSlider(); $euro->id = "{$id}_euro"; $euro->range = 'min'; $euro->min = 0; $euro->max = 100; $euro->value = $e; $euro->css("margin-bottom", "8px"); $euro->onslide = "function(event, ui){ \$('#{$id}_euro_value').text(ui.value); "; $euro->onslide .= "\$('#{$id}_hidden').val( \$('#{$id}_euro_value').text()+'.'+\$('#{$id}_cent_value').text() ).change(); }"; $euro->onmouseover = "\$('#{$id}_euro_value').css({color:'red'});"; $euro->onmouseout = "\$('#{$id}_euro_value').css({color:'black'});"; $cent = new uiSlider(); $cent->id = "{$id}_cent"; $cent->range = 'min'; $cent->min = 0; $cent->max = 99; $cent->value = $c; $cent->onslide = "function(event, ui){ \$('#{$id}_cent_value').text(ui.value<10?'0'+ui.value:ui.value); "; $cent->onslide .= "\$('#{$id}_hidden').val( \$('#{$id}_euro_value').text()+'.'+\$('#{$id}_cent_value').text() ).change(); }"; $cent->onmouseover = "\$('#{$id}_cent_value').css({color:'red'});"; $cent->onmouseout = "\$('#{$id}_cent_value').css({color:'black'});"; $container = new Control("div"); $container->class = "container"; $container->content($euro); $container->content($cent); $value = new Control("div"); $value->class = "value"; $euroval = new Control("div"); $euroval->id = "{$id}_euro_value"; $euroval->css("float", "left"); $euroval->content($e); $centval = new Control("div"); $centval->id = "{$id}_cent_value"; $centval->css("float", "left"); $centval->content($c < 9 ? "0{$c}" : $c); $value->content("<div style='float:left'>€</div>"); $value->content($euroval); $value->content("<div style='float:left'>,</div>"); $value->content($centval); $this->content($container); $this->content($value); $this->content("<input type='hidden' id='{$id}_hidden' name='{$id}' value='{$defvalue}' onchange='{$onchange}'/>"); $this->content("<br style='clear:both; line-height:0'/>"); }
/** * @override */ function PreRender($args = array()) { if ($this->opt('value') > $this->opt('max')) { $this->opt('value', $this->opt('max')); } if ($this->opt('value') < $this->opt('min')) { $this->opt('value', $this->opt('min')); } parent::PreRender($args); }
/** * @override */ function PreRender($args = array()) { if ($this->Url) { $this->opt('url', $this->Url); } if ($this->NodeSelected) { $this->opt('nodeSelected', $this->NodeSelected); } return parent::PreRender($args); }
/** * @param int $defvalue Initial value (seconds) * @param string $onchange onChange JS code */ function __initialize($defvalue = 0, $onchange = "") { parent::__initialize("div"); $this->InitFunctionName = false; $defvalue = intval($defvalue); $m = floor($defvalue / 60); $s = $defvalue % 60; $id = $this->id; $this->class = "timeinput ui-widget-content ui-widget ui-corner-all"; $this->css("border", "1px solid transparent"); $this->onmouseover = "\$(this).css({border:''});"; $this->onmouseout = "\$(this).css({border:'1px solid transparent'});"; $minutes = new uiSlider(); $minutes->id = "{$id}_euro"; $minutes->range = 'min'; $minutes->min = 0; $minutes->max = 120; $minutes->value = $m; $minutes->css("margin-bottom", "8px"); $minutes->onslide = "function(event, ui){ \$('#{$id}_euro_value').text(ui.value<10?'0'+ui.value:ui.value);"; $minutes->onslide .= "\$('#{$id}_hidden').val( parseInt(\$('#{$id}_euro_value').text())*60 + parseInt(\$('#{$id}_cent_value').text()) ).change(); }"; $minutes->onmouseover = "\$('#{$id}_euro_value').css({color:'red'});"; $minutes->onmouseout = "\$('#{$id}_euro_value').css({color:'black'});"; $seconds = new uiSlider(); $seconds->id = "{$id}_cent"; $seconds->range = 'min'; $seconds->min = 0; $seconds->max = 59; $seconds->value = $s; $seconds->onslide = "function(event, ui){ \$('#{$id}_cent_value').text(ui.value<10?'0'+ui.value:ui.value); "; $seconds->onslide .= "\$('#{$id}_hidden').val( parseInt(\$('#{$id}_euro_value').text())*60 + parseInt(\$('#{$id}_cent_value').text()) ).change(); }"; $seconds->onmouseover = "\$('#{$id}_cent_value').css({color:'red'});"; $seconds->onmouseout = "\$('#{$id}_cent_value').css({color:'black'});"; $container = new Control("div"); $container->class = "container"; $container->content($minutes); $container->content($seconds); $value = new Control("div"); $value->class = "value"; $minuteval = new Control("div"); $minuteval->id = "{$id}_euro_value"; $minuteval->css("float", "left"); $minuteval->content($m < 9 ? "0{$m}" : $m); $secval = new Control("div"); $secval->id = "{$id}_cent_value"; $secval->css("float", "left"); $secval->content($s < 9 ? "0{$s}" : $s); $value->content($minuteval); $value->content("<div style='float:left'>:</div>"); $value->content($secval); $this->content($container); $this->content($value); $this->content("<input type='hidden' id='{$id}_hidden' name='{$id}' value='{$defvalue}' onchange='{$onchange}'/>"); $this->content("<br style='clear:both; line-height:0'/>"); }
/** * @override */ function PreRender($args = array()) { if (!$this->CultureInfo) { $this->SetCulture(Localization::detectCulture()); } if (isset($this->value)) { $this->value = get_class_simple($this) == "uiDatePicker" ? $this->CultureInfo->FormatDate($this->value, DateTimeFormat::DF_SHORTDATE) : $this->CultureInfo->FormatDateTime($this->value); } if (isset($this->Options['defaultDate'])) { $this->Options['defaultDate'] = get_class_simple($this) == "uiDatePicker" ? $this->CultureInfo->FormatDate($this->Options['defaultDate'], DateTimeFormat::DF_SHORTDATE) : $this->CultureInfo->FormatDateTime($this->Options['defaultDate']); } parent::PreRender($args); }
function __initialize($message, $type = 'highlight') { parent::__initialize('div'); $this->class = "ui-widget ui-message"; if (function_exists('translation_string_exists') && translation_string_exists($message)) { $message = getString($message); } $icon = $type == 'highlight' ? 'info' : 'alert'; $sub = $this->content(new Control('div')); $sub->class = "ui-state-{$type} ui-corner-all"; $sub->content("<span class='ui-icon ui-icon-close' onclick=\"\$(this).parent().parent().slideUp('fast', function(){ \$(this).remove(); })\"></span>"); $sub->content("<p><span class='ui-icon ui-icon-{$icon}'></span>{$message}</p>"); }
/** * @override */ function PreRender($args = array()) { if (!$this->CultureInfo) { $this->SetCulture(Localization::detectCulture()); } if (isset($this->value)) { $this->value = get_class_simple($this) == "uiDatePicker" ? $this->CultureInfo->FormatDate($this->value, DateTimeFormat::DF_SHORTDATE) : $this->CultureInfo->FormatDateTime($this->value); } if (isset($this->Options['defaultDate'])) { $this->Options['defaultDate'] = get_class_simple($this) == "uiDatePicker" ? $this->CultureInfo->FormatDate($this->Options['defaultDate'], DateTimeFormat::DF_SHORTDATE) : $this->CultureInfo->FormatDateTime($this->Options['defaultDate']); } $this->script("\$('#{$this->id}').{$this->init_code}(" . system_to_json($this->Options) . ");"); parent::PreRender($args); }
/** * @override */ function PreRender($args = array()) { if ($this->Url || $this->NodeSelected) { $options = new StdClass(); if ($this->Url) { $options->url = $this->Url; } if ($this->NodeSelected) { $options->nodeSelected = $this->NodeSelected; } $this->script("\$('#" . $this->id . "').treeview(" . system_to_json($options) . ");"); } else { $this->script("\$('#" . $this->id . "').treeview({});"); } return parent::PreRender($args); }
/** * @override */ function PreRender($args = array()) { $btncnt = count($this->buttons); if ($btncnt != 0) { for ($index = 0; $index < $btncnt; $index++) { $label = $this->buttons[$index]['label']; $events = $this->buttons[$index]['events']; $this->content($this->buttons[$index]['button']); // $this->content("<label for='".$this->buttons[$index]['button']->id."'>".$label."</label>"); $this->content($this->buttons[$index]['label']); if (isset($this->buttons[$index]['icon'])) { $this->script("\$('#{$this->buttons[$index]['button']->id}').button({icons:{primary:'ui-icon-" . $this->buttons[$index]['icon'] . "'}});"); } foreach ($events as $event => $function) { $this->script("\$('#{$this->buttons[$index]['button']->id}').{$event}(function(){ {$function} }); "); } } } parent::PreRender($args); }
/** * @override */ public function PreRender($args = array()) { if (isset($this->Options['captionEl'])) { $title = isset($this->Options['captionTitle']) ? $this->Options['captionTitle'] . ": " : getString("TXT_RATING") . ": "; $labTitle = new Label($title); $labTitle->class = "userrating"; $caption_element = "<span id='" . $this->Options['captionEl'] . "'></span>"; $caption = ", captionEl: \$('#" . $this->Options['captionEl'] . "')}"; unset($this->Options['captionEl']); unset($this->Options['captionTitle']); $this->Options = system_to_json($this->Options); $this->Options = str_replace("}", $caption, $this->Options); $this->content($labTitle); $this->content($this->CreateSelect($this->id . "_select")); //$this->_content[] = " (".$caption_element.")"; } else { $this->Options = system_to_json($this->Options); $this->content($this->CreateSelect($this->id . "_select")); } $script = "\$('#{$this->id}').stars({$this->Options});"; $this->script($script); parent::PreRender($args); }
/** * @override */ public function PreRender($args = array()) { log_debug(__METHOD__); $this->script("\$('#{self}').tabs(" . system_to_json($this->Options) . ")"); return parent::PreRender($args); }
/** * @param array $options See http://api.jqueryui.com/tabs/ */ function __initialize($options = array()) { parent::__initialize('div'); $this->Options = force_array($options); $this->list = $this->content(new Control('ul')); }
/** * @param array $options See http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/ */ function __initialize($options = array()) { parent::__initialize("select"); }
/** * @param array $options See http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/ */ function __initialize($options = array()) { parent::__initialize("select"); $this->script("\$('#{$this->id}').selectmenu();"); }