本文整理汇总了PHP中rex_list::addColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_list::addColumn方法的具体用法?PHP rex_list::addColumn怎么用?PHP rex_list::addColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_list
的用法示例。
在下文中一共展示了rex_list::addColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
</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) {
$publishedAt = new DateTime($list->getValue('publishedAt'));
if ($list->getValue('publishedAt') == '0000-00-00 00:00:00') {
return '
<span class="rex-offline datepicker" data-id="###id###">' . $I18N->msg('asd_news_unpublished') . '</span>
<span style="height:1px; width:1px; display:block" id="news_###id###" data-clang="' . $clang . '" value="' . $now->format('d/m/Y H:i') . '"></span>';
}
$url = $list->getParsedUrl(array('func' => 'unpublish', 'id' => '###id###'));
return '<a href="' . $url . '" class="rex-online" onclick="return confirm(\'' . $I18N->msg('asd_news_really_unpublish') . '\');">' . $I18N->msg('asd_news_published') . '</a>';
});
$list->addColumn('editCol', $I18N->msg('edit'), -1, array('', '<td>###VALUE###</td>'));
$list->setColumnParams('editCol', array('func' => 'edit', 'id' => '###id###'));
$list->addColumn('delCol', $I18N->msg('delete'), -1, array('', '<td>###VALUE###</td>'));
$list->setColumnParams('delCol', array('func' => 'delete', 'id' => '###id###'));
$list->addLinkAttribute('delCol', 'onclick', 'return confirm(\'' . $I18N->msg('asd_news_really_delete') . '\');');
示例2: 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();
}