/** * @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()) { 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()) { foreach ($this->_sections as $section => $section_content) { $this->content("<h3>{$section}</h3>"); $this->content($section_content); } parent::PreRender($args); }
/** * @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); }
/** * @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); }
/** * @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->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); }
/** * @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); }