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;
        }
    }
    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;
        }
    }
 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();
     }
 }
    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;
        }
    }
示例#5
0
 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";
 }
    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>';
    }
$cat_select->setSelected('REX_VALUE[3]');
echo $cat_select->get();
?>
</td>

<td>Maximaler Zoom:</td>
<td><?php 
$max_zoom = (int) 'REX_VALUE[4]';
if ($max_zoom < 1 || $max_zoom > 16) {
    $max_zoom = 8;
}
$zoom_select = new rex_select();
$zoom_select->setName('VALUE[4]');
$zoom_select->setSelected($max_zoom);
for ($zoom = 1; $zoom <= 16; $zoom++) {
    $zoom_select->addOption($zoom, $zoom);
}
$zoom_select->setSize(1);
echo $zoom_select->get();
?>
</td>
</tr>

<tr>
<td>Marker:</td>
<td colspan="3"><textarea name="VALUE[6]" style="width:500px; height:200px">REX_VALUE[6]</textarea></td>
</tr>

<tr>
<td>DIV:</td>
<td colspan="3"><textarea name="VALUE[5]" style="width:500px; height:200px">REX_VALUE[5]</textarea></td>
示例#8
0
     $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');
 if (count($categories) > 0) {
     foreach ($categories as $c => $cc) {
         // typsicherer vergleich, weil (0 != "all") => false
         if ($c !== 'all') {
             $cat_select->setSelected($cc);
         }
     }
					
					<?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 
}
?>
				</div>
    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        global $REX, $I18N;
        // ---------- CONFIG & CHECK
        $this->be_em = array();
        $this->be_em["source_table"] = $this->params["main_table"];
        // "rex_em_data_" wegcutten
        $this->be_em["label"] = $this->elements[2];
        // HTML Bezeichnung
        $this->be_em["target_table"] = $this->elements[3];
        // Zieltabelle
        $this->be_em["target_field"] = $this->elements[4];
        // Zielfield welches angezeigt wird.
        $this->be_em["relation_type"] = (int) $this->elements[5];
        // select single = 0 / select multiple = 1 / popup single = 2 / popup multiple = 3
        if ($this->be_em["relation_type"] > 4) {
            $this->be_em["relation_type"] = 0;
        }
        $this->be_em["eoption"] = (int) $this->elements[6];
        // "Leer" Option
        $this->be_em["page"] = $this->elements[8];
        // page=editme
        if ($this->be_em["page"] == "") {
            $this->be_em["page"] = 'editme';
        }
        $this->be_em["subpage"] = $this->elements[9];
        // page=editme
        if ($this->be_em["subpage"] == "") {
            $this->be_em["subpage"] = $this->be_em["target_table"];
        }
        if ($this->be_em["eoption"] != 1) {
            $this->be_em["eoption"] = 0;
        }
        $disabled = FALSE;
        // ---------- Datensatz existiert bereits, Values aus verkn�pfungstabelle holen
        if ($this->params["main_id"] > 0 && $send == 0) {
            if (trim($this->getValue()) != "") {
                $values = explode(",", $this->getValue());
            } else {
                $vs = rex_sql::factory();
                $vs->debugsql = $this->params["debug"];
                $vs->setQuery('
					select 
						target_id as id 
					from 
						rex_xform_relation 
					where 
						source_table="' . $this->be_em["source_table"] . '" and 
						source_name="' . $this->getName() . '" and 
						source_id="' . $this->params["main_id"] . '"');
                $v = $vs->getArray();
                $values = array();
                if (count($v) > 0) {
                    foreach ($v as $w) {
                        $values[$w["id"]] = $w["id"];
                    }
                }
            }
            $this->setValue($values);
            // echo '<pre>++ ';var_dump($this->getValue());echo '</pre>';
        }
        // ---------- connected, fix values
        if (isset($this->params["rex_xform_set"][$this->getName()])) {
            $values = $this->getValue();
            $values[] = $this->params["rex_xform_set"][$this->getName()];
            $this->setValue($values);
            $disabled = TRUE;
        }
        // ---------- Value angleichen -> immer Array mit IDs daraus machen
        if (!is_array($this->getValue())) {
            if (trim($this->getValue()) == "") {
                $this->setValue(array());
            } else {
                $this->setValue(explode(",", $this->getValue()));
            }
        }
        // ---------- (array) $this->getValue()
        // ---------- check values
        $sql = 'select id,' . $this->be_em["target_field"] . ' from ' . $this->be_em["target_table"];
        $value_names = array();
        if (count($this->getValue()) > 0) {
            $add_sql = array();
            foreach ($this->getValue() as $v) {
                $add_sql[] = ' id=' . $v . '';
            }
            if (count($add_sql) > 0) {
                $sql .= ' where ' . implode(" OR ", $add_sql);
            }
            $values = array();
            $vs = rex_sql::factory();
            $sss->debugsql = $this->params["debug"];
            $vs->setQuery($sql);
            foreach ($vs->getArray() as $v) {
                $value_names[$v["id"]] = $v[$this->be_em["target_field"]] . ' [id=' . $v['id'] . ']';
                $values[] = $v["id"];
                $value_name = $v[$this->be_em["target_field"]];
            }
            $this->setValue($values);
        }
        // ------------------------------------ POPUP, single, multiple 1-1, n-m
        if ($this->be_em["relation_type"] == 2 || $this->be_em["relation_type"] == 3) {
            $multiple = "0";
            if ($this->be_em["relation_type"] == 3) {
                $multiple = "1";
            }
            $link = 'index.php?page=xform&subpage=manager&tripage=data_edit&table_name=' . $this->be_em["target_table"];
            if ($multiple) {
                $out = '
				<div class="rex-widget">
				    <div class="rex-widget-xform-manager-datalist">
				      <input type="hidden" name="FORM[' . $this->params["form_name"] . '][el_' . $this->getId() . ']" id="XFORM_MANAGER_DATALIST_' . $this->getId() . '" value="' . implode(",", $this->getValue()) . '" />
				      <p class="rex-widget-field">
				        <select name="XFORM_MANAGER_DATALIST_SELECT[' . $this->getId() . ']" id="XFORM_MANAGER_DATALIST_SELECT_' . $this->getId() . '" size="8">';
                foreach ($value_names as $k => $v) {
                    $out .= '<option value="' . $k . '">' . $v . '</option>';
                }
                $out .= '
				        </select>
				      </p>
				       <p class="rex-widget-icons rex-widget-2col">
				       	<span class="rex-widget-column rex-widget-column-first">
						<a href="#" class="rex-icon-file-top" 
							onclick="xform_manager_moveDatalist(' . $this->getId() . ',\'top\');return false;" 
							title="' . $I18N->msg("xform_relation_move_first_data") . '"></a>
						<a href="#" class="rex-icon-file-up" 
							onclick="xform_manager_moveDatalist(' . $this->getId() . ',\'up\');return false;" 
							title="' . $I18N->msg("xform_relation_move_up_data") . '"></a>
						<a href="#" class="rex-icon-file-down" 
							onclick="xform_manager_moveDatalist(' . $this->getId() . ',\'down\');return false;" 
							title="' . $I18N->msg("xform_relation_down_first_data") . '"></a>
						<a href="#" class="rex-icon-file-bottom" 
							onclick="xform_manager_moveDatalist(' . $this->getId() . ',\'bottom\');return false;" 
							title="' . $I18N->msg("xform_relation_move_last_data") . '"></a>
				       	</span>
				       	<span class="rex-widget-column">
							<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>';
            } else {
                $out = '
				
				<div class="rex-widget">
					<div class="rex-widget-data">
					
					<p class="rex-widget-field">
					<input type="hidden" name="FORM[' . $this->params["form_name"] . '][el_' . $this->getId() . ']" id="XFORM_MANAGER_DATA_' . $this->getId() . '" value="' . implode(",", $this->getValue()) . '" />
					<input type="text" size="30" name="XFORM_MANAGER_DATANAME[' . $this->getId() . ']" value="' . htmlspecialchars($value_name) . '" id="XFORM_MANAGER_DATANAME_' . $this->getId() . '" readonly="readonly" class="text" />
					</p>
					<p class="rex-widget-icons rex-widget-1col">
					<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&ouml;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());
    }
示例#11
0
} 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) {
    $test_user_id = 0;
} else {
    $test_user = $test_users[0];
示例#12
0
文件: profile.php 项目: staabm/redaxo
$userpsw = rex_request('userpsw', 'string');
$userpsw_new_1 = rex_request('userpsw_new_1', 'string');
$userpsw_new_2 = rex_request('userpsw_new_2', 'string');
$username = rex_request('username', 'string', $user->getName());
$userdesc = rex_request('userdesc', 'string', $user->getValue('description'));
$userlogin = $user->getLogin();
// --------------------------------- Title
echo rex_view::title(rex_i18n::msg('profile_title'), '');
// --------------------------------- BE LANG
// backend sprache
$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]);
        					<th>' . $I18N->msg('action_functions') . '</th>
      					</tr>
    					</thead>
    				<tbody>
              ' . $actions . '
            </tbody>
            </table>
          ';
                }
                $gaa_sel = new rex_select();
                $gaa_sel->setName('action_id');
                $gaa_sel->setId('action_id');
                $gaa_sel->setSize(1);
                $gaa_sel->setStyle('class="rex-form-select"');
                for ($i = 0; $i < $gaa->getRows(); $i++) {
                    $gaa_sel->addOption(rex_translate($gaa->getValue('name'), null, false), $gaa->getValue('id'));
                    $gaa->next();
                }
                echo $actions . '
				<fieldset class="rex-form-col-1">
          <legend>' . $I18N->msg('action_add') . '</legend>
      		<div class="rex-form-wrapper">
						
						<div class="rex-form-row">
							<p class="rex-form-col-a rex-form-select">
								<label for="action_id">' . $I18N->msg('action') . '</label>
								' . $gaa_sel->get() . '
					  	</p>
					  </div>
					  
						<div class="rex-form-row">
    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 . '" />

                  <p class="rex-slct">
                    ' . $MODULESELECT->get() . '
                    <noscript><input type="submit" class="rex-sbmt" name="btn_add" value="' . $I18N->msg("add_block") . '" /></noscript>
                  </p>

                </fieldset>
              </form>';
                        }
                        // ----- EDIT/DELETE BLOCK - Wenn Rechte vorhanden
                        if ($REX_USER->hasPerm("module[" . $RE_MODUL_ID[$I_ID] . "]") || $REX_USER->hasPerm("admin[]")) {
                            $msg = '';
                            if ($this->slice_id == $RE_CONTS[$I_ID] && $this->message != '') {
                                $msg = rex_warning($this->message);
                            }
                            $sliceUrl = 'index.php?page=content&amp;article_id=' . $this->article_id . '&amp;mode=edit&amp;slice_id=' . $RE_CONTS[$I_ID] . '&amp;clang=' . $this->clang . '&amp;ctype=' . $this->ctype . '%s#slice' . $RE_CONTS[$I_ID];
                            $listElements = array();
                            $listElements[] = '<a href="' . sprintf($sliceUrl, '&amp;function=edit') . '" class="rex-clr-grn">' . $I18N->msg('edit') . ' <span class="rex-hide">' . $RE_MODUL_NAME[$I_ID] . '</span></a>';
                            $listElements[] = '<a href="' . sprintf($sliceUrl, '&amp;function=delete&amp;save=1') . '" class="rex-clr-red" onclick="return confirm(\'' . $I18N->msg('delete') . ' ?\')">' . $I18N->msg('delete') . ' <span class="rex-hide">' . $RE_MODUL_NAME[$I_ID] . '</span></a>';
                            if ($REX_USER->hasPerm('moveSlice[]')) {
                                $moveUp = $I18N->msg('move_slice_up');
                                $moveDown = $I18N->msg('move_slice_down');
                                // upd stamp übergeben, da sonst ein block nicht mehrfach hintereindander verschoben werden kann
                                // (Links wären sonst gleich und der Browser lässt das klicken auf den gleichen Link nicht zu)
                                $listElements[] = '<a href="' . sprintf($sliceUrl, '&amp;upd=' . time() . '&amp;function=moveup') . '" title="' . $moveUp . '"><img src="media/file_up.gif" width="16" height="16" alt="' . $moveUp . '" /> <span class="rex-hide">' . $RE_MODUL_NAME[$I_ID] . '</span></a>';
                                $listElements[] = '<a href="' . sprintf($sliceUrl, '&amp;upd=' . time() . '&amp;function=movedown') . '" title="' . $moveDown . '"><img src="media/file_down.gif" width="16" height="16" alt="' . $moveDown . '" /> <span class="rex-hide">' . $RE_MODUL_NAME[$I_ID] . '</span></a>';
                            }
                            // ----- EXTENSION POINT
                            $listElements = rex_register_extension_point('ART_SLICE_MENU', $listElements, array('article_id' => $this->article_id, 'clang' => $this->clang, 'ctype' => $RE_CONTS_CTYPE[$I_ID], 'module_id' => $RE_MODUL_ID[$I_ID], 'slice_id' => $RE_CONTS[$I_ID]));
                            $mne = $msg . '
			       	<div class="rex-cnt-editmode-slc">
                <p class="rex-flLeft">' . htmlspecialchars($RE_MODUL_NAME[$I_ID]) . '</p>
                <ul class="rex-flRight" id="rex-slc-mnu">
              ';
                            foreach ($listElements as $listElement) {
                                $mne .= '<li>' . $listElement . '</li>';
                            }
                            $mne .= '</ul></div>';
                            $slice_content .= $mne;
                            if ($this->function == "edit" && $this->slice_id == $RE_CONTS[$I_ID]) {
                                // **************** Aktueller Slice
                                // ----- PRE VIEW ACTION [EDIT]
                                $REX_ACTION = array();
                                // nach klick auf den übernehmen button,
                                // die POST werte übernehmen
                                if (rex_var::isEditEvent()) {
                                    foreach ($REX['VARIABLES'] as $obj) {
                                        $REX_ACTION = $obj->getACRequestValues($REX_ACTION);
                                    }
                                } else {
                                    foreach ($REX['VARIABLES'] as $obj) {
                                        $REX_ACTION = $obj->getACDatabaseValues($REX_ACTION, $this->CONT);
                                    }
                                }
                                // TODO: PreviewActions gibts nur im EditMode...?
                                if ($this->function == 'edit') {
                                    $modebit = '2';
                                } elseif ($this->function == 'delete') {
                                    $modebit = '4';
                                } else {
                                    $modebit = '1';
                                }
                                // pre-action and add
                                $ga = new rex_sql();
                                $ga->debugsql = 0;
                                $ga->setQuery('SELECT preview FROM ' . $REX['TABLE_PREFIX'] . 'module_action ma,' . $REX['TABLE_PREFIX'] . 'action a WHERE preview != "" AND ma.action_id=a.id AND module_id=' . $RE_MODUL_ID[$I_ID] . ' AND ((a.previewmode & ' . $modebit . ') = ' . $modebit . ')');
                                for ($t = 0; $t < $ga->getRows(); $t++) {
                                    $iaction = $ga->getValue('preview');
                                    // ****************** VARIABLEN ERSETZEN
                                    foreach ($REX['VARIABLES'] as $obj) {
                                        $iaction = $obj->getACOutput($REX_ACTION, $iaction);
                                    }
                                    eval('?>' . $iaction);
                                    // ****************** SPEICHERN FALLS NOETIG
                                    foreach ($REX['VARIABLES'] as $obj) {
                                        $obj->setACValues($this->CONT, $REX_ACTION);
                                    }
                                    $ga->next();
                                }
                                // ----- / PRE VIEW ACTION
                                $slice_content .= $this->editSlice($RE_CONTS[$I_ID], $RE_MODUL_IN[$I_ID], $RE_CONTS_CTYPE[$I_ID], $RE_MODUL_ID[$I_ID]);
                            } else {
                                // Modulinhalt ausgeben
                                $slice_content .= '
                <!-- *** OUTPUT OF MODULE-OUTPUT - START *** -->
                <div class="rex-cnt-slc-otp"><div class="rex-cnt-slc-otp2">
                  ' . $RE_MODUL_OUT[$I_ID] . '
                </div></div>
                <!-- *** OUTPUT OF MODULE-OUTPUT - END *** -->
                ';
                                $slice_content = $this->replaceVars($this->CONT, $slice_content);
                            }
                        } else {
                            // ----- hat keine rechte an diesem modul
                            $mne = '
			  	<div class="rex-cnt-editmode-slc">
                <p class="rex-flLeft" id="slice' . $RE_CONTS[$I_ID] . '">' . $RE_MODUL_NAME[$I_ID] . '</p>
                <ul class="rex-flRight">
                  <li>' . $I18N->msg('no_editing_rights') . ' <span class="rex-hide">' . $RE_MODUL_NAME[$I_ID] . '</span></li>
                </ul>
				  </div>';
                            $slice_content .= $mne . $RE_MODUL_OUT[$I_ID];
                            $slice_content = $this->replaceVars($this->CONT, $slice_content);
                        }
                    } else {
                        // ----- wenn mode nicht edit
                        if ($this->getSlice) {
                            while (list($k, $v) = each($RE_CONTS)) {
                                $I_ID = $k;
                            }
                        }
                        $slice_content .= $RE_MODUL_OUT[$I_ID];
                        $slice_content = $this->replaceVars($this->CONT, $slice_content);
                    }
                    // --------------- ENDE EINZELNER SLICE
                    // --------------- EP: SLICE_SHOW
                    $slice_content = rex_register_extension_point('SLICE_SHOW', $slice_content, array('article_id' => $this->article_id, 'clang' => $this->clang, 'ctype' => $RE_CONTS_CTYPE[$I_ID], 'module_id' => $RE_MODUL_ID[$I_ID], 'slice_id' => $RE_CONTS[$I_ID], 'function' => $this->function, 'function_slice_id' => $this->slice_id));
                    // ---------- slice in ausgabe speichern wenn ctype richtig
                    if ($this->ctype == -1 or $this->ctype == $RE_CONTS_CTYPE[$I_ID]) {
                        $this->article_content .= $slice_content;
                        // last content type slice id
                        $LCTSL_ID = $RE_CONTS[$I_ID];
                    }
                    // ----- zwischenstand: ctype .. wenn ctype neu dann if
                    if ($this->mode != "edit" && isset($RE_CONTS_CTYPE[$RE_CONTS[$I_ID]]) && $RE_CONTS_CTYPE[$I_ID] != $RE_CONTS_CTYPE[$RE_CONTS[$I_ID]] && $RE_CONTS_CTYPE[$RE_CONTS[$I_ID]] != "") {
                        $this->article_content .= "<?php } if(\$this->ctype == '" . $RE_CONTS_CTYPE[$RE_CONTS[$I_ID]] . "' || \$this->ctype == '-1'){ ?>";
                    }
                    // zum nachsten slice
                    $I_ID = $RE_CONTS[$I_ID];
                    $PRE_ID = $I_ID;
                }
                // ----- end: ctype unterscheidung
                if ($this->mode != "edit" && $i > 0) {
                    $this->article_content .= "<?php } ?>";
                }
                // ----- add module im edit mode
                if ($this->mode == "edit") {
                    $form_url = 'index.php';
                    if ($this->setanker) {
                        $form_url .= '#addslice';
                    }
                    if ($this->function == "add" && $this->slice_id == $LCTSL_ID) {
                        $slice_content = $this->addSlice($LCTSL_ID, $module_id);
                    } else {
                        // ----- BLOCKAUSWAHL - SELECT
                        $MODULESELECT->setId("module_id" . $LCTSL_ID);
                        // $slice_content = $add_select_box;
                        $slice_content = '
            <form action="' . $form_url . '" method="get">
              <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="' . $LCTSL_ID . '" />
                <input type="hidden" name="function" value="add" />
                <input type="hidden" name="clang" value="' . $this->clang . '" />
                <input type="hidden" name="ctype" value="' . $this->ctype . '" />

                <p class="rex-slct">
                  ' . $MODULESELECT->get() . '
                  <noscript><input type="submit" class="rex-sbmt" name="btn_add" value="' . $I18N->msg("add_block") . '" /></noscript>
                </p>

              </fieldset>
            </form>';
                    }
                    $this->article_content .= $slice_content;
                }
                // -------------------------- schreibe content
                if ($this->mode == "generate" || $this->viasql) {
                    echo $this->replaceLinks($this->article_content);
                } else {
                    eval("?>" . $this->article_content);
                }
            } else {
                echo $I18N->msg('no_article_available');
            }
        }
        // ----- end: article caching
        $CONTENT = ob_get_contents();
        ob_end_clean();
        return $CONTENT;
    }
示例#15
0
             ' . $actions . '
         </tbody>
         </table>
     ';
     $fragment = new rex_fragment();
     $fragment->setVar('title', rex_i18n::msg('actions_added_caption'), false);
     $fragment->setVar('content', $panel, false);
     $content .= $fragment->parse('core/page/section.php');
 }
 $gaa_sel = new rex_select();
 $gaa_sel->setName('action_id');
 $gaa_sel->setId('action_id');
 $gaa_sel->setSize(1);
 $gaa_sel->setAttribute('class', 'form-control');
 for ($i = 0; $i < $gaa->getRows(); ++$i) {
     $gaa_sel->addOption(rex_i18n::translate($gaa->getValue('name'), false), $gaa->getValue('id'));
     $gaa->next();
 }
 $panel = '';
 $panel .= '<fieldset>';
 $formElements = [];
 $n = [];
 $n['label'] = '<label for="action_id">' . rex_i18n::msg('action') . '</label>';
 $n['field'] = $gaa_sel->get();
 $formElements[] = $n;
 $fragment = new rex_fragment();
 $fragment->setVar('elements', $formElements, false);
 $panel .= $fragment->parse('core/form/form.php');
 $panel .= '</fieldset>';
 $formElements = [];
 $n = [];
    }
} elseif (!empty($edit_clang_save)) {
    if (array_key_exists($clang_id, $REX['CLANG'])) {
        rex_editCLang($clang_id, $clang_name);
        $info = $I18N->msg('clang_edited');
        $func = '';
        unset($clang_id);
    }
}
// seltype
$sel = new rex_select();
$sel->setName('clang_id');
$sel->setId('clang_id');
$sel->setSize(1);
foreach (array_diff(range(0, 14), array_keys($REX['CLANG'])) as $clang) {
    $sel->addOption($clang, $clang);
}
if ($info != '') {
    echo rex_info($info);
}
if ($warning != '') {
    echo rex_warning($warning);
}
if ($func == 'addclang' || $func == 'editclang') {
    $legend = $func == 'add_clang' ? $I18N->msg('clang_add') : $I18N->msg('clang_edit');
    echo '
      <form action="index.php#clang" method="post">
        <fieldset>
          <legend><span class="rex-hide">' . $legend . '</span></legend>
          <input type="hidden" name="page" value="specials" />
          <input type="hidden" name="subpage" value="lang" />
<?php

// Stellenkategorien
$query = 'SELECT interne_bezeichnung, kategorie_id ' . 'FROM ' . $REX['TABLE_PREFIX'] . 'd2u_stellenmarkt_kategorien ' . 'ORDER BY interne_bezeichnung';
$result = new rex_sql();
$result->setQuery($query);
$num_rows = $result->getRows();
$kategorien = array();
for ($i = 0; $i < $num_rows; $i++) {
    $kategorien[$result->getValue("kategorie_id")] = $result->getValue("interne_bezeichnung");
    $result->next();
}
print 'Anzuzeigende Stellenkategorie auswählen: ';
$select = new rex_select();
$select->setName('VALUE[1]');
$select->setSize(1);
// Daten
$select->addOption("Alle", 0);
foreach ($kategorien as $key => $val) {
    $select->addOption($val, $key);
}
// Vorselektierung
$select->setSelected("REX_VALUE[1]");
echo $select->show();
?>

<p><br />Alle weiteren Änderungen bitte im <a href="index.php?page=d2u_stellenmarkt">Stellenmarkt Addon</a> vornehmen.</p>
}
echo '
<!-- *** OUTPUT CATEGORIES - END *** -->
';
// --------------------------------------------- ARTIKEL LISTE
echo '
<!-- *** OUTPUT ARTICLES - START *** -->';
// --------------------- READ TEMPLATES
if ($category_id > -1) {
    $TEMPLATES = new rex_sql();
    $TEMPLATES->setQuery('select * from ' . $REX['TABLE_PREFIX'] . 'template order by name');
    $TMPL_SEL = new rex_select();
    $TMPL_SEL->setName('template_id');
    $TMPL_SEL->setId('template_id');
    $TMPL_SEL->setSize(1);
    $TMPL_SEL->addOption($I18N->msg('option_no_template'), '0');
    for ($i = 0; $i < $TEMPLATES->getRows(); $i++) {
        if ($TEMPLATES->getValue('active') == 1) {
            $TMPL_SEL->addOption(rex_translate($TEMPLATES->getValue('name')), $TEMPLATES->getValue('id'));
        }
        $TEMPLATE_NAME[$TEMPLATES->getValue('id')] = rex_translate($TEMPLATES->getValue('name'));
        $TEMPLATES->next();
    }
    $TEMPLATE_NAME[0] = $I18N->msg('template_default_name');
    // --------------------- ARTIKEL LIST
    if (isset($amessage) and $amessage != '') {
        echo rex_warning($amessage);
    }
    $art_add_link = '';
    if ($KATPERM && !$REX_USER->hasPerm('editContentOnly[]')) {
        $art_add_link = '<a href="index.php?page=structure&amp;category_id=' . $category_id . '&amp;function=add_art&amp;clang=' . $clang . '"' . rex_accesskey($I18N->msg('article_add'), $REX['ACKEY']['ADD_2']) . '><img src="media/document_plus.gif" alt="' . $I18N->msg('article_add') . '" /></a>';
示例#19
0
文件: export.php 项目: DECAF/redaxo
$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>';
$n['field'] = $sel_dirs->get();
$n['footer'] = '</div>';
$formElements[] = $n;
$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$content .= $fragment->parse('core/form/form.php');
$checked0 = '';
$checked1 = '';
if ($exportdl) {
    $checked1 = ' checked="checked"';
} else {
    // $SEL->setStyle(' class="select ' . $wc . '"');
    $radio->setSelected($missing_columns);
    echo $radio->get();
    ?>

                <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));
    ?>
示例#21
0
        }
    }
    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 != '') {
    echo rex_view::success($success);
}
$dbconfig = rex::getProperty('db');
$version = rex_path::src();
if (strlen($version) > 21) {
    $version = substr($version, 0, 8) . '..' . substr($version, strlen($version) - 13);
}
示例#22
0
 if (!is_array($modules)) {
     $modules = [];
 }
 if (!is_array($categories)) {
     $categories = [];
 }
 // modules[ctype_id][module_id];
 // modules[ctype_id]['all'];
 // Module ...
 $modul_select = new rex_select();
 $modul_select->setMultiple(true);
 $modul_select->setSize(10);
 $modul_select->setAttribute('class', 'form-control');
 $m_sql = rex_sql::factory();
 foreach ($m_sql->getArray('SELECT id, name FROM ' . rex::getTablePrefix() . 'module ORDER BY name') as $m) {
     $modul_select->addOption(rex_i18n::translate($m['name']), $m['id']);
 }
 // Kategorien
 $cat_select = new rex_category_select(false, false, false, false);
 $cat_select->setMultiple(true);
 $cat_select->setSize(10);
 $cat_select->setName('categories[]');
 $cat_select->setId('rex-id-categories-select');
 $cat_select->setAttribute('class', 'form-control');
 if (count($categories) > 0) {
     foreach ($categories as $c => $cc) {
         // typsicherer vergleich, weil (0 != "all") => false
         if ($c !== 'all') {
             $cat_select->setSelected($cc);
         }
     }
示例#23
0
    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']);
        }
    }
    if (sizeof($REX['CLANG']) > 1) {
        foreach ($REX['CLANG'] as $k => $v) {
            $select->addOption("nur folgende Sprache: " . $v, 'clang_' . $k);
        }
    }
    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        $day = 0;
        $month = 0;
        $year = 0;
        if (@strlen($this->value) == 10) {
            $day = (int) substr($this->value, 8, 2);
            $month = (int) substr($this->value, 5, 2);
            $year = (int) substr($this->value, 0, 4);
        } else {
            if (isset($_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["day"])) {
                $day = (int) $_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["day"];
            }
            if (isset($_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["month"])) {
                $month = (int) $_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["month"];
            }
            if (isset($_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["year"])) {
                $year = (int) $_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["year"];
            }
        }
        $formname = 'FORM[' . $this->params["form_name"] . '][el_' . $this->id . ']';
        $isodatum = sprintf("%04d-%02d-%02d", $year, $month, $day);
        $datum = $isodatum;
        $twarning = "";
        if (isset($this->elements[4]) && $this->elements[4] == 1 && !checkdate($month, $day, $year) && $send == 1) {
            $twarning = 'border:1px solid #f99;background-color:#f9f3f3;';
            $warning[] = "Geburtsdatum ist falsch";
        } else {
            $email_elements[$this->elements[1]] = "{$day}.{$month}.{$year}";
            $sql_elements[$this->elements[1]] = $datum;
        }
        $out = "";
        $out .= '
		<p class="formbirthday">
					<label class="select" for="el_' . $this->id . '" >' . $this->elements[2] . '</label>';
        $dsel = new rex_select();
        $dsel->setName($formname . '[day]');
        $dsel->setStyle("width:50px;" . $twarning);
        $dsel->setId('el_' . $this->id . '_day');
        $dsel->setSize(1);
        $dsel->addOption("TT", "0");
        for ($i = 1; $i < 32; $i++) {
            $dsel->addOption($i, $i);
        }
        $dsel->setSelected($day);
        $out .= $dsel->get();
        $msel = new rex_select();
        $msel->setName($formname . '[month]');
        $msel->setStyle("width:50px;" . $twarning);
        $msel->setId('el_' . $this->id . '_month');
        $msel->setSize(1);
        $msel->addOption("MM", "0");
        for ($i = 1; $i < 13; $i++) {
            $msel->addOption($i, $i);
        }
        $msel->setSelected($month);
        $out .= $msel->get();
        $ysel = new rex_select();
        $ysel->setName($formname . '[year]');
        $ysel->setStyle("width:80px;" . $twarning);
        $ysel->setId('el_' . $this->id . '_year');
        $ysel->setSize(1);
        $ysel->addOption("YYYY", "0");
        for ($i = 1930; $i < 2000; $i++) {
            $ysel->addOption($i, $i);
        }
        $ysel->setSelected($year);
        $out .= $ysel->get();
        $out .= '</p>';
        $form_output[] = $out;
    }
示例#25
0
                $lang_a->setName('clang_a');
                $lang_a->setSize('1');
                $lang_a->setAttribute('tabindex', rex_tabindex(false));
                foreach ($clang_perm as $key) {
                    $val = rex_translate($REX['CLANG'][$key]);
                    $lang_a->addOption($val, $key);
                }
                $lang_b = new rex_select();
                $lang_b->setStyle('class="rex-form-select"');
                $lang_b->setId('clang_b');
                $lang_b->setName('clang_b');
                $lang_b->setSize('1');
                $lang_b->setAttribute('tabindex', rex_tabindex(false));
                foreach ($clang_perm as $key) {
                    $val = rex_translate($REX['CLANG'][$key]);
                    $lang_b->addOption($val, $key);
                }
                $lang_a->setSelected(rex_request('clang_a', 'rex-clang-id', null));
                $lang_b->setSelected(rex_request('clang_b', 'rex-clang-id', null));
                $out .= '
              <fieldset class="rex-form-col-2">
                <legend>' . $I18N->msg('content_submitcopycontent') . '</legend>
							  <div class="rex-form-wrapper">
							  
							  	<div class="rex-form-row">
									  <p class="rex-form-col-a rex-form-select">
											<label for="clang_a">' . $I18N->msg('content_contentoflang') . '</label>
											' . $lang_a->get() . '
										</p>
									  <p class="rex-form-col-b rex-form-select">
											<label for="clang_b">' . $I18N->msg('content_to') . '</label>
    function enterObject(&$email_elements, &$sql_elements, &$warning, &$form_output, $send = 0)
    {
        $day = date("d");
        $month = date("m");
        $year = date("Y");
        if (!is_array($this->getValue()) && strlen($this->getValue()) == 8) {
            $year = (int) substr($this->value, 0, 4);
            $month = (int) substr($this->value, 4, 2);
            $day = (int) substr($this->value, 6, 2);
        } else {
            if (isset($_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["day"])) {
                $day = $_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["day"];
            }
            if (isset($_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["month"])) {
                $month = $_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["month"];
            }
            if (isset($_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["year"])) {
                $year = $_REQUEST["FORM"][$this->params["form_name"]]['el_' . $this->id]["year"];
            }
        }
        $formname = 'FORM[' . $this->params["form_name"] . '][el_' . $this->id . ']';
        $twarning = "";
        if (!checkdate($month, $day, $year) && $send == 1) {
            $twarning = 'border:1px solid #f99;background-color:#f9f3f3;';
            $warning[] = "Datum ist falsch";
        }
        $isodatum = sprintf("%04d%02d%02d", $year, $month, $day);
        $email_elements[$this->getName()] = $isodatum;
        $sql_elements[$this->getName()] = $isodatum;
        $out = "";
        $out .= '
		<p class="formdate formlabel-' . $this->getName() . '" id="' . $this->getHTMLId() . '">
					<label class="select" for="' . $this->getFieldId() . '" >' . $this->elements[2] . '</label>';
        $dsel = new rex_select();
        $dsel->setName($formname . '[day]');
        $dsel->setStyle("width:55px;" . $twarning);
        $dsel->setId('el_' . $this->id . '_day');
        $dsel->setSize(1);
        $dsel->addOption("TT", "0");
        for ($i = 1; $i < 32; $i++) {
            $dsel->addOption($i, $i);
        }
        $dsel->setSelected($day);
        $out .= $dsel->get();
        $msel = new rex_select();
        $msel->setName($formname . '[month]');
        $msel->setStyle("width:55px;" . $twarning);
        $msel->setId('el_' . $this->id . '_month');
        $msel->setSize(1);
        $msel->addOption("MM", "0");
        for ($i = 1; $i < 13; $i++) {
            $msel->addOption($i, $i);
        }
        $msel->setSelected($month);
        $out .= $msel->get();
        $year_start = (int) $this->elements[3];
        $year_end = (int) $this->elements[4];
        if ($year_start == 0) {
            $year_start = 1980;
        }
        if ($year_end == 0) {
            $year_end = 2010;
        }
        if ($year_end < $year_start) {
            $year_end = $year_start;
        }
        $ysel = new rex_select();
        $ysel->setName($formname . '[year]');
        $ysel->setStyle("width:88px;" . $twarning);
        $ysel->setId('el_' . $this->id . '_year');
        $ysel->setSize(1);
        $ysel->addOption("YYYY", "0");
        for ($i = $year_start; $i <= $year_end; $i++) {
            $ysel->addOption($i, $i);
        }
        $ysel->setSelected($year);
        $out .= $ysel->get();
        $out .= '</p>';
        $form_output[] = $out;
    }
示例#27
0
                $isSql = substr($file, strlen($file) - 4) == '.sql';
                $isArchive = substr($file, strlen($file) - 7) == '.tar.gz';
                if ($isSql) {
                    $export_sqls[] = substr($file, 0, -4);
                    $exports_found = true;
                } elseif ($isArchive) {
                    $export_archives[] = substr($file, 0, -7);
                    $exports_found = true;
                }
            }
            closedir($handle);
        }
        foreach ($export_sqls as $sql_export) {
            // Es ist ein Export Archiv + SQL File vorhanden
            if (in_array($sql_export, $export_archives)) {
                $sel_export->addOption($sql_export, $sql_export);
            }
        }
    }
    echo '
      <p>
        <input class="rex-chckbx" type="radio" id="dbanlegen_0" name="dbanlegen" value="0"' . $dbchecked0 . rex_tabindex() . ' />
        <label class="rex-lbl-right" for="dbanlegen_0">' . $I18N->msg('setup_034') . '</label>
      </p>

      <p>
        <input class="rex-chckbx" type="radio" id="dbanlegen_1" name="dbanlegen" value="1"' . $dbchecked1 . ' />
        <label class="rex-lbl-right" for="dbanlegen_1">' . $I18N->msg('setup_035', '<b>', '</b>') . '</label>
      </p>

      <p>
$sel_lang = new rex_select();
$sel_lang->setStyle('class="rex-form-select"');
$sel_lang->setName('neu_lang');
$sel_lang->setId('rex-form-lang');
$sel_lang->setSize(1);
$sel_lang->setSelected($REX['LANG']);
foreach ($REX['LOCALES'] as $l) {
    $sel_lang->addOption($l, $l);
}
$sel_mod_rewrite = new rex_select();
$sel_mod_rewrite->setSize(1);
$sel_mod_rewrite->setStyle('class="rex-form-select"');
$sel_mod_rewrite->setName('neu_modrewrite');
$sel_mod_rewrite->setId('rex-form-mod-rewrite');
$sel_mod_rewrite->setSelected($REX['MOD_REWRITE'] === false ? 'FALSE' : 'TRUE');
$sel_mod_rewrite->addOption('TRUE', 'TRUE');
$sel_mod_rewrite->addOption('FALSE', 'FALSE');
if ($warning != '') {
    echo rex_warning($warning);
}
if ($info != '') {
    echo rex_info($info);
}
echo '
	<div class="rex-form" id="rex-form-system-setup">
  	<form action="index.php" method="post">
    	<input type="hidden" name="page" value="specials" />
    	<input type="hidden" name="func" value="updateinfos" />
		
			<div class="rex-area-col-2">
				<div class="rex-area-col-a">
示例#29
0
$gc = rex_sql::factory();
$gc->setQuery('SHOW TABLES');
$tables = $gc->getArray();
$tbl_sel = new rex_select();
$tbl_sel->setName('VALUE[1]');
$tbl_sel->setSize(1);
$tbl_sel->addOption('Keine Tabelle ausgewählt', '');
foreach ($tables as $key => $value) {
    $tbl_sel->addOption(current($value), current($value));
}
$tbl_sel->setSelected('REX_VALUE[1]');
$tbl_sel = $tbl_sel->get();
$plz_tbl_sel = new rex_select();
$plz_tbl_sel->setName('VALUE[8]');
$plz_tbl_sel->setSize(1);
$plz_tbl_sel->addOption('Keine Tabelle ausgewählt', '');
foreach ($tables as $key => $value) {
    $plz_tbl_sel->addOption(current($value), current($value));
}
$plz_tbl_sel->setSelected('REX_VALUE[8]');
$plz_tbl_sel = $plz_tbl_sel->get();
?>

<table class="rex-table">
    <tr>
        <th colspan="2">yform GeoModul</th>
    </tr>
    <tr>
        <th>Quell-Tabelle</th>
        <td><?php 
echo $tbl_sel;
}
$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>
		<legend class="rex-lgnd"><?php 
echo $I18N_A93->msg('config_settings');
?>
</legend>
		<p>
		  <label for="fromname"><?php