public function get_input_lis() { $input_lis = array(); $visible_fields = $this->get_visible_fields(); foreach ($visible_fields as $visible_field) { if ($visible_field->get_name() != 'id') { $input_li = new HTMLTags_LI(); $l_t_l_o_ws = Formatting_ListOfWords::get_list_of_words_for_string($visible_field->get_name(), '_'); $label_text = $l_t_l_o_ws->get_words_as_capitalised_string(); $input_label = new HTMLTags_Label($label_text); $input_label->set_attribute_str('for', $visible_field->get_name()); #$input_label->set_attribute_str('id', $visible_field->get_name()); $input_li->append_tag_to_content($input_label); $field_renderer = $visible_field->get_renderer(); $input_tag = $field_renderer->get_form_input(); #print_r($visible_field); if ($visible_field->has_default()) { $input_tag->set_value($visible_field->get_default()); } $input_li->append_tag_to_content($input_tag); $input_lis[] = $input_li; } } return $input_lis; }
public function get_input_lis() { $input_lis = array(); $visible_fields = $this->get_visible_fields(); $row_renderer = $this->row->get_renderer(); foreach ($visible_fields as $visible_field) { $input_li = new HTMLTags_LI(); $l_t_l_o_ws = Formatting_ListOfWords::get_list_of_words_for_string($visible_field->get_name(), '_'); $label_text = $l_t_l_o_ws->get_words_as_capitalised_string(); $input_label = new HTMLTags_Label($label_text); $input_label->set_attribute_str('for', $visible_field->get_name()); #$input_label->set_attribute_str('id', $name); $input_li->append_tag_to_content($input_label); #$field_renderer = $visible_field->get_renderer(); # #$input_tag = $field_renderer->get_form_input(); # #echo '$visible_field->get_name(): ' . $visible_field->get_name() . "\n"; # #$input_tag->set_value( # $this->row->get($visible_field->get_name()) #); $input_tag = $row_renderer->get_input_tag_for_field($visible_field); $input_li->append_tag_to_content($input_tag); $input_lis[] = $input_li; } return $input_lis; }
public function add_input_tag($name, HTMLTags_InputTag $input_tag, $label_text = null, $post_content = '') { #echo "In HTMLTags_SimpleOLForm::add_input_tag(...)\n"; $input_li = new HTMLTags_LI(); if (!isset($label_text)) { $l_t_l_o_ws = Formatting_ListOfWords::get_list_of_words_for_string($name, '_'); $label_text = $l_t_l_o_ws->get_words_as_capitalised_string(); # echo "\$label_text: $label_text\n"; #} else { # echo "\$label_text: $label_text\n"; } #echo "After if\n"; $input_label = new HTMLTags_Label($label_text); $input_label->set_attribute_str('for', $name); #$input_label->set_attribute_str('id', $name); $input_li->append_tag_to_content($input_label); $input_li->append_tag_to_content($input_tag); if (strlen($post_content) > 0) { $input_li->append_str_to_content($post_content); } $input_msg_box = new HTMLTags_Span(); $input_msg_box->set_attribute_str('id', $name . 'msg'); $input_msg_box->set_attribute_str('class', 'rules'); $input_li->append_tag_to_content($input_msg_box); if (count($this->input_lis) == 0) { $this->first_input_name = $name; } $this->input_lis[] = $input_li; }
public function __construct(Exception $e, $print_name = FALSE, $print_trace = FALSE) { parent::__construct(); $this->set_attribute_str('id', 'exception'); /* * The exception class p. */ if ($print_name) { $this->append_tag_to_content(new HTMLTags_P(get_class($e))); } /* * The exception message p. */ $this->append_tag_to_content(new HTMLTags_P($e->getMessage())); /* * The exception's trace list. */ if ($print_trace) { $trace_list = new HTMLTags_OL(); $trace_list->set_attribute_str('id', 'trace-list'); foreach ($e->getTrace() as $data) { $trace_item = new HTMLTags_LI(); #print_r($location); foreach (array_keys($data) as $key) { $trace_item->append_str_to_content("{$key}:"); #$trace_item->append_tag_to_content(new HTMLTags_BR()); if (is_array($data[$key])) { foreach ($data[$key] as $datum) { $trace_item->append_str_to_content(' '); if (is_numeric($datum) || is_string($datum)) { $trace_item->append_str_to_content('"' . $datum . '"'); } $trace_item->append_tag_to_content(new HTMLTags_BR()); } } else { if (strtolower($key) == 'file') { $formatted_filename = new Formatting_FileName($data[$key]); $formatted_filename_pre = new HTMLTags_Pre($formatted_filename->get_pretty_name()); $trace_item->append_tag_to_content($formatted_filename_pre); $trace_item->append_tag_to_content(new HTMLTags_BR()); } else { $trace_item->append_str_to_content(' '); #echo $data[$key]; #print_r($data[$key]); $trace_item->append_str_to_content('' . $data[$key]); $trace_item->append_tag_to_content(new HTMLTags_BR()); } } } $trace_list->append_tag_to_content($trace_item); } $this->append_tag_to_content($trace_list); } }
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 __construct(HaddockProjectOrganisation_ProjectDirectory $project_directory) { parent::__construct(); $m_w_a_ss = $project_directory->get_modules_with_admin_sections(); foreach ($m_w_a_ss as $m_w_a_s) { $module_li = new HTMLTags_LI(); $module_a = new HTMLTags_A(); //$module_href = new HTMLTags_URL(); #if ( # is_a( # $m_w_a_s, # 'HaddockProjectOrganisation_ProjectSpecificDirectory' # ) #) { # $module_name = 'project-specific'; #} else { # $module_name_l_o_ws = $m_w_a_s->get_module_name_as_l_o_w(); # $module_name = $module_name_l_o_ws->get_words_as_delimited_lc_string('-'); #} //$module_name = $m_w_a_s->get_admin_section_directory_name(); // //#$module_href->set_file('/admin/' . $module_name . '/home.html'); //$module_href->set_file('/admin/hc/' . $module_name . '/home.html'); $module_href = $m_w_a_s->get_admin_section_home_page_href(); $module_a->set_href($module_href); $module_config_file = $m_w_a_s->get_module_config_file(); $module_span = new HTMLTags_Span($module_config_file->get_admin_section_title()); $module_a->append_tag_to_content($module_span); $module_li->append_tag_to_content($module_a); $this->add_li($module_li); } }
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_tag_cloud_div($current_url, $javascript = FALSE) { $tags_table = $this->get_element(); #$database = $productgraph_row->get_database(); #$tags_table = $database->get_table('hpi_shop_product_tags'); #$productgraph_row = $productgraphs_table->get_row_by_id($_GET['productgraph_id']); #$database = $productgraph_row->get_database(); $tag_cloud_div = new HTMLTags_Div(); $tag_cloud_div->set_attribute_str('id', 'tag_cloud_div'); $tag_cloud_heading = new HTMLTags_Heading(3); $tag_cloud_heading->append_str_to_content('All Tags'); $tag_cloud_div->append_tag_to_content($tag_cloud_heading); $tag_cloud_list = new HTMLTags_OL(); $tags = $tags_table->get_tags_with_counts('hpi_shop_product_tags.tag', 'ASC'); foreach ($tags as $tag) { $tag_cloud_line = new HTMLTags_LI(); $tag_cloud_href = clone $current_url; $tag_cloud_href->set_get_variable('tag_id', $tag->get_id()); $tag_cloud_link = new HTMLTags_A(); $tag_cloud_link->set_href($tag_cloud_href); $tag_cloud_link->set_attribute_str('id', $tag->get_id()); if ($javascript) { $onclick = 'javascript:return tagsOnClick(this);'; $tag_cloud_link->set_attribute_str('onclick', $onclick); } #tag_cloud_link->set_attribute_str('id', 'productgraph_page_link'); #echo $tag->get_product_count(); /* * RFI 2007-03-27 * * Is this the right way around? * * Aren't tags with a lower product count less popular? */ #if ($tag->get_product_count() > 3) { # $tag_cloud_link->set_attribute_str('class', 'not-very-popular'); #} $popularity_css_class = $tag->get_popularity_css_class(); #echo "\$popularity_css_class: $popularity_css_class\n\n"; $tag_cloud_link->set_attribute_str('class', $popularity_css_class); $tag_cloud_link->set_attribute_str('rel', 'tag'); $tag_product_count = $tag->get_product_count(); if ($tag_product_count == 1) { $tag_product_count_span_text = $tag_product_count . ' product is tagged with '; } else { $tag_product_count_span_text = $tag_product_count . ' products are tagged with '; } $tag_cloud_link_span = new HTMLTags_Span($tag_product_count_span_text); $tag_cloud_link->append_tag_to_content($tag_cloud_link_span); $tag_cloud_link->append_str_to_content($tag->get_tag()); $tag_cloud_line->append_tag_to_content($tag_cloud_link); $tag_cloud_list->append_tag_to_content($tag_cloud_line); } $tag_cloud_div->append_tag_to_content($tag_cloud_list); return $tag_cloud_div; }
private function get_add_new_character_li() { $add_new_character_url = $this->get_add_new_character_url(); $link = new HTMLTags_A('add a new character'); $link->set_href($add_new_character_url); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'add_new_character'); return $li; }
private function get_delete_option_li() { $delete_option_url = $this->get_delete_option_url(); $link = new HTMLTags_A('delete this Option'); $link->set_href($delete_option_url); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'delete_option'); return $li; }
private function get_edit_li() { $edit_url = $this->get_edit_url(); $link = new HTMLTags_A('Edit this frame'); $link->set_href($edit_url); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'edit-frame'); return $li; }
private function get_share_drama_li() { $share_drama_url = $this->get_share_drama_url(); $link = new HTMLTags_A('Share this Drama'); $link->set_href($share_drama_url); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'share-drama'); return $li; }
public function get_html_ul() { $ul = new HTMLTags_UL(); foreach ($this->get_option_button_tags() as $obt) { $li = new HTMLTags_LI(); $li->append_tag_to_content($obt); $ul->add_li($li); } return $ul; }
protected function render_top_links_ul() { $page_options_div = new HTMLTags_Div(); $page_options_div->set_attribute_str('id', 'page-options'); $other_pages_ul = new HTMLTags_UL(); foreach ($this->get_top_links_as() as $a) { $li = new HTMLTags_LI(); $li->append_tag_to_content($a); $other_pages_ul->append_tag_to_content($li); } $page_options_div->append_tag_to_content($other_pages_ul); echo $page_options_div->get_as_string(); }
private function get_drama_li(Oedipus_Drama $drama) { $drama_url = $this->get_drama_page_url_for_drama($drama); $link = new HTMLTags_A(); /* * Put the Link, image, added date etc. * in separate <span></span> */ $name_span = $this->get_span_with_id($drama->get_name(), 'name'); $added_span = $this->get_span_with_id($drama->get_human_readable_added(), 'added'); $link->append_tag_to_content($name_span); $link->append_tag_to_content($added_span); $link->set_href($drama_url); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'drama'); // foreach ($drama->get_frames() as $frame) // { // $li->append_tag_to_content($this->get_oedipus_png_frame($frame)); // } return $li; }
$field_classes_list->append_tag_to_content($table_li); } $d_c_n_c_field_set->append_tag_to_content($field_classes_list); } /* * The field renderers. */ if (count($field_renderer_files) > 0) { $field_renderers_heading = new HTMLTags_Heading(3, 'Field Renderers'); $d_c_n_c_field_set->append_tag_to_content($field_renderers_heading); $table_names = array_keys($field_renderer_files); $field_renderers_list = new HTMLTags_OL(); foreach ($table_names as $table_name) { $table_li = new HTMLTags_LI(); $table_name_heading = new HTMLTags_Heading(4, $table_name); $table_li->append_tag_to_content($table_name_heading); $table_fields_list = new HTMLTags_OL(); $field_names = array_keys($field_renderer_files[$table_name]); foreach ($field_names as $field_name) { $field_renderer_li = new HTMLTags_LI(); $input_name = 'field-' . $table_name . '-' . $field_name . '-renderer'; $field_renderer_select_label = new HTMLTags_Label($field_name); $field_renderer_select_label->set_attribute_str('for', $input_name); $field_renderer_li->append_tag_to_content($field_renderer_select_label); $field_renderer_select = new HTMLTags_Select(); $field_renderer_select->set_attribute_str('id', $input_name); $field_renderer_select->set_attribute_str('name', $input_name); $current_field_renderer_class_file = null; if (isset($database_class_name_file)) { if ($database_class_name_file->has_field_renderer_class_file($table_name, $field_name)) { $current_field_renderer_class_file = $database_class_name_file->get_field_renderer_class_file($table_name, $field_name);
$checkout_li->append_tag_to_content($checkout_link); $product_links_ul->append_tag_to_content($checkout_li); $shopping_desc_div->append_tag_to_content($product_links_ul); $navigation_div->append_tag_to_content($shopping_desc_div); ########################################### # Navigation Links ########################################### ########################################### # Links UL ########################################### $pages_ul = new HTMLTags_UL(); $pages_ul->set_attribute_str('id', 'navigation-ul'); foreach ($pages as $page) { $page_li = new HTMLTags_LI(); if ($page['name'] == $page_manager->get_page() || $page['name'] == $_GET['page']) { $page_link_span = new HTMLTags_Span(' ' . $page['text']); $page_li->append_tag_to_content($page_link_span); } else { $page_link_file = '/' . $page['name'] . '.html'; $page_link_location = new HTMLTags_URL(); $page_link_location->set_file($page_link_file); $page_link_anchor = new HTMLTags_A(); $page_link_anchor->set_href($page_link_location); $page_link_anchor->set_attribute_str('title', $page['title']); $page_link_anchor->append_str_to_content($page['text']); $page_li->append_tag_to_content($page_link_anchor); } $pages_ul->append_tag_to_content($page_li); } $navigation_div->append_tag_to_content($pages_ul); echo $navigation_div;
public function get_status_form_select_li() { $input_li = new HTMLTags_LI(); $input_label = new HTMLTags_Label('Status'); $input_label->set_attribute_str('for', 'status_id'); $input_li->append_tag_to_content($input_label); $input_li->append_tag_to_content($this->get_status_form_select()); $input_msg_box = new HTMLTags_Span(); $input_msg_box->set_attribute_str('id', 'status_id' . 'msg'); $input_msg_box->set_attribute_str('class', 'rules'); $input_li->append_tag_to_content($input_msg_box); return $input_li; }
<?php /** * A div that is displayed if the customer is already logged into a shop. * * @copyright Clear Line Web Design, 2007-08-21 */ $checkout_process_div = new HTMLTags_Div(); $checkout_process_div->set_attribute_str('id', 'checkout_process_div'); $checkout_process_ul = new HTMLTags_UL(); $process_step_one_li = new HTMLTags_LI(); $process_step_one_li->append_tag_to_content(new HTMLTags_Em('Step 1')); $checkout_process_ul->append_tag_to_content($process_step_one_li); $process_step_two_li = new HTMLTags_LI(); $process_step_two_li->append_str_to_content('Step 2'); $checkout_process_ul->append_tag_to_content($process_step_two_li); $process_step_three_li = new HTMLTags_LI(); $process_step_three_li->append_str_to_content('Step 3'); $checkout_process_ul->append_tag_to_content($process_step_three_li); $checkout_process_div->append_tag_to_content($checkout_process_ul); // Already logged in // You are logged in as Mr. X. $p_text = <<<TXT Step 1 on the Checkout process TXT; $checkout_process_div->append_tag_to_content(new HTMLTags_P($p_text)); echo $checkout_process_div->get_as_string();
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; }
/** * Renders a UL that contains links to other pages * to do with this one. * e.g. the 'delete_everything' version of this page. */ protected function render_other_pages_ul() { $page_options_div = new HTMLTags_Div(); $page_options_div->set_attribute_str('id', 'page-options'); $other_pages_ul = new HTMLTags_UL(); /** * Link to the add row form. */ $add_row_li = new HTMLTags_LI(); $add_row_a = new HTMLTags_A($this->get_add_something_link_text()); $add_row_href = $this->get_add_something_page_url(); $add_row_a->set_href($add_row_href); $add_row_li->append_tag_to_content($add_row_a); $other_pages_ul->append_tag_to_content($add_row_li); /** * Link to the delete all confirmation page. */ $delete_all_li = new HTMLTags_LI(); $delete_all_a = new HTMLTags_A($this->get_delete_everything_link_text()); $delete_all_href = $this->get_current_base_url(); $delete_all_href->set_get_variable('content', 'delete_everything'); $delete_all_a->set_href($delete_all_href); $delete_all_li->append_tag_to_content($delete_all_a); $other_pages_ul->append_tag_to_content($delete_all_li); $page_options_div->append_tag_to_content($other_pages_ul); echo $page_options_div->get_as_string(); }
$mysql_user_factory = Database_MySQLUserFactory::get_instance(); $mysql_user = $mysql_user_factory->get_for_this_project(); $database = $mysql_user->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(); $customer_regions_div->set_attribute_str('id', 'tabs'); $customer_regions_ul = new HTMLTags_UL(); foreach ($customer_regions as $customer_region) { $customer_region_li = new HTMLTags_LI(); $customer_region_link_span = new HTMLTags_Span($customer_region->get_name()); if ($customer_region->get_id() == $_SESSION['customer_region_id']) { $double_span = new HTMLTags_Span(); $double_span->set_attribute_str('class', 'current'); $double_span->append_tag_to_content($customer_region_link_span); $customer_region_li->append_tag_to_content($double_span); } else { //$customer_region_link_file = '/'; //$customer_region_link_location = new HTMLTags_URL(); //$customer_region_link_location->set_file($customer_region_link_file); //$customer_region_link_location->set_get_variable('page', $page_manager->get_page()); $customer_region_link_location = $page_manager->get_script_uri(); $customer_region_link_location->set_get_variable('customer_region_session', $customer_region->get_id()); $customer_region_link_anchor = new HTMLTags_A(); $customer_region_link_anchor->set_href($customer_region_link_location); $customer_region_link_anchor->set_attribute_str('title', 'Change your location to ' . $customer_region->get_name()); $customer_region_link_anchor->append_tag_to_content($customer_region_link_span); $customer_region_li->append_tag_to_content($customer_region_link_anchor); } $customer_regions_ul->append_tag_to_content($customer_region_li); }
} /** * Links to other pages in the admin section. */ $page_options_div = new HTMLTags_Div(); $page_options_div->set_attribute_str('id', 'page-options'); $other_pages_ul = new HTMLTags_UL(); /** * Link to the add row form. */ $add_row_li = new HTMLTags_LI(); $add_row_a = new HTMLTags_A('Add New Product Brand'); $add_row_href = clone $current_page_url; $add_row_href->set_get_variable('add_row'); $add_row_a->set_href($add_row_href); $add_row_li->append_tag_to_content($add_row_a); $other_pages_ul->append_tag_to_content($add_row_li); /** * Link to the delete all confirmation page. */ #$delete_all_li = new HTMLTags_LI(); # #$delete_all_a = new HTMLTags_A('Delete All Photographs'); # #$delete_all_href = new HTMLTags_URL(); # #$delete_all_href->set_file('/admin/index.php'); # #$delete_all_href->set_get_variable('module', 'shop'); #$delete_all_href->set_get_variable('page', 'product_brands'); #$delete_all_href->set_get_variable('delete_all');
public function get_content() { $content = new HTMLTags_TagContent(); /* * Build the LI for each section. */ foreach ($this->anxf->get_sections() as $section) { if ($this->anxf->has_access_permission_for_section($section, $this->admin_user_level)) { $section_li = new HTMLTags_LI(); /* * Append the section title. */ $section_title = $this->anxf->get_section_title($section); $section_title_h3 = new HTMLTags_Heading(3, $section_title); $section_title_h3->set_attribute_str('id', 'section-title'); $section_li->append_tag_to_content($section_title_h3); /* * We deal with the project-specific section differently * as it doesn't have modules. */ if ($section == 'project-specific') { $pages = $this->anxf->get_pages_in_section($section); $section_ul = new HTMLTags_UL(); $section_ul->set_attribute_str('class', 'section-pages-list'); foreach ($pages as $page) { if ($this->anxf->has_access_permission_for_page_in_section($page, $section, $this->admin_user_level)) { $page_li = new HTMLTags_LI(); $page_title = $this->anxf->get_title_for_page_in_section($page, $section); $page_a = new HTMLTags_A($page_title); $page_url = $this->anxf->get_url_for_page_in_section($page, $section); $page_a->set_href($page_url); $page_li->append_tag_to_content($page_a); $section_ul->add_li($page_li); } } $section_li->append_tag_to_content($section_ul); } else { $modules = $this->anxf->get_modules_in_section($section); $section_ul = new HTMLTags_UL(); foreach ($modules as $module) { if ($this->anxf->has_access_permission_for_module_in_section($module, $section, $this->admin_user_level)) { $module_li = new HTMLTags_LI(); $module_title = $this->anxf->get_module_title_in_section($module, $section); #$module_li->append_str_to_content($module); $module_title_h4 = new HTMLTags_Heading(4, $module_title); $module_title_h4->set_attribute_str('id', 'module-title'); $module_li->append_tag_to_content($module_title_h4); $module_ul = new HTMLTags_UL(); $module_ul->set_attribute_str('class', 'module-pages-list'); $pages = $this->anxf->get_pages_in_module($module, $section); #echo 'count($pages): ' . count(\$pages) . "\n"; foreach ($pages as $page) { if ($this->anxf->has_access_permission_for_page_in_module_in_section($page, $module, $section, $this->admin_user_level)) { $page_li = new HTMLTags_LI(); $page_title = $this->anxf->get_title_for_page_in_module_in_section($page, $module, $section); $page_a = new HTMLTags_A($page_title); $page_url = $this->anxf->get_url_for_page_in_module_in_section($page, $module, $section); $page_a->set_href($page_url); $page_li->append_tag_to_content($page_a); $module_ul->add_li($page_li); } } $module_li->append_tag_to_content($module_ul); $section_ul->add_li($module_li); } } $section_li->append_tag_to_content($section_ul); } $content->append_tag($section_li); } } return $content; }
public function get_share_links_ul_in_public() { $share_links_ul = new HTMLTags_UL(); $share_product_link = new HTMLTags_A('Spread the word!'); $share_product_location = $this->get_product_page_url(); $share_product_location->set_get_variable('share_product', '1'); $share_product_link->set_href($share_product_location); $share_product_li = new HTMLTags_LI(); $share_product_li->append_tag_to_content($share_product_link); $share_links_ul->append_tag_to_content($share_product_li); return $share_links_ul; }
public function get_content() { #echo "\$this->offset: $this->offset\n"; #echo "\$this->limit: $this->limit\n"; $content = new HTMLTags_TagContent(); /* * Are we at the beginning? */ if ($this->offset > 0) { $first_offset = 0; $previous_offset = $this->offset - $this->limit; $first_page_li = new HTMLTags_LI(); $link_to_first_page = new HTMLTags_A('first'); # How will we set this to 'primero' etc? $first_page_href = clone $this->link_href; $first_page_href->set_get_variable('offset', 0); $first_page_href->set_get_variable('limit', $this->limit); $link_to_first_page->set_href($first_page_href); $first_page_li->append_tag_to_content($link_to_first_page); $content->append_tag($first_page_li); /* * Do previous and first collide? */ if ($first_offset < $previous_offset) { $previous_page_li = new HTMLTags_LI(); $link_to_previous_page = new HTMLTags_A('previous'); $previous_page_href = clone $this->link_href; $previous_page_href->set_get_variable('offset', $previous_offset); $previous_page_href->set_get_variable('limit', $this->limit); $link_to_previous_page->set_href($previous_page_href); $previous_page_li->append_tag_to_content($link_to_previous_page); $content->append_tag($previous_page_li); } } /* * Current * * offset to offset + limit */ $current_page_li = new HTMLTags_LI(); $current_msg = $this->offset + 1; $current_msg .= ' to '; #$row_count = $this->table->count_all_rows(); $current_msg .= $this->offset + $this->limit < $this->row_count ? $this->offset + $this->limit : $this->row_count; $current_page_li->append_str_to_content($current_msg); $content->append_tag($current_page_li); /* * Are there more rows to show? */ #echo "\$row_count: $row_count\n"; if ($this->offset + $this->limit < $this->row_count) { #echo "There are more pages\n"; $next_offset = $this->offset + $this->limit; $last_offset = $this->row_count - ($this->row_count % $this->limit == 0 ? $this->limit : $this->row_count % $this->limit); /* * Do next and final collide? */ if ($next_offset < $last_offset) { $next_page_li = new HTMLTags_LI(); $link_to_next_page = new HTMLTags_A('next'); $next_page_href = clone $this->link_href; $next_page_href->set_get_variable('offset', $next_offset); $next_page_href->set_get_variable('limit', $this->limit); $link_to_next_page->set_href($next_page_href); $next_page_li->append_tag_to_content($link_to_next_page); $content->append_tag($next_page_li); } $last_page_li = new HTMLTags_LI(); $link_to_last_page = new HTMLTags_A('last'); $last_page_href = clone $this->link_href; $last_page_href->set_get_variable('offset', $last_offset); $last_page_href->set_get_variable('limit', $this->limit); $link_to_last_page->set_href($last_page_href); $last_page_li->append_tag_to_content($link_to_last_page); $content->append_tag($last_page_li); } return $content; }
/** * The purpose of this div is to tell the customer which * the stage of the checkout process they have reached. * * A short explanation of the stage is also given. */ public function get_checkout_status_div() { // accounts >> shipping-details >> payment-options $checkout_status = $this->get_checkout_status(); #echo $checkout_status; exit; $checkout_status_div = new HTMLTags_Div(); $checkout_status_div->set_attribute_str('id', 'checkout_status_div'); $checkout_status_ul = new HTMLTags_UL(); switch ($checkout_status) { case 'accounts': $status_step_one_li = new HTMLTags_LI(); $status_step_one_li->append_tag_to_content(new HTMLTags_Em('Log In')); $checkout_status_ul->append_tag_to_content($status_step_one_li); $status_step_two_li = new HTMLTags_LI(); $status_step_two_li->append_str_to_content('Shipping Details'); $checkout_status_ul->append_tag_to_content($status_step_two_li); $status_step_three_li = new HTMLTags_LI(); $status_step_three_li->append_str_to_content('Go to Secure Server'); $checkout_status_ul->append_tag_to_content($status_step_three_li); $p_text = <<<TXT Please complete this form and create an account with us. Alternatively, log in with your existing email address and password. TXT; break; case 'shipping-details': $status_step_one_li = new HTMLTags_LI(); $status_step_one_li->append_str_to_content('Log In'); $checkout_status_ul->append_tag_to_content($status_step_one_li); $status_step_two_li = new HTMLTags_LI(); $status_step_two_li->append_tag_to_content(new HTMLTags_Em('Shipping Details')); $checkout_status_ul->append_tag_to_content($status_step_two_li); $status_step_three_li = new HTMLTags_LI(); $status_step_three_li->append_str_to_content('Go to Secure Server'); $checkout_status_ul->append_tag_to_content($status_step_three_li); $p_text = <<<TXT Please enter or confirm your shipping address, this must be the same as your billing address. TXT; break; case 'payment-options': $status_step_one_li = new HTMLTags_LI(); $status_step_one_li->append_str_to_content('Log In'); $checkout_status_ul->append_tag_to_content($status_step_one_li); $status_step_two_li = new HTMLTags_LI(); $status_step_two_li->append_str_to_content('Shipping Details'); $checkout_status_ul->append_tag_to_content($status_step_two_li); $status_step_three_li = new HTMLTags_LI(); $status_step_three_li->append_tag_to_content(new HTMLTags_Em('Go to Secure Server')); $checkout_status_ul->append_tag_to_content($status_step_three_li); $p_text = <<<TXT Check your shipping details and shopping basket. TXT; $p2_text = <<<TXT When you're happy, click the button below to be transfered to a secure server where you can enter your credit card details to complete the payment. TXT; break; } $checkout_status_div->append_tag_to_content($checkout_status_ul); $checkout_status_div->append_tag_to_content(new HTMLTags_P($p_text)); if (isset($p2_text)) { $checkout_status_div->append_tag_to_content(new HTMLTags_P($p2_text)); } return $checkout_status_div; }
$last_error_box_div = new HTMLTags_LastActionBoxDiv($message, $current_page_url->get_as_string(), 'message'); $content_div->append_tag_to_content($last_error_box_div); } /** * Links to other pages in the admin section. */ $page_options_div = new HTMLTags_Div(); $page_options_div->set_attribute_str('id', 'page-options'); $other_pages_ul = new HTMLTags_UL(); /** * Link to the refresh page. */ $refresh_page_li = new HTMLTags_LI(); $refresh_page_a = new HTMLTags_A('Check for new transactions'); $refresh_page_a->set_href($current_page_url); $refresh_page_li->append_tag_to_content($refresh_page_a); $other_pages_ul->append_tag_to_content($refresh_page_li); $page_options_div->append_tag_to_content($other_pages_ul); $content_div->append_tag_to_content($page_options_div); #################################################################### # # Display some of the data in the table. # #################################################################### $actions_method_args[] = $current_page_url; $selection_div = $table_renderer->get_admin_database_selection_html_table(ORDER_BY, DIRECTION, OFFSET, LIMIT, $current_page_url, 'added order_id txn_id payment_status payment_amount payment_shipping receiver_email payer_email', 'Transactions'); // $selection_div // = $table_renderer // ->get_admin_transactions_selection_html_table( // DIRECTION, // ORDER_BY,
$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();
$add_row_li = new HTMLTags_LI(); $add_row_a = new HTMLTags_A('Add New Customer'); $add_row_href = clone $current_page_url; $add_row_href->set_get_variable('add_row'); $add_row_a->set_href($add_row_href); $add_row_li->append_tag_to_content($add_row_a); $other_pages_ul->append_tag_to_content($add_row_li); /** * Link to the delete all confirmation page. */ $delete_all_li = new HTMLTags_LI(); $delete_all_a = new HTMLTags_A('Delete All Customer'); $delete_all_href = clone $current_page_url; $delete_all_href->set_get_variable('delete_all'); $delete_all_a->set_href($delete_all_href); $delete_all_li->append_tag_to_content($delete_all_a); $other_pages_ul->append_tag_to_content($delete_all_li); $page_options_div->append_tag_to_content($other_pages_ul); $content_div->append_tag_to_content($page_options_div); #################################################################### # # Display some of the data in the table. # #################################################################### /* * DIV for limits and previous and nexts. */ $limit_previous_next_div = new HTMLTags_Div(); $limit_previous_next_div->set_attribute_str('class', 'table_pages_div'); /* * To allow the user to set the number of extras to show at a time.