本文整理汇总了PHP中CB\Config::getDefaultGridColumnConfigs方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getDefaultGridColumnConfigs方法的具体用法?PHP Config::getDefaultGridColumnConfigs怎么用?PHP Config::getDefaultGridColumnConfigs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CB\Config
的用法示例。
在下文中一共展示了Config::getDefaultGridColumnConfigs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
protected function getData($p)
{
$rez = array();
if (empty($p)) {
return $rez;
}
// form columns
L\initTranslations();
$defaultColumns = Config::getDefaultGridColumnConfigs();
$columns = $defaultColumns;
// retreive data
$p['start'] = 0;
$p['rows'] = 500;
$sr = new \CB\BrowserView();
$results = $sr->getChildren($p);
if (!empty($results['DC'])) {
$columns = array();
foreach ($results['DC'] as $colName => $col) {
if (@$col['hidden'] !== true) {
$columns[$colName] = $col;
}
}
}
$colTitles = array();
foreach ($columns as $name => &$col) {
$colTitles[] = empty($defaultColumns[$name]) ? @Util\coalesce($col['title'], $name) : $defaultColumns[$name]['title'];
}
//insert header
$rez[] = $colTitles;
while (!empty($results['data'])) {
foreach ($results['data'] as $r) {
$record = array();
foreach ($columns as $colName => $col) {
if (@$col['xtype'] == 'datecolumn') {
$value = Util\dateISOToMysql(@$r[$colName]);
if (!empty($col['format'])) {
$value = Util\formatMysqlTime($value, $col['format']);
} else {
$value = Util\formatMysqlTime($value);
$tmp = explode(' ', $value);
if (!empty($tmp[1]) && $tmp[1] == '00:00') {
$value = $tmp[0];
}
}
$record[] = $value;
} elseif (strpos($colName, 'date') === false) {
if (in_array($colName, array('oid', 'cid', 'uid')) && !empty($r[$colName])) {
$record[] = User::getDisplayName($r[$colName]);
} else {
$record[] = @$r[$colName];
}
}
}
$rez[] = $record;
}
if ($p['start'] + $p['rows'] < $results['total']) {
$p['start'] += $p['rows'];
$results = $sr->getChildren($p);
} else {
$results['data'] = array();
}
}
return $rez;
}
示例2: getDC
/**
* get display columns for last node in active path
* @return array
*/
public function getDC()
{
$rez = array();
$p =& $this->params;
$ip =& $p['inputParams'];
if (!empty($ip['query'])) {
$dc = Config::get('search_DC');
//its a config reference, get it from config
if (!empty($dc) && is_scalar($dc)) {
$dc = Config::getDCConfig($dc);
}
$rez['data'] = $dc;
}
if (empty($rez['data'])) {
$path = Cache::get('current_path');
if (!empty($path)) {
$node = $path[sizeof($path) - 1];
$rez = $node->getDC();
}
}
if (!empty($ip['query'])) {
$rez['from'] = 'search';
}
//apply properties for default casebox columns
if (!empty($rez['data'])) {
$defaults = Config::getDefaultGridColumnConfigs();
foreach ($rez['data'] as $k => $v) {
if (!empty($defaults[$k])) {
$rez['data'][$k] = array_merge($defaults[$k], $v);
}
}
}
return $rez;
}
示例3: getDC
/**
* get display columns for last node in active path
* @return array
*/
public function getDC()
{
$rez = array();
$path = Cache::get('current_path');
if (!empty($path)) {
$node = $path[sizeof($path) - 1];
$rez = $node->getNodeParam('DC');
}
//apply properties for default casebox columns
if (!empty($rez['data'])) {
$defaults = Config::getDefaultGridColumnConfigs();
foreach ($rez['data'] as $k => $v) {
if (!empty($defaults[$k])) {
$rez['data'][$k] = array_merge($defaults[$k], $v);
}
}
}
return $rez;
}