本文整理汇总了PHP中rex_list类的典型用法代码示例。如果您正苦于以下问题:PHP rex_list类的具体用法?PHP rex_list怎么用?PHP rex_list使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了rex_list类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rex_request
<?php
$func = rex_request('func', 'string');
if ($func == '') {
$list = rex_list::factory("SELECT `id`, `caption` FROM `" . rex::getTablePrefix() . "socialhub_entry_hashtag` WHERE `source` = 'twitter' ORDER BY `id` DESC");
$list->addTableAttribute('class', 'table-striped');
$list->setNoRowsMessage($this->i18n('entries_norowsmessage'));
// icon column
$list->addColumn(' ', '<i class="rex-icon fa-twitter"></i>', 0, ['<th class="rex-table-icon">###VALUE###</th>', '<td class="rex-table-icon">###VALUE###</td>']);
$list->setColumnLabel('caption', $this->i18n('entries_column_caption'));
$list->setColumnFormat('caption', 'custom', function ($params) {
return urldecode($params['subject']);
});
$funcs = $this->i18n('entries_column_status');
$list->addColumn($funcs, '<i class="rex-icon rex-icon-online"></i> online', -1, ['<th class="rex-table-action" colspan="2">###VALUE###</th>', '<td class="rex-table-action">###VALUE###</td>']);
$list->setColumnParams($funcs, ['id' => '###id###', 'func' => 'toggleVisibility']);
$list->removeColumn('id');
$content = $list->get();
$fragment = new rex_fragment();
$fragment->setVar('content', $content, false);
$content = $fragment->parse('core/page/section.php');
echo $content;
}
示例2: rex_sql
$query_to_delete = "SELECT lang.kategorie_id, kategorien.kategorie_id " . "FROM `" . $REX['TABLE_PREFIX'] . "d2u_stellenmarkt_kategorien_lang` AS lang " . "LEFT JOIN `" . $REX['TABLE_PREFIX'] . "d2u_stellenmarkt_kategorien` AS kategorien " . "ON lang.kategorie_id = kategorien.kategorie_id " . "WHERE kategorien.kategorie_id IS NULL " . "GROUP BY lang.kategorie_id";
$result_to_delete = new rex_sql();
$result_to_delete->setQuery($query_to_delete);
$num_rows_to_delete = $result_to_delete->getRows();
for ($i = 0; $i < $num_rows_to_delete; $i++) {
// ... muessen zuerst geloescht werden
$delete_qry = 'DELETE FROM ' . $REX['TABLE_PREFIX'] . 'd2u_stellenmarkt_kategorien_lang ' . 'WHERE kategorie_id = ' . $result_to_delete->getValue("lang.kategorie_id");
$delete_sql = new rex_sql();
$delete_data = $delete_sql->getArray($delete_qry);
$result_to_delete->next();
}
/*
* Liste anlegen
*/
$sql = 'SELECT kategorie_id, interne_bezeichnung FROM ' . $REX['TABLE_PREFIX'] . 'd2u_stellenmarkt_kategorien AS kategorien ' . 'ORDER BY interne_bezeichnung ASC';
$list = rex_list::factory($sql, 100);
// Spalten mit Sortierfunktion
$list->setColumnSortable('interne_bezeichnung');
$imgHeader = '<a href="' . $list->getUrl(array('func' => 'add')) . '"><img src="media/metainfo_plus.gif" alt="add" title="add" /></a>';
// Hinzufuegen Button
$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>'));
// Edit Button unterhalb des hinzufuegen Buttons
$list->setColumnParams($imgHeader, array('func' => 'edit', 'entry_id' => '###kategorie_id###'));
// Labels
$list->setColumnLabel('kategorie_id', $I18N_STELLEN->msg('id'));
$list->setColumnLabel('interne_bezeichnung', $I18N_STELLEN->msg('interne_bezeichnung'));
// Edit Funktion auf Zeileneintrag
$list->setColumnParams('kategorie_id', array('func' => 'edit', 'entry_id' => '###kategorie_id###'));
$list->setColumnParams('interne_bezeichnung', array('func' => 'edit', 'entry_id' => '###kategorie_id###'));
// Liste anzeigen
$list->show();
示例3: array
<?php
/**
* Redaxo D2U Kurse
* @author Tobias Krais
* @author <a href="http://www.design-to-use.de">www.design-to-use.de</a>
*/
// Uebersichtsliste
if ($func == '') {
$sql = 'SELECT zielgruppen.zielgruppe_id, zielgruppen.name, eltern.name AS elternname FROM ' . $REX['TABLE_PREFIX'] . 'd2u_kurse_zielgruppen AS zielgruppen ' . 'LEFT JOIN ' . $REX['TABLE_PREFIX'] . 'd2u_kurse_zielgruppen AS eltern ' . 'ON zielgruppen.eltern_zielgruppe_id = eltern.zielgruppe_id ' . 'ORDER BY zielgruppen.name ASC';
$list = rex_list::factory($sql, 50, null, false);
// Spalten mit Sortierfunktion
$list->setColumnSortable('name');
$list->setColumnSortable('elternname');
$imgHeader = '<a href="' . $list->getUrl(array('func' => 'add')) . '"><img src="media/metainfo_plus.gif" alt="add" title="add" /></a>';
// Hinzufuegen Button
$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>'));
// Edit Button unterhalb des hinzufuegen Buttons
$list->setColumnParams($imgHeader, array('func' => 'edit', 'entry_id' => '###zielgruppe_id###'));
// Labels
$list->setColumnLabel('zielgruppe_id', $I18N_KURSE->msg('id'));
$list->setColumnLabel('zielgruppen.name', $I18N_KURSE->msg('name'));
$list->setColumnLabel('elternname', $I18N_KURSE->msg('elternkategorie'));
// Edit Funktion auf Zeileneintrag
$list->setColumnParams('zielgruppe_id', array('func' => 'edit', 'entry_id' => '###zielgruppe_id###'));
$list->setColumnParams('name', array('func' => 'edit', 'entry_id' => '###zielgruppe_id###'));
// Liste anzeigen
$list->show();
} elseif ($func == 'edit' || $func == 'add') {
$form = rex_form::factory($REX['TABLE_PREFIX'] . 'd2u_kurse_zielgruppen', $I18N_KURSE->msg('zielgruppen'), "zielgruppe_id = " . $entry_id, "post", false);
// Name
示例4: REPLACE
AND
((archive_date != "0000-00-00") AND REPLACE(archive_date, "-", "") <= CURDATE() + 0)
)
' . $addSql . '
ORDER BY online_date desc', '5000', '', false, 'rex_list_extended');
$list->addTableColumnGroup(array(20, '*', 80, 40, 60, 60, 60, 60));
} else {
$list = rex_list::factory('
SELECT id,
name,
online_date,
clang,
status,
flag,
stickyUntil,
category,
createdate
FROM ' . TBL_NEWS . '
WHERE (
(offline_date = "0000-00-00" OR (REPLACE(offline_date, "-", "") > CURDATE() + 0))
AND
((archive_date = "0000-00-00") OR REPLACE(archive_date, "-", "") > CURDATE() + 0)
)
' . $addSql . '
ORDER BY online_date desc', '5000', '', false, 'rex_list_extended');
$list->addTableColumnGroup(array(20, '*', 80, 40, 60, 40, 40, 40, 60, 60));
}
}
$imgHeader = '<a href="' . $list->getUrl(array('func' => 'add', 'clang' => $clang)) . '"><img src="media/metainfo_plus.gif" alt="' . $I18N->msg('b_504_add') . '" title="' . $I18N->msg('b_504_add') . '" /></a>';
$list->addColumn($imgHeader, '###' . 'id###', 0, array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-small">###VALUE###</td>'));
$list->setColumnLabel('article', 'Artikel');
$list->setColumnLabel('name', 'Name');
示例5: nl2br
$name = $manager->getName($oid);
$success = $manager->tryExecute($oid);
$msg = '';
if ($manager->hasMessage()) {
$msg = '<br /><br />' . $this->i18n('log_message') . ': <br />' . nl2br($manager->getMessage());
}
if ($success) {
echo rex_view::success($this->i18n('execute_success', $name) . $msg);
} else {
echo rex_view::error($this->i18n('execute_error', $name) . $msg);
}
$func = '';
}
if ($func == '') {
$query = 'SELECT id, name, type, `interval`, environment, execution_moment, status FROM ' . REX_CRONJOB_TABLE . ' ORDER BY name';
$list = rex_list::factory($query, 30, 'cronjobs');
$list->setNoRowsMessage($this->i18n('no_cronjobs'));
$tdIcon = '<i class="rex-icon rex-icon-cronjob"></i>';
$thIcon = '<a href="' . $list->getUrl(['func' => 'add']) . '" title="' . $this->i18n('add') . '"><i class="rex-icon rex-icon-add-cronjob"></i></a>';
$list->addColumn($thIcon, $tdIcon, 0, ['<th class="rex-table-icon">###VALUE###</th>', '<td class="rex-table-icon">###VALUE###</td>']);
$list->setColumnParams($thIcon, ['func' => 'edit', 'oid' => '###id###']);
$list->removeColumn('id');
$list->removeColumn('type');
$list->setColumnLabel('name', $this->i18n('name'));
$list->setColumnParams('name', ['func' => 'edit', 'oid' => '###id###']);
$list->setColumnLabel('interval', $this->i18n('interval'));
$list->setColumnFormat('interval', 'custom', function ($params) {
$value = explode('|', $params['list']->getValue('interval'));
$str = $value[1] . ' ';
$array = ['i' => 'minutes', 'h' => 'hour', 'd' => 'day', 'w' => 'week', 'm' => 'month', 'y' => 'year'];
$str .= rex_i18n::msg('cronjob_interval_' . $array[$value[2]]);
示例6: rex_info
$sql->setWhere('`id` = ' . $id);
$successMessage = $I18N->msg('asd_news_unpublished_m');
}
if ($sql->update()) {
echo rex_info($successMessage);
} else {
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));
示例7: array
$addsql .= ")";
}
$link .= "&csuche]" . $csuche;
}
if ($cstatus != "") {
if ($addsql == "") {
$addsql .= " WHERE ";
} else {
$addsql .= " AND ";
}
$addsql .= " `status`='" . $cstatus . "' ";
}
$sql = "select * from {$table} {$addsql}";
// echo $sql;
echo "<table cellpadding=5 class=rex-table><tr><td><a href=index.php?page=" . $page . "&subpage=" . $subpage . "&func=add><b>+ {$bezeichner} anlegen</b></a></td></tr></table><br />";
$list = rex_list::factory($sql, 30);
$list->setColumnFormat('id', 'Id');
/*
$list->setColumnLabel('name', 'Name');
$list->setColumnLabel('firma', 'Firma');
$list->setColumnLabel('funktion', 'Funktion');
*/
$list->setColumnParams("id", array("oid" => "###id###", "func" => "edit"));
$list->setColumnParams("name", array("oid" => "###id###", "func" => "edit"));
$list->setColumnParams("email", array("oid" => "###id###", "func" => "edit"));
$list->addParam("page", $page);
$list->addParam("subpage", $subpage);
$list->addParam("csuchtxt", $csuchtxt);
$list->addParam("cstatus", $cstatus);
$list->addParam("csuche", $csuche);
foreach ($csuchfeld as $cs) {
示例8: rex_request
* @author mail[at]blumbeet[dot]com
*
*/
$myself = 'url_control';
$addon = $REX['ADDON'][$myself]['addon'];
$oid = rex_request('oid', 'int');
$func = rex_request('func', 'string');
$echo = '';
if ($func == '') {
$query = ' SELECT `id`,
`url`,
`method`,
`method_parameters`,
`status`
FROM ' . $REX['TABLE_PREFIX'] . 'url_control_manager';
$list = rex_list::factory($query, 30, 'url_control_manager');
// $list->debug = true;
$list->setNoRowsMessage($I18N->msg('b_no_results'));
$list->setCaption($I18N->msg('b_tables'));
$list->addTableAttribute('summary', $I18N->msg('b_tables'));
//$list->addTableColumnGroup(array(40, '*', 150, 80, 80, '153'));
$header = '<a class="rex-i-element rex-i-generic-add" href="' . $list->getUrl(array('func' => 'add')) . '"><span class="rex-i-element-text">' . $I18N->msg('b_add_entry', $I18N->msg('b_table')) . '</span></a>';
$list->addColumn($header, '###id###', 0, array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-small">###VALUE###</td>'));
$list->removeColumn('id');
$list->removeColumn('status');
$list->removeColumn('method');
$list->removeColumn('method_parameters');
$list->setColumnLabel('url', $I18N->msg('b_url_control_manager_requested_url'));
$list->addColumn('target', '');
$list->setColumnLabel('target', $I18N->msg('b_url_control_manager_target'));
$list->setColumnFormat('target', 'custom', create_function('$params', 'global $I18N;
示例9: function
});
//--></script>';
echo $message;
echo $content;
$OUT = false;
}
}
if ($OUT) {
if ($success != '') {
$message .= rex_view::success($success);
}
if ($error != '') {
$message .= rex_view::error($error);
}
$list = rex_list::factory('SELECT id, name, active FROM ' . rex::getTablePrefix() . 'template ORDER BY name');
$list->addTableAttribute('class', 'table-striped table-hover');
$tdIcon = '<i class="rex-icon rex-icon-template"></i>';
$thIcon = '<a href="' . $list->getUrl(['function' => 'add']) . '"' . rex::getAccesskey(rex_i18n::msg('create_template'), 'add') . ' title="' . rex_i18n::msg('create_template') . '"><i class="rex-icon rex-icon-add-template"></i></a>';
$list->addColumn($thIcon, $tdIcon, 0, ['<th class="rex-table-icon">###VALUE###</th>', '<td class="rex-table-icon">###VALUE###</td>']);
$list->setColumnParams($thIcon, ['function' => 'edit', 'template_id' => '###id###']);
$list->setColumnLabel('id', rex_i18n::msg('id'));
$list->setColumnLayout('id', ['<th class="rex-table-id">###VALUE###</th>', '<td class="rex-table-id" data-title="' . rex_i18n::msg('id') . '">###VALUE###</td>']);
$list->setColumnLabel('name', rex_i18n::msg('header_template_description'));
$list->setColumnParams('name', ['function' => 'edit', 'template_id' => '###id###']);
$list->setColumnLabel('active', rex_i18n::msg('header_template_active'));
$list->setColumnFormat('active', 'custom', function ($params) {
$list = $params['list'];
return $list->getValue('active') == 1 ? '<i class="rex-icon rex-icon-active-true"></i> ' . rex_i18n::msg('yes') : '<i class="rex-icon rex-icon-active-false"></i> ' . rex_i18n::msg('no');
});
$list->addColumn(rex_i18n::msg('header_template_functions'), '<i class="rex-icon rex-icon-edit"></i> ' . rex_i18n::msg('edit'));
示例10: getFieldPage
//.........这里部分代码省略.........
echo '<div class="rex-addon-content">';
echo '<pre class="rex-code"><code>' . $notation_php . '</code></pre>';
echo '</div></div>';
echo '<div class="rex-addon-output">';
echo '<h2 class="rex-hl2">Pipe</h2>';
echo '<div class="rex-addon-content">';
echo '<pre class="rex-code"><code>' . $notation_pipe . '</code></pre>';
echo '</div></div>';
echo '<div class="rex-addon-output">';
echo '<h2 class="rex-hl2">E-Mail</h2>';
echo '<div class="rex-addon-content">';
echo '<pre class="rex-code"><code>' . $notation_email . '</code></pre>';
echo '</div></div>';
$func = 'list';
}
// ********************************************* LIST
if ($func == 'list') {
// ****** EP XFORM_MANAGER_TABLE_FIELD_FUNC
$show_list = true;
$show_list = rex_register_extension_point('XFORM_MANAGER_TABLE_FIELD_FUNC', $show_list, array('table' => $table, 'link_vars' => $this->getLinkVars()));
if ($show_list) {
function rex_xform_list_format($p, $value = '')
{
if ($value != '') {
$p['value'] = $value;
}
switch ($p['list']->getValue('type_id')) {
case 'validate':
$style = 'color:#aaa;';
// background-color:#cfd9d9;
break;
case 'action':
$style = 'background-color:#cfd9d9;';
break;
default:
$style = 'background-color:#eff9f9;';
break;
}
return '<td style="' . $style . '">' . $p['value'] . '</td>';
}
function rex_xform_list_edit_format($p)
{
global $REX, $I18N;
return rex_xform_list_format($p, $p['list']->getColumnLink($I18N->msg('xform_edit'), $I18N->msg('xform_edit')));
}
function rex_xform_list_delete_format($p)
{
global $REX, $I18N;
return rex_xform_list_format($p, $p['list']->getColumnLink($I18N->msg('xform_delete'), $I18N->msg('xform_delete')));
}
$table_echo = '
<div class="rex-area-col-2">
<div class="rex-area-col-a">
<a href="index.php?' . $link_vars . '&table_name=' . $table->getTableName() . '&func=choosenadd"><b>+ ' . $I18N->msg('xform_addtablefield') . '</b></a>
</div>
<div class="rex-area-col-b rex-algn-rght">
<ul class="rex-navi-piped">
<li><a href="index.php?' . $link_vars . '&table_name=' . $table->getTableName() . '&func=show_form_notation">' . $I18N->msg('xform_manager_show_form_notation') . '</a></li><li><a href="index.php?' . $link_vars . '&table_name=' . $table->getTableName() . '&func=updatetable">' . $I18N->msg('xform_updatetable') . '</a></li><li><a href="index.php?' . $link_vars . '&table_name=' . $table->getTableName() . '&func=updatetablewithdelete" onclick="return confirm(\'' . $I18N->msg('xform_updatetable_with_delete_confirm') . '\')">' . $I18N->msg('xform_updatetable_with_delete') . '</a></li>
</ul>
</div>
</div>
<div class="rex-clearer"></div>
';
echo rex_content_block($table_echo);
$sql = 'select id, prio, type_id, type_name, name from ' . rex_xform_manager_field::table() . ' where table_name="' . $table->getTableName() . '" order by prio';
$list = rex_list::factory($sql, 30);
// $list->debug = 1;
$list->setColumnFormat('id', 'Id');
foreach ($this->getLinkVars() as $k => $v) {
$list->addParam($k, $v);
}
$list->addParam('start', rex_request('start', 'int'));
$list->addParam('table_name', $table->getTableName());
$list->removeColumn('id');
$list->setColumnLabel('prio', $I18N->msg('xform_manager_table_prio_short'));
$list->setColumnLabel('type_id', $I18N->msg('xform_manager_type_id'));
$list->setColumnLabel('type_name', $I18N->msg('xform_manager_type_name'));
$list->setColumnLabel('name', $I18N->msg('xform_manager_name'));
$list->setColumnLayout('prio', array('<th>###VALUE###</th>', '###VALUE###'));
$list->setColumnFormat('prio', 'custom', 'rex_xform_list_format');
$list->setColumnLayout('type_id', array('<th>###VALUE###</th>', '###VALUE###'));
$list->setColumnFormat('type_id', 'custom', 'rex_xform_list_format');
$list->setColumnLayout('type_name', array('<th>###VALUE###</th>', '###VALUE###'));
$list->setColumnFormat('type_name', 'custom', 'rex_xform_list_format');
$list->setColumnLayout('name', array('<th>###VALUE###</th>', '###VALUE###'));
// ###VALUE###
$list->setColumnFormat('name', 'custom', 'rex_xform_list_format');
$list->addColumn($I18N->msg('xform_edit'), $I18N->msg('xform_edit'));
$list->setColumnParams($I18N->msg('xform_edit'), array('field_id' => '###id###', 'func' => 'edit', 'type_name' => '###type_name###', 'type_id' => '###type_id###'));
$list->setColumnLayout($I18N->msg('xform_edit'), array('<th>###VALUE###</th>', '###VALUE###'));
$list->setColumnFormat($I18N->msg('xform_edit'), 'custom', 'rex_xform_list_edit_format');
$list->addColumn($I18N->msg('xform_delete'), $I18N->msg('xform_delete'));
$list->setColumnParams($I18N->msg('xform_delete'), array('field_id' => '###id###', 'func' => 'delete'));
$list->setColumnLayout($I18N->msg('xform_delete'), array('<th>###VALUE###</th>', '###VALUE###'));
$list->setColumnFormat($I18N->msg('xform_delete'), 'custom', 'rex_xform_list_delete_format');
$list->addLinkAttribute($I18N->msg('xform_delete'), 'onclick', 'return confirm(\' [###type_id###, ###type_name###, ###name###] ' . $I18N->msg('xform_delete') . ' ?\')');
echo $list->get();
}
}
}
示例11: rex_request
$field_id = rex_request('field_id', 'int', 0);
if ($field_id != 0) {
if (rex_metainfo_delete_field($field_id)) {
echo rex_view::success(rex_i18n::msg('minfo_field_successfull_deleted'));
} else {
echo rex_view::error(rex_i18n::msg('minfo_field_error_deleted'));
}
}
$func = '';
}
//------------------------------> Eintragsliste
if ($func == '') {
$title = rex_i18n::msg('minfo_field_list_caption');
// replace LIKE wildcards
$likePrefix = str_replace(['_', '%'], ['\\_', '\\%'], $prefix);
$list = rex_list::factory('SELECT id, name FROM ' . rex::getTablePrefix() . 'metainfo_field WHERE `name` LIKE "' . $likePrefix . '%" ORDER BY priority');
$list->addTableAttribute('class', 'table-striped');
$tdIcon = '<i class="rex-icon rex-icon-metainfo"></i>';
$thIcon = '<a href="' . $list->getUrl(['func' => 'add']) . '"><i class="rex-icon rex-icon-add-metainfo"></i></a>';
$list->addColumn($thIcon, $tdIcon, 0, ['<th class="rex-table-icon">###VALUE###</th>', '<td class="rex-table-icon">###VALUE###</td>']);
$list->setColumnParams($thIcon, ['func' => 'edit', 'field_id' => '###id###']);
$list->removeColumn('id');
$list->setColumnLabel('id', rex_i18n::msg('minfo_field_label_id'));
$list->setColumnLayout('id', ['<th class="rex-table-id">###VALUE###</th>', '<td class="rex-table-id" data-title="' . rex_i18n::msg('minfo_field_label_id') . '">###VALUE###</td>']);
$list->setColumnLabel('name', rex_i18n::msg('minfo_field_label_name'));
$list->setColumnParams('name', ['func' => 'edit', 'field_id' => '###id###']);
$list->addColumn(rex_i18n::msg('minfo_field_label_functions'), '<i class="rex-icon rex-icon-edit"></i> ' . rex_i18n::msg('edit'));
$list->setColumnLayout(rex_i18n::msg('minfo_field_label_functions'), ['<th class="rex-table-action" colspan="2">###VALUE###</th>', '<td class="rex-table-action">###VALUE###</td>']);
$list->setColumnParams(rex_i18n::msg('minfo_field_label_functions'), ['func' => 'edit', 'field_id' => '###id###']);
$list->addLinkAttribute(rex_i18n::msg('minfo_field_label_functions'), 'class', 'rex-edit');
$list->addColumn('delete', '<i class="rex-icon rex-icon-delete"></i> ' . rex_i18n::msg('delete'));
示例12: array
<label for="userperm_extra">' . $I18N->msg('extras') . '</label>
' . $sel_extra->get() . '
<span>' . $I18N->msg('ctrl') . '</span>
</p>
</div>
' . $add_submit . '
</div>
</fieldset>
</form>
</div>
';
}
// ---------------------------------- Userliste
if (isset($SHOW) and $SHOW) {
$list = rex_list::factory('SELECT user_id, name, login, lasttrydate FROM ' . $REX['TABLE_PREFIX'] . 'user ORDER BY name');
$list->setCaption($I18N->msg('user_caption'));
$list->addTableAttribute('summary', $I18N->msg('user_summary'));
if (!$REX_USER->hasPerm('advancedMode[]')) {
$list->removeColumn('user_id');
$list->addTableColumnGroup(array(40, '*', 153, 153, 153));
} else {
$list->addTableColumnGroup(array(40, '5%', '*', 153, 153, 153));
}
$img = '<img src="media/user.gif" alt="###name###" title="###name###" />';
$imgAdd = '<img src="media/user_plus.gif" alt="' . $I18N->msg('create_user') . '" title="' . $I18N->msg('create_user') . '" />';
$imgHeader = '<a href="' . $list->getUrl(array('FUNC_ADD' => '1')) . '"' . rex_accesskey($I18N->msg('create_user'), $REX['ACKEY']['ADD']) . '>' . $imgAdd . '</a>';
$list->addColumn($imgHeader, $img, 0, array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-icon">###VALUE###</td>'));
$list->setColumnParams($imgHeader, array('user_id' => '###user_id###'));
$list->setColumnLabel('user_id', 'ID');
$list->setColumnLayout('user_id', array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-icon">###VALUE###</td>'));
示例13: rex_request
<?php
$vid = rex_request('vid', 'int');
if ($func == '') {
$list = rex_list::factory('
SELECT v.vid, v.name, v.street, v.city
FROM ' . $REX['ADDON']['dbpref']['events'] . 'venues v
ORDER BY vid
LIMIT 10;');
$imgHeader = '<a href="' . $list->getUrl(array('func' => 'add')) . '"><img src="media/metainfo_plus.gif" alt="add" title="add" /></a>';
$list->setColumnSortable('name');
$list->setColumnSortable('city');
$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', 'vid' => '###vid###'));
$list->setColumnLabel('name', 'Veranstaltungsort');
$list->setColumnLabel('street', 'Straße');
$list->setColumnLabel('city', 'Stadt');
$list->removeColumn('vid');
$list->setColumnLayout('eid', array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-icon">###VALUE###</td>'));
$list->setColumnParams('name', array('func' => 'edit', 'vid' => '###vid###'));
$list->show();
} elseif ($func == 'edit' || $func == 'add') {
$form = rex_form::factory($REX['ADDON']['dbpref']['events'] . 'venues', 'Veranstaltungsorte', 'vid=' . $vid);
$field =& $form->addTextField('name');
$field->setLabel('Veranstaltungsort');
$field =& $form->addTextField('street');
$field->setLabel('Straße');
$field =& $form->addTextField('city');
$field->setLabel('Stadt');
if ($func == 'edit') {
$form->addParam('eid', $id);
示例14:
<?php
$message = '';
$content = '';
if ($func == 'delete') {
$sql = rex_sql::factory();
$sql->setQuery('DELETE FROM ' . rex::getTable('user_role') . ' WHERE id = ? LIMIT 1', [$id]);
$message = rex_view::info(rex_i18n::msg('user_role_deleted'));
$func = '';
}
if ($func == '') {
$title = rex_i18n::msg('user_role_caption');
$list = rex_list::factory('SELECT id, name FROM ' . rex::getTablePrefix() . 'user_role');
$list->addTableAttribute('class', 'table-striped');
$tdIcon = '<i class="rex-icon rex-icon-userrole"></i>';
$thIcon = '<a href="' . $list->getUrl(['func' => 'add', 'default_value' => 1]) . '"' . rex::getAccesskey(rex_i18n::msg('create_user_role'), 'add') . ' title="' . rex_i18n::msg('create_user_role') . '"><i class="rex-icon rex-icon-add-userrole"></i></a>';
$list->addColumn($thIcon, $tdIcon, 0, ['<th>###VALUE###</th>', '<td>###VALUE###</td>']);
$list->setColumnParams($thIcon, ['func' => 'edit', 'id' => '###id###']);
$list->setColumnLabel('id', rex_i18n::msg('id'));
$list->setColumnLayout('id', ['<th>###VALUE###</th>', '<td>###VALUE###</td>']);
$list->setColumnLabel('name', rex_i18n::msg('name'));
$list->setColumnLayout('name', ['<th>###VALUE###</th>', '<td>###VALUE###</td>']);
$list->setColumnParams('name', ['func' => 'edit', 'id' => '###id###']);
$list->addColumn('edit', '<i class="rex-icon rex-icon-edit"></i> ' . rex_i18n::msg('edit'));
$list->setColumnLabel('edit', rex_i18n::msg('user_functions'));
$list->setColumnLayout('edit', ['<th colspan="2">###VALUE###</th>', '<td>###VALUE###</td>']);
$list->setColumnParams('edit', ['func' => 'edit', 'id' => '###id###']);
$list->addColumn('funcs', '<i class="rex-icon rex-icon-delete"></i> ' . rex_i18n::msg('user_role_delete'));
$list->setColumnLabel('funcs', rex_i18n::msg('user_functions'));
$list->setColumnLayout('funcs', ['', '<td>###VALUE###</td>']);
$list->setColumnParams('funcs', ['func' => 'delete', 'id' => '###id###']);
示例15: array
}
}
} else {
if ($func == 'delete') {
$query = "delete from {$table} where id='" . $template_id . "' ";
$delsql = rex_sql::factory();
$delsql->setQuery($query);
$content = rex_view::success(rex_i18n::msg('yform_email_info_template_deleted'));
}
}
echo $content;
if ($show_list) {
$add_sql = ' ORDER BY name';
$link = '';
$sql = "select * from {$table} " . $add_sql;
$list = rex_list::factory($sql);
// $list->setCaption(rex_i18n::msg('yform_email_header_template_caption'));
$list->addTableAttribute('summary', rex_i18n::msg('yform_email_header_template_summary'));
$list->addTableAttribute('class', 'table-striped');
$list->addTableColumnGroup(array(40, 40, '*', 153, 153));
$tdIcon = '<i class="rex-icon rex-icon-template"></i>';
$thIcon = '<a href="' . $list->getUrl(['func' => 'add']) . '"' . rex::getAccesskey(rex_i18n::msg('create_template'), 'add') . ' title="' . rex_i18n::msg('create_template') . '"><i class="rex-icon rex-icon-add-template"></i></a>';
$list->addColumn($thIcon, $tdIcon, 0, ['<th class="rex-table-icon">###VALUE###</th>', '<td class="rex-table-icon">###VALUE###</td>']);
$list->setColumnLabel('id', 'ID');
$list->setColumnLayout('id', array('<th class="rex-small">###VALUE###</th>', '<td class="rex-small">###VALUE###</td>'));
$list->setColumnLabel('name', rex_i18n::msg('yform_email_header_template_description'));
$list->setColumnParams('name', array('page' => $page, 'func' => 'edit', 'template_id' => '###id###'));
$list->setColumnLabel('mail_from', rex_i18n::msg('yform_email_header_template_mail_from'));
$list->setColumnLabel('mail_from_name', rex_i18n::msg('yform_email_header_template_mail_from_name'));
$list->setColumnLabel('subject', rex_i18n::msg('yform_email_header_template_subject'));
$list->removeColumn('body');