• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CLink类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CLink的典型用法代码示例。如果您正苦于以下问题:PHP CLink类的具体用法?PHP CLink怎么用?PHP CLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CLink类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _getContent

 public function _getContent($refresh = false)
 {
     $table = new CTableInfo(_('No web scenarios found.'));
     $table->setHeader(array(_('Website'), _('Links'), _('Broken Links')));
     $data = array();
     // fetch links between HTTP tests and host groups
     $result = DbFetchArray(DBselect('SELECT website.*, sum(status LIKE "2%") as links_ok, sum(status != "" AND NOT status LIKE "2%") as links_404, sum(status = "" OR status is null) as links_unchecked FROM zabbix_spider.website LEFT JOIN zabbix_spider.page ON page.website = Website.aid group by page.website;'));
     foreach ($result as $row) {
         $deadlinks = DbFetchArray(DBselect('SELECT * FROM zabbix_spider.page  WHERE NOT status IS NULL AND status != "200" AND status != "" and website = ' . $row['aid']));
         $deadlink_output = array();
         $link_options = array("target" => "_blank");
         foreach ($deadlinks as $deadlink) {
             $link_link = new CLink($deadlink['url'] == "" ? "root" : substr($deadlink['url'], 0, 50), ($deadlink['url'] == "" || $deadlink['url'][0] == "/" ? $row['url'] : "") . $deadlink['url']);
             $link_link->setTarget("_blank");
             $map_link = new CLink("map", $this->reportUrl . "?pid={$deadlink['aid']}");
             $map_link->setTarget("_blank");
             $info_link = new CLink($deadlink["status"], "http://www.checkupdown.com/status/E{$deadlink['status']}.html");
             $info_link->setTarget("_blank");
             $deadlink_output[] = new CDiv(array($link_link, " [ ", $map_link, " | ", $info_link, " ]"));
         }
         $link_link = new CLink($row['name'], $row['url']);
         $link_link->setTarget("_blank");
         $map_link = new CLink("map", $this->reportUrl . "?wid={$row['aid']}");
         $map_link->setTarget("_blank");
         $table->addRow(array(new CDiv(array($link_link, " [ ", $map_link, " ]")), new CDiv(array(new CSpan($row['links_ok'], 'green'), " / ", new CSpan($row['links_404'], 'red'), " / ", new CSpan($row['links_unchecked'], 'gray'))), new CDiv($deadlink_output)));
     }
     return $table;
 }
开发者ID:OneOaaS,项目名称:zabbix-dashboard-extension,代码行数:28,代码来源:dbwebspider.inc.php


示例2: 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);
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:32,代码来源:class.ctabview.php


示例3: get

 /**
  * Process screen.
  *
  * @return CDiv (screen inside container)
  */
 public function get()
 {
     $this->dataId = 'graph_' . $this->screenitem['screenitemid'] . '_' . $this->screenitem['screenid'];
     $resourceid = !empty($this->screenitem['real_resourceid']) ? $this->screenitem['real_resourceid'] : $this->screenitem['resourceid'];
     $containerid = 'graph_container_' . $this->screenitem['screenitemid'] . '_' . $this->screenitem['screenid'];
     $graphDims = getGraphDims();
     $graphDims['graphHeight'] = $this->screenitem['height'];
     $graphDims['width'] = $this->screenitem['width'];
     // get time control
     $timeControlData = array('id' => $this->getDataId(), 'containerid' => $containerid, 'objDims' => $graphDims, 'loadImage' => 1, 'periodFixed' => CProfile::get('web.screens.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD);
     // host feature
     if ($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM && !empty($this->hostid)) {
         $newitemid = get_same_item_for_host($resourceid, $this->hostid);
         $resourceid = !empty($newitemid) ? $newitemid : '';
     }
     if ($this->mode == SCREEN_MODE_PREVIEW && !empty($resourceid)) {
         $this->action = 'history.php?action=' . HISTORY_GRAPH . '&itemids[]=' . $resourceid . '&period=' . $this->timeline['period'] . '&stime=' . $this->timeline['stimeNow'] . $this->getProfileUrlParams();
     }
     if ($resourceid && $this->mode != SCREEN_MODE_EDIT) {
         if ($this->mode == SCREEN_MODE_PREVIEW) {
             $timeControlData['loadSBox'] = 1;
         }
     }
     $timeControlData['src'] = $resourceid ? 'chart.php?itemids[]=' . $resourceid . '&' . $this->screenitem['url'] . '&width=' . $this->screenitem['width'] . '&height=' . $this->screenitem['height'] : 'chart3.php?';
     $timeControlData['src'] .= $this->mode == SCREEN_MODE_EDIT ? '&period=3600&stime=' . date(TIMESTAMP_FORMAT, time()) : '&period=' . $this->timeline['period'] . '&stime=' . $this->timeline['stimeNow'];
     $timeControlData['src'] .= $this->getProfileUrlParams();
     // output
     if ($this->mode == SCREEN_MODE_JS) {
         return 'timeControl.addObject("' . $this->getDataId() . '", ' . CJs::encodeJson($this->timeline) . ', ' . CJs::encodeJson($timeControlData) . ')';
     } else {
         if ($this->mode == SCREEN_MODE_SLIDESHOW) {
             insert_js('timeControl.addObject("' . $this->getDataId() . '", ' . CJs::encodeJson($this->timeline) . ', ' . CJs::encodeJson($timeControlData) . ');');
         } else {
             zbx_add_post_js('timeControl.addObject("' . $this->getDataId() . '", ' . CJs::encodeJson($this->timeline) . ', ' . CJs::encodeJson($timeControlData) . ');');
         }
         if ($this->mode == SCREEN_MODE_EDIT || $this->mode == SCREEN_MODE_SLIDESHOW) {
             $item = new CDiv();
         } elseif ($this->mode == SCREEN_MODE_PREVIEW) {
             $item = new CLink(null, 'history.php?action=' . HISTORY_GRAPH . '&itemids[]=' . $resourceid . '&period=' . $this->timeline['period'] . '&stime=' . $this->timeline['stimeNow']);
         }
         $item->setAttribute('id', $containerid);
         return $this->getOutput($item);
     }
 }
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:49,代码来源:CScreenSimpleGraph.php


示例4: 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() . ']', '&laquo;' . 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();
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:43,代码来源:setup.inc.php


示例5: 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);
            if ($this->selectedTab === null) {
                $activeTab = get_cookie('tab', 0);
                $createEvent = '';
            } else {
                $activeTab = $this->selectedTab;
                $createEvent = 'create: function() { jQuery.cookie("tab", ' . $this->selectedTab . '); },';
            }
            $disabledTabs = $this->disabledTabs === null ? '' : 'disabled: ' . CJs::encodeJson($this->disabledTabs) . ',';
            zbx_add_post_js('
				jQuery("#' . $this->id . '").tabs({
					' . $createEvent . '
					' . $disabledTabs . '
					active: ' . $activeTab . ',
					activate: function(event, ui) {
						jQuery.cookie("tab", ui.newTab.index().toString());
					}
				})
				.css("visibility", "visible");');
        }
        return parent::toString($destroy);
    }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:42,代码来源:CTabView.php


示例6: createServiceConfigurationTree

/**
 * Creates nodes that can be used to display the service configuration tree using the CTree class.
 *
 * @see CTree
 *
 * @param array $services
 * @param array $parentService
 * @param array $service
 * @param array $dependency
 * @param array $tree
 */
function createServiceConfigurationTree(array $services, &$tree, array $parentService = array(), array $service = array(), array $dependency = array())
{
    if (!$service) {
        $caption = new CLink(_('root'), '#');
        $caption->setMenuPopup(CMenuPopupHelper::getServiceConfiguration(null, _('root'), false));
        $serviceNode = array('id' => 0, 'parentid' => 0, 'caption' => $caption, 'trigger' => array(), 'algorithm' => SPACE, 'description' => SPACE);
        $service = $serviceNode;
        $service['serviceid'] = 0;
        $service['dependencies'] = array();
        $service['trigger'] = array();
        // add all top level services as children of "root"
        foreach ($services as $topService) {
            if (!$topService['parent']) {
                $service['dependencies'][] = array('servicedownid' => $topService['serviceid'], 'soft' => 0, 'linkid' => 0);
            }
        }
        $tree = array($serviceNode);
    } else {
        // caption
        $caption = new CLink($service['name'], '#');
        // service is deletable only if it has no hard dependency
        $deletable = true;
        foreach ($service['dependencies'] as $dep) {
            if ($dep['soft'] == 0) {
                $deletable = false;
                break;
            }
        }
        $caption->setMenuPopup(CMenuPopupHelper::getServiceConfiguration($service['serviceid'], $service['name'], $deletable));
        $serviceNode = array('id' => $service['serviceid'], 'caption' => $caption, 'description' => $service['trigger'] ? $service['trigger']['description'] : '-', 'parentid' => $parentService ? $parentService['serviceid'] : 0, 'algorithm' => serviceAlgorythm($service['algorithm']));
    }
    if (!$dependency || !$dependency['soft']) {
        $tree[$serviceNode['id']] = $serviceNode;
        foreach ($service['dependencies'] as $dependency) {
            $childService = $services[$dependency['servicedownid']];
            createServiceConfigurationTree($services, $tree, $service, $childService, $dependency);
        }
    } else {
        $serviceNode['caption'] = new CSpan($serviceNode['caption'], 'service-caption-soft');
        $tree[$serviceNode['id'] . '.' . $dependency['linkid']] = $serviceNode;
    }
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:53,代码来源:services.inc.php


示例7: bodyToString

 function bodyToString($destroy = true)
 {
     $left = new CDiv(null, 'left');
     $left->addItem(new CDiv(null, 'setup_logo'));
     $left->addItem(new CDiv(ZABBIX_VERSION, 'setup_version'));
     $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') . ' >>');
     } 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);
     }
     $footer = new CDiv(array($cancel, new CDiv(array($this->getStep() != 0 ? new CSubmit('back[' . $this->getStep() . ']', '<< ' . _('Previous')) : null, $next), 'footer_right')), 'footer');
     $container->addItem($footer);
     return parent::bodyToString($destroy) . $container->ToString();
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:39,代码来源:setup.inc.php


示例8: CTextArea

 if ($hostInventoryTable['fields'][$inventoryInfo['db_field']]['type'] == DB::FIELD_TYPE_TEXT) {
     $input = new CTextArea('host_inventory[' . $inventoryInfo['db_field'] . ']', $host_inventory[$inventoryInfo['db_field']]);
     $input->addStyle('width: 64em;');
 } else {
     $fieldLength = $hostInventoryTable['fields'][$inventoryInfo['db_field']]['length'];
     $input = new CTextBox('host_inventory[' . $inventoryInfo['db_field'] . ']', $host_inventory[$inventoryInfo['db_field']]);
     $input->setAttribute('maxlength', $fieldLength);
     $input->addStyle('width: ' . ($fieldLength > 64 ? 64 : $fieldLength) . 'em;');
 }
 if ($inventory_mode == HOST_INVENTORY_DISABLED) {
     $input->setAttribute('disabled', 'disabled');
 }
 // link to populating item at the right side (if any)
 if (isset($hostItemsToInventory[$inventoryNo])) {
     $itemName = itemName($hostItemsToInventory[$inventoryNo]);
     $populatingLink = new CLink($itemName, 'items.php?form=update&itemid=' . $hostItemsToInventory[$inventoryNo]['itemid']);
     $populatingLink->setAttribute('title', _s('This field is automatically populated by item "%s".', $itemName));
     $populatingItemCell = array(' &larr; ', $populatingLink);
     $input->addClass('linked_to_item');
     // this will be used for disabling fields via jquery
     if ($inventory_mode == HOST_INVENTORY_AUTOMATIC) {
         $input->setAttribute('disabled', 'disabled');
     }
 } else {
     $populatingItemCell = '';
 }
 $input->addStyle('float: left;');
 $populatingItem = new CSpan($populatingItemCell, 'populating_item');
 if ($inventory_mode != HOST_INVENTORY_AUTOMATIC) {
     // those links are visible only in automatic mode
     $populatingItem->addStyle('display: none');
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.edit.php


示例9: CComboBox

     $deltaComboBox = new CComboBox('delta', $this->data['delta']);
     $deltaComboBox->addItems($deltaOptions);
 }
 $itemFormList->addRow(_('Store value'), $deltaComboBox, false, 'row_delta');
 // append valuemap to form list
 if ($this->data['limited']) {
     $itemForm->addVar('valuemapid', $this->data['valuemapid']);
     $valuemapComboBox = new CTextBox('valuemap_name', !empty($this->data['valuemaps']) ? $this->data['valuemaps'] : _('As is'), ZBX_TEXTBOX_SMALL_SIZE, 'yes');
 } else {
     $valuemapComboBox = new CComboBox('valuemapid', $this->data['valuemapid']);
     $valuemapComboBox->addItem(0, _('As is'));
     foreach ($this->data['valuemaps'] as $valuemap) {
         $valuemapComboBox->addItem($valuemap['valuemapid'], get_node_name_by_elid($valuemap['valuemapid'], null, NAME_DELIMITER) . CHtml::encode($valuemap['name']));
     }
 }
 $link = new CLink(_('show value mappings'), 'adm.valuemapping.php');
 $link->setAttribute('target', '_blank');
 $itemFormList->addRow(_('Show value'), array($valuemapComboBox, SPACE, $link), null, 'row_valuemap');
 $itemFormList->addRow(_('Allowed hosts'), new CTextBox('trapper_hosts', $this->data['trapper_hosts'], ZBX_TEXTBOX_STANDARD_SIZE), false, 'row_trapper_hosts');
 // append applications to form list
 $itemFormList->addRow(_('New application'), new CTextBox('new_application', $this->data['new_application'], ZBX_TEXTBOX_STANDARD_SIZE), false, null, 'new');
 $applicationComboBox = new CListBox('applications[]', $this->data['applications'], 6);
 $applicationComboBox->addItem(0, '-' . _('None') . '-');
 foreach ($this->data['db_applications'] as $application) {
     $applicationComboBox->addItem($application['applicationid'], CHtml::encode($application['name']));
 }
 $itemFormList->addRow(_('Applications'), $applicationComboBox);
 // append populate host to form list
 if (empty($this->data['parent_discoveryid'])) {
     $itemCloned = isset($_REQUEST['clone']);
     $hostInventoryFieldComboBox = new CComboBox('inventory_link');
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:configuration.item.edit.php


示例10: getEventAckState

/**
 * Create element with event acknowledges info.
 * If $event has subarray 'acknowledges', returned link will have hint with acknowledges.
 *
 * @param array			$event   event data
 * @param int			$event['acknowledged']
 * @param int			$event['eventid']
 * @param int			$event['objectid']
 * @param array			$event['acknowledges']
 * @param bool|string	$backUrl if true, add backurl param to link with current page file name
 * @param bool			$isLink  if true, return link otherwise span
 * @param array			$params  additional params for link
 *
 * @return array|CLink|CSpan|null|string
 */
function getEventAckState($event, $backUrl = false, $isLink = true, $params = array())
{
    $config = select_config();
    if (!$config['event_ack_enable']) {
        return null;
    }
    if ($isLink) {
        if (!empty($backUrl)) {
            if (is_bool($backUrl)) {
                global $page;
                $backurl = '&backurl=' . $page['file'];
            } else {
                $backurl = '&backurl=' . $backUrl;
            }
        } else {
            $backurl = '';
        }
        $additionalParams = '';
        foreach ($params as $key => $value) {
            $additionalParams .= '&' . $key . '=' . $value;
        }
        if ($event['acknowledged'] == 0) {
            $ack = new CLink(_('No'), 'acknow.php?eventid=' . $event['eventid'] . '&triggerid=' . $event['objectid'] . $backurl . $additionalParams, 'disabled');
        } else {
            $ackLink = new CLink(_('Yes'), 'acknow.php?eventid=' . $event['eventid'] . '&triggerid=' . $event['objectid'] . $backurl . $additionalParams, 'enabled');
            if (is_array($event['acknowledges'])) {
                $ackLinkHints = makeAckTab($event);
                if (!empty($ackLinkHints)) {
                    $ackLink->setHint($ackLinkHints, '', '', false);
                }
                $ack = array($ackLink, ' (' . count($event['acknowledges']) . ')');
            } else {
                $ack = array($ackLink, ' (' . $event['acknowledges'] . ')');
            }
        }
    } else {
        if ($event['acknowledged'] == 0) {
            $ack = new CSpan(_('No'), 'on');
        } else {
            $ack = array(new CSpan(_('Yes'), 'off'), ' (' . (is_array($event['acknowledges']) ? count($event['acknowledges']) : $event['acknowledges']) . ')');
        }
    }
    return $ack;
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:59,代码来源:events.inc.php


示例11: testDeleteLink

 /**
  * Tests the delete of a link
  */
 public function testDeleteLink()
 {
     global $AppUI;
     $this->obj->bind($this->post_data);
     $result = $this->obj->store($AppUI);
     $this->assertTrue($result);
     $original_id = $this->obj->link_id;
     $result = $this->obj->delete($AppUI);
     $this->assertTrue($result);
     $link = new CLink();
     $link->load($original_id);
     $this->assertEquals('', $link->link_name);
     $this->assertEquals('', $link->link_url);
 }
开发者ID:eureka2,项目名称:web2project,代码行数:17,代码来源:links.test.php


示例12: CNumericBox

$sysmapList->addRow(_('Width'), new CNumericBox('width', $this->data['sysmap']['width'], 5));
$sysmapList->addRow(_('Height'), new CNumericBox('height', $this->data['sysmap']['height'], 5));
// append background image to form list
$imageComboBox = new CComboBox('backgroundid', $this->data['sysmap']['backgroundid']);
$imageComboBox->addItem(0, _('No image'));
foreach ($this->data['images'] as $image) {
    $imageComboBox->addItem($image['imageid'], $image['name']);
}
$sysmapList->addRow(_('Background image'), $imageComboBox);
// append iconmapping to form list
$iconMappingComboBox = new CComboBox('iconmapid', $this->data['sysmap']['iconmapid']);
$iconMappingComboBox->addItem(0, _('<manual>'));
foreach ($this->data['iconMaps'] as $iconMap) {
    $iconMappingComboBox->addItem($iconMap['iconmapid'], $iconMap['name']);
}
$iconMappingsLink = new CLink(_('show icon mappings'), 'adm.iconmapping.php');
$iconMappingsLink->setAttribute('target', '_blank');
$sysmapList->addRow(_('Automatic icon mapping'), array($iconMappingComboBox, SPACE, $iconMappingsLink));
// append multiple checkboxes to form list
$sysmapList->addRow(_('Icon highlight'), new CCheckBox('highlight', $this->data['sysmap']['highlight'], null, 1));
$sysmapList->addRow(_('Mark elements on trigger status change'), new CCheckBox('markelements', $this->data['sysmap']['markelements'], null, 1));
$sysmapList->addRow(_('Expand single problem'), new CCheckBox('expandproblem', $this->data['sysmap']['expandproblem'], null, 1));
$sysmapList->addRow(_('Advanced labels'), new CCheckBox('label_format', $this->data['sysmap']['label_format'], null, 1));
// append hostgroup to form list
$labelTypeHostgroupComboBox = new CComboBox('label_type_hostgroup', $this->data['sysmap']['label_type_hostgroup'], null, $this->data['labelTypesLimited']);
$customLabelHostgroupTextArea = new CTextArea('label_string_hostgroup', $this->data['sysmap']['label_string_hostgroup']);
if ($this->data['sysmap']['label_type_hostgroup'] != MAP_LABEL_TYPE_CUSTOM) {
    $customLabelHostgroupTextArea->addClass('hidden');
}
$sysmapList->addRow(_('Host group label type'), array($labelTypeHostgroupComboBox, BR(), $customLabelHostgroupTextArea));
// append host to form list
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.sysmap.edit.php


示例13: CNumericBox

$userFormList->addRow(_('Refresh (in seconds)'), new CNumericBox('refresh', $this->data['refresh'], 4));
$userFormList->addRow(_('Rows per page'), new CNumericBox('rows_per_page', $this->data['rows_per_page'], 6));
$userFormList->addRow(_('URL (after login)'), new CTextBox('url', $this->data['url'], ZBX_TEXTBOX_STANDARD_SIZE));
/*
 * Media tab
 */
if (uint_in_array(CWebUser::$data['type'], array(USER_TYPE_ZABBIX_ADMIN, USER_TYPE_SUPER_ADMIN))) {
    $userMediaFormList = new CFormList('userMediaFormList');
    $userForm->addVar('user_medias', $this->data['user_medias']);
    $mediaTableInfo = new CTableInfo(_('No media found.'));
    foreach ($this->data['user_medias'] as $id => $media) {
        if (!isset($media['active']) || !$media['active']) {
            $status = new CLink(_('Enabled'), '#', 'enabled');
            $status->onClick('return create_var("' . $userForm->getName() . '","disable_media",' . $id . ', true);');
        } else {
            $status = new CLink(_('Disabled'), '#', 'disabled');
            $status->onClick('return create_var("' . $userForm->getName() . '","enable_media",' . $id . ', true);');
        }
        $mediaUrl = '?dstfrm=' . $userForm->getName() . '&media=' . $id . '&mediatypeid=' . $media['mediatypeid'] . '&sendto=' . urlencode($media['sendto']) . '&period=' . $media['period'] . '&severity=' . $media['severity'] . '&active=' . $media['active'];
        foreach (getSeverityCaption() as $key => $caption) {
            $mediaActive = $media['severity'] & 1 << $key;
            $mediaSeverity[$key] = new CSpan(mb_substr($caption, 0, 1), $mediaActive ? 'enabled' : null);
            $mediaSeverity[$key]->setHint($caption . ($mediaActive ? ' (on)' : ' (off)'));
        }
        $mediaTableInfo->addRow(array(new CCheckBox('user_medias_to_del[' . $id . ']', null, null, $id), new CSpan($media['description'], 'nowrap'), new CSpan($media['sendto'], 'nowrap'), new CSpan($media['period'], 'nowrap'), $mediaSeverity, $status, new CButton('edit_media', _('Edit'), 'return PopUp("popup_media.php' . $mediaUrl . '", 550, 400);', 'link_menu')));
    }
    $userMediaFormList->addRow(_('Media'), array($mediaTableInfo, new CButton('add_media', _('Add'), 'return PopUp("popup_media.php?dstfrm=' . $userForm->getName() . '", 550, 400);', 'link_menu'), SPACE, SPACE, count($this->data['user_medias']) > 0 ? new CSubmit('del_user_media', _('Delete selected'), null, 'link_menu') : null));
}
/*
 * Profile fields
 */
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:administration.users.edit.php


示例14: make_favorite_maps

function make_favorite_maps()
{
    $favList = new CList(null, 'favorites', _('No maps added.'));
    $fav_sysmaps = CFavorite::get('web.favorite.sysmapids');
    if (!$fav_sysmaps) {
        return $favList;
    }
    $sysmapids = array();
    foreach ($fav_sysmaps as $favorite) {
        $sysmapids[$favorite['value']] = $favorite['value'];
    }
    $sysmaps = API::Map()->get(array('sysmapids' => $sysmapids, 'output' => array('sysmapid', 'name')));
    foreach ($sysmaps as $sysmap) {
        $sysmapid = $sysmap['sysmapid'];
        $link = new CLink(get_node_name_by_elid($sysmapid, null, NAME_DELIMITER) . $sysmap['name'], 'maps.php?sysmapid=' . $sysmapid);
        $link->setTarget('blank');
        $favList->addItem($link, 'nowrap');
    }
    return $favList;
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:20,代码来源:blocks.inc.php


示例15: dirname

**
** 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 dirname(__FILE__) . '/js/configuration.services.child.list.js.php';
$servicesChildWidget = new CWidget();
$servicesChildWidget->addPageHeader(_('IT service dependencies'));
// create form
$servicesChildForm = new CForm();
$servicesChildForm->setName('servicesForm');
if (!empty($this->data['service'])) {
    $servicesChildForm->addVar('serviceid', $this->data['service']['serviceid']);
}
// create table
$servicesChildTable = new CTableInfo(_('No IT services found.'));
$servicesChildTable->setHeader(array(new CCheckBox('all_services', null, "javascript: checkAll('" . $servicesChildForm->getName() . "', 'all_services', 'services');"), _('Service'), _('Status calculation'), _('Trigger')));
$prefix = null;
foreach ($this->data['db_cservices'] as $service) {
    $description = new CLink($service['name'], '#', 'service-name');
    $description->setAttributes(array('id' => 'service-name-' . $service['serviceid'], 'data-name' => $service['name'], 'data-serviceid' => $service['serviceid'], 'data-trigger' => $service['trigger']));
    $cb = new CCheckBox('services[' . $service['serviceid'] . ']', null, null, $service['serviceid']);
    $cb->addClass('service-select');
    $servicesChildTable->addRow(array($cb, array($prefix, $description), serviceAlgorythm($service['algorithm']), $service['trigger']));
}
$servicesChildTable->setFooter(new CCol(new CButton('select', _('Select')), 'right'));
// append table to form
$servicesChildForm->addItem($servicesChildTable);
// append form to widget
$servicesChildWidget->addItem($servicesChildForm);
return $servicesChildWidget;
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.services.child.list.php


示例16: _

        $templateList->addRow(_('Web scenarios'), $listBox);
    }
}
$divTabs->addTab('templateTab', _('Template'), $templateList);
// FULL CLONE }
// } TEMPLATE WIDGET
// TEMPLATES{
$tmplList = new CFormList('tmpllist');
// create linked template table
$linkedTemplateTable = new CTable(_('No templates linked.'), 'formElementTable');
$linkedTemplateTable->attr('id', 'linkedTemplateTable');
$linkedTemplateTable->setHeader(array(_('Name'), _('Action')));
$ignoredTemplates = array();
foreach ($this->data['linkedTemplates'] as $template) {
    $tmplList->addVar('templates[]', $template['templateid']);
    $templateLink = new CLink($template['name'], 'templates.php?form=update&templateid=' . $template['templateid']);
    $templateLink->setTarget('_blank');
    $linkedTemplateTable->addRow(array($templateLink, array(new CSubmit('unlink[' . $template['templateid'] . ']', _('Unlink'), null, 'link_menu'), SPACE, SPACE, isset($this->data['original_templates'][$template['templateid']]) ? new CSubmit('unlink_and_clear[' . $template['templateid'] . ']', _('Unlink and clear'), null, 'link_menu') : SPACE)), null, 'conditions_' . $template['templateid']);
    $ignoredTemplates[$template['templateid']] = $template['name'];
}
$tmplList->addRow(_('Linked templates'), new CDiv($linkedTemplateTable, 'template-link-block objectgroup inlineblock border_dotted ui-corner-all'));
// create new linked template table
$newTemplateTable = new CTable(null, 'formElementTable');
$newTemplateTable->attr('id', 'newTemplateTable');
$newTemplateTable->attr('style', 'min-width: 400px;');
$newTemplateTable->addRow(array(new CMultiSelect(array('name' => 'add_templates[]', 'objectName' => 'templates', 'ignored' => $ignoredTemplates, 'popup' => array('parameters' => 'srctbl=templates&srcfld1=hostid&srcfld2=host&dstfrm=' . $frmHost->getName() . '&dstfld1=add_templates_&templated_hosts=1&multiselect=1', 'width' => 450, 'height' => 450)))));
$newTemplateTable->addRow(array(new CSubmit('add_template', _('Add'), null, 'link_menu')));
$tmplList->addRow(_('Link new templates'), new CDiv($newTemplateTable, 'template-link-block objectgroup inlineblock border_dotted ui-corner-all'));
$divTabs->addTab('tmplTab', _('Linked templates'), $tmplList);
// } TEMPLATES
// macros
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:configuration.template.edit.php


示例17: make_latest_issues

function make_latest_issues($params = array())
{
    global $USER_DETAILS;
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY);
    $available_triggers = get_accessible_triggers(PERM_READ_ONLY, array());
    $scripts_by_hosts = get_accessible_scripts_by_hosts($available_hosts);
    $config = select_config();
    $sql_select = '';
    $sql_from = '';
    $sql_where = '';
    $limit = 20;
    if (!empty($params)) {
        if (isset($params['limit'])) {
            $limit = $params['limit'];
        }
        if (isset($params['groupid']) && $params['groupid'] > 0) {
            $sql_select .= ',g.name ';
            $sql_from .= ',groups g ';
            $sql_where .= ' AND g.groupid=hg.groupid ' . ' AND hg.groupid=' . $params['groupid'];
        }
        if (isset($params['hostid']) && $params['hostid'] > 0) {
            $sql_where .= ' AND h.hostid=' . $params['hostid'];
        }
    }
    $table = new CTableInfo();
    $table->setHeader(array(is_show_all_nodes() ? S_NODE : null, isset($params['groupid']) && $params['groupid'] > 0 ? S_GROUP : null, S_HOST, S_ISSUE, S_LAST_CHANGE, S_AGE, $config['event_ack_enable'] ? S_ACK : NULL, S_ACTIONS));
    $sql = 'SELECT DISTINCT t.triggerid,t.status,t.description,t.expression,t.priority,t.lastchange,t.value,h.host,h.hostid ' . $sql_select . ' FROM triggers t,hosts h,items i,functions f,hosts_groups hg ' . $sql_from . ' WHERE f.itemid=i.itemid ' . ' AND h.hostid=i.hostid ' . ' AND hg.hostid=h.hostid ' . ' AND t.triggerid=f.triggerid ' . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND ' . DBcondition('t.triggerid', $available_triggers) . ' AND h.status=' . HOST_STATUS_MONITORED . ' AND t.value=' . TRIGGER_VALUE_TRUE . $sql_where . ' ORDER BY t.lastchange DESC';
    $result = DBselect($sql, $limit);
    while ($row = DBfetch($result)) {
        // Check for dependencies
        if (trigger_dependent($row["triggerid"])) {
            continue;
        }
        $host = null;
        $menus = '';
        $host_nodeid = id2nodeid($row['hostid']);
        foreach ($scripts_by_hosts[$row['hostid']] as $id => $script) {
            $script_nodeid = id2nodeid($script['scriptid']);
            if (bccomp($host_nodeid, $script_nodeid) == 0) {
                $menus .= "['" . $script['name'] . "',\"javascript: openWinCentered('scripts_exec.php?execute=1&hostid=" . $row['hostid'] . "&scriptid=" . $script['scriptid'] . "','" . S_TOOLS . "',760,540,'titlebar=no, resizable=yes, scrollbars=yes, dialog=no');\", null,{'outer' : ['pum_o_item'],'inner' : ['pum_i_item']}],";
            }
        }
        $menus .= "[" . zbx_jsvalue(S_LINKS) . ",null,null,{'outer' : ['pum_oheader'],'inner' : ['pum_iheader']}],";
        $menus .= "['" . S_LATEST_DATA . "',\"javascript: redirect('latest.php?groupid=0&hostid=" . $row['hostid'] . "')\", null,{'outer' : ['pum_o_item'],'inner' : ['pum_i_item']}],";
        $menus = rtrim($menus, ',');
        $menus = "show_popup_menu(event,[[" . zbx_jsvalue(S_TOOLS) . ",null,null,{'outer' : ['pum_oheader'],'inner' : ['pum_iheader']}]," . $menus . "],180);";
        $host = new CSpan($row['host'], 'link');
        $host->setAttribute('onclick', 'javascript: ' . $menus);
        $host->setAttribute('onmouseover', "javascript: this.style.cursor = 'pointer';");
        $event_sql = 'SELECT DISTINCT e.eventid, e.value, e.clock, e.objectid as triggerid, e.acknowledged, t.type, t.url ' . ' FROM events e, triggers t ' . ' WHERE e.object=' . EVENT_SOURCE_TRIGGERS . ' AND e.objectid=' . $row['triggerid'] . ' AND t.triggerid=e.objectid ' . ' AND e.value=' . TRIGGER_VALUE_TRUE . ' ORDER by e.object DESC, e.objectid DESC, e.eventid DESC';
        $res_events = DBSelect($event_sql, 1);
        while ($row_event = DBfetch($res_events)) {
            $ack = NULL;
            if ($config['event_ack_enable']) {
                if ($row_event['acknowledged'] == 1) {
                    $ack_info = make_acktab_by_eventid($row_event['eventid']);
                    $ack_info->setAttribute('style', 'width: auto;');
                    $ack = new CLink(S_YES, 'acknow.php?eventid=' . $row_event['eventid'], 'action');
                    $ack->setHint($ack_info);
                } else {
                    $ack = new CLink(S_NO, 'acknow.php?eventid=' . $row_event['eventid'], 'on');
                }
            }
            //			$description = expand_trigger_description($row['triggerid']);
            $description = expand_trigger_description_by_data(array_merge($row, array('clock' => $row_event['clock'])), ZBX_FLAG_EVENT);
            //actions
            $actions = get_event_actions_stat_hints($row_event['eventid']);
            $clock = new CLink(zbx_date2str(S_DATE_FORMAT_YMDHMS, $row_event['clock']), 'events.php?triggerid=' . $row['triggerid'] . '&source=0&show_unknown=1&nav_time=' . $row_event['clock'], 'action');
            if ($row_event['url']) {
                $description = new CLink($description, $row_event['url'], 'action', null, true);
            } else {
                $description = new CSpan($description, 'pointer');
            }
            $description = new CCol($description, get_severity_style($row["priority"]));
            $description->setHint(make_popup_eventlist($row_event['eventid'], $row['type']));
            $table->addRow(array(get_node_name_by_elid($row['triggerid']), $host, $description, $clock, zbx_date2age($row_event['clock']), $ack, $actions));
        }
        unset($row, $description, $actions, $alerts, $hint);
    }
    $table->setFooter(new CCol(S_UPDATED . ': ' . date("H:i:s", time())));
    return $table;
}
开发者ID:phedders,项目名称:zabbix,代码行数:82,代码来源:blocks.inc.php


示例18: CTitleBlock

$m = 'links';
if ($canEdit) {
    $titleBlock = new CTitleBlock('', '', $m, "{$m}.{$a}");
    $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new link') . '">', '', '<form action="?m=links&a=addedit&project_id=' . $project_id . '&task_id=' . $task_id . '" method="post" accept-charset="utf-8">', '</form>');
    $titleBlock->show() 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CList类代码示例发布时间:2022-05-23
下一篇:
PHP CLightHTMLEditor类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap