addParam() public method

public addParam ( $name, $value )
示例#1
0
文件: news.php 项目: Sysix/asd_news
        echo rex_warning($sql->getError());
    }
    $func = '';
}
if ($func == '') {
    $list = new rex_list('
    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') {