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;
 }
 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);
 }
 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;
 }
 protected function get_add_act_li()
 {
     $li = new HTMLTags_LI();
     $a = new HTMLTags_A('Add Act');
     $a->set_attribute_str('id', 'add');
     $a->set_attribute_str('title', 'Add an Act');
     $a->set_href(Oedipus_DramaHelper::get_add_act_url($this->drama->get_id()));
     $li->append($a);
     return $li;
 }
 public static function get_link_a_with_span($node)
 {
     $span = new HTMLTags_Span();
     $span->append($node['url_title']);
     $a = new HTMLTags_A();
     $a->append($span);
     $a->set_href(HTMLTags_URL::parse_and_make_url($node['url_href']));
     $a->set_attribute_str('title', $node['url_title']);
     if ($node['open_in_new_window'] == 'Yes') {
         #echo ' target="_blank" ';
         $a->set_attribute_str('target', '_blank');
     }
     return $a;
 }
 public static function get_spans($str_to_split, $num_displayed_char)
 {
     $spans = array();
     $str_to_split_shortened = '';
     # Shorten the string if it needs it
     $max_length = $num_displayed_char;
     if (strlen($str_to_split) > $max_length) {
         # $str_to_split_shortened = substr($str_to_split, 0, $max_length);
         # $pos = strrpos($str_to_split, " ");
         #
         # if($pos === false) {
         #        $str_to_split_shortened = substr($str_to_split, 0, $max_length)."...";
         #
         # }
         #
         #$str_to_split_shortened =  substr($str_to_split, 0, $pos)."...";
         $str_to_split_shortened = substr($str_to_split, 0, $max_length);
         $truncated_span = new HTMLTags_Span();
         $truncated_span->set_attribute_str('class', 'truncated');
         $truncated_span->append_str_to_content($str_to_split_shortened);
         $truncated_span->append_str_to_content('&nbsp;');
         $truncated_span_show_link = new HTMLTags_A('More...');
         #$truncated_span_show_link->set_attribute_str('onclick', 'javascript: showInline(');
         $truncated_span_show_link->set_attribute_str('class', 'show');
         $truncated_span_show_link->set_attribute_str('title', 'Show the rest of this text');
         $truncated_span_show_location = new HTMLTags_URL();
         $truncated_span_show_location->set_file('#');
         $truncated_span_show_link->set_href($truncated_span_show_location);
         $truncated_span->append_tag_to_content($truncated_span_show_link);
         array_push($spans, $truncated_span);
         $full_span = new HTMLTags_Span();
         $full_span->set_attribute_str('class', 'full');
         $full_span->append_str_to_content($str_to_split);
         $full_span->append_str_to_content('&nbsp;');
         $full_span_hide_link = new HTMLTags_A('...Hide');
         $full_span_hide_link->set_attribute_str('class', 'hide');
         $full_span_hide_link->set_attribute_str('title', 'hide the rest of this text');
         $full_span_hide_location = new HTMLTags_URL();
         $full_span_hide_location->set_file('#');
         $full_span_hide_link->set_href($full_span_hide_location);
         $full_span->append_tag_to_content($full_span_hide_link);
         array_push($spans, $full_span);
     } else {
         $full_span = new HTMLTags_Span();
         $full_span->append_str_to_content($str_to_split);
         array_push($spans, $full_span);
     }
     return $spans;
 }
 private static function get_link_a_to_admin_section($link_text, HTMLTags_URL $href)
 {
     $a = new HTMLTags_A($link_text);
     $a->set_href($href);
     $a->set_attribute_str('target', '_blank');
     return $a;
 }
 public function get_admin_currencies_html_table_tr($current_page_url)
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     /*
      * The data.
      */
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $iso_4217_code_field = $table->get_field('iso_4217_code');
     $iso_4217_code_td = $this->get_data_html_table_td($iso_4217_code_field);
     $html_row->append_tag_to_content($iso_4217_code_td);
     $symbol_field = $table->get_field('symbol');
     $symbol_td = $this->get_data_html_table_td($symbol_field);
     $html_row->append_tag_to_content($symbol_td);
     /*
      * The edit td.
      */
     $edit_td = new HTMLTags_TD();
     $edit_link = new HTMLTags_A('Edit');
     $edit_link->set_attribute_str('class', 'cool_button');
     $edit_link->set_attribute_str('id', 'edit_table_button');
     $edit_location = clone $current_page_url;
     $edit_location->set_get_variable('edit_id', $row->get_id());
     $edit_link->set_href($edit_location);
     $edit_td->append_tag_to_content($edit_link);
     $html_row->append_tag_to_content($edit_td);
     /*
      * The delete td.
      */
     $delete_td = new HTMLTags_TD();
     $delete_link = new HTMLTags_A('Delete');
     $delete_link->set_attribute_str('class', 'cool_button');
     $delete_link->set_attribute_str('id', 'delete_table_button');
     $delete_location = clone $current_page_url;
     $delete_location->set_get_variable('delete_id', $row->get_id());
     $delete_link->set_href($delete_location);
     $delete_td->append_tag_to_content($delete_link);
     $html_row->append_tag_to_content($delete_td);
     return $html_row;
 }
 public static function get_link_to_edit_video_admin_page_div($video_id)
 {
     $div = new HTMLTags_Div();
     $div->set_attribute_str('class', 'admin');
     $a = new HTMLTags_A('Edit this Video');
     $a->set_attribute_str('class', 'edit');
     $a->set_href(VideoLibrary_URLHelper::get_edit_external_video_admin_page_url($video_id));
     $div->append($a);
     return $div;
 }
 public static function get_frame_png_thumbnail_img_a(Oedipus_Frame $frame, $max_width = 250, $max_height = 185)
 {
     $url = Oedipus_DramaHelper::get_drama_page_url_for_frame_id($frame->get_id());
     $a = new HTMLTags_A();
     $a->set_href($url);
     $a->set_attribute_str('title', 'View this Frame');
     $img = self::get_frame_png_thumbnail_img($frame, $max_width, $max_height);
     $a->append_tag_to_content($img);
     return $a;
 }
 private function get_share_drama_li()
 {
     $share_drama_url = $this->get_share_drama_url();
     $link = new HTMLTags_A('Share this Drama');
     $link->set_href($share_drama_url);
     $link->set_attribute_str('id', 'selected');
     $li = new HTMLTags_LI();
     $li->append_tag_to_content($link);
     $li->set_attribute_str('id', 'share-drama');
     return $li;
 }
 private function get_shop_plug_in_action_td($location, $a_text, $a_id, $id_get_var_name)
 {
     $td = new HTMLTags_TD();
     $row = $this->get_element();
     $link = new HTMLTags_A($a_text);
     $link->set_attribute_str('class', 'cool_button');
     $link->set_attribute_str('id', $a_id);
     // horrible bug fix where it seems to be passing the same location
     // over and over again, with all previous get variables intact!
     if ($location->is_get_variable_set('edit_id')) {
         $location->unset_get_variable('edit_id');
     }
     if ($location->is_get_variable_set('delete_id')) {
         $location->unset_get_variable('delete_id');
     }
     $location->set_get_variable($id_get_var_name, $row->get_id());
     $link->set_href($location);
     $td->append_tag_to_content($link);
     return $td;
 }
 public function get_set_image_link_td()
 {
     $set_image_link_td = new HTMLTags_TD();
     $product = $this->get_element();
     $link = new HTMLTags_A('Set Image');
     $link->set_attribute_str('class', 'cool_button');
     $url = Admin_AdminIncluderURLFactory::get_url('plug-ins', 'trackit-stock-management', 'set-product-image', 'html');
     $url->set_get_variable('product_id', $product->get_id());
     $link->set_href($url);
     $set_image_link_td->append_tag_to_content($link);
     return $set_image_link_td;
 }
 private function get_admin_users_td($a_text, $admin_page)
 {
     $user_row = $this->get_element();
     $td = new HTMLTags_TD();
     $confirm_url = Admin_AdminIncluderURLFactory::get_url('haddock', 'admin', $admin_page, 'html');
     $confirm_url->set_get_variable('user_id', $user_row->get_id());
     $a = new HTMLTags_A($a_text);
     $a->set_href($confirm_url);
     $a->set_attribute_str('class', 'cool_button');
     $td->append_tag_to_content($a);
     return $td;
 }
 public static function get_thumbnail_div_for_video($video_data, $options = array('admin' => FALSE))
 {
     $div = new HTMLTags_Div();
     $div->set_attribute_str('class', 'video');
     $url = VideoLibrary_URLHelper::get_video_page_url($video_data['id'], $video_data['name']);
     $img_a = new HTMLTags_A();
     $img_a->set_href($url);
     $img_a->append(self::get_thumbnail_img($video_data['thumbnail_url']));
     $details_ul = new HTMLTags_UL();
     $details_ul->set_attribute_str('class', 'details');
     $name_a = new HTMLTags_A();
     $name_a->set_attribute_str('class', 'text');
     $name_a->set_href($url);
     $name_a->set_attribute_str('title', stripslashes($video_data['name']));
     $name_a->append(self::truncate_video_name(stripslashes($video_data['name']), 50));
     $name_li = new HTMLTags_LI();
     $name_li->set_attribute_str('class', 'name');
     $name_li->append($name_a);
     $details_ul->append($name_li);
     $length_min = self::get_minutes_from_seconds($video_data['length_seconds']);
     $details_ul->append('<li class="length">' . $length_min . ' min</li>');
     $details_ul->append('<li class="views">' . $video_data['views'] . ' views</li>');
     $provider_img = self::get_img_for_external_provider_name($video_data['external_video_provider_name'], 16);
     $provider_img->set_attribute_str('class', 'provider');
     $div->append($img_a);
     $div->append($details_ul);
     $div->append($provider_img);
     if ($options['admin'] && Admin_LogInHelper::is_logged_id()) {
         $links_ul = new HTMLTags_UL();
         $links_ul->set_attribute_str('class', 'options');
         $edit_li = '<li>' . VideoLibrary_AdminHelper::get_link_to_edit_video_admin_page_div($video_data['id'])->get_as_string() . '</li>';
         $links_ul->append($edit_li);
         $div->append($links_ul);
         $div->append('<hr />');
     }
     return $div;
 }
 public function get_first_tier_navigation_ul()
 {
     $pages = $this->get_pages_for_first_tier_navigation();
     $ul = new HTMLTags_UL();
     foreach ($pages as $page) {
         $li = new HTMLTags_LI();
         if (($this->get_current_page_class_string() == 'VideoLibrary_SearchPage' || $this->get_current_page_class_string() == 'VideoLibrary_HomePage') && $page['name'] == 'home' || $this->get_current_page_class_string() == 'VideoLibrary_TagsPage' && $page['name'] == 'tags') {
             $li->set_attribute_str('class', 'selected');
         }
         $a = new HTMLTags_A();
         $url = new HTMLTags_URL();
         $url->set_file($page['href']);
         $a->set_href($url);
         if ($page['open-in-new-window'] == 'yes') {
             $a->set_attribute_str('target', '_blank');
         }
         $span = new HTMLTags_Span($page['title']);
         $a->append($span);
         $li->append($a);
         $ul->append($li);
     }
     return $ul;
 }
 public function get_title_a()
 {
     $page_row = $this->get_element();
     $title_a = new HTMLTags_A($page_row->get_title());
     $title_a->set_href($page_row->get_page_url());
     $title_a->set_attribute_str('target', '_blank');
     return $title_a;
 }
 public function get_admin_customer_regions_html_table_tr($current_page_url)
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     /*
      * The data.
      */
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $description_field = $table->get_field('description');
     $description_td = $this->get_data_html_table_td($description_field);
     $html_row->append_tag_to_content($description_td);
     $currency_td = $this->get_currency_td();
     $html_row->append_tag_to_content($currency_td);
     $language_td = $this->get_language_td();
     $html_row->append_tag_to_content($language_td);
     $suppliers_td = $this->get_suppliers_td();
     $html_row->append_tag_to_content($suppliers_td);
     $sort_order_field = $table->get_field('sort_order');
     $sort_order_td = $this->get_data_html_table_td($sort_order_field);
     $html_row->append_tag_to_content($sort_order_td);
     /*
      * The set_suppliers td.
      */
     $set_suppliers_td = new HTMLTags_TD();
     $set_suppliers_link = new HTMLTags_A('Set Suppliers');
     $set_suppliers_link->set_attribute_str('class', 'cool_button');
     $set_suppliers_link->set_attribute_str('id', 'set_suppliers_table_button');
     $set_suppliers_location = clone $current_page_url;
     $set_suppliers_location->set_get_variable('suppliers');
     $set_suppliers_location->set_get_variable('customer_region_id', $row->get_id());
     $set_suppliers_link->set_href($set_suppliers_location);
     $set_suppliers_td->append_tag_to_content($set_suppliers_link);
     $html_row->append_tag_to_content($set_suppliers_td);
     /*
      * The edit td.
      */
     $edit_td = new HTMLTags_TD();
     $edit_link = new HTMLTags_A('Edit');
     $edit_link->set_attribute_str('class', 'cool_button');
     $edit_link->set_attribute_str('id', 'edit_table_button');
     $edit_location = clone $current_page_url;
     $edit_location->set_get_variable('edit_id', $row->get_id());
     $edit_link->set_href($edit_location);
     $edit_td->append_tag_to_content($edit_link);
     $html_row->append_tag_to_content($edit_td);
     /*
      * The delete td.
      */
     $delete_td = new HTMLTags_TD();
     $delete_link = new HTMLTags_A('Delete');
     $delete_link->set_attribute_str('class', 'cool_button');
     $delete_link->set_attribute_str('id', 'delete_table_button');
     $delete_location = clone $current_page_url;
     $delete_location->set_get_variable('delete_id', $row->get_id());
     $delete_link->set_href($delete_location);
     $delete_td->append_tag_to_content($delete_link);
     $html_row->append_tag_to_content($delete_td);
     return $html_row;
 }
                        $row_tr->append_tag_to_content($data_td);
                    } else {
                        $data_td = new HTMLTags_TD('not set');
                        $row_tr->append_tag_to_content($data_td);
                    }
                } catch (Exception $e) {
                    $data_td = new HTMLTags_TD('not set');
                    $row_tr->append_tag_to_content($data_td);
                }
            }
            /*
             * The edit td.
             */
            $edit_td = new HTMLTags_TD();
            $edit_link = new HTMLTags_A('Edit');
            $edit_link->set_attribute_str('class', 'cool_button');
            $edit_link->set_attribute_str('id', 'edit_table_button');
            $edit_location = clone $current_page_url;
            $edit_location->set_get_variable('edit_row', '1');
            $edit_location->set_get_variable('supplier_id', $supplier->get_id());
            $edit_location->set_get_variable('product_category_id', $product_category->get_id());
            $edit_link->set_href($edit_location);
            $edit_td->append_tag_to_content($edit_link);
            $row_tr->append_tag_to_content($edit_td);
            $supplier_table->append_tag_to_content($row_tr);
        }
        $content_div->append_tag_to_content($supplier_table);
    }
    # ------------------------------------------------------------------
}
echo $content_div->get_as_string();
     */
    $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'])) {
    /**
     * Row editing.
     */
    $product_brand_row = $product_brands_table->get_row_by_id($_GET['edit_id']);
    $product_brand_row_renderer = $product_brand_row->get_renderer();
    $row_editing_form = $product_brand_row_renderer->get_product_brand_editing_form($redirect_script_url, $cancel_href);
    $content_div->append_tag_to_content($row_editing_form);
} elseif (isset($_GET['add_row'])) {
    /**
     * Row Adding.
     */
    $redirect_script_url->set_get_variable('type', 'redirect-script');
    $redirect_script_url->set_get_variable('log_in', '1');
    if (isset($_GET['return_to'])) {
        $redirect_script_url->set_get_variable('return_to', $_GET['return_to']);
    }
    $cancel_href = new HTMLTags_URL();
    $cancel_href->set_file('/log-in.html');
    $customer_log_in_form = $customers_table_renderer->get_customer_log_in_form($redirect_script_url, $cancel_href);
    $log_in_to_account_div->append_tag_to_content($customer_log_in_form);
}
$content_div->append_tag_to_content($log_in_to_account_div);
// Create new account (go to customer-details.html)
$create_new_customer_div = new HTMLTags_Div();
$create_new_customer_div->set_attribute_str('id', 'create_new_customer_div');
$create_new_customer_link = new HTMLTags_A('Create New Customer');
$create_new_customer_link->set_attribute_str('class', 'cool_button');
$create_new_customer_link->set_attribute_str('id', 'create_new_customer_button');
$create_new_customer_location = new HTMLTags_URL();
$create_new_customer_location->set_file('/');
$create_new_customer_location->set_get_variable('page', 'customer-details');
if (isset($_GET['return_to'])) {
    $create_new_customer_location->set_get_variable('return_to', $_GET['return_to']);
}
$create_new_customer_link->set_href($create_new_customer_location);
$create_new_customer_div->append_tag_to_content($create_new_customer_link);
$content_div->append_tag_to_content($create_new_customer_div);
// Blurb at bottom
$p_text = <<<TXT
We hope you have a pleasant login experience.
TXT;
$content_div->append_tag_to_content(new HTMLTags_P($p_text));
 public function get_admin_suppliers_html_table_tr($current_page_url)
 {
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     //        name notes');
     //            foreach ($field_names as $field_name) {
     //                $heading_row->append_sortable_field_name($field_name);
     //            }
     //
     //           $currency_header = new HTMLTags_TH('Currency');
     //            $heading_row->append_tag_to_content($currency_header);
     //           $address_header = new HTMLTags_TH('Address');
     //            $heading_row->append_tag_to_content($address_header);
     //           $email_address_header = new HTMLTags_TH('Email Address');
     //            $heading_row->append_tag_to_content($email_address_header);
     //           $telephone_header = new HTMLTags_TH('Telephone');
     //            $heading_row->append_tag_to_content($telephone_header);
     /*
      * The data.
      */
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $contact_name_field = $table->get_field('contact_name');
     $contact_name_td = $this->get_data_html_table_td($contact_name_field);
     $html_row->append_tag_to_content($contact_name_td);
     $notes_field = $table->get_field('notes');
     $notes_td = $this->get_data_html_table_td($notes_field);
     $html_row->append_tag_to_content($notes_td);
     $currency_td = $this->get_currency_td();
     $html_row->append_tag_to_content($currency_td);
     $address_td = $this->get_address_td();
     $html_row->append_tag_to_content($address_td);
     $email_address_td = $this->get_email_address_td();
     $html_row->append_tag_to_content($email_address_td);
     $telephone_number_td = $this->get_telephone_number_td();
     $html_row->append_tag_to_content($telephone_number_td);
     /*
      * The edit td.
      */
     $edit_td = new HTMLTags_TD();
     $edit_link = new HTMLTags_A('Edit');
     $edit_link->set_attribute_str('class', 'cool_button');
     $edit_link->set_attribute_str('id', 'edit_table_button');
     $edit_location = clone $current_page_url;
     $edit_location->set_get_variable('edit_id', $row->get_id());
     $edit_link->set_href($edit_location);
     $edit_td->append_tag_to_content($edit_link);
     $html_row->append_tag_to_content($edit_td);
     /*
      * The delete td.
      */
     $delete_td = new HTMLTags_TD();
     $delete_link = new HTMLTags_A('Delete');
     $delete_link->set_attribute_str('class', 'cool_button');
     $delete_link->set_attribute_str('id', 'delete_table_button');
     $delete_location = clone $current_page_url;
     $delete_location->set_get_variable('delete_id', $row->get_id());
     $delete_link->set_href($delete_location);
     $delete_td->append_tag_to_content($delete_link);
     $html_row->append_tag_to_content($delete_td);
     return $html_row;
 }
<?php

/**
 * Give the customer a chance to create a new account.
 *
 * @copyright Clear Line Web Design, 2007-09-21
 */
$existing_customer_log_in_div = new HTMLTags_Div();
$existing_customer_log_in_div->set_attribute_str('id', 'existing_customer_log_in_div');
$existing_customer_log_in_p_text = <<<TXT
If you already have a password, please log in here:
TXT;
$existing_customer_log_in_div->append_tag_to_content(new HTMLTags_P($existing_customer_log_in_p_text));
$existing_customer_log_in_link = new HTMLTags_A('Existing Customer Log In');
$existing_customer_log_in_link->set_attribute_str('class', 'cool_button');
$existing_customer_log_in_link->set_attribute_str('id', 'existing_customer_log_in_button');
$existing_customer_log_in_location = new HTMLTags_URL();
$existing_customer_log_in_location->set_file('/');
$existing_customer_log_in_location->set_get_variable('section', 'plug-ins');
$existing_customer_log_in_location->set_get_variable('module', 'shop');
$existing_customer_log_in_location->set_get_variable('page', 'log-in');
$existing_customer_log_in_location->set_get_variable('type', 'html');
if (isset($_GET['return_to'])) {
    $existing_customer_log_in_location->set_get_variable('return_to', $_GET['return_to']);
}
$existing_customer_log_in_link->set_href($existing_customer_log_in_location);
$existing_customer_log_in_div->append_tag_to_content($existing_customer_log_in_link);
echo $existing_customer_log_in_div->get_as_string();
 public function get_admin_people_html_table_tr(HTMLTags_URL $edit_location, HTMLTags_URL $delete_location)
 {
     $person = $this->get_element();
     $html_row = new HTMLTags_TR();
     $row = $this->get_element();
     $table = $row->get_table();
     $database = $row->get_database();
     /*
      * The data.
      */
     $added_field = $table->get_field('added');
     $added_td = $this->get_data_html_table_td($added_field);
     $html_row->append_tag_to_content($added_td);
     $name_field = $table->get_field('name');
     $name_td = $this->get_data_html_table_td($name_field);
     $html_row->append_tag_to_content($name_td);
     $email_field = $table->get_field('email');
     $email_td = $this->get_data_html_table_td($email_field);
     $html_row->append_tag_to_content($email_td);
     $status_field = $table->get_field('status');
     $status_td = $this->get_data_html_table_td($status_field);
     $html_row->append_tag_to_content($status_td);
     /*
      * The edit td.
      */
     $edit_td = new HTMLTags_TD();
     $edit_link = new HTMLTags_A('Edit');
     $edit_link->set_attribute_str('class', 'cool_button');
     $edit_link->set_attribute_str('id', 'edit_table_button');
     #            $edit_location = new HTMLTags_URL();
     #
     #            $edit_location->set_file('/admin/');
     #
     #            $edit_location->set_get_variable('module', 'mailing-list');
     #            $edit_location->set_get_variable('page', 'mailing-list');
     $edit_location->set_get_variable('edit_id', $row->get_id());
     $edit_link->set_href($edit_location);
     $edit_td->append_tag_to_content($edit_link);
     $html_row->append_tag_to_content($edit_td);
     /*
      * The delete td.
      */
     $delete_td = new HTMLTags_TD();
     $delete_link = new HTMLTags_A('Delete');
     $delete_link->set_attribute_str('class', 'cool_button');
     $delete_link->set_attribute_str('id', 'delete_table_button');
     #            $delete_location = new HTMLTags_URL();
     #
     #            $delete_location->set_file('/admin/');
     #
     #            $delete_location->set_get_variable('module', 'mailing-list');
     #            $delete_location->set_get_variable('page', 'mailing-list');
     $delete_location->set_get_variable('delete_id', $row->get_id());
     $delete_link->set_href($delete_location);
     $delete_td->append_tag_to_content($delete_link);
     $html_row->append_tag_to_content($delete_td);
     return $html_row;
 }
$database = $mysql_user->get_database();
$customer_regions_table = $database->get_table('hpi_shop_customer_regions');
$customer_regions = $customer_regions_table->get_all_rows('sort_order', 'ASC');
$customer_regions_div = new HTMLTags_Div();
$customer_regions_div->set_attribute_str('id', 'tabs');
$customer_regions_ul = new HTMLTags_UL();
foreach ($customer_regions as $customer_region) {
    $customer_region_li = new HTMLTags_LI();
    $customer_region_link_span = new HTMLTags_Span($customer_region->get_name());
    if ($customer_region->get_id() == $_SESSION['customer_region_id']) {
        $double_span = new HTMLTags_Span();
        $double_span->set_attribute_str('class', 'current');
        $double_span->append_tag_to_content($customer_region_link_span);
        $customer_region_li->append_tag_to_content($double_span);
    } else {
        //$customer_region_link_file = '/';
        //$customer_region_link_location = new HTMLTags_URL();
        //$customer_region_link_location->set_file($customer_region_link_file);
        //$customer_region_link_location->set_get_variable('page', $page_manager->get_page());
        $customer_region_link_location = $page_manager->get_script_uri();
        $customer_region_link_location->set_get_variable('customer_region_session', $customer_region->get_id());
        $customer_region_link_anchor = new HTMLTags_A();
        $customer_region_link_anchor->set_href($customer_region_link_location);
        $customer_region_link_anchor->set_attribute_str('title', 'Change your location to&nbsp;' . $customer_region->get_name());
        $customer_region_link_anchor->append_tag_to_content($customer_region_link_span);
        $customer_region_li->append_tag_to_content($customer_region_link_anchor);
    }
    $customer_regions_ul->append_tag_to_content($customer_region_li);
}
$customer_regions_div->append_tag_to_content($customer_regions_ul);
echo $customer_regions_div->get_as_string();
 public function get_thumbnail_img_with_drop_shadow_with_a_div($javascript = FALSE)
 {
     $row = $this->get_element();
     $thumbnail_image_row = $row->get_thumbnail_image_row();
     #print_r($thumbnail_image_row);
     $full_size_image_id = $row->get_id();
     $gallery_image_page_a = new HTMLTags_A();
     $gallery_image_page_a->set_attribute_str('class', 'thumbnailLink');
     $gallery_image_page_a->set_attribute_str('id', $full_size_image_id);
     if ($javascript) {
         $onclick = 'javascript:return thumbnailsOnClick(this);';
         $gallery_image_page_a->set_attribute_str('onclick', $onclick);
     }
     $full_size_image_href = new HTMLTags_URL();
     $full_size_image_href->set_file('/');
     $full_size_image_href->set_get_variable('page', 'gallery');
     $full_size_image_href->set_get_variable('product_brand_id', $full_size_image_id);
     $gallery_image_page_a->set_href($full_size_image_href);
     $thumbnail_image_row_renderer = $thumbnail_image_row->get_renderer();
     #print_r($thumbnail_image_row_renderer);
     $drop_shadow_div = new HTMLTags_Div();
     $drop_shadow_div->set_attribute_str('class', 'img-shadow');
     $gallery_image_page_a->append_tag_to_content($thumbnail_image_row_renderer->get_img_in_public_images());
     $drop_shadow_div->append_tag_to_content($gallery_image_page_a);
     return $drop_shadow_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;
    }
 #		$content_div->append_tag_to_content($share_product_div);
 #	}
 #	else
 #	{
 $full_product_div = $product_row_renderer->get_full_product_div_in_public();
 $content_div->append_tag_to_content($full_product_div);
 #		$share_links_ul = $product_row_renderer->get_share_links_ul_in_public();
 #		$share_links_ul->set_attribute_str('class', 'share-links');
 #		$content_div->append_tag_to_content($share_links_ul);
 $product_links_ul = $product_row_renderer->get_product_links_ul_in_public();
 $content_div->append_tag_to_content($product_links_ul);
 // Comments Div
 $comments_div = new HTMLTags_Div();
 $comments_div->set_attribute_str('id', 'product-comments');
 $comments_anchor = new HTMLTags_A();
 $comments_anchor->set_attribute_str('name', 'comments');
 $comments_div->append_tag_to_content($comments_anchor);
 if ($product_row->count_comments() > 0) {
     $comments_div_h = new HTMLTags_Heading(3, 'Comments');
     $comments_div->append_tag_to_content($comments_div_h);
     $product_comments_div = $product_row_renderer->get_paged_public_all_comments_div($current_page_url);
     $product_comments_div->set_attribute_str('class', 'comments-listing');
     $comments_div->append_tag_to_content($product_comments_div);
 }
 #--------------------------------
 # COMMENT ADDING FORM
 #--------------------------------
 $comment_form_div = new HTMLTags_Div();
 $comment_form_div->set_attribute_str('class', 'comment-form');
 $form_notification_div = new HTMLTags_Div();
 $form_notification_div->set_attribute_str('id', 'form_notification_div');
 public function get_delete_row_a()
 {
     $order = $this->get_element();
     $delete_row_link = new HTMLTags_A('Delete');
     $delete_row_link->set_attribute_str('class', 'cool_button');
     $delete_row_location = new HTMLTags_URL();
     $delete_row_location->set_file('/');
     $delete_row_location->set_get_variable('page', 'shopping-basket');
     $delete_row_location->set_get_variable('type', 'redirect-script');
     $delete_row_location->set_get_variable('delete_order_id', $order->get_id());
     $delete_row_link->set_href($delete_row_location);
     return $delete_row_link;
 }
 public function append_row_action_tds_to_tr(Database_Row $row, HTMLTags_TR $dtr)
 {
     $row_renderer = $row->get_renderer();
     $dn = $this->get_display_node();
     $ases = $dn->getElementsByTagName('actions');
     if ($ases->length == 1) {
         $ase = $ases->item(0);
         $aes = $ase->getElementsByTagName('action');
         for ($i = 0; $i < $aes->length; $i++) {
             $ae = $aes->item($i);
             if ($ae->getAttribute('name') == 'edit' || $ae->getAttribute('name') == 'delete') {
                 $td = new HTMLTags_TD();
                 if ($ae->getAttribute('name') == 'edit') {
                     if ($ae->hasAttribute('edit_link_text')) {
                         $link = new HTMLTags_A($this->getAttribute('edit_link_text'));
                     } else {
                         $link = new HTMLTags_A('Edit');
                     }
                 } elseif ($ae->getAttribute('name') == 'delete') {
                     if ($ae->hasAttribute('delete_link_text')) {
                         $link = new HTMLTags_A($this->getAttribute('delete_link_text'));
                     } else {
                         $link = new HTMLTags_A('Delete');
                     }
                 }
                 $link->set_attribute_str('class', 'cool_button');
                 $location = $this->get_html_location();
                 if ($ae->getAttribute('name') == 'edit') {
                     $location->set_get_variable('edit_id', $row->get_id());
                 } elseif ($ae->getAttribute('name') == 'delete') {
                     $location->set_get_variable('delete_id', $row->get_id());
                 }
                 $link->set_href($location);
                 $td->append_tag_to_content($link);
             } else {
                 if ($ae->hasAttribute('td_render_method_name')) {
                     $rmn = $ae->getAttribute('td_render_method_name');
                     $rrro = new ReflectionObject($row_renderer);
                     $rm = $rrro->getMethod($rmn);
                     $td = $rm->invoke($row_renderer);
                 } else {
                     throw new Exception('No action TD render method set!');
                 }
             }
             $dtr->append_tag_to_content($td);
         }
         return $dtr;
     }
     throw new Exception('Unable to append actions to data TR!');
 }