public function get_mini_orders_for_current_session_div()
 {
     $mini_order_div = new HTMLTags_Div();
     $top_right_p = new HTMLTags_P('Shopping Basket');
     $top_right_p->set_attribute_str('class', 'top-right');
     $mini_order_div->append_tag_to_content($top_right_p);
     $mini_order_table = $this->get_mini_orders_for_current_session_table();
     $middle_right_div = new HTMLTags_Div();
     $middle_right_div->set_attribute_str('class', 'middle-right');
     $middle_right_div->append_tag_to_content($mini_order_table);
     $mini_order_div->append_tag_to_content($middle_right_div);
     $bottom_left_div = new HTMLTags_Div();
     $bottom_left_div->set_attribute_str('class', 'bottom-left');
     $bottom_right_p = new HTMLTags_P();
     $bottom_right_p->set_attribute_str('class', 'bottom-right');
     $go_to_basket_link = new HTMLTags_A();
     $go_to_basket_link->set_attribute_str('class', 'add-to-basket-link');
     $go_to_basket_link->set_attribute_str('id', 'add-to-basket-link');
     $go_to_basket_location = new HTMLTags_URL();
     $go_to_basket_location->set_file('/shopping-basket.html');
     $go_to_basket_link->set_href($go_to_basket_location);
     $go_to_basket_link->append_tag_to_content(new HTMLTags_Span('Go to Basket'));
     $bottom_right_p->append_tag_to_content($go_to_basket_link);
     $bottom_left_div->append_tag_to_content($bottom_right_p);
     $mini_order_div->append_tag_to_content($bottom_left_div);
     return $mini_order_div;
 }
 private static function get_link_p_to_admin_section(HTMLTags_A $a)
 {
     $p = new HTMLTags_P();
     $p->set_attribute_str('class', 'haddock_admin');
     $p->append($a);
     return $p;
 }
 public function __construct($message, $no_script_href = '', $status = NULL)
 {
     #echo "\$message: $message\n";
     #echo "\$no_script_href: $no_script_href\n";
     parent::__construct();
     $this->set_attribute_str('id', 'lastActionBox');
     #if (strlen($no_script_href) > 0) {
     #    $this->set_attribute_str('class', 'noscript');
     #}
     if ($status == 'error') {
         $this->set_attribute_str('class', 'error');
     }
     $p = new HTMLTags_P();
     $hide_a = new HTMLTags_A('Hide');
     $hide_a->set_attribute_str('id', 'lastActionBoxA');
     $hide_a->set_href(new HTMLTags_URL($no_script_href));
     #if (strlen($no_script_href) < 1) {
     #    $hide_a->set_href(new HTMLTags_URL('#'));
     #} else {
     #    $hide_a->set_href(new HTMLTags_URL($no_script_href));
     #}
     $hide_a->set_attribute_str('id', 'lastActionBoxHide');
     $hide_a->set_attribute_str('title', 'Hide this notice');
     $p->append_tag_to_content($hide_a);
     $p->append_str_to_content($message);
     $this->append_tag_to_content($p);
 }
 protected function get_message_div($msg)
 {
     $div = new HTMLTags_Div();
     $div->set_attribute_str('id', 'message');
     $p = new HTMLTags_P();
     $p->append($msg);
     $div->append($p);
     return $div;
 }
 public function get_mini_shopping_baskets_for_current_session_div()
 {
     $page_manager = PublicHTML_PageManager::get_instance();
     $mini_shopping_basket_div = new HTMLTags_Div();
     $top_right_p = new HTMLTags_P('Shopping Basket');
     $top_right_p->set_attribute_str('class', 'top-right');
     $mini_shopping_basket_div->append_tag_to_content($top_right_p);
     $mini_shopping_basket_table = $this->get_mini_shopping_baskets_for_current_session_table();
     $middle_right_div = new HTMLTags_Div();
     $middle_right_div->set_attribute_str('class', 'middle-right');
     $middle_right_div->append_tag_to_content($mini_shopping_basket_table);
     $mini_shopping_basket_div->append_tag_to_content($middle_right_div);
     $bottom_left_div = new HTMLTags_Div();
     $bottom_left_div->set_attribute_str('class', 'bottom-left');
     $bottom_right_p = new HTMLTags_P();
     $bottom_right_p->set_attribute_str('class', 'bottom-right');
     $basket_and_checkout_links_ul = new HTMLTags_UL();
     $basket_link_li = new HTMLTags_LI();
     $go_to_basket_link = new HTMLTags_A();
     $go_to_basket_link->set_attribute_str('class', 'mini-shopping-basket-add-to-basket-link');
     $go_to_basket_link->set_attribute_str('id', 'mini-shopping-basket-add-to-basket-link');
     $go_to_basket_location = new HTMLTags_URL();
     $go_to_basket_location->set_file('/hpi/shop/shopping-basket.html');
     $go_to_basket_link->set_href($go_to_basket_location);
     $go_to_basket_link->append_tag_to_content(new HTMLTags_Span('Go to Basket'));
     $basket_link_li->append_tag_to_content($go_to_basket_link);
     $basket_and_checkout_links_ul->append_tag_to_content($basket_link_li);
     if ($page_manager->get_page() != 'checkout') {
         $checkout_link_li = new HTMLTags_LI();
         $go_to_checkout_link = new HTMLTags_A();
         $go_to_checkout_link->set_attribute_str('class', 'mini-shopping-basket-go-to-checkout-link');
         $go_to_checkout_link->set_attribute_str('id', 'mini-shopping-basket-go-to-checkout-link');
         $go_to_checkout_location = new HTMLTags_URL();
         $go_to_checkout_location->set_file('/hpi/shop/checkout.html');
         $go_to_checkout_link->set_href($go_to_checkout_location);
         $go_to_checkout_link->append_tag_to_content(new HTMLTags_Span('Go to Checkout'));
         $checkout_link_li->append_tag_to_content($go_to_checkout_link);
         $basket_and_checkout_links_ul->append_tag_to_content($checkout_link_li);
     }
     //                $bottom_right_p->append_tag_to_content($go_to_basket_link);
     //                $bottom_right_p->append_tag_to_content($go_to_checkout_link);
     //                $bottom_right_p->append_tag_to_content($basket_and_checkout_links_ul);
     $middle_right_div->append_tag_to_content($basket_and_checkout_links_ul);
     $bottom_left_div->append_tag_to_content($bottom_right_p);
     $mini_shopping_basket_div->append_tag_to_content($bottom_left_div);
     return $mini_shopping_basket_div;
 }
 public function __construct($question, $action, $cancel, $yes_str = 'Yes', $no_str = 'No')
 {
     parent::__construct();
     $this->question = $question;
     $this->action = $action;
     $this->cancel = $cancel;
     $this->yes_str = $yes_str;
     $this->no_str = $no_str;
 }
 /**
  * The paragraph tag for a comment.
  *
  * This method is called in the public pages
  * to display a comment.
  */
 public function get_html_p()
 {
     $comment = $this->get_element();
     $html_p = new HTMLTags_P();
     $html_p->append_str_to_content('&quot;');
     $html_p->append_str_to_content($comment->get_comment());
     $html_p->append_str_to_content('&quot;');
     $html_p->append_str_to_content(' &#150; ');
     $html_p->append_str_to_content($comment->get_name());
     if ($comment->has_url()) {
         $html_p->append_str_to_content(', ');
         $html_p->append_tag_to_content($this->get_html_a());
     }
     return $html_p;
 }
 protected function get_last_action_div()
 {
     $div = new HTMLTags_Div();
     $div->set_attribute_str('class', 'last-action-div');
     /*
      * See if we edited anything
      */
     if (isset($_GET['edited']) && isset($_GET['message'])) {
         $p = new HTMLTags_P();
         if (isset($_GET['error'])) {
             $div->append('<p><em>Please contact your Website Administrator</em></p>');
             $p->append(urldecode($_GET['error']));
             $div->set_attribute_str('id', 'error');
         } else {
             $p->append($_GET['message']);
         }
         $div->append($p);
     }
     return $div;
 }
 /**
  * The paragraph tag for a web_video.
  *
  * This method is called in the public pages
  * to display a web_video.
  */
 public function get_html_p()
 {
     $person = $this->get_element();
     $html_p = new HTMLTags_P();
     $html_p->append_str_to_content('&quot;');
     $html_p->append_str_to_content($person->get_name());
     $html_p->append_str_to_content('&quot;');
     $html_p->append_str_to_content(' &#150; ');
     $html_p->append_str_to_content($person->get_email());
     return $html_p;
 }
 public function get_log_in_state_div()
 {
     $log_in_state_div = new HTMLTags_Div();
     $log_in_state_div->set_attribute_str('id', 'log-in-state');
     $logged_in_as_p = new HTMLTags_P();
     $logged_in_as_p->set_attribute_str('id', 'logged_in_as');
     $alm = Admin_LoginManager::get_instance();
     $logged_in_as_p->append_str_to_content('<em>User:</em> ' . $alm->get_name());
     $logged_in_as_p->append_str_to_content('&nbsp;');
     $logged_in_as_p->append_str_to_content('<em>Type:</em> ' . $alm->get_type());
     $log_in_state_div->append($logged_in_as_p);
     $log_out_div = new HTMLTags_Div();
     $log_out_div->set_attribute_str('id', 'log_out');
     $log_out_div->append_tag_to_content($alm->get_log_out_a());
     $log_in_state_div->append($log_out_div);
     return $log_in_state_div;
 }
if (isset($_GET['delete_id'])) {
    /**
     * Confirm deleting a row.
     */
    $row = $product_brands_table->get_row_by_id($_GET['delete_id']);
    $question_p = new HTMLTags_P();
    $question_p->set_attribute_str('class', 'question');
    $question_p->append_str_to_content('Are you sure that you want to delete this product brand?');
    $content_div->append_tag_to_content($question_p);
    /**
     * Show the user the data in the row.
     */
    $row_renderer = $row->get_renderer();
    $content_div->append_tag_to_content($row_renderer->get_admin_product_brand_html_table());
    # ------------------------------------------------------------------
    $answer_p = new HTMLTags_P();
    $answer_p->set_attribute_str('class', 'answer');
    $delete_link = new HTMLTags_A('DELETE');
    $delete_href = clone $redirect_script_url;
    $delete_href->set_get_variable('delete_id', $row->get_id());
    $delete_link->set_href($delete_href);
    $delete_link->set_attribute_str('class', 'cool_button');
    $delete_link->set_attribute_str('id', 'inline');
    $answer_p->append_tag_to_content($delete_link);
    $cancel_link = new HTMLTags_A('Cancel');
    $cancel_link->set_href($cancel_href);
    $cancel_link->set_attribute_str('class', 'cool_button');
    $cancel_link->set_attribute_str('id', 'inline');
    $answer_p->append_tag_to_content($cancel_link);
    $content_div->append_tag_to_content($answer_p);
} elseif (isset($_GET['edit_id'])) {
 public function get_drama_url_div(Oedipus_Drama $drama)
 {
     $div = new HTMLTags_Div();
     $div->append('<h3>Web address for this drama:</h3>');
     $p = new HTMLTags_P();
     $p->append(self::get_unique_link_for_drama($drama));
     $div->append($p);
     return $div;
 }
#    . 'HaddockProjectOrganisation_ProjectDirectoryFinder.inc.php';
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
#$find_button = new HTMLTags_Input();
#
#$find_button->set_attribute_str('type', 'button');
#$find_button->set_attribute_str('value', 'Find Classes');
#$find_button->set_attribute_str('onclick', 'find_classes()');
#
#$content_div->append_tag_to_content($find_button);
#
#$class_list_div = new HTMLTags_Div();
#$class_list_div->set_attribute_str('id', 'class_list');
#
#$content_div->append_tag_to_content($class_list_div);
$selection_p = new HTMLTags_P();
$selection_p->append_str_to_content('Look for subclasses of: ');
$project_directory_finder = HaddockProjectOrganisation_ProjectDirectoryFinder::get_instance();
$project_directory = $project_directory_finder->get_project_directory_for_this_project();
$php_class_files = $project_directory->get_php_class_files();
$class_list_select = new HTMLTags_Select();
$class_list_select->set_attribute_str('id', 'class_list_select');
$class_list_select->set_attribute_str('onchange', 'process()');
foreach ($php_class_files as $p_c_f) {
    $class_option = new HTMLTags_Option($p_c_f->get_php_class_name());
    $class_option->set_attribute_str('value', $p_c_f->get_php_class_name());
    $class_list_select->add_option($class_option);
}
$selection_p->append_tag_to_content($class_list_select);
$content_div->append_tag_to_content($selection_p);
$subclasses_list_div = new HTMLTags_Div();
 * Content of the "select-viewer" admin page.
 *
 * @copyright Clear Line Web Design, 2007-11-16
 */
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
/*
 * Link to a blank form in a new tab or window,
 * so that you can preserve the current query.
 */
if (isset($_GET['query'])) {
    $blank_form_link_a = new HTMLTags_A('New Form');
    $blank_form_link_a->set_attribute_str('target', '_blank');
    $blank_form_link_url = Admin_AdminIncluderURLFactory::get_url($section = 'haddock', $module = 'database', $page = 'select-viewer', $type = 'html');
    $blank_form_link_a->set_href($blank_form_link_url);
    $blank_form_link_p = new HTMLTags_P();
    $blank_form_link_p->append_tag_to_content($blank_form_link_a);
    $content_div->append_tag_to_content($blank_form_link_p);
}
/*
 * The form to take the query.
 */
$query_form = new HTMLTags_Form();
$query_form->set_attribute_str('id', 'query_form');
$query_form->set_attribute_str('method', 'GET');
$action_url = Admin_AdminIncluderURLFactory::get_url('haddock', 'database', 'select-viewer', 'html');
$slash_url = new HTMLTags_URL();
$slash_url->set_file('/');
$query_form->set_action($slash_url);
$get_vars = $action_url->get_get_variables();
foreach (array_keys($get_vars) as $key) {
Example #15
0
<?php

/**
 * The Product Page!
 * 
 * RFI & SANH 2007-03-02
 */
require_once PROJECT_ROOT . '/haddock/database/classes/' . 'Database_MySQLUserFactory.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();
$comments_table = $database->get_table('hpi_shop_comments');
if (isset($_GET['add_comment'])) {
    if ($_POST['name'] != '' && $_POST['email'] != '' && $_POST['comment'] != '') {
        $ip = $_SERVER['REMOTE_ADDR'];
        $last_added_id = $comments_table->add_comment($_POST['name'], $ip, $_POST['email'], $_POST['url'], $_POST['homepage_title'], $_POST['comment'], $_POST['product_id']);
        $form_notification = new HTMLTags_P('Thank you for your comment.<br />Comments can take up to 24 hours to appear in the shop.');
        echo $form_notification->get_as_string();
    } else {
        $form_notification = new HTMLTags_P('Please complete name, email and comment');
        echo $form_notification->get_as_string();
    }
}
 /**
  * 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('&nbsp;');
     $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;
 }
    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;
    }
<?php

/**
 * The div to tell the customer about which products are available in
 * the selected region in the shop plug-in.
 * 
 * @copyright Clear Line Web Design, 2007-07-26
 */
if (isset($_GET['customer_region_session'])) {
    $div_customer_region_notification = new HTMLTags_Div();
    $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_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']);
    $customer_region_blurb_p = new HTMLTags_P();
    $customer_region_blurb_p->append_str_to_content('These are the products available in&nbsp;');
    $customer_region_blurb_p->append_str_to_content($customer_region->get_name_with_the());
    $customer_region_blurb_p->append_str_to_content('.');
    $div_customer_region_notification->append_tag_to_content($customer_region_blurb_p);
    echo $div_customer_region_notification->get_as_string();
}
<?php

/**
 * Content of the page for refreshing the __autoload
 * function .INC file.
 *
 * @copyright Clear Line Web Design, 2007-05-11
 */
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_Div.inc.php';
require_once PROJECT_ROOT . '/haddock/html-tags/classes/standard/' . 'HTMLTags_P.inc.php';
require_once PROJECT_ROOT . '/haddock/haddock-project-organisation/classes/' . 'HaddockProjectOrganisation_ProjectDirectoryFinder.inc.php';
$project_directory_finder = HaddockProjectOrganisation_ProjectDirectoryFinder::get_instance();
$project_directory = $project_directory_finder->get_project_directory_for_this_project();
$project_specific_directory = $project_directory->get_project_specific_directory();
$autoload_inc_file = $project_specific_directory->get_autoload_inc_file();
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
$autoload_inc_file = $project_specific_directory->get_autoload_inc_file();
$last_modified_p = new HTMLTags_P();
$last_modified_p->append_str_to_content('The <code>__autoload()</code> .INC file was last modified on ');
$last_modified_p->append_str_to_content(date('r', $autoload_inc_file->mtime()));
$content_div->append_tag_to_content($last_modified_p);
$refresh_a = new HTMLTags_A('Refresh');
$refresh_url = new HTMLTags_URL();
$refresh_url->set_file('/admin/redirect-script.php');
$refresh_url->set_get_variable('module', 'haddock-project-organisation');
$refresh_url->set_get_variable('page', 'autoload-inc-file-creation');
$refresh_url->set_get_variable('refresh');
$refresh_a->set_href($refresh_url);
$content_div->append_tag_to_content($refresh_a);
echo $content_div->get_as_string();
<?php

/**
 * Link to the log out script of a page in the admin section.
 *
 * @copyright Clear Line Web Design, 2007-08-22
 */
$log_out_p = new HTMLTags_P();
$log_out_p->set_attribute_str('id', 'log_out');
$alm = Admin_LoginManager::get_instance();
$log_out_p->append_tag_to_content($alm->get_log_out_a());
echo $log_out_p->get_as_string();
            $enter_r_pw_p->append_str_to_content('Click ');
            $enter_r_pw_a = new HTMLTags_A('here');
            $enter_r_pw_url = new HTMLTags_URL('/admin/database/sign-in-as-root.html');
            $enter_r_pw_a->set_href($enter_r_pw_url);
            $enter_r_pw_p->append_tag_to_content($enter_r_pw_a);
            $enter_r_pw_p->append_str_to_content(' to try again.');
            $content_div->append_tag_to_content($enter_r_pw_p);
        } else {
            /*
             * A link to sign out.
             */
            #print_r($_SESSION);
            $root_pw_status_p = new HTMLTags_P();
            $root_pw_status_p->append_str_to_content('The root password has been entered.');
            $content_div->append_tag_to_content($root_pw_status_p);
            $sign_out_p = new HTMLTags_P();
            $sign_out_p->append_str_to_content('Click ');
            $sign_out_a = new HTMLTags_A('here');
            $sign_out_url = new HTMLTags_URL();
            $sign_out_url->set_file('/admin/redirect-script.php');
            $sign_out_url->set_get_variable('module', 'database');
            $sign_out_url->set_get_variable('page', 'sign-in-as-root');
            $sign_out_url->set_get_variable('sign_out');
            $sign_out_a->set_href($sign_out_url);
            $sign_out_p->append_tag_to_content($sign_out_a);
            $sign_out_p->append_str_to_content(' to sign out.');
            $content_div->append_tag_to_content($sign_out_p);
        }
    }
}
/*
<?php

/**
 * Content div of the page to explain that the page requested
 * does not exist.
 *
 * @copyright Clear Line Web Design, 2007-08-03
 */
/*
 * Create the singleton objects.
 */
$cmf = HaddockProjectOrganisation_ConfigManagerFactory::get_instance();
$cm = $cmf->get_config_manager('plug-ins', 'public-html');
/*
 * Create the HTML objects.
 */
$content_div = new HTMLTags_Div();
$content_div->set_attribute_str('id', 'content');
$error_p = new HTMLTags_P();
$error_p->set_attribute_str('class', 'error');
$error_p->append_str_to_content($cm->get_error_message_page_not_found());
$content_div->append_tag_to_content($error_p);
echo $content_div->get_as_string();
                     */
                    $sync_files_with_database_p = new HTMLTags_P('To synchronise the files with the database, click ');
                    $sync_files_with_database_a = new HTMLTags_A('here.');
                    $sync_files_with_database_url = new HTMLTags_URL();
                    $sync_files_with_database_url->set_file('/admin/redirect-script.php');
                    $sync_files_with_database_url->set_get_variable('module', 'database');
                    $sync_files_with_database_url->set_get_variable('page', 'table-structure-synchronisation');
                    $sync_files_with_database_url->set_get_variable('sync_files_with_db');
                    $sync_files_with_database_a->set_href($sync_files_with_database_url);
                    $sync_files_with_database_p->append_tag_to_content($sync_files_with_database_a);
                    #$sync_files_with_database_p->append_str_to_content('.');
                    $content_div->append_tag_to_content($sync_files_with_database_p);
                    /*
                     * ---------------------------------------------------------
                     */
                    $sync_database_with_files_p = new HTMLTags_P('To synchronise the database with the files, click ');
                    $sync_database_with_files_a = new HTMLTags_A('here.');
                    $sync_database_with_files_url = new HTMLTags_URL();
                    $sync_database_with_files_url->set_file('/admin/redirect-script.php');
                    $sync_database_with_files_url->set_get_variable('module', 'database');
                    $sync_database_with_files_url->set_get_variable('page', 'table-structure-synchronisation');
                    $sync_database_with_files_url->set_get_variable('sync_db_with_files');
                    $sync_database_with_files_a->set_href($sync_database_with_files_url);
                    $sync_database_with_files_p->append_tag_to_content($sync_database_with_files_a);
                    #$sync_database_with_files_p->append_str_to_content('.');
                    $content_div->append_tag_to_content($sync_database_with_files_p);
                }
            }
        }
    }
}
<?php

/**
 * The div to tell the customer which region they are currently set to.
 *
 * @copyright Clear Line Web Design, 2007-08-23
 */
$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_region = $customer_regions_table->get_row_by_id($_SESSION['customer_region_id']);
if ($customer_regions_table->count_all_rows() > 0) {
    $crn_div = new HTMLTags_Div();
    $customer_region = $customer_regions_table->get_current_customer_region();
    $customer_region_blurb_p = new HTMLTags_P();
    if (isset($_GET['customer_region_session'])) {
        $customer_region_blurb_p->append_str_to_content('You have set your region to&nbsp;');
    } else {
        $customer_region_blurb_p->append_str_to_content('Your region is set to&nbsp;');
    }
    $customer_region_blurb_p->append_str_to_content($customer_region->get_name_with_the());
    $customer_region_blurb_p->append_str_to_content('.');
    $crn_div->append_tag_to_content($customer_region_blurb_p);
    echo $crn_div->get_as_string();
}
<?php

/**
 * The p the link to the page for all the products.
 * 
 * @copyright Clear Line Web Design, 2007-07-26
 */
$all_products_link = new HTMLTags_A('See All Products');
$all_products_location = new HTMLTags_URL();
$all_products_location->set_file('/');
$all_products_location->set_get_variable('section', 'plug-ins');
$all_products_location->set_get_variable('module', 'shop');
$all_products_location->set_get_variable('page', 'products');
$all_products_location->set_get_variable('type', 'html');
$all_products_link->set_href($all_products_location);
$all_products_link_p = new HTMLTags_P();
$all_products_link_p->append_tag_to_content($all_products_link);
echo $all_products_link_p->get_as_string();
$row_class_files = $database_class_finder->get_row_class_files();
$row_renderer_files = $database_class_finder->get_row_renderer_files();
$field_class_files = $database_class_finder->get_field_class_files();
$field_renderer_files = $database_class_finder->get_field_renderer_files();
/*
 * -----------------------------------------------------------------------------
 * Show the user their options.
 * -----------------------------------------------------------------------------
 */
/*
 * Create a nicely formatted file name for the project directory.
 */
$p_r_formatted = new Formatting_FileName(PROJECT_ROOT);
$p_r_formatted_pre = new HTMLTags_Pre($p_r_formatted->get_pretty_name());
if (count($database_class_files) + count($database_renderer_files) + count($table_class_files) + count($table_renderer_files) + count($row_class_files) + count($row_renderer_files) + count($field_class_files) + count($field_renderer_files) == 0) {
    $p = new HTMLTags_P();
    $p->append_str_to_content('No classes found in:');
    $p->append_tag_to_content($p_r_formatted_pre);
    $content_div->append_tag_to_content($p);
} else {
    $database_classes_heading = new HTMLTags_Heading(3, 'Database Classes found in ');
    $content_div->append_tag_to_content($database_classes_heading);
    $content_div->append_tag_to_content($p_r_formatted_pre);
    /*
     * -------------------------------------------------------------------------
     */
    $d_c_n_c_form = new HTMLTags_Form();
    $d_c_n_c_form->set_attribute_str('name', 'database_class_names_committing');
    $d_c_n_c_form->set_attribute_str('action', '/admin/redirect-script.php?module=database&page=database-class-finding');
    $d_c_n_c_form->set_attribute_str('method', 'POST');
    $d_c_n_c_form->set_attribute_str('class', 'basic-form');
                $db_user_not_yet_p = new HTMLTags_P();
                $db_user_not_yet_p->set_attribute_str('class', 'error');
                $db_user_not_yet_p->append_str_to_content('The database user for this project does not exist yet!');
                $content_div->append_tag_to_content($db_user_not_yet_p);
                /*
                 * -------------------------------------------------------------
                 */
                $create_db_user_p = new HTMLTags_P();
                $create_db_user_p->append_str_to_content('Click ');
                $create_db_user_a = new HTMLTags_A('here');
                $create_db_user_url = new HTMLTags_URL();
                $create_db_user_url->set_file('/admin/redirect-script.php');
                $create_db_user_url->set_get_variable('module', 'database');
                $create_db_user_url->set_get_variable('page', 'user-management');
                $create_db_user_url->set_get_variable('create_db_user');
                $create_db_user_a->set_href($create_db_user_url);
                $create_db_user_p->append_tag_to_content($create_db_user_a);
                $create_db_user_p->append_str_to_content(' to create it.');
                $content_div->append_tag_to_content($create_db_user_p);
            } else {
                $db_user_already_p = new HTMLTags_P();
                $db_user_already_p->append_str_to_content('The database user for this project exists.');
                $content_div->append_tag_to_content($db_user_already_p);
            }
        }
    }
}
/*
 * -----------------------------------------------------------------------------
 */
echo $content_div;
    public function get_widget_content()
    {
        $mysql_user_factory = Database_MySQLUserFactory::get_instance();
        $mysql_user = $mysql_user_factory->get_for_this_project();
        $database = $mysql_user->get_database();
        $people_table = $database->get_table('hpi_mailing_list_people');
        $widget_div = new HTMLTags_Div();
        $rows_html_ul = new HTMLTags_UL();
        $rows_html_ul->set_attribute_str('class', 'people');
        $query = <<<SQL
SELECT *
FROM hpi_mailing_list_people
WHERE status = 'new' OR status = 'accepted'
ORDER BY `added` DESC
LIMIT 0, 5
SQL;
        try {
            $rows = $people_table->get_rows_for_select($query);
        } catch (Exception $e) {
        }
        if (count($rows) > 0) {
            $explanation_p = new HTMLTags_P();
            $explanation_txt = <<<TXT
The last five people to join the list:
TXT;
            $explanation_p->append($explanation_txt);
            $widget_div->append($explanation_p);
            foreach ($rows as $row) {
                $li = new HTMLTags_LI();
                $li->append_str_to_content($row->get_name() . '&nbsp;(' . $row->get_email() . ')');
                $rows_html_ul->append_tag_to_content($li);
            }
        } else {
            $no_people_p = new HTMLTags_P();
            $no_people_txt = <<<TXT
There are no people in the Mailing List.
TXT;
            $no_people_p->append($no_people_txt);
            $widget_div->append($no_people_p);
        }
        $widget_div->append_tag_to_content($rows_html_ul);
        $widget_div->append(self::get_mailing_list_links_ul());
        return $widget_div;
    }
    public function get_order_editing_description_p()
    {
        $text = <<<TXT
If the status is pending, the payment has not been confirmed yet. If the status is paid, the payment is confirmed. Set the status to dispatched once you have sent the item off.
TXT;
        $description_p = new HTMLTags_P($text);
        $description_p->set_attribute_str('class', 'form_explanation');
        return $description_p;
    }
        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&nbsp;';
        $this_product_category_inactive_text .= $product_category->get_name();
        $this_product_category_inactive_text .= '&nbsp;available in&nbsp;';
        $this_product_category_inactive_text .= $customer_region->get_name_with_the();
        $this_product_category_inactive_text .= '.';
        $this_product_category_inactive_p = new HTMLTags_P($this_product_category_inactive_text);
        $content_div->append_tag_to_content($this_product_category_inactive_p);
        $all_products_available_text = 'See all products available in&nbsp;';
        $all_products_available_text .= $customer_region->get_name_with_the();
        $all_products_link = new HTMLTags_A($all_products_available_text);
        $all_products_location = clone $current_page_url;
        $all_products_location->set_get_variable('page', 'products');
        $all_products_location->set_get_variable('customer_region_session', $customer_region->get_id());
        $all_products_link->set_href($all_products_location);
        $all_products_available_p = new HTMLTags_P();
        $all_products_available_p->append_tag_to_content($all_products_link);
        $content_div->append_tag_to_content($all_products_available_p);
    }
} elseif (!isset($_GET['product_category_id'])) {
    $content_div->append_str_to_content($page_manager->get_inc_file_as_string('body.div.product_category_id-missing'));
}
echo $content_div->get_as_string();