function format_text_view($content, $txt_viewer_attributes, $txt_attributes) { $txt_full_attributes = array_merge($txt_viewer_attributes, $txt_attributes); $txt_start = BuildHTML::start_element(self::$div, $txt_full_attributes); $txt_end = BuildHTML::end_element(self::$div); self::$viewer_content = $txt_start . $content . $txt_end; }
function format_content_view($content, $viewer_attributes, $meta_attributes) { $content_txt = $content['contenttext']; $content_img = $content['contentimage']; $txt_tab_attributes = array("class" => 'grid_6 text'); $txt_tab_start = BuildHTML::start_element(self::$div, $txt_tab_attributes); $img_tab_attributes = array("class" => 'grid_6 image'); $img_tab_start = BuildHTML::start_element(self::$div, $img_tab_attributes); $content_end = BuildHTML::end_element(self::$div); if (!empty($content_txt)) { $txt = $content_txt; } else { $txt = "No associated text available"; } if (!empty($content_img)) { $img_content = self::$img_dir . $content_img; $img_attributes["src"] = $img_content; $img = BuildHTML::start_element(self::$img, $img_attributes); } else { $img = "No associated image available"; } $txt_output = $txt_tab_start . $txt . $content_end; $img_output = $img_tab_start . $img . $content_end; self::$viewer_content = $img_output . $txt_output; }
function format_content_view($content, $viewer_attributes, $meta_attributes) { $map_attributes = array("id" => "map_canvas", "class" => "grid_6", "coordinates" => $content); $map_start = BuildHTML::start_element(self::$div, $map_attributes); $map_end = BuildHTML::end_element(self::$div); $map_output = $map_start . $map_end; self::$viewer_content = $map_output; }
function format_image_view($content, $img_viewer_attributes, $img_attributes) { $img_content = self::$img_dir . $content; $img_attributes["src"] = $img_content; $img_start = BuildHTML::start_element(self::$div, $img_viewer_attributes); $img = BuildHTML::start_element(self::$img, $img_attributes); $img_end = BuildHTML::end_element(self::$div); self::$viewer_content = $img_start . $img . $img_end; }
function format_gallery_layout($content) { $div_end = BuildHTML::end_element(self::$div); $link_end = BuildHTML::end_element(self::$link); foreach ($content as $key => $val) { $img_id = $val['contentid']; $img_name = $val['contentname']; $img_desc = $val['contentdesc']; $img = $val['contentimage']; $thumb_attributes = array("class" => "grid_3 image thumb_contain group_item"); $img_attributes = array("id" => $img_id, "class" => GALLERY_IMG, "title" => $img_name . ' - ' . $img_desc, "alt" => $img_name, "src" => MEDIA_IMAGES_DIR . $img); $link_attributes = array("href" => '?node=content/image&id=' . $img_id, "class" => GALLERY_LINK, "title" => "click to open image page"); $thumb_start = BuildHTML::start_element(self::$div, $thumb_attributes); $img_start = BuildHTML::start_element(self::$img, $img_attributes); $link_start = BuildHTML::start_element(self::$link, $link_attributes); self::$gallery_content .= $thumb_start . $img_start . $link_start . $img_name . $link_end . $div_end; } return self::$gallery_content; }
function format_content_view($content, $viewer_attributes, $meta_attributes) { $content_img = $content['contentimage']; $content_txt = $content['contenttext']; $content_end = BuildHTML::end_element(self::$div); //set parent wrapper tabs div & tabs links $tabs_attributes = array("id" => "tabs"); $tabs_start = BuildHTML::start_element(self::$div, $tabs_attributes); $tabs_ul_start = BuildHTML::start_element(self::$ul); $tabs_ul_end = BuildHTML::end_element(self::$ul); $tabs_li_start = BuildHTML::start_element(self::$li); $tabs_li_end = BuildHTML::end_element(self::$li); //tabs links $img_link_attributes = array("href" => "#tabs-1"); $img_link_start = BuildHTML::start_element(self::$link, $img_link_attributes); $txt_link_attributes = array("href" => "#tabs-2"); $txt_link_start = BuildHTML::start_element(self::$link, $txt_link_attributes); $tabs_link_end = BuildHTML::end_element(self::$link); //set image tab div $img_tab_attributes = array("id" => "tabs-1"); $img_tab_start = BuildHTML::start_element(self::$div, $img_tab_attributes); //set text tab div $txt_tab_attributes = array("id" => "tabs-2"); $txt_tab_start = BuildHTML::start_element(self::$div, $txt_tab_attributes); if (!empty($content_txt)) { $txt = $content_txt; } else { $txt = "No associated text available"; } if (!empty($content_img)) { $img_content = self::$img_dir . $content_img; $img_attributes["src"] = $img_content; $img = BuildHTML::start_element(self::$img, $img_attributes); } else { $img = "No associated image available"; } //a tad verbose - could be abstracted further $tabs = $tabs_start . $tabs_ul_start . $tabs_li_start . $img_link_start . 'Image' . $tabs_link_end . $tabs_li_end . $tabs_li_start . $txt_link_start . 'Text' . $tabs_link_end . $tabs_li_end . $tabs_ul_end . $img_tab_start . $img . $content_end . $txt_tab_start . $txt . $content_end . $content_end; //build full output for tabs and content self::$viewer_content = $tabs; }
function table_headers($headers) { $header_start = BuildHTML::start_element(self::$thead); $header_end = BuildHTML::end_element(self::$thead); $th_attribute = array("title" => "click to change sort order"); foreach ($headers as $key => $val) { $th_start = BuildHTML::start_element(self::$th, $th_attribute); $th_end = BuildHTML::end_element(self::$th); self::$taxa_headers .= $th_start . $val . $th_end; } self::$taxa_headers = $header_start . self::$taxa_headers . $header_end; return self::$taxa_headers; }
function draw_footer() { $attributes = array("id" => HTML_FOOTER, "class" => HTML_FOOTER_CLASS); $footer_start = BuildHTML::start_element(self::$div, $attributes); $footer_end = BuildHTML::end_element(self::$div); echo $footer_start; echo $footer_end; }