function form_edit($message = '') { global $step; pagetop(gTxt('edit_forms'), $message); extract(gpsa(array('Form', 'name', 'type'))); if ($step == 'form_create') { $Form = ''; $name = ''; $type = ''; $inputs = fInput('submit', 'savenew', gTxt('save_new'), 'publish') . eInput("form") . sInput('form_save'); } else { $name = (!$name or $step == 'form_delete') ? 'default' : $name; $rs = safe_row("*", "txp_form", "name='{$name}'"); if ($rs) { extract($rs); $inputs = fInput('submit', 'save', gTxt('save'), 'publish') . eInput("form") . sInput('form_save') . hInput('oldname', $name); } } $out = startTable('edit') . tr(tdtl(hed(gTxt('useful_tags'), 2) . graf(gTxt('articles') . sp . popHelp('form_place_article') . br . popTagLinks('article')) . graf(gTxt('links') . sp . popHelp('form_place_link') . br . popTagLinks('link')) . graf(gTxt('displayed_comments') . sp . popHelp('form_place_comment') . br . popTagLinks('comment')) . graf(gTxt('comment_form') . sp . popHelp('form_place_input') . br . popTagLinks('comment_form')) . graf(gTxt('search_input_form') . sp . popHelp('form_place_search_input') . br . popTagLinks('search_input')) . graf(gTxt('search_results_form') . sp . popHelp('form_place_search_results') . br . popTagLinks('search_result')) . graf(tag('<strong>' . gTxt('file_download_tags') . '</strong>', 'a', ' href="#" onclick="toggleDisplay(\'downloadtags\');"') . sp . popHelp('form_file_download_tags')) . graf(popTagLinks('file_download'), ' style="display:none;" id="downloadtags"')) . tdtl('<form action="index.php" method="post">' . input_textarea($Form) . graf(gTxt('form_name') . br . fInput('text', 'name', $name, 'edit', '', '', 15)) . graf(gTxt('form_type') . br . formtypes($type)) . graf(gTxt('only_articles_can_be_previewed')) . fInput('submit', 'preview', gTxt('preview'), 'smallbox') . graf($inputs) . '</form>') . tdtl(form_list($name))) . endTable(); echo $out; }
public function render_meta_box_descricoes($post) { $postId = $post->ID; $this->post_id = $postId; if ($postId != null) { $this->evento = Eventos::getInstance()->getById($postId, false); } ?> <div id="tabs"> <ul class="tabs"> <li><a href="#tabs-descricao">Descrição</a></li> <li><a href="#tabs-realizacao">Realização</a></li> <li><a href="#tabs-inscricao">Inscrição</a></li> <?php if ($this->templateExibir('campos_extras')) { ?> <li><a href="#tabs-dados">Dados Formulário</a></li> <?php } ?> <?php if ($this->evento->pago == 'pago') { ?> <li><a href="#tabs-treinamento">Treinamento</a></li> <?php } ?> <!-- <li><a href="#tabs-mensagens">Mensagens</a></li>--> <?php if ($this->templateExibir('secoes_extras')) { ?> <li><a href="#tabs-sessoesextras">Sessões Extras</a></li> <?php } ?> </ul> <div id="tabs-descricao"> <?php if (TGO_EVENTO_EVENTO_PAI === true) { echo "<div class=fields>"; echo "<h3>Herdar Configurações</h3>"; $eventos = Eventos::getInstance()->getEventosOrfaos($postId); $eventos = PLib::object_to_array($eventos); $eventos = Plib::array_to_key_value($eventos, 'id', 'titulo'); echo input_select($postId, 'id_evento_pai', 'Evento Pai:', $eventos, null, get_post_meta($postId, 'id_evento_pai', true), 'class=ajustes_visuais'); echo "</div>"; } echo "<div class=fields>"; echo "<h3>Chamadas Curtas</h3>"; if ($this->templateExibir('descricao_1')) { echo input_texto($postId, 'descricao_1', 'Descrição Curtíssima', 100); } if ($this->templateExibir('descricao_2')) { echo input_textarea($postId, 'descricao_2', 'Descrição Breve', 3); } echo "</div>"; echo "<div class=fields>"; echo "<h3>Apresentação completa</h3>"; if ($this->templateExibir('descricao_3')) { $value = get_post_meta($postId, 'descricao_3', true); wp_editor($value, 'descricao_3', array('textarea_rows' => get_option('default_post_edit_rows', 20))); } echo "</div>"; ?> </div> <div id="tabs-realizacao"> <?php // Organizador $organizadores = Plib::object_to_array(Organizadores::getInstance()->getAll()); $organizadores = Plib::array_to_key_value($organizadores, 'id', 'titulo'); if (count($organizadores) > 1) { echo "<div class=fields>"; echo "<h3>Organização</h3>"; if ($this->templateExibir('id_organizador')) { echo input_select($postId, 'id_organizador', 'Organizador:', $organizadores, null, $this->templateValorPadrao('id_organizador')); } else { if ($this->templateValorPadrao('id_organizador') != null) { echo input_hidden($postId, 'id_organizador', $this->templateValorPadrao('id_organizador')); } else { $organizadores = array_keys($organizadores); echo input_hidden($postId, 'id_organizador', $organizadores[0]); } } echo "</div>"; } // Instrutor if ($this->templateExibir('id_instrutor')) { $instrutores = Instrutores::getInstance()->getTodosArray(); echo input_select($postId, 'id_instrutor', 'Instrutor/Coordenador:', $instrutores); } echo "<div class=fields>"; echo "<h3>Data e Local</h3>"; echo input_data($postId, 'data', 'Data do Evento:'); echo input_hora($postId, 'hora', 'Hora de Inicio:'); if ($this->templateExibir('data_fim')) { echo input_data($postId, 'data_fim', 'Data Término:'); } echo input_hora($postId, 'hora_fim', 'Hora Término:'); if ($this->templateExibir('id_local')) { Locais::getInstance()->init(); $locais = Plib::object_to_array(Locais::getInstance()->getAll()); $locais = Plib::array_to_key_value($locais, 'id', 'titulo'); echo input_select($postId, 'id_local', 'Local:', $locais); } echo "</div>"; echo "<div class=fields>"; echo "<h3>Medidores de Conversão</h3>"; echo input_texto($postId, 'fb_conversion_track', 'Facebook Conversion Track:', 20); echo input_texto($postId, 'tw_conversion_track', 'Twitter Conversion Track:', 20); echo "</div>"; ?> </div> <div id="tabs-inscricao"> <?php // Data Inicio Inscrições echo "<div class=fields>"; echo "<h3>Inscrições</h3>"; echo input_data($postId, 'data_inicio_inscricoes', 'Inicio das Inscrições:'); echo input_data($postId, 'data_fim_inscricoes', 'Fim das Inscrições:'); // Pago ou Gratuito if ($this->templateExibir('pago')) { echo input_select($postId, 'pago', 'Tipo de Inscrição:', array('pago' => 'Paga', 'gratuito' => 'Gratuita'), null, null, 'class=ajustes_visuais'); } else { if ($this->templateValorPadrao('pago') != null) { echo input_hidden($postId, 'pago', $this->templateValorPadrao('pago')); } } if ($this->templateExibir('confirmacao')) { echo input_select($postId, 'confirmacao', 'Confirmação da Inscrição:', array('preinscricao' => 'Pré-inscrição', 'imediata' => 'Imediata', 'pagamento' => 'Após Confirmação do Pagamento', 'posterior' => 'Posteriormente pelo Organizador'), null); } else { if ($this->templateValorPadrao('confirmacao') != null) { echo input_hidden($postId, 'confirmacao', $this->templateValorPadrao('confirmacao')); } } if ($this->templateExibir('validacao_pessoa')) { echo input_select($postId, 'validacao_pessoa', 'Localizar Cadastro do Inscrito:', array('email' => 'Email', 'cpf' => 'CPF'), null, 'email'); } echo "</div>"; // Vagas if ($this->templateExibir('vagas')) { echo "<div class=fields>"; echo "<h3>Vagas</h3>"; echo input_numero($postId, 'vagas', 'Vagas Disponíveis:'); echo input_checkbox($postId, 'fila_espera', 'Fila de Espera'); echo "</div>"; } // Formas de pagamento echo "<div id=formas_pagamento class=fields>"; echo "<h3>Pagamento</h3>"; // Integração PagSeguro if (Integracoes::getInstance()->hasByServico('PagSeguro')) { echo input_checkbox($postId, 'pago_pagseguro', 'PagSeguro'); $integracoes = Plib::object_to_array(Integracoes::getInstance()->getByServico('PagSeguro')); $integracoes = Plib::array_to_key_value($integracoes, 'id', 'titulo'); echo input_select($postId, 'id_integracao_pagseguro', 'Integração PagSeguro:', $integracoes); } // Integração Cielo if (Integracoes::getInstance()->hasByServico('Cielo')) { echo input_checkbox($postId, 'pago_cielo', 'Cielo'); $integracoes = Plib::object_to_array(Integracoes::getInstance()->getByServico('Cielo')); $integracoes = Plib::array_to_key_value($integracoes, 'id', 'titulo'); echo input_select($postId, 'id_integracao_cielo', 'Integração Cielo:', $integracoes); } // Local de pagamento echo input_checkbox($postId, 'pago_dinheiro', 'Dinheiro'); $locais = Plib::object_to_array(Locais::getInstance()->getAll()); $locais = Plib::array_to_key_value($locais, 'id', 'titulo'); echo input_select($postId, 'id_local_pagamento', 'Local pagamenho Dinheiro:', $locais); echo input_checkbox($postId, 'pago_deposito', 'Depósito Bancário'); echo "</div>"; // Beta if ($this->templateExibir('beta')) { echo input_checkbox($postId, 'beta', 'Beta:'); } // Confirmação da Inscrição: //var_dump($this->evento->confirmacao); // $meta = get_post_meta($postId, 'confirmacao', true); // echo "'$meta'<br>"; //die(); ?> </div> <div id="tabs-dados"> <?php // Campo chave de validação da pessoa // Campos Extra if ($this->templateExibir('campos_extras')) { echo "<div class=fields>"; echo "<h3>Campos Extras</h3>"; echo input_textarea($postId, 'campos_extras', 'Campos Extras:', 10, "Utilizar:<br>nome_unico/Titulo do campo<br>Exemplo:<br>empresa/Empresa em que trabalha"); echo "</div>"; } if ($this->templateExibir('avaliacao')) { $questionarios = Plib::object_to_array(Questionarios::getInstance()->getAll()); $questionarios = Plib::array_to_key_value($questionarios, 'id', 'titulo'); echo input_select($postId, 'id_questionario', 'Questionário de Feedback:', $questionarios); } ?> </div> <!-- <div id="tabs-mensagens">--> <!-- --><?php // if ($this->evento){ // // Incluir formulário parcial de mensagens // Mensagens::getInstance()->setEvento($this->evento->id); // require_once PLUGINPATH. '/view/mensagens/partial_mensagens.php'; // } // ?> <!-- </div>--> <?php if ($this->evento->pago == 'pago') { ?> <div id="tabs-treinamento"> <?php echo "<div class=fields>"; echo "<h3>Treinamento</h3>"; // Publico Alvo if ($this->templateExibir('publico_alvo')) { echo input_textarea($postId, 'publico_alvo', 'Público Alvo', 2); } // Material Didático if ($this->templateExibir('material')) { echo input_textarea($postId, 'material', 'Material Didático oferecido:', 2); } // Certificado if ($this->templateExibir('certificado')) { echo input_textarea($postId, 'certificado', 'Certificado:', 1); } // Duração if ($this->templateExibir('duracao')) { echo input_textarea($postId, 'duracao', 'Duração:', 1); } if ($this->templateExibir('horarios')) { echo input_textarea($postId, 'horarios', 'Horários:', 1); } if ($this->templateExibir('requisitos')) { echo input_textarea($postId, 'requisitos', 'Pré-Requisitos:', 1); } // Valor // if ($this->templateExibir('valor')) // echo input_numero($postId, 'valor', 'Valor:'); echo "</div>"; echo "<div class=fields>"; echo "<h3>Conteúdo</h3>"; // Tópicos if ($this->templateExibir('topicos')) { echo input_textarea($postId, 'topicos', 'Tópicos:', 10, "Utilizar um tópico por linha. Identar com 3 espaços.<br>[v] Video, [a] Arquivo"); } // FAQ if ($this->templateExibir('faq')) { echo input_textarea($postId, 'faq', 'Perguntas Frequentes.:', 10, "Utilizar:<br>- Pergunta<Br>Resposta"); } echo "</div>"; ?> </div> <?php } ?> <?php if ($this->templateExibir('secoes_extras')) { ?> <div id="tabs-sessoesextras"> <?php $postId = $post->ID; // Cada secão if ($this->evento) { $secoes = $this->evento->getSecoesExtras(); if ($secoes != null) { foreach ($secoes as $secao => $titulo) { // var_dump($secoes); echo "<label for='secao_{$secao}'><div><p>{$titulo}</p></div></label>"; $value = get_post_meta($postId, 'secao_' . $secao, true); wp_editor($value, 'secao_' . $secao, array('textarea_rows' => get_option('default_post_edit_rows', 10))); } } } // Secões echo input_textarea($postId, 'secoes_extras', 'Secoes Extras:', 7, "Utilizar:<br>nome_unico/Titulo da seção"); ?> </div> <?php } ?> </div> <script> function ajustesVisuais(){ console.log(this); console.log(); if (jQuery("#pago").val() == "pago") { jQuery("#formas_pagamento").css("display","block"); } else { jQuery("#formas_pagamento").css("display","none"); } }; jQuery(function ($) { $(document ).ready(function() { $("#tabs").tabs(); $(".ajustes_visuais").on("change", function () { ajustesVisuais(); }); ajustesVisuais(); }); }); </script> <?php }
function show_form($errors = '') { // If the form is submitted, get defaults from submitted parameters if (array_key_exists('_submit_check', $_POST)) { $defaults = $_POST; } else { // Otherwise, set our own defaults: medium size and yes to delivery $defaults = array('name' => '', 'sweet' => 'puff', 'main_dish' => array('cuke'), 'comments' => '', 'delivery' => 'yes', 'size' => 'medium'); } // If errors were passed in, put them in $error_text (with HTML markup) if ($errors) { $error_text = '<tr><td>You need to correct the following errors:'; $error_text .= '</td><td><ul><li>'; $error_text .= implode('</li><li>', $errors); $error_text .= '</li></ul></td></tr>'; } else { // No errors? Then $error_text is blank $error_text = ''; } // Jump out of PHP mode to make displaying all the HTML tags easier ?> <form method="POST" action="<?php print $_SERVER['SCRIPT_NAME']; ?> "> <table> <?php print $error_text; ?> <tr><td>Your Name:</td> <td><?php input_text('name', $defaults); ?> </td></tr> <tr><td>Size:</td> <td><?php input_radiocheck('radio', 'size', $defaults, 'small'); ?> Small <br/> <?php input_radiocheck('radio', 'size', $defaults, 'medium'); ?> Medium <br/> <?php input_radiocheck('radio', 'size', $defaults, 'large'); ?> Large </td></tr> <tr><td>Pick one sweet item:</td> <td><?php input_select('sweet', $defaults, $GLOBALS['sweets']); ?> </td></tr> <tr><td>Pick two main dishes:</td> <td> <?php input_select('main_dish', $defaults, $GLOBALS['main_dishes'], true); ?> </td></tr> <tr><td>Do you want your order delivered?</td> <td><?php input_radiocheck('checkbox', 'delivery', $defaults, 'yes'); ?> Yes </td></tr> <tr><td>Enter any special instructions.<br/> If you want your order delivered, put your address here:</td> <td><?php input_textarea('comments', $defaults); ?> </td></tr> <tr><td colspan="2" align="center"><?php input_submit('save', 'Order'); ?> </td></tr> </table> <input type="hidden" name="_submit_check" value="1"/> </form> <?php }
<td width="49%">' . input_text('waktu_akhir', $get['waktu_akhir'], 'text', 15) . ' ' . $wktakhir . '</td> </tr> <tr> <td width="20%">Background Color</td> <td width="1%">:</td> <td width="49%">' . input_text('background', $get['background'], 'text', 15, 'onblur="return ubahbackground(\'ubahwarna\',this);"') . ' <span id="ubahwarna" style="background:' . $get['background'] . '"> <span id="tulisanwarna" style="color:' . $get['color'] . '">16</span> </span></td> </tr> <tr> <td width="20%">Color</td> <td width="1%">:</td> <td width="49%">' . input_text('color', $get['color'], 'text', 15, 'onblur="return ubahcolor(\'tulisanwarna\',this);"') . '</td> </tr> <tr> <td width="20%">Isi</td> <td width="1%">:</td> <td width="49%">' . input_textarea('isi', $get['isi'], $rows = 5, $cols = 40, $opt = '') . '</td> </tr> <tr> <td width="20%"> </td> <td width="1%"> </td> <td width="49%"><input type="submit" name="submit" value="Edit" class="submit" /></td> </tr>'; $content .= '</table></form>'; $content .= '</div>'; break; case 'delete': $id = int_filter($_GET['id']); $del = mysql_query("DELETE FROM `tbl_kalender` WHERE `id`='{$id}'"); if ($del) { $content .= '<div class="border"><table width="100%" class="bodyline"><tr><td align="left"><img src="images/info.gif" border="0"></td><td align="center"><div class="sukses">Data Berhasil Dihapus</div></td><td align="right"><img src="images/info.gif" border="0"></td></tr></table></div>'; $content .= '<div class="border"><center><a href="admin.php?pilih=calendar&mod=yes">Back</a></center></div>';
function build_input_form($field_array) { hook_action('build_input_form'); if ($field_array['name']) { if (!isset($field_array['object_id']) or !is_numeric($field_array['object_id'])) { $field_array['object_id'] = '0'; } if (!isset($field_array['nice_name'])) { $field_array['nice_name'] = ''; } if (!isset($field_array['object_type'])) { $field_array['object_type'] = ''; } if (!isset($field_array['description'])) { $field_array['description'] = ''; } if (!isset($field_array['placeholder'])) { $field_array['placeholder'] = ''; } if (!isset($field_array['default_value'])) { $field_array['default_value'] = ''; } if (!isset($field_array['addClass'])) { $field_array['addClass'] = NULL; } if (!isset($field_array['input_type'])) { $field_array['input_type'] = 'text'; } if (!isset($field_array['create_slug'])) { $field_array['create_slug'] = FALSE; } if (!isset($field_array['required'])) { $field_array['required'] = FALSE; } if (!isset($field_array['handle'])) { $field_array['handle'] = TRUE; } if ($field_array['required'] == TRUE) { $field_array['required'] = 'required'; } if (!isset($field_array['input_option'])) { $field_array['input_option'] = array(); } if (!is_array($field_array['input_option'])) { $field_array['input_option'] = array(); } switch ($field_array['input_type']) { case 'text': input_text($field_array); break; case 'email': input_email($field_array); break; case 'hidden': input_hidden($field_array); break; case 'request_uri': input_request_uri($field_array); break; case 'number': input_number($field_array); break; case 'password': input_password($field_array); break; case 'textarea': input_textarea($field_array); break; case 'wysiwyg': echo input_editor($field_array); break; case 'select': input_select($field_array); break; case 'multiimage': input_multiimage($field_array); break; } } }
/** * textarea * * @param string $colname * @param mixed $default * @param integer $id * @param boolean $disabled * @param array $column */ protected function edit_area($colname, $default, /** @noinspection PhpUnusedParameterInspection */ $id, $disabled, array $column) { $attributes = array(); if (isset($column['cols'])) { $attributes[] = 'cols="'.$column['cols'].'"'; } if (isset($column['width'])) { $attributes[] = 'style="width:'.$column['width'].'"'; } if (isset($column['rows'])) { $attributes[] = 'rows="'.$column['rows'].'"'; } if (!empty($column['required'])) { $attributes[] = 'required'; } input_textarea($colname, $default, $disabled, join(" ", $attributes)); }