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;
 }
 protected function get_add_act_li()
 {
     $li = new HTMLTags_LI();
     $a = new HTMLTags_A('Add Act');
     $a->set_attribute_str('id', 'add');
     $a->set_attribute_str('title', 'Add an Act');
     $a->set_href(Oedipus_DramaHelper::get_add_act_url($this->drama->get_id()));
     $li->append($a);
     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_mailing_list_links_ul()
 {
     $links = array("Mailing List" => "/?section=haddock&module=admin&page=admin-includer&type=html&admin-section=plug-ins&admin-page=mailing-list&admin-module=mailing-list", "People CSV" => "/MailingList_ListAddressesAdminPage");
     $ul = new HTMLTags_UL();
     $ul->set_attribute_str('class', 'inline');
     foreach ($links as $key => $value) {
         $li = new HTMLTags_LI();
         $url = new HTMLTags_URL();
         $url->set_file($value);
         $a = new HTMLTags_A($key);
         $a->set_href($url);
         $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>&hellip;</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 function add_input_tag($name, HTMLTags_InputTag $input_tag, $label_text = NULL, $post_content = NULL)
 {
     #echo "In HTMLTags_SimpleOLForm::add_input_tag(...)\n";
     $input_li = new HTMLTags_LI();
     if (!isset($label_text)) {
         $l_t_l_o_ws = Formatting_ListOfWordsHelper::get_list_of_words_for_string($name, '_');
         $label_text = $l_t_l_o_ws->get_words_as_capitalised_string();
         #    echo "\$label_text: $label_text\n";
         #} else {
         #    echo "\$label_text: $label_text\n";
     }
     #echo "After if\n";
     $input_label = new HTMLTags_Label($label_text);
     $input_label->set_attribute_str('for', $name);
     #$input_label->set_attribute_str('id', $name);
     $input_li->append_tag_to_content($input_label);
     $input_li->append_tag_to_content($input_tag);
     if (isset($post_content)) {
         #print_r($post_content);
         $input_li->append($post_content);
         #} else {
         #	echo "No post_content!\n";
     }
     $input_msg_box = new HTMLTags_Span();
     $input_msg_box->set_attribute_str('id', $name . 'msg');
     $input_msg_box->set_attribute_str('class', 'rules');
     $input_li->append_tag_to_content($input_msg_box);
     if (count($this->input_lis) == 0) {
         $this->first_input_name = $name;
     }
     $this->input_lis[] = $input_li;
 }
 public static function get_project_specific_1d_ul($tree_name, $class_name = NULL)
 {
     if (!isset($class_name)) {
         $class_name = 'navigation';
     }
     $nodes = Navigation_ListsHelper::get_project_specific_1d_tree_nodes($tree_name);
     $ul = new HTMLTags_UL();
     $ul->set_class($class_name);
     foreach ($nodes as $node) {
         $li = new HTMLTags_LI();
         $li->append(Navigation_NodesHelper::get_link_a($node));
         $ul->add_li($li);
     }
     return $ul;
 }
 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;
 }
 private function get_next_navigation_div(Oedipus_Frame $frame, $child_frames)
 {
     $div = new HTMLTags_Div();
     $div->set_attribute_str('id', 'next-frames');
     $div->append(new HTMLTags_Heading(4, 'Next Frames'));
     $ul = new HTMLTags_UL();
     foreach ($child_frames as $child) {
         $li = new HTMLTags_LI();
         $li->append(new HTMLTags_Heading(5, $child->get_name()));
         $li->append(Oedipus_FrameImageHelper::get_frame_png_thumbnail_img_a($child, 150, 100));
         $ul->append($li);
     }
     if ($frame->is_editable()) {
         $li = new HTMLTags_LI();
         $li->append(self::get_add_node_a($frame));
         $ul->append($li);
     }
     $div->append($ul);
     return $div;
 }
 private function get_1d_ul_with_selected_li($tree_name, $class_name = NULL)
 {
     $page_class_name = get_class($this);
     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->append(Navigation_NodesHelper::get_link_a($node));
         //                        print_r($page_class_name);exit;
         if (substr($node['url_href'], 1) == $page_class_name || $node['url_href'] == '/' && $page_class_name == 'Oedipus_HomePage') {
             $li->set_class('selected');
         }
         $ul->add_li($li);
     }
     return $ul;
 }
 private function get_enter_plu_code_form()
 {
     $enter_plu_code_form = new HTMLTags_Form();
     $enter_plu_code_form->set_attribute_str('name', 'enter_plu_code');
     $enter_plu_code_form->set_attribute_str('method', 'GET');
     $enter_plu_code_form->set_attribute_str('class', 'table-select-form');
     $enter_plu_code_form->set_action(new HTMLTags_URL('/'));
     $inputs_ol = new HTMLTags_OL();
     /*
      * Select whether you want all products or just those with status==display
      */
     $li = new HTMLTags_LI();
     $label = new HTMLTags_Label('PLU Code');
     $label->set_attribute_str('for', 'plu_code');
     $li->append_tag_to_content($label);
     $input = new HTMLTags_Input();
     $input->set_attribute_str('name', 'plu_code');
     $li->append($input);
     $inputs_ol->append($li);
     /*
      * The submit button.
      */
     $go_button_li = new HTMLTags_LI();
     $go_button = new HTMLTags_Input();
     $go_button->set_attribute_str('type', 'submit');
     $go_button->set_attribute_str('value', 'Go');
     $go_button->set_attribute_str('class', 'submit');
     $go_button_li->append_tag_to_content($go_button);
     $inputs_ol->add_li($go_button_li);
     $enter_plu_code_form->append($inputs_ol);
     /*
      * The hidden inputs.
      */
     $current_page_url = $this->get_current_page_url();
     $enter_plu_code_action = clone $current_page_url;
     $enter_plu_code_action_get_vars = $enter_plu_code_action->get_get_variables();
     foreach (array_keys($enter_plu_code_action_get_vars) as $key) {
         $form_hidden_input = new HTMLTags_Input();
         $form_hidden_input->set_attribute_str('type', 'hidden');
         $form_hidden_input->set_attribute_str('name', $key);
         $form_hidden_input->set_attribute_str('value', $enter_plu_code_action_get_vars[$key]);
         $enter_plu_code_form->append_tag_to_content($form_hidden_input);
     }
     return $enter_plu_code_form;
 }