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_tag_cloud_div($current_url, $javascript = FALSE) { $tag_row = $this->get_element(); $database = $tag_row->get_database(); $tags_table = $database->get_table('hpi_shop_product_tags'); #$product_row = $products_table->get_row_by_id($_GET['product_id']); #$database = $product_row->get_database(); $tag_cloud_div = new HTMLTags_Div(); $tag_cloud_div->set_attribute_str('id', 'tag_cloud_div'); $tag_cloud_list = new HTMLTags_OL(); $tags = $tags_table->get_tags_with_counts(); 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); if ($javascript) { $onclick = 'javascript:return tagsOnClick(this);'; $tag_cloud_link->set_attribute_str('onclick', $onclick); } #tag_cloud_link->set_attribute_str('id', 'product_page_link'); #echo $tag->get_photo_count(); if ($tag->get_photo_count() > 3) { $tag_cloud_link->set_attribute_str('class', 'ultra-popular'); } $tag_cloud_link->set_attribute_str('rel', 'tag'); $tag_cloud_link_span = new HTMLTags_Span(); $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_embed_div() { $embed_div_style = <<<TXT width: 400px; margin: 20px auto;text-align: center; TXT; $embed_img_style = <<<TXT display: inline; margin: 0; padding: 0;vertical-align: middle; TXT; $embed_a_style = <<<TXT display: block;text-align:center; TXT; $embed_span_style = <<<TXT display: block; font-size: 90%; text-align: center; TXT; $embed_div = new HTMLTags_Div(); $embed_div->set_attribute_str('style', $embed_div_style); $product = $this->get_element(); $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('style', $embed_img_style); $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('style', $embed_img_style); $design_img_a = new HTMLTags_A(); $this_product_location = $this->get_absolute_product_page_url(); $design_img_a->set_href($this_product_location); $main_img_a = new HTMLTags_A(); $this_product_location = $this->get_absolute_product_page_url(); $main_img_a->set_href($this_product_location); $product_name_a = new HTMLTags_A(); $this_product_location = $this->get_absolute_product_page_url(); $product_name_a->set_href($this_product_location); $main_img_a->append_tag_to_content($main_medium_size_img); $design_img_a->append_tag_to_content($design_medium_size_img); $embed_div->append_tag_to_content($main_img_a); $embed_div->append_tag_to_content($design_img_a); $product_name = $product->get_name(); $shop_mention_span = new HTMLTags_Span('Only at the Connected Films Shop'); $shop_mention_span->set_attribute_str('style', $embed_span_style); $product_name_a->append_str_to_content($product_name); $product_name_a->set_attribute_str('style', $embed_a_style); $embed_div->append_tag_to_content($product_name_a); $embed_div->append_tag_to_content($shop_mention_span); return $embed_div; }
$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;
/** * The TD that shows the user what product they've put * in their basket. */ public function get_product_page_link_td() { $shopping_basket = $this->get_element(); #print_r($shopping_basket); #exit; $product = $shopping_basket->get_product(); $product_renderer = $product->get_renderer(); if ($product->has_main_photograph()) { $main_photograph = $product->get_main_photograph(); $main_photograph_renderer = $main_photograph->get_renderer(); $thumb_img = $main_photograph_renderer->get_thumbnail_img(); $thumb_str = $thumb_img->get_as_string(); } else { $thumb_str = '<img src="/plug-ins/shop/public-html/images/no-image-available-thumbnail.png" />'; } $product_page_link = new HTMLTags_A(); #$product_page_link->set_attribute_str('class', 'summary-link'); $product_page_location = $product_renderer->get_product_page_url(); $product_page_link->set_href($product_page_location); $product_page_link->append_str_to_content($thumb_str); $product_page_link->append_str_to_content($product->get_name()); $name_td = new HTMLTags_TD(); $name_td->append_tag_to_content($product_page_link); /* * The variation of this product (size and colour) */ $variation_p = new HTMLTags_P(); $variation_p->append_str_to_content('Size: '); $variation_p->append_str_to_content($shopping_basket->get('size')); $variation_p->append_str_to_content(' '); $variation_p->append_str_to_content('Colour: '); $variation_p->append_str_to_content($shopping_basket->get('colour')); $name_td->append_tag_to_content($variation_p); return $name_td; }