コード例 #1
0
 public function append_array($array)
 {
     if (isset($this->items_added)) {
         throw new Exception('You cannot append an array to a HTMLTags_FillTable more than once!');
     } else {
         $groups_array = $this->split_array($array);
         #print_r($groups_array);
         for ($i = 0; $i < count($groups_array); $i++) {
             $row = new HTMLTags_TR();
             for ($j = 0; $j < count($groups_array[$i]); $j++) {
                 $td = new HTMLTags_TD();
                 if (is_a($groups_array[$i][$j], 'HTMLTags_Tag')) {
                     #echo "tag\n";
                     $td->append_tag_to_content($groups_array[$i][$j]);
                 } else {
                     #echo "non-tag\n";
                     $td->append_str_to_content($groups_array[$i][$j]);
                 }
                 $row->append_tag_to_content($td);
             }
             $this->append_tag_to_content($row);
         }
         $this->items_added = TRUE;
     }
 }
コード例 #2
0
 public function get_admin_page_html_table_tr()
 {
     $page_row = $this->get_element();
     $admin_pages_html_table_tr = new HTMLTags_TR();
     $name_td = new HTMLTags_TD();
     $name_td->append_str_to_content($page_row->get_name());
     $admin_pages_html_table_tr->append_tag_to_content($name_td);
     $author_td = new HTMLTags_TD();
     $author_td->append_str_to_content($page_row->get_author());
     $admin_pages_html_table_tr->append_tag_to_content($author_td);
     $title_td = new HTMLTags_TD();
     #$title_td->append_str_to_content($page_row->get_title());
     $title_td->append_tag_to_content($this->get_title_a());
     $admin_pages_html_table_tr->append_tag_to_content($title_td);
     /*
      * The actions
      */
     $confirmation_url_base = new HTMLTags_URL();
     $confirmation_url_base->set_file('/');
     $confirmation_url_base->set_get_variable('section', 'haddock');
     $confirmation_url_base->set_get_variable('module', 'admin');
     $confirmation_url_base->set_get_variable('page', 'admin-includer');
     $confirmation_url_base->set_get_variable('type', 'html');
     $confirmation_url_base->set_get_variable('admin-section', 'haddock');
     $confirmation_url_base->set_get_variable('admin-module', 'database');
     /*
      * Edit the page's details.
      */
     $edit_td = new HTMLTags_TD();
     $edit_url = clone $confirmation_url_base;
     $edit_url->set_get_variable('admin-page', 'edit-page');
     $edit_url->set_get_variable('page_id', $page_row->get_id());
     $edit_a = new HTMLTags_A('Edit');
     $edit_a->set_href($edit_url);
     $edit_td->append_tag_to_content($edit_a);
     $admin_pages_html_table_tr->append_tag_to_content($edit_td);
     /*
      * Delete the page.
      */
     $delete_td = new HTMLTags_TD();
     $delete_url = clone $confirmation_url_base;
     $delete_url->set_get_variable('admin-page', 'delete-page');
     $delete_url->set_get_variable('page_id', $page_row->get_id());
     $delete_a = new HTMLTags_A('Delete');
     $delete_a->set_href($delete_url);
     $delete_td->append_tag_to_content($delete_a);
     $admin_pages_html_table_tr->append_tag_to_content($delete_td);
     return $admin_pages_html_table_tr;
 }
コード例 #3
0
 public function get_short_address_td()
 {
     $address = $this->get_element();
     $address_td = new HTMLTags_TD($address_text);
     $address_td->set_attribute_str('style', 'text-align: left');
     if ($address->has_post_office_box()) {
         $address_td->append_str_to_content($address->get_post_office_box());
         $address_td->append_tag_to_content(new HTMLTags_BR());
     }
     if ($address->has_extended_address()) {
         $address_td->append_str_to_content($address->get_extended_address());
         $address_td->append_tag_to_content(new HTMLTags_BR());
     }
     $address_td->append_str_to_content($address->get_street_address());
     $address_td->append_tag_to_content(new HTMLTags_BR());
     $address_td->append_str_to_content($address->get_locality());
     $address_td->append_tag_to_content(new HTMLTags_BR());
     $address_td->append_str_to_content($address->get_region());
     $address_td->append_tag_to_content(new HTMLTags_BR());
     $address_td->append_str_to_content($address->get_postal_code());
     $address_td->append_tag_to_content(new HTMLTags_BR());
     $address_td->append_str_to_content($address->get_country_name());
     return $address_td;
 }
コード例 #4
0
 $row_tr = new HTMLTags_TR();
 $row_th = new HTMLTags_TH($product_category->get_name());
 $row_tr->append_tag_to_content($row_th);
 foreach ($customer_regions as $customer_region) {
     /*
      * FIRST_PRICE
      */
     try {
         $conditions = array();
         $conditions['supplier_id'] = $supplier->get_id();
         $conditions['customer_region_id'] = $customer_region->get_id();
         $conditions['product_category_id'] = $product_category->get_id();
         $supplier_shipping_price = $supplier_shipping_prices_table->get_rows_where($conditions);
         if (count($supplier_shipping_price) > 0) {
             $data_td = new HTMLTags_TD();
             $data_td->append_str_to_content($supplier_shipping_price[0]->get_first_price() . '&nbsp;(' . $supplier_shipping_price[0]->get_additional_price() . ')');
             $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');
コード例 #5
0
 public function get_suppliers_td()
 {
     $row = $this->get_element();
     $suppliers = $row->get_suppliers();
     $supplier_td = new HTMLTags_TD();
     foreach ($suppliers as $supplier) {
         $supplier_td->append_str_to_content($supplier->get_name());
         $supplier_td->append_tag_to_content(new HTMLTags_BR());
     }
     return $supplier_td;
 }
コード例 #6
0
 public function get_tags_td()
 {
     $tags_td = new HTMLTags_TD();
     $tags_str = $this->get_tags_as_csv();
     #print_r($tags_str);
     $tags_td->append_str_to_content($tags_str);
     return $tags_td;
 }
コード例 #7
0
 public function get_product_td()
 {
     $shopping_basket = $this->get_element();
     $product = $shopping_basket->get_product();
     $photograph = $product->get_main_photograph();
     $photograph_renderer = $photograph->get_renderer();
     $product_td = new HTMLTags_TD();
     $product_td->append_tag_to_content($photograph_renderer->get_thumbnail_img());
     $product_td->append_str_to_content($product->get_name());
     return $product_td;
 }
コード例 #8
0
 public function get_product_td()
 {
     $comment = $this->get_element();
     $product = $comment->get_product();
     $product_td = new HTMLTags_TD();
     $product_td->append_str_to_content($product->get_name());
     return $product_td;
 }