Beispiel #1
0
 function build_edit_html_article_popup($aid)
 {
     $db_functions_obj = new DbFunctions();
     $validation_js_obj = new Validation_js();
     $cat_obj = new Category();
     $helper_obj = new Helper();
     $pgrate_obj = new Pgrate();
     $tag_obj = new Tag();
     $article_tags = $db_functions_obj->get_article_tags($aid);
     $article_categories = $db_functions_obj->get_article_categories($aid);
     global $base_path;
     $article_info = $db_functions_obj->get_article_html_by_id($aid);
     $output = "";
     //$output .= '<script src="js/plugins/ckeditor/ckeditor.js"></script>';
     //$output = $validation_js_obj->edit_article_validation();
     $output .= "<script>\$(document).ready(function() {  var isvalid = \$(\"#edit_html_article\").valid();\n        \$('#edit_html_article').ajaxForm(function(res) { \n                        \n                        if (isvalid) { \n                            var data = res.split(\"***#***\");   \n                            \$('#article_' + data[1]).after(data[0]);\n                            \$('#article_' + data[1]).remove(); \n                            closePopup();\n                        }  \n                    }); }); \n                    </script>";
     $output .= "<div class='popup-header'>" . $helper_obj->t("Edit Article") . " " . $article_info['title'] . "</div>";
     $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_html_article' id='edit_html_article' method='post' action='{$base_path}" . "edit_html_article'>";
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Title</label>\n                        <div class='controls'>\n                           <input style='width:500px' type='text' id='title_updated' name='title_updated' value='" . $article_info['title'] . "'>\n                        </div>\n                      </div>";
     /*$output .= "<div class='control-group'> 
          <label class='control-label' for='client_name'>Video Url</label>
          <div class='controls'> 
            <input style='width:600px' class='input-xlarge' data-rule-required='true' type='text' name='video_updated' id='video_updated' value='" . $article_info->video . "'>  
          </div>
       </div>";   */
     $output .= "<div class='control-group'> \n                        <label class='control-label' for='client_name'>Image1</label>\n                        <div class='controls'>\n                            <input accept='image/*' type='file' name='image1_updated' id='image1_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $article_info['image'] . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n                        </div>\n                      </div>";
     $output .= $cat_obj->build_categories_list('edit', $article_categories);
     $output .= $pgrate_obj->build_pgrate_list("edit", $article_info['pg_rated_id']);
     $output .= $tag_obj->build_tags_list("edit", $article_tags, "", "style='height:152px'");
     $radio1 = "";
     $radio2 = "";
     $radio3 = "";
     if ($article_info['section'] == 1) {
         $radio1 = "checked='checked'";
     }
     if ($article_info['section'] == 2) {
         $radio2 = "checked='checked'";
     }
     $output .= '<div class="control-group">
                         <label class="control-label">Main Category in home page</label>
                         <div class="controls">
                             <label class="radio">
                                 <input ' . $radio1 . ' type="radio" name="section_updated" value="1"> Top Section
                             </label>
                             <label class="radio">
                                 <input ' . $radio2 . ' type="radio" name="section_updated" value="2"> Middle Section 
                             </label> 
                         </div>
                     </div>';
     $output .= '<div class="row-fluid">
                     <div class="span12">
                         <div class="box">
                             <div class="box-title">
                                 <h3><i class="icon-th"></i> Article Body</h3>
                             </div>
                             <div class="box-content nopadding">
                                 <textarea data-rule-required=\'true\' name="ck_updated" id="ck_updated" class=\'ckeditor span12\' rows="5">' . $article_info['body'] . '</textarea>
                             </div>
                         </div>
                     </div>
                ';
     $output .= "<input onclick='setHtmlEditorValue();' class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>";
     $output .= "<input type='hidden' name='edit_article' id='edit_article' value='" . $aid . "'>";
     $output .= "</form>";
     return $output;
 }