public static function get_1d_ul_with_selected_lines_using_custom_function($tree_name, $class_name = NULL, $page_class_str = NULL, $selected_function = 'return Navigation_HTMLListsHelper::is_node_selected($node, $page_class_str);', $options = array('use_span' => FALSE)) { if (!isset($class_name)) { $class_name = 'navigation'; } $nodes = Navigation_1DTreeRetriever::get_tree_nodes($tree_name); #print_r($nodes); #echo "<ul class=\"$class_name\">\n"; $ul = new HTMLTags_UL(); $ul->set_class($class_name); foreach ($nodes as $node) { #Navigation_NodeRenderer::render_node($node); $li = new HTMLTags_LI(); $li->set_attribute_str('id', self::get_line_css_id($node['url_href'])); // print_r($selected_function);exit; if ($page_class_str != NULL && eval($selected_function)) { $li->set_class('selected'); } if ($options['use_span']) { $li->append(Navigation_NodesHelper::get_link_a_with_span($node)); } else { $li->append(Navigation_NodesHelper::get_link_a($node)); } $ul->add_li($li); } return $ul; }
public function get_rss_titles_ul(RSS_RSS $rss, $limit = 10) { // print_r($rss->get_xml());exit; $items = $rss->get_items(); $tempCounter = 0; $ul = new HTMLTags_UL(); $ul->set_attribute_str('class', 'rss'); foreach ($items as $item) { # DISPLAY ONLY 10 ITEMS. if ($tempCounter < $limit + 1) { $li = new HTMLTags_LI(); if ($tempCounter % 2 == 0) { $li->set_attribute_str('class', 'odd'); } $a = new HTMLTags_A(); $url = new HTMLTags_URL(); $url->set_file($item->get_url_filename()); $a->set_href($url); $a->append($item->get_title()); $li->append($a); $ul->append($li); } $tempCounter += 1; } return $ul; }
public static function get_login_status_ul() { $user_login_manager = UserLogin_LoginManager::get_instance(); $ul = new HTMLTags_UL(); if (!$user_login_manager->is_logged_in()) { $login_li = new HTMLTags_LI(); $login_url = UserLogin_URLHelper::get_login_page_url(); $login_a = new HTMLTags_A('Login'); $login_a->set_href($login_url); $login_li->append($login_a); $ul->append($login_li); $register_li = new HTMLTags_LI(); $register_url = UserLogin_URLHelper::get_registration_page_url(); $register_a = new HTMLTags_A('Register'); $register_a->set_href($register_url); $register_li->append($register_a); $ul->append($register_li); } else { $name_li = new HTMLTags_LI(); $name_li->set_attribute_str('id', 'user-name'); $name_li->append($user_login_manager->get_name()); $ul->append($name_li); $log_out_li = new HTMLTags_LI(); $log_out_li->append($user_login_manager->get_log_out_a()); $ul->append($log_out_li); } return $ul; }
private function get_delete_option_li() { $delete_option_url = $this->get_delete_option_url(); $link = new HTMLTags_A('delete this Option'); $link->set_href($delete_option_url); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'delete_option'); return $li; }
private function get_add_new_character_li() { $add_new_character_url = $this->get_add_new_character_url(); $link = new HTMLTags_A('add a new character'); $link->set_href($add_new_character_url); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'add_new_character'); return $li; }
private function get_edit_li() { $edit_url = $this->get_edit_url(); $link = new HTMLTags_A('Edit this frame'); $link->set_href($edit_url); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'edit-frame'); return $li; }
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); $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'share-drama'); return $li; }
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 static function get_gallery_div_for_images($images) { $div = new HTMLTags_Div(); $div->set_attribute_str('class', 'gallery_div'); $main_image_div = new HTMLTags_Div(); $main_image_div->set_attribute_str('id', 'main_image'); $div->append($main_image_div); $ul = new HTMLTags_UL(); $ul->set_attribute_str('class', 'gallery_demo_unstyled'); $first = TRUE; foreach ($images as $image) { $li = new HTMLTags_LI(); if ($first) { $li->set_attribute_str('class', 'active'); $first = FALSE; } $li->append($image->get_image_img()); $ul->append($li); } $div->append($ul); 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 static function get_pager_div($start, $duration, $total_videos_count, $results_page_url) { $div = new HTMLTags_Div(); $div->set_attribute_str('class', 'pager'); //print_r($total_videos_count . ' || ' . $duration);exit; /* * Find how many pages, any remainder has to count as a new page */ $pages = ceil($total_videos_count / $duration); if ($pages > 1) { /* * Find current page */ if ($start > 0) { $current_page = ceil($start / $duration) + 1; } else { $current_page = 1; } //print_r($start . ' || ' . $duration . "\n"); //print_r($pages . ' || ' . $current_page);exit; $ul = new HTMLTags_UL(); $first = TRUE; /* * Previous Link */ if ($current_page > 1) { $prev_li = new HTMLTags_LI(); $prev_li->set_attribute_str('class', 'prev'); $prev_a = new HTMLTags_A('Previous'); $prev_a->set_href(VideoLibrary_URLHelper::get_results_page_url($results_page_url, ($current_page - 2) * $duration, $duration)); $prev_li->append($prev_a); $ul->append($prev_li); } /* * Middle Links: * * (if there are 7 pages) * << 1 2 3 4 5 6 7>> * * (if we're on page 5 of 8) * << 1 2 ... 4 5 6 7 8 >> * * (if we're on page 50 of 100) * << 1 2 ... 49 50 51 ... 99 100 >> * */ $ellipsis = 0; $previous_line_was_ellipsis = FALSE; for ($page = 1; $page <= $pages; $page++) { if ($pages <= 9 or $page == 1 or $page == 2 or $page == $current_page or $page == $pages - 1 or $page == $pages or $page == $current_page - 1 or $page == $current_page + 1) { $li = new HTMLTags_LI(); $li_class = ""; if ($first) { $li_class .= 'first '; $first = FALSE; } elseif ($page == $pages) { $li_class .= 'last '; } if ($page == $current_page) { $li_class .= 'selected '; $span = new HTMLTags_Span($page); $li->append($span); } else { $a = new HTMLTags_A($page); $a->set_href(VideoLibrary_URLHelper::get_results_page_url($results_page_url, ($page - 1) * $duration, $duration)); $li->append($a); } $li->set_attribute_str('class', trim($li_class)); $ul->append($li); $previous_line_was_ellipsis = FALSE; } elseif (!$previous_line_was_ellipsis && $ellipsis <= 1) { $li = new HTMLTags_LI(); $li->set_attribute_str('class', 'ellipsis'); $li->append('<span>…</span>'); $ul->append($li); $ellipsis++; $previous_line_was_ellipsis = TRUE; } } /* * Next page link */ if ($current_page < $pages) { $next_li = new HTMLTags_LI(); $next_li->set_attribute_str('class', 'next'); $next_a = new HTMLTags_A('Next'); $next_a->set_href(VideoLibrary_URLHelper::get_results_page_url($results_page_url, $current_page * $duration, $duration)); $next_li->append($next_a); $ul->append($next_li); } $div->append($ul); //print_r($div->get_as_string());exit; } return $div; }
public static function get_tags_empty_links_list($tags) { $ul = new HTMLTags_UL(); $ul->set_attribute_str('class', 'tags-empty-links-list'); foreach ($tags as $tag) { $li = new HTMLTags_LI(); $li->set_attribute_str('tag', $tag['tag']); $li->append($tag['tag']); $ul->append($li); } return $ul; }
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; }
private function get_tree_view_li() { $tree_view_url = $this->get_tree_view_url(); $link = new HTMLTags_A('Scene View'); $link->set_href($tree_view_url); if (!isset($_GET['frame_id'])) { $link->set_attribute_str('id', 'selected'); } $li = new HTMLTags_LI(); $li->append_tag_to_content($link); $li->set_attribute_str('id', 'tree-view'); return $li; }
<?php /** * A div that is displayed if the customer is trying to go to the checkout with no shopping basket. * * @copyright Clear Line Web Design, 2007-08-21 */ $no_shopping_basket_div = new HTMLTags_Div(); $p_text = <<<TXT I'm sorry, you have no shopping basket yet. Why are you trying to Checkout? TXT; $product_links_ul = new HTMLTags_UL(); $product_links_ul->set_attribute_str('id', 'shopping-basket-ul'); $all_products_link = new HTMLTags_A('See All Products'); $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); $no_shopping_basket_div->append_tag_to_content(new HTMLTags_P($p_text)); $no_shopping_basket_div->append_tag_to_content($product_links_ul); echo $no_shopping_basket_div->get_as_string();