public function action_index()
 {
     $this->set_title("Module Admin ");
     $f = new Form("?module=admVoiture&action=valide&id=" . $this->req->id, "f_add");
     $f->add_text("annee", "annee", "Année");
     $f->add_text("km", "km", "Kilométrage");
     $f->add_textarea("des", "des", "Description");
     $f->add_submit("valide", "valide")->set_value("Valider");
     $this->tpl->assign("f_add", $f);
     $this->session->f_add = $f;
 }
Example #2
0
 public function action_index()
 {
     if ($this->session->ouverte()) {
         $this->set_title("Module Nos voitures");
         if ($this->req->name) {
             $db = DB::get_instance();
             $modm = new ModeleManager($db);
             $imgm = new ImageManager($db);
             $mod = $modm->getByName($this->req->name);
             $cm = new CommentaireManager($db);
             if ($mod) {
                 $idmodele = $mod->getIdModele();
                 $listeCom = $cm->listing($idmodele);
                 $this->tpl->assign("com", $listeCom);
                 $listeImg = $imgm->listing($idmodele);
                 $this->tpl->assign("photo", $listeImg);
             } else {
                 Site::redirect('loc', 'index');
             }
         } else {
             Site::redirect('index');
         }
         $fcom = new Form("?module=car&action=validcom&name=" . $this->req->name, "f_com");
         $i = 0;
         $notes[] = '';
         while ($i < 6) {
             $notes[] = $i;
             $i++;
         }
         $fcom->add_select("note", "note", "Note", $notes);
         $fcom->add_textarea("com", "com", "");
         $fcom->add_submit("", "", "")->set_value("Envoyez");
         $this->tpl->assign("f_com", $fcom);
     } else {
         Site::redirect("login");
     }
 }
    function editor()
    {
        $rubrik = $this->I18n_get_real($this->navi[$_GET['edit']]['Rubrik']);
        $rubrik = $this->path_encode($rubrik);
        $seite = $this->I18n_get_real($this->navi[$_GET['edit']]['Subnavi'][$_GET['edit_page']]['Seite']);
        $seite = $this->path_encode($seite);
        $folder = INSTALL_PATH . "/Content/{$rubrik}/{$seite}";
        $wokingversion = isset($_GET['workingversion']) ? true : false;
        if ($wokingversion && RheinaufFile::is_file($folder . "/Arbeitsversion/content.html")) {
            $contents = RheinaufFile::get_file($folder . "/Arbeitsversion/content.html");
        } else {
            $contents = RheinaufFile::get_file($folder . "/content.html");
        }
        $_SESSION['rubrik'] = $this->path_encode($rubrik);
        $_SESSION['seite'] = $this->path_encode($seite);
        $_SESSION['docroot'] = DOCUMENT_ROOT;
        $editor_page = new Html();
        //$editor_page->body_attributes=array('onunload'=>'catchClose(xinha_editors.editor)');
        $title = 'Editor für ' . PROJECT_NAME . ' -> ' . $rubrik . ' -> ' . $seite;
        $title .= $wokingversion ? ' (Arbeitsversion)' : ' (Liveversion)';
        $editor_page->title = $title;
        $editor_page->script(' _editor_url  = "/' . INSTALL_PATH . '/Libraries/Xinha/";_editor_lang = "de";_document_root = "' . DOCUMENT_ROOT . '"');
        $editor_page->script('', array('src' => '/' . INSTALL_PATH . '/Libraries/Xinha/XinhaLoader.js'));
        $editor_page->script('', array('src' => '/' . INSTALL_PATH . '/Libraries/XinhaConfig/editor.php'));
        $editor_page->script("var project_name = '" . addslashes(PROJECT_NAME) . "';");
        $styles = 'BODY 	{
						margin: 0;
						background-color:Menu;
						font-size:12px;
						padding:0;
						font-family: sans-serif;
					}

					#editor {
						width:100%;
						height:500px;
					}

					/*---DropDowns*/

					ul { /* all lists */
						padding: 0;
						margin: 0;
						list-style: none;
						position:absolute;
						top:2px;
						left:0px;
						z-index:999;
						cursor:default;


					}
					ul a {
						cursor:default;
						color:black;
						text-decoration:none;
						display:block;
					}

					li { /* all list items */
						float: left;
						position: relative;
						width: 10em;
						border:1px solid;
						border-color:Menu;
						padding-left:2px;
					}

					li:hover,li.over {
						border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
					}
					li ul { /* second-level lists */
						display: none;
						position: absolute;
						top: 15px;
						left: 0;
						-moz-opacity:1;
						filter:alpha(opacity = 100);
						padding-bottom:5px;
					}

					li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
						top: auto;
						left: auto;
					}

					li:hover ul, li.over ul { /* lists nested under hovered list items */
						display: block;
						background-color: Menu;
						border:1px solid;
						border-color:Menu ButtonShadow ButtonShadow ButtonHighlight;
					}
					li:hover ul a:hover, li.over ul a:hover {
						color:white;
						background-color:darkblue;

					}

					#content {
						clear: left;
						padding:20px 0 0 0 ;
					}

					';
        $editor_page->style($styles);
        $editor_page->div($this->menu());
        $form = new Form();
        if ($wokingversion) {
            $get_working_version = 'workingversion&';
        } else {
            $get_working_version = '';
        }
        $form->form_tag(SELF_URL . '?' . $get_working_version . 'edit=' . $_GET['edit'] . '&edit_page=' . $_GET['edit_page'], 'post', 'application/x-www-urlencoded', array('id' => 'editor_form'));
        $form->add_input('hidden', 'rubrik', $rubrik);
        $form->add_input('hidden', 'seite', $seite);
        $form->add_input('hidden', 'tmp_file', RheinaufFile::is_file($this->work_folder() . 'tmp.html') ? 'true' : 'false', array('id' => 'tmp_file'));
        $form->add_textarea('editor_text', $contents, array('id' => 'editor'));
        $form->close_form();
        $editor_page->div($form->flush_form(), array('id' => 'content'));
        return $editor_page->flush_page();
    }
    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) . '&emsp;';
                        $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;
    }
Example #5
0
<?php

$user = $g_display["user"];
$address = $g_display["address"];
$f = new Form();
$f->cancel = true;
$f->cancel_url = "?action=retrieve&amp;type=account";
$f->title = _t("Account update");
$f->action = "?action=update&amp;type=account";
$f->method = "POST";
$f->add_text(_t("Firstname"), "firstname", default_value("firstname", format_firstname($user->firstname)), _t("Your Firstname."));
$f->add_text(_t("Lastname"), "lastname", default_value("lastname", format_lastname($user->lastname)), _t("Your Lastname."));
$f->add_email(_t("Email"), "email", default_value("email", $user->email), _t("A valid Email you want to associate to your account."));
$item = $f->add_text(_t("Phone number (optional)"), "phone", default_value("phone", $user->phone), _t("Used only when processing order if we need to contact you quickly."));
$item->is_optional = true;
$item = $f->add_textarea(_t("Address"), "address", default_value("address", $address->address), _t("Your address"));
$item->is_optional = true;
$item->other_attr = 'class="addresspicker" placeholder="{{Street no, Street, Zip City, etc.}}"';
$item = $f->add_text(_t("VAT#"), "vat", default_value("vat", $user->vat), _t("VAT#, for european compagny only."));
$item->is_optional = true;
$item = $f->add_text(_t("Compagny name"), "compagny_name", default_value("compagny_name", $user->compagny_name), _t("VAT#, for european compagny only."));
$item->is_optional = true;
$item = $f->add_password(_t("New Password (optional)"), "clear_new_pass", _t("Leave empty if you do not want to change your password."));
$item->is_optional = true;
$item = $f->add_password(_t("Retype new Password (optional)"), "clear_new_pass2", _t("Retype your new password."));
$item->is_optional = true;
$item = $f->add_hidden("new_pass", "");
$item->is_optional = true;
$item = $f->add_hidden("new_pass2", "");
$item->is_optional = true;
$f->add_hidden("id", $user->id);
<?php

require_once '../../kernel/begin.php';
require_once 'parser.class.php';
$lang->setModule('xtc_builder', 'index');
$form = new Form('Formulaire', 'post');
$form->add_fieldset();
$form->add_button('button', 'input_insert', 'Input')->setonClick('insert( \'texForm\', \'Input <nom,id,label>\' );')->setInline(true);
$form->add_button('button', 'textarea_insert', 'Textarea')->setonClick('insert( \'texForm\', \'Textarea <nom,id,label>\' );')->setInline(true);
$form->add_button('button', 'fieldset_insert', 'Fieldset')->setonClick('insert( \'texForm\', \'Fieldset <nom>\' );')->setInline(true);
$form->add_button('button', 'button_insert', 'Button')->setonClick('insert( \'texForm\', \'Button <type,nom,valeur>\' );')->setInline(true);
$form->add_button('button', 'liste_insert', 'Liste (avec valeurs)')->setonClick('insert( \'texForm\', \'Liste <type,nom,id,valeur>\', \'avec\' );')->setInline(true);
$form->add_button('button', 'liste_insert', 'Liste (sans valeurs)')->setonClick('insert( \'texForm\', \'Liste <type,nom,id,valeur>\', \'sans\' );')->setInline(true);
$form->add_button('button', 'liste_insert', 'Choix (avec valeurs)')->setonClick('insert( \'texForm\', \'Choix <type,nom>\', \'avec\' );')->setInline(true);
$form->add_button('button', 'liste_insert', 'Choix (sans valeurs)')->setonClick('insert( \'texForm\', \'Choix <type,nom>\', \'sans\' );')->setInline(true);
$form->add_textarea('texForm', 'texForm', 'Contenu à parser');
$form->add_button();
$fh = new FormHandle($form);
$fh->handle();
tpl_begin();
if ($fh->okay()) {
    $contenuAParser = $fh->get('texForm');
    $parserPage = new xtc_builder_formulaire($contenuAParser);
    $r = $parserPage->parse_content();
    $md5 = md5($r);
    file_put_contents(ROOT . 'modules/xtc_builder/cache/formulaires/' . $md5 . '.php', $r);
    echo '<p>À insérer dans la zone de texte.</p>';
    echo '<input type="text" value="Form <#' . $md5 . '>" />';
} else {
    $form->buildAll();
}
<?php

require_once '../../kernel/begin.php';
require_once 'panel_admin.inc.php';
$requeteConfiguration = $bdd->query('SELECT * FROM ' . TABLE_CONFIG);
$listeForms = array();
while ($configurations = $bdd->fetch($requeteConfiguration)) {
    $form = new Form(translate('edit_config_title'));
    $form->add_fieldset();
    $form->add_input($configurations['config_name'] . '_config_name', $configurations['config_name'] . '_config_name', translate('config_name'))->setValue($configurations['config_name']);
    $configsDatas = unserialize($configurations['config_value']);
    $i = 0;
    foreach ($configsDatas as $k => $config) {
        $i++;
        $form->add_input($configurations['config_name'] . '_config_entry_name_' . $i, $configurations['config_name'] . '_config_entry_name_' . $i, translate('config_entry_name'))->setValue(htmlspecialchars($k));
        $form->add_textarea($configurations['config_name'] . '_config_entry_value_' . $i, $configurations['config_name'] . '_config_entry_value_' . $i, translate('config_entry_value'))->setValue(stripslashes(htmlspecialchars($config)));
    }
    $form->add_input($configurations['config_name'] . '_config_lang', 'config_lang', translate('config_lang'))->setValue($configurations['config_lang']);
    $form->add_button();
    $listeForms[$configurations['config_name']] = $form;
    unset($form);
}
foreach ($listeForms as $nomConfig => $formulaire) {
    $traitement = new FormHandle($formulaire);
    $traitement->handle();
    if ($traitement->okay()) {
        $langSite = $traitement->get($nomConfig . '_config_lang');
        $configValues = array();
        for ($i = 1; ($nomEntree = $traitement->get($nomConfig . '_config_entry_name_' . $i)) != NULL && ($valeurEntree = $traitement->get($nomConfig . '_config_entry_value_' . $i)) != NULL; $i++) {
            $configValues[$nomEntree] = addslashes($valeurEntree);
        }
         $dataCours['coursIntro'] = $fh->get('cours_introduction');
         $dataCours['coursConclusion'] = $fh->get('cours_conclusion');
         $coursCateg = $fh->get('cours_categorie');
         $cours = new Cours();
         $cours->ajouter_element($coursCateg, $dataCours, $member);
         $error = new Error();
         $error->add_Error(translate('cours_create_okay'), ERROR_PAGE, __FILE__, __LINE__);
     }
     break;
 case 'modifierTutoriel':
     $idTutoriel = intval($_GET['idTutoriel']);
     $donneesTutoriel = $bdd->requete('SELECT cours_level, cours_id, cours_nom, cours_texte, cours_gauche, cours_droite FROM ' . TABLE_COURS . ' WHERE cours_id = ?', $idTutoriel);
     $form = new Form(translate('title_edit_form'));
     $form->add_fieldset();
     $form->add_input('cours_nom', 'cours_nom', translate('cours_name_form'))->setValue($donneesTutoriel['cours_nom']);
     $form->add_textarea('cours_introduction', 'cours_introduction', translate('cours_intro_form'))->setValue($donneesTutoriel['cours_texte']);
     $form->add_textarea('cours_conclusion', 'cours_conclusion', translate('cours_conclu_form'))->setValue($donneesTutoriel['cours_texte']);
     $form->add_button();
     $fh = new FormHandle($form);
     $fh->handle();
     if ($fh->okay()) {
         $dataCours['coursNom'] = $fh->get('cours_nom');
         $dataCours['coursIntro'] = $fh->get('cours_introduction');
         $dataCours['coursConclusion'] = $fh->get('cours_conclusion');
         $cours = new Cours();
         $cours->modifier_element($dataCours);
         $error = new Error();
         $error->add_error(translate('cours_edit_okay'), ERROR_PAGE, __FILE__, __LINE__);
     }
     break;
 case 'deplacerTutoriel':
Example #9
0
<?php

if ($DB->value("SELECT locked FROM thread WHERE id=\$1", array(id())) == 't') {
    return;
}
$Form = new Form();
$Form->header(url(0, 1) . "reply", "post", FORM_SALT);
$Form->values(array("thread_id" => id(true)));
$Form->add_hidden("thread_id");
$Form->account_login();
$Form->fieldset_open("Reply");
$Form->add_textarea("body", "Body:");
$Form->fieldset_close();
$Form->add_submit(SAY_BUTTON, "id=\"submit\"/>");
$Form->add_button("preview", PREVIEW_BUTTON, "preview_post('{$Form->name}','thread'," . id() . ");");
if (id() == 362137) {
    print "&nbsp;";
    $Form->add_button("_load", "load bradyism", "\$(this).val('loading...');\$.post('/thread/view/bradyism/',{},function(data){ \$('#body').val(\$.trim(data));\$('#_load').val('load bradyism')});");
}
print "&nbsp;<sup><a href=\"javascript:;\" onclick=\"\$('#bbcode').slideToggle()\">[help]</a></sup>\n";
$Form->footer();
$Form->header_validate();
$Form->add_notnull("body", "Please enter a post body.");
$Form->footer_validate();
print BBCODE_GUIDE;
?>
<script type="text/javascript">
function completed(data)
{
  if(jQuery.trim(data) == "")
  {
    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, '?') ? '&amp;' : '?';
        $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) . '&amp;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) . '&emsp;';
                        $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;
        }
    }
<?php

require_once '../../kernel/begin.php';
$lang->setModule('news', 'ajouter');
$xtcode = new XTCode();
$form = new Form(translate('title_add_form'));
$form->add_fieldset();
$form->add_input('news_title', 'news_title', translate('news_title'));
$form->add_textarea('news_content', 'news_content', translate('news_content'));
$form->add_button();
$fh = new FormHandle($form);
$fh->handle();
if ($fh->okay()) {
    $error = new Error();
    $error->add_error(translate('addition_success'), ERROR_GLOBAL, __FILE__, __LINE__, ROOTU . 'modules/news/index.php');
} else {
    tpl_begin();
    $form->build_all();
    tpl_end();
}
        echo htmlentities($data['membre_citation']);
        ?>
</p>
<p>Biographie : <?php 
        echo XTCode_decode($data['membre_biographie']);
        ?>
</p>
<?php 
        break;
    case 'modifier':
        $form = new Form(translate('edit_profile'), 'post');
        $form->add_fieldset();
        $form->add_input('login', 'login', translate('login_form'), 'text', 'disabled')->setValue(htmlentities($data['membre_login']));
        $form->add_input('email', 'email', translate('email_form'))->setValue(htmlentities($data['membre_email']));
        $form->add_input('citation', 'citation', translate('citation_form'))->setValue(htmlentities($data['membre_citation']));
        $form->add_textarea('biographie', 'biographie', translate('biographie_form'))->setValue($data['membre_biographie']);
        $form->add_button();
        $fh = new FormHandle($form);
        $fh->handle();
        if ($fh->okay()) {
            $newEmail = $fh->get('email');
            $newCitation = $fh->get('citation');
            $newBiographie = $fh->get('biographie');
            $bdd->query('UPDATE ' . TABLE_MEMBERS . ' SET membre_email = ?, membre_citation = ?, membre_biographie = ? WHERE membre_id = ?', array($newEmail, $newCitation, $newBiographie));
            $error = new Error();
            $error->add_error(translate('edit_ok'), ERROR_GLOBAL, __FILE__, __LINE__, ROOTU . 'modules/membres/connexion.php');
            goto voirAction;
        }
        $form->build_all();
        break;
}
<?php

require_once '../../kernel/begin.php';
$lang->setModule('accueil', 'contact');
$form = new Form(translate('contact_form'));
$form->add_fieldset();
$form->add_input('message_objet', 'message_objet', translate('message_objet_form'));
$form->add_input('message_email', 'message_email', translate('message_email_form'))->setRequired(false);
$form->add_textarea('message_contenu', 'message_contenu', translate('message_contenu_form'));
$form->add_button();
$fh = new FormHandle($form);
$fh->handle();
if ($fh->okay()) {
    $messageObjet = $fh->get('message_objet');
    $messageEmail = $fh->get('message_email');
    $messageContenu = $fh->get('message_contenu');
    $bdd->query('INSERT INTO ' . TABLE_CONTACT . ' ( contact_objet, contact_message, contact_email, contact_date, contact_ip ) VALUES( ?, ?, ?, ?, ? )', array($messageObjet, $messageContenu, $messageEmail, time(), get_ip()));
    $error = new Error();
    $error->add_error(translate('message_send_okay'), ERROR_PAGE, __FILE__, __LINE__);
}
tpl_begin();
$form->build_all();
tpl_end();
 function neu_form()
 {
     $this->form_scripts();
     $required = array();
     for ($i = 0; $i < count($this->fields); $i++) {
         if ($this->fields[$i]['required']) {
             $required[] = preg_replace('#[^\\w\\.]#', '_', $this->fields[$i]['name']);
         }
     }
     $required = General::array2js('required', $required);
     $form_tag = Form::form_tag(SELF . '?input', 'post', 'multipart/form-data', array('onsubmit' => 'return checkform()'));
     $form_close = Form::close_form();
     $this->scripts .= Html::script($required);
     //$this->scripts .= Html::script('',array('src'=>'/'.INSTALL_PATH.'/Module/BuddyListe/BuddyListe.js'));
     $spalten = 2;
     $table = new Table($spalten, array('id' => 'formtable'));
     $table->id_tbody('form_tbody');
     foreach ($this->fields as $field) {
         $show_name = $field['show_name'] != '' ? $field['show_name'] : $field['name'];
         $show_name = $field['required'] ? $show_name . Html::span('*', array('style' => 'color:red;cursor:help', 'title' => 'Dieses Feld muss ausgefüllt werden.')) : $show_name;
         $encoded_name = rawurlencode($field['name']);
         $id = Html::html_legal_id($field['name']);
         switch ($field['input_type']) {
             case 'text':
                 $parameters = array();
                 $parameters['id'] = $id;
                 if (isset($field['length'])) {
                     $parameters['size'] = $field['length'];
                     $parameters['maxlength'] = $field['length'];
                 } else {
                     $parameters['size'] = 40;
                 }
                 $input = Form::add_input('text', $encoded_name, '', $parameters);
                 break;
             case 'select':
                 $select = new Select($encoded_name, array('id' => $id));
                 $select->add_option('--Bitte auswählen--');
                 foreach ($field['options'] as $option) {
                     $select->add_option(rawurlencode($option), $option);
                 }
                 if ($field['sonstiges']) {
                     $select->add_option('', 'Sonstige:', array('onclick' => 'sonstig_input(this,\'' . rawurlencode($encoded_name) . '\')'));
                 }
                 $input = $select->flush_select();
                 break;
             case 'check':
                 $input = '';
                 foreach ($field['options'] as $option) {
                     $input .= Form::add_input('checkbox', $encoded_name . '[]', rawurlencode($option)) . ' ' . $option . '<br />';
                 }
                 break;
             case 'textarea':
                 $input = Form::add_textarea($encoded_name, '', array('id' => $id, 'cols' => '35', 'rows' => '2', 'onfocus' => 'textarea_grow(\'' . $id . '\')', 'onblur' => 'textarea_shrink(\'' . $id . '\')'));
                 break;
         }
         $table->add_td(array($show_name, $input));
     }
     $fileinput = Form::add_input('file', 'bild[0]');
     $table->add_td(array('Bild 1', $fileinput . Html::a('javascript:;', Html::img('/RheinaufCMS/Module/BuddyListe/edit_add.png', 'Plus', array('title' => 'Noch ein Bild', 'onclick' => 'add_file_upload()')))));
     $table->add_td(array(Form::add_input('submit', 'submit_new_buddyentry', 'Eintragen')), array('style' => 'border-top:1px solid #33466B'));
     $page = new Template(INSTALL_PATH . '/Module/BuddyListe/Templates/Form.template.html');
     $vars['form'] = $form_tag . $table->flush_table() . $form_close;
     return $page->parse_template('TEMPLATE', $vars);
 }
<?php

require_once '../../kernel/begin.php';
require_once 'panel_admin.inc.php';
tpl_begin();
$listeFichiers = glob(ROOT . 'kernel/templates/*.tpl');
if (isset($_GET['fichier'])) {
    $fichier = $_GET['fichier'];
    $verif = ROOT . 'kernel/templates/' . $fichier . '.tpl';
    if (in_array($verif, $listeFichiers)) {
        $contenu = file_get_contents($verif);
        $form = new Form(translate('file_form'), 'post');
        $form->add_fieldset();
        $form->add_textarea('contenu', 'contenu', translate('content_file'))->setValue($contenu);
        $form->add_button();
        $fh = new FormHandle($form);
        $fh->handle();
        if ($fh->okay()) {
            $contenu = $fh->get('contenu');
            file_put_contents($verif, $contenu);
            $error = new Error();
            $error->add_error(translate('modification_ok'), ERROR_PAGE, __FILE__, __LINE__);
        } else {
            $form->build_all();
        }
    }
}
?>
<p><?php 
echo translate('help_message');
?>
    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) . '&emsp;';
                        $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;
    }
Example #17
0
<?php

include_once __DIR__ . "/../autoloader.php";
$form = new Form();
$form->add_text("nom", "Votre nom");
$form->add_date("date", "Format JJMMYY");
$form->add_password("passw", "Votre mot de passe ici :");
$form->add_textarea("bio", "Je vis  a Tonneins");
$form->add_checkbox("etudiant", "1", "Etudiant", TRUE);
$form->add_checkbox("bob", "2", "Bob");
$form->display("./../index.php", "get");
Example #18
0
print "<div id=\"password\" style=\"display:none\">\n";
$Form->add_password("_current", "Current:");
$Form->add_password("_pass", "New:");
$Form->add_password("_pass_confirm", "Confirm:");
print "</div>\n";
$Form->add_button("_change", "Change Password", "change_password()", "style=\"margin:5px\"");
$Form->fieldset_close();
$Form->fieldset_open("Details");
$DB->query("SELECT\r\n              p.display,\r\n              p.name as field,\r\n              pt.name as type,\r\n              p.width\r\n            FROM\r\n              pref p\r\n            LEFT JOIN\r\n              pref_type pt\r\n            ON\r\n              pt.id = p.pref_type_id\r\n            WHERE\r\n              p.editable IS true\r\n            ORDER BY\r\n              p.ordering");
while ($pref = $DB->load_array()) {
    switch ($pref['type']) {
        case "input":
            $Form->add_text($pref['field'], "{$pref['display']}:", $pref['width']);
            break;
        case "textarea":
            $Form->add_textarea($pref['field'], "{$pref['display']}:");
            break;
        case "checkbox":
            $Form->add_checkbox($pref['field'], "{$pref['display']}:");
            break;
    }
}
$Form->add_submit("Save Changes");
$Form->fieldset_close();
$Form->footer();
$Form->header_validate();
$Form->add_notnull("postalcode", "Please enter a postal code.");
$Form->footer_validate();
$Base->footer();
print "</div>";
?>
Example #19
0
    $item->other_attr = ' step="0.01" min="0"';
} else {
    $f->add_hidden("funding_needed", $event->funding_needed);
}
$item = $f->add_text(_t("Event date"), "happening_t", default_value("happening_t", $event->happening_t), _t("Date at which starts the event (Format: YYYY-MM-DD)."));
$item->other_attr = 'autocomplete="off"';
$item = $f->add_text(_t("VAT indentification number"), "vat", default_value("vat", $event->vat, $user->vat), _t("For EU company only."));
$item->is_optional = true;
if (!$event->is_confirmed()) {
    $f->add_checkbox(_t("This event is confirmed."), "is_confirmed", "", _t("help_checkbox_confirmation"));
}
$item = $f->add_text(_t("Confirmation date"), "confirmation_t", default_value("confirmation_t", $event->confirmation_t), _t("Maximum date at which the event will be confirmed or cancelled (Format: YYYY-MM-DD)."));
$item->other_attr = 'autocomplete="off"';
$location = Address::get_from_id($event->location_address_id);
$placeholder = _t('Street no, Street, Zip City, etc.');
$item = $f->add_textarea(_t("Event address"), "location_address", default_value("location_address", $location->address), _t("Address of the place where will occur the event. Please indicate an accurate address (street, street no, city, zip, state, country)"));
$item->other_attr = 'class="addresspicker" data-addresspickeroptions=\'{"showBlockMap": false}\' placeholder="' . $placeholder . '"';
$billing_address = Address::get_from_id($event->billing_address_id);
$item = $f->add_textarea(_t("Billing address"), "billing_address", default_value("billing_address", $billing_address->address, $user->address()), _t("Address of the organizer. Please indicate an accurate address (street, street no, city, zip, state, country)"));
$item->other_attr = 'class="addresspicker" data-addresspickeroptions=\'{"showBlockMap": false}\' placeholder="' . $placeholder . '"';
$item = $f->add_text(_t("Web site (optional)"), "link", default_value("link", $event->link), _t("Official event web site (if any)."));
$item->other_attr = 'size="60" maxlength="255"';
$item->is_optional = true;
$item = $f->add_textarea(_t("Short description"), "short_description", default_value("short_description", $event->short_description), _t("Enter a short description of the event. (HTML editor)"));
$item->other_attr = 'style="width: 100%;" rows="5"';
$item = $f->add_textarea(_t("Long description"), "long_description", default_value("long_description", $event->long_description), _t("Enter a long description of the event. (HTML editor)"));
$item->other_attr = 'class="apply_tinymce" width="200px"';
$f->add_hidden("id", $event->id);
$f->add_hidden("event_type", $event->type);
$f->add_raw_html(<<<EOF
\t</div>