本文整理汇总了PHP中rex_list::setColumnLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_list::setColumnLabel方法的具体用法?PHP rex_list::setColumnLabel怎么用?PHP rex_list::setColumnLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_list
的用法示例。
在下文中一共展示了rex_list::setColumnLabel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
//------------------------------> Parameter
if (!isset($prefix)) {
trigger_error('Fehler: Prefix nicht definiert!', E_USER_ERROR);
exit;
}
if (!isset($metaTable)) {
trigger_error('Fehler: metaTable nicht definiert!', E_USER_ERROR);
exit;
}
$Basedir = dirname(__FILE__);
$field_id = rex_request('field_id', 'int');
//------------------------------> Eintragsliste
if ($func == '') {
$list = new rex_list('SELECT field_id, name FROM ' . $REX['TABLE_PREFIX'] . '62_params WHERE `name` LIKE "' . $prefix . '%" ORDER BY prior');
$list->setCaption($I18N_META_INFOS->msg('field_list_caption'));
$imgHeader = '<a href="' . $list->getUrl(array('func' => 'add')) . '"><img src="media/metainfo_plus.gif" alt="add" title="add" /></a>';
$list->addColumn($imgHeader, '<img src="media/metainfo.gif" alt="field" title="field" />', 0, array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-icon">###VALUE###</td>'));
$list->setColumnParams($imgHeader, array('func' => 'edit', 'field_id' => '###field_id###'));
$list->setColumnLabel('field_id', $I18N_META_INFOS->msg('field_label_id'));
$list->setColumnLayout('field_id', array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-icon">###VALUE###</td>'));
$list->setColumnLabel('name', $I18N_META_INFOS->msg('field_label_name'));
$list->setColumnParams('name', array('func' => 'edit', 'field_id' => '###field_id###'));
$list->show();
} elseif ($func == 'edit' || $func == 'add') {
require_once $REX['INCLUDE_PATH'] . '/addons/metainfo/classes/class.rex_tableExpander.inc.php';
$form = new rex_a62_tableExpander($prefix, $metaTable, $REX['TABLE_PREFIX'] . '62_params', $I18N_META_INFOS->msg('field_fieldset'), 'field_id=' . $field_id);
if ($func == 'edit') {
$form->addParam('field_id', $field_id);
}
$form->show();
}
示例2: array
SELECT
`id`, `title`, `publishedAt`, `status`
FROM `' . rex_asd_news_config::getTable() . '`
WHERE `clang` = ' . $clang . '
ORDER BY CASE
WHEN `publishedAt` = "0000-00-00 00:00:00" THEN 1
ELSE 0
END DESC,
`publishedAt` DESC, `updatedAt` DESC');
$list->addParam('clang', $clang);
$list->addParam('subpage', $subpage);
$imgHeader = '
<a class="rex-i-element rex-i-generic-add" href="' . $list->getUrl(array('func' => 'add')) . '">
<span class="rex-i-element-text">add</span>
</a>';
$list->setColumnLabel('id', $imgHeader);
$list->setColumnLabel('title', $I18N->msg('asd_news_title'));
$list->setColumnLabel('publishedAt', $I18N->msg('asd_news_publishedAt'));
$list->removeColumn('status');
$list->addTableColumnGroup(array(40, '*', 120, 50, 50, 50, 50));
$list->setColumnParams('title', array('func' => 'edit', 'id' => '###id###'));
$list->setColumnFormat('publishedAt', 'custom', function ($params) use($list, $now, $clang, $I18N, $REX) {
$publishedAt = new DateTime($list->getValue('publishedAt'));
$value = $publishedAt->format('d.m.Y H:i');
if ($list->getValue('publishedAt') == '0000-00-00 00:00:00') {
return '';
}
return '<span>' . $value . '</span>';
});
$list->addColumn('publishCol', $I18N->msg('asd_news_publish'), -1, array('<th colspan="4">' . $I18N->msg('actions') . '</th>', '<td>###VALUE###</td>'));
$list->setColumnFormat('publishCol', 'custom', function ($params) use($list, $clang, $now, $I18N) {
示例3: array
$list->debug = false;
$imgHeader = '<a href="' . $list->getUrl(array('func' => 'add')) . '"><img src="media/metainfo_plus.gif" alt="add" title="add" /></a>';
$list->setColumnSortable('id');
$list->setColumnSortable('field_1');
//$list->setColumnSortable('field_2' );
$list->setColumnSortable('field_3');
$list->setColumnSortable('field_4');
$list->setColumnSortable('field_5');
$list->setColumnSortable('field_6');
//$list->setColumnSortable('field_7' );
//$list->setColumnSortable('field_8' );
//$list->setColumnSortable('field_9' );
//$list->setColumnSortable('field_10');
$list->addColumn($imgHeader, '<img src="media/metainfo.gif" alt="field" title="field" />', 0, array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-icon">###VALUE###</td>'));
$list->setColumnParams($imgHeader, array('func' => 'edit', 'id' => '###id###'));
$list->setColumnLabel('id', 'ID');
$list->setColumnLabel('field_1', 'Text');
$list->setColumnLabel('field_2', 'Textarea');
$list->setColumnLabel('field_3', 'Select');
$list->setColumnLabel('field_4', 'Multiselect');
$list->setColumnLabel('field_5', 'Check');
$list->setColumnLabel('field_6', 'Radio');
$list->setColumnLabel('field_7', 'Mediabutton');
$list->setColumnLabel('field_8', 'MediaList');
$list->setColumnLabel('field_9', 'Link');
$list->setColumnLabel('field_10', 'Linklist');
//$list->setColumnParams('id' ,array('func' => 'edit', 'id' => '###id###'));
$list->setColumnParams('field_1', array('func' => 'edit', 'id' => '###id###'));
$list->setColumnParams('field_2', array('func' => 'edit', 'id' => '###id###'));
$list->setColumnParams('field_3', array('func' => 'edit', 'id' => '###id###'));
$list->setColumnParams('field_4', array('func' => 'edit', 'id' => '###id###'));