Пример #1
0
 function build_rss_source_list($page = 'add', $selected_rss_source = "", $onclick = "", $style = "")
 {
     $db_functions_obj = new DbFunctions();
     $helper_obj = new Helper();
     $rss_sources = $db_functions_obj->get_all_rss_sources();
     $output = "<div class='control-group'> \n                        <label class='control-label' for='client_name'>RSS Sources</label>\n                        <div class='controls'>";
     $output .= "<select class='input-xlarge' data-rule-required='true' {$style} {$onclick} id='{$page}" . "_rss_source' name='{$page}" . "_rss_source'>";
     $output .= "<option value=''>" . $helper_obj->t("Select...") . "</option>";
     foreach ($rss_sources as $key => $value) {
         if ($selected_rss_source != "") {
             $output .= "<option ";
             if ($selected_rss_source == $value->id) {
                 $output .= " selected='selected' ";
             }
             $output .= "value='{$value->id}'>{$value->source_name}</option>";
         } else {
             $output .= "<option value='{$value->id}'>{$value->source_name}</option>";
         }
     }
     $output .= "</select>";
     $output .= "</div>";
     $output .= "</div>";
     return $output;
 }