protected function set_libraries_navigation_div()
 {
     $libraries = VideoLibrary_DatabaseHelper::get_external_video_libraries();
     //print_r($libraries);exit;
     $this->libraries_navigation_div = VideoLibrary_DisplayHelper::get_external_video_libraries_navigation_div($libraries, $this->get_external_video_library_id(), $this->get_libraries_navigation_div_base_url());
 }
    public static function get_add_external_video_form()
    {
        $html = '';
        $post_url = '/?oo-page=1&page-class=VideoLibrary_AddExternalVideoAdminRedirectScript';
        $html .= '<form class="basic-form" id="basic-form" method="post" action="' . $post_url . '">';
        $html .= '<fieldset> <legend>' . $title . '</legend>';
        $html .= "<ol>\n";
        $library_values = VideoLibrary_DatabaseHelper::get_external_video_libraries(TRUE);
        //$library_li = '<li><label for="external_video_library_id">Library</label><select name="external_video_library_id">';
        //foreach ($library_values as $library_value) {
        //$library_li .= '<option value="' . $library_value['id'] . '">' . $library_value['name'] . '</option>';
        //}
        //$library_li .= '</select></li>';
        $library_li = '<li><label for="external_video_library_id">Library</label><div id="library-selector" class="radio-inputs">';
        $i = 0;
        foreach ($library_values as $library_value) {
            $library_li .= '<label><input type="radio" name="external_video_library_id" value="' . $library_value['id'] . '"';
            // if ($i == 0) $library_li .= ' checked="checked"';
            $i++;
            $library_li .= '>';
            $library_li .= $library_value['name'] . '<br /></label>';
        }
        $library_li .= '</div></li>';
        $html .= $library_li;
        $provider_values = VideoLibrary_DatabaseHelper::get_external_video_providers();
        //$provider_li = '<li><label for="external_video_provider_id">Provider</label><select name="external_video_provider_id">';
        //foreach ($provider_values as $provider_value) {
        //$provider_li .= '<option value="' . $provider_value['id'] . '">' . $provider_value['name'] . '</option>';
        //}
        //$provider_li .= '</select></li>';
        $provider_li = '<li><label for="external_video_provider_id">Provider</label><div id="external_video_provider_ids" class="radio-inputs">';
        $i = 0;
        foreach ($provider_values as $provider_value) {
            $provider_li .= '<label><input type="radio" name="external_video_provider_id" value="' . $provider_value['id'] . '"';
            // if ($i == 0) $provider_li .= ' checked="checked"';
            $i++;
            $provider_li .= '>';
            $provider_li .= $provider_value['name'] . '<br /></label>';
        }
        $provider_li .= '</div></li>';
        $html .= $provider_li;
        $html .= self::get_form_li_text_input('name');
        $html .= self::get_form_li_text_input('providers_internal_id');
        $html .= self::get_form_li_text_input('length');
        $status_values = VideoLibrary_DatabaseHelper::get_enum_values('hpi_video_library_external_videos', 'status');
        // $status_li = '<li><label for="status">Status</label><select name="status">';
        $status_li = '<li><label for="status">Status</label><div class="radio-inputs">';
        foreach ($status_values as $status_value) {
            $status_li .= '<label><input type="radio" name="status" value="' . $status_value . '"';
            if ($status_value == 'hide') {
                $status_li .= ' checked="checked"';
            }
            $i++;
            $status_li .= '>';
            $status_li .= $status_value . '<br /></label>';
            // $status_li .= '<option value="' . $status_value . '">' . $status_value . '</option>';
        }
        $status_li .= '</div></li>';
        // $status_li .= '</select></li>';
        $html .= $status_li;
        $html .= '<fieldset class="tags-fieldset" id="tags-fieldset"><legend>Tags</legend>';
        $html .= self::get_form_li_text_input('tags');
        // $html .= self::get_tags_list_for_form($library_values);
        $html .= '</fieldset>';
        $html .= "</ol>\n";
        $html .= <<<HTML
\t<div class="submit_buttons_div">
\t\t<input
\t\t\ttype="submit"
\t\t\tvalue="Add this Video"
\t\t\tclass="submit"
\t\t/>
\t\t<input
\t\t\ttype="button"
\t\t\tvalue="Cancel"
\t\t\tclass="submit"
\t\t/>
\t</div>
\t</fieldset>
HTML;
        $html .= "</form>\n";
        $html .= self::get_form_help_message();
        return $html;
    }
 protected function render_edit_something_form_ol()
 {
     $acm = $this->get_admin_crud_manager();
     echo "<ol>\n";
     $library_values = VideoLibrary_DatabaseHelper::get_external_video_libraries(TRUE);
     $library_li = '<li><label for="external_video_library_id">Library</label><div id="library-selector" class="radio-inputs">';
     foreach ($library_values as $library_value) {
         $library_li .= '<label><input type="radio" name="external_video_library_id" value="' . $library_value['id'] . '"';
         $cur_library_value = VideoLibrary_DatabaseHelper::get_external_video_library_id_for_external_video_id($_GET['id']);
         if ($cur_library_value == $library_value['id']) {
             $library_li .= ' checked="checked"';
         }
         $library_li .= '>';
         $library_li .= $library_value['name'] . '<br /></label>';
     }
     $library_li .= '</div></li>';
     echo $library_li;
     $provider_values = VideoLibrary_DatabaseHelper::get_external_video_providers();
     $provider_li = '<li><label for="external_video_provider_id">Provider</label><div id="external_video_provider_ids" class="radio-inputs">';
     foreach ($provider_values as $provider_value) {
         $provider_li .= '<label><input type="radio" name="external_video_provider_id" value="' . $provider_value['id'] . '"';
         $cur_provider_value = $acm->has_current_var('external_video_provider_id') ? $acm->get_current_var('external_video_provider_id') : NULL;
         if ($cur_provider_value == $provider_value['id']) {
             $provider_li .= ' checked="checked"';
         }
         $provider_li .= '>';
         $provider_li .= $provider_value['name'] . '<br /></label>';
     }
     $provider_li .= '</div></li>';
     echo $provider_li;
     // $this->render_edit_something_form_li_text_input('name');
     $cur_name_value = $acm->has_current_var('name') ? $acm->get_current_var('name') : NULL;
     echo '<li><label for="name">Name</label>';
     echo '<input type="text" name="name" id="name" value ="';
     echo stripslashes(html_entity_decode($cur_name_value));
     echo '" />';
     $this->render_edit_something_form_li_text_input('providers_internal_id');
     // $this->render_edit_something_form_li_text_input('length');
     $cur_length_value = $acm->has_current_var('length_seconds') ? $acm->get_current_var('length_seconds') : NULL;
     $current_length = gmdate("H:i:s", $cur_length_value);
     echo '<li><label for="length">Length (mm:ss)</label>';
     echo '<input type="text" name="length" id="length" value ="';
     echo $current_length;
     echo '" />';
     $status_values = VideoLibrary_DatabaseHelper::get_enum_values('hpi_video_library_external_videos', 'status');
     // $status_li = '<li><label for="status">Status</label><select name="status">';
     $status_li = '<li><label for="status">Status</label><div class="radio-inputs">';
     foreach ($status_values as $status_value) {
         $status_li .= '<label><input type="radio" name="status" value="' . $status_value . '"';
         $cur_status_value = $acm->has_current_var('status') ? $acm->get_current_var('status') : NULL;
         if ($cur_status_value == $status_value) {
             $status_li .= ' checked="checked"';
         }
         $i++;
         $status_li .= '>';
         $status_li .= $status_value . '<br /></label>';
         // $status_li .= '<option value="' . $status_value . '">' . $status_value . '</option>';
     }
     $status_li .= '</div></li>';
     // $status_li .= '</select></li>';
     echo $status_li;
     echo '<fieldset class="tags-fieldset" id="tags-fieldset"><legend>Tags</legend>';
     echo '<li><label for="tags">Tags</label>';
     echo '<input type="text" name="tags" id="tags" value ="';
     echo VideoLibrary_DisplayHelper::get_tags_csv_string(VideoLibrary_DatabaseHelper::get_tags_for_external_video_id($_GET['id']));
     echo '" />';
     // echo $this->get_tags_list_for_form($library_values);
     echo '</fieldset>';
     echo "</ol>\n";
     echo $this->get_form_help_message();
 }