getUrl() public method

public getUrl ( array $params = [], $escape = true )
$params array
Example #1
0
}
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') {
            return '';
        }
        return '<span>' . $value . '</span>';
Example #2
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();
}