$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')); /* * CONNECTED FILMS SHOP IMAGE
/** * 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; }
$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'] . ' ' . $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 ';
$content_div->set_attribute_str('id', 'content'); if (isset($_GET['product_tag_id'])) { $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 ';
<?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();