本文整理汇总了PHP中Select::add_option方法的典型用法代码示例。如果您正苦于以下问题:PHP Select::add_option方法的具体用法?PHP Select::add_option怎么用?PHP Select::add_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Select
的用法示例。
在下文中一共展示了Select::add_option方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function user_table()
{
$user_table = '';
$img_edit_group = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/edit_group.png', 'Gruppe ändern', array('title' => 'Gruppe ändern'));
$img_delete_user = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/delete_user.png', 'Benutzer löschen', array('title' => 'Benutzer löschen'));
$img_new_user = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/add_user.png', 'Benutzer hinzufügen', array('title' => 'Benutzer hinzufügen'));
$img_edit = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/edit.png', 'Eigenschaften bearbeiten', array('title' => 'Eigenschaften bearbeiten'));
$img_apply = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/apply.png', 'Speichern');
$img_apply_path = '/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/apply.png';
$img_pass = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/password.png', 'Passwort');
$img_user = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/edit_user.png', 'Benutzername');
$img_group = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/edit_group.png', 'Gruppe');
$img_mail = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/mail_generic.png', 'E-Mail');
$img_show_pw = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/14_layer_visible.png', 'Passwörter zeigen');
$img_hide_pw = Html::img('/' . INSTALL_PATH . '/Classes/Admin/Icons/16x16/14_layer_novisible.png', 'Passwörter verstecken');
$form = new Form();
$table = new Table(5, array('id' => 'user_table'));
$table->add_caption('Registrierte Benutzer');
if (!isset($_GET['showpw'])) {
$pwshow = Html::a($_SERVER['REDIRECT_URL'] . '?showpw', $img_show_pw, array('title' => 'Passwörter zeigen'));
} else {
$pwshow = Html::a($_SERVER['REDIRECT_URL'], $img_hide_pw, array('title' => 'Passwörter verstecken'));
}
$table->add_th(array('Benutzer', 'E-Mail', 'Passwort ' . $pwshow, 'Gruppe'));
for ($i = 0; $i < count($this->existent_users); $i++) {
$select = new Select('gruppe');
foreach ($this->existent_groups as $group) {
if ($this->existent_users[$i]['Group'] == $group) {
$attr['selected'] = 'selected';
} else {
unset($attr['selected']);
}
$select->add_option(rawurlencode($group), $group, $attr);
}
$groups_select = $select->flush_select();
if (!isset($_GET['showpw'])) {
$show_password = '*****';
} else {
$show_password = $this->existent_users[$i]['Password'];
}
if (isset($_GET['editgroup'])) {
$id = $_GET['editgroup'];
if ($id == $this->existent_users[$i]['id']) {
$editgroup_submit = $form->add_input('image', 'submit_edit_group', '', array('src' => $img_apply_path, 'alt' => 'Speichern'));
$editgroup_submit_id = $form->add_input('hidden', 'id', $id);
$groupshow = $groups_select . $editgroup_submit_id . $editgroup_submit;
} else {
$groupshow = $this->existent_users[$i]['Group'];
}
} else {
$groupshow = $this->existent_users[$i]['Group'];
}
//$edit_group_button = Html::a($_SERVER['REDIRECT_URL'].'?editgroup='.$this->existent_users[$i]['id'],$img_edit_group);
$edit_user_button = Html::a($_SERVER['REDIRECT_URL'] . '?edituser=' . $this->existent_users[$i]['id'], $img_edit);
$delete_user_confirm = array('onclick' => 'return confirm(\'Wollen Sie ' . $this->existent_users[$i]['Name'] . ' wirklich löschen?\')');
$delete_user_button = Html::a($_SERVER['REDIRECT_URL'] . '?deleteuser=' . $this->existent_users[$i]['id'], $img_delete_user, $delete_user_confirm);
$user_row = array($this->existent_users[$i]['Name'], $this->existent_users[$i]['E-Mail'], $show_password, $groupshow, $edit_user_button . $edit_group_button . $delete_user_button);
if (isset($_GET['edituser'])) {
$id = $_GET['edituser'];
if ($id == $this->existent_users[$i]['id']) {
$edit_user_form_name = $form->add_input('text', 'edit_user_name', $this->existent_users[$i]['Name'], array('size' => '12'));
$edit_user_form_pass = $form->add_input('text', 'edit_user_pass', $this->existent_users[$i]['Password'], array('size' => '12'));
$edit_user_form_mail = $form->add_input('text', 'edit_user_mail', $this->existent_users[$i]['E-Mail'], array('size' => '12'));
$edit_user_form_id = $form->add_input('hidden', 'edit_user_id', $id);
$edit_user_form_submit = $form->add_input('image', 'submit_edit_user', 'Speichern', array('src' => $img_apply_path, 'alt' => 'Speichern'));
$user_row = array($img_user . $edit_user_form_name, $img_mail . $edit_user_form_mail, $img_pass . $edit_user_form_pass, $img_group . $groups_select, $edit_user_form_submit . $edit_user_form_id);
}
}
$table->add_td($user_row, array('class' => is_int($i / 2) ? 'abwechselnde_flaechen_1' : 'abwechselnde_flaechen_2'));
}
$new_user_link = Html::a($_SERVER['REDIRECT_URL'] . '?newuser', $img_new_user . ' Benutzer hinzufügen');
if (isset($_GET['newuser'])) {
$new_user_form_name = $form->add_input('text', 'new_user_name', '', array('size' => '12'));
$new_user_form_pass = $form->add_input('text', 'new_user_pass', '', array('size' => '12'));
$new_user_form_mail = $form->add_input('text', 'new_user_mail', '', array('size' => '12'));
$new_user_form_submit = $form->add_input('image', 'submit_new_user', 'Speichern', array('src' => $img_apply_path, 'alt' => 'Speichern'));
$table->add_td(array($img_user . $new_user_form_name, $img_mail . $new_user_form_mail, $img_pass . $new_user_form_pass, $img_group . $groups_select, $new_user_form_submit));
} else {
$table->add_td(array(array(2 => $new_user_link)));
}
return $form->form_tag('/Admin/User/') . $table->flush_table() . $form->close_form();
}
示例2: foreach
function module_table()
{
$this->installed = $this->connection->db_assoc("SELECT * FROM `RheinaufCMS>Module` WHERE `SYSTEM` = 0 ORDER BY `id` ASC");
$this->available_modules = RheinaufFile::dir_array(INSTALL_PATH . '/Module', false, 'php');
foreach ($this->available_modules as $module) {
$class_name = preg_replace('/\\.php/', '', $module);
if ($module != 'Navi.php') {
if (RheinaufFile::is_file(INSTALL_PATH . '/Module/' . $class_name . '/Install.php')) {
include_once INSTALL_PATH . '/Module/' . $class_name . '/Install.php';
$class_name .= 'Install';
} else {
include_once $module;
}
}
if (is_callable(array($class_name, 'about'))) {
eval('$module_about = ' . $class_name . '::about();');
switch ($module_about['type']) {
case 'inPage':
$this->inPageModules[] = $module_about;
break;
case 'installable':
$this->installableModules[] = $module_about;
break;
}
}
}
$return_string = '';
$this->return .= Html::h(3, 'Installierbare Module');
$table = new Table(2);
$table->add_th(array('Installierbare Module', 'Installierte Module'));
$form = new Form();
$form->form_tag(SELF_URL);
$installed_modules = array();
foreach ($this->installed as $installed) {
$installed_modules[] = $installed['Name'];
}
$installables_select = new Select('installable', array('size' => '10', 'style' => 'width:150px'));
foreach ($this->installableModules as $modul) {
if (!in_array($modul['Name'], $installed_modules)) {
$installables_select->add_option(rawurlencode($modul['Name']), $modul['Name']);
}
}
$installed_select = new Select('installed', array('size' => '10', 'style' => 'width:150px'));
foreach ($installed_modules as $modul) {
$installed_select->add_option(rawurlencode($modul), $modul);
}
$table->add_td(array($installables_select->flush_select(), $installed_select->flush_select()));
$install_submit = Form::add_input('submit', 'install', 'Installieren');
$uninstall_submit = Form::add_input('submit', 'uninstall', 'Deinstallieren');
$table->add_td(array($install_submit, $uninstall_submit), array('style' => 'text-align:center'));
$form->add_custom($table->flush_table());
$this->return .= $form->flush_form();
$this->return .= Html::h(3, 'Aufruf über Template');
$table = new Table(2, array('style' => 'width:500px'));
$table->add_th(array('Modul', 'Einbindung'));
foreach ($this->inPageModules as $module) {
$table->add_td(array(Html::bold($module['Name']), $module['Usage']));
}
$this->return .= $table->flush_table();
}
示例3: current
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) . '.';
//.........这里部分代码省略.........
示例4: current
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 . '");
//.........这里部分代码省略.........
示例5: array
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);
}
示例6: Select
function modules_select($module_name)
{
if (count($this->installed_modules)) {
$module_select = new Select('module');
$module_select->add_option('', 'kein Modul');
foreach ($this->installed_modules as $module) {
$selected = $module['Name'] == $module_name ? array('selected' => 'selected') : array();
$module_select->add_option($module['Name'], $module['Name'], $selected);
}
return $module_select->flush_select();
} else {
return '';
}
}
示例7: array
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;
}
示例8: array
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;
}
示例9: array
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) . '\')';
//.........这里部分代码省略.........
示例10: array
function order_images()
{
$images_sql = "SELECT bilder.*, indices.Bild_id,indices.Raum_id,indices.index\r\n\t\tFROM `{$this->pics_db_table}` `bilder`\r\n\t\tLEFT JOIN `{$this->indices_db_table}` `indices`\r\n\t\t ON bilder.id = indices.Bild_id\r\n\t\tWHERE indices.Raum_id = " . $_GET['order'] . "\r\n\t\tORDER BY indices.index,bilder.Name ASC";
$images = $this->connection->db_assoc($images_sql);
$script = $this->order_script();
$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($script);
$select = new Select('select[]', array('size' => 24, 'id' => 'select'));
foreach ($images as $img) {
$select->add_option($img['id'], $img['Dateiname']);
}
$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 .= Html::a('javascript:coverpic();', 'Titelbild', array('class' => 'button'));
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 .= 'Titelbild' . Html::br();
$return .= Html::img('/Images/Galerie/180/' . $room_info['Titelbild'], 'Noch nicht festgelegt', array('id' => 'coverpic_preview'));
return $return;
}