• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP rex_select类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中rex_select的典型用法代码示例。如果您正苦于以下问题:PHP rex_select类的具体用法?PHP rex_select怎么用?PHP rex_select使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了rex_select类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($tag = '', &$table, $attributes = array())
 {
     global $I18N;
     global $REX;
     parent::rex_form_select_element('', $table, $attributes);
     $dummy = null;
     $this->chkbox_element = new rex_form_checkbox_element('', $dummy);
     $this->chkbox_element->setAttribute('name', 'enable_restrictions');
     $this->chkbox_element->setAttribute('id', 'enable_restrictions_chkbx');
     $this->chkbox_element->addOption($I18N->msg('minfo_field_label_no_restrictions'), '');
     if ($table->getPrefix() == 'art_' || $table->getPrefix() == 'cat_') {
         $restrictionsSelect = new rex_category_select(false, false, true, false);
     } elseif ($table->getPrefix() == 'med_') {
         $restrictionsSelect = new rex_mediacategory_select();
     } elseif ($table->getPrefix() == 'asd_') {
         $restrictionsSelect = new rex_select();
         $restrictionsSelect->addSqlOptions('SELECT `name`, `id` FROM ' . $REX['TABLE_PREFIX'] . 'asd_news_category');
         $restrictionsSelect->setSize(6);
     } else {
         trigger_error('Unexpected TablePrefix "' . $table->getPrefix() . '"!', E_USER_ERROR);
         exit;
     }
     $restrictionsSelect->setMultiple(true);
     $this->setSelect($restrictionsSelect);
     $this->setNotice($I18N->msg('ctrl'));
 }
开发者ID:Sysix,项目名称:asd_news,代码行数:26,代码来源:rex_form_asd_restrictions_element.php


示例2: setSelect

 public function setSelect(rex_select $selectObj)
 {
     $this->select = $selectObj;
     if ($selectObj->hasAttribute('multiple')) {
         $this->setAttribute('multiple', $selectObj->getAttribute('multiple'));
     }
 }
开发者ID:staabm,项目名称:redaxo,代码行数:7,代码来源:select.php


示例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;
        }
    }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:53,代码来源:class.xform.select_single_sql.inc.php


示例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>';
    }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:50,代码来源:class.xform.select_multiple_sql.inc.php


示例5: rex_event_select

 function rex_event_select($options)
 {
     global $I18N;
     parent::rex_select();
     $this->setMultiple(1);
     foreach ($options as $key => $value) {
         $this->addOption($value, $key);
     }
     $this->setSize(count($options));
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:10,代码来源:module.action.inc.php


示例6: buildSelectBoxes

 function buildSelectBoxes()
 {
     $select = new rex_select();
     // hier muss getName() nicht $name verwendet werden (section Prefix!)
     $select->setName($this->getName() . '[]');
     $select->setSize(1);
     $select->setStyle('width: 24%;');
     $this->daySelect = $select;
     $this->monthSelect = $select;
     $this->yearSelect = $select;
     foreach (range(1, 31) as $day) {
         $this->daySelect->addOption($day, $day);
     }
     foreach (range(1, 12) as $month) {
         $this->monthSelect->addOption($month, $month);
     }
     foreach (range(1995, 2050) as $year) {
         $this->yearSelect->addOption($year, $year);
     }
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:20,代码来源:field.dateField.inc.php


示例7: 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;
        }
    }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:44,代码来源:class.xform.select_single_sql.inc.php


示例8: getArticle

    function getArticle($curctype = -1)
    {
        global $module_id, $REX_USER, $REX, $I18N;
        $this->ctype = $curctype;
        $sliceLimit = '';
        if ($this->getSlice) {
            //$REX['GG'] = 0;
            $sliceLimit = " AND " . $REX['TABLE_PREFIX'] . "article_slice.id = '" . $this->getSlice . "' ";
        }
        // ----- start: article caching
        ob_start();
        ob_implicit_flush(0);
        if ($REX['GG'] && !$this->viasql && !$this->getSlice) {
            if ($this->article_id != 0) {
                $this->contents = '';
                $article_content_file = $REX['INCLUDE_PATH'] . '/generated/articles/' . $this->article_id . '.' . $this->clang . '.content';
                if ($cont = rex_get_file_contents($article_content_file)) {
                    $this->contents = $cont;
                    eval($this->contents);
                }
            }
        } else {
            if ($this->article_id != 0) {
                // ---------- alle teile/slices eines artikels auswaehlen
                $sql = "SELECT " . $REX['TABLE_PREFIX'] . "module.id, " . $REX['TABLE_PREFIX'] . "module.name, " . $REX['TABLE_PREFIX'] . "module.ausgabe, " . $REX['TABLE_PREFIX'] . "module.eingabe, " . $REX['TABLE_PREFIX'] . "article_slice.*, " . $REX['TABLE_PREFIX'] . "article.re_id\r\n          FROM\r\n            " . $REX['TABLE_PREFIX'] . "article_slice\r\n          LEFT JOIN " . $REX['TABLE_PREFIX'] . "module ON " . $REX['TABLE_PREFIX'] . "article_slice.modultyp_id=" . $REX['TABLE_PREFIX'] . "module.id\r\n          LEFT JOIN " . $REX['TABLE_PREFIX'] . "article ON " . $REX['TABLE_PREFIX'] . "article_slice.article_id=" . $REX['TABLE_PREFIX'] . "article.id\r\n          WHERE\r\n            " . $REX['TABLE_PREFIX'] . "article_slice.article_id='" . $this->article_id . "' AND\r\n            " . $REX['TABLE_PREFIX'] . "article_slice.clang='" . $this->clang . "' AND\r\n            " . $REX['TABLE_PREFIX'] . "article.clang='" . $this->clang . "'\r\n            " . $sliceLimit . "\r\n            ORDER BY " . $REX['TABLE_PREFIX'] . "article_slice.re_article_slice_id";
                $this->CONT = new rex_sql();
                $this->CONT->debugsql = 0;
                $this->CONT->setQuery($sql);
                $RE_CONTS = array();
                $RE_CONTS_CTYPE = array();
                $RE_MODUL_OUT = array();
                $RE_MODUL_IN = array();
                $RE_MODUL_ID = array();
                $RE_MODUL_NAME = array();
                $RE_C = array();
                // ---------- SLICE IDS/MODUL SETZEN - speichern der daten
                for ($i = 0; $i < $this->CONT->getRows(); $i++) {
                    $RE_CONTS[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'article_slice.id');
                    $RE_CONTS_CTYPE[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'article_slice.ctype');
                    $RE_MODUL_IN[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'module.eingabe');
                    $RE_MODUL_OUT[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'module.ausgabe');
                    $RE_MODUL_ID[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'module.id');
                    $RE_MODUL_NAME[$this->CONT->getValue('re_article_slice_id')] = $this->CONT->getValue($REX['TABLE_PREFIX'] . 'module.name');
                    $RE_C[$this->CONT->getValue('re_article_slice_id')] = $i;
                    $this->CONT->next();
                }
                // ---------- moduleselect: nur module nehmen auf die der user rechte hat
                if ($this->mode == 'edit') {
                    $MODULE = new rex_sql();
                    $MODULE->setQuery('select * from ' . $REX['TABLE_PREFIX'] . 'module order by name');
                    $MODULESELECT = new rex_select();
                    $MODULESELECT->setName('module_id');
                    $MODULESELECT->setSize('1');
                    $MODULESELECT->setAttribute('onchange', 'this.form.submit();');
                    $MODULESELECT->addOption('----------------------------  ' . $I18N->msg('add_block'), '');
                    for ($i = 0; $i < $MODULE->getRows(); $i++) {
                        if ($REX_USER->hasPerm('module[' . $MODULE->getValue('id') . ']') || $REX_USER->hasPerm('admin[]')) {
                            $MODULESELECT->addOption(rex_translate($MODULE->getValue('name'), NULL, FALSE), $MODULE->getValue('id'));
                        }
                        $MODULE->next();
                    }
                }
                // ---------- SLICE IDS SORTIEREN UND AUSGEBEN
                $I_ID = 0;
                $PRE_ID = 0;
                $LCTSL_ID = 0;
                $this->CONT->reset();
                $this->article_content = "";
                for ($i = 0; $i < $this->CONT->getRows(); $i++) {
                    // ----- ctype unterscheidung
                    if ($this->mode != "edit" && $i == 0) {
                        $this->article_content = "<?php if (\$this->ctype == '" . $RE_CONTS_CTYPE[$I_ID] . "' || (\$this->ctype == '-1')) { ?>";
                    }
                    // ------------- EINZELNER SLICE - AUSGABE
                    $this->CONT->counter = $RE_C[$I_ID];
                    $slice_content = "";
                    $SLICE_SHOW = TRUE;
                    if ($this->mode == "edit") {
                        $form_url = 'index.php';
                        if ($this->setanker) {
                            $form_url .= '#addslice';
                        }
                        $this->ViewSliceId = $RE_CONTS[$I_ID];
                        // ----- add select box einbauen
                        if ($this->function == "add" && $this->slice_id == $I_ID) {
                            $slice_content = $this->addSlice($I_ID, $module_id);
                        } else {
                            // ----- BLOCKAUSWAHL - SELECT
                            $MODULESELECT->setId("module_id" . $I_ID);
                            $slice_content = '
              <form action="' . $form_url . '" method="get" id="slice' . $RE_CONTS[$I_ID] . '">
                <fieldset>
                  <legend class="rex-lgnd"><span class="rex-hide">' . $I18N->msg("add_block") . '</span></legend>
                  <input type="hidden" name="article_id" value="' . $this->article_id . '" />
                  <input type="hidden" name="page" value="content" />
                  <input type="hidden" name="mode" value="' . $this->mode . '" />
                  <input type="hidden" name="slice_id" value="' . $I_ID . '" />
                  <input type="hidden" name="function" value="add" />
                  <input type="hidden" name="clang" value="' . $this->clang . '" />
                  <input type="hidden" name="ctype" value="' . $this->ctype . '" />
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:101,代码来源:class.rex_article.inc.php


示例9: select

 function select()
 {
     parent::rex_select();
 }
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:4,代码来源:class.compat.inc.php


示例10: foreach

    rex::setProperty('debug', $config['debug']);
    foreach (rex_system_setting::getAll() as $setting) {
        $key = $setting->getKey();
        if (isset($settings[$key])) {
            if (($msg = $setting->setValue($settings[$key])) !== true) {
                $error[] = $msg;
            }
        }
    }
    if (empty($error)) {
        if (rex_file::putConfig($configFile, $config) > 0) {
            $success = rex_i18n::msg('info_updated');
        }
    }
}
$sel_lang = new rex_select();
$sel_lang->setStyle('class="form-control"');
$sel_lang->setName('settings[lang]');
$sel_lang->setId('rex-id-lang');
$sel_lang->setSize(1);
$sel_lang->setSelected(rex::getProperty('lang'));
foreach (rex_i18n::getLocales() as $l) {
    $sel_lang->addOption($l, $l);
}
if (!empty($error)) {
    echo rex_view::error(implode('<br />', $error));
}
if ($info != '') {
    echo rex_view::info($info);
}
if ($success != '') {
开发者ID:staabm,项目名称:redaxo,代码行数:31,代码来源:system.settings.php


示例11: foreach

$sel_mailer->setId('mailer');
$sel_mailer->setName('mailer');
$sel_mailer->setSize(1);
$sel_mailer->setSelected($mailer);
foreach (array('mail', 'sendmail', 'smtp') as $type) {
    $sel_mailer->addOption($type, $type);
}
$sel_encoding = new rex_select();
$sel_encoding->setId('encoding');
$sel_encoding->setName('encoding');
$sel_encoding->setSize(1);
$sel_encoding->setSelected($encoding);
foreach (array('7bit', '8bit', 'binary', 'base64', 'quoted-printable') as $enc) {
    $sel_encoding->addOption($enc, $enc);
}
$sel_priority = new rex_select();
$sel_priority->setid('priority');
$sel_priority->setName('priority');
$sel_priority->setSize(1);
$sel_priority->setSelected($priority);
foreach (array(1 => $I18N_A93->msg('high'), 3 => $I18N_A93->msg('normal'), 5 => $I18N_A93->msg('low')) as $no => $name) {
    $sel_priority->addOption($name, $no);
}
if ($message != '') {
    echo rex_warning($message);
}
?>

<div class="rex-addon-editmode">
	<form action="" method="post">
	  <fieldset>
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:settings.inc.php


示例12: rex_a62_metaFields


//.........这里部分代码省略.........
                $class = $typeLabel == 'radio' ? 'rex-rdo' : 'rex-chckbx';
                $oneValue = count($values) == 1;
                if (!$oneValue) {
                    $tag = '';
                    $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();
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:67,代码来源:extension_common.inc.php


示例13: rex_select

							</a>
						</p>
					</div>
					
					<?php 
if (OOAddon::isActivated('multinewsletter')) {
    ?>
					<div class="rex-form-row rex-form-element-v1">
						<p class="rex-form-text">
							<label for="multinewsletter_group"><?php 
    echo $I18N_KURSE->msg('multinewsletter_gruppe');
    ?>
</label>
							<?php 
    require_once $REX['INCLUDE_PATH'] . '/addons/multinewsletter/classes/class.multinewsletter_group.inc.php';
    $groups = new rex_select();
    $groups->setSize(1);
    $groups->setAttribute('class', 'myrex_select');
    $groups->addOption($I18N_KURSE->msg('multinewsletter_nicht_anmelden'), '0');
    $newsletter_groups = MultinewsletterGroupList::getAll($REX['TABLE_PREFIX']);
    foreach ($newsletter_groups as $group) {
        $groups->addOption($group->name, $group->group_id);
    }
    $groups->setSelected($REX['ADDON']['d2u_kurse']['settings']['multinewsletter_group']);
    $groups->setAttribute('id', 'multinewsletter_group');
    $groups->setName('settings[multinewsletter_group]');
    print $groups->get();
    ?>
						</p>
					</div>
					<?php 
开发者ID:TobiasKrais,项目名称:d2u_kurse,代码行数:31,代码来源:einstellungen.inc.php


示例14: rex_getAttributes

 if (!isset($save) or $save != 'ja') {
     echo '<a name="edit"></a>';
     // Ctype Handling
     $ctypes = rex_getAttributes('ctype', $attributes);
     $modules = rex_getAttributes('modules', $attributes);
     $categories = rex_getAttributes('categories', $attributes);
     if (!is_array($modules)) {
         $modules = array();
     }
     if (!is_array($categories)) {
         $categories = array();
     }
     // modules[ctype_id][module_id];
     // modules[ctype_id]['all'];
     // Module ...
     $modul_select = new rex_select();
     $modul_select->setMultiple(true);
     $modul_select->setStyle('class="rex-form-select"');
     $modul_select->setSize(10);
     $m_sql = rex_sql::factory();
     $m_sql->setQuery('SELECT id, name FROM ' . $REX['TABLE_PREFIX'] . 'module ORDER BY name');
     foreach ($m_sql->getArray() as $m) {
         $modul_select->addOption(rex_translate($m['name'], $I18N, false), $m['id']);
     }
     // Kategorien
     $cat_select = new rex_category_select(false, false, false, false);
     $cat_select->setMultiple(true);
     $cat_select->setStyle('class="rex-form-select"');
     $cat_select->setSize(10);
     $cat_select->setName('categories[]');
     $cat_select->setId('categories');
开发者ID:eaCe,项目名称:redaxo4,代码行数:31,代码来源:template.inc.php


示例15: renderMetaFields


//.........这里部分代码省略.........
                         $selected = ' checked="checked"';
                     }
                     $e = [];
                     if ($oneValue) {
                         $e['label'] = $label;
                     } else {
                         $e['label'] = '<label for="' . $id . '">' . htmlspecialchars($value) . '</label>';
                     }
                     $e['field'] = '<input type="' . $typeLabel . '" name="' . $name . '" value="' . htmlspecialchars($key) . '" id="' . $id . '" ' . $attrStr . $selected . ' />';
                     $formElements[] = $e;
                 }
                 $fragment = new rex_fragment();
                 $fragment->setVar('elements', $formElements, false);
                 $fragment->setVar('inline', $inline);
                 if ($typeLabel == 'radio') {
                     $field = $fragment->parse('core/form/radio.php');
                 } else {
                     if (!$oneValue) {
                         $fragment->setVar('grouped', true);
                     }
                     $field = $fragment->parse('core/form/checkbox.php');
                 }
                 if (!$oneValue) {
                     $e = [];
                     $e['label'] = $label;
                     $e['field'] = $field;
                     $fragment = new rex_fragment();
                     $fragment->setVar('elements', [$e], false);
                     $field = $fragment->parse('core/form/form.php');
                 }
                 break;
             case 'select':
                 $tag_attr = ' class="form-control"';
                 $select = new rex_select();
                 $select->setStyle('class="form-control"');
                 $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 . '[]');
                         $select->setMultiple();
                     }
                 }
                 // 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 (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 = [];
                     $value_groups = explode('|', $params);
                     foreach ($value_groups as $value_group) {
                         // check ob key:value paar
开发者ID:DECAF,项目名称:redaxo,代码行数:67,代码来源:handler.php


示例16: rex_a62_metaFields


//.........这里部分代码省略.........
                        $attrStr = ' ' . $key . '="' . $value . '"';
                    }
                }
                if (!$activeItem) {
                    $dbvalues = (array) $defaultValue;
                }
                foreach ($values as $key => $value) {
                    $id = preg_replace('/[^a-zA-Z\\-0-9_]/', '_', $id . $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)) {
                        $selected = ' checked="checked"';
                    }
                    if ($oneValue) {
                        $tag_attr = ' class="rex-form-col-a rex-form-' . $class_s . $classAdd . '"';
                        $field .= '<input class="rex-form-' . $class_s . '" type="' . $typeLabel . '" name="' . $name . '" value="' . htmlspecialchars($key) . '" id="' . $id . '" ' . $attrStr . $selected . ' />' . "\n";
                    } else {
                        $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);
开发者ID:Barnhiac,项目名称:MTW_REDAXO,代码行数:67,代码来源:extension_common.inc.php


示例17: rex_request

$redaxo_nl_article_name = "";
if ($redaxo_nl_article_id > 0 && ($m = OOArticle::getArticleById($redaxo_nl_article_id))) {
    $redaxo_nl_article_name = $m->getName();
} else {
    $redaxo_nl_article_id = 0;
}
$redaxo_nl_from_email = rex_request("redaxo_nl_from_email", "string");
$redaxo_nl_from_name = rex_request("redaxo_nl_from_name", "string");
$redaxo_nl_subject = rex_request("redaxo_nl_subject", "string");
// -------- xform email template
$xform_nl_tpl = "";
$xform_nl_tpl_tmp = rex_request("xform_nl_tpl", "string");
$xform_nl_sql = new rex_sql();
$xform_nl_sql->setQuery("select * from rex_xform_email_template");
$xform_nl_tpls = $xform_nl_sql->getArray();
$xform_nl_select = new rex_select();
$xform_nl_select->setName("xform_nl_tpl");
foreach ($xform_nl_tpls as $tpl) {
    $xform_nl_select->addOption($tpl["name"], $tpl["name"]);
    if ($xform_nl_tpl_tmp == $tpl["name"]) {
        $xform_nl_tpl = $tpl;
        $xform_nl_select->setSelected($tpl["name"]);
    }
}
// -------- Testuser ID
$test_user_id = rex_request("test_user_id", "int", 0);
$test_user = array();
$gu = new rex_sql();
$gu->setQuery('select * from rex_com_user where id=' . $test_user_id);
$test_users = $gu->getArray();
if (count($test_users) != 1) {
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:31,代码来源:index.inc.php


示例18: rex_request

    <div class="rex-toolbar rex-toolbar-has-form">
        <div class="rex-toolbar-content">
            <div class="rex-form">
                <form action="index.php" method="get" class="rex-fl-lft" style="margin-left:5px">
                    <fieldset>
                        <input type="hidden" name="page" value="<?php 
    print rex_request('page');
    ?>
" />
                        <input type="hidden" name="subpage" value="<?php 
    print rex_request('subpage');
    ?>
" />
                        <label for="filter">Filter:</label> &nbsp;
                        <?php 
    $select = new rex_select();
    $select->setName('filter');
    $select->setAttribute('onchange', 'this.form.submit();');
    $select->setSize(1);
    $select->setMultiple(false);
    $select->setStyle("width:250px;");
    $select->addOption("Alle anzeigen", 999);
    $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']);
        }
开发者ID:brt-tito,项目名称:rex-news,代码行数:31,代码来源:entries.inc.php


示例19: rex_select

								  </div>
                </fieldset>';
                }
                // --------------------------------------------------- ZUM STARTARTICLE MACHEN END
                // --------------------------------------------------- INHALTE KOPIEREN START
                if (($REX_USER->hasPerm('admin[]') || $REX_USER->hasPerm('copyContent[]')) && count($REX['CLANG']) > 1) {
                    $lang_a = new rex_select();
                    $lang_a->setId('clang_a');
                    $lang_a->setName('clang_a');
                    $lang_a->setSize('1');
                    $lang_a->setAttribute('tabindex', rex_tabindex(false));
                    foreach ($REX['CLANG'] as $key => $val) {
                        $val = rex_translate($val);
                        $lang_a->addOption($val, $key);
                    }
                    $lang_b = new rex_select();
                    $lang_b->setId('clang_b');
                    $lang_b->setName('clang_b');
                    $lang_b->setSize('1');
                    $lang_b->setAttribute('tabindex', rex_tabindex(false));
                    foreach ($REX['CLANG'] as $key => $val) {
                        $val = rex_translate($val);
                        $lang_b->addOption($val, $key);
                    }
                    $lang_a->setSelected(rex_request('clang_a', 'int', null));
                    $lang_b->setSelected(rex_request('clang_b', ' 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP rex_sql类代码示例发布时间:2022-05-23
下一篇:
PHP rex_path类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap