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;
 }
 */
#$pdf = HaddockProjectOrganisation_ProjectDirectoryFinder::get_instance();
#$project_directory = $pdf->get_project_directory_for_this_project();
#
#$config_file = $project_directory->get_config_file();
/*
 * Find the module config manager.
 */
$cmf = HaddockProjectOrganisation_ConfigManagerFactory::get_instance();
$config_manager = $cmf->get_config_manager('haddock', 'haddock-project-organisation');
/*
 * Create the HTML tags objects.
 */
$div_header = new HTMLTags_Div();
$div_header->set_attribute_str('id', 'header');
$h1_title = new HTMLTags_Heading(1);
#$home_link = new HTMLTags_A($config_file->get_project_title());
#$element_names = array('project', 'name');
#
#if ($config_manager->has_nested_config_variable($element_names)) {
#	$home_link = new HTMLTags_A($config_manager->get_nested_config_variable($element_names));
#
#	$home_link->set_href(new HTMLTags_URl('/'));
#
#	$h1_title->append_tag_to_content($home_link);
#
#	$div_header->append_tag_to_content($h1_title);
#
#	echo $div_header->get_as_string();
#}
$home_link = new HTMLTags_A($config_manager->get_project_name());
 */
/* Code copied from new style Admin_HTMLPage
 * to give old-style admin pages the same look
 */
$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();
$config_manager = $cmf->get_config_manager('haddock', '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);
echo $image_div->get_as_string();
$h1_title = new HTMLTags_Heading(1);
$home_link = new HTMLTags_A(HaddockProjectOrganisation_ProjectInformationHelper::get_title());
$home_link->set_href(new HTMLTags_URl('/'));
$h1_title->append_tag_to_content($home_link);
echo $h1_title->get_as_string();
$gvm = Caching_GlobalVarManager::get_instance();
echo "<h2>\n";
//
//echo "Admin\n";
//
//echo "&nbsp;&gt;&nbsp;\n";
#echo $current_module_directory->get_admin_section_title();
#echo "\n";
#print_r($current_admin_page_directory);
//if (isset($current_admin_page_directory)) {
//    echo "&nbsp;&gt;&nbsp;\n";
$page_manager = PublicHTML_PageManager::get_instance();
$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_title);
$main_page_header_h->set_attribute_str('class', 'logo');
$main_page_header_h->set_attribute_str('id', $main_page_header_id);
$content_div->append_tag_to_content($main_page_header_h);
/*
 * Welcome DIV
 */
$welcome_div = new HTMLTags_Div();
$welcome_div->set_attribute_str('id', 'welcome');
// IF LOGGED IN MESSAGE
if ($logged_in) {
    $welcome_div->append_str_to_content($page_manager->get_inc_file_as_string('body.p.logged-in-salutation'));
}
// WELCOME MESSAGE
$welcome_div->append_str_to_content($page_manager->get_inc_file_as_string('body.p.welcome-message'));
/*
<?php

/**
 * The header of the log in page.
 *
 * @copyright Clear Line Web Design, 2007-08-21
 */
$main_page_header_id = 'login';
$main_page_header_title = 'Customer Login';
$main_page_header_class = 'login';
$main_page_header_h = new HTMLTags_Heading(2);
$main_page_header_h->set_attribute_str('class', $main_page_header_class);
$main_page_header_h->set_attribute_str('id', $main_page_header_id);
$main_page_header_h->append_tag_to_content(new HTMLTags_Span($main_page_header_title));
echo $main_page_header_h->get_as_string();
$customers_table = $database->get_table('hpi_shop_customers');
$customers_table_renderer = $customers_table->get_renderer();
//$customers_table = $database->get_tusersable('hpi_shop_customers');
//$products_table_renderer = $products_table->get_renderer();
//$shopping_baskets_table = $database->get_table('hpi_shop_shopping_baskets');
//$shopping_baskets_table_renderer = $shopping_baskets_table->get_renderer();
// CONTENT DIV
//$wrapper_div = new HTMLTags_Div();
//$wrapper_div->set_attribute_str('id', 'wrapper');
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
// Show The Header
$main_page_header_id = 'login';
$main_page_header_title = 'Login';
$main_page_header_class = 'login';
$main_page_header_h = new HTMLTags_Heading(2);
$main_page_header_h->set_attribute_str('class', $main_page_header_class);
$main_page_header_h->set_attribute_str('id', $main_page_header_id);
$main_page_header_h->append_tag_to_content(new HTMLTags_Span($main_page_header_title));
$content_div->append_tag_to_content($main_page_header_h);
// Already Logged in?
#if ($logged_in) {
if ($log_in_manager->is_logged_in()) {
    $already_logged_in_div = new HTMLTags_Div();
    $already_logged_in_div->set_attribute_str('id', 'already_logged_in_div');
    // Already logged in
    // You are logged in as Mr. X.
    $p_text = <<<TXT
You are logged in as&nbsp;
TXT;
    $p_text .= $log_in_manager->get_login_name();
 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;
 }
/**
 * The header include for
 * the Connected Films Shop.
 * 
 * @copyright Clear Line Web Design, 2006-09-27
 */
require_once PROJECT_ROOT . '/haddock/database/classes/' . 'Database_MySQLUserFactory.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_Div.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_UL.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_LI.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/' . 'HTMLTags_URL.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_Heading.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_A.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_P.inc.php';
$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');
$header_div = new HTMLTags_Div();
$header_div->set_attribute_str('id', 'header');
$logo_span = new HTMLTags_Span();
$header_div->append_tag_to_content($logo_span);
$header_div_header_id = 'connected_films_shop';
$header_div_header_title = 'Connected Films Shop';
$header_div_header_class = 'header';
$header_div_header_h = new HTMLTags_Heading(1);
$header_div_header_h->set_attribute_str('class', $header_div_header_class);
$header_div_header_h->set_attribute_str('id', $header_div_header_id);
$header_div->append_tag_to_content($header_div_header_h);
//$header_div->append_tag_to_content(new HTMLTags_P('Buy a DVD!'));
echo $header_div;
 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_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('&nbsp;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&nbsp;
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&nbsp;' . $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;
    }
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
if (isset($_GET['product_category_id'])) {
    $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'] . '&nbsp;' . $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']);
 * @copyright Clear Line Web Design, 2007-08-22
 * @copyright 2009-10-08, Robert Impey
 */
$header_div = new HTMLTags_Div();
$header_div->set_attribute_str('id', 'header');
/* Code copied from new style Admin_HTMLPage
 * to give old-style admin pages the same look
 */
$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);
$header_div->append($image_div);
$h1_title = new HTMLTags_Heading(1);
$home_link = new HTMLTags_A(HaddockProjectOrganisation_ProjectInformationHelper::get_title());
$home_link->set_href(new HTMLTags_URl('/'));
$h1_title->append_tag_to_content($home_link);
$header_div->append($h1_title);
$header_div->append_tag_to_content(new HTMLTags_Heading(2, 'Login'));
echo $header_div->get_as_string();
<?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 heading of the page where the user confirms that
 * they want to reset their password.
 *
 * @copyright Clear Line Web Design, 2007-09-24
 */
$reset_password_heading = new HTMLTags_Heading(2, 'Reset Password');
echo $reset_password_heading->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 &gt; table');
if (isset($table)) {
    $header_title->append_str_to_content(' &gt; ' . $table->get_name());
}
echo $header_title->get_as_string();