本文整理汇总了PHP中CRow::addClass方法的典型用法代码示例。如果您正苦于以下问题:PHP CRow::addClass方法的具体用法?PHP CRow::addClass怎么用?PHP CRow::addClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRow
的用法示例。
在下文中一共展示了CRow::addClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareRow
public function prepareRow($item, $class = null, $id = null)
{
if ($item === null) {
return null;
}
if (is_object($item) && strtolower(get_class($item)) === 'ccol') {
if (isset($this->header) && !isset($item->attributes['colspan'])) {
$item->attributes['colspan'] = $this->colnum;
}
}
if (!is_object($item) || strtolower(get_class($item)) !== 'crow') {
$item = new CRow($item);
if ($id !== null) {
$item->setId($id);
}
}
if ($class !== null) {
$item->addClass($class);
}
return $item;
}
示例2: CDiv
$openState = CProfile::get('web.latest.toggle_other', null, $host['hostid']);
$toggle = new CDiv(null, 'app-list-toggle icon-plus-9x9');
if ($openState) {
$toggle->addClass('icon-minus-9x9');
}
$toggle->setAttribute('data-app-id', '0_' . $host['hostid']);
$toggle->setAttribute('data-open-state', $openState);
$hostName = null;
if (!$singleHostSelected) {
$hostName = new CSpan($host['name'], 'link_menu menu-host' . ($host['status'] == HOST_STATUS_NOT_MONITORED ? ' not-monitored' : ''));
$hostName->setMenuPopup(CMenuPopupHelper::getHost($host, $hostScripts[$host['hostid']]));
}
// add toggle row
$table->addRow(array($toggle, '', $hostName, new CCol(array(bold('- ' . 'other' . ' -'), ' (' . _n('%1$s Item', '%1$s Items', $dbHost['item_cnt']) . ')'), null, $filter['showDetails'] ? 10 : 5)), 'odd_row');
// add toggle sub rows
foreach ($appRows as $row) {
$row->setAttribute('parent_app_id', '0_' . $host['hostid']);
$row->addClass('odd_row');
if (!$openState) {
$row->addClass('hidden');
}
$table->addRow($row);
}
}
$goBox = new CComboBox('graphtype', GRAPH_TYPE_STACKED, null, array(GRAPH_TYPE_STACKED => _('Display stacked graph'), GRAPH_TYPE_NORMAL => _('Display graph')));
$goBox->setAttribute('id', 'action');
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$form->addItem(array($table, get_table_header(array($goBox, $goButton))));
$latestWidget->addItem($form);
$latestWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';