/**
  * Print the popup
  *
  * @param string $tableId
  * @param array $tableFields
  * @return array
  */
 function renderPopup($tableId, $tableFields)
 {
     $this->name = $tableId;
     $fields = array_keys($tableFields);
     foreach ($fields as $f) {
         switch (strtolower($tableFields[$f]['Type'])) {
             case 'javascript':
             case 'button':
             case 'private':
             case 'hidden':
             case 'cellmark':
                 break;
             default:
                 $label = $tableFields[$f]['Label'] != '' ? $tableFields[$f]['Label'] : $f;
                 $label = str_replace("\n", ' ', $label);
                 $pmXmlNode = new Xml_Node($f, 'complete', '', array('label' => $label, 'type' => 'popupOption', 'launch' => $tableId . '.showHideField("' . $f . '")'));
                 $this->fields[$f] = new XmlForm_Field_popupOption($pmXmlNode);
                 $this->values[$f] = '';
         }
     }
     $scTemp = '';
     $this->values['PAGED_TABLE_ID'] = $tableId;
     print parent::render(PATH_CORE . 'templates/popupMenu.html', $scTemp);
     $sc = "<script type=\"text/javascript\">\n{$scTemp}\n loadPopupMenu_{$tableId}(); \n</script>";
     return $sc;
 }
Exemple #2
0
$form->add_field('input', array('#class' => 'checkbox', '#label' => 'Check me out', 'type' => 'checkbox'));
$form->add_field('button', array('#value' => 'Submit', 'type' => 'submit', 'class' => 'btn btn-default'));
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Example 1</title>

	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">

	<!-- Optional theme -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" crossorigin="anonymous">

	<!-- Latest compiled and minified JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>

  </head>
  <body>
  <div class="container">
  <h1>Example 1</h1>
  <?php 
print $form->render();
?>
  </div>
  </body>
  </html>
Exemple #3
0
function smt_form($id)
{
    $id = (int) $id;
    $var = json_decode(mysql_result(mysql_query("SELECT setting_value FROM settings WHERE setting_owner='form_action' and setting_name='form{$id}'"), 0));
    $form = new form('POST', 'form.php', 'normalclass', $var->name);
    /*
    $selectId = $form->addSelect('select test','açıkla', TRUE);
    $form->addSelect_item($selectId,'item1val','bir');
    $form->addSelect_item($selectId,'item2val','iki');
    */
    foreach ($var->vars as $id => $var) {
        if ($var->type == 'text') {
            $form->addTextBox('text_test', 'tx_value', $var->name);
        } elseif ($var->type == 'mail') {
            $form->addTextBox('text_test', 'tx_value', $var->name);
        } elseif ($var->type == 'textarea') {
            $form->addTextArea('ta_name', 'ta_value', $var->name, TRUE);
        } elseif ($var->type == 'checkbox') {
            $form->addCheckBox('cb_name', 'cb_value', 'açıkla');
        } elseif ($var->type == 'radio') {
            $form->addRadioButton('rb_name', 'rb_value', 'açıkla');
        }
    }
    $form->addSubmitButton('name', 'Gönder');
    echo $form->render();
    if (isset($_POST['id'])) {
        if (isset($_POST['id'])) {
            $id = (int) $_POST['id'];
        }
        $var = json_decode(mysql_result(mysql_query("SELECT setting_value FROM settings WHERE setting_owner='form_action' and setting_name='form1'"), 0));
        var_dump($var);
        if ($var->mail) {
            $c = $var->name . "'dan gelen geri bildiriminiz:";
            foreach ($var->vars as $ids => $v) {
                $c .= $v->name . ': ' . htmlentities($_POST[$ids]) . "\n--------------\n";
            }
            require_once 'phpmailer.class.php';
            $mail = new PHPMailer();
            $mail->SetFrom("*****@*****.**", smt_siteinfo('name', FALSE));
            $mail->AddAddress($var->send, 'Name');
            $mail->Subject = smt_siteinfo('name', FALSE) . " '' formundan gelen geri bildirim";
            $mail->AltBody = "E-posta bildirimini admin panelinizden ayarlayabilirsiniz.";
            $mail->MsgHTML($c);
            if ($mail->Send()) {
                $result = TRUE;
            }
        } elseif ($var->db) {
            $c = NULL;
            foreach ($var->vars as $ids => $v) {
                $c .= "'" . mysql_real_escape_string(htmlentities($_POST[$ids])) . "',";
            }
            $sql = sprintf("INSERT INTO form{$id} VALUES (DEFAULT, %s DEFAULT)", $c);
            if (@mysql_query($sql)) {
                $result = TRUE;
            }
        }
        if ($result) {
            echo $var->result->ok;
        } else {
            $var->result->fail;
        }
    }
}
 /**
  * {inheritDoc}
  */
 public function render(\phpbb\template\template $template)
 {
     $l_admin_info = $this->config_text->get('contact_admin_info');
     if ($l_admin_info) {
         $contact_admin_data = $this->config_text->get_array(array('contact_admin_info', 'contact_admin_info_uid', 'contact_admin_info_bitfield', 'contact_admin_info_flags'));
         $l_admin_info = generate_text_for_display($contact_admin_data['contact_admin_info'], $contact_admin_data['contact_admin_info_uid'], $contact_admin_data['contact_admin_info_bitfield'], $contact_admin_data['contact_admin_info_flags']);
     }
     $template->assign_vars(array('S_CONTACT_ADMIN' => true, 'S_CONTACT_FORM' => $this->config['contact_admin_form_enable'], 'S_IS_REGISTERED' => $this->user->data['is_registered'], 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=contactadmin'), 'CONTACT_INFO' => $l_admin_info, 'MESSAGE' => $this->body, 'SUBJECT' => $this->subject, 'NAME' => $this->sender_name, 'EMAIL' => $this->sender_address));
     parent::render($template);
 }
 /**
  * Displays and processes a login form
  * 
  * Used if a user is not authorised to view. Forces a login
  * 
  * @return Boolean TRUE if user passed authentication
  */
 private function do_login()
 {
     include_helper('form');
     $f = new form('login_form');
     $f_user_login = $f->add_field('user_login', 'text')->add_validation(array('required' => NULL));
     $f_password = $f->add_field('user_password', 'password')->add_validation(array('required' => NULL));
     $f_remember_me = $f->add_field('remember', 'checkbox');
     $f_submit = $f->add_field('wp_submit', 'submit', $label = 'Login');
     if ($credentials = $f->get_posted_data()) {
         // form was submitted successfully
         $u = wp_signon($credentials, false);
         if (!is_wp_error($u)) {
             return TRUE;
             // we are logged in and done ...
         } else {
             $f->add_error('The username and/or password is incorrect.');
         }
     }
     // if we got here we are not authenticated - display the form...
     // if there is a _do_login view we will use it...
     $login_form = $f->render();
     $this->CONTROLLER->add_var('login_form', $login_form);
     $this->CONTROLLER->set_post_title('Login to Continue');
     $this->CONTROLLER->set_post_content($this->CONTROLLER->load_view('tina_mvc_do_login'));
     return FALSE;
 }
 /**
  * this function is putting the filters
  * @author 
  *
  * @access public
  * @param  string $template
  * @param  string $scriptContent
  * @return string
  */
 function render($template, &$scriptContent)
 {
     $this->cols = intVal($this->cols);
     return parent::render($template, $scriptContent);
 }
 /**
  * {inheritDoc}
  */
 public function render(\phpbb\template\template $template)
 {
     parent::render($template);
     $this->user->add_lang('viewtopic');
     $template->assign_vars(array('EMAIL' => $this->recipient_address, 'NAME' => $this->recipient_name, 'S_LANG_OPTIONS' => language_select($this->recipient_lang), 'MESSAGE' => $this->body, 'L_EMAIL_BODY_EXPLAIN' => $this->user->lang['EMAIL_TOPIC_EXPLAIN'], 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=email&amp;t=' . $this->topic_id)));
 }
 /**
  * {inheritDoc}
  */
 public function render(\phpbb\template\template $template)
 {
     parent::render($template);
     $template->assign_vars(array('S_SEND_USER' => true, 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=email&amp;u=' . $this->recipient_id), 'L_SEND_EMAIL_USER' => $this->user->lang('SEND_EMAIL_USER', $this->recipient_row['username']), 'USERNAME_FULL' => get_username_string('full', $this->recipient_row['user_id'], $this->recipient_row['username'], $this->recipient_row['user_colour']), 'SUBJECT' => $this->subject, 'MESSAGE' => $this->body));
 }
<?php

require_once '../init.inc.php';
require_once '../class/form.class.php';
$module = $thinkedit->newModule('article', 1);
$module->load();
$form = new form($module);
echo $form->render();
Exemple #10
0
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Example 6</title>

	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">

	<!-- Optional theme -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX" crossorigin="anonymous">

	<!-- Latest compiled and minified JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>

  </head>
  <body>
  <div class="container">
  <h1>Example 6</h1>
  <?php 
print $form->render();
?>
  <?php 
print $form2->render();
?>
  </div>
  </body>
  </html>