本文整理汇总了PHP中rex_list::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_list::factory方法的具体用法?PHP rex_list::factory怎么用?PHP rex_list::factory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_list
的用法示例。
在下文中一共展示了rex_list::factory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFieldPage
//.........这里部分代码省略.........
$_fields = array();
foreach (rex_xform_manager_table::getXFormFieldsByType($table['table_name']) as $_k => $_v) {
$_fields[] = $_k;
}
$xform->setValueField('select', array($field, $v['label'], implode(',', $_fields), '', '', 0));
break;
case 'select_names':
// Todo: Mehrere Namen aus denanderen Federn ziehen und als multiselectbox anbieten
$_fields = array();
foreach (rex_xform_manager_table::getXFormFieldsByType($table['table_name']) as $_k => $_v) {
$_fields[] = $_k;
}
$xform->setValueField('select', array($field, $v['label'], implode(',', $_fields), '', '', 1, 5));
break;
default:
// nur beim "Bezeichnungsfeld"
if ($field == 'label' && $type_real_field != '' && !isset($v['value'])) {
$v['value'] = $type_real_field;
} elseif (!isset($v['value'])) {
$v['value'] = '';
}
$xform->setValueField('text', array($field, $v['label'], $v['value']));
}
}
$xform->setActionField('showtext', array('', '<p>' . $I18N->msg('thankyouforentry') . '</p>'));
$xform->setObjectparams('main_table', $REX['TABLE_PREFIX'] . 'xform_field');
// f�r db speicherungen und unique abfragen
if ($func == 'edit') {
$xform->setObjectparams('submit_btn_label', $I18N->msg('save'));
$xform->setHiddenField('field_id', $field_id);
$xform->setActionField('manage_db', array($REX['TABLE_PREFIX'] . 'xform_field', "id={$field_id}"));
$xform->setObjectparams('main_id', $field_id);
$xform->setObjectparams('main_where', "id={$field_id}");
$sql = rex_sql::factory();
$sql->setQuery("SELECT * FROM " . $REX['TABLE_PREFIX'] . "xform_field WHERE id={$field_id}");
foreach ($selectFields as $alias => $field) {
if ($alias != $field) {
if ((!$sql->hasValue($field) || !$sql->getValue($field)) && $sql->hasValue($alias)) {
$sql->setValue($field, $sql->getValue($alias));
}
$xform->setValueField('hidden', array($alias, ''));
}
}
$xform->setObjectparams('sql_object', $sql);
$xform->setObjectparams('getdata', true);
} elseif ($func == 'add') {
$xform->setObjectparams('submit_btn_label', $I18N->msg('add'));
$xform->setActionField('manage_db', array($REX['TABLE_PREFIX'] . 'xform_field'));
}
if ($type_id == 'value') {
$xform->setValueField('checkbox', array('list_hidden', $I18N->msg('hideinlist'), 1, '1'));
$xform->setValueField('checkbox', array('search', $I18N->msg('useassearchfieldalidatenamenotempty'), 1, '1'));
} elseif ($type_id == 'validate') {
$xform->setValueField('hidden', array('list_hidden', 1));
}
$form = $xform->getForm();
if ($xform->objparams['form_show']) {
if ($func == 'add') {
echo '<div class="rex-addon-output"><h3 class="rex-hl2">' . $I18N->msg('addfield') . ' "' . $type_name . '"</h3><div class="rex-addon-content">';
} else {
echo '<div class="rex-addon-output"><h3 class="rex-hl2">' . $I18N->msg('editfield') . ' "' . $type_name . '"</h3><div class="rex-addon-content">';
}
echo $form;
echo '</div></div>';
$table_echo = '<a href="index.php?' . $link_vars . '&table_name=' . $table['table_name'] . '"><b>« ' . $I18N->msg('back_to_overview') . '</b></a>';
echo rex_content_block($table_echo);
示例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
});
//--></script>';
$OUT = false;
}
}
if ($OUT) {
if ($info != '') {
echo rex_info($info);
}
if ($warning != '') {
echo rex_warning($warning);
}
$list = rex_list::factory('SELECT id, name, active FROM ' . $REX['TABLE_PREFIX'] . 'template ORDER BY name');
$list->setCaption($I18N->msg('header_template_caption'));
$list->addTableAttribute('summary', $I18N->msg('header_template_summary'));
$list->addTableColumnGroup(array(40, 40, '*', 153, 153));
$tdIcon = '<span class="rex-i-element rex-i-template"><span class="rex-i-element-text">###name###</span></span>';
$thIcon = '<a class="rex-i-element rex-i-template-add" href="' . $list->getUrl(array('function' => 'add')) . '"' . rex_accesskey($I18N->msg('create_template'), $REX['ACKEY']['ADD']) . '><span class="rex-i-element-text">' . $I18N->msg('create_template') . '</span></a>';
$list->addColumn($thIcon, $tdIcon, 0, array('<th class="rex-icon">###VALUE###</th>', '<td class="rex-icon">###VALUE###</td>'));
$list->setColumnParams($thIcon, array('function' => 'edit', 'template_id' => '###id###'));
$list->setColumnLabel('id', 'ID');
$list->setColumnLayout('id', array('<th class="rex-small">###VALUE###</th>', '<td class="rex-small">###VALUE###</td>'));
$list->setColumnLabel('name', $I18N->msg('header_template_description'));
$list->setColumnParams('name', array('function' => 'edit', 'template_id' => '###id###'));
$list->setColumnLabel('active', $I18N->msg('header_template_active'));
$list->setColumnFormat('active', 'custom', create_function('$params', 'global $I18N; $list = $params["list"]; return $list->getValue("active") == 1 ? $I18N->msg("yes") : $I18N->msg("no");'));
$list->addColumn($I18N->msg('header_template_functions'), $I18N->msg('delete_template'));
$list->setColumnParams($I18N->msg('header_template_functions'), array('function' => 'delete', 'template_id' => '###id###'));
示例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
$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'));
示例9: 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;
示例10: 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>'));
示例11: getFieldPage
//.........这里部分代码省略.........
// Todo:
case 'select_name':
$_fields = array();
foreach ($table->getValueFields() as $_k => $_v) {
$_fields[] = $_k;
}
$xform->setValueField('select', array($field, $v['label'], implode(',', $_fields), '', '', 0));
break;
case 'select_names':
$_fields = array();
foreach ($table->getValueFields() as $_k => $_v) {
$_fields[] = $_k;
}
$xform->setValueField('select', array($field, $v['label'], implode(',', $_fields), '', '', 1, 5));
break;
default:
// nur beim "Bezeichnungsfeld"
if ($field == 'label' && $type_real_field != '' && !isset($v['value'])) {
$v['value'] = $type_real_field;
} elseif (!isset($v['value'])) {
$v['value'] = '';
}
$xform->setValueField('text', array($field, $v['label'], $v['value']));
}
}
$xform->setActionField('showtext', array('', '<p>' . $I18N->msg('xform_thankyouforentry') . '</p>'));
$xform->setObjectparams('main_table', rex_xform_manager_field::table());
if ($func == 'edit') {
$xform->setObjectparams('submit_btn_label', $I18N->msg('xform_save'));
$xform->setHiddenField('field_id', $field_id);
$xform->setActionField('manage_db', array(rex_xform_manager_field::table(), "id={$field_id}"));
$xform->setObjectparams('main_id', $field_id);
$xform->setObjectparams('main_where', "id={$field_id}");
$sql = rex_sql::factory();
$sql->setQuery('SELECT * FROM ' . rex_xform_manager_field::table() . " WHERE id={$field_id}");
foreach ($selectFields as $alias => $field) {
if ($alias != $field) {
if ((!$sql->hasValue($field) || null === $sql->getValue($field) || '' === $sql->getValue($field)) && $sql->hasValue($alias)) {
$sql->setValue($field, $sql->getValue($alias));
}
$xform->setValueField('hidden', array($alias, ''));
}
}
$xform->setObjectparams('sql_object', $sql);
$xform->setObjectparams('getdata', true);
} elseif ($func == 'add') {
$xform->setObjectparams('submit_btn_label', $I18N->msg('xform_add'));
$xform->setActionField('manage_db', array(rex_xform_manager_field::table()));
}
if ($type_id == 'value') {
$xform->setValueField('checkbox', array('list_hidden', $I18N->msg('xform_hideinlist'), 1, '1'));
$xform->setValueField('checkbox', array('search', $I18N->msg('xform_useassearchfieldalidatenamenotempty'), 1, '1'));
} elseif ($type_id == 'validate') {
$xform->setValueField('hidden', array('list_hidden', 1));
}
$form = $xform->getForm();
if ($xform->objparams['form_show']) {
if ($func == 'add') {
echo '<div class="rex-addon-output"><h3 class="rex-hl2">' . $I18N->msg('xform_addfield') . ' "' . $type_name . '"</h3><div class="rex-addon-content">';
} else {
echo '<div class="rex-addon-output"><h3 class="rex-hl2">' . $I18N->msg('xform_editfield') . ' "' . $type_name . '"</h3><div class="rex-addon-content">';
}
echo $form;
echo '</div></div>';
$table_echo = '<a href="index.php?' . $link_vars . '&table_name=' . $table->getTableName() . '"><b>« ' . $I18N->msg('xform_back_to_overview') . '</b></a>';
echo rex_content_block($table_echo);
示例12: 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);
示例13:
<?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###']);
示例14: 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;
}
示例15: rex_request
<?php
$func = rex_request('func', 'string');
if ($func == 'delete') {
$id = rex_request('id', 'int');
$sql = rex_sql::factory();
// $sql->setDebug();
$sql->setTable('rex_aufgaben_kategorien');
$sql->setWhere('id = ' . $id);
if ($sql->delete()) {
echo '<div class="alert alert-success">Die Kategorie wurde gelöscht.</div>';
}
$func = '';
}
if ($func == '') {
$list = rex_list::factory("SELECT * FROM " . rex::getTablePrefix() . "aufgaben_kategorien ORDER BY kategorie ASC");
$list->addTableAttribute('class', 'table-striped');
$list->setNoRowsMessage('<div class="alert alert-info" role="alert"><strong>Keine Kategorie vorhanden.</strong><br/>Bitte legen Sie eine Kategroie an.</div>');
// icon column
$thIcon = '<a href="' . $list->getUrl(['func' => 'add']) . '" title="Kategorie hinzufügen"><i class="rex-icon rex-icon-add-action"></i></a>';
$tdIcon = '<i class="rex-icon fa-file-text-o"></i>';
$list->addColumn($thIcon, $tdIcon, 0, ['<th class="rex-table-icon">###VALUE###</th>', '<td class="rex-table-icon">###VALUE###</td>']);
$list->setColumnParams($thIcon, ['func' => 'edit', 'id' => '###id###']);
$list->setColumnLabel('kategorie', 'Kategorie');
$list->setColumnLabel('farbe', 'Farbe');
$delete = 'deleteCol';
$list->addColumn($delete, '<i class="rex-icon rex-icon-delete"></i> löschen', -1, ['', '<td class="rex-table-action">###VALUE###</td>']);
$list->setColumnParams($delete, ['id' => '###id###', 'func' => 'delete']);
$list->addLinkAttribute($delete, 'data-confirm', rex_i18n::msg('delete') . ' ?');
$list->removeColumn('id');
$content = $list->get();