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; }
public function get_body_div_header() { /* * Create the HTML tags objects. */ $div_header = new HTMLTags_Div(); $div_header->set_attribute_str('id', 'header'); /* * Project Logo IMG, * for filename look in config, * default should be some haddock fish */ $image_div = new HTMLTags_Div(); $image_div->set_attribute_str('id', 'logo_image'); $logo_img = new HTMLTags_IMG(); $logo_src_url = new HTMLTags_URL(); $cmf = HaddockProjectOrganisation_ConfigManagerFactory::get_instance(); /* * The admin module has been moved to the plug-ins directory. * * RFI 2009-10-08 */ #$config_manager = $cmf->get_config_manager('haddock', 'admin'); $config_manager = $cmf->get_config_manager('plug-ins', 'admin'); $logo_config_filename = $config_manager->get_logo_image_filename(); $logo_src_url->set_file($logo_config_filename); $logo_img->set_src($logo_src_url); $image_div->append($logo_img); $div_header->append($image_div); /* * There are two headers: * Project Title Link (H1) * and Page Title (H2) */ $h1_title = new HTMLTags_Heading(1); $h1_title->append_str_to_content($this->get_body_div_header_project_heading_content()); $div_header->append_tag_to_content($h1_title); $h2_title = new HTMLTags_Heading(2); $h2_title->append_str_to_content($this->get_body_div_header_heading_content()); $div_header->append_tag_to_content($h2_title); $div_header->append($this->get_log_in_state_div()); $div_header->append($this->get_admin_header_navigation_link_div()); return $div_header; }
public function get_body_div_header() { /* * Create the HTML tags objects. */ $div_header = new HTMLTags_Div(); $div_header->set_attribute_str('id', 'header'); $h1_title = new HTMLTags_Heading(1); $h1_title->append_str_to_content($this->get_body_div_header_heading_content()); $div_header->append_tag_to_content($h1_title); return $div_header; }
public function get_share_product_div_in_public() { $product = $this->get_element(); $product_name = $product->get_name(); $product_brand = $product->get_product_brand(); $product_brand_name = $product_brand->get_name(); $this_product_location = $this->get_product_page_url(); $this_product_comments_location = $this->get_product_page_comments_url(); $product_category = $product->get_product_category(); $product_category_name = $product_category->get_name(); $product_category_name_minus_s = rtrim($product_category_name, 's'); $share_product_div = new HTMLTags_Div(); $share_product_div->set_attribute_str('id', 'share_product_div'); $share_h_em = new HTMLTags_Em($product_name); $share_h = new HTMLTags_Heading(2); $share_h->append_tag_to_content($share_h_em); $share_h->append_str_to_content(' spread the word'); $share_product_div->append_tag_to_content($share_h); $product_img_div = new HTMLTags_Div(); $product_img_div->set_attribute_str('class', 'product_img_div'); $design_photograph = $product->get_design_photograph(); $design_photograph_renderer = $design_photograph->get_renderer(); $design_medium_size_img = $design_photograph_renderer->get_absolute_medium_size_img(); $design_medium_size_img->set_attribute_str('class', 'share_product_img'); $design_img_link = new HTMLTags_A(); $design_img_link->set_href($this_product_location); $design_img_link->append_tag_to_content($design_medium_size_img); $main_photograph = $product->get_main_photograph(); $main_photograph_renderer = $main_photograph->get_renderer(); $main_medium_size_img = $main_photograph_renderer->get_absolute_medium_size_img(); $main_medium_size_img->set_attribute_str('class', 'share_product_img'); $main_img_link = new HTMLTags_A(); $main_img_link->set_href($this_product_location); $main_img_link->append_tag_to_content($main_medium_size_img); $product_img_div->append_tag_to_content($main_img_link); $product_img_div->append_tag_to_content($design_img_link); $share_product_div->append_tag_to_content($product_img_div); $share_text = <<<TXT Help us spread the word about this {$product_category_name_minus_s}, and the other {$product_brand_name} products. There are a few ways you can do this here, if you think of any more then please let us know how they work out in the TXT; $comments_link = new HTMLTags_A('comments'); $comments_link->set_href($this_product_comments_location); $share_div_p = new HTMLTags_P($share_text); $share_div_p->append_tag_to_content($comments_link); $share_div_p->append_str_to_content('.'); $share_product_div->append_tag_to_content($share_div_p); // $this_product_link = new HTMLTags_A('Go back to ' . $product_name); // $this_product_location = $this->get_product_page_url(); // $this_product_link->set_href($this_product_location); // // $share_product_div->append_tag_to_content($this_product_link); $social_network_h = new HTMLTags_Heading(3, 'Share ' . $product_category_name_minus_s . ' with Facebook etc.'); $share_product_div->append_tag_to_content($social_network_h); // $social_network_text = <<<TXT //TXT; // $share_product_div->append_tag_to_content(new HTMLTags_P($social_network_text)); $social_network_links_ul = $this->get_social_network_links_ul(); $share_product_div->append_tag_to_content($social_network_links_ul); $embed_h = new HTMLTags_Heading(3, 'Feature ' . $product_category_name_minus_s . ' on your own website'); $share_product_div->append_tag_to_content($embed_h); $embed_text = <<<TXT Copy and paste this code into your own web page, blog, or MySpace page. TXT; $share_product_div->append_tag_to_content(new HTMLTags_P($embed_text)); $embed_form = $this->get_embed_form(); $share_product_div->append_tag_to_content($embed_form); return $share_product_div; }
$product_category_id = $_GET['product_category_id']; $product_category = $product_categories_table->get_row_by_id($product_category_id); if ($product_category->is_active()) { // PRODUCT CATEGORY HEADER // $product_category_header_id = 'product-category'; $product_category_header_class = 'product-category'; if (isset($_GET['tag'])) { $product_category_header_title = $_GET['tag'] . ' ' . $product_category->get_name(); } else { $product_category_header_title = $product_category->get_name(); } $product_category_header_h = new HTMLTags_Heading(2); $product_category_header_h->set_attribute_str('class', $product_category_header_class); $product_category_header_h->set_attribute_str('id', $product_category_header_id); $product_category_header_h->append_str_to_content($product_category_header_title); $content_div->append_tag_to_content($product_category_header_h); // PRODUCTS FOR PRODUCT CATEGORY DIV // if (isset($_GET['tag'])) { $products_for_product_category_ul = $products_table_renderer->get_products_for_product_category_and_tag_ul_in_public($product_category_id, $_GET['tag']); } else { $products_for_product_category_ul = $products_table_renderer->get_products_for_product_category_ul_in_public($product_category_id); } $content_div->append_tag_to_content($products_for_product_category_ul); } else { $customer_regions_table = $database->get_table('hpi_shop_customer_regions'); $customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']); $this_product_category_inactive_text = 'There are no '; $this_product_category_inactive_text .= $product_category->get_name(); $this_product_category_inactive_text .= ' available in ';
$product_tag_id = $_GET['product_tag_id']; $product_tag = $product_categories_table->get_row_by_id($product_tag_id); if ($product_tag->is_active()) { // PRODUCT CATEGORY HEADER // $product_tag_header_id = 'product-tag'; $product_tag_header_class = 'product-tag'; if (isset($_GET['tag'])) { $product_tag_header_title = $_GET['tag'] . ' ' . $product_tag->get_name(); } else { $product_tag_header_title = $product_tag->get_name(); } $product_tag_header_h = new HTMLTags_Heading(2); $product_tag_header_h->set_attribute_str('class', $product_tag_header_class); $product_tag_header_h->set_attribute_str('id', $product_tag_header_id); $product_tag_header_h->append_str_to_content($product_tag_header_title); $content_div->append_tag_to_content($product_tag_header_h); // PRODUCTS FOR PRODUCT CATEGORY DIV // if (isset($_GET['tag'])) { $products_for_product_tag_ul = $products_table_renderer->get_products_for_product_tag_and_tag_ul_in_public($product_tag_id, $_GET['tag']); } else { $products_for_product_tag_ul = $products_table_renderer->get_products_for_product_tag_ul_in_public($product_tag_id); } $content_div->append_tag_to_content($products_for_product_tag_ul); } else { $customer_regions_table = $database->get_table('hpi_shop_customer_regions'); $customer_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']); $this_product_tag_inactive_text = 'There are no '; $this_product_tag_inactive_text .= $product_tag->get_name(); $this_product_tag_inactive_text .= ' available in ';
<?php /** * The header div for the shop plug-in. * * @copyright Clear Line Web Design, 2006-09-27 */ $page_manager = PublicHTML_PageManager::get_instance(); $header_div = new HTMLTags_Div(); $header_div->set_attribute_str('id', 'header'); /* * A span for the logo (CSS hack). */ $logo_span = new HTMLTags_Span(); $header_div->append_tag_to_content($logo_span); /* * A heading that looks at the config file for this project. */ $header_div_header_h = new HTMLTags_Heading(1); $header_div_header_h->set_attribute_str('class', 'header'); $header_div_header_h->set_attribute_str('id', 'shop_title'); $pdf = HaddockProjectOrganisation_ProjectDirectoryFinder::get_instance(); $project_directory = $pdf->get_project_directory_for_this_project(); $config_file = $project_directory->get_config_file(); $header_div_header_h->append_str_to_content($config_file->get_project_title()); $header_div->append_tag_to_content($header_div_header_h); /* * The various regions where this shop sells products. */ $header_div->append_str_to_content($page_manager->get_inc_file_as_string('body.div.customer-regions')); echo $header_div->get_as_string();
<?php /** * The Title that goes at the top of the page for a table in database admin. * * RFI & SANH 2007-01-05 */ require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/HTMLTags_Heading.inc.php'; $header_title = new HTMLTags_Heading(1, 'Database Admin > table'); if (isset($table)) { $header_title->append_str_to_content(' > ' . $table->get_name()); } echo $header_title->get_as_string();
$mysql_user_factory = Database_MySQLUserFactory::get_instance(); $mysql_user = $mysql_user_factory->get_for_this_project(); $database = $mysql_user->get_database(); // CONTENT DIV $content_div = new HTMLTags_Div(); $content_div->set_attribute_str('id', 'content'); $logo_span = new HTMLTags_Span(); $logo_span->set_attribute_str('class', 'logo'); $content_div->append_tag_to_content($logo_span); // HEADER $main_page_header_id = 'home'; $main_page_header_title = 'Home'; $main_page_header_h = new HTMLTags_Heading(2); $main_page_header_h->set_attribute_str('class', 'logo'); $main_page_header_h->set_attribute_str('id', $main_page_header_id); $main_page_header_h->append_str_to_content($main_page_header_title); $content_div->append_tag_to_content($main_page_header_h); // IF LOGGED IN MESSAGE if ($logged_in) { $content_div->append_str_to_content($page_manager->get_inc_file_as_string('body.p.logged-in-salutation')); } // WELCOME MESSAGE $content_div->append_str_to_content($page_manager->get_inc_file_as_string('body.p.welcome-message')); // CONNECTED FILMS SHOP IMAGE // $home_img = new HTMLTags_IMG(); $home_img_location = new HTMLTags_URL(); $home_img_location->set_file('/images/clapperboard.png'); $home_img->set_src($home_img_location); $home_img->set_attribute_str('class', 'home-page-img'); $content_div->append_tag_to_content($home_img);