本文整理汇总了PHP中CDiv类的典型用法代码示例。如果您正苦于以下问题:PHP CDiv类的具体用法?PHP CDiv怎么用?PHP CDiv使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CDiv类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get()
{
$error = null;
$timeOffset = null;
$timeZone = null;
switch ($this->screenitem['style']) {
case TIME_TYPE_HOST:
$items = API::Item()->get(array('itemids' => $this->screenitem['resourceid'], 'selectHosts' => array('host'), 'output' => array('itemid', 'value_type')));
$item = reset($items);
$host = reset($item['hosts']);
$lastValue = Manager::History()->getLast(array($item));
if ($lastValue) {
$lastValue = reset($lastValue[$item['itemid']]);
$item['lastvalue'] = $lastValue['value'];
$item['lastclock'] = $lastValue['clock'];
} else {
$item['lastvalue'] = '0';
$item['lastclock'] = '0';
}
$timeType = $host['host'];
preg_match('/([+-]{1})([\\d]{1,2}):([\\d]{1,2})/', $item['lastvalue'], $arr);
if (!empty($arr)) {
$timeZone = $arr[2] * SEC_PER_HOUR + $arr[3] * SEC_PER_MIN;
if ($arr[1] == '-') {
$timeZone = 0 - $timeZone;
}
}
if ($lastvalue = strtotime($item['lastvalue'])) {
$diff = time() - $item['lastclock'];
$timeOffset = $lastvalue + $diff;
} else {
$error = _('NO DATA');
}
break;
case TIME_TYPE_SERVER:
$error = null;
$timeType = _('SERVER');
$timeOffset = time();
$timeZone = date('Z');
break;
default:
$error = null;
$timeType = _('LOCAL');
$timeOffset = null;
$timeZone = null;
break;
}
if ($this->screenitem['width'] > $this->screenitem['height']) {
$this->screenitem['width'] = $this->screenitem['height'];
}
$item = new CFlashClock($this->screenitem['width'], $this->screenitem['height'], $this->action);
$item->setTimeError($error);
$item->setTimeType($timeType);
$item->setTimeZone($timeZone);
$item->setTimeOffset($timeOffset);
$flashclockOverDiv = new CDiv(null, 'flashclock');
$flashclockOverDiv->setAttribute('style', 'width: ' . $this->screenitem['width'] . 'px; height: ' . $this->screenitem['height'] . 'px;');
return $this->getOutput(array($item, $flashclockOverDiv));
}
示例2: build
/**
* Display the widget in expanded or collapsed state.
*/
public function build()
{
$body = new CDiv($this->body, 'body');
$body->setAttribute('id', $this->id);
if (!$this->open) {
$body->setAttribute('style', 'display: none;');
if ($this->footer) {
$this->footer->setAttribute('style', 'display: none;');
}
}
$this->cleanItems();
$this->addItem($this->header);
$this->addItem($body);
$this->addItem($this->footer);
}
示例3: addValue
public function addValue($name, $value, $checked = null)
{
$this->count++;
$id = str_replace(array('[', ']'), array('_'), $this->name) . '_' . $this->count;
$radio = new CInput('radio', $this->name, $value);
$radio->attr('id', zbx_formatDomId($id));
if (strcmp($value, $this->value) == 0 || !is_null($checked) || $checked) {
$radio->attr('checked', 'checked');
}
$label = new CLabel($name, $id);
$outerDiv = new CDiv(array($radio, $label));
if ($this->orientation == self::ORIENTATION_HORIZONTAL) {
$outerDiv->addClass('inlineblock');
}
parent::addItem($outerDiv);
}
示例4: __construct
public function __construct($header, $messages = [], $buttons = [])
{
parent::__construct($header);
$this->addClass(ZBX_STYLE_MSG_BAD);
$this->addClass('msg-global');
if ($messages) {
parent::addItem((new CDiv((new CList($messages))->addClass(ZBX_STYLE_MSG_DETAILS_BORDER)))->addClass(ZBX_STYLE_MSG_DETAILS));
}
parent::addItem((new CDiv($buttons))->addClass('msg-buttons'));
}
示例5: get
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get()
{
$image = new CImg('map.php?noedit=1&sysmapid=' . $this->screenitem['resourceid'] . '&width=' . $this->screenitem['width'] . '&height=' . $this->screenitem['height'] . '&curtime=' . time());
$image->setAttribute('id', 'map_' . $this->screenitem['screenitemid']);
if ($this->mode == SCREEN_MODE_PREVIEW) {
$sysmap = API::Map()->get(array('sysmapids' => $this->screenitem['resourceid'], 'output' => API_OUTPUT_EXTEND, 'selectSelements' => API_OUTPUT_EXTEND, 'selectLinks' => API_OUTPUT_EXTEND, 'expandUrls' => true, 'nopermissions' => true, 'preservekeys' => true));
$sysmap = reset($sysmap);
$actionMap = getActionMapBySysmap($sysmap);
$image->setMap($actionMap->getName());
$output = array($actionMap, $image);
} elseif ($this->mode == SCREEN_MODE_EDIT) {
$output = array($image, BR(), new CLink(_('Change'), $this->action));
} else {
$output = array($image);
}
$this->insertFlickerfreeJs();
$div = new CDiv($output, 'map-container flickerfreescreen', $this->getScreenId());
$div->setAttribute('data-timestamp', $this->timestamp);
$div->addStyle('position: relative;');
return $div;
}
示例6: bodyToString
function bodyToString($destroy = true)
{
$left = new CDiv(null, 'left');
$left->addItem(new CDiv($this->getList(), 'left_menu'));
$link1 = new CLink('www.zabbix.com', 'http://www.zabbix.com/', null, null, true);
$link1->setAttribute('target', '_blank');
$link2 = new CLink('GPL v2', 'http://www.zabbix.com/license.php', null, null, true);
$link2->setAttribute('target', '_blank');
$licence = new CDiv(array($link1, BR(), ' Licensed under ', $link2), 'setup_wizard_licence');
$left->addItem($licence);
$right = new CDiv(null, 'right');
if ($this->getStep() == 0) {
$right->addItem(new CDiv(null, 'blank_title'));
$right->addItem(new CDiv($this->getState(), 'blank_under_title'));
$container = new CDiv(array($left, $right), 'setup_wizard setup_wizard_welcome');
} else {
$right->addItem(new CDiv($this->stage[$this->getStep()]['title'], 'setup_title'));
$right->addItem(new CDiv($this->getState(), 'under_title'));
$container = new CDiv(array($left, $right), 'setup_wizard');
}
if (isset($this->stage[$this->getStep() + 1])) {
$next = new CSubmit('next[' . $this->getStep() . ']', _('Next') . SPACE . '»');
} else {
$next = new CSubmit('finish', _('Finish'));
}
if (isset($this->HIDE_CANCEL_BUTTON) && $this->HIDE_CANCEL_BUTTON) {
$cancel = null;
} else {
$cancel = new CDiv(new CSubmit('cancel', _('Cancel')), 'footer_left');
}
if ($this->DISABLE_NEXT_BUTTON) {
$next->setEnabled(false);
}
// if the user is not logged in (first setup run) hide the "previous" button on the final step
if ($this->getStep() && (CWebUser::$data && CWebUser::getType() == USER_TYPE_SUPER_ADMIN || $this->getStep() < 5)) {
$back = new CSubmit('back[' . $this->getStep() . ']', '«' . SPACE . _('Previous'));
} else {
$back = null;
}
$footer = new CDiv(array($cancel, new CDiv(array($back, $next), 'footer_right')), 'footer');
$container->addItem($footer);
return parent::bodyToString($destroy) . $container->ToString();
}
示例7: toString
public function toString($destroy = true)
{
if (count($this->tabs) == 1) {
$this->setAttribute('class', 'min-width ui-tabs ui-widget ui-widget-content ui-corner-all widget');
$header = reset($this->headers);
$header = new CDiv($header);
$header->addClass('ui-corner-all ui-widget-header header');
$header->setAttribute('id', 'tab_' . key($this->headers));
$this->addItem($header);
$tab = reset($this->tabs);
$tab->addClass('ui-tabs ui-tabs-panel ui-widget ui-widget-content ui-corner-all widget');
$this->addItem($tab);
} else {
$headersList = new CList();
foreach ($this->headers as $id => $header) {
$tabLink = new CLink($header, '#' . $id, null, null, false);
$tabLink->setAttribute('id', 'tab_' . $id);
$headersList->addItem($tabLink);
}
$this->addItem($headersList);
$this->addItem($this->tabs);
$options = array();
if (!is_null($this->selectedTab)) {
$options['selected'] = $this->selectedTab;
}
if ($this->rememberTab) {
$options['cookie'] = array();
}
zbx_add_post_js('jQuery("#' . $this->id . '").tabs(' . zbx_jsvalue($options, true) . ').show();');
}
return parent::toString($destroy);
}
示例8: CLink
if (time() - $trigger['lastchange'] < TRIGGER_BLINK_PERIOD) {
$status->setAttribute('name', 'blink');
}
$lastchange = new CLink(zbx_date2str(S_DATE_FORMAT_YMDHMS, $trigger['lastchange']), 'events.php?triggerid=' . $trigger['triggerid']);
//.'&stime='.date('YmdHis', $trigger['lastchange']
if ($config['event_ack_enable']) {
if ($trigger['event_count']) {
$to_ack = new CCol(array(new CLink(S_ACKNOWLEDGE, 'acknow.php?triggers[]=' . $trigger['triggerid'] . '&backurl=' . $page['file'], 'on'), ' (' . $trigger['event_count'] . ')'));
} else {
$to_ack = new CCol(S_ACKNOWLEDGED, 'off');
}
} else {
$to_ack = null;
}
if ($show_events != EVENTS_OPTION_NOEVENT && !empty($trigger['events'])) {
$open_close = new CDiv(SPACE, 'filterclosed');
$open_close->setAttribute('data-switcherid', $trigger['triggerid']);
} else {
if ($show_events == EVENTS_OPTION_NOEVENT) {
$open_close = null;
} else {
$open_close = SPACE;
}
}
$severity_col = new CCol(get_severity_description($trigger['priority']), get_severity_style($trigger['priority'], $trigger['value']));
if ($show_event_col) {
$severity_col->setColSpan(2);
}
$table->addRow(array($open_close, $config['event_ack_enable'] ? $show_event_col ? null : new CCheckBox('triggers[' . $trigger['triggerid'] . ']', 'no', null, $trigger['triggerid']) : null, $severity_col, $status, $lastchange, zbx_date2age($trigger['lastchange']), $show_event_col ? SPACE : NULL, $to_ack, get_node_name_by_elid($trigger['triggerid']), $host, $tr_desc, new CLink(zbx_empty($trigger['comments']) ? S_ADD : S_SHOW, 'tr_comments.php?triggerid=' . $trigger['triggerid'])), 'even_row');
if ($show_events != EVENTS_OPTION_NOEVENT) {
$i = 1;
示例9: array_merge
if (isset($services[$row['serviceid']])) {
$services[$row['serviceid']] = array_merge($services[$row['serviceid']], $row);
} else {
$services[$row['serviceid']] = $row;
}
if (isset($row['serviceupid'])) {
$services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0);
}
if (isset($row['servicedownid'])) {
$services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
}
}
$treeServ = array();
createShowServiceTree($services, $treeServ);
//return into $treeServ parametr
//permission issue
$treeServ = del_empty_nodes($treeServ);
$tree = new CTree($treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold(S_SLA_LAST_7_DAYS), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH)));
if ($tree) {
$url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$tab = create_hat(S_IT_SERVICES_BIG, $tree->getHTML(), null, 'hat_services', get_profile('web.srv_status.hats.hat_services.state', 1));
$tab->Show();
unset($tab);
} else {
error('Can not format Tree. Check logik structure in service links');
}
}
include_once "include/page_footer.php";
示例10: foreach
foreach ($this->data['new_operation']['opcommand_hst'] as $ohnum => $cmd) {
$this->data['new_operation']['opcommand_hst'][$ohnum]['name'] = $cmd['hostid'] > 0 ? $hosts[$cmd['hostid']]['name'] : '';
}
order_result($this->data['new_operation']['opcommand_hst'], 'name');
$groups = API::HostGroup()->get(array('groupids' => zbx_objectValues($this->data['new_operation']['opcommand_grp'], 'groupid'), 'output' => array('groupid', 'name'), 'preservekeys' => true, 'editable' => true));
$this->data['new_operation']['opcommand_grp'] = array_values($this->data['new_operation']['opcommand_grp']);
foreach ($this->data['new_operation']['opcommand_grp'] as $ognum => $cmd) {
$this->data['new_operation']['opcommand_grp'][$ognum]['name'] = $groups[$cmd['groupid']]['name'];
}
order_result($this->data['new_operation']['opcommand_grp'], 'name');
// js add commands
$jsInsert = 'addPopupValues(' . zbx_jsvalue(array('object' => 'hostid', 'values' => $this->data['new_operation']['opcommand_hst'])) . ');';
$jsInsert .= 'addPopupValues(' . zbx_jsvalue(array('object' => 'groupid', 'values' => $this->data['new_operation']['opcommand_grp'])) . ');';
zbx_add_post_js($jsInsert);
// target list
$cmdList = new CDiv($cmdList, 'objectgroup border_dotted ui-corner-all inlineblock');
$cmdList->setAttribute('id', 'opCmdList');
$newOperationsTable->addRow(array(_('Target list'), $cmdList), 'indent_top');
// type
$typeComboBox = new CComboBox('new_operation[opcommand][type]', $this->data['new_operation']['opcommand']['type'], 'javascript: showOpTypeForm();');
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_IPMI, _('IPMI'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT, _('Custom script'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_SSH, _('SSH'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_TELNET, _('Telnet'));
$typeComboBox->addItem(ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT, _('Global script'));
$userScriptId = new CVar('new_operation[opcommand][scriptid]', $this->data['new_operation']['opcommand']['scriptid']);
$userScriptName = new CTextBox('new_operation[opcommand][script]', $this->data['new_operation']['opcommand']['script'], 32, true);
$userScriptSelect = new CButton('select_opcommand_script', _('Select'), null, 'link_menu');
$userScript = new CDiv(array($userScriptId, $userScriptName, SPACE, $userScriptSelect), 'class_opcommand_userscript inlineblock hidden');
$newOperationsTable->addRow(array(_('Type'), array($typeComboBox, SPACE, $userScript)), 'indent_bottom');
// script
示例11: CFormList
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
include 'include/views/js/administration.general.triggerSeverity.js.php';
$severityTab = new CFormList('scriptsTab');
$headerDiv = new CDiv(_('Custom severity'), 'inlineblock');
$headerDiv->addStyle('width: 16.3em; margin-left: 3px; zoom:1; *display: inline;');
$severityTab->addRow(SPACE, array($headerDiv, _('Colour')));
$severityNameTB0 = new CTextBox('severity_name_0', $this->data['config']['severity_name_0']);
$severityNameTB0->addStyle('width: 15em;');
$severityNameTB0->setAttribute('maxlength', 32);
$severityColorTB0 = new CColor('severity_color_0', $this->data['config']['severity_color_0']);
$severityTab->addRow(_('Not classified'), array($severityNameTB0, SPACE, $severityColorTB0));
$severityNameTB1 = new CTextBox('severity_name_1', $this->data['config']['severity_name_1']);
$severityNameTB1->addStyle('width: 15em;');
$severityNameTB1->setAttribute('maxlength', 32);
$severityColorTB1 = new CColor('severity_color_1', $this->data['config']['severity_color_1']);
$severityTab->addRow(_('Information'), array($severityNameTB1, SPACE, $severityColorTB1));
$severityNameTB2 = new CTextBox('severity_name_2', $this->data['config']['severity_name_2']);
$severityNameTB2->addStyle('width: 15em;');
$severityNameTB2->setAttribute('maxlength', 32);
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:administration.general.triggerSeverity.edit.php
示例12: getHostInventories
// getting inventory fields to make a drop down
$inventoryFields = getHostInventories(true);
// 'true' means list should be ordered by title
$inventoryFieldsComboBox = new CComboBox('filter_field', $this->data['filterField']);
foreach ($inventoryFields as $inventoryField) {
$inventoryFieldsComboBox->addItem($inventoryField['db_field'], $inventoryField['title']);
}
$exactComboBox = new CComboBox('filter_exact', $this->data['filterExact']);
$exactComboBox->addItem('0', _('like'));
$exactComboBox->addItem('1', _('exactly'));
$filterTable->addRow(array(array(array(bold(_('Field')), SPACE, $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $this->data['filterFieldValue'], 20)))), 'host-inventories');
$filter = new CSubmit('filter_set', _('Filter'));
$filter->useJQueryStyle('main');
$reset = new CSubmit('filter_rst', _('Reset'));
$reset->useJQueryStyle();
$divButtons = new CDiv(array($filter, SPACE, $reset));
$divButtons->setAttribute('style', 'padding: 4px 0px;');
$footerCol = new CCol($divButtons, 'controls');
$filterTable->addRow($footerCol);
$filterForm = new CForm('get');
$filterForm->setAttribute('name', 'zbx_filter');
$filterForm->setAttribute('id', 'zbx_filter');
$filterForm->addItem($filterTable);
$hostInventoryWidget->addFlicker($filterForm, CProfile::get('web.hostinventories.filter.state', 0));
$hostInventoryWidget->addHeaderRowNumber();
$table = new CTableInfo(_('No hosts found.'));
$table->setHeader(array(make_sorting_header(_('Host'), 'name', $this->data['sort'], $this->data['sortorder']), _('Group'), make_sorting_header(_('Name'), 'pr_name', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Type'), 'pr_type', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('OS'), 'pr_os', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Serial number A'), 'pr_serialno_a', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Tag'), 'pr_tag', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('MAC address A'), 'pr_macaddress_a', $this->data['sort'], $this->data['sortorder'])));
foreach ($this->data['hosts'] as $host) {
$hostGroups = array();
foreach ($host['groups'] as $group) {
$hostGroups[] = $group['name'];
示例13: _
$dependenciesTable->setHeader(array(_('Name'), _('Action')));
foreach ($this->data['dependencies'] as $dependency) {
$triggersForm->addVar('dependencies[]', $dependency['triggerid'], 'dependencies_' . $dependency['triggerid']);
$hostNames = array();
foreach ($dependency['hosts'] as $host) {
$hostNames[] = CHtml::encode($host['name']);
$hostNames[] = ', ';
}
array_pop($hostNames);
if ($dependency['flags'] == ZBX_FLAG_DISCOVERY_NORMAL) {
$description = new CLink(array($hostNames, NAME_DELIMITER, CHtml::encode($dependency['description'])), 'triggers.php?form=update&hostid=' . $dependency['hostid'] . '&triggerid=' . $dependency['triggerid']);
$description->setAttribute('target', '_blank');
} else {
$description = array($hostNames, NAME_DELIMITER, $dependency['description']);
}
$row = new CRow(array($description, new CButton('remove', _('Remove'), 'javascript: removeDependency(\'' . $dependency['triggerid'] . '\');', 'link_menu')));
$row->setAttribute('id', 'dependency_' . $dependency['triggerid']);
$dependenciesTable->addRow($row);
}
$dependenciesDiv = new CDiv(array($dependenciesTable, new CButton('btn1', _('Add'), 'return PopUp("popup.php?' . 'dstfrm=massupdate' . '&dstact=add_dependency' . '&reference=deptrigger' . '&dstfld1=new_dependency' . '&srctbl=triggers' . '&objname=triggers' . '&srcfld1=triggerid' . '&multiselect=1' . '&with_triggers=1", 1000, 700);', 'link_menu')), 'objectgroup inlineblock border_dotted ui-corner-all');
$dependenciesDiv->setAttribute('id', 'dependencies_div');
$triggersFormList->addRow(array(_('Replace dependencies'), SPACE, new CVisibilityBox('visible[dependencies]', isset($this->data['visible']['dependencies']), 'dependencies_div', _('Original'))), $dependenciesDiv);
}
// append tabs to form
$triggersTab = new CTabView();
$triggersTab->addTab('triggersTab', _('Mass update'), $triggersFormList);
$triggersForm->addItem($triggersTab);
// append buttons to form
$triggersForm->addItem(makeFormFooter(new CSubmit('massupdate', _('Update')), new CButtonCancel(url_params(array('groupid', 'hostid', 'parent_discoveryid')))));
$triggersWidget->addItem($triggersForm);
return $triggersWidget;
示例14: makeTriggersPopup
/**
* Generate table for dashboard triggers popup.
*
* @see make_system_status
*
* @param array $triggers
* @param array $ackParams
* @param array $actions
*
* @return CTableInfo
*/
function makeTriggersPopup(array $triggers, array $ackParams, array $actions)
{
$config = select_config();
$popupTable = new CTableInfo();
$popupTable->setAttribute('style', 'width: 400px;');
$popupTable->setHeader(array(is_show_all_nodes() ? _('Node') : null, _('Host'), _('Issue'), _('Age'), _('Info'), $config['event_ack_enable'] ? _('Ack') : null, _('Actions')));
CArrayHelper::sort($triggers, array(array('field' => 'lastchange', 'order' => ZBX_SORT_DOWN)));
foreach ($triggers as $trigger) {
// unknown triggers
$unknown = SPACE;
if ($trigger['state'] == TRIGGER_STATE_UNKNOWN) {
$unknown = new CDiv(SPACE, 'status_icon iconunknown');
$unknown->setHint($trigger['error'], '', 'on');
}
// ack
if ($config['event_ack_enable']) {
$ack = isset($trigger['event']['eventid']) ? getEventAckState($trigger['event'], true, true, $ackParams) : _('No events');
} else {
$ack = null;
}
// action
$action = isset($trigger['event']['eventid']) && isset($actions[$trigger['event']['eventid']]) ? $actions[$trigger['event']['eventid']] : _('-');
$popupTable->addRow(array(get_node_name_by_elid($trigger['triggerid']), $trigger['hosts'][0]['name'], getSeverityCell($trigger['priority'], $trigger['description']), zbx_date2age($trigger['lastchange']), $unknown, $ack, $action));
}
return $popupTable;
}
示例15: __construct
public function __construct($title, $class, $action = '')
{
parent::__construct(SPACE, $class . ' menu_icon');
$this->setAttribute('title', $title);
if (!empty($action)) {
$this->setAttribute('onclick', 'javascript: ' . $action);
}
}