当前位置: 首页>>代码示例>>PHP>>正文


PHP CList类代码示例

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


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

示例1: 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

示例2: createChain

 /**
  * Creates and returns calculation rules chain.
  * 
  * @return CList calculation rules chain
  */
 protected function createChain()
 {
     if (!isset($this->_rules)) {
         $chain = $this->chain();
         $this->_rules = new CList();
         foreach ($chain as $item) {
             $rule = $this->createChainRule($item);
             $this->_rules->add($rule);
         }
     }
     return $this->_rules;
 }
开发者ID:hansenmakangiras,项目名称:disperindag,代码行数:17,代码来源:RatingModelChain.php

示例3: addValidators

 protected function addValidators()
 {
     $validators = new CList();
     foreach ($this->rules() as $rule) {
         if (isset($rule[0], $rule[1])) {
             $validator = CValidator::createValidator($rule[1], $this->_model, $rule[0], array_slice($rule, 2));
             $validators->add($validator);
         } else {
             throw new CException(Yii::t('yii', '{class} has an invalid validation rule. The rule must specify attributes to be validated and the validator name.', array('{class}' => get_class($this))));
         }
     }
     return $validators;
 }
开发者ID:hit-shappens,项目名称:testapp,代码行数:13,代码来源:ExtendedARBehavior.php

示例4: getList

 /**
  * @param bool $id = false
  * @return CList|int
  */
 public function getList($id = false)
 {
     if ($id === true) {
         return $this->list->getStringId();
     }
     return $this->list;
 }
开发者ID:evodelavega,项目名称:activecampaign-api-php,代码行数:11,代码来源:Filter.php

示例5: findRecursive

 public static function findRecursive($dir, $filters = NULL, $depth = -1, $limit = 0)
 {
     if (!$filters instanceof EFileFilters) {
         $filters = new EFileFilters($filters);
     }
     $list = new CList();
     //TODO: $dir = new DirectoryIterator(dirname(__FILE__)); foreach ($dir as $fileinfo) {}
     $handle = opendir($dir);
     while (($fileName = readdir($handle)) !== FALSE) {
         if ($limit > 0 && $list->count >= $limit) {
             break;
         }
         if ($fileName === '.' || $fileName === '..') {
             continue;
         }
         $file = EFile::getInstance($dir . DIRECTORY_SEPARATOR . $fileName);
         //TODO: подумать о сортировке прямо в цикле поиска
         if ($filters->run($file)) {
             if ($file->isDir && $depth) {
                 $list->mergeWith(self::findRecursive($file->path, $filters, $depth - 1, $limit - $list->count));
             } else {
                 $list->add($file);
             }
         }
     }
     closedir($handle);
     return $list;
 }
开发者ID:sinelnikof,项目名称:yiiext,代码行数:28,代码来源:EFile.php

示例6: createValidators

 public function createValidators()
 {
     $validators = new CList();
     $rules = $this->rules();
     if ($this->addDefaultRules) {
         $rules = array_merge($rules, $this->defaultRules());
     }
     foreach ($rules as $rule) {
         if (isset($rule[0], $rule[1])) {
             // attributes, validator name
             $validators->add(CValidator::createValidator($rule[1], $this, $rule[0], array_slice($rule, 2)));
         } else {
             throw new CException(Yii::t('yii', '{class} has an invalid validation rule. The rule must specify attributes to be validated and the validator name.', array('{class}' => get_class($this))));
         }
     }
     return $validators;
 }
开发者ID:teknosuper,项目名称:YiiValidateRelation,代码行数:17,代码来源:YiiFormModel.php

示例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);
            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

示例8: __construct

 /**
  * @param string $options['name']
  * @param int    $options['value']		(optional) Default: TRIGGER_SEVERITY_NOT_CLASSIFIED
  * @param bool   $options['all']		(optional)
  */
 public function __construct(array $options = [])
 {
     parent::__construct();
     $id = zbx_formatDomId($options['name']);
     $this->addClass(ZBX_STYLE_RADIO_SEGMENTED);
     $this->setId($id);
     if (!array_key_exists('value', $options)) {
         $options['value'] = TRIGGER_SEVERITY_NOT_CLASSIFIED;
     }
     $severity_from = array_key_exists('all', $options) && $options['all'] ? -1 : TRIGGER_SEVERITY_NOT_CLASSIFIED;
     $config = select_config();
     for ($severity = $severity_from; $severity < TRIGGER_SEVERITY_COUNT; $severity++) {
         $name = $severity == -1 ? _('all') : getSeverityName($severity, $config);
         $class = $severity == -1 ? null : getSeverityStyle($severity);
         $radio = (new CInput('radio', $options['name'], $severity))->setId(zbx_formatDomId($options['name'] . '_' . $severity));
         if ($severity === $options['value']) {
             $radio->setAttribute('checked', 'checked');
         }
         parent::addItem((new CListItem([$radio, new CLabel($name, $options['name'] . '_' . $severity)]))->addClass($class));
     }
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:26,代码来源:CSeverity.php

示例9: createValueValidatorsByRules

 /**
  * @param array $rules
  * @return CList
  * @throws CException
  */
 private function createValueValidatorsByRules(array $rules)
 {
     $validators = new CList();
     foreach ($rules as $rule) {
         if (isset($rule[0], $rule[1])) {
             if ($rule[1] != 'unique') {
                 $validators->add(CValidator::createValidator($rule[1], $this, $rule[0], array_slice($rule, 2)));
             }
         } else {
             throw new CException(Zurmo::t('ReportsModule', '{class} has an invalid validation rule. The rule must specify ' . 'attributes to be validated and the validator name.', array('{class}' => get_class($this))));
         }
     }
     return $validators;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:19,代码来源:FilterForReportForm.php

示例10: show_messages

function show_messages($bool = true, $okmsg = null, $errmsg = null)
{
    global $page, $ZBX_MESSAGES;
    if (!defined('PAGE_HEADER_LOADED')) {
        return null;
    }
    if (defined('ZBX_API_REQUEST')) {
        return null;
    }
    if (!isset($page['type'])) {
        $page['type'] = PAGE_TYPE_HTML;
    }
    $imageMessages = array();
    if (!$bool && !is_null($errmsg)) {
        $msg = _('ERROR') . ': ' . $errmsg;
    } elseif ($bool && !is_null($okmsg)) {
        $msg = $okmsg;
    }
    if (isset($msg)) {
        switch ($page['type']) {
            case PAGE_TYPE_IMAGE:
                // save all of the messages in an array to display them later in an image
                $imageMessages[] = array('text' => $msg, 'color' => !$bool ? array('R' => 255, 'G' => 0, 'B' => 0) : array('R' => 34, 'G' => 51, 'B' => 68));
                break;
            case PAGE_TYPE_XML:
                echo htmlspecialchars($msg) . "\n";
                break;
            case PAGE_TYPE_HTML:
            default:
                $msg_tab = new CTable($msg, $bool ? 'msgok' : 'msgerr');
                $msg_tab->setCellPadding(0);
                $msg_tab->setCellSpacing(0);
                $row = array();
                $msg_col = new CCol(bold($msg), 'msg_main msg');
                $msg_col->setAttribute('id', 'page_msg');
                $row[] = $msg_col;
                if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
                    $msg_details = new CDiv(_('Details'), 'blacklink');
                    $msg_details->setAttribute('onclick', 'javascript: showHide("msg_messages", IE ? "block" : "table");');
                    $msg_details->setAttribute('title', _('Maximize') . '/' . _('Minimize'));
                    array_unshift($row, new CCol($msg_details, 'clr'));
                }
                $msg_tab->addRow($row);
                $msg_tab->show();
                break;
        }
    }
    if (isset($ZBX_MESSAGES) && !empty($ZBX_MESSAGES)) {
        if ($page['type'] == PAGE_TYPE_IMAGE) {
            foreach ($ZBX_MESSAGES as $msg) {
                // save all of the messages in an array to display them later in an image
                if ($msg['type'] == 'error') {
                    $imageMessages[] = array('text' => $msg['message'], 'color' => array('R' => 255, 'G' => 55, 'B' => 55));
                } else {
                    $imageMessages[] = array('text' => $msg['message'], 'color' => array('R' => 155, 'G' => 155, 'B' => 55));
                }
            }
        } elseif ($page['type'] == PAGE_TYPE_XML) {
            foreach ($ZBX_MESSAGES as $msg) {
                echo '[' . $msg['type'] . '] ' . $msg['message'] . "\n";
            }
        } else {
            $lst_error = new CList(null, 'messages');
            foreach ($ZBX_MESSAGES as $msg) {
                $lst_error->addItem($msg['message'], $msg['type']);
                $bool = $bool && 'error' !== strtolower($msg['type']);
            }
            $msg_show = 6;
            $msg_count = count($ZBX_MESSAGES);
            if ($msg_count > $msg_show) {
                $msg_count = $msg_show * 16;
                $lst_error->setAttribute('style', 'height: ' . $msg_count . 'px;');
            }
            $tab = new CTable(null, $bool ? 'msgok' : 'msgerr');
            $tab->setCellPadding(0);
            $tab->setCellSpacing(0);
            $tab->setAttribute('id', 'msg_messages');
            $tab->setAttribute('style', 'width: 100%;');
            if (isset($msg_tab) && $bool) {
                $tab->setAttribute('style', 'display: none;');
            }
            $tab->addRow(new CCol($lst_error, 'msg'));
            $tab->show();
        }
        $ZBX_MESSAGES = null;
    }
    // draw an image with the messages
    if ($page['type'] == PAGE_TYPE_IMAGE && count($imageMessages) > 0) {
        $imageFontSize = 8;
        // calculate the size of the text
        $imageWidth = 0;
        $imageHeight = 0;
        foreach ($imageMessages as &$msg) {
            $size = imageTextSize($imageFontSize, 0, $msg['text']);
            $msg['height'] = $size['height'] - $size['baseline'];
            // calculate the total size of the image
            $imageWidth = max($imageWidth, $size['width']);
            $imageHeight += $size['height'] + 1;
        }
        unset($msg);
//.........这里部分代码省略.........
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:101,代码来源:func.inc.php

示例11: AddDocumentField

 public function AddDocumentField($documentType, $fields)
 {
     $iblockId = intval(substr($documentType, strlen("iblock_")));
     if ($iblockId <= 0) {
         throw new CBPArgumentOutOfRangeException("documentType", $documentType);
     }
     if (substr($fields["code"], 0, strlen("PROPERTY_")) == "PROPERTY_") {
         $fields["code"] = substr($fields["code"], strlen("PROPERTY_"));
     }
     $fieldsTemporary = array("NAME" => $fields["name"], "ACTIVE" => "Y", "SORT" => $fields["sort"] ? $fields["sort"] : 900, "CODE" => $fields["code"], 'MULTIPLE' => $fields['multiple'] == 'Y' || (string) $fields['multiple'] === '1' ? 'Y' : 'N', 'IS_REQUIRED' => $fields['required'] == 'Y' || (string) $fields['required'] === '1' ? 'Y' : 'N', "IBLOCK_ID" => $iblockId, "FILTRABLE" => "Y", "SETTINGS" => $fields["settings"] ? $fields["settings"] : array("SHOW_ADD_FORM" => 'Y', "SHOW_EDIT_FORM" => 'Y'), "DEFAULT_VALUE" => $fields['DefaultValue']);
     if (strpos("0123456789", substr($fieldsTemporary["CODE"], 0, 1)) !== false) {
         $fieldsTemporary["CODE"] = self::generateMnemonicCode($fieldsTemporary["CODE"]);
     }
     if (array_key_exists("additional_type_info", $fields)) {
         $fieldsTemporary["LINK_IBLOCK_ID"] = intval($fields["additional_type_info"]);
     }
     if (strstr($fields["type"], ":") !== false) {
         list($fieldsTemporary["TYPE"], $fieldsTemporary["USER_TYPE"]) = explode(":", $fields["type"], 2);
         if ($fields["type"] == "E:EList") {
             $fieldsTemporary["LINK_IBLOCK_ID"] = $fields["options"];
         }
     } elseif ($fields["type"] == "user") {
         $fieldsTemporary["TYPE"] = "S:employee";
         $fieldsTemporary["USER_TYPE"] = "UserID";
     } elseif ($fields["type"] == "date") {
         $fieldsTemporary["TYPE"] = "S:Date";
         $fieldsTemporary["USER_TYPE"] = "Date";
     } elseif ($fields["type"] == "datetime") {
         $fieldsTemporary["TYPE"] = "S:DateTime";
         $fieldsTemporary["USER_TYPE"] = "DateTime";
     } elseif ($fields["type"] == "file") {
         $fieldsTemporary["TYPE"] = "F";
         $fieldsTemporary["USER_TYPE"] = "";
     } elseif ($fields["type"] == "select") {
         $fieldsTemporary["TYPE"] = "L";
         $fieldsTemporary["USER_TYPE"] = false;
         if (is_array($fields["options"])) {
             $i = 10;
             foreach ($fields["options"] as $k => $v) {
                 $def = "N";
                 if ($fields['DefaultValue'] == $v) {
                     $def = "Y";
                 }
                 $fieldsTemporary["VALUES"][] = array("XML_ID" => $k, "VALUE" => $v, "DEF" => $def, "SORT" => $i);
                 $i = $i + 10;
             }
         } elseif (is_string($fields["options"]) && strlen($fields["options"]) > 0) {
             $a = explode("\n", $fields["options"]);
             $i = 10;
             foreach ($a as $v) {
                 $v = trim(trim($v), "\r\n");
                 if (!$v) {
                     continue;
                 }
                 $v1 = $v2 = $v;
                 if (substr($v, 0, 1) == "[" && strpos($v, "]") !== false) {
                     $v1 = substr($v, 1, strpos($v, "]") - 1);
                     $v2 = trim(substr($v, strpos($v, "]") + 1));
                 }
                 $def = "N";
                 if ($fields['DefaultValue'] == $v2) {
                     $def = "Y";
                 }
                 $fieldsTemporary["VALUES"][] = array("XML_ID" => $v1, "VALUE" => $v2, "DEF" => $def, "SORT" => $i);
                 $i = $i + 10;
             }
         }
     } elseif ($fields["type"] == "string") {
         $fieldsTemporary["TYPE"] = "S";
         if ($fields["row_count"] && $fields["col_count"]) {
             $fieldsTemporary["ROW_COUNT"] = $fields["row_count"];
             $fieldsTemporary["COL_COUNT"] = $fields["col_count"];
         } else {
             $fieldsTemporary["ROW_COUNT"] = 1;
             $fieldsTemporary["COL_COUNT"] = 30;
         }
     } elseif ($fields["type"] == "text") {
         $fieldsTemporary["TYPE"] = "S";
         if ($fields["row_count"] && $fields["col_count"]) {
             $fieldsTemporary["ROW_COUNT"] = $fields["row_count"];
             $fieldsTemporary["COL_COUNT"] = $fields["col_count"];
         } else {
             $fieldsTemporary["ROW_COUNT"] = 4;
             $fieldsTemporary["COL_COUNT"] = 30;
         }
     } elseif ($fields["type"] == "int" || $fields["type"] == "double") {
         $fieldsTemporary["TYPE"] = "N";
     } elseif ($fields["type"] == "bool") {
         $fieldsTemporary["TYPE"] = "L";
         $fieldsTemporary["VALUES"][] = array("XML_ID" => 'yes', "VALUE" => GetMessage("BPVDX_YES"), "DEF" => "N", "SORT" => 10);
         $fieldsTemporary["VALUES"][] = array("XML_ID" => 'no', "VALUE" => GetMessage("BPVDX_NO"), "DEF" => "N", "SORT" => 20);
     } else {
         $fieldsTemporary["TYPE"] = $fields["type"];
         $fieldsTemporary["USER_TYPE"] = false;
     }
     $idField = false;
     $properties = CIBlockProperty::getList(array(), array("IBLOCK_ID" => $fieldsTemporary["IBLOCK_ID"], "CODE" => $fieldsTemporary["CODE"]));
     if (!$properties->fetch()) {
         $listObject = new CList($iblockId);
         $idField = $listObject->addField($fieldsTemporary);
//.........这里部分代码省略.........
开发者ID:Satariall,项目名称:izurit,代码行数:101,代码来源:bizprocdocument.php

示例12: CWidget

**
** 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.
**/
$this->addJSfile('js/class.pmaster.js');
$dashboard = (new CWidget())->setTitle(_('Dashboard'))->setControls((new CForm())->cleanItems()->addItem((new CList())->addItem(get_icon('dashconf', ['enabled' => $data['filter_enabled']]))->addItem(get_icon('fullscreen', ['fullscreen' => $data['fullscreen']]))));
/*
 * Dashboard grid
 */
$dashboardGrid = [[], [], []];
$widgetRefreshParams = [];
$widgets = [WIDGET_FAVOURITE_GRAPHS => ['id' => 'favouriteGraphs', 'menu_popup' => ['CMenuPopupHelper', 'getFavouriteGraphs'], 'data' => $data['favourite_graphs'], 'header' => _('Favourite graphs'), 'links' => [['name' => _('Graphs'), 'url' => 'charts.php']], 'defaults' => ['col' => 0, 'row' => 0]], WIDGET_FAVOURITE_SCREENS => ['id' => 'favouriteScreens', 'menu_popup' => ['CMenuPopupHelper', 'getFavouriteScreens'], 'data' => $data['favourite_screens'], 'header' => _('Favourite screens'), 'links' => [['name' => _('Screens'), 'url' => 'screens.php'], ['name' => _('Slide shows'), 'url' => 'slides.php']], 'defaults' => ['col' => 0, 'row' => 1]], WIDGET_FAVOURITE_MAPS => ['id' => 'favouriteMaps', 'menu_popup' => ['CMenuPopupHelper', 'getFavouriteMaps'], 'data' => $data['favourite_maps'], 'header' => _('Favourite maps'), 'links' => [['name' => _('Maps'), 'url' => 'zabbix.php?action=map.view']], 'defaults' => ['col' => 0, 'row' => 2]]];
foreach ($widgets as $widgetid => $widget) {
    $icon = (new CButton(null))->addClass(ZBX_STYLE_BTN_WIDGET_ACTION)->setTitle(_('Action'))->setId($widget['id'])->setMenuPopup(call_user_func($widget['menu_popup']));
    $footer = new CList();
    foreach ($widget['links'] as $link) {
        $footer->addItem(new CLink($link['name'], $link['url']));
    }
    $col = CProfile::get('web.dashboard.widget.' . $widgetid . '.col', $widget['defaults']['col']);
    $row = CProfile::get('web.dashboard.widget.' . $widgetid . '.row', $widget['defaults']['row']);
    $dashboardGrid[$col][$row] = (new CCollapsibleUiWidget($widgetid, $widget['data']))->setExpanded((bool) CProfile::get('web.dashboard.widget.' . $widgetid . '.state', true))->setHeader($widget['header'], [$icon], true, 'zabbix.php?action=dashboard.widget')->setFooter($footer);
}
$widgets = [WIDGET_SYSTEM_STATUS => ['action' => 'widget.system.view', 'header' => _('System status'), 'defaults' => ['col' => 1, 'row' => 1]], WIDGET_HOST_STATUS => ['action' => 'widget.hosts.view', 'header' => _('Host status'), 'defaults' => ['col' => 1, 'row' => 2]], WIDGET_LAST_ISSUES => ['action' => 'widget.issues.view', 'header' => _n('Last %1$d issue', 'Last %1$d issues', DEFAULT_LATEST_ISSUES_CNT), 'defaults' => ['col' => 1, 'row' => 3]], WIDGET_WEB_OVERVIEW => ['action' => 'widget.web.view', 'header' => _('Web monitoring'), 'defaults' => ['col' => 1, 'row' => 4]]];
if ($data['show_status_widget']) {
    $widgets[WIDGET_ZABBIX_STATUS] = ['action' => 'widget.status.view', 'header' => _('Status of Zabbix'), 'defaults' => ['col' => 1, 'row' => 0]];
}
if ($data['show_discovery_widget']) {
    $widgets[WIDGET_DISCOVERY_STATUS] = ['action' => 'widget.discovery.view', 'header' => _('Discovery status'), 'defaults' => ['col' => 1, 'row' => 5]];
}
foreach ($widgets as $widgetid => $widget) {
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:monitoring.dashboard.view.php

示例13: stage3

 function stage3()
 {
     $table = new CTable(null, 'requirements');
     $table->setAlign('center');
     $DB['TYPE'] = $this->getConfig('DB_TYPE');
     $cmbType = new CComboBox('type', $DB['TYPE'], 'this.form.submit();');
     $frontendSetup = new FrontendSetup();
     $databases = $frontendSetup->getSupportedDatabases();
     foreach ($databases as $id => $name) {
         $cmbType->addItem($id, $name);
     }
     $table->addRow(array(new CCol(_('Database type'), 'header'), $cmbType));
     switch ($DB['TYPE']) {
         case ZBX_DB_SQLITE3:
             $database = new CTextBox('database', $this->getConfig('DB_DATABASE', 'zabbix'));
             $database->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('Database file'), 'header'), $database));
             break;
         default:
             $server = new CTextBox('server', $this->getConfig('DB_SERVER', 'localhost'));
             $server->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('Database host'), 'header'), $server));
             $port = new CNumericBox('port', $this->getConfig('DB_PORT', '0'), 5, 'no', false, false);
             $port->attr('style', '');
             $port->attr('onchange', "disableSetupStepButton('#next_2'); validateNumericBox(this, 'false', 'false');");
             $table->addRow(array(new CCol(_('Database port'), 'header'), array($port, ' 0 - use default port')));
             $database = new CTextBox('database', $this->getConfig('DB_DATABASE', 'zabbix'));
             $database->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('Database name'), 'header'), $database));
             if ($DB['TYPE'] == ZBX_DB_DB2) {
                 $schema = new CTextBox('schema', $this->getConfig('DB_SCHEMA', ''));
                 $schema->attr('onchange', "disableSetupStepButton('#next_2')");
                 $table->addRow(array(new CCol(_('Database schema'), 'header'), $schema));
             }
             $user = new CTextBox('user', $this->getConfig('DB_USER', 'root'));
             $user->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('User'), 'header'), $user));
             $password = new CPassBox('password', $this->getConfig('DB_PASSWORD', ''));
             $password->attr('onchange', "disableSetupStepButton('#next_2')");
             $table->addRow(array(new CCol(_('Password'), 'header'), $password));
             break;
     }
     global $ZBX_MESSAGES;
     if (!empty($ZBX_MESSAGES)) {
         $lst_error = new CList(null, 'messages');
         foreach ($ZBX_MESSAGES as $msg) {
             $lst_error->addItem($msg['message'], $msg['type']);
         }
         $table = array($table, $lst_error);
     }
     return array(new CDiv(new CDiv(array('Please create database manually, and set the configuration parameters for connection to this database.', BR(), BR(), 'Press "Test connection" button when done.', BR(), $table), 'vertical_center'), 'table_wraper'), new CDiv(array(isset($_REQUEST['retry']) ? !$this->DISABLE_NEXT_BUTTON ? new CSpan(array(_('OK'), BR()), 'ok') : new CSpan(array(_('Fail'), BR()), 'fail') : null, new CSubmit('retry', 'Test connection')), 'info_bar'));
 }
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:52,代码来源:setup.inc.php

示例14: getList

 function getList()
 {
     $list = new CList();
     foreach ($this->stage as $id => $data) {
         if ($id < $this->getStep()) {
             $style = 'completed';
         } else {
             if ($id == $this->getStep()) {
                 $style = 'current';
             } else {
                 $style = null;
             }
         }
         $list->addItem($data['title'], $style);
     }
     return $list;
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:17,代码来源:setup.inc.php

示例15: testOffsetUnset

 public function testOffsetUnset()
 {
     $list = new CList(array(1, 2, 3));
     $list->offsetUnset(1);
     $this->assertEquals(array(1, 3), $list->toArray());
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:6,代码来源:CListTest.php


注:本文中的CList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。