setColumnParams() 공개 메소드

Verlinkt eine Spalte mit den übergebenen Parametern.
public setColumnParams ( string $columnName, array $params = [] )
$columnName string Name der Spalte
$params array Array von Parametern
예제 #1
0
//------------------------------> 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
0
파일: news.php 프로젝트: Sysix/asd_news
     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) {
     $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>';
예제 #3
0
 // DEBUG SWITCH
 $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###'));