public function __construct($value = NULL, $class = NULL) { parent::__construct('ul', 'yes'); $this->tag_end = ''; $this->addItem($value); $this->setClass($class); }
public function __construct($value, $class = null, $id = null) { parent::__construct('li', 'yes'); $this->addItem($value); $this->addClass($class); $this->attr('id', $id); }
/** * @param array $options['objectOptions'] an array of parameters to be added to the request URL * * @see jQuery.multiSelect() */ public function __construct(array $options = []) { parent::__construct('div', true); $this->addClass('multiselect'); $this->setId(zbx_formatDomId($options['name'])); // url $url = new CUrl('jsrpc.php'); $url->setArgument('type', PAGE_TYPE_TEXT_RETURN_JSON); $url->setArgument('method', 'multiselect.get'); $url->setArgument('objectName', $options['objectName']); if (!empty($options['objectOptions'])) { foreach ($options['objectOptions'] as $optionName => $optionvalue) { $url->setArgument($optionName, $optionvalue); } } $params = ['url' => $url->getUrl(), 'name' => $options['name'], 'labels' => ['No matches found' => _('No matches found'), 'More matches found...' => _('More matches found...'), 'type here to search' => _('type here to search'), 'new' => _('new'), 'Select' => _('Select')]]; if (array_key_exists('data', $options)) { $params['data'] = zbx_cleanHashes($options['data']); } foreach (['ignored', 'defaultValue', 'disabled', 'selectedLimit', 'addNew'] as $option) { if (array_key_exists($option, $options)) { $params[$option] = $options[$option]; } } if (array_key_exists('popup', $options)) { foreach (['parameters', 'width', 'height'] as $option) { if (array_key_exists($option, $options['popup'])) { $params['popup'][$option] = $options['popup'][$option]; } } } zbx_add_post_js('jQuery("#' . $this->getAttribute('id') . '").multiSelect(' . CJs::encodeJson($params) . ');'); }
public function __construct($label, $for = null) { parent::__construct('label', true, $label); if ($for !== null) { $this->setAttribute('for', zbx_formatDomId($for)); } }
public function __construct($item = null, $class = null, $id = null) { parent::__construct('tr', 'yes'); $this->addItem($item); $this->attr('class', $class); $this->attr('id', $id); }
public function __construct($name = '', $value = '0') { parent::__construct('input', 'no'); $this->options['type'] = 'hidden'; $this->options['name'] = $name; $this->options['id'] = $name; $this->setValue($value); }
public function __construct($coords, $href, $alt, $shape) { parent::__construct('area', 'no'); $this->setCoords($coords); $this->setShape($shape); $this->setHref($href); $this->setAlt($alt); }
public function __construct($name = 'file', $value = '') { parent::__construct('input', 'no'); $this->setClass('biginput'); $this->setAttribute('type', 'file'); $this->setName($name); $this->setFile($value); }
public function __construct($item = null, $url = null) { parent::__construct('a', true); if ($item !== null) { $this->addItem($item); } $this->url = $url; }
public function __construct() { parent::__construct('table', true); $this->rownum = 0; $this->header = ''; $this->footer = ''; $this->colnum = 1; }
public function __construct($value, $caption = null, $selected = null, $enabled = null) { parent::__construct('option', 'yes'); $this->tag_body_start = ''; $this->setAttribute('value', $value); $this->addItem($caption); $this->setSelected($selected); $this->setEnabled($enabled); }
public function __construct($value, $caption = NULL, $selected = NULL, $enabled = NULL) { parent::__construct('option', 'yes'); $this->tag_body_start = ''; $this->options['value'] = $value; $this->addItem($caption); $this->setSelected($selected); $this->setEnabled($enabled); }
public function __construct($src = null, $width = '100%', $height = '100%', $scrolling = 'no', $id = 'iframe') { parent::__construct('iframe', true); $this->setSrc($src); $this->setWidth($width); $this->setHeight($height); $this->setScrolling($scrolling); $this->setId($id); }
public function __construct($name = 'button', $caption = '') { parent::__construct('button', true, $caption); $this->setAttribute('type', 'button'); if ($name !== null) { $this->setId(zbx_formatDomId($name)); $this->setAttribute('name', $name); } }
public function __construct($value, $class = null, $id = null) { parent::__construct('li', 'yes'); $this->addItem($value); $this->addClass($class); if (!empty($id)) { $this->setAttribute('id', $id); } }
public function __construct($type = 'text', $name = 'textbox', $value = '') { parent::__construct('input'); $this->setType($type); // if id is not passed, it will be the same as element name $this->setId(zbx_formatDomId($name)); $this->setAttribute('name', $name); $this->setAttribute('value', $value); return $this; }
public function __construct($label, $for = null, $id = null) { parent::__construct('label', 'yes', $label); if (!is_null($id)) { $this->attr('id', zbx_formatDomId($id)); } if (!is_null($for)) { $this->attr('for', zbx_formatDomId($for)); } }
public function __construct($action = NULL, $method = 'post', $enctype = NULL) { parent::__construct('form', 'yes'); $this->setMethod($method); $this->setAction($action); $this->setEnctype($enctype); if (isset($_COOKIE['zbx_sessionid'])) { $this->addVar('sid', substr($_COOKIE['zbx_sessionid'], 16, 16)); } }
public function __construct($name = 'textarea', $value = '', $cols = 77, $rows = 7, $readonly = 'no') { parent::__construct('textarea', 'yes'); $this->attributes['class'] = 'biginput'; $this->attributes['name'] = $name; $this->attributes['rows'] = $rows; $this->attributes['cols'] = $cols; $this->setReadonly($readonly); $this->addItem($value); }
public function __construct($label, $for = null, $id = null) { parent::__construct('label', 'yes', $label); if (!is_null($id)) { $this->setAttribute('id', $id); } if (!is_null($for)) { $this->setAttribute('for', $for); } }
public function __construct($value, $caption = null, $selected = null, $enabled = null) { parent::__construct('option', true); $this->setAttribute('value', $value); $this->addItem($caption); $this->setSelected($selected); if ($enabled !== null) { $this->setEnabled($enabled); } }
public function __construct($name = 'button', $caption = '', $action = NULL, $accesskey = NULL) { parent::__construct('input', 'no'); $this->tag_body_start = ''; $this->attributes['type'] = 'submit'; $this->setAttribute('value', $caption); $this->attributes['class'] = 'button'; $this->setName($name); $this->setAction($action); $this->setAccessKey($accesskey); }
public function __construct($name = 'button', $caption = '', $action = NULL, $submit = true) { parent::__construct('input', 'no'); $this->tag_body_start = ''; $this->attributes['type'] = $submit ? 'submit' : 'button'; $this->setAttribute('value', $caption); $this->attributes['class'] = 'button'; $this->attributes['id'] = $name; $this->setName($name); $this->setAction($action); }
public function __construct($name = 'combobox', $value = NULL, $action = NULL) { parent::__construct('select', 'yes'); $this->tag_end = ''; $this->options['id'] = $name; $this->options['name'] = $name; $this->options['class'] = 'biginput'; $this->options['size'] = 1; $this->value = $value; $this->SetAction($action); }
public function __construct($items = NULL, $class = NULL) { parent::__construct('span', 'yes'); $this->setClass($class); $this->addItem($items); $this->tag_body_start = ''; $this->tag_start = ''; $this->tag_end = ''; $this->tag_body_start = ''; $this->tag_body_end = ''; }
/** * @param string $options['id'] * @param string $options['name'] * @param int $options['value'] */ public function __construct(array $options = array()) { parent::__construct('div', 'yes'); $this->attr('id', isset($options['id']) ? $options['id'] : zbx_formatDomId($options['name'])); $this->addClass('jqueryinputset control-severity'); if (!isset($options['value'])) { $options['value'] = TRIGGER_SEVERITY_NOT_CLASSIFIED; } $items = array(); $jsIds = ''; $jsLabels = ''; foreach (getSeverityCaption() as $severity => $caption) { $items[] = new CRadioButton($options['name'], $severity, null, $options['name'] . '_' . $severity, $options['value'] == $severity); $css = getSeverityStyle($severity); $label = new CLabel($caption, $options['name'] . '_' . $severity, $options['name'] . '_label_' . $severity); $label->attr('data-severity', $severity); $label->attr('data-severity-style', $css); if ($options['value'] == $severity) { $label->attr('aria-pressed', 'true'); $label->addClass($css); } else { $label->attr('aria-pressed', 'false'); } $items[] = $label; $jsIds .= ', #' . $options['name'] . '_' . $severity; $jsLabels .= ', #' . $options['name'] . '_label_' . $severity; } if ($jsIds) { $jsIds = substr($jsIds, 2); $jsLabels = substr($jsLabels, 2); } $this->addItem($items); insert_js(' jQuery("' . $jsLabels . '").mouseenter(function() { jQuery("' . $jsLabels . '").each(function() { var obj = jQuery(this); if (obj.attr("aria-pressed") == "false") { obj.removeClass("ui-state-hover " + obj.data("severityStyle")); } }); var obj = jQuery(this); obj.addClass(obj.data("severityStyle")); }) .mouseleave(function() { jQuery("#' . $this->getAttribute('id') . ' [aria-pressed=\\"true\\"]").trigger("mouseenter"); }); jQuery("' . $jsIds . '").change(function() { jQuery("#' . $this->getAttribute('id') . ' [aria-pressed=\\"true\\"]").trigger("mouseenter"); });', true); }
public function __construct($value = null, $class = null) { parent::__construct('ul', 'yes'); $this->tag_end = ''; $this->addItem($value); $this->addClass($class); if (is_null($value)) { $this->addItem(_('List is empty'), 'empty'); $this->emptyList = true; } }
/** * Creates a UL list. * * @param array $values an array of items to add to the list */ public function __construct(array $values = []) { parent::__construct('ul', true); foreach ($values as $value) { $this->addItem($value); } if (!$values) { $this->addItem(_('List is empty'), 'empty'); $this->emptyList = true; } }
public function __construct($filterid) { parent::__construct('div', true); $this->addClass(ZBX_STYLE_FILTER_CONTAINER); $this->setId('filter-space'); $this->filterid = $filterid; $this->columns = []; $this->form = (new CForm('get'))->cleanItems()->setAttribute('name', $this->name)->setId('id', $this->name); // filter is opened by default $this->opened = CProfile::get($this->filterid, 1) == 1; }
public function __construct($item = null, $class = null, $colspan = null, $width = null) { parent::__construct('td', 'yes'); $this->addItem($item); $this->attr('class', $class); if (!empty($colspan)) { $this->attr('colspan', $colspan); } if (!empty($width)) { $this->attr('width', $width); } }