本文整理汇总了PHP中rex_select::setSelected方法的典型用法代码示例。如果您正苦于以下问题:PHP rex_select::setSelected方法的具体用法?PHP rex_select::setSelected怎么用?PHP rex_select::setSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rex_select
的用法示例。
在下文中一共展示了rex_select::setSelected方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enterObject
function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
{
$this->label = $this->elements[1];
$multiple = FALSE;
if (isset($this->elements[6]) && $this->elements[6] == 1) {
$multiple = TRUE;
}
$SEL = new rex_select();
$SEL->setId("el_" . $this->id);
if ($multiple) {
$SEL->setName("FORM[" . $this->params["form_name"] . "][el_" . $this->id . "][]");
$SEL->setSize(5);
$SEL->setMultiple(1);
if (!is_array($this->value)) {
$this->value = array();
}
} else {
$SEL->setName("FORM[" . $this->params["form_name"] . "][el_" . $this->id . "]");
$SEL->setSize(1);
$this->value = stripslashes($this->value);
}
foreach ($this->getKeys() as $k => $v) {
$SEL->addOption($v, $k);
}
if ($this->value == "" && !$send) {
if (isset($this->elements[5])) {
$SEL->setSelected($this->elements[5]);
}
} else {
if (is_array($this->value)) {
foreach ($this->value as $val) {
$SEL->setSelected($val);
}
} else {
$SEL->setSelected($this->value);
}
}
$wc = "";
if (isset($warning["el_" . $this->getId()])) {
$wc = $warning["el_" . $this->getId()];
}
$SEL->setStyle(' class="select ' . $wc . '"');
$form_output[] = '
<p class="formselect formlabel-' . $this->label . '">
<label class="select ' . $wc . '" for="el_' . $this->id . '" >' . $this->elements[2] . '</label>' . $SEL->get() . '
</p>';
$email_elements[$this->elements[1]] = $this->value;
if (!isset($this->elements[4]) || $this->elements[4] != "no_db") {
$sql_elements[$this->elements[1]] = $this->value;
}
}
示例2: enterObject
function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
{
$multiple = FALSE;
if (isset($this->elements[6]) && $this->elements[6] == 1) {
$multiple = TRUE;
}
$size = (int) $this->getElement(7);
if ($size < 1) {
$size = 1;
}
$SEL = new rex_select();
$SEL->setId("el_" . $this->getId());
if ($multiple) {
if ($size == 1) {
$size = 2;
}
$SEL->setName($this->getFormFieldname() . "[]");
$SEL->setSize($size);
$SEL->setMultiple(1);
} else {
$SEL->setName($this->getFormFieldname());
$SEL->setSize(1);
}
foreach (explode(',', $this->elements[3]) as $v) {
$teile = explode('=', $v);
$wert = $teile[0];
if (isset($teile[1])) {
$bezeichnung = $teile[1];
} else {
$bezeichnung = $teile[0];
}
$SEL->addOption(rex_translate($wert), $bezeichnung);
}
if (!$send && $this->value == "" && isset($this->elements[5]) && $this->elements[5] != "") {
$this->value = $this->elements[5];
}
if (!is_array($this->getValue())) {
$this->value = explode(",", $this->getValue());
}
foreach ($this->getValue() as $v) {
$SEL->setSelected($v);
}
$this->value = implode(",", $this->getValue());
$wc = "";
if (isset($warning[$this->getId()])) {
$wc = $warning[$this->getId()];
}
$SEL->setStyle(' class="select ' . $wc . '"');
$form_output[$this->getId()] = '
<p class="formselect formlabel-' . $this->getName() . '" id="' . $this->getHTMLId() . '">
<label class="select ' . $wc . '" for="el_' . $this->getId() . '" >' . rex_translate($this->getElement(2)) . '</label>' . $SEL->get() . '</p>';
$email_elements[$this->elements[1]] = $this->getValue();
if (!isset($this->elements[4]) || $this->elements[4] != "no_db") {
$sql_elements[$this->elements[1]] = $this->getValue();
}
}
示例3: enterObject
function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
{
$SEL = new rex_select();
$SEL->setName('FORM[' . $this->params["form_name"] . '][el_' . $this->id . ']');
$SEL->setId("el_" . $this->id);
$SEL->setSize(1);
$sql = $this->elements[4];
$teams = rex_sql::factory();
$teams->debugsql = $this->params["debug"];
$teams->setQuery($sql);
$sqlnames = array();
// mit --- keine auswahl ---
if ($this->elements[3] != 1) {
$SEL->addOption($this->elements[3], "0");
}
foreach ($teams->getArray() as $t) {
if (!isset($this->elements[6]) || $this->elements[6] == "") {
$v = $t['name'];
} else {
$v = $t[$this->elements[6]];
}
if ($this->elements[5] == "") {
$k = $t['id'];
} else {
$k = $t[$this->elements[5]];
}
$SEL->addOption($v, $k);
if (isset($this->elements[7])) {
$sqlnames[$k] = $t[$this->elements[7]];
}
}
$wc = "";
if (isset($warning["el_" . $this->getId()])) {
$wc = $warning["el_" . $this->getId()];
}
$SEL->setStyle(' class="select ' . $wc . '"');
if ($this->value == "" && isset($this->elements[7]) && $this->elements[7] != "") {
$this->value = $this->elements[7];
}
$SEL->setSelected($this->value);
$form_output[] = '
<p class="formselect" id="' . $this->getHTMLId() . '">
<label class="select ' . $wc . '" for="el_' . $this->id . '" >' . $this->elements[2] . '</label>
' . $SEL->get() . '
</p>';
$email_elements[$this->elements[1]] = stripslashes($this->value);
if (isset($sqlnames[$this->value])) {
$email_elements[$this->elements[1] . '_SQLNAME'] = stripslashes($sqlnames[$this->value]);
}
if (!isset($this->elements[8]) || $this->elements[8] != "no_db") {
$sql_elements[$this->elements[1]] = $this->value;
}
}
示例4: enterObject
function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
{
// ***** SELECT FESTLEGEN
$SEL = new rex_select();
$SEL->setName('FORM[' . $this->params["form_name"] . '][el_' . $this->id . '][]');
$SEL->setId("el_" . $this->id);
$SEL->setSize(5);
$SEL->setMultiple(1);
// ***** SQL - ROHDATEN ZIEHEN
$sql = $this->elements[5];
$teams = rex_sql::factory();
$teams->debugsql = $this->params["debug"];
$teams->setQuery($sql);
for ($t = 0; $t < $teams->getRows(); $t++) {
$SEL->addOption($teams->getValue($this->elements[7]), $teams->getValue($this->elements[6]));
$teams->next();
}
$wc = "";
// if (isset($warning["el_" . $this->getId()])) $wc = $warning["el_" . $this->getId()];
$SEL->setStyle('class="multipleselect ' . $wc . '"');
// ***** EINGELOGGT ODER NICHT SETZEN
if ($send == 0) {
// erster aufruf
// Daten ziehen
if ($this->params["main_id"] > 0) {
$this->value = array();
$g = rex_sql::factory();
$g->debugsql = $this->params["debug"];
$g->setQuery('select ' . $this->elements[3] . ' from ' . $this->elements[1] . ' where ' . $this->elements[2] . '=' . $this->params["main_id"]);
$gg = $g->getArray();
if (is_array($gg)) {
foreach ($gg as $g) {
$this->value[] = $g[$this->elements[3]];
}
}
}
}
// ***** AUSWAHL SETZEN
if (is_array($this->value)) {
foreach ($this->value as $val) {
$SEL->setSelected($val);
}
}
// ***** AUSGEBEN
$form_output[] = '
<p class="formmultipleselect" id="' . $this->getHTMLId() . '">
<label class="multipleselect ' . $wc . '" for="el_' . $this->id . '" >' . $this->elements[4] . '</label>
' . $SEL->get() . '
</p>';
}
示例5: enterObject
function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
{
$SEL = new rex_select();
$SEL->setName('FORM[' . $this->params["form_name"] . '][el_' . $this->id . ']');
$SEL->setId("el_" . $this->id);
$SEL->setSize(1);
$sql = $this->elements[4];
$teams = new rex_sql();
$teams->debugsql = $this->params["debug"];
$teams->setQuery($sql);
$sqlnames = array();
if ($this->elements[3] != 1) {
// mit --- keine auswahl ---
$SEL->addOption($this->elements[3], "0");
}
for ($t = 0; $t < $teams->getRows(); $t++) {
$SEL->addOption($teams->getValue($this->elements[6]), $teams->getValue($this->elements[5]));
if (isset($this->elements[7])) {
$sqlnames[$teams->getValue($this->elements[5])] = $teams->getValue($this->elements[7]);
}
$teams->next();
}
$wc = "";
if (isset($warning["el_" . $this->getId()])) {
$wc = $warning["el_" . $this->getId()];
}
$SEL->setStyle(' class="select ' . $wc . '"');
if ($this->value == "" && isset($this->elements[7]) && $this->elements[7] != "") {
$this->value = $this->elements[7];
}
$SEL->setSelected($this->value);
$form_output[] = '
<p class="formselect">
<label class="select ' . $wc . '" for="el_' . $this->id . '" >' . $this->elements[2] . '</label>
' . $SEL->get() . '
</p>';
$email_elements[$this->elements[1]] = stripslashes($this->value);
if (isset($sqlnames[$this->value])) {
$email_elements[$this->elements[1] . '_SQLNAME'] = stripslashes($sqlnames[$this->value]);
}
if (!isset($this->elements[8]) || $this->elements[8] != "no_db") {
$sql_elements[$this->elements[1]] = $this->value;
}
}
示例6: formatElement
function formatElement()
{
global $I18N;
$name = $this->getAttribute('name') . '[]';
$value = explode('|', htmlspecialchars($this->getValue()));
if (count($value) != 4) {
$value = array(null, 1, 'd');
}
$select = new rex_select();
$select->setAttribute('class', 'rex-form-select rex-a630-interval');
$select->setStyle('width:120px');
$select->setName($name);
$select->setSize(1);
$select->addOption($I18N->msg('cronjob_interval_hour'), 'h');
$select->addOption($I18N->msg('cronjob_interval_day'), 'd');
$select->addOption($I18N->msg('cronjob_interval_week'), 'w');
$select->addOption($I18N->msg('cronjob_interval_month'), 'm');
$select->addOption($I18N->msg('cronjob_interval_year'), 'y');
$select->setSelected($value[2]);
return '
<input type="text" class="rex-form-text rex-a630-interval" name="' . $name . '" style="width:20px; margin-right: 5px;" value="' . $value[1] . '" />
' . $select->get() . "\n";
}
示例7: rex_a62_metaFields
//.........这里部分代码省略.........
$labelIt = false;
$tag = 'div';
$tag_attr = ' class="rex-chckbxs rex-ptag"';
$field .= '<p>' . $label . '</p>';
}
foreach ($values as $key => $value) {
$id = preg_replace('/[^a-zA-Z\\-0-9_]/', '_', $id . $key);
$key = htmlspecialchars($key);
// wenn man keine Werte angibt (Boolean Chkbox/Radio)
// Dummy Wert annehmen, damit an/aus unterscheidung funktioniert
if ($oneValue && $key == '') {
$key = 'true';
}
$selected = '';
if (in_array($key, $dbvalues_esc)) {
$selected = ' checked="checked"';
}
if ($oneValue) {
$tag_attr = ' class="' . $class . '"';
$field .= '<input type="' . $typeLabel . '" name="' . $name . '" value="' . $key . '" id="' . $id . '" ' . $attr . $selected . ' />' . "\n";
} else {
$field .= '<p class="' . $class . '">' . "\n";
$field .= '<label for="' . $id . '"><span>' . htmlspecialchars($value) . '</span></label>';
$field .= '<input type="' . $typeLabel . '" name="' . $name . '" value="' . $key . '" id="' . $id . '" ' . $attr . $selected . ' />' . "\n";
$field .= '</p>' . "\n";
}
}
break;
case 'select':
$select = new rex_select();
$select->setName($name);
$select->setId($id);
// hier mit den "raw"-values arbeiten, da die rex_select klasse selbst escaped
$select->setSelected($dbvalues);
foreach (rex_split_string($attr) as $attr_name => $attr_value) {
if (empty($attr_name)) {
continue;
}
$select->setAttribute($attr_name, $attr_value);
if ($attr_name == 'multiple') {
$select->setName($name . '[]');
}
}
if (rex_sql::getQueryType($params) == 'SELECT') {
// Werte via SQL Laden
$select->addDBSqlOptions($params);
} else {
// Optionen mit | separiert
// eine einzelne Option kann mit key:value separiert werden
$values = array();
$value_groups = explode('|', $params);
foreach ($value_groups as $value_group) {
if (strpos($value_group, ':') !== false) {
$temp = explode(':', $value_group);
$values[$temp[0]] = $temp[1];
} else {
$values[$value_group] = $value_group;
}
}
$select->addOptions($values);
}
$field .= $select->get();
break;
case 'datetime':
case 'date':
if ($dbvalues_esc[0] == '') {
示例8: foreach
$select->addOption("nur News, die den Status \"online\" haben", 101);
$select->addOption("nur News, die den Status \"auf Startseite\" haben", 102);
$qry = 'SELECT id, name from ' . TBL_NEWS_CATS;
$sql = new rex_sql();
$data = $sql->getArray($qry);
if (is_array($data) && sizeof($data) > 0) {
foreach ($data as $row) {
$select->addOption("nur aus " . $row['name'], $row['id']);
}
}
if (sizeof($REX['CLANG']) > 1) {
foreach ($REX['CLANG'] as $k => $v) {
$select->addOption("nur folgende Sprache: " . $v, 'clang_' . $k);
}
}
$select->setSelected(rex_request('filter'));
echo $select->get();
?>
</fieldset>
</form>
</div>
<div class="rex-clearer"></div>
</div>
</div>
<div id="addon_news">
<?php
$filter = rex_request('filter');
if ($filter > 0 and $filter != 999) {
switch ($filter) {
case 101:
$addSql = " AND status=1";
示例9: foreach
}
}
$ctypes_out = '';
$i = 1;
$ctypes[] = '';
// Extra, fŸr Neue Spalte
if (is_array($ctypes)) {
foreach ($ctypes as $id => $name) {
$modul_select->setName('modules[' . $i . '][]');
$modul_select->setId('modules_' . $i . '_select');
$modul_select->resetSelected();
if (isset($modules[$i]) && count($modules[$i]) > 0) {
foreach ($modules[$i] as $j => $jj) {
// typsicherer vergleich, weil (0 != "all") => false
if ($j !== 'all') {
$modul_select->setSelected($jj);
}
}
}
$ctypes_out .= '
<div class="rex-form-row">
<p class="rex-form-col-a rex-form-text">
<label for="ctype' . $i . '">ID=' . $i . '</label>
<input class="rex-form-text" id="ctype' . $i . '" type="text" name="ctype[' . $i . ']" value="' . htmlspecialchars($name) . '" />
</p>
<p class="rex-form-col-a rex-form-checkbox rex-form-label-right">
<input class="rex-form-checkbox" id="allmodules' . $i . '" type="checkbox" name="modules[' . $i . '][all]" ';
if (!isset($modules[$i]['all']) || $modules[$i]['all'] == 1) {
$ctypes_out .= ' checked="checked" ';
}
$ctypes_out .= ' value="1" />
示例10: rex_a62_metaFields
//.........这里部分代码省略.........
$field .= '<p class="rex-form-' . $class_s . ' rex-form-label-right' . $classAdd . '">' . "\n";
$field .= '<input class="rex-form-' . $class_s . '" type="' . $typeLabel . '" name="' . $name . '" value="' . htmlspecialchars($key) . '" id="' . $id . '" ' . $attrStr . $selected . ' />' . "\n";
$field .= '<label for="' . $id . '">' . htmlspecialchars($value) . '</label>';
$field .= '</p>' . "\n";
}
}
if (!$oneValue) {
$field .= '</div>';
}
break;
case 'select':
$tag_attr = ' class="rex-form-select"';
$select = new rex_select();
$select->setStyle('class="rex-form-select"');
$select->setName($name);
$select->setId($id);
$multiple = false;
foreach ($attrArray as $attr_name => $attr_value) {
if (empty($attr_name)) {
continue;
}
$select->setAttribute($attr_name, $attr_value);
if ($attr_name == 'multiple') {
$multiple = true;
$select->setName($name . '[]');
}
}
// Beachte auch default values in multiple fields bei ADD.
// Im EDIT wurde dies bereits vorher gehandelt
if ($multiple && !$activeItem) {
$dbvalues = explode('|', $defaultValue);
}
// hier mit den "raw"-values arbeiten, da die rex_select klasse selbst escaped
$select->setSelected($dbvalues);
if (!$multiple) {
$select->setSize(1);
}
if (rex_sql::getQueryType($params) == 'SELECT') {
// Werte via SQL Laden
$select->addDBSqlOptions($params);
} else {
// Optionen mit | separiert
// eine einzelne Option kann mit key:value separiert werden
$values = array();
$value_groups = explode('|', $params);
foreach ($value_groups as $value_group) {
// check ob key:value paar
// und der wert beginnt nicht mit "translate:"
if (strpos($value_group, ':') !== false && strpos($value_group, 'translate:') !== 0) {
$temp = explode(':', $value_group, 2);
$values[$temp[0]] = rex_translate($temp[1]);
} else {
$values[$value_group] = rex_translate($value_group);
}
}
$select->addOptions($values);
}
$field .= $select->get();
break;
case 'date':
case 'time':
case 'datetime':
$tag_attr = ' class="rex-form-select-date"';
$active = $dbvalues[0] != 0;
if ($dbvalues[0] == '') {
$dbvalues[0] = time();
示例11: count
$tableSelect->setSelected($table);
}
}
$formElements = [];
$n = [];
$n['header'] = '<div id="rex-js-exporttype-sql-div">';
$n['label'] = '<label for="rex-form-exporttables">' . rex_i18n::msg('backup_export_select_tables') . '</label>';
$n['field'] = $tableSelect->get();
$n['footer'] = '</div>';
$formElements[] = $n;
// Vorhandene Exporte auslesen
$sel_dirs = new rex_select();
$sel_dirs->setId('rex-form-exportdir');
$sel_dirs->setName('EXPDIR[]');
$sel_dirs->setMultiple();
$sel_dirs->setSelected($EXPDIR);
$sel_dirs->setStyle('class="form-control"');
$dir = rex_path::frontend();
$folders = rex_finder::factory($dir)->dirsOnly()->ignoreDirs('.*')->ignoreDirs('redaxo');
$folders = iterator_to_array($folders);
$count_folders = count($folders);
if ($count_folders > 4) {
$sel_dirs->setSize($count_folders);
}
foreach ($folders as $file) {
$file = basename($file);
$sel_dirs->addOption($file, $file);
}
$n = [];
$n['header'] = '<div id="rex-js-exporttype-files-div" style="display: none;">';
$n['label'] = '<label for="rex-form-exportdir">' . rex_i18n::msg('backup_export_select_dir') . '</label>';
示例12: htmlspecialchars
?>
<p class="rex-form-select">
<label class="select " for="divider" ><?php
echo $I18N->msg('xform_manager_import_divider');
?>
</label>
<?php
$a = new rex_select();
$a->setName('divider');
$a->setId('divider');
$a->setSize(1);
$a->addOption($I18N->msg('xform_manager_import_divider_semicolon') . ' (;)', ';');
$a->addOption($I18N->msg('xform_manager_import_divider_comma') . ' (,)', ',');
$a->addOption($I18N->msg('xform_manager_import_divider_tab') . '', 'tab');
$a->setSelected($divider);
echo $a->get();
?>
</p>
<p class="rex-form-text">
<label for="rex-form-error-replacefield"><?php
echo $I18N->msg('xform_manager_import_unique_field');
?>
</label>
<input class="rex-form-text" type="text" id="rex-form-replacefield" name="replacefield" value="<?php
echo htmlspecialchars(stripslashes($replacefield));
?>
" />
</p>
示例13: catch
$sel_be_sprache = new rex_select();
$sel_be_sprache->setSize(1);
$sel_be_sprache->setStyle('class="form-control"');
$sel_be_sprache->setName('userperm_be_sprache');
$sel_be_sprache->setId('rex-id-userperm-mylang');
$sel_be_sprache->addOption('default', '');
$saveLocale = rex_i18n::getLocale();
$langs = [];
foreach (rex_i18n::getLocales() as $locale) {
rex_i18n::setLocale($locale, false);
// Locale nicht neu setzen
$sel_be_sprache->addOption(rex_i18n::msg('lang'), $locale);
}
rex_i18n::setLocale($saveLocale, false);
$userperm_be_sprache = rex_request('userperm_be_sprache', 'string', $user->getLanguage());
$sel_be_sprache->setSelected($userperm_be_sprache);
// --------------------------------- FUNCTIONS
if (rex_post('upd_profile_button', 'bool')) {
$updateuser = rex_sql::factory();
$updateuser->setTable(rex::getTablePrefix() . 'user');
$updateuser->setWhere(['id' => $user_id]);
$updateuser->setValue('name', $username);
$updateuser->setValue('description', $userdesc);
$updateuser->setValue('language', $userperm_be_sprache);
$updateuser->addGlobalUpdateFields();
try {
$updateuser->update();
$success = rex_i18n::msg('user_data_updated');
} catch (rex_sql_exception $e) {
$error = $e->getMessage();
}
示例14: enterObject
//.........这里部分代码省略.........
<span class="rex-widget-column rex-widget-column-first">
<a href="#" class="rex-icon-file-open"
onclick="xform_manager_openDatalist(' . $this->getId() . ', \'' . $this->be_em["target_field"] . '\', \'' . $link . '\',\'' . $multiple . '\');return false;"
title="' . $I18N->msg("xform_relation_choose_entry") . '"></a>
<a href="#" class="rex-icon-file-delete"
onclick="xform_manager_deleteDatalist(' . $this->getId() . ',\'' . $multiple . '\');return false;"
title="' . $I18N->msg("xform_relation_delete_entry") . '"></a>
</span>
</p>
</div>
</div>
<div class="rex-clearer"></div>
';
}
$form_output[] = '
<p class="formpopup" id="' . $this->getHTMLId() . '">
<label class="select ' . $wc . '" for="el_' . $this->id . '" >' . $this->be_em["label"] . '</label>
' . $out . '
</p>';
}
// --------------------------------------- POPUP, 1-n
if ($this->be_em["relation_type"] == 4) {
$text = 'not yet implemented';
// TODO
/*
if($this->params["main_id"] < 1)
{
$text = 'Diesen Bereich können Sie erst bearbeiten, wenn der Datensatz angelegt wurde.';
}else
{
$link = 'javascript:rex_xform_openRelation('.$this->getId().',\''.$this->be_em["target_table"].'\',\'id'.
'&rex_em_filter['.$this->be_em["target_field"].']='.$this->params["main_id"].
'&rex_em_set['.$this->be_em["target_field"].']='.$this->params["main_id"].
'&page='.$this->be_em["page"].
'&subpage='.$this->be_em["subpage"].
'\');';
$text = '<a href="'.$link.'">'.
'Link'.
'</a>';
}
*/
$form_output[] = '
<p class="formhtml" id="' . $this->getHTMLId() . '">
<label class="select " for="el_' . $this->getId() . '" >' . $this->be_em["label"] . '</label>
<input type="hidden" name="FORM[' . $this->params["form_name"] . '][el_' . $this->getId() . '][]" id="REX_RELATION_' . $this->getId() . '" />
<span>' . $text . '</span>
</p>';
return;
}
// --------------------------------------- Selectbox, single or multiple
if ($this->be_em["relation_type"] < 2) {
if ($send == 1 && $this->be_em["eoption"] == 0 && count($this->getValue()) == 0) {
// Error. Fehlermeldung ausgeben
$this->params["warning"][] = $this->elements[7];
$this->params["warning_messages"][] = $this->elements[7];
$wc = $this->params["error_class"];
}
$wc = "";
if (isset($warning[$this->getId()])) {
$wc = $warning[$this->getId()];
}
// ----- SELECT BOX
$sss = rex_sql::factory();
$sss->debugsql = $this->params["debug"];
$sss->setQuery('select * from ' . $this->be_em["target_table"] . ' order by ' . $this->be_em["target_field"]);
$SEL = new rex_select();
$SEL->setName('FORM[' . $this->params["form_name"] . '][el_' . $this->id . '][]');
$SEL->setId("el_" . $this->id);
$SEL->setStyle('class="select"');
$SEL->setDisabled($disabled);
$SEL->setSize(1);
// mit --- keine auswahl ---
if ($this->be_em["relation_type"] == 1) {
$SEL->setMultiple(TRUE);
$SEL->setSize(5);
} elseif ($this->be_em["eoption"] == 1) {
$SEL->addOption("-", "");
}
foreach ($sss->getArray() as $v) {
$s = $v[$this->be_em["target_field"]];
if (strlen($s) > 50) {
$s = substr($s, 0, 45) . ' ... ';
}
$s = $s . ' [id=' . $v["id"] . ']';
$SEL->addOption($s, $v["id"]);
}
// var_dump($this->getValue());
$SEL->setSelected($this->getValue());
$form_output[] = '
<p class="formselect" id="' . $this->getHTMLId() . '">
<label class="select ' . $wc . '" for="el_' . $this->id . '" >' . $this->be_em["label"] . '</label>
' . $SEL->get() . '
</p>';
}
// --------------------------------------- save
$email_elements[$this->getName()] = stripslashes(implode(",", $this->getValue()));
$sql_elements[$this->getName()] = implode(",", $this->getValue());
}
示例15: foreach
$allcatschecked = ' checked="checked"';
}
if ($allmcats == 1) {
$allmcatschecked = ' checked="checked"';
}
// userperm_all
foreach ($userperm_all as $_perm) {
$sel_all->setSelected($_perm);
}
// userperm_ext
foreach ($userperm_ext as $_perm) {
$sel_ext->setSelected($_perm);
}
// userperm_extra
foreach ($userperm_extra as $_perm) {
$sel_extra->setSelected($_perm);
}
// userperm_sprachen
foreach ($userperm_sprachen as $_perm) {
$sel_sprachen->setSelected($_perm);
}
if ($userperm_mylang == '') {
$userperm_mylang = 'be_lang[default]';
}
$sel_mylang->setSelected($userperm_mylang);
// userperm_cat
foreach ($userperm_cat as $_perm) {
$sel_cat->setSelected($_perm);
}
// userperm_media
foreach ($userperm_media as $_perm) {