本文整理汇总了PHP中zbx_formatDomId函数的典型用法代码示例。如果您正苦于以下问题:PHP zbx_formatDomId函数的具体用法?PHP zbx_formatDomId怎么用?PHP zbx_formatDomId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zbx_formatDomId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTab
public function addTab($id, $header, $body)
{
$this->headers[$id] = $header;
$this->tabs[$id] = new CDiv($body);
$this->tabs[$id]->setId(zbx_formatDomId($id));
return $this;
}
示例2: __construct
/**
* @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) . ');');
}
示例3: __construct
public function __construct($label, $for = null)
{
parent::__construct('label', true, $label);
if ($for !== null) {
$this->setAttribute('for', zbx_formatDomId($for));
}
}
示例4: __construct
public function __construct($id = null)
{
parent::__construct();
$this->addClass('table-forms');
if ($id) {
$this->setId(zbx_formatDomId($id));
}
}
示例5: __construct
public function __construct($id, $class = null, $editable = true)
{
$this->editable = $editable;
$this->formList = new CList(null, 'formlist');
parent::__construct();
$this->attr('id', zbx_formatDomId($id));
$this->attr('class', $class);
}
示例6: __construct
public function __construct($name, $value, $insert_color_picker = true)
{
parent::__construct([(new CColorCell('lbl_' . $name, $value))->setTitle('#' . $value)->onClick('javascript: show_color_picker("' . zbx_formatDomId($name) . '")'), (new CTextBox($name, $value))->setWidth(ZBX_TEXTAREA_COLOR_WIDTH)->setAttribute('maxlength', 6)->onChange('set_color_by_name("' . zbx_formatDomId($name) . '", this.value)')]);
$this->addClass(ZBX_STYLE_INPUT_COLOR_PICKER);
if ($insert_color_picker) {
insert_show_color_picker_javascript();
}
}
示例7: __construct
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);
}
}
示例8: __construct
public function __construct($name, $value, $action = null)
{
parent::__construct(SPACE . SPACE . SPACE, 'pointer');
$this->setName($name);
$this->attr('id', zbx_formatDomId($name));
$this->attr('title', '#' . $value);
$this->attr('style', 'display: inline; width: 10px; height: 10px; text-decoration: none; border: 1px solid black; background-color: #' . $value);
$this->attr('onclick', $action);
}
示例9: __construct
public function __construct($name = null, $color)
{
parent::__construct();
if ($name !== null) {
$this->setName($name);
$this->setId(zbx_formatDomId($name));
}
$this->setAttribute('style', 'background: #' . $color);
}
示例10: __construct
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));
}
}
示例11: __construct
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;
}
示例12: __construct
/**
* @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);
}
示例13: __construct
public function __construct($name, $value)
{
parent::__construct();
$txt = new CTextBox($name, $value);
$txt->addStyle('width: 6em;');
$txt->attr('maxlength', 6);
$txt->attr('id', zbx_formatDomId($name));
$txt->addAction('onchange', 'set_color_by_name("' . $name . '", this.value)');
$txt->addStyle('style', 'margin-top: 0px; margin-bottom: 0px;');
$lbl = new CColorCell('lbl_' . $name, $value, 'javascript: show_color_picker("' . $name . '")');
$this->addItem(array($txt, $lbl));
insert_show_color_picker_javascript();
}
示例14: __construct
public function __construct($name = 'combobox', $value = null, $action = null, array $items = [])
{
parent::__construct('select', true);
$this->setId(zbx_formatDomId($name));
$this->setAttribute('name', $name);
$this->value = $value;
if ($action !== null) {
$this->onChange($action);
}
$this->addItems($items);
// Prevent Firefox remembering selected option on page refresh.
$this->setAttribute('autocomplete', 'off');
}
示例15: __construct
public function __construct($name = 'combobox', $value = null, $action = null, $items = null)
{
parent::__construct('select', 'yes');
$this->tag_end = '';
$this->attr('id', zbx_formatDomId($name));
$this->attr('name', $name);
$this->attr('class', 'input select');
$this->attr('size', 1);
$this->value = $value;
$this->attr('onchange', $action);
if (is_array($items)) {
$this->addItems($items);
}
}