public function get_admin_pages_html_table() { $pages_table = $this->get_element(); $admin_pages_html_table = new HTMLTags_Table(); $admin_pages_html_table->set_attribute_str('id', 'admin_pages_table'); /* * The head */ $thead = new HTMLTags_THead(); $header_tr = new HTMLTags_TR(); $header_tr->append_tag_to_content(new HTMLTags_TH('Name')); $header_tr->append_tag_to_content(new HTMLTags_TH('Author')); $header_tr->append_tag_to_content(new HTMLTags_TH('Title')); $actions_th = new HTMLTags_TH('Actions'); $actions_th->set_attribute_str('colspan', 2); $header_tr->append_tag_to_content($actions_th); $thead->append_tag_to_content($header_tr); $admin_pages_html_table->append_tag_to_content($thead); /* * The body. */ $tbody = new HTMLTags_TBody(); $pages = $pages_table->get_pages_viewable_by_currently_logged_in_user(); foreach ($pages as $page) { $page_renderer = $page->get_renderer(); $tbody->append_tag_to_content($page_renderer->get_admin_page_html_table_tr()); } $admin_pages_html_table->append_tag_to_content($tbody); return $admin_pages_html_table; }
public function append_nonsortable_field_name($field_name) { $th = new HTMLTags_TH(); $f_n_l_o_ws = Formatting_ListOfWords::get_list_of_words_for_string($field_name, '_'); $th->append_str_to_content($f_n_l_o_ws->get_words_as_capitalised_string()); $this->append_tag_to_content($th); }
public function append_nonsortable_field_name($field_name, $title = NULL) { $th = new HTMLTags_TH(); if (!isset($title)) { $f_n_l_o_ws = Formatting_ListOfWordsHelper::get_list_of_words_for_string($field_name, '_'); $title = $f_n_l_o_ws->get_words_as_capitalised_string(); } $th->append_str_to_content($title); $this->append_tag_to_content($th); }
protected function get_heading_tr() { $heading_tr = new HTMLTags_TR(); /* * Append the column headings for the data in the table. */ $column_titles = $this->get_column_titles(); foreach ($column_titles as $column_title) { $heading_tr->append_tag_to_content(new HTMLTags_TH($column_title)); } /* * Append the column heading for the action columns. */ $action_columns_heading = new HTMLTags_TH('Reorder'); $action_columns_heading->set_attribute_str('colspan', 2); $heading_tr->append_tag_to_content($action_columns_heading); return $heading_tr; }
protected function get_option_trs() { $option_trs = array(); foreach ($this->actors as $actor) { if ($actor->has_options()) { // Actors Name TR $actors_name_tr = new HTMLTags_TR(); $actors_name_em = new HTMLTags_Em($actor->get_name()); $actors_name_th = new HTMLTags_TH(); $actors_name_th->append_tag_to_content($actors_name_em); $actors_name_th->set_attribute_str('class', 'option'); $actors_name_th->set_attribute_str('id', $actor->get_color()); $actors_name_tr->append_tag_to_content($actors_name_th); for ($i = -1; $i < count($this->actors); $i++) { $blank_td = new HTMLTags_TD(); $actors_name_tr->append_tag_to_content($blank_td); } $option_trs[] = $actors_name_tr; // Option TRs with positions $options = $actor->get_options(); foreach ($options as $option) { $tr = new HTMLTags_TR(); $option_th = new HTMLTags_TH($option->get_name()); $option_th->set_attribute_str('class', 'option'); $option_th->set_attribute_str('id', $actor->get_color()); $tr->append_tag_to_content($option_th); foreach ($this->actors as $position_actor) { $position = $option->get_position($position_actor->get_id()); $position_td = new HTMLTags_TD(); $position_td->append_tag_to_content($this->get_position_tile($position)); $tr->append_tag_to_content($position_td); } // Stated Intention TD $stated_intention = $option->get_stated_intention(); $stated_intention_td = new HTMLTags_TD(); $stated_intention_td->append_tag_to_content($this->get_stated_intention_tile($stated_intention, $actor)); $tr->append_tag_to_content($stated_intention_td); $option_trs[] = $tr; } // Blank TR $blank_tr = new HTMLTags_TR(); $blank_th = new HTMLTags_TH(); $blank_th->set_attribute_str('class', 'blank'); $blank_tr->append_tag_to_content($blank_th); for ($i = -1; $i < count($this->actors); $i++) { $blank_td = new HTMLTags_TD(); $blank_tr->append_tag_to_content($blank_td); } $option_trs[] = $blank_tr; } } return $option_trs; }
* The Heading Row. */ $sort_href = clone $current_page_url; $sort_href->set_get_variable('limit', LIMIT); $heading_row = new Database_SortableHeadingTR($sort_href, DIRECTION); $field_names = explode(' ', 'added modified status front_page'); foreach ($field_names as $field_name) { $heading_row->append_sortable_field_name($field_name); } $product_header = new HTMLTags_TH('Product'); $heading_row->append_tag_to_content($product_header); $name_header = new HTMLTags_TH('Name'); $heading_row->append_tag_to_content($name_header); $comment_header = new HTMLTags_TH('Comment'); $heading_row->append_tag_to_content($comment_header); $actions_header = new HTMLTags_TH('Actions'); $actions_header->set_attribute_str('colspan', '4'); $heading_row->append_tag_to_content($actions_header); // foreach ( // $comments_table_renderer->get_admin_database_action_ths() // as // $action_th // ) { // $heading_row->append_tag_to_content($action_th); // } $rows_html_table->append_tag_to_content($heading_row); # ------------------------------------------------------------------ /** * Display the contents of the table. */ #$order_by = isset($_GET['order_by']) ? $_GET['order_by'] : 'id';