public function __construct(HaddockProjectOrganisation_ProjectDirectory $project_directory)
 {
     parent::__construct();
     $m_w_a_ss = $project_directory->get_modules_with_admin_sections();
     foreach ($m_w_a_ss as $m_w_a_s) {
         $module_li = new HTMLTags_LI();
         $module_a = new HTMLTags_A();
         //$module_href = new HTMLTags_URL();
         #if (
         #    is_a(
         #        $m_w_a_s,
         #        'HaddockProjectOrganisation_ProjectSpecificDirectory'
         #    )
         #) {
         #    $module_name = 'project-specific';
         #} else {
         #    $module_name_l_o_ws = $m_w_a_s->get_module_name_as_l_o_w();
         #    $module_name = $module_name_l_o_ws->get_words_as_delimited_lc_string('-');
         #}
         //$module_name = $m_w_a_s->get_admin_section_directory_name();
         //
         //#$module_href->set_file('/admin/' . $module_name . '/home.html');
         //$module_href->set_file('/admin/hc/' . $module_name . '/home.html');
         $module_href = $m_w_a_s->get_admin_section_home_page_href();
         $module_a->set_href($module_href);
         $module_config_file = $m_w_a_s->get_module_config_file();
         $module_span = new HTMLTags_Span($module_config_file->get_admin_section_title());
         $module_a->append_tag_to_content($module_span);
         $module_li->append_tag_to_content($module_a);
         $this->add_li($module_li);
     }
 }
 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 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_drama_li(Oedipus_Drama $drama)
 {
     $drama_url = $this->get_drama_page_url_for_drama($drama);
     $link = new HTMLTags_A();
     /*
      * Put the Link, image, added date etc.
      * in separate <span></span>
      */
     $name_span = $this->get_span_with_id($drama->get_name(), 'name');
     $added_span = $this->get_span_with_id($drama->get_human_readable_added(), 'added');
     $link->append_tag_to_content($name_span);
     $link->append_tag_to_content($added_span);
     $link->set_href($drama_url);
     $li = new HTMLTags_LI();
     $li->append_tag_to_content($link);
     $li->set_attribute_str('id', 'drama');
     //                foreach ($drama->get_frames() as $frame)
     //                {
     //                        $li->append_tag_to_content($this->get_oedipus_png_frame($frame));
     //                }
     return $li;
 }
 public function get_data_html_table_td_with_image(Database_Field $field)
 {
     $row = $this->get_element();
     if ($field->get_name() == 'image' && $row->has_full_size_image()) {
         #print_r($field);
         $field_renderer = $field->get_renderer();
         $img_tag = $this->get_img_in_public_images();
         #print_r($img_tag);
         $full_a = new HTMLTags_A();
         $full_size_image = $row->get_full_size_image();
         #print_r($full_size_image);
         $full_size_image_renderer = $full_size_image->get_renderer();
         $full_size_image_url = $full_size_image_renderer->get_html_url_in_public_images();
         $full_a->set_href($full_size_image_url);
         $full_a->append_tag_to_content($img_tag);
         $data_html_table_td = $field_renderer->get_data_html_table_td($full_a->get_as_string());
         return $data_html_table_td;
     } else {
         return parent::get_data_html_table_td($field);
     }
 }
    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;
    }
$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_shopping_basket_checkout_links_ul()
 {
     $shopping_baskets_table = $this->get_element();
     $product_links_ul = new HTMLTags_UL();
     $product_links_ul->set_attribute_str('id', 'shopping-basket-ul');
     $all_products_link = new HTMLTags_A('Continue Shopping');
     $all_products_location = new HTMLTags_URL();
     $all_products_location->set_file('/hpi/shop/products.html');
     $all_products_link->set_href($all_products_location);
     $all_products_li = new HTMLTags_LI();
     $all_products_li->set_attribute_str('class', 'all-products');
     $all_products_li->append_tag_to_content($all_products_link);
     $product_links_ul->append_tag_to_content($all_products_li);
     if ($shopping_baskets_table->check_for_current_session_in_shopping_baskets()) {
         $checkout_link = new HTMLTags_A();
         $checkout_link->append_tag_to_content(new HTMLTags_Span('Checkout'));
         $checkout_location = new HTMLTags_URL();
         $checkout_location->set_file('/hpi/shop/checkout.html');
         $checkout_link->set_href($checkout_location);
         $checkout_li = new HTMLTags_LI();
         $checkout_li->set_attribute_str('class', 'checkout');
         $checkout_li->append_tag_to_content($checkout_link);
         $product_links_ul->append_tag_to_content($checkout_li);
     }
     return $product_links_ul;
 }
 public function get_customer_region_selection_div()
 {
     $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();
     #$customer_regions_table = $database->get_table('hpi_shop_customer_regions');
     $customer_regions_table = $this->get_element();
     $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());
             $redirect_script_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'customer-region', 'redirect-script');
             $redirect_script_location->set_get_variable('customer_region_session', $customer_region->get_id());
             $desired_location = $page_manager->get_script_uri();
             if (isset($_GET['product_id'])) {
                 $desired_location->set_get_variable('product_id', $_GET['product_id']);
             }
             if (isset($_GET['product_category_id'])) {
                 $desired_location->set_get_variable('product_category_id', $_GET['product_category_id']);
             }
             $redirect_script_location->set_get_variable('desired_location', urlencode($desired_location->get_as_string()));
             $customer_region_link_anchor = new HTMLTags_A();
             $customer_region_link_anchor->set_href($redirect_script_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();
     return $customer_regions_div;
 }
 /**
  * Allows the customer to search for products by reducing the search
  * criteria using select drop-downs.
  *
  * Used in:
  * 	- The secondary navigation div.
  *
  * Changes:
  * 	- RFI 2007-12-13
  * 		Instead of going to separate pages for product categories and tags,
  * 		the customer is taken to the products page where the selection criteria
  * 		for products is constrained appropriately.
  */
 public function get_public_tag_selection_div()
 {
     $product_tag = $this->get_element();
     $tag = $product_tag->get_tag();
     $div = new HTMLTags_Div();
     $div->set_attribute_str('id', $tag);
     $div->set_attribute_str('class', 'tag-selection');
     $heading = new HTMLTags_Heading(3, ucfirst($tag));
     $tag_link_href = new HTMLTags_URL();
     $tag_link_file = '/?section=plug-ins&module=shop&page=products&type=html&tag=' . $tag;
     $tag_link_href->set_file($tag_link_file);
     $tag_link = new HTMLTags_A();
     $tag_link->set_href($tag_link_href);
     $tag_link->append_tag_to_content($heading);
     $div->append_tag_to_content($tag_link);
     /*
      * Brand Select Form
      */
     $brand_form = new MashShop_TagSelectionForm();
     $brand_form->set_attribute_str('id', 'brand');
     #$brand_form->add_hidden_input('section', 'plug-ins');
     #$brand_form->add_hidden_input('module', 'shop');
     #$brand_form->add_hidden_input('page', 'product-brand');
     #$brand_form->add_hidden_input('type', 'html');
     $brand_form = self::add_hidden_inputs_for_results_page_get_vars_to_tag_selection_form($brand_form);
     $brand_form->add_hidden_input('tag', $tag);
     $brand_action = new HTMLTags_URL();
     $brand_action->set_file('/');
     $brand_form->set_action($brand_action);
     $brand_form->set_attribute_str('name', 'brand');
     $brand_form->set_attribute_str('method', 'GET');
     $form_ul = new HTMLTags_UL();
     $brand_li = new HTMLTags_LI();
     $brand_label = new HTMLTags_Label('Brands:');
     $brand_label->set_attribute_str('for', 'product_brand_id');
     $brand_li->append_tag_to_content($brand_label);
     $brand_select_box = $this->get_brand_select();
     $brand_li->append_tag_to_content($brand_select_box);
     $form_ul->append_tag_to_content($brand_li);
     $submit_button = new HTMLTags_Input();
     $submit_button->set_attribute_str('type', 'submit');
     $submit_button->set_attribute_str('value', 'Go');
     $submit_button->set_attribute_str('class', 'submit');
     $submit_li = new HTMLTags_LI();
     $submit_li->append_tag_to_content($submit_button);
     $form_ul->append_tag_to_content($submit_li);
     $brand_form->append_tag_to_content($form_ul);
     $div->append_tag_to_content($brand_form);
     $clear_div = new HTMLTags_Div();
     $clear_div->set_attribute_str('style', 'clear:both;');
     $div->append_tag_to_content($clear_div);
     /*
      * category Select Form
      */
     $category_form = new MashShop_TagSelectionForm();
     $category_form->set_attribute_str('id', 'category');
     #$category_form->add_hidden_input('section', 'plug-ins');
     #$category_form->add_hidden_input('module', 'shop');
     #$category_form->add_hidden_input('page', 'product-category');
     #$category_form->add_hidden_input('type', 'html');
     $category_form = self::add_hidden_inputs_for_results_page_get_vars_to_tag_selection_form($category_form);
     $category_form->add_hidden_input('tag', $tag);
     $category_action = new HTMLTags_URL();
     $category_action->set_file('/');
     $category_form->set_action($category_action);
     $category_form->set_attribute_str('name', 'category');
     $category_form->set_attribute_str('method', 'GET');
     $form_ul = new HTMLTags_UL();
     $category_li = new HTMLTags_LI();
     $category_label = new HTMLTags_Label('Products:');
     $category_label->set_attribute_str('for', 'product_category_id');
     $category_li->append_tag_to_content($category_label);
     $category_select_box = $this->get_category_select();
     $category_li->append_tag_to_content($category_select_box);
     $form_ul->append_tag_to_content($category_li);
     $submit_button = new HTMLTags_Input();
     $submit_button->set_attribute_str('type', 'submit');
     $submit_button->set_attribute_str('value', 'Go');
     $submit_button->set_attribute_str('class', 'submit');
     $submit_li = new HTMLTags_LI();
     $submit_li->append_tag_to_content($submit_button);
     $form_ul->append_tag_to_content($submit_li);
     $category_form->append_tag_to_content($form_ul);
     $div->append_tag_to_content($category_form);
     $div->append_tag_to_content($clear_div);
     return $div;
 }
Ejemplo n.º 12
0
$muf = Database_MySQLUserFactory::get_instance();
$mu = $muf->get_for_this_project();
$database = $mu->get_database();
$products_table = $database->get_table('hpi_trackit_stock_management_products');
$product_row = $products_table->get_row_by_id($_GET['product_id']);
$photographs_table = $database->get_table('hpi_shop_photographs');
?>
<div id="content">
<h2>Please set the image for Product <?php 
echo $product_row->get('product_id');
?>
</h2>
<?php 
$photographs = $photographs_table->get_all_rows();
echo "<ul>\n";
foreach ($photographs as $photograph) {
    $prr = $photograph->get_renderer();
    echo "<li>\n";
    $url = Admin_AdminIncluderURLFactory::get_url('plug-ins', 'trackit-stock-management', 'set-product-image', 'redirect-script');
    $url->set_get_variable('photograph_id', $photograph->get_id());
    $url->set_get_variable('product_id', $product_row->get_id());
    $link = new HTMLTags_A();
    $link->set_href($url);
    $link->append_tag_to_content($prr->get_thumbnail_img());
    echo $link->get_as_string();
    echo "</li>\n";
}
echo "</ul>\n";
?>
</div>