function overview() { $this->scaff->order_by = $_GET['order'] ? $_GET['order'] : 'Stadt'; $this->scaff->group_by = 'Location_id'; $this->scaff->add_search_field('PLZ'); $this->scaff->add_search_field('Stadt'); $this->scaff->template_vars['stadt_value'] = $_GET['Stadt'] ? $_GET['Stadt'] : ''; $this->scaff->search_method = 'LIKE'; $this->scaff->template_vars['reset'] = ''; if ($_GET['PLZ'] || $_GET['PLZ'] === '0') { $_GET['PLZ'] = $this->scaff->template_vars['plz_value'] = preg_replace('/[^0-9]/', '', $_GET['PLZ']); for ($i = 0; $i < 5 - strlen($_GET['PLZ']); $i++) { $this->scaff->template_vars['plz_value'] .= 'x'; } $_GET['PLZ'] .= '%'; } else { $this->scaff->template_vars['plz_value'] = ''; } if ($stadt = $_GET['Stadt']) { $_GET['Stadt'] = "%{$stadt}%"; } if ($_GET['Stadt'] || $_GET['PLZ'] || $_GET['PLZ'] === '0') { $this->scaff->template_vars['reset'] = Html::br() . Html::a(SELF, 'Alle zeigen'); } return $this->scaff->make_table($sql, INSTALL_PATH . '/Module/LocationsFrontend/Templates/LocationsOverview.template.html'); }
function show($meldung = '') { if (defined('HTTPS') && HTTPS && !isset($_SERVER['HTTPS'])) { header("Location: " . 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); } if ($_SESSION['uuid']) { $vars['uuid'] = $_SESSION['uuid']; } else { $vars['uuid'] = $_SESSION['uuid'] = General::uuid(); } $template = $this->system->login_template ? $this->system->login_template : INSTALL_PATH . '/Templates/Login.template.html'; $login_form = new Template($template); $meldungen = Template::get_all_parts($login_form->template); $vars['meldung'] = $meldungen[$meldung] ? $meldungen[$meldung] : $meldung; $vars['action'] = SELF_URL; if (isset($_GET['logout'])) { $vars['user'] = $_GET['logout']; $vars['meldung'] = $login_form->parse_template('LOGOUT-MELDUNG', $vars); return Html::div($login_form->parse_template('FORM', $vars)); } if (!isset($_POST['user']) || !isset($_POST['pass'])) { $vars['meldung'] .= Html::br() . $meldungen['KENNWORT_EINGEBEN']; return Html::div($login_form->parse_template('FORM', $vars)); } else { $vars['meldung'] .= Html::br() . $meldungen['FAIL']; return Html::div($login_form->parse_template('FORM', $vars)); } }
/** * Form Component */ public static function formComponent() { $_templates = Themes::getTemplates(); foreach ($_templates as $template) { $templates[basename($template, '.template.php')] = basename($template, '.template.php'); } echo '<div class="col-xs-3">' . Form::open() . Form::hidden('csrf', Security::token()) . Form::label('sandbox_form_template', __('Sandbox template', 'sandbox')) . Form::select('sandbox_form_template', $templates, Option::get('sandbox_template'), array('class' => 'form-control')) . Html::br() . Form::submit('sandbox_component_save', __('Save', 'sandbox'), array('class' => 'btn btn-default')) . Form::close() . '</div>'; }
/** * Tests Html::br() * * @test */ public function test_br() { $output = Html::br(); $expected = "<br />"; $this->assertEquals($expected, $output); $output = Html::br('2', array('id' => 'example', 'class' => 'sample', 'style' => 'color:red;')); $expected = '<br id="example" class="sample" style="color:red;" /><br id="example" class="sample" style="color:red;" />'; $this->assertEquals($expected, $output); }
/** * Test Html::br(); * * @test */ public function test_br() { $expected = '<br /><br />'; $output = Html::br(2); $this->assertEquals($expected, $output); $expected = '<br class="clearfix" />'; $output = Html::br(1, array('class' => 'clearfix')); $this->assertEquals($expected, $output); }
function html($showErrors = false) { if (!$this->isContainer) { return parent::html($showErrors); } $elementsHtml = ''; foreach ($this->elements as $e) { $elementsHtml .= $e->html() . Html::br(); } parent::setContent($elementsHtml); return parent::html(); }
function show($meldung = '') { if (defined('HTTPS') && HTTPS && !isset($_SERVER['HTTPS'])) { header("Location: " . 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); } $vars['uuid'] = $_SESSION['uuid'] = General::uuid(); $template = $this->system->login_template ? $this->system->login_template : INSTALL_PATH . '/Templates/Login.template.html'; $login_form = new Template($template); $meldungen = Template::get_all_parts($login_form->template); $vars['meldung'] = $meldungen[$meldung] ? $meldungen[$meldung] : $meldung; $vars['action'] = SELF_URL; if (isset($_GET['logout'])) { $vars['user'] = $_GET['logout']; $vars['meldung'] = $login_form->parse_template('LOGOUT-MELDUNG', $vars); } if (isset($_GET['recover'])) { if ($_POST['recover_submit']) { $email = General::input_clean($_POST['email'], true); foreach ($this->system->user_tables as $t) { $sql = "SELECT * FROM `{$t}` WHERE `E-Mail` = '{$email}'"; $result = $this->system->connection->db_single_row($sql); if ($result) { break; } } if ($result) { $mail = $login_form->parse_template('RECOVER_MAIL', $result); mail($result['E-Mail'], 'Ihr ' . PROJECT_NAME . ' Passwort', $mail, 'From: ' . PROJECT_NAME . '<noreply@' . preg_replace('/^www\\./i', '', $_SERVER['HTTP_HOST']) . '>'); return $login_form->parse_template('RECOVER_THANKYOU', $result); } else { return $login_form->parse_template('RECOVER_NOFOUND', $result); } } else { $vars['meldung'] = 'Bitte geben Sie Ihre E-Mail-Adresse ein: '; } return Html::div($login_form->parse_template('RECOVER_FORM', $vars)); } if (!isset($_POST['user']) || !isset($_POST['pass'])) { $vars['meldung'] .= Html::br() . $meldungen['KENNWORT_EINGEBEN']; return Html::div($login_form->parse_template('FORM', $vars)); } else { /*if ($this->check_login($system)) { //if (HTTPS) header("Location: ".'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); header("Location: ".'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); } else {*/ $vars['meldung'] .= Html::br() . $meldungen['FAIL']; return Html::div($login_form->parse_template('FORM', $vars)); // } } }
function wrap_string($string, $line_length) { if (strlen($string) > $line_length) { $array = explode(' ', $string); $count = 0; for ($i = 0; $i < count($array); $i++) { $count += strlen($array[$i]); if ($count >= $line_length) { $array[$i] .= Html::br(); $count = 0; } } $string = implode(' ', $array); } return $string; }
/** * Página de inicio de muebleBBB * @param array $ofertas -> Array de Productos en oferta * @param array $novedades -> Array de Productos novedad */ function ofertas_novedades($ofertas, $novedades) { echo Html::div_("contenedor_inicio"); // Columna izquierda "Ofertas" echo Html::div_("ofertas columnas_inicio left") . Html::seccion(1, "Ofertas"); foreach ($ofertas as $oferta) { $precio_descuento = $oferta->__get("precio") - $oferta->__get("precio") / 100 * $oferta->__get("descuento"); echo Html::div_("contenedor_producto") . Html::a_("catalogo.php?id_producto={$oferta->__get("codigo")}") . Html::img("{$oferta->__get("imagen")}", "{$oferta->__get("nombre")}") . Html::span("{$oferta->__get("descuento")}%", "oferta") . Html::seccion(2, "{$oferta->__get("nombre")}", "nombre_producto") . Html::div_("detalles") . Html::p("{$oferta->__get("categoria")}", "categoria") . Html::p_("{$precio_descuento} €", "precio") . Html::br() . Html::del("{$oferta->__get("precio")}€", "precio_antes") . Html::_p() . Html::_div() . Html::_a() . Html::_div(); } echo Html::_div(); // Fin columna izquierda "Ofertas" // Columna derecha "Novedades" echo Html::div_("novedades columnas_inicio right") . Html::seccion(1, "Novedades"); foreach ($novedades as $novedad) { echo Html::div_("contenedor_producto") . Html::a_("catalogo.php?id_producto={$novedad->__get("codigo")}") . Html::img("{$novedad->__get("imagen")}", "{$novedad->__get("nombre")}") . Html::div_("novedad") . Html::img("../imagenes/nuevo.png", "etiqueta indicando novedad", "etiqueta_nuevo") . Html::_div() . Html::seccion(2, "{$novedad->__get("nombre")}", "nombre_producto") . Html::div_("detalles") . Html::p("{$novedad->__get("categoria")}", "categoria") . Html::p("{$novedad->__get("precio")}€", "precio") . Html::_div() . Html::_div() . Html::_a(); } echo Html::_div(); echo Html::_div(); }
public function item_view() { $class = str_replace('\\', '', $this->class); $val = $this->item->{$this->field} ? $this->item->{$this->field} : ''; $result = html_tag('input', array('name' => "{$class}-" . ($this->item->id ? $this->item->id : 'new') . "-{$this->field}", 'type' => 'file')); if ($val) { $upload_type = $this->def('upload_type', 'image'); if ($upload_type == 'image') { $result .= \Html::br(2); if ($this->def('secure')) { $result .= $this->item->{$this->field}; } else { $result .= html_tag('image', array('src' => $this->item->get_image(array('field' => $this->field)))); } } elseif ($upload_type == 'audio') { $result .= \Html::nbs(3) . $this->item->{$this->field}; } } return $result; }
public function item_view() { // First, build the Audiofile select $audiofiles = Model_Audiofile::find()->order_by('filename')->get(); $select = array('<option value=""></option>'); foreach ($audiofiles as $af) { $select[$af->id] = '<option value="' . $af->id . '" not_selected="1">' . $af->filename . '</option>'; } $result = "<table id=\"track_list\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><b>#</b></td>\n\t\t\t\t\t<td><b>Name</b></td>\n\t\t\t\t\t<td><b>File</b></td>\n\t\t\t\t\t<td></td>\n\t\t\t\t</tr>"; foreach ($this->item->tracks as $track) { $temp_select = $select; if ($track->audiofile) { $temp_select[$track->audiofile->id] = str_replace('not_selected', 'selected', $temp_select[$track->audiofile->id]); } $result .= "<tr>\n\t\t\t\t\t<td>" . html_tag('input', array('type' => 'text', 'value' => $track->track_num, 'name' => "item_field[Model_Track][{$track->id}][track_num]")) . "</td>\n\t\t\t\t\t<td>" . html_tag('input', array('type' => 'text', 'value' => $track->name, 'name' => "item_field[Model_Track][{$track->id}][name]")) . "</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select name=\"item_field[Model_Track][{$track->id}][audiofile_id]\">" . implode('', $temp_select) . "</select>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>" . html_tag('input', array('type' => 'button', 'value' => 'delete', 'class' => 'delete', 'track_id' => $track->id, 'onclick' => '$(this).parent().parent().remove();')) . "</td>\n\t\t\t\t</tr>"; } // add blank track field for cloning purposes $result .= "<tr style=\"display:none;\" id=\"track_clone\">\n\t\t\t\t<td>" . html_tag('input', array('type' => 'text', 'class' => 'track_num')) . "</td>\n\t\t\t\t<td>" . html_tag('input', array('type' => 'text', 'class' => 'name')) . "</td>\n\t\t\t\t<td><select class=\"audiofile\">" . implode('', $select) . "</select></td>\n\t\t\t\t<td>" . html_tag('input', array('type' => 'button', 'class' => 'delete', 'value' => 'delete', 'onclick' => '$(this).parent().parent().remove();')) . "</td>\n\t\t\t</tr>"; $result .= "</table>" . Html::br(2) . html_tag('input', array('type' => 'button', 'value' => 'new track', 'id' => 'new_track', 'onclick' => "TrackField.newTrack();")); return $result; }
function make_form($edit = '') { if ($edit) { $values = $this->get_entry($edit); $edit = is_array($edit) ? current($edit) : $edit; } $return = ''; $return .= Form::form_tag($this->action ? $this->action : SELF, 'post', 'multipart/form-data', array('onsubmit' => 'return checkform()')); $table = new Table(2); foreach ($this->cols_array as $key => $col) { $name = $key; $show_name = $col['name']; $id = 'input_' . $GLOBALS['input_id']; $encoded_name = rawurlencode($name); $attr_array = $col['attributes']; if (isset($values[$key])) { $value = $values[$key]; } elseif ($col['value']) { $value = $col['value']; } elseif ($this->re_entry && $_POST[$name]) { $value = $_POST[$name]; } else { $value = ''; } if ($name != 'id') { switch ($col['type']) { case 'text': $attr_array['id'] = $id; if (isset($col['length'])) { $attr_array['size'] = $field['length']; $attr_array['maxlength'] = $field['length']; } else { $attr_array['size'] = 40; } $input = Form::add_input('text', $encoded_name, $value, $attr_array); break; case 'select': $attr_array['id'] = $id; $select = new Select($encoded_name, $attr_array); $select->add_option('', '--Bitte auswählen--'); $attr_array = array(); foreach ($col['options'] as $option => $name) { if ($value == $option) { $attr_array['selected'] = 'selected'; } else { unset($attr_array['selected']); } $select->add_option(rawurlencode($option), $name, $attr_array); } if ($col['sonstiges']) { $select->add_option('', 'Sonstige:'); } //,array('onclick'=>'sonstig_input(this,\''.rawurlencode($encoded_name).'\')')); $input = $select->flush_select(); break; case 'check': $input = ''; foreach ($col['options'] as $option => $name) { if (is_array($value) && in_array($option, $value)) { $attr_array['checked'] = 'checked'; } else { unset($attr_array['checked']); } $input .= Form::add_input('checkbox', $encoded_name . '[]', $option, $attr_array) . ' ' . $name . Html::br(); } break; case 'textarea': $attr_array['id'] = $id; $attr_array['cols'] = $col['attributes']['cols'] ? $col['attributes']['cols'] : 30; $attr_array['rows'] = $col['attributes']['rows'] ? $col['attributes']['rows'] : 10; $input = Form::add_textarea($encoded_name, $value, $attr_array); //,'cols'=>'35','rows'=>'2','onfocus'=>'textarea_grow(\''.$id.'\')','onblur'=>'textarea_shrink(\''.$id.'\')')); if ($col['html']) { if (!$xinha_loaded) { $GLOBALS['scripts'] .= Html::script(' _editor_url = "/' . INSTALL_PATH . '/Libraries/Xinha/";_editor_lang = "de";_document_root = "' . DOCUMENT_ROOT . '";project_name = "' . PROJECT_NAME . '";'); $GLOBALS['scripts'] .= Html::script('', array('src' => '/' . INSTALL_PATH . '/Libraries/Xinha/XinhaLoader.js')); $GLOBALS['scripts'] .= Html::script('', array('src' => '/' . INSTALL_PATH . '/System/Scaffold/XinhaConfig.php')); $GLOBALS['scripts'] .= Html::script('xinha_editors.push("' . $id . '")'); $xinha_loaded = true; } else { $GLOBALS['scripts'] .= Html::script('xinha_editors.push("' . $id . '")'); } } break; case 'upload': $attr_array['id'] = $id; $input = $value ? $value . Form::add_input('hidden', $encoded_name, $value, $attr_array) . Html::br() . Html::span('Neue Datei verknüpfen:', array('class' => 'klein')) . Html::br() : ''; $input .= Form::add_input('file', $encoded_name . '_upload'); break; case 'custom': $input = $col['custom_input']; break; case 'timestamp': $this->calendar_script(); $attr_array['id'] = 'tag_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input = Form::add_input('text', $encoded_name . '_tag', ($tag = Date::tag($value)) != 0 && $value != '' ? $tag : '', $attr_array) . '.'; $attr_array['id'] = 'monat_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_monat', ($monat = Date::monat($value)) != 0 && $value != '' ? $monat : '', $attr_array) . '.'; $attr_array['id'] = 'jahr_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_jahr', ($jahr = Date::jahr($value)) != 0 && $value != '' ? $jahr : '', $attr_array) . ' '; $attr_array['id'] = 'stunde_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_stunde', ($stunde = Date::stunde($value)) != 0 && $value != '' ? $stunde : '', $attr_array) . ':'; $attr_array['id'] = 'minute_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_minute', ($minute = Date::minute($value)) != 0 && $value != '' ? $minute : '', $attr_array); $input .= Form::add_input('hidden', $encoded_name, $value, array('id' => $id)); $input .= Form::add_input('button', '', 'Kalender', array('id' => 'trigger_' . $GLOBALS['input_id'])); $script = ' Calendar.setup( { inputField : "' . $id . '", // ID of the input field ifFormat : "%Y/%m/%d", // the date format button : "trigger_"+' . $GLOBALS['input_id'] . ', // ID of the button showsTime : false, timeFormat : "24", showOthers : true, onSelect : onSelect, onUpdate : onUpd, inputId : ' . $GLOBALS['input_id'] . ', prevInput : "test" } ); timefields.push("' . $id . '"); '; $input .= Html::script($script); break; case 'email': preg_match('/(.*?)<?([0-9a-z.+-]{2,}\\@[0-9a-z.-]{2,}\\.[a-z]{2,6})>?/', $value, $matches); $name_value = trim($matches[1]); $mail_value = $matches[2]; $attr_array['id'] = 'name_' . $GLOBALS['input_id']; $input = 'Name ' . Form::add_input('text', $encoded_name . '_name', $name_value, $attr_array); $attr_array['id'] = 'mail_' . $GLOBALS['input_id']; $input .= 'E-Mail ' . Form::add_input('text', $encoded_name . '_mail', $mail_value, $attr_array); break; case 'info': $input = $col['value']; $hidden_inputs .= Form::add_input('hidden', $encoded_name, $value, $attr_array); break; case 'hidden': $attr_array['id'] = $id; $hidden_inputs .= Form::add_input('hidden', $encoded_name, $value, $attr_array); $input = ''; break; case 'ignore': unset($input); break; } if ($col['required'] && $input) { if ($col['type'] == 'timestamp') { $input .= Html::script("\nrequired_fields.push('" . 'tag_' . $GLOBALS['input_id'] . "');"); $input .= Html::script("\nrequired_fields.push('" . 'monat_' . $GLOBALS['input_id'] . "');"); $input .= Html::script("\nrequired_fields.push('" . 'jahr_' . $GLOBALS['input_id'] . "');"); } else { $input .= Html::script("\nrequired_fields.push('{$id}');"); } } if ($input) { $table->add_td(array(Form::add_label($id, $show_name), $input)); } $GLOBALS['input_id']++; } } $input = $this->submit_button ? $this->submit_button : Form::add_input('submit', 'submit', 'Eintragen', array('class' => 'button')); if ($edit) { $input .= Form::add_input('hidden', 'edit_id', $edit); } $input .= Form::add_input('hidden', 'submit', 'submit'); $input .= $hidden_inputs; $table->add_td(array('', $input)); $return .= $table->flush_table(); $return .= Form::close_form(); return $return; }
function order_images() { $images_sql = "SELECT bilder.*, indices.Bild_id,indices.Raum_id,indices.index\n\t\tFROM `{$this->pics_db_table}` `bilder`\n\t\tLEFT JOIN `{$this->indices_db_table}` `indices`\n\t\t ON bilder.id = indices.Bild_id\n\t\tWHERE indices.Raum_id = " . $_GET['order'] . "\n\t\tORDER BY indices.index, indices.id ASC, bilder.Name ASC"; $images = $this->connection->db_assoc($images_sql); $room_info = $this->get_room_info($_GET['order']); $return = Html::h(2, $room_info['Roomname'] . ': Reihenfolge bearbeiten'); $return .= Form::form_tag(SELF . '?order=' . $_GET['order'], '', '', array('onsubmit' => 'updateOrder()', 'id' => 'orderform', 'style' => 'float:left;margin-right:20px;')); $GLOBALS['scripts'] .= Html::script('', array('src' => '/' . INSTALL_PATH . '/Module/RheinaufExhibition/Backend/order.js')); $select = new Select('select[]', array('size' => 24, 'id' => 'select', 'onclick' => "preview(this)", 'style' => 'min-width:220px;')); foreach ($images as $img) { $dateiname = $img['Dateiname']; $select->add_option($img['id'], $dateiname . ' ' . $img['Name'], array('filename' => $dateiname)); } $return .= $select->flush_select() . Html::br(); $return .= Html::a('javascript:void(0);', 'Hoch', array('class' => 'button', 'onclick' => 'up()')); $return .= Html::a('javascript:void(0);', 'Runter', array('class' => 'button', 'onclick' => 'down()')); $return .= Html::a('javascript:void(0);', 'Löschen', array('class' => 'button', 'onclick' => 'del()')); $return .= Html::a('javascript:void(0);', 'Titelbild', array('class' => 'button', 'onclick' => 'coverpic()')); if (!$room_info['Titelbild']) { $room_info['Titelbild'] = $images[0]['Dateiname']; } $return .= Form::add_input('hidden', 'coverpic', $room_info['Titelbild'], array('id' => 'coverpic')); $return .= Form::add_input('submit', 'submit', 'Speichern', array('class' => 'button')); $return .= Html::a(SELF, 'Zurück', array('class' => 'button', 'onclick' => 'return getChanged()')); $return .= Form::close_form(); $return .= Html::div('Ausgewähltes Bild' . Html::br() . Html::img('', '', array('id' => 'selected_preview')), array('style' => 'display:none')); $return .= Html::br(); $return .= 'Titelbild' . Html::br(); $return .= Html::img('/' . $this->filepath . $this->landscape_thumb_dir . $room_info['Titelbild'], 'Noch nicht festgelegt', array('id' => 'coverpic_preview')); return $return; }
function make_form($edit = '') { if ($edit) { $values = $this->get_entry($edit); $edit = is_array($edit) ? current($edit) : $edit; } $return = ''; $return .= Form::form_tag($this->action ? $this->action : SELF, 'post', 'multipart/form-data', array('onsubmit' => 'return checkform()')); $table = new Table(2); foreach ($this->cols_array as $key => $col) { $name = $key; $show_name = $col['name']; $id = 'input_' . $GLOBALS['input_id']; $encoded_name = rawurlencode($name); $attr_array = $col['attributes']; if (isset($values[$key])) { $value = $values[$key]; } elseif ($col['value']) { $value = $col['value']; } elseif ($this->re_entry && $_POST[$name]) { $value = $_POST[$name]; } else { $value = ''; } if ($name != 'id') { switch ($col['type']) { case 'text': $attr_array['id'] = $id; if (isset($col['length'])) { $attr_array['size'] = $field['length']; $attr_array['maxlength'] = $field['length']; } else { $attr_array['size'] = 40; } $input = Form::add_input('text', $encoded_name, $value, $attr_array); break; case 'select': $attr_array['id'] = $id; $select = new Select($encoded_name, $attr_array); $select->add_option('', '--Bitte auswählen--'); $attr_array = array(); foreach ($col['options'] as $option => $name) { if ($value == $option) { $attr_array['selected'] = 'selected'; } else { unset($attr_array['selected']); } $select->add_option(rawurlencode($option), $name, $attr_array); } if ($col['sonstiges']) { $select->add_option('', 'Sonstige:'); } //,array('onclick'=>'sonstig_input(this,\''.rawurlencode($encoded_name).'\')')); $input = $select->flush_select(); break; case 'check': $input = ''; foreach ($col['options'] as $option => $name) { if (is_array($value) && in_array($option, $value)) { $attr_array['checked'] = 'checked'; } else { unset($attr_array['checked']); } $input .= Form::add_input('checkbox', $encoded_name . '[]', $option, $attr_array) . ' ' . $name . Html::br(); } break; case 'textarea': $attr_array['id'] = $id; $attr_array['cols'] = $col['attributes']['cols'] ? $col['attributes']['cols'] : 30; $attr_array['rows'] = $col['attributes']['rows'] ? $col['attributes']['rows'] : 10; $input = Form::add_textarea($encoded_name, $value, $attr_array); //,'cols'=>'35','rows'=>'2','onfocus'=>'textarea_grow(\''.$id.'\')','onblur'=>'textarea_shrink(\''.$id.'\')')); if ($col['html']) { if (!$xinha_loaded) { $GLOBALS['scripts'] .= Html::script(' _editor_url = "/' . INSTALL_PATH . '/Libraries/Xinha/";_editor_lang = "de";_document_root = "' . DOCUMENT_ROOT . '"'); $GLOBALS['scripts'] .= Html::script('', array('src' => '/' . INSTALL_PATH . '/Libraries/Xinha/htmlarea.js')); $GLOBALS['scripts'] .= Html::script(' xinha_editors = []; xinha_init = null; xinha_config = null; xinha_plugins = null; // This contains the names of textareas we will make into Xinha editors xinha_init = xinha_init ? xinha_init : function() { xinha_plugins = xinha_plugins ? xinha_plugins : [ "SuperClean", "ImageManager", //"GetHtml", //"Linker", "DoubleClick" ]; if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return; xinha_editors.push("' . $id . '"); xinha_config = xinha_config ? xinha_config : new HTMLArea.Config(); xinha_config.statusBar = false; xinha_config.toolbar = [ ["bold","italic"], ["separator","createlink","insertimage"], ["separator","undo","redo","selectall"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste","overwrite"]), ["separator","killword","separator","htmlmode","about","showhelp"] ]; //xinha_config.flowToolbars = false; xinha_config.showLoading = true; //xinha_config.only7BitPrintablesInURLs = false; xinha_config.SuperClean.show_dialog = true; xinha_config.SuperClean.filters = { "tidy": HTMLArea._lc("General tidy up and correction of some problems.", "SuperClean"), "word": "Word" } xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins); HTMLArea.startEditors(xinha_editors); } window.onload = xinha_init; '); $xinha_loaded = true; } else { $GLOBALS['scripts'] .= Html::script('xinha_editors.push("' . $id . '")'); } } break; case 'upload': $attr_array['id'] = $id; $input = $value ? $value . Form::add_input('hidden', $encoded_name, $value, $attr_array) . Html::br() . Html::span('Neue Datei verknüpfen:', array('class' => 'klein')) . Html::br() : ''; $input .= Form::add_input('file', $encoded_name . '_upload'); break; case 'custom': $input = $col['custom_input']; break; case 'timestamp': $this->calendar_script(); $attr_array['id'] = 'tag_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input = Form::add_input('text', $encoded_name . '_tag', ($tag = Date::tag($value)) != 0 && $value != '' ? $tag : '', $attr_array) . '.'; $attr_array['id'] = 'monat_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_monat', ($monat = Date::monat($value)) != 0 && $value != '' ? $monat : '', $attr_array) . '.'; $attr_array['id'] = 'jahr_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_jahr', ($jahr = Date::jahr($value)) != 0 && $value != '' ? $jahr : '', $attr_array) . ' '; $attr_array['id'] = 'stunde_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_stunde', ($stunde = Date::stunde($value)) != 0 && $value != '' ? $stunde : '', $attr_array) . ':'; $attr_array['id'] = 'minute_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_minute', ($minute = Date::minute($value)) != 0 && $value != '' ? $minute : '', $attr_array); $input .= Form::add_input('hidden', $encoded_name, $value, array('id' => $id)); $input .= Form::add_input('button', '', 'Kalender', array('id' => 'trigger_' . $GLOBALS['input_id'])); $script = ' Calendar.setup( { inputField : "' . $id . '", // ID of the input field ifFormat : "%Y/%m/%d", // the date format button : "trigger_"+' . $GLOBALS['input_id'] . ', // ID of the button showsTime : false, timeFormat : "24", showOthers : true, onSelect : onSelect, onUpdate : onUpd, inputId : ' . $GLOBALS['input_id'] . ', prevInput : "test" } ); timefields.push("' . $id . '"); '; $input .= Html::script($script); break; case 'email': preg_match('/(.*?)<?([0-9a-z.+-]{2,}\\@[0-9a-z.-]{2,}\\.[a-z]{2,6})>?/', $value, $matches); $name_value = trim($matches[1]); $mail_value = $matches[2]; $attr_array['id'] = 'name_' . $GLOBALS['input_id']; $input = 'Name ' . Form::add_input('text', $encoded_name . '_name', $name_value, $attr_array); $attr_array['id'] = 'mail_' . $GLOBALS['input_id']; $input .= 'E-Mail ' . Form::add_input('text', $encoded_name . '_mail', $mail_value, $attr_array); break; case 'info': $input = $col['value']; $hidden_inputs .= Form::add_input('hidden', $encoded_name, $value, $attr_array); break; case 'hidden': $attr_array['id'] = $id; $hidden_inputs .= Form::add_input('hidden', $encoded_name, $value, $attr_array); $input = ''; break; case 'ignore': unset($input); break; } if ($col['required'] && $input) { if ($col['type'] == 'timestamp') { $input .= Html::script("\nrequired_fields.push('" . 'tag_' . $GLOBALS['input_id'] . "');"); $input .= Html::script("\nrequired_fields.push('" . 'monat_' . $GLOBALS['input_id'] . "');"); $input .= Html::script("\nrequired_fields.push('" . 'jahr_' . $GLOBALS['input_id'] . "');"); } else { $input .= Html::script("\nrequired_fields.push('{$id}');"); } } if ($input) { $table->add_td(array(Form::add_label($id, $show_name), $input)); } $GLOBALS['input_id']++; } } $input = $this->submit_button ? $this->submit_button : Form::add_input('submit', 'submit', 'Eintragen', array('class' => 'button')); if ($edit) { $input .= Form::add_input('hidden', 'edit_id', $edit); } $input .= Form::add_input('hidden', 'submit', 'submit'); $input .= $hidden_inputs; $table->add_td(array('', $input)); $return .= $table->flush_table(); $return .= Form::close_form(); return $return; }
function content_4f42433c6c2b9($_smarty_tpl) { ?> <p>welcome to item view.</p> <a href="/admin/list/<?php echo $_smarty_tpl->tpl_vars['table']->value; ?> ">back to list</a> <?php echo Html::br(2); ?> <span style="color:green;"><?php if (isset($_smarty_tpl->tpl_vars['success']->value)) { echo $_smarty_tpl->tpl_vars['success']->value; } ?> </span> <form action="/admin/item/<?php echo $_smarty_tpl->tpl_vars['table']->value; ?> ?<?php if ($_smarty_tpl->tpl_vars['item']->value->id) { ?> id=<?php echo $_smarty_tpl->tpl_vars['item']->value->id; } else { ?> new=1<?php } ?> " method="POST" name="save_item" enctype="multipart/form-data"> <table border="0" cellspacing="5" cellpadding="5"> <?php $_smarty_tpl->tpl_vars['field'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['field']->_loop = false; $_from = $_smarty_tpl->tpl_vars['item_config']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['field']->key => $_smarty_tpl->tpl_vars['field']->value) { $_smarty_tpl->tpl_vars['field']->_loop = true; ?> <tr> <td valign="top"><?php echo $_smarty_tpl->tpl_vars['field']->value['desc']; ?> : </td> <td><?php echo $_smarty_tpl->tpl_vars['field']->value['type']->item_view(); ?> </td> </tr> <?php } ?> <tr> <td colspan="2"> <input type="submit" value="save" name="save_item" /> <input type="button" value="cancel" onclick="window.location = '/admin/list/<?php echo $_smarty_tpl->tpl_vars['table']->value; ?> ';" /> <?php if ($_smarty_tpl->tpl_vars['item']->value->id) { ?> <input type="submit" value="delete" name="delete" onclick="alert('Are you sure you want to delete this record?');"/> <?php } ?> </td> </tr> </table> </form> <?php echo Html::br(3); }
function groups_select($r = '', $s = '') { $existent_groups = $this->existent_groups(); $selected = array(); $return_string = ''; if ($r != '' && $s == '') { $show_to = $this->navi[$r]['Show_to']; $groups = is_array($show_to) ? $show_to : array(); } else { if ($r != '' && $s != '') { $show_to = $this->navi[$r]['Subnavi'][$s]['Show_to']; $groups = is_array($show_to) ? $show_to : array(); } else { $groups = array(); } } for ($i = 0; $i < count($existent_groups); $i++) { if (in_array($existent_groups[$i]['Name'], $groups)) { $selected = array('checked' => 'checked'); } else { $selected = array(); } $return_string .= Form::add_input('checkbox', 'Gruppen[]', $i, $selected) . ' ' . $existent_groups[$i]['Name'] . Html::br(); } return Html::div(Html::bold('Zugang beschränken')) . $return_string . Html::div('Nichts gewählt = keine Beschränkung', array('class' => 'klein')); }
echo Html::br() . Form::open() . Form::hidden('csrf', Security::token()); ?> <div class="row"> <div class="col-md-6"> <?php echo Form::label('toggle_duration', __('Slide duration [ms]', 'toggle')) . Form::input('toggle_duration', Option::get('toggle_duration'), array('class' => 'form-control')); ?> </div> <div class="col-md-6"> <?php echo Form::label('toggle_easing', __('Slide easing', 'toggle')) . Form::select('toggle_easing', array('linear' => 'linear', 'swing' => 'swing'), Option::get('toggle_easing'), array('class' => 'form-control')); ?> </div> </div> <?php echo Html::br() . Form::submit('toggle_options', __('Save', 'toggle'), array('class' => 'btn btn-primary')) . Form::close(); ?> <!-- modal: README markup --> <div id="modal-documentation" class="modal fade" tabindex="-1"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <div class="close" data-dismiss="modal">×</div> <h4 class="modal-title" id="myModalLabel">README.md</h4> </div> <div class="modal-body"></div> </div> </div> </div>
function make_form($edit = '', $action = null, $action_parameter_filter = array(), $template = null) { if ($edit) { $values = $this->get_entry($edit); $edit = is_array($edit) ? current($edit) : $edit; } $GLOBALS['scripts'] .= Html::script("onLoad.push(checkConditions);"); //$GLOBALS['scripts'] .= Html::script("onLoad.push(sizeTextAreas);"); $return = ''; $url = $action ? $action : SELF_URL; $url .= strstr($url, '?') ? '&' : '?'; $url .= $this->GET_2_url(array_merge(array('edit', 'new', 'noframe', 'reentry'), $action_parameter_filter)); //$url .= ($_GET['edit']) ? '#entry'.$_GET['edit'] : ''; $return .= Form::form_tag($url, 'post', 'multipart/form-data', array('onsubmit' => "loading();return checkform();")); $table = new Table(2, array('class' => 'scaffold')); $return .= $this->text_above_form; if ($this->show_buttons_above_form) { $input = $this->submit_button ? $this->submit_button : Form::add_input('submit', 'submit', 'Eintragen', array('class' => 'button')); if ($this->show_cancel) { $input .= Form::add_input('button', 'cancel', 'Abbrechen', array('class' => 'button', 'onclick' => 'cancelEdit(this)')); } $table->add_td(array(array(2 => $input))); } foreach ($this->cols_array as $key => $col) { $name = $key; //$show_name = General::wrap_string($col['name'],30); $show_name = $col['name']; $show_name .= $col['required'] ? ' *' : ''; $id = 'input_' . $GLOBALS['input_id']; $encoded_name = rawurlencode($name); $attr_array = $col['attributes']; if ($col['disabled']) { $attr_array['disabled'] = 'disabled'; } else { if ($attr_array['disabled']) { unset($attr_array['disabled']); } } if ($this->re_entry || isset($_REQUEST['reentry']) && $_POST[$name]) { $value = $_POST[$name]; } else { if ($values[$key]) { $value = $values[$key]; } else { if ($col['value']) { $value = $col['value']; } else { $value = ''; } } } if (isset($col['options'])) { $options = $this->get_options($col['options'], $col['options_sort'], $col['options_insert_id']); if (!$col['options_hide_edit_button']) { $edit_options_btn = is_string($col['options']) && $this->edit_enabled ? Html::a("javascript:void(0);", 'Optionen bearbeiten', array('class' => 'button', 'onclick' => "window.open('" . SELF_URL . "?nomenu&editoptions={$encoded_name}','scaff_dialog','toolbar=no,menubar=yes,personalbar=no,width=500,scrollbars=yes,resizable=yes,modal=yes,dependable=yes');var refresh=document.getElementById('{$id}_refresh');refresh.style.display='';refresh.focus();return false;")) : ''; $edit_options_btn .= Form::add_input('submit', 'reentry', 'Aktualisieren', array('id' => $id . '_refresh', 'style' => 'display:none')); $edit_options_btn = Html::br() . $edit_options_btn; } } if ($name != 'id') { switch ($col['type']) { case 'text': $attr_array['id'] = $id; if (isset($col['length'])) { $attr_array['size'] = $field['length']; $attr_array['maxlength'] = $field['length']; } else { if (!stristr($attr_array['style'], 'width')) { $attr_array['style'] .= "width:{$this->input_width};"; } } if ($col['multiple']) { $input = Form::add_input('text', $encoded_name . '[]', $value, $attr_array); $info .= Html::a('javascript:void(0);', '+', array('onclick' => 'cloneInput(\'' . $id . '\')')); } else { $input = Form::add_input('text', $encoded_name, $value, $attr_array); } break; case 'select': $attr_array['id'] = $id; $select = new Select($encoded_name, array_merge($attr_array, array('onchange' => "selectOtherOption('{$id}','" . $col['other_option'] . "')"))); $select->add_option('', '--Bitte auswählen--'); $attr_array = array(); if (is_array($options)) { if (!in_array($value, $options) && !key_exists($value, $options)) { $col['other'] = $value; } foreach ($options as $option => $name) { if ($value == $option) { $attr_array['selected'] = 'selected'; } else { unset($attr_array['selected']); } $select->add_option($option, $name, $attr_array); } if ($col['other_option']) { if ($col['other']) { $attr_array['selected'] = 'selected'; } $attr_array['onclick'] = 'otherOption(this,\'' . rawurlencode($encoded_name) . '\')'; $select->add_option('', $col['other_option'], $attr_array); } else { unset($attr_array['onclick']); } } $input = $select->flush_select(); if ($col['other']) { $input .= Form::add_input('text', $encoded_name, $col['other'], array('onfocus' => "selectOtherOption('{$id}','" . $col['other_option'] . "')", 'id' => $id . '_other')); } $input .= $edit_options_btn; break; case 'radio': $attr_array['id'] = $id; $attr_array = array(); $input = ''; foreach ($options as $option => $name) { if ($value == $option) { $attr_array['checked'] = 'checked'; } else { unset($attr_array['checked']); } if (isset($col['condition'][$option])) { $condition = "{input:'" . $encoded_name . "',value:'" . $option . "',target:'" . $col['condition'][$option] . "'}"; $input .= Html::script("conditions.push({$condition})"); //$attr_array['onchange'] = "checkCondition($condition)"; } else { //unset($attr_array['onchange']); } if (isset($col['condition'])) { $attr_array['onchange'] = "checkCondition({$condition})"; } else { unset($attr_array['onchange']); } $input .= Form::add_input('radio', $encoded_name, $option, $attr_array) . ' ' . $name . Html::br(); } if ($col['condition']) { } $input .= $edit_options_btn; break; case 'check': $input = ''; if (!is_array($value)) { $value = explode('&delim;', $value); } foreach ($options as $option => $name) { if (is_array($value) && in_array($option, $value)) { $attr_array['checked'] = 'checked'; } else { unset($attr_array['checked']); } $input .= Form::add_input('checkbox', $encoded_name . '[]', $option, $attr_array) . ' ' . $name . Html::br(); } if ($col['other_option']) { $other = array_diff($value, $options); $input .= $col['other_option'] . ' ' . Form::add_input('text', $encoded_name . '[]', implode(', ', $other)) . Html::br(); } $input .= $edit_options_btn; $input = Html::div($input, array('id' => $id, 'name' => $encoded_name)); break; case 'textarea': $attr_array['id'] = $id; if ($col['attributes']['cols']) { $col['attributes']['cols']; } else { if (!stristr($attr_array['style'], 'width')) { $attr_array['style'] .= "width:{$this->input_width};"; } } $attr_array['rows'] = $col['attributes']['rows'] ? $col['attributes']['rows'] : 10; if ($col['max_length']) { $attr_array['onkeydown'] = 'return maxLength(event,this,' . $col['max_length'] . ')'; } $input = Form::add_textarea($encoded_name, $value, $attr_array); //,'cols'=>'35','rows'=>'2','onfocus'=>'textarea_grow(\''.$id.'\')','onblur'=>'textarea_shrink(\''.$id.'\')')); if ($col['max_length']) { $input .= Html::span("Noch " . Html::span($col['max_length'] - strlen($value), array('id' => $id . '_charsleft')) . " Zeichen"); } if ($col['options']) { $input .= Html::br() . $edit_options_btn; } if ($col['html']) { $this->xinha_scripts(); } break; case 'upload': $input = ''; $value = $values[$key]; $entries = array(); if (!is_array($value)) { $entries = explode('&delim;', $value); } else { $entries = $value; } $upload_folder = ''; if (is_string($this->upload_folder)) { $this->upload_folder = array($this->upload_folder); } foreach ($this->upload_folder as $col_name) { $upload_folder .= $values[$col_name]; } $upload_folder .= '/'; if (count(General::trim_array($entries)) > 0) { $subtable = new Table(3); foreach ($entries as $file) { $img_info = @getimagesize($this->upload_path . $upload_folder . $file); if ($img_info) { $thumb = Html::img(SELF_URL . '?img=' . rawurlencode($upload_folder . $file) . '&x=100', $file); } else { $thumb = ''; } $check = Form::add_input('hidden', $encoded_name . '[]', $file); $check .= Html::br() . Form::add_input('checkbox', $encoded_name . '_delfile[]', $file, array("onclick" => "confirmDelPic(this)")) . ' Datei löschen'; $subtable->add_td(array($thumb, $file . $check)); } $input .= $subtable->flush_table(); if ($col['upload_max_count']) { $input .= Html::span("Maximal " . $col['upload_max_count'] . " Dateien" . Html::br(), array('class' => 'klein')); } } if ($col['upload_max_count'] && count(General::trim_array($entries)) >= $col['upload_max_count']) { continue; } $attr_array['id'] = $id; //$input = ($value) ? $value.Form::add_input('hidden',$encoded_name,$value,$attr_array).Html::br().Html::span('Neue Datei verknüpfen:',array('class'=>'klein')).Html::br():''; $input .= Form::add_input('file', $encoded_name . '_upload[]'); // if ($col['upload_max_count']) // { $input .= Form::add_input('submit', 'reentry', 'Hochladen'); // } if ($col['upload_extensions']) { $input .= Html::br() . Html::span("Erlaubte Erweiterungen: " . implode(', ', $col['upload_extensions']), array('class' => 'klein')); } if ($col['upload_size']) { $input .= Html::br() . Html::span("Maximale Dateigröße: " . $col['upload_size'] . 'KB', array('class' => 'klein')); } break; case 'EFM': break; case 'custom': $input = $col['custom_input']; break; case 'timestamp': $this->calendar_script(); $attr_array['id'] = 'tag_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input = Form::add_input('text', $encoded_name . '_tag', ($tag = Date::tag($value)) != 0 && $value != '' ? $tag : '', $attr_array) . '.'; $attr_array['id'] = 'monat_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_monat', ($monat = Date::monat($value)) != 0 && $value != '' ? $monat : '', $attr_array) . '.'; $attr_array['id'] = 'jahr_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_jahr', ($jahr = Date::jahr($value)) != 0 && $value != '' ? $jahr : '', $attr_array) . ' '; $attr_array['id'] = 'stunde_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_stunde', ($stunde = Date::stunde($value)) != 0 && $value != '' ? $stunde : '', $attr_array) . ':'; $attr_array['id'] = 'minute_' . $GLOBALS['input_id']; $attr_array['size'] = '2'; $input .= Form::add_input('text', $encoded_name . '_minute', ($minute = Date::minute($value)) != 0 && $value != '' ? $minute : '', $attr_array); $input .= Form::add_input('hidden', $encoded_name, $value, array('id' => $id)); $input .= Form::add_input('button', '', 'Kalender', array('id' => 'trigger_' . $GLOBALS['input_id'])); $script = ' Calendar.setup( { inputField : "' . $id . '", // ID of the input field ifFormat : "%Y/%m/%d", // the date format button : "trigger_"+' . $GLOBALS['input_id'] . ', // ID of the button showsTime : false, timeFormat : "24", showOthers : true, onSelect : onSelect, onUpdate : onUpd, inputId : ' . $GLOBALS['input_id'] . ', prevInput : "test" } ); timefields.push("' . $id . '"); '; $input .= Html::script($script); break; case 'email': preg_match('/(.*?)<?([0-9a-z.+-]{2,}\\@[0-9a-z.-]{2,}\\.[a-z]{2,6})>?/', $value, $matches); $name_value = trim($matches[1]); $mail_value = $matches[2]; $attr_array['id'] = 'name_' . $GLOBALS['input_id']; $input = 'Name ' . Form::add_input('text', $encoded_name . '_name', $name_value, $attr_array); $attr_array['id'] = 'mail_' . $GLOBALS['input_id']; $input .= 'E-Mail ' . Form::add_input('text', $encoded_name . '_mail', $mail_value, $attr_array); break; case 'info': $input = $col['value']; //$hidden_inputs .= Form::add_input('hidden',$encoded_name,$value,$attr_array); break; case 'hidden': $attr_array['id'] = $id; $hidden_inputs .= Form::add_input('hidden', $encoded_name, $value, $attr_array); $input = ''; break; case 'ignore': unset($input); break; case 'changed': $input = Form::add_textarea('', $value, array("disabled" => "disabled")) . Form::add_input('hidden', $encoded_name, $value); break; } if ($col['required'] && $input) { if ($col['type'] == 'timestamp') { $input .= Html::script("\nrequired_fields.push('" . 'tag_' . $GLOBALS['input_id'] . "');"); $input .= Html::script("\nrequired_fields.push('" . 'monat_' . $GLOBALS['input_id'] . "');"); $input .= Html::script("\nrequired_fields.push('" . 'jahr_' . $GLOBALS['input_id'] . "');"); } else { $input .= Html::script("\nrequired_fields.push('{$id}');"); } } $alternatig_rows = $alternatig_rows == 1 ? 0 : 1; $td_atributes['class'] = ' alt_row_' . $alternatig_rows; if ($col['hidden']) { $td_atributes['style'] = 'display:none;'; } else { unset($td_atributes['style']); } if ($col['info']) { if (!$GLOBALS['toolTipScriptLoaded']) { $GLOBALS['scripts'] .= Html::script(null, array('src' => '/Libraries/ToolTip/ToolTip.js')); $GLOBALS['scripts'] .= Html::script('onLoad.push(toolTipOnLoad)'); $GLOBALS['toolTipScriptLoaded'] = true; } $trigger_id = 'info' . $GLOBALS['input_id']; $source_id = "tooltip" . $GLOBALS['input_id']; $info = ' ' . Html::img('/' . INSTALL_PATH . "/System/Scaffold/info.gif", strip_tags($col['info']), array('id' => $trigger_id, 'title' => strip_tags($col['info']))); $info .= Html::div($col['info'], array('id' => $source_id, "style" => "display:none")); $info .= Html::script("toolTips.push({trigger : '{$trigger_id}',source : '{$source_id}',className : 'tooltip'});"); } else { $info = ''; } if ($input) { $table->add_td(array(Form::add_label($id, $show_name) . $info, $input), $td_atributes); } ++$GLOBALS['input_id']; } } $input = $this->submit_button ? $this->submit_button : Form::add_input('submit', 'submit', 'Eintragen', array('class' => 'button')); if ($this->show_cancel) { if ($this->use_ajax) { $input .= Form::add_input('button', 'cancel', 'Abbrechen', array('class' => 'button', 'onclick' => 'cancelEdit(this)')); } else { $input .= Form::add_input('submit', 'cancel', 'Abbrechen', array('class' => 'button')); } } $input .= Form::add_input('hidden', 'edit_id', $edit ? $edit : ''); $input .= Form::add_input('hidden', 'submit', 'submit'); $input .= $hidden_inputs; $table->add_td(array(array(2 => $input))); $return .= $table->flush_table(); $return .= Form::close_form(); if ($template) { $t = new Template($template); $vars['form'] = $return; return $t->parse_template(null, $vars); } else { return $return; } }
<td> <?php echo Html::heading($event['title'], 4); ?> </td> <td class="hidden-xs"> <?php echo date('d.m.Y H:i', strtotime($event['timestamp'])); if ($event['timestamp_end']) { if (date('d.m.Y', strtotime($event['timestamp'])) == date('d.m.Y', strtotime($event['timestamp_end']))) { echo ' – ' . date('H:i', strtotime($event['timestamp_end'])); } else { echo ' – ' . date('d.m.Y H:i', strtotime($event['timestamp_end'])); } } echo Html::br() . $event['short']; ?> </td> <td class="hidden-xs hidden-sm"> <div class="color-text-box" title="#<?php echo $event['color'] ? $event['color'] : $categories[$event['category']]['color']; ?> " style="border-left: 1.4em solid #<?php echo $event['color'] ? $event['color'] : $categories[$event['category']]['color']; ?> ; padding-left: 10px;" > <?php
/** * Genera el formulario para crear una nueva categoría. * @param array asociativo $categorias -> Contiene las categorías de la BBDD MuebleBBB de esta manera: "id-categoria"=>"nombre-categoria" */ function contenedorModificarCategoria($categorias, $mensaje_modCat) { echo Html::div_("opciones_admin contenedor_modificar_categoria") . Html::form_("", "POST") . Html::seccion(1, "MODIFICAR CATEGORÍA") . Html::select(1, $categorias, "categoria_id", 1, "", "modificar_categorias") . Html::input("text", "nuevo_nombre_categoria", "", "nombreModificarCategoria", false, "", "", "placeholder='Nuevo nombre' required='required' size='10' maxlength='10'") . Html::br() . Html::input("checkbox", "borrar", "", "borrarCategoriaCB", true, "Borrar Categoria") . Html::br() . Html::input("submit", "", "Modificar", "btnModificarCategoria") . Html::_form() . Html::div_("clear") . Html::_div(); if ($mensaje_modCat != "") { echo Html::div_("mensaje_modificar_categoria"); if ($mensaje_modCat == "¡OK!") { echo Html::span(" ", "fontawesome-ok mensaje_correcto", "", "title='La categoría ha sido modificada con éxito'") . Html::p("{$mensaje_modCat}", "mensaje_correcto visible_inline"); } else { if ($mensaje_modCat == "¡Error!") { echo Html::span(" ", "fontawesome-remove error", "", "title='La categoría ya existe en la BBDD'") . Html::p("{$mensaje_modCat}", "error visible_inline"); } else { if ($mensaje_modCat == "¡Borrado!") { echo Html::span(" ", "fontawesome-ok mensaje_correcto", "", "title='La categoría se ha borrado con éxito'") . Html::p("{$mensaje_modCat}", "mensaje_correcto visible_inline"); } else { if ($mensaje_modCat == "¡Productos en categoría!") { echo Html::span(" ", "fontawesome-remove error", "", "title='La categoría contiene productos'") . Html::p("{$mensaje_modCat}", "error visible_inline"); } } } } echo Html::_div(); } echo Html::_div(); }
function work() { $loc_id = $_GET['addwork']; //$edit_work = ($_GET[]) $location = $this->connection->db_single_row("SELECT * FROM `{$this->db_table}` WHERE `Location_id`='{$loc_id}' ORDER BY `id` ASC"); $edit = !$location['Werk'] ? $location['id'] : ''; if ($_GET['edit']) { $edit = $_GET['edit']; } $this->scaff->cols_array['Location_id']['type'] = 'hidden'; $this->scaff->cols_array['Location_id']['value'] = $location['Location_id']; $this->scaff->cols_array['Location_name']['type'] = 'hidden'; $this->scaff->cols_array['Location_name']['value'] = $location['Location_name']; $this->scaff->cols_array['Adresse']['type'] = 'hidden'; $this->scaff->cols_array['Adresse']['value'] = $location['Adresse']; $this->scaff->cols_array['PLZ']['type'] = 'hidden'; $this->scaff->cols_array['PLZ']['value'] = $location['PLZ']; $this->scaff->cols_array['Stadt']['type'] = 'hidden'; $this->scaff->cols_array['Stadt']['value'] = $location['Stadt']; $this->scaff->cols_array['Ortszusatz']['type'] = 'hidden'; $this->scaff->cols_array['Ortszusatz']['value'] = $location['Ortszusatz']; $this->scaff->cols_array['Land']['type'] = 'hidden'; $this->scaff->cols_array['Land']['value'] = $location['Land']; $this->scaff->cols_array['Website']['type'] = 'hidden'; $this->scaff->cols_array['Website']['value'] = $location['Website']; $this->scaff->cols_array['Breite']['type'] = 'hidden'; $this->scaff->cols_array['Breite']['value'] = $location['Breite']; $this->scaff->cols_array['Länge']['type'] = 'hidden'; $this->scaff->cols_array['Länge']['value'] = $location['Länge']; $this->scaff->cols_array['Technik']['type'] = 'select'; $this->scaff->cols_array['Technik']['options'] = array('Betonrelief' => 'Betonrelief', 'Skulptur' => 'Skulptur', 'Fenster (Bleiverglasung)' => 'Fenster (Bleiverglasung)', 'Fenster (Betonverglasung)' => 'Fenster (Betonverglasung)', 'Wandteppiche' => 'Wandteppiche', 'Decken- und Wandgemälde' => 'Decken- und Wandgemälde', 'Bilder' => 'Bilder'); /*$this->scaff->cols_array['Jahr']['type'] = 'ignore'; $this->scaff->cols_array['Werk']['type'] = 'ignore'; $this->scaff->cols_array['Beschreibung']['type'] = 'ignore'; $this->scaff->cols_array['Mitarbeit']['type'] = 'ignore'; $this->scaff->cols_array['Ausführung']['type'] = 'ignore'; $this->scaff->cols_array['Architekten']['type'] = 'ignore'; $this->scaff->cols_array['Literatur']['type'] = 'ignore';*/ $this->scaff->cols_array['action']['type'] = 'hidden'; $this->scaff->cols_array['action']['value'] = 'insertwork'; $return = Html::h(2, 'Werk hinzufügen'); $return .= Html::bold($location['Location_name']) . ' '; $return .= $location['Adresse'] . ' '; $return .= $location['PLZ'] . ' ' . $location['Stadt'] . $location['Ortszusatz'] . Html::br() . Html::br(); return $return . $this->scaff->make_form($edit); }
<?php require_once 'libreria/Html.php'; /* TESTEO: * OJO!!!!! los métodos estáticos Html me devuelven cadenas, de ahí que sólo hago un 'echo' y concateno cada una de las llamadas * con puntos '.' y cerrando la última sentencia con el ';' */ echo Html::html_() . Html::tab() . Html::head_() . Html::tab(2) . Html::title("HTML generado con métodos estáticos de clase Html con PHP") . Html::tab(2) . Html::meta() . Html::tab(2) . Html::meta('name="description" content="Página realizada con métodos estáticos de PHP"') . Html::tab(2) . Html::link() . Html::tab() . Html::_head() . Html::tab() . Html::body_() . Html::tab(2) . Html::div_("ClaseDiv") . Html::tab(3) . Html::seccion("Este valor va a ser 1 por defecto", "Sección H1", 'seccion', '', 'IdH1') . Html::tab(3) . Html::seccion(2, "Sección H2", 'seccion', 'IdH2') . Html::tab(3) . Html::seccion(3, "Sección H3", 'seccion', 'IdH3') . Html::tab(3) . Html::seccion(4, "Sección H4", 'seccion', 'IdH4') . Html::tab(3) . Html::seccion(5, "Sección H5", 'seccion', 'IdH5') . Html::tab(3) . Html::seccion(6, "Sección H6", 'seccion', 'IdH6') . Html::tab(3) . Html::hr() . Html::tab(3) . Html::p('Contenido de un párrafo.') . Html::tab(3) . Html::p('Contenido de un párrafo largo: Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaquepsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla.') . Html::tab(3) . Html::a_('enlace con apertura y cierre') . Html::_a() . Html::tab(3) . Html::p_('Párrafo con apertura y cierre y ' . Html::strong("¡¡contenido en negrita!! ") . 'Más párrafo después de strong.') . Html::_p() . Html::tab(3) . Html::p_('Párrafo con apertura y cierre y ' . Html::em("¡¡contenido en cursiva!! ") . 'Más párrafo después de em.') . Html::_p() . Html::tab(3) . Html::p_('Superíndice: 2' . Html::sup("2") . ' = 4.') . Html::_p() . Html::tab(3) . Html::p_('Subíndice: H ' . Html::sub("2") . 'O -> Agua.') . Html::_p() . Html::tab(3) . Html::p_('Párrafo con apertura y cierre y ' . Html::span("¡¡contenido dentro de span que cambia el color de fuente a rojo!! ", "", "", "style='color:red'") . 'Más párrafo después de span.') . Html::_p() . Html::tab(3) . Html::p_('Párrafo con apertura y cierre y ' . Html::a("enlace dentro de párrafo. ") . 'Más párrafo después de enlace.') . Html::_p() . Html::tab(2) . Html::_div() . Html::tab(2) . Html::div_("ClaseDiv", "", "style='background:#8BC34A'") . Html::tab(3) . Html::p('¡¡Este párrafo está dentro de un div con backgroudnd verde!!') . Html::tab(2) . Html::_div() . Html::tab(2) . Html::hr() . Html::tab(2) . Html::p_() . Html::strong("Listado ordenado:") . Html::_p() . Html::tab(2) . Html::ol_("listado ordenado", "", 4) . Html::tab(3) . Html::li('Lista 1') . Html::tab(3) . Html::li('Lista 2') . Html::tab(3) . Html::li('Lista 3') . Html::tab(3) . Html::li('Lista 4') . Html::tab(3) . Html::li('Lista 5') . Html::tab(2) . Html::_ol() . Html::tab(2) . Html::p_() . Html::strong("Listado No ordenado:") . Html::_p() . Html::tab(2) . Html::ul_("listado no_ordenado", "", 4) . Html::tab(3) . Html::li('Lista 1') . Html::tab(3) . Html::li('Lista 2') . Html::tab(3) . Html::li('Lista 3') . Html::tab(3) . Html::li('Lista 4') . Html::tab(3) . Html::li('Lista 5') . Html::tab(2) . Html::_ul() . Html::tab(2) . Html::hr() . Html::tab(2) . Html::p_() . Html::strong("Imagen:") . Html::_p() . Html::tab(2) . Html::img("img/logo_jlalovi.png", "Logo de jlalovi") . Html::tab(2) . Html::hr() . Html::tab(2) . Html::table_("", "", "border=1") . Html::tab(3) . Html::caption("Tabla de prueba") . Html::tab(3) . Html::tr_() . Html::tab(4) . Html::th("Encabezado 1") . Html::tab(4) . Html::th("Encabezado 2") . Html::tab(4) . Html::th("Encabezado 3") . Html::tab(4) . Html::th("Encabezado 4") . Html::tab(3) . Html::_tr() . Html::tab(3) . Html::tr_() . Html::tab(4) . Html::td("celda 1.1") . Html::tab(4) . Html::td("celda 1.2") . Html::tab(4) . Html::td("celda 1.3") . Html::tab(4) . Html::td("celda 1.4") . Html::tab(3) . Html::_tr() . Html::tab(3) . Html::tr_() . Html::tab(4) . Html::td("celda 2.1") . Html::tab(4) . Html::td("celda 2.2") . Html::tab(4) . Html::td("celda 2.3") . Html::tab(4) . Html::td("celda 2.4") . Html::tab(3) . Html::_tr() . Html::tab(3) . Html::trTd(["celda 3.1", "celda 3.2", "celda 3.3", "celda 3.4"]) . Html::tab(2) . Html::_table() . Html::tab(2) . Html::hr() . Html::tab(2) . Html::form_("prueba_formulario.php") . Html::tab(3) . Html::fieldset_() . Html::tab(4) . Html::legend("Prueba formulario POST") . Html::tab(4) . Html::textarea("Prueba formulario", "texto", "idTextarea", true, "Label Textarea:") . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("text", "nombre", "", "idNombre", true, "Nombre:") . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("password", "clave", "", "idClave", true, "Clave:") . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("submit", "", "Enviar") . Html::tab(3) . Html::_fieldset() . Html::tab(2) . Html::_form() . Html::tab(2) . Html::form_("prueba_formulario.php", "get") . Html::tab(3) . Html::fieldset_() . Html::tab(4) . Html::legend("Prueba formulario GET") . Html::tab(4) . Html::input("checkbox", "nameCheckbox1", "Valor 1", "idCheckbox1", true, "Checkbox nº 1:", "ClaseCheckbox") . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("checkbox", "nameCheckbox2", "Valor 2", "idCheckbox2", true, "Checkbox nº 2:", "ClaseCheckbox") . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("checkbox", "nameCheckbox3", "Valor 3", "idCheckbox3", true, "Checkbox nº 3:", "ClaseCheckbox") . Html::tab(4) . Html::br() . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("radio", "nameRadio", "Valor 1", "idRadio1", true, "Radio nº 1:", "ClaseRadio") . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("radio", "nameRadio", "Valor 2", "idRadio2", true, "Radio nº 2:", "ClaseRadio") . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("radio", "nameRadio", "Valor 3", "idRadio3", true, "Radio nº 3:", "ClaseRadio") . Html::tab(4) . Html::br() . Html::tab(4) . Html::br() . Html::tab(4) . Html::select(4, ["uno" => 1, "dos" => 2, "tres" => 3], 3) . Html::tab(4) . Html::br() . Html::tab(4) . Html::br() . Html::tab(4) . Html::input("submit", "", "Enviar") . Html::tab(3) . Html::_fieldset() . Html::tab(2) . Html::_form() . Html::tab() . Html::_body() . Html::_html();
<!-- INFORMASI SURAT --> <!--<div class="divleft"><h2>Rekam Disposisi Kasubag/Kasi</h2></div>--> <!--<hr>--> <div id="pesan"></div> </br> <?php if (isset($this->data)) { $form = new Form_Generator(); $html = new Html(); $html->heading('INFORMASI SURAT MASUK :', 3); $html->hr(); $html->br(); $html->div_open('id', 'form-wrapper'); //var_dump($html->div_open('id', 'form-wrapper')); $form->form_open('suratkeluar'); $form->form_label('AGENDA SURAT MASUK'); $form->form_input(array('value' => $this->data[1], 'size' => 6)); $html->br(); $form->form_label('NOMOR SURAT MASUK'); $form->form_input(array('value' => $this->data[2], 'size' => 40)); $html->br(); $form->form_label('DARI'); $form->form_input(array('value' => $this->data[3], 'size' => 60)); $html->br(); $form->form_label('PERIHAL'); $form->form_textarea(array('name' => '#', 'cols' => 40, 'rows' => 5), $this->data[4]); $html->br(); $form->form_close(); $html->div_close(); $html->br(); $html->hr();
</div> </div> <div class="row"> <div class="col-sm-6"> <?php echo Form::label('event_image', __('Image file', 'events'), array('data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => __('Event title image from preconfigured image directory', 'events'))); if (sizeof($files) > 1) { echo Form::select('event_image', $files, Null, array('class' => 'form-control clear')); } else { echo Form::select('event_image', array(), Null, array('class' => 'form-control clear', 'disabled' => 'disabled', 'title' => __('No file available in configured image directory', 'events'))); } ?> </div> <div class="col-sm-6"> <?php echo Form::label('event_imagesection', __('Clip image', 'events'), array('data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => __('Specifies how to clip rectangular image to square', 'events'))) . Html::br(); ?> <select class="image-picker" name="event_imagesection"> <option data-img-src="/plugins/events/images/image-section-t.png" value="t"><?php echo __('Clip to top', 'events'); ?> </option> <option data-img-src="/plugins/events/images/image-section-m.png" value="m"><?php echo __('Clip to middle', 'events'); ?> </option> <option data-img-src="/plugins/events/images/image-section-b.png" value="b"><?php echo __('Clip to bottom', 'events'); ?> </option> <option data-img-src="/plugins/events/images/image-section-l.png" value="l"><?php
function render($showErrors = false) { //Header $this->html = '<form action="" method="' . $this->method . '">'; //Tous les champs foreach ($this->fields as $name => $field) { $this->html .= $field->html($showErrors); $this->html .= Html::br(); } //Bouton envoyer if ($this->submit != null) { $this->html .= $this->submit->html(); } //Fin de la form $this->html .= '</form>'; }
?> </div> <?php if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { ?> <div class="form-group"> <?php echo Form::label('role', __('Role', 'users')); echo Form::select('role', array('admin' => __('Admin', 'users'), 'editor' => __('Editor', 'users'), 'user' => __('User', 'users')), $user['role'], array('class' => 'form-control')); ?> </div> <?php } else { echo Form::hidden('role', Session::get('user_role')); } echo Html::br() . Form::submit('edit_profile', __('Save', 'users'), array('class' => 'btn btn-phone btn-primary')) . Html::nbsp(2) . Html::anchor(__('Cancel', 'users'), 'index.php?id=users', array('title' => __('Cancel', 'users'), 'class' => 'btn btn-phone btn-cancel btn-default')) . Form::close(); ?> </div> <div class="col-md-6"> <?php echo Form::open() . Form::hidden('csrf', Security::token()) . Form::hidden('user_id', Request::get('user_id')); ?> <div class="form-group"> <?php echo Form::label('new_password', __('New password', 'users')) . Form::password('new_password', null, array('class' => 'form-control')); ?> </div> <?php echo Form::submit('edit_profile_password', __('Save', 'users'), array('class' => 'btn btn-phone btn-primary')) . Form::close(); ?>
echo Form::label('page_meta_title', __('Title', 'pages')) . Form::input('page_meta_title', $meta_title_to_edit, array('class' => 'form-control')); ?> </div> <div class="form-group"> <?php echo Form::label('page_keywords', __('Keywords', 'pages')) . Form::input('page_keywords', $keywords_to_edit, array('class' => 'form-control')); ?> </div> <div class="form-group"> <?php echo Form::label('page_description', __('Description', 'pages')) . Form::textarea('page_description', $description_to_edit, array('class' => 'form-control')); ?> </div> <div class="form-group"> <?php echo Form::label('robots', __('Search Engines Robots', 'pages')) . Html::br(1) . 'no Index' . Html::nbsp() . Form::checkbox('robots_index', 'index', $post_robots_index) . Html::nbsp(2) . 'no Follow' . Html::nbsp() . Form::checkbox('robots_follow', 'follow', $post_robots_follow); ?> </div> </div> <div class="tab-pane <?php if (Notification::get('settings')) { ?> active<?php } ?> " id="settings"> <?php if (Request::get('name') == 'error404') { echo Form::hidden('pages', $parent_page); } else { ?>
if (!empty($_POST)) { $productos = $catalogo->BuscarProductos($_POST["busca"]); } else { $productos = []; } /*************************************************** GENERO EL HTML DE LA PÁGINA RESULTADOS_BUSQUEDA.PHP ****************************************************/ echo cabecera("MUEBLEBBB - Búsqueda", "../css/estilos.css", "../js/libreria.js"); echo encabezadoIndex(); navegacion_sesion($_POST, $MuebleBBB); echo Html::div_("contenedor_inicio"); echo Html::seccion(1, "Resultado de búsqueda"); if (!empty($productos)) { foreach ($productos as $producto) { if ($producto->__get("descuento") > 0) { $precio_descuento = $producto->__get("precio") - $producto->__get("precio") / 100 * $producto->__get("descuento"); echo Html::div_("contenedor_producto") . Html::a_("catalogo.php?id_producto={$producto->__get("codigo")}") . Html::img("{$producto->__get("imagen")}", "{$producto->__get("nombre")}") . Html::span("{$producto->__get("descuento")}%", "oferta") . Html::seccion(2, "{$producto->__get("nombre")}", "nombre_producto") . Html::div_("detalles") . Html::p("{$producto->__get("categoria")}", "categoria") . Html::p_("{$precio_descuento} €", "precio") . Html::br() . Html::del("{$producto->__get("precio")}€", "precio_antes") . Html::_p() . Html::_div() . Html::_a() . Html::_div(); } else { if ($producto->__get("nuevo")) { echo Html::div_("contenedor_producto") . Html::a_("catalogo.php?id_producto={$producto->__get("codigo")}") . Html::img("{$producto->__get("imagen")}", "{$producto->__get("nombre")}") . Html::div_("novedad") . Html::img("../imagenes/nuevo.png", "etiqueta indicando novedad", "etiqueta_nuevo") . Html::_div() . Html::seccion(2, "{$producto->__get("nombre")}", "nombre_producto") . Html::div_("detalles") . Html::p("{$producto->__get("categoria")}", "categoria") . Html::p("{$producto->__get("precio")}€", "precio") . Html::_div() . Html::_div() . Html::_a(); } else { echo Html::div_("contenedor_producto") . Html::a_("catalogo.php?id_producto={$producto->__get("codigo")}") . Html::img("{$producto->__get("imagen")}", "{$producto->__get("nombre")}") . Html::seccion(2, "{$producto->__get("nombre")}", "nombre_producto") . Html::div_("detalles") . Html::p("{$producto->__get("categoria")}", "categoria") . Html::p("{$producto->__get("precio")}€", "precio") . Html::_div() . Html::_div() . Html::_a(); } } } } else { echo Html::p("No se ha encontrado ninguna coincidencia.", "error"); } echo Html::_div(); echo pie();
function login($meldung = '', $template = '') { die('DEPRECATED LOGIN METHOD: ' . __FILE__ . ' ' . __LINE__); if (!isset($_SESSION)) { session_start(); } if (isset($_POST['user']) && isset($_POST['pass']) && $this->check_login()) { return true; } $vars['uuid'] = $_SESSION['uuid'] = General::uuid(); if (defined('HTTPS') && HTTPS && !isset($_SERVER['HTTPS'])) { header("Location: " . 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); } $page = new Seite($this, $template); $login_form = new Template(INSTALL_PATH . '/Templates/Login.template.html'); $meldungen = Template::get_all_parts($login_form->template); $vars['meldung'] = $meldungen[$meldung] ? $meldungen[$meldung] : $meldung; $vars['action'] = SELF_URL; $vars['title'] = $this->seite != 'index' ? $this->rubrik . ' | ' . $this->seite : $this->rubrik; if ($navi) { $navi = new Navi($this); $vars['navi'] = $navi->rubriken(); } if (!isset($_POST['user']) || !isset($_POST['pass'])) { $vars['meldung'] .= Html::br() . $meldungen['KENNWORT_EINGEBEN']; die($page->header($vars) . Html::div($login_form->parse_template('FORM', $vars)) . $page->footer($vars)); } else { if ($this->check_login()) { //if (HTTPS) header("Location: ".'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); header("Location: " . 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); } else { die($page->header($vars) . Html::div($login_form->parse_template('FORM', $vars)) . $page->footer($vars)); } } }
function order_rooms() { $rooms_sql = "SELECT rooms.*, indices.Exhibition_id,indices.Exhibition_id,indices.index\n\t\tFROM `{$this->rooms_db_table}` `rooms`\n\t\tLEFT JOIN `{$this->indices_db_table}` `indices`\n\t\t ON rooms.RoomId = indices.Raum_id\n\t\tWHERE indices.Exhibition_id = " . $_GET['order'] . "\n\t\tORDER BY indices.index ASC, indices.id ASC"; $rooms = $this->connection->db_assoc($rooms_sql); $script = $this->order_script(); $return = Html::h(2, $this->get_exhibition_name('order') . ': Reihenfolge bearbeiten'); $return .= Form::form_tag(SELF . '?order=' . $_GET['order'], '', '', array('onsubmit' => 'updateOrder()', 'id' => 'orderform')); $GLOBALS['scripts'] .= Html::script($script); $select = new Select('select[]', array('size' => 24, 'id' => 'select')); foreach ($rooms as $room) { $select->add_option($room['RoomId'], $room['Roomname']); } $return .= $select->flush_select() . Html::br(); $return .= Html::a('javascript:up();', 'Hoch', array('class' => 'button')); $return .= Html::a('javascript:down();', 'Runter', array('class' => 'button')); $return .= Html::a('javascript:del();', 'Löschen', array('class' => 'button')); $return .= Form::add_input('submit', 'submit', 'Speichern', array('class' => 'button')); $return .= Html::a(SELF, 'Zurück', array('class' => 'button', 'onclick' => 'return getChanged()')); $return .= Form::close_form(); return $return; }