Example #1
0
function field_form()
{
    global $phpc_script, $vars, $phpcdb, $phpcid;
    $form = new Form($phpc_script, __('Field Form'));
    $form->add_part(new FormFreeQuestion('name', __('Name'), false, 32, true));
    if (isset($vars['cid'])) {
        $form->add_hidden('cid', $vars['cid']);
        $cid = $vars['cid'];
    } else {
        $cid = $phpcid;
    }
    $form->add_hidden('action', 'field_submit');
    $form->add_hidden('phpcid', $phpcid);
    $form->add_part(new FormCheckBoxQuestion('required', __('Required?')));
    $form->add_part(new FormFreeQuestion('format', __('Format')));
    $form->add_part(new FormSubmitButton(__("Submit Field")));
    if (isset($vars['fid'])) {
        $form->add_hidden('fid', $vars['fid']);
        $field = $phpcdb->get_field($vars['fid']);
        $defaults = array('name' => htmlspecialchars($field['name']), 'required' => htmlspecialchars($field['required']), 'format' => htmlspecialchars($field['format']));
    } else {
        $defaults = array();
    }
    return $form->get_form($defaults);
}
Example #2
0
function category_form()
{
    global $phpc_script, $vars, $phpcdb, $phpcid;
    $form = new Form($phpc_script, __('Category Form'));
    $form->add_part(new FormFreeQuestion('name', __('Name'), false, 32, true));
    if (isset($vars['cid'])) {
        $form->add_hidden('cid', $vars['cid']);
        $cid = $vars['cid'];
    } else {
        $cid = $phpcid;
    }
    $form->add_hidden('action', 'category_submit');
    $form->add_hidden('phpcid', $phpcid);
    $form->add_part(new FormColorPicker('text-color', __('Text Color')));
    $form->add_part(new FormColorPicker('bg-color', __('Background Color')));
    $group_question = new FormDropDownQuestion('gid', __('Visible to groups'));
    $group_question->add_option('', __('None'));
    foreach ($phpcdb->get_groups($cid) as $group) {
        $group_question->add_option($group['gid'], $group['name']);
    }
    $form->add_part($group_question);
    $form->add_part(new FormSubmitButton(__("Submit Category")));
    if (isset($vars['catid'])) {
        $form->add_hidden('catid', $vars['catid']);
        $category = $phpcdb->get_category($vars['catid']);
        $defaults = array('name' => htmlspecialchars($category['name']), 'text-color' => htmlspecialchars(str_replace('#', '', $category['text_color'])), 'bg-color' => htmlspecialchars(str_replace('#', '', $category['bg_color'])), 'gid' => htmlspecialchars($category['gid']));
    } else {
        $defaults = array('text-color' => '000000', 'bg-color' => 'FFFFFF');
    }
    return $form->get_form($defaults);
}
Example #3
0
function group_form()
{
    global $phpc_script, $vars, $phpcdb, $phpcid;
    $form = new Form($phpc_script, __('Group Form'));
    $form->add_part(new FormFreeQuestion('name', __('Name'), false, 32, true));
    $form->add_hidden('cid', $phpcid);
    $form->add_hidden('action', 'group_submit');
    $form->add_part(new FormSubmitButton(__("Submit Group")));
    if (isset($vars['gid'])) {
        $form->add_hidden('gid', $vars['gid']);
        $group = $phpcdb->get_group($vars['gid']);
        $defaults = array('name' => htmlspecialchars($group['name']));
    } else {
        $defaults = array();
    }
    return $form->get_form($defaults);
}
Example #4
0
function import()
{
    global $phpc_script, $vars;
    $form = new Form($phpc_script, __('Import Form'));
    $form->add_part(new FormFreeQuestion('host', __('MySQL Host Name')));
    $form->add_part(new FormFreeQuestion('dbname', __('MySQL Database Name')));
    $form->add_part(new FormFreeQuestion('port', __('MySQL Port Number'), __('Leave blank for default')));
    $form->add_part(new FormFreeQuestion('username', __('MySQL User Name')));
    $pwq = new FormFreeQuestion('passwd', __('MySQL User Password'));
    $pwq->type = 'password';
    $form->add_part($pwq);
    $form->add_part(new FormFreeQuestion('prefix', __('PHP-Calendar Table Prefix')));
    $form->add_hidden('action', 'import');
    $form->add_hidden('submit_form', 'submit_form');
    $form->add_part(new FormSubmitButton(__("Import Calendar")));
    $defaults = array('host' => 'localhost', 'dbname' => 'calendar', 'prefix' => 'phpc_');
    return tag('div', attrs('id="phpc-admin-import"'), $form->get_form($defaults));
}
Example #5
0
function search_form()
{
    global $day, $month, $year, $phpc_script, $month_names, $sort_options, $order_options, $phpcid, $phpc_cal;
    $date_format = $phpc_cal->date_format;
    $form = new Form($phpc_script, __('Search'), 'post');
    $form->add_part(new FormFreeQuestion('searchstring', __('Phrase'), false, 32, true));
    $form->add_hidden('action', 'search');
    $form->add_hidden('phpcid', $phpcid);
    $form->add_part(new FormDateQuestion('search-from', __('From'), $date_format));
    $form->add_part(new FormDateQuestion('search-to', __('To'), $date_format));
    $sort = new FormDropdownQuestion('sort', __('Sort By'));
    $sort->add_options($sort_options);
    $form->add_part($sort);
    $order = new FormDropdownQuestion('order', __('Order'));
    $order->add_options($order_options);
    $form->add_part($order);
    $form->add_part(new FormSubmitButton(__("Search")));
    return $form->get_form();
}
Example #6
0
 function index()
 {
     $options = array("a" => 1, "b" => 2);
     $this->load_library("Form", "form");
     $this->form->init_form(URL . "ajax.php/form/save/", "get");
     $this->form->open_table("Table title");
     $this->form->add_hidden('a', 1);
     $this->form->add_item('text', 'name', 'text', 'description', null, 'required');
     $this->form->add_item('text', 'email', 'email', 'insert your email', null, 'required,email');
     $this->form->add_item('password', 'pw', 'password', 'insert your pw');
     $this->form->add_item('select', 'sel', 'select', 'make your choice', null, null, array('options' => $options));
     $this->form->add_item('checkbox', 'check', 'select', 'make your choice', null, null, array('options' => $options));
     $this->form->add_item('textarea', 'textarea', 'textarea', 'description');
     $this->form->add_item('word', 'word', 'textarea', 'description');
     $this->form->add_item('file', 'file', 'filename', 'upload a file');
     $this->form->add_item('yes', 'yes', 'enable', 'do you want to enable?');
     $this->form->add_html('this is plain html');
     $this->form->add_button();
     $this->form->close_table();
     $this->form->draw($use_ajax = true, $return_string = false);
 }
Example #7
0
function display_form()
{
    global $phpc_script, $phpc_year, $phpc_month, $phpc_day, $vars, $phpcdb, $phpc_cal, $phpc_token;
    $hour24 = $phpc_cal->hours_24;
    $date_format = $phpc_cal->date_format;
    $form = new Form($phpc_script, __('Occurrence Form'));
    $when_group = new FormGroup(__('When'));
    $when_group->add_part(new FormDateTimeQuestion('start', __('From'), $hour24, $date_format));
    $when_group->add_part(new FormDateTimeQuestion('end', __('To'), $hour24, $date_format));
    $time_type = new FormDropDownQuestion('time-type', __('Time Type'));
    $time_type->add_option('normal', __('Normal'));
    $time_type->add_option('full', __('Full Day'));
    $time_type->add_option('tba', __('To Be Announced'));
    $when_group->add_part($time_type);
    $form->add_part($when_group);
    if (isset($vars['phpcid'])) {
        $form->add_hidden('phpcid', $vars['phpcid']);
    }
    if (isset($vars['oid'])) {
        $form->add_hidden('oid', $vars['oid']);
        $occ = $phpcdb->get_occurrence_by_oid($vars['oid']);
        $datefmt = $phpc_cal->date_format;
        $start_date = format_short_date_string($occ->get_start_year(), $occ->get_start_month(), $occ->get_start_day(), $datefmt);
        $end_date = format_short_date_string($occ->get_end_year(), $occ->get_end_month(), $occ->get_end_day(), $datefmt);
        $start_time = $occ->get_start_time();
        if ($start_time == NULL) {
            $start_time = format_time_string(17, 0, $hour24);
        }
        $end_time = $occ->get_end_time();
        if ($end_time == NULL) {
            $end_time = format_time_string(18, 0, $hour24);
        }
        $defaults = array('start-date' => $start_date, 'end-date' => $end_date, 'start-time' => $start_time, 'end-time' => $end_time);
        switch ($occ->get_time_type()) {
            case 0:
                $defaults['time-type'] = 'normal';
                break;
            case 1:
                $defaults['time-type'] = 'full';
                break;
            case 2:
                $defaults['time-type'] = 'tba';
                break;
        }
    } else {
        $form->add_hidden('eid', $vars['eid']);
        $defaults = array('start-date' => "{$phpc_month}/{$phpc_day}/{$phpc_year}", 'end-date' => "{$phpc_month}/{$phpc_day}/{$phpc_year}", 'start-time' => format_time_string(17, 0, $hour24), 'end-time' => format_time_string(18, 0, $hour24));
    }
    $form->add_hidden('phpc_token', $phpc_token);
    $form->add_hidden('action', 'occur_form');
    $form->add_hidden('submit_form', 'submit_form');
    $form->add_part(new FormSubmitButton(__("Submit Occurrence")));
    return $form->get_form($defaults);
}
 public function action_index()
 {
     $this->set_title("Module Inscription");
     /** -- En cas de retour sur action_index() suite à des erreurs on remplie le formulaire avec l'ancienne saisie de l'utilisateur -- **/
     //La saisie est sauvegarde jusqu'a ce qu'il reussise l'inscription : -S'il quitte la page et reviens les données sont conservées
     if (isset($this->session->formIns)) {
         $f = $this->session->formIns;
         $f->populate();
     } else {
         $dir = "./images/captcha";
         // Ouvre un dossier bien connu, et liste tous les fichiers
         if (is_dir($dir)) {
             if ($dh = opendir($dir)) {
                 while (($file = readdir($dh)) !== false) {
                     //echo "fichier : $file : type : " . filetype($dir . $file) . "\n";
                     $captcha[] = $file;
                 }
                 closedir($dh);
             }
         }
         $length = 0;
         foreach ($captcha as $cp) {
             $length++;
         }
         $nb = rand(2, $length - 1);
         echo var_dump($length . "ee" . $nb);
         $f = new Form("?module=inscription&action=valide", "f_ins");
         //Creation du formulaire
         $f->add_text("nom", "nom", "Nom");
         $f->add_text("prenom", "prenom", "Prénom");
         $f->add_text("rue", "rue", "Rue");
         $f->add_text("cp", "cp", "Code postal");
         $f->add_text("ville", "ville", "Ville");
         $f->add_text("mail", "mail", "Mail");
         $f->add_password("mdp", "mdp", "Mot de passe");
         $f->add_password("mdp2", "mdp2", "Confirmation");
         $f->add_captcha("cap", "cap", "Code de confirmation")->set_captcha($captcha[$nb]);
         $f->add_hidden("hide", "hide", "")->set_value($captcha[$nb]);
         $f->add_submit("Valider", "valIns")->set_value("Valider");
         $this->session->formIns = $f;
     }
     $this->tpl->assign("f_ins", $f);
 }
Example #9
0
function display_form()
{
    global $phpc_script, $year, $month, $day, $vars, $phpcdb, $phpc_cal, $phpc_user, $phpc_token;
    $hour24 = $phpc_cal->hours_24;
    $date_format = $phpc_cal->date_format;
    $form = new Form($phpc_script, __('Event Form'));
    $form->add_part(new FormFreeQuestion('subject', __('Subject'), false, $phpc_cal->subject_max, true));
    $form->add_part(new FormLongFreeQuestion('description', __('Description')));
    $when_group = new FormGroup(__('When'), 'phpc-when');
    if (isset($vars['eid'])) {
        $when_group->add_part(new FormCheckBoxQuestion('phpc-modify', false, __('Change the event date and time')));
    }
    $when_group->add_part(new FormDateTimeQuestion('start', __('From'), $hour24, $date_format));
    $when_group->add_part(new FormDateTimeQuestion('end', __('To'), $hour24, $date_format));
    $time_type = new FormDropDownQuestion('time-type', __('Time Type'));
    $time_type->add_option('normal', __('Normal'));
    $time_type->add_option('full', __('Full Day'));
    $time_type->add_option('tba', __('To Be Announced'));
    $when_group->add_part($time_type);
    $form->add_part($when_group);
    $repeat_type = new FormDropdownQuestion('repeats', __('Repeats'), array(), true, 'never');
    $repeat_type->add_option('never', __('Never'));
    $daily_group = new FormGroup();
    $repeat_type->add_option('daily', __('Daily'), NULL, $daily_group);
    $weekly_group = new FormGroup();
    $repeat_type->add_option('weekly', __('Weekly'), NULL, $weekly_group);
    $monthly_group = new FormGroup();
    $repeat_type->add_option('monthly', __('Monthly'), NULL, $monthly_group);
    $yearly_group = new FormGroup();
    $repeat_type->add_option('yearly', __('Yearly'), NULL, $yearly_group);
    $every_day = new FormDropdownQuestion('every-day', __('Every'), __('Repeat every how many days?'));
    $every_day->add_options(create_sequence(1, 30));
    $daily_group->add_part($every_day);
    $daily_group->add_part(new FormDateQuestion('daily-until', __('Until'), $date_format));
    $every_week = new FormDropdownQuestion('every-week', __('Every'), __('Repeat every how many weeks?'));
    $every_week->add_options(create_sequence(1, 30));
    $weekly_group->add_part($every_week);
    $weekly_group->add_part(new FormDateQuestion('weekly-until', __('Until'), $date_format));
    $every_month = new FormDropdownQuestion('every-month', __('Every'), __('Repeat every how many months?'));
    $every_month->add_options(create_sequence(1, 30));
    $monthly_group->add_part($every_month);
    $monthly_group->add_part(new FormDateQuestion('monthly-until', __('Until'), $date_format));
    $every_year = new FormDropdownQuestion('every-year', __('Every'), __('Repeat every how many years?'));
    $every_year->add_options(create_sequence(1, 30));
    $yearly_group->add_part($every_year);
    $yearly_group->add_part(new FormDateQuestion('yearly-until', __('Until'), $date_format));
    $when_group->add_part($repeat_type);
    if ($phpc_cal->can_create_readonly()) {
        $form->add_part(new FormCheckBoxQuestion('readonly', false, __('Read-only')));
    }
    $categories = new FormDropdownQuestion('catid', __('Category'));
    $categories->add_option('', __('None'));
    $have_categories = false;
    foreach ($phpc_cal->get_visible_categories($phpc_user->get_uid()) as $category) {
        $categories->add_option($category['catid'], $category['name']);
        $have_categories = true;
    }
    if ($have_categories) {
        $form->add_part($categories);
    }
    if (isset($vars['phpcid'])) {
        $form->add_hidden('phpcid', $vars['phpcid']);
    }
    $form->add_hidden('phpc_token', $phpc_token);
    $form->add_hidden('action', 'event_form');
    $form->add_hidden('submit_form', 'submit_form');
    $form->add_part(new FormSubmitButton(__("Submit Event")));
    if (isset($vars['eid'])) {
        $form->add_hidden('eid', $vars['eid']);
        $occs = $phpcdb->get_occurrences_by_eid($vars['eid']);
        $event = $occs[0];
        $defaults = array('subject' => $event->get_raw_subject(), 'description' => $event->get_raw_desc(), 'start-date' => $event->get_short_start_date(), 'end-date' => $event->get_short_end_date(), 'start-time' => $event->get_start_time(), 'end-time' => $event->get_end_time(), 'readonly' => $event->is_readonly());
        if (!empty($event->catid)) {
            $defaults['catid'] = $event->catid;
        }
        switch ($event->get_time_type()) {
            case 0:
                $defaults['time-type'] = 'normal';
                break;
            case 1:
                $defaults['time-type'] = 'full';
                break;
            case 2:
                $defaults['time-type'] = 'tba';
                break;
        }
        add_repeat_defaults($occs, $defaults);
    } else {
        $hour24 = $phpc_cal->hours_24;
        $datefmt = $phpc_cal->date_format;
        $date_string = format_short_date_string($year, $month, $day, $datefmt);
        $defaults = array('start-date' => $date_string, 'end-date' => $date_string, 'start-time' => format_time_string(17, 0, $hour24), 'end-time' => format_time_string(18, 0, $hour24), 'daily-until-date' => $date_string, 'weekly-until-date' => $date_string, 'monthly-until-date' => $date_string, 'yearly-until-date' => $date_string);
    }
    return $form->get_form($defaults);
}
Example #10
0
$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);
$f->add_submit(_t("Update"));
echo $f->html();
?>
<script>
	var hash_salt = "<?php 
echo RANDOM_SALT;
?>
";
	$(document).ready(function() {
		eb_sync_hash('clear_new_pass', 'new_pass');
		eb_sync_hash('clear_new_pass2', 'new_pass2');
Example #11
0
<?php

$Form = new Form();
$Form->header(url(0, 1) . "reply", "post", FORM_SALT);
$Form->values(array("message_id" => id(true)));
$Form->add_hidden("message_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}','message'," . id() . ");");
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) == "")
  {
    loadposts('message',false);
    e('<?php 
print $Form->name;
?>
').reset();
  }
  $('.submit').attr('disabled',false);
 public function action_addPhoto()
 {
     $id = $this->req->id;
     $this->set_title("Module Admin Ajouter Photo");
     $f = new Form("?module=admModele&action=validePhoto", "f_addph");
     $f->add_hidden("id", "id", "Id")->set_value($this->req->id);
     $f->add_file("photo", "photo", "photo");
     $f->add_submit("Valider", "val_up")->set_value("Valider");
     $this->tpl->assign("f_addph", $f);
     $this->session->formPh = $f;
 }
Example #13
0
$Base = new Base();
$Base->type(CREATE);
$Base->title("Create New Message");
$Base->header();
$Form = new Form();
$Form->header(url(), "post", FORM_SALT);
$Form->account_login();
$Form->fieldset_open("Message Details");
$Form->labels(false);
print "<li>\n";
print "  <label>Recipients:</label>\n";
print "  <div id=\"m\" style=\"width:500px;float:left;line-height:1.8em;\"><span id=\"notice\" class=\"small\">(invalid names will be discarded)</span></div>\n";
print "</li>\n";
print "<li>\n";
print "  <label for=\"recipients\">Add Members:</label>\n";
$Form->add_hidden("message_members");
$Form->add_text("_recipients", false, 200, false, "onkeydown=\"return catch_enter(event)\"/>");
$Form->add_button("add", "Add", "check_member();", "tabindex=\"10\"/>");
print " <sup id=\"names\">add multiples with: name, name, name</sup>";
print "</li>\n";
$Form->labels(true);
$Form->add_text("subject", "Subject:", 400, 200);
$Form->add_textarea("body", "Body:");
$Form->fieldset_close();
$Form->add_submit(SAY_BUTTON, "class=\"nodisable\"/>");
$Form->add_button("preview", PREVIEW_BUTTON, "preview_post('{$Form->name}','message',99999999);");
print "&nbsp;<sup><a href=\"javascript:;\" onclick=\"\$('#bbcode').slideToggle()\">[help]</a></sup>\n";
$Form->footer();
$Form->header_validate();
$Form->add_notnull("message_members", "Please enter at least one recipient.");
$Form->add_notnull("subject", "Please enter a subject.");
Example #14
0
</form>
		</td>
		<td width="100" align="center">
			&nbsp;
		</td>
		<td width="300" class="evt_sign_in_form">
<div class="evt_sign_in_table_title">{{Password connect}}</div>
<div class="form_cancel"><small>{{Not registered? Then}} <a href="index.php?action=get_form&amp;type=account">{{create an account}}</a></small></div>
<?php 
$f = new Form();
$f->action = "?action=authenticate";
$f->other_attrs = 'id="sign_in"';
$f->method = "POST";
$f->add_text(_t("Email"), "email", default_value("email"), _t("Enter your email"));
$f->add_password(_t("Password"), "clear_password", _t("Enter your password"));
$f->add_hidden("password", "");
$f->add_hidden("cnonce", "");
$f->add_submit(_t("Sign in"));
echo $f->html();
?>
<br/>
<br/>
<a href="?action=get_form&type=forgotten_password">{{Forgot your password?}}</a><br/>
		</td>
	</tr>
</table>
<script>
	var hash_salt = "<?php 
echo RANDOM_SALT;
?>
";
Example #15
0
 public function action_rent()
 {
     if ($this->session->ouverte()) {
         if ($this->req->id) {
             $f = new Form("?module=loc&action=valide&idmod=" . $this->req->id, "form_rent");
             $f->add_dateAndTime("dateloc", "dateloc", "Date location");
             $f->add_dateAndTime("daterendu", "daterendu", "Date retour ");
             $f->add_hidden("id", "id")->set_value($this->req->id);
             $f->add_submit("valider", "valider")->set_value("Valider");
             $this->tpl->assign("f_rent", $f);
             $this->session->frent = $f;
             //echo var_dump($_SERVER['HTTP_USER_AGENT']);
         }
     } else {
         Site::redirect("Login");
     }
 }
Example #16
0
require_once BASE_DIR . '/include/recaptcha.inc';
global $g_use_recaptcha;
$f = new Form();
$f->cancel = true;
$f->title = _t("Account creation");
$f->action = "?action=create&amp;type=account";
$f->method = "POST";
$f->add_email(_t("Email"), "email", default_value("email"), _t("A valid Email you want to associate to your account. Will act as your login."));
$f->add_text(_t("Firstname"), "firstname", default_value("firstname"), _t("Your Firstname."));
$f->add_text(_t("Lastname"), "lastname", default_value("lastname"), _t("Your Lastname."));
$item = $f->add_password(_t("Password"), "clear_password", _t("The password you want to associate to your account."));
$item->is_optional = true;
$item = $f->add_password(_t("Retype Password"), "clear_password2", _t("Retype your password."));
$item->is_optional = true;
$f->add_hidden("password", "");
$f->add_hidden("password2", "");
//$f->add_text("Street# and street name", "street", default_value("street"), "Number and street name");
//$f->add_text("ZIP", "zip", default_value("zip"), "ZIP code of your city.");
//$f->add_text("City", "city", default_value("city"), "Your city.");
//$item = $f->add_text("State (Optional)", "state", default_value("state"), "Your state if any");
//$item->is_optional = true;
//$f->add_text("Country", "country", default_value("country"), "Your country");
if ($g_use_recaptcha) {
    $publickey = CAPTCHA_PUB_KEY;
    // you got this from the signup page
    $f->add_raw_html(recaptcha_get_html($publickey));
}
$f->add_checkbox(_t("I have read and understood the <a href=\"info/terms\" target=\"_blank\">Terms and Conditions</a> and accept them."), "confirm", "", "");
$f->add_submit(_t("Submit"));
echo $f->html();
Example #17
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) == "")
  {
Example #18
0
$f->add_raw_html(<<<EOF
\t<h1>{{Describe your event}}</h1>
\t<div class="form_section">
EOF
);
$item = $f->add_text(_t("[event]Title"), "title", default_value("title", $event->title), _t("Conference, or meeting name."));
$item->other_attr = ' size="60" maxlength="255"';
$item = $f->add_text(_t("Organizer name"), "organizer_name", default_value("organizer_name", $event->organizer_name, $user->get_company_name()), _t("The entity that is responsible for organizing the event."));
$item->other_attr = ' size="60" maxlength="255"';
$item = $f->add_text(_t("Organizer phone (optional but recommended)"), "phone", default_value("phone", $event->phone, $user->phone), _t("Contact phone not published. Used ONLY for support purpose."));
$item->is_optional = true;
if (!$event->has_accountancy_activity()) {
    $item = $f->add_number(_t("Required funding (Euro)"), "funding_needed", default_value("funding_needed", $event->funding_needed), _t("Minimum amount of fund needed to organize the event. Please indicate 0 if no requirement."));
    $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);