public function __construct(HTMLTags_URL $action, $current_limit, $limits_str = NULL) { parent::__construct(); $this->current_limit = $current_limit; #echo "\$this->current_limit: $this->current_limit\n"; exit; if (!isset($limits_str)) { $limits_str = self::default_limits_str; } if (preg_match('/^(?:\\d+)(?: \\d+)*$/', $limits_str)) { $this->limits = explode(' ', $limits_str); } else { throw new Exception('$limits_str must be like \'NUM[ NUM]*\''); } $this->set_attribute_str('name', 'limit_setting'); $this->set_action($action); $this->set_attribute_str('method', 'GET'); $select = new HTMLTags_Select(); $select->set_attribute_str('name', 'limit'); foreach ($this->limits as $limit) { $option = new HTMLTags_Option($limit); $option->set_attribute_str('value', $limit); $select->add_option($option); } $select->set_value($this->current_limit); $this->append_tag_to_content($select); foreach ($this->get_hidden_inputs() as $h_i) { $this->append_tag_to_content($h_i); } $submit = new HTMLTags_Input(); $submit->set_attribute_str('type', 'submit'); $submit->set_attribute_str('value', 'Go'); $this->append_tag_to_content($submit); #$content->append_tag($p); }
public function get_product_currency_price_editing_form($product_id, $redirect_script_url, $cancel_href) { $product_currency_prices_table = $this->get_element(); $database = $product_currency_prices_table->get_database(); $products_table = $database->get_table('hpi_shop_products'); $currencies_table = $database->get_table('hpi_shop_currencies'); $product = $products_table->get_row_by_id($product_id); $product_currency_price_editing_form = new HTMLTags_SimpleOLForm('product_currency_price_editing'); $product_currency_price_editing_form->set_action($redirect_script_url); $legend_text = ''; $legend_text .= 'Edit prices for '; $legend_text .= $product->get_name(); $product_currency_price_editing_form->set_legend_text($legend_text); $currencies = $currencies_table->get_all_rows(); foreach ($currencies as $currency) { /* * The price */ $conditions = array(); $conditions['product_id'] = $product_id; $conditions['currency_id'] = $currency->get_id(); $product_currency_price = $product_currency_prices_table->get_rows_where($conditions); if (count($product_currency_price) > 0) { $current_price = $product_currency_price[0]->get_price(); } else { $current_price = 0; } $input_li = new HTMLTags_LI(); $input_label_text = ''; $input_label_text .= 'Price in '; $input_label_text .= $currency->get_name(); $input_label_text .= ' ('; $input_label_text .= $currency->get_symbol(); $input_label_text .= ')'; $input_label_title = ''; $input_label_title .= $currency->get_id(); $input_label = new HTMLTags_Label($input_label_text); $input_label->set_attribute_str('for', $input_label_title); $input_li->append_tag_to_content($input_label); $input = new HTMLTags_Input(); $input->set_attribute_str('type', 'text'); $input->set_attribute_str('name', $input_label_title); $input->set_value($current_price); $input_li->append_tag_to_content($input); $product_currency_price_editing_form->add_input_li($input_li); } /* * The add button. */ $product_currency_price_editing_form->set_submit_text('Edit'); $product_currency_price_editing_form->set_cancel_location($cancel_href); return $product_currency_price_editing_form; }
public function get_photograph_adding_form($photograph_adding_action, $cancel_location) { $mysql_user_factory = Database_MySQLUserFactory::get_instance(); $mysql_user = $mysql_user_factory->get_for_this_project(); $database = $mysql_user->get_database(); $photographs_table = $database->get_table('hpi_shop_photographs'); $photograph_adding_form = new HTMLTags_SimpleOLForm('photograph_adding'); $photograph_adding_form->set_attribute_str('enctype', 'multipart/form-data'); #$photograph_adding_action->set_get_variable('table', $photographs_table->get_name()); $photograph_adding_form->set_action($photograph_adding_action); $photograph_adding_form->set_legend_text('Add a photograph'); /* * The name */ $name_field = $photographs_table->get_field('name'); $name_field_renderer = $name_field->get_renderer(); $input_tag = $name_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'name'); $photograph_adding_form->add_input_tag('name', $input_tag); /* THE FULL SIZE IMAGE UPLOAD */ $full_size_image_file_input_tag = new HTMLTags_Input(); $full_size_image_file_input_tag_name = 'display_photograph_file[]'; $full_size_image_file_input_tag->set_attribute_str('type', 'file'); $full_size_image_file_input_tag->set_attribute_str('id', $full_size_image_file_input_tag_name); $full_size_image_file_input_tag->set_attribute_str('name', $full_size_image_file_input_tag_name); $photograph_adding_form->add_input_tag($full_size_image_file_input_tag_name, $full_size_image_file_input_tag, 'Full Size File'); /* THE MEDIUM SIZE IMAGE UPLOAD */ $medium_size_image_file_input_tag = new HTMLTags_Input(); $medium_size_image_file_input_tag_name = 'medium_photograph_file[]'; $medium_size_image_file_input_tag->set_attribute_str('type', 'file'); $medium_size_image_file_input_tag->set_attribute_str('id', $medium_size_image_file_input_tag_name); $medium_size_image_file_input_tag->set_attribute_str('name', $medium_size_image_file_input_tag_name); $photograph_adding_form->add_input_tag($medium_size_image_file_input_tag_name, $medium_size_image_file_input_tag, 'Medium Size File'); /* THE THUMBNAIL IMAGE UPLOAD */ $thumbnail_image_file_input_tag = new HTMLTags_Input(); $thumbnail_image_file_input_tag_name = 'thumbnail_photograph_file[]'; $thumbnail_image_file_input_tag->set_attribute_str('type', 'file'); $thumbnail_image_file_input_tag->set_attribute_str('id', $thumbnail_image_file_input_tag_name); $thumbnail_image_file_input_tag->set_attribute_str('name', $thumbnail_image_file_input_tag_name); $photograph_adding_form->add_input_tag($thumbnail_image_file_input_tag_name, $thumbnail_image_file_input_tag, 'Thumbnail File'); $photograph_adding_form->add_hidden_input('MAX_FILE_SIZE', '1000000'); /* * The add button. */ $photograph_adding_form->set_submit_text('Add'); $photograph_adding_form->set_cancel_location($cancel_location); return $photograph_adding_form; }
public function __construct($name, $value) { parent::__construct(); $this->set_attribute_str('type', 'hidden'); $this->set_attribute_str('name', $name); #echo __METHOD__ . PHP_EOL; exit; #$this->set_attribute_str('value', $value); $this->set_value($value); }
public function get_row_adding_form(HTMLTags_URL $row_adding_action, HTMLTags_URL $cancel_href) { $table = $this->get_element(); $row_adding_form = new HTMLTags_SimpleOLForm('files_adding'); $row_adding_form->set_attribute_str('enctype', 'multipart/form-data'); $row_adding_form->set_attribute_str('class', 'basic-form'); $file_input_tag = new HTMLTags_Input(); $file_input_tag_name = 'user_file[]'; $file_input_tag->set_attribute_str('type', 'file'); $file_input_tag->set_attribute_str('id', $file_input_tag_name); $file_input_tag->set_attribute_str('name', $file_input_tag_name); $row_adding_form->add_input_tag($file_input_tag_name, $file_input_tag, 'File'); $row_adding_form->add_hidden_input('MAX_FILE_SIZE', '1000000'); $row_adding_form->set_action($row_adding_action); $row_adding_form->set_legend_text('Add file.'); $row_adding_form->set_submit_text('Add'); $row_adding_form->set_cancel_location($cancel_href); return $row_adding_form; }
public function get_log_file_adding_form() { $log_file_adding_form = new HTMLTags_SimpleOLForm('csv_adding'); $log_file_adding_form->set_attribute_str('enctype', 'multipart/form-data'); $legend_text = 'Add a log file'; $log_file_adding_form->set_legend_text($legend_text); /* * THE FILE */ $file_input_tag = new HTMLTags_Input(); $file_input_tag_name = 'user_file[]'; $file_input_tag->set_attribute_str('type', 'file'); $file_input_tag->set_attribute_str('id', $file_input_tag_name); $file_input_tag->set_attribute_str('name', $file_input_tag_name); $log_file_adding_form->add_input_tag($file_input_tag_name, $file_input_tag, 'File'); $log_file_adding_form->add_hidden_input('MAX_FILE_SIZE', '1000000'); $log_file_adding_form->set_submit_text('Add'); return $log_file_adding_form; }
public function get_form_input() { $field = $this->get_element(); $row_adding_form_input = new HTMLTags_Input(); $row_adding_form_input->set_attribute_str('type', 'text'); $row_adding_form_input->set_attribute_str('name', $field->get_name()); $row_adding_form_input->set_attribute_str('id', $field->get_name()); if ($field->has_default()) { $row_adding_form_input->set_attribute_str('value', $field->get_default()); } return $row_adding_form_input; }
private function get_status_radio_button_li($name) { $input_tag = new HTMLTags_Input(); $input_tag->set_attribute_str('type', 'radio'); $input_tag->set_attribute_str('name', 'status'); $input_tag->set_attribute_str('id', $name); $input_tag->set_attribute_str('value', $name); if ($this->drama->get_status() == $name) { $input_tag->set_attribute_str('checked', 'checked'); } $input_li = new HTMLTags_LI(); $input_li->append_tag_to_content($input_tag); $input_label = new HTMLTags_Label(ucfirst($name)); $input_label->set_attribute_str('for', $name); $input_label->set_attribute_str('class', 'radio'); $input_li->append_tag_to_content($input_label); return $input_li; }
public function get_product_brand_adding_form($product_brand_adding_action, $cancel_location) { // $mysql_user_factory = Database_MySQLUserFactory::get_instance(); // $mysql_user = $mysql_user_factory->get_for_this_project(); // $database = $mysql_user->get_database(); // $product_brands_table = $database->get_table('hpi_shop_product_brands'); $product_brands_table = $this->get_element(); $product_brand_adding_form = new HTMLTags_SimpleOLForm('product_brand_adding'); $product_brand_adding_form->set_attribute_str('enctype', 'multipart/form-data'); #$product_brand_adding_action->set_get_variable('table', $product_brands_table->get_name()); $product_brand_adding_form->set_action($product_brand_adding_action); $product_brand_adding_form->set_legend_text('Add a product_brand'); /* * The name */ $name_field = $product_brands_table->get_field('name'); $name_field_renderer = $name_field->get_renderer(); $input_tag = $name_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'name'); $product_brand_adding_form->add_input_tag('name', $input_tag); /* * The owner */ $owner_field = $product_brands_table->get_field('owner'); $owner_field_renderer = $owner_field->get_renderer(); $input_tag = $owner_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'owner'); $product_brand_adding_form->add_input_tag('owner', $input_tag); /* * The description */ $description_field = $product_brands_table->get_field('description'); $description_field_renderer = $description_field->get_renderer(); $input_tag = $description_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'description'); $product_brand_adding_form->add_input_tag('description', $input_tag); /* * The url */ $url_field = $product_brands_table->get_field('url'); $url_field_renderer = $url_field->get_renderer(); $input_tag = $url_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'url'); $product_brand_adding_form->add_input_tag('url', $input_tag); /* THE FULL SIZE IMAGE UPLOAD */ $full_size_image_file_input_tag = new HTMLTags_Input(); $full_size_image_file_input_tag_name = 'display_image_file[]'; $full_size_image_file_input_tag->set_attribute_str('type', 'file'); $full_size_image_file_input_tag->set_attribute_str('id', $full_size_image_file_input_tag_name); $full_size_image_file_input_tag->set_attribute_str('name', $full_size_image_file_input_tag_name); $product_brand_adding_form->add_input_tag($full_size_image_file_input_tag_name, $full_size_image_file_input_tag, 'Photograph File'); /* THE THUMBNAIL IMAGE UPLOAD */ $thumbnail_image_file_input_tag = new HTMLTags_Input(); $thumbnail_image_file_input_tag_name = 'thumbnail_image_file[]'; $thumbnail_image_file_input_tag->set_attribute_str('type', 'file'); $thumbnail_image_file_input_tag->set_attribute_str('id', $thumbnail_image_file_input_tag_name); $thumbnail_image_file_input_tag->set_attribute_str('name', $thumbnail_image_file_input_tag_name); $product_brand_adding_form->add_input_tag($thumbnail_image_file_input_tag_name, $thumbnail_image_file_input_tag, 'Thumbnail File'); $product_brand_adding_form->add_hidden_input('MAX_FILE_SIZE', '1000000'); /* * The add button. */ $product_brand_adding_form->set_submit_text('Add'); $product_brand_adding_form->set_cancel_location($cancel_location); return $product_brand_adding_form; }
$create_pw_f_p->append_str_to_content(' to create one.'); $content_div->append_tag_to_content($create_pw_f_p); } else { $mysql_user_factory = Database_MySQLUserFactory::get_instance(); $root_mysql_user = $mysql_user_factory->get_root_user_for_this_project(); if (!$root_mysql_user->has_password()) { $root_password_form = new HTMLTags_SimpleOLForm('root_password'); $r_p_f_action_url = new HTMLTags_URL(); $r_p_f_action_url->set_file('/admin/redirect-script.php'); $r_p_f_action_url->set_get_variable('module', 'database'); $r_p_f_action_url->set_get_variable('page', 'sign-in-as-root'); $root_password_form->set_action($r_p_f_action_url); $password_file = $root_mysql_user->get_password_file(); $root_password_form->set_legend_text('Root Password for ' . $password_file->get_host()); #$root_password_form->add_input_name('password'); $password_tag = new HTMLTags_Input(); $password_tag->set_attribute_str('type', 'password'); $password_tag->set_attribute_str('id', 'password'); $password_tag->set_attribute_str('name', 'password'); $root_password_form->add_input_tag('password', $password_tag, 'Password'); $root_password_form->set_submit_text('Sign In'); $root_password_form->set_cancel_location(new HTMLTags_URL('/admin/database/home.html')); $content_div->append_tag_to_content($root_password_form); } else { /* * Make sure that the root can log on to * the database set in the passwords file * using the password from the session variable. */ if (!$root_mysql_user->can_log_on()) { $root_mysql_user->clear_password();
$li_force_email = new HTMLTags_LI(); //<label for="force_email">Force email:</label> $label_force_email = new HTMLTags_Label('Force email: '); $label_force_email->set_attribute_str('for', 'force_email'); $li_force_email->append_tag_to_content($label_force_email); //<input // id="force_email" // name="force_email" // type="checkbox" ///> $input_force_email = new HTMLTags_Input(); $input_force_email->set_attribute_str('id', 'force_email'); $input_force_email->set_attribute_str('name', 'force_email'); $input_force_email->set_attribute_str('type', 'checkbox'); $li_force_email->append_tag_to_content($input_force_email); //<br> $ul_inputs->append_tag_to_content($li_force_email); } $form_email_adding->append_tag_to_content($ul_inputs); $li_submit = new HTMLTags_LI(); # <input class="submit" type="submit" name="Submit" value="Submit"> $input_submit = new HTMLTags_Input(); $input_submit->set_attribute_str('id', 'submit'); $input_submit->set_attribute_str('name', 'submit'); $input_submit->set_attribute_str('class', 'submit'); $input_submit->set_attribute_str('type', 'submit'); $input_submit->set_attribute_str('value', 'Submit'); $li_submit->append_tag_to_content($input_submit); $ul_inputs->append_tag_to_content($li_submit); //</form> echo $form_email_adding->get_as_string();
private function get_enter_plu_code_form() { $enter_plu_code_form = new HTMLTags_Form(); $enter_plu_code_form->set_attribute_str('name', 'enter_plu_code'); $enter_plu_code_form->set_attribute_str('method', 'GET'); $enter_plu_code_form->set_attribute_str('class', 'table-select-form'); $enter_plu_code_form->set_action(new HTMLTags_URL('/')); $inputs_ol = new HTMLTags_OL(); /* * Select whether you want all products or just those with status==display */ $li = new HTMLTags_LI(); $label = new HTMLTags_Label('PLU Code'); $label->set_attribute_str('for', 'plu_code'); $li->append_tag_to_content($label); $input = new HTMLTags_Input(); $input->set_attribute_str('name', 'plu_code'); $li->append($input); $inputs_ol->append($li); /* * The submit button. */ $go_button_li = new HTMLTags_LI(); $go_button = new HTMLTags_Input(); $go_button->set_attribute_str('type', 'submit'); $go_button->set_attribute_str('value', 'Go'); $go_button->set_attribute_str('class', 'submit'); $go_button_li->append_tag_to_content($go_button); $inputs_ol->add_li($go_button_li); $enter_plu_code_form->append($inputs_ol); /* * The hidden inputs. */ $current_page_url = $this->get_current_page_url(); $enter_plu_code_action = clone $current_page_url; $enter_plu_code_action_get_vars = $enter_plu_code_action->get_get_variables(); foreach (array_keys($enter_plu_code_action_get_vars) as $key) { $form_hidden_input = new HTMLTags_Input(); $form_hidden_input->set_attribute_str('type', 'hidden'); $form_hidden_input->set_attribute_str('name', $key); $form_hidden_input->set_attribute_str('value', $enter_plu_code_action_get_vars[$key]); $enter_plu_code_form->append_tag_to_content($form_hidden_input); } return $enter_plu_code_form; }
protected function get_cancel_button() { $cancel_button = new HTMLTags_Input(); $cancel_location = $this->get_cancel_location(); $onclick = 'document.location.href=(\''; $onclick .= $cancel_location->get_as_string(); $onclick .= "')"; $cancel_button->set_attribute_str('type', 'button'); $cancel_button->set_attribute_str('value', $this->get_cancel_text()); $cancel_button->set_attribute_str('onclick', $onclick); $cancel_button->set_attribute_str('class', 'submit'); return $cancel_button; }
public function get_log_in_form(HTMLTags_URL $form_location, HTMLTags_URL $redirect_script_location, HTMLTags_URL $desired_location, HTMLTags_URL $cancel_page_location) { $log_in_form = new HTMLTags_SimpleOLForm('create_new_account'); $log_in_form->set_attribute_str('id', $this->get_login_form_id()); $log_in_form->set_attribute_str('class', $this->get_login_form_css_class()); $svm = Caching_SessionVarManager::get_instance(); /* * The action. */ $log_in_script_location = clone $redirect_script_location; $log_in_script_location->set_get_variable('log_in'); $log_in_script_location->set_get_variable('desired_location', urlencode($desired_location->get_as_string())); $log_in_script_location->set_get_variable('form_location', urlencode($form_location->get_as_string())); $log_in_form->set_action($log_in_script_location); $log_in_form->set_legend_text('Log In'); /* * The input tags. */ if ($svm->is_set('log-in: email')) { $log_in_form->add_input_name_with_value('email', $svm->get('log-in: email')); } else { $log_in_form->add_input_name('email'); } $password_input = new HTMLTags_Input(); $password_input->set_attribute_str('type', 'password'); $password_input->set_attribute_str('id', 'password'); $password_input->set_attribute_str('name', 'password'); $log_in_form->add_input_tag('password', $password_input); /* * The submit button. */ $log_in_form->set_submit_text('Log In'); /* * The cancel button */ $cancel_location = clone $redirect_script_location; $cancel_location->set_get_variable('cancel'); $cancel_location->set_get_variable('cancel_page_location', urlencode($cancel_page_location->get_as_string())); $log_in_form->set_cancel_location($cancel_location); return $log_in_form; }
$query_label->set_attribute_str('for', 'query'); $query_li->append_tag_to_content($query_label); $query_input = new HTMLTags_TextArea(); $query_input->set_attribute_str('id', 'query'); $query_input->set_attribute_str('name', 'query'); if (isset($_GET['query'])) { $query_input->append_str_to_content(stripcslashes($_GET['query'])); } $query_input->set_attribute_str('cols', 72); $query_input->set_attribute_str('rows', 15); $query_li->append_tag_to_content($query_input); $form_ul->add_li($query_li); /* * The submit button. */ $submit_button = new HTMLTags_Input(); $submit_button->set_attribute_str('type', 'submit'); $submit_button->set_attribute_str('value', 'GO'); $submit_button->set_attribute_str('class', 'submit'); $form_ul->add_tag_in_new_li($submit_button); $query_form->append_tag_to_content($form_ul); $content_div->append_tag_to_content($query_form); /* * Get the data. */ if (isset($_GET['query'])) { $query = stripcslashes($_GET['query']); if (strlen($query) == 0) { $p = new HTMLTags_P('Try typing a SELECT statement.'); $content_div->append_tag_to_content($p); } elseif (preg_match('/^(?:\\s*\\()*\\s*(?:(?:EXPLAIN\\s*)?SELECT|SHOW)\\s/i', $query)) {
/* * The hidden inputs. */ $order_status_selecting_action_get_vars = $order_status_selecting_action->get_get_variables(); foreach (array_keys($order_status_selecting_action_get_vars) as $key) { $form_hidden_input = new HTMLTags_Input(); $form_hidden_input->set_attribute_str('type', 'hidden'); $form_hidden_input->set_attribute_str('name', $key); $form_hidden_input->set_attribute_str('value', $order_status_selecting_action_get_vars[$key]); $order_status_selecting_form->append_tag_to_content($form_hidden_input); } /* * The submit button. */ $go_button_li = new HTMLTags_LI(); $go_button = new HTMLTags_Input(); $go_button->set_attribute_str('type', 'submit'); $go_button->set_attribute_str('value', 'Go'); $go_button->set_attribute_str('class', 'submit'); $go_button_li->append_tag_to_content($go_button); $inputs_ol->add_li($go_button_li); $order_status_selecting_form->append_tag_to_content($inputs_ol); $content_div->append_tag_to_content($order_status_selecting_form); #################################################################### # # Display some of the data in the table. # #################################################################### /* * DIV for limits and previous and nexts. */
public function get_checkout_shipping_location_choice_for_current_session_div(HTMLTags_URL $action) { // $locations = $this->get_shipping_locations(); // $shipping_location_div = new HTMLTags_Div(); // $location_form = new HTMLTags_Form(); // $location_form->set_attribute_str('name', 'shipping_location'); // $location_form->set_action($action); // $location_form->set_attribute_str('method', 'POST'); // $select = new HTMLTags_Select(); // $select->set_attribute_str('name', 'shipping_location'); // foreach ($locations as $location) { // $option = new HTMLTags_Option($location['text']); // $option->set_attribute_str('value', $location['title']); // $select->add_option($option); // } // Set Default Select // if ($shipping_location == '') // { // $select->set_value('uk'); // } // else // { // $select->set_value($shipping_location); // } // $location_form->append_tag_to_content($select); // $submit = new HTMLTags_Input(); // $submit->set_attribute_str('type', 'submit'); // $submit->set_attribute_str('value', 'Go'); // $location_form->append_tag_to_content($submit); // $shipping_location_div->append_tag_to_content($location_form); // return $shipping_location_div; $shopping_baskets_table = $this->get_element(); $database = $shopping_baskets_table->get_database(); $customer_regions_table = $database->get_table('hpi_shop_customer_regions'); $customer_regions = $customer_regions_table->get_all_rows('sort_order', 'ASC'); $customer_regions_div = new HTMLTags_Div(); $location_form = new HTMLTags_Form(); $location_form->set_attribute_str('name', 'shipping_location'); $location_form->set_action($action); $location_form->set_attribute_str('method', 'POST'); $select = new HTMLTags_Select(); $select->set_attribute_str('name', 'customer_region'); foreach ($customer_regions as $customer_region) { $option = new HTMLTags_Option($customer_region->get_name()); $option->set_attribute_str('value', $customer_region->get_id()); $select->add_option($option); } if (isset($_SESSION['customer_region_id'])) { $select->set_value($_SESSION['customer_region_id']); } $location_form->append_tag_to_content($select); $submit = new HTMLTags_Input(); $submit->set_attribute_str('type', 'submit'); $submit->set_attribute_str('value', 'Change'); $location_form->append_tag_to_content($submit); $customer_regions_div->append_tag_to_content($location_form); if (isset($_SESSION['customer_region_id'])) { $selected_customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']); $customer_region_description_div = new HTMLTags_P($selected_customer_region->get_description()); $customer_regions_div->append_tag_to_content($customer_region_description_div); } return $customer_regions_div; }
public static function render_body_form_add_email() { $form_email_adding = new HTMLTags_Form(); /* * Form altered by RFI 2007-07-13 */ #$form_action = new HTMLTags_URL(); # #$form_action->set_file('/'); # #$form_action->set_get_variable('section', 'plug-ins'); #$form_action->set_get_variable('module', 'mailing-list'); #$form_action->set_get_variable('page', 'sign-up'); #$form_action->set_get_variable('type', 'redirect-script'); #$form_action->set_get_variable('add_person'); #$form_action->set_get_variable('return_to', urlencode('/?section=project-specific&page=sign-up')); $form_action = MailingList_SignUpURLFactory::get_email_adding_redirect_script(); #echo 'action="' . $form_action->get_as_string() . "\"\n"; $form_email_adding->set_action($form_action); $form_email_adding->set_attribute_str('method', 'POST'); // method="POST" //> $ul_inputs = new HTMLTags_UL(); $li_name = new HTMLTags_LI(); // <label for="name">Name:</label> $label_name = new HTMLTags_Label('Name: '); $label_name->set_attribute_str('for', 'name'); $li_name->append_tag_to_content($label_name); // <input class="name" name="name" type="text" id="name" value=" $input_name = new HTMLTags_Input(); $input_name->set_attribute_str('id', 'name'); $input_name->set_attribute_str('name', 'name'); $input_name->set_attribute_str('type', 'text'); // if ($_SESSION['name']) { // echo $_SESSION['name']; // } $input_name->set_attribute_str('value', isset($_SESSION['name']) ? $_SESSION['name'] : ''); //" size="17" /> #$input_name->set_attribute_str('size', 17); // <br /> $li_name->append_tag_to_content($input_name); $ul_inputs->add_li($li_name); // $li_email = new HTMLTags_LI(); // <label for="name">Email:</label> $label_email = new HTMLTags_Label('Email: '); $label_email->set_attribute_str('for', 'email'); $li_email->append_tag_to_content($label_email); // <input class="email" name="email" type="text" id="name" value=" $input_email = new HTMLTags_Input(); $input_email->set_attribute_str('id', 'email'); $input_email->set_attribute_str('name', 'email'); $input_email->set_attribute_str('type', 'text'); // if ($_SESSION['email']) { // echo $_SESSION['email']; // } $input_email->set_attribute_str('value', isset($_SESSION['email']) ? $_SESSION['email'] : ''); //" size="17" /> #$input_email->set_attribute_str('size', 17); // <br> $li_email->append_tag_to_content($input_email); $ul_inputs->append_tag_to_content($li_email); if (isset($_GET['email_incorrect'])) { $li_force_email = new HTMLTags_LI(); //<label for="force_email">Force email:</label> $label_force_email = new HTMLTags_Label('Force email: '); $label_force_email->set_attribute_str('for', 'force_email'); $li_force_email->append_tag_to_content($label_force_email); //<input // id="force_email" // name="force_email" // type="checkbox" ///> $input_force_email = new HTMLTags_Input(); $input_force_email->set_attribute_str('id', 'force_email'); $input_force_email->set_attribute_str('name', 'force_email'); $input_force_email->set_attribute_str('type', 'checkbox'); $li_force_email->append_tag_to_content($input_force_email); //<br> $ul_inputs->append_tag_to_content($li_force_email); } $form_email_adding->append_tag_to_content($ul_inputs); $li_submit = new HTMLTags_LI(); # <input class="submit" type="submit" name="Submit" value="Submit"> $input_submit = new HTMLTags_Input(); $input_submit->set_attribute_str('id', 'submit'); $input_submit->set_attribute_str('name', 'submit'); $input_submit->set_attribute_str('class', 'submit'); $input_submit->set_attribute_str('type', 'submit'); $input_submit->set_attribute_str('value', 'Submit'); $li_submit->append_tag_to_content($input_submit); $ul_inputs->append_tag_to_content($li_submit); //</form> echo $form_email_adding->get_as_string(); }
public function get_login_form_div($name = NULL) { $login_form_div = new HTMLTags_Div(); $login_form = new HTMLTags_SimpleOLForm('login'); $login_form->set_attribute_str('class', $this->get_login_form_css_class()); $login_form->set_attribute_str('id', $this->get_login_form_id()); $login_form->set_action($this->get_login_script_url()); $login_form->set_legend_text($this->get_login_form_legend_text()); if ($name == NULL) { $login_form->add_input_name($this->get_login_name_field_name()); } else { $login_form->add_input_name_with_value($this->get_login_name_field_name(), $name); } $password_input = new HTMLTags_Input(); $password_input->set_attribute_str('name', 'password'); $password_input->set_attribute_str('type', 'password'); $login_form->add_input_tag('password', $password_input); $login_form->set_submit_text('Login'); $login_form->set_cancel_location($this->get_login_cancel_url()); $login_form_div->append_tag_to_content($login_form); return $login_form_div; }
/** * Allows the customer to search for products by reducing the search * criteria using select drop-downs. * * Used in: * - The secondary navigation div. * * Changes: * - RFI 2007-12-13 * Instead of going to separate pages for product categories and tags, * the customer is taken to the products page where the selection criteria * for products is constrained appropriately. */ public function get_public_tag_selection_div() { $product_tag = $this->get_element(); $tag = $product_tag->get_tag(); $div = new HTMLTags_Div(); $div->set_attribute_str('id', $tag); $div->set_attribute_str('class', 'tag-selection'); $heading = new HTMLTags_Heading(3, ucfirst($tag)); $tag_link_href = new HTMLTags_URL(); $tag_link_file = '/?section=plug-ins&module=shop&page=products&type=html&tag=' . $tag; $tag_link_href->set_file($tag_link_file); $tag_link = new HTMLTags_A(); $tag_link->set_href($tag_link_href); $tag_link->append_tag_to_content($heading); $div->append_tag_to_content($tag_link); /* * Brand Select Form */ $brand_form = new MashShop_TagSelectionForm(); $brand_form->set_attribute_str('id', 'brand'); #$brand_form->add_hidden_input('section', 'plug-ins'); #$brand_form->add_hidden_input('module', 'shop'); #$brand_form->add_hidden_input('page', 'product-brand'); #$brand_form->add_hidden_input('type', 'html'); $brand_form = self::add_hidden_inputs_for_results_page_get_vars_to_tag_selection_form($brand_form); $brand_form->add_hidden_input('tag', $tag); $brand_action = new HTMLTags_URL(); $brand_action->set_file('/'); $brand_form->set_action($brand_action); $brand_form->set_attribute_str('name', 'brand'); $brand_form->set_attribute_str('method', 'GET'); $form_ul = new HTMLTags_UL(); $brand_li = new HTMLTags_LI(); $brand_label = new HTMLTags_Label('Brands:'); $brand_label->set_attribute_str('for', 'product_brand_id'); $brand_li->append_tag_to_content($brand_label); $brand_select_box = $this->get_brand_select(); $brand_li->append_tag_to_content($brand_select_box); $form_ul->append_tag_to_content($brand_li); $submit_button = new HTMLTags_Input(); $submit_button->set_attribute_str('type', 'submit'); $submit_button->set_attribute_str('value', 'Go'); $submit_button->set_attribute_str('class', 'submit'); $submit_li = new HTMLTags_LI(); $submit_li->append_tag_to_content($submit_button); $form_ul->append_tag_to_content($submit_li); $brand_form->append_tag_to_content($form_ul); $div->append_tag_to_content($brand_form); $clear_div = new HTMLTags_Div(); $clear_div->set_attribute_str('style', 'clear:both;'); $div->append_tag_to_content($clear_div); /* * category Select Form */ $category_form = new MashShop_TagSelectionForm(); $category_form->set_attribute_str('id', 'category'); #$category_form->add_hidden_input('section', 'plug-ins'); #$category_form->add_hidden_input('module', 'shop'); #$category_form->add_hidden_input('page', 'product-category'); #$category_form->add_hidden_input('type', 'html'); $category_form = self::add_hidden_inputs_for_results_page_get_vars_to_tag_selection_form($category_form); $category_form->add_hidden_input('tag', $tag); $category_action = new HTMLTags_URL(); $category_action->set_file('/'); $category_form->set_action($category_action); $category_form->set_attribute_str('name', 'category'); $category_form->set_attribute_str('method', 'GET'); $form_ul = new HTMLTags_UL(); $category_li = new HTMLTags_LI(); $category_label = new HTMLTags_Label('Products:'); $category_label->set_attribute_str('for', 'product_category_id'); $category_li->append_tag_to_content($category_label); $category_select_box = $this->get_category_select(); $category_li->append_tag_to_content($category_select_box); $form_ul->append_tag_to_content($category_li); $submit_button = new HTMLTags_Input(); $submit_button->set_attribute_str('type', 'submit'); $submit_button->set_attribute_str('value', 'Go'); $submit_button->set_attribute_str('class', 'submit'); $submit_li = new HTMLTags_LI(); $submit_li->append_tag_to_content($submit_button); $form_ul->append_tag_to_content($submit_li); $category_form->append_tag_to_content($form_ul); $div->append_tag_to_content($category_form); $div->append_tag_to_content($clear_div); return $div; }
if ($field_renderer_class_file->equals($current_field_renderer_class_file)) { $option->set_attribute_str('selected'); } $field_renderer_select->add_option($option); } $field_renderer_li->append_tag_to_content($field_renderer_select); $table_fields_list->add_li($field_renderer_li); } $table_li->append_tag_to_content($table_fields_list); $field_renderers_list->append_tag_to_content($table_li); } $d_c_n_c_field_set->append_tag_to_content($field_renderers_list); } /* * ------------------------------------------------------------------------- */ $d_c_n_c_form->append_tag_to_content($d_c_n_c_field_set); $commit_button = new HTMLTags_Input(); $commit_button->set_attribute_str('type', 'submit'); $commit_button->set_attribute_str('value', 'Commit'); $commit_button->set_attribute_str('class', 'submit'); $d_c_n_c_form->append_tag_to_content($commit_button); $cancel_button = new HTMLTags_Input(); $cancel_button->set_attribute_str('type', 'button'); $cancel_button->set_attribute_str('onclick', "document.location.href=('/admin/database/home.html')"); $cancel_button->set_attribute_str('value', 'Cancel'); $cancel_button->set_attribute_str('class', 'submit'); $d_c_n_c_form->append_tag_to_content($cancel_button); $content_div->append_tag_to_content($d_c_n_c_form); } echo $content_div;
public function get_extra_photograph_form_checkbox_li() { $input_li = new HTMLTags_LI(); $input_label = new HTMLTags_Label('Extra Photographs'); $input_label->set_attribute_str('for', 'extra_photograph_id'); $input_li->append_tag_to_content($input_label); $products_table = $this->get_element(); $database = $products_table->get_database(); $photographs_table = $database->get_table('hpi_shop_photographs'); $photographs = $photographs_table->get_all_rows(); foreach ($photographs as $photograph) { $photograph_renderer = $photograph->get_renderer(); $input = new HTMLTags_Input(); $input->set_attribute_str('type', 'checkbox'); $input->set_attribute_str('name', 'extra_photograph_id_' . $photograph->get_id()); $input->set_value($photograph->get_id()); $input_li->append_tag_to_content($input); $input_li->append_tag_to_content($photograph_renderer->get_thumbnail_img()); } $input_msg_box = new HTMLTags_Span(); $input_msg_box->set_attribute_str('id', 'extra_photograph_id' . 'msg'); $input_msg_box->set_attribute_str('class', 'rules'); $input_li->append_tag_to_content($input_msg_box); return $input_li; }
public function get_add_new_user_form() { $add_new_user_form = new HTMLTags_SimpleOLForm('add_new_user'); $redirect_script = Admin_AdminIncluderURLFactory::get_url('haddock', 'admin', 'manage-users', 'redirect-script'); $action_href = clone $redirect_script; $action_href->set_get_variable('add-new-user'); $add_new_user_form->set_action($action_href); $add_new_user_form->set_legend_text('Add new user'); /* * The user's name */ $svm = Caching_SessionVarManager::get_instance(); if ($svm->is_set('manage-users-form: name')) { $add_new_user_form->add_input_name_with_value('name', $svm->get('manage-users-form: name')); } else { $add_new_user_form->add_input_name('name'); } /* * The user's password. */ $password_input = new HTMLTags_Input(); $password_input->set_attribute_str('type', 'password'); $password_input->set_attribute_str('id', 'password'); $password_input->set_attribute_str('name', 'password'); $add_new_user_form->add_input_tag('password', $password_input); $password_confirm_input = new HTMLTags_Input(); $password_confirm_input->set_attribute_str('type', 'password'); $password_confirm_input->set_attribute_str('id', 'confirm_password'); $password_confirm_input->set_attribute_str('name', 'confirm_password'); $add_new_user_form->add_input_tag('confirm_password', $password_confirm_input); /* * The type of admin user. */ $login_manager = Admin_LoginManager::get_instance(); $user_types = $login_manager->get_user_types(); $user_types_select = HTMLTags_SelectFactory::make_select_for_str_array($user_types); $user_types_select->set_attribute_str('id', 'type'); $user_types_select->set_attribute_str('name', 'type'); if ($svm->is_set('manage-users-form: type')) { $user_types_select->set_value($svm->get('manage-users-form: type')); } $add_new_user_form->add_input_tag('type', $user_types_select); /* * The user's real name */ if ($svm->is_set('manage-users-form: real_name')) { $add_new_user_form->add_input_name_with_value('real_name', $svm->get('manage-users-form: real_name')); } else { $add_new_user_form->add_input_name('real_name'); } /* * The user's email */ if ($svm->is_set('manage-users-form: email')) { $add_new_user_form->add_input_name_with_value('email', $svm->get('manage-users-form: email')); } else { $add_new_user_form->add_input_name('email'); } $add_new_user_form->set_submit_text('Add'); $cancel_href = clone $redirect_script; $cancel_href->set_get_variable('cancel'); $add_new_user_form->set_cancel_location($cancel_href); return $add_new_user_form; }
public function get_simplified_customer_and_address_adding_form(HTMLTags_URL $redirect_script_url, HTMLTags_URL $cancel_url) { /* form should just have name, email one address box and postcode, country name already filled in */ $customers_table = $this->get_element(); $database = $customers_table->get_database(); //$email_addresses_table = $database->get_table('hpi_shop_email_addresses'); $telephone_numbers_table = $database->get_table('hpi_shop_telephone_numbers'); $addresses_table = $database->get_table('hpi_shop_addresses'); $customer_adding_form = new HTMLTags_Form('customer_adding'); $customer_adding_form->set_attribute_str('class', 'cmxform'); $customer_adding_form->set_attribute_str('id', 'customer-details-form'); $customer_adding_form->set_action($redirect_script_url); #$customer_adding_form = new HTMLTags_TagContent(); # # The Log In Details field set. # $log_in_details_field_set = new HTMLTags_FieldSet(); $log_in_details_field_set->append_tag_to_content(new HTMLTags_Legend('Log In Details')); $log_in_details_field_set_inputs_list = new HTMLTags_OL(); /* * The email_address */ $email_address_field = $customers_table->get_field('email_address'); $email_address_field_renderer = $email_address_field->get_renderer(); $input_tag = $email_address_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'email_address'); $email_address_li = $this->get_form_li('email_address', $input_tag); $log_in_details_field_set_inputs_list->append_tag_to_content($email_address_li); /* * The password */ $password_field = $customers_table->get_field('password'); $password_field_renderer = $password_field->get_renderer(); $input_tag = $password_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'password'); $password_li = $this->get_form_li('password', $input_tag); $log_in_details_field_set_inputs_list->append_tag_to_content($password_li); $log_in_details_field_set->append_tag_to_content($log_in_details_field_set_inputs_list); $customer_adding_form->append_tag_to_content($log_in_details_field_set); # # The Customer field set. # $customer_details_field_set = new HTMLTags_FieldSet(); $customer_details_field_set->append_tag_to_content(new HTMLTags_Legend('Shipping Details')); $customer_details_field_set_inputs_list = new HTMLTags_OL(); /* * The first_name */ $first_name_field = $customers_table->get_field('first_name'); $first_name_field_renderer = $first_name_field->get_renderer(); $input_tag = $first_name_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'first_name'); $first_name_li = $this->get_form_li('first_name', $input_tag); $customer_details_field_set_inputs_list->append_tag_to_content($first_name_li); /* * The last_name */ $last_name_field = $customers_table->get_field('last_name'); $last_name_field_renderer = $last_name_field->get_renderer(); $input_tag = $last_name_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'last_name'); $last_name_li = $this->get_form_li('last_name', $input_tag); $customer_details_field_set_inputs_list->append_tag_to_content($last_name_li); /* * The telephone_number */ $telephone_number_field = $telephone_numbers_table->get_field('telephone_number'); $telephone_number_field_renderer = $telephone_number_field->get_renderer(); $input_tag = $telephone_number_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'telephone_number'); $telephone_number_li = $this->get_form_li('telephone_number', $input_tag); $customer_details_field_set_inputs_list->append_tag_to_content($telephone_number_li); /* * The full_address * which will be put straight into street_address * * in add_simplified_customer() */ $address_li = $this->get_address_form_input_li(); $customer_details_field_set_inputs_list->append_tag_to_content($address_li); /* * The address_postal_code */ $address_field = $addresses_table->get_field('postal_code'); $address_field_renderer = $address_field->get_renderer(); $input_tag = $address_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'postal_code'); $address_postal_code_li = $this->get_form_li('postal_code', $input_tag); $customer_details_field_set_inputs_list->append_tag_to_content($address_postal_code_li); /* * The address_country_name */ $address_field = $addresses_table->get_field('country_name'); $address_field_renderer = $address_field->get_renderer(); $input_tag = $address_field_renderer->get_form_input(); $input_tag->set_attribute_str('id', 'country_name'); if (isset($_SESSION['customer_region_id'])) { $customer_regions_table = $database->get_table('hpi_shop_customer_regions'); $customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']); $input_tag->set_attribute_str('value', $customer_region->get_name()); } $address_country_name_li = $this->get_form_li('country_name', $input_tag); $customer_details_field_set_inputs_list->append_tag_to_content($address_country_name_li); $customer_details_field_set->append_tag_to_content($customer_details_field_set_inputs_list); $customer_adding_form->append_tag_to_content($customer_details_field_set); # # SUBMIT BUTTON # $submit_button = new HTMLTags_Input(); $submit_button->set_attribute_str('type', 'submit'); $submit_button->set_attribute_str('value', 'Add'); $submit_button->set_attribute_str('class', 'submit'); $submit_buttons_div = new HTMLTags_Div(); $submit_buttons_div->set_attribute_str('class', 'submit_buttons_div'); $submit_buttons_div->append_tag_to_content($submit_button); $cancel_button = new HTMLTags_Input(); $onclick = 'document.location.href=(\''; $onclick .= $cancel_url->get_as_string(); $onclick .= "')"; $cancel_button->set_attribute_str('type', 'button'); $cancel_button->set_attribute_str('value', 'Cancel'); $cancel_button->set_attribute_str('onclick', $onclick); $cancel_button->set_attribute_str('class', 'submit'); $submit_buttons_div->append_tag_to_content($cancel_button); $customer_adding_form->append_tag_to_content($submit_buttons_div); # The Fields: // $last_added_id = $customers_table->add_simplified_customer( // $_POST['full_name'], // $_POST['password'], // $_POST['email_address'], // $_POST['telephone_number'], // $_POST['full_address'], // $_POST['postal_code'], // $_POST['country_name'], // $_POST['customer_region_id'] // ) return $customer_adding_form; }
################################################################################# $protx_form_div = new HTMLTags_Div(); $protx_form_div->set_attribute_str('id', 'paypal_form_div'); $protx_form = new HTMLTags_Form(); $protx_form_action = new HTMLTags_URL(); //$protx_form_action->set_file('https://ukvps.protx.com/vspgateway/service/vspform-register.vsp'); # The real thing //$protx_form_action->set_file('https://ukvpstest.protx.com/vspgateway/service/vspform-register.vsp'); # The sandbox $protx_form_action->set_file($strPurchaseURL); # The URL set above $protx_form->set_action($protx_form_action); $protx_form->set_attribute_str('method', 'POST'); $protx_form->add_hidden_input('VPSProtocol', '2.22'); $protx_form->add_hidden_input('TxType', $strTransactionType); $protx_form->add_hidden_input('Vendor', $strVSPVendorName); $protx_form->add_hidden_input('Crypt', $strCrypt); $protx_submit_input = new HTMLTags_Input(); $protx_submit_input->set_attribute_str('type', 'submit'); $protx_submit_input->set_attribute_str('value', 'Go to Secure Server'); $protx_form->append_tag_to_content($protx_submit_input); foreach ($protx_form->get_hidden_inputs() as $hidden_input) { $protx_form->append_tag_to_content($hidden_input); } $protx_form_div->append_tag_to_content($protx_form); /* * Example of ProTx Form */ //<form // action="https://ukvpstest.protx.com/vspgateway/service/vspform-register.vsp" // method="POST" id="VSPForm" name="VSPForm" // > // <input type="hidden" name="VPSProtocol" value="2.22">
public function get_supplier_shipping_price_editing_form($supplier_id, $product_category_id, $redirect_script_url, $cancel_href) { $supplier_shipping_prices_table = $this->get_element(); $database = $supplier_shipping_prices_table->get_database(); $customer_regions_table = $database->get_table('hpi_shop_customer_regions'); $suppliers_table = $database->get_table('hpi_shop_suppliers'); $supplier = $suppliers_table->get_row_by_id($supplier_id); $product_categories_table = $database->get_table('hpi_shop_product_categories'); $product_category = $product_categories_table->get_row_by_id($product_category_id); $supplier_shipping_price_editing_form = new HTMLTags_SimpleOLForm('supplier_shipping_price_editing'); $supplier_shipping_price_editing_form->set_action($redirect_script_url); $legend_text = ''; $legend_text .= 'Edit '; $legend_text .= $supplier->get_name(); $legend_text .= "'s shipping prices for "; $legend_text .= $product_category->get_name(); $supplier_shipping_price_editing_form->set_legend_text($legend_text); $customer_regions = $customer_regions_table->get_all_rows(); foreach ($customer_regions as $customer_region) { $price_id = $customer_region->get_id(); $conditions = array(); $conditions['customer_region_id'] = $customer_region->get_id(); $conditions['product_category_id'] = $product_category_id; $conditions['supplier_id'] = $supplier_id; $supplier_shipping_prices = $supplier_shipping_prices_table->get_rows_where($conditions); if (count($supplier_shipping_prices) > 0) { $current_first_price = $supplier_shipping_prices[0]->get_first_price(); $current_additional_price = $supplier_shipping_prices[0]->get_additional_price(); } else { $current_first_price = 0; $current_additional_price = 0; } /* * The first_price */ $input_li = new HTMLTags_LI(); $currency = $customer_region->get_currency(); $input_label_text = ''; $input_label_text .= 'Price of first item to '; $input_label_text .= $customer_region->get_name(); $input_label_text .= ' ('; $input_label_text .= $currency->get_symbol(); $input_label_text .= ')'; $input_label_title = 'first_price_'; $input_label_title .= $customer_region->get_id(); $input_label = new HTMLTags_Label($input_label_text); $input_label->set_attribute_str('for', $input_label_title); $input_li->append_tag_to_content($input_label); $input = new HTMLTags_Input(); $input->set_attribute_str('type', 'text'); $input->set_attribute_str('name', $input_label_title); $input->set_value($current_first_price); $input_li->append_tag_to_content($input); $supplier_shipping_price_editing_form->add_input_li($input_li); /* * The additional_price */ $input_li = new HTMLTags_LI(); $currency = $customer_region->get_currency(); $input_label_text = ''; $input_label_text .= 'Price of each additional item to '; $input_label_text .= $customer_region->get_name(); $input_label_text .= ' ('; $input_label_text .= $currency->get_symbol(); $input_label_text .= ')'; $input_label_title = 'additional_price_'; $input_label_title .= $customer_region->get_id(); $input_label = new HTMLTags_Label($input_label_text); $input_label->set_attribute_str('for', $input_label_title); $input_li->append_tag_to_content($input_label); $input = new HTMLTags_Input(); $input->set_attribute_str('type', 'text'); $input->set_attribute_str('name', $input_label_title); $input->set_value($current_additional_price); $input_li->append_tag_to_content($input); $supplier_shipping_price_editing_form->add_input_li($input_li); } /* * The add button. */ $supplier_shipping_price_editing_form->set_submit_text('Edit'); $supplier_shipping_price_editing_form->set_cancel_location($cancel_href); return $supplier_shipping_price_editing_form; }
// shipping 2 $shipping2_price = new Shop_SumOfMoney($product->get_additional_shipping_price_for_current_session(), $currency); $paypal_form->add_hidden_input('shipping2_' . $i, $shipping2_price->get_as_string(FALSE)); $i++; } // Address Override $customer = $log_in_manager->get_user(); $address = $customer->get_address(); $paypal_form->add_hidden_input('address_override', '1'); $paypal_form->add_hidden_input('first_name', $customer->get_first_name()); $paypal_form->add_hidden_input('last_name', $customer->get_last_name()); $paypal_form->add_hidden_input('address1', $address->get_street_address()); $paypal_form->add_hidden_input('city', $address->get_locality()); $paypal_form->add_hidden_input('zip', $address->get_postal_code()); $paypal_form->add_hidden_input('country', $address->get_country_name()); $paypal_submit_input = new HTMLTags_Input(); $paypal_submit_input->set_attribute_str('type', 'submit'); $paypal_submit_input->set_attribute_str('value', 'Go to PayPal'); $paypal_form->append_tag_to_content($paypal_submit_input); foreach ($paypal_form->get_hidden_inputs() as $hidden_input) { $paypal_form->append_tag_to_content($hidden_input); } $paypal_form_div->append_tag_to_content($paypal_form); /* * Example of address override */ // <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> // <input type="hidden" name="cmd" value="_xclick"> // <input type="hidden" name="business" value="*****@*****.**"> // <input type="hidden" name="item_name" value="Memorex 256MB Memory Stick"> // <input type="hidden" name="item_number" value="MEM32507725">
public function get_embed_form() { $embed_form = new HTMLTags_Form(); $embed_form->set_attribute_str('name', 'embedForm'); $embed_form->set_attribute_str('id', 'embedForm'); $embed_label = new HTMLTags_Label('Embed Code:'); $embed_label->set_attribute_str('for', 'embed_code'); $embed_form->append_tag_to_content($embed_label); $embed_input = new HTMLTags_Input(); $embed_input->set_attribute_str('name', 'embed_code'); $embed_input->set_attribute_str('class', 'embedField'); $embed_input->set_attribute_str('value', $this->get_embed_code()); $embed_input->set_attribute_str('onclick', 'javascript:document.embedForm.embed_code.focus();document.embedForm.embed_code.select();'); $embed_input->set_attribute_str('readonly', 'true'); $embed_input->set_attribute_str('type', 'text'); $embed_form->append_tag_to_content($embed_input); return $embed_form; }
$email_input->set_attribute_str('value', $user->get_email_address()); $comment_adding_form->add_input_tag('', $email_input); } else { $comment_adding_form->add_input_name('email'); } /* * The comment input. */ $comment_field = $comments_table->get_field('comment'); $comment_field_renderer = $comment_field->get_renderer(); $comment_input_tag = $comment_field_renderer->get_form_input(); $comment_adding_form->add_input_tag('comment', $comment_input_tag); /* * Hidden product_id input */ $product_id_input = new HTMLTags_Input(); $product_id_input->set_attribute_str('type', 'hidden'); $product_id_input->set_attribute_str('name', 'product_id'); $product_id_input->set_attribute_str('value', $_GET['product_id']); $comment_adding_form->add_input_tag('', $product_id_input); #$comment_adding_form->add_input_name('url', 'URL'); # #$comment_adding_form->add_input_name('homepage_title'); /* * The add button. */ $comment_adding_form->set_submit_text('Add'); $comment_adding_form->set_cancel_location($cancel_location); $comment_form_div->append_tag_to_content($comment_adding_form); $comments_div->append_tag_to_content($comment_form_div); $content_div->append_tag_to_content($comments_div);
protected function get_submit_button() { $submit_button = new HTMLTags_Input(); $submit_button->set_attribute_str('type', 'submit'); $submit_button->set_attribute_str('value', $this->get_submit_text()); $submit_button->set_attribute_str('class', 'submit'); return $submit_button; }