Add image link to json output, a=chris

Chris Pollett [2015-01-02 16:Jan:nd]
Add image link to json output, a=chris
Filename
controllers/search_controller.php
views/elements/groupfeed_element.php
diff --git a/controllers/search_controller.php b/controllers/search_controller.php
index 2fd26f579..4cac7f435 100755
--- a/controllers/search_controller.php
+++ b/controllers/search_controller.php
@@ -161,6 +161,9 @@ class SearchController extends Controller implements CrawlConstants
                     if(isset($page[self::TYPE])) {
                         $item["type"] = $page[self::TYPE];
                     }
+                    if(isset($page[self::IMAGE_LINK])) {
+                        $item["image_link"] = $page[self::IMAGE_LINK];
+                    }
                     $out_data['item'][] =$item;
                 }
                 echo json_encode($out_data);
diff --git a/views/elements/groupfeed_element.php b/views/elements/groupfeed_element.php
index c6d81bd0e..07e2b4fc9 100644
--- a/views/elements/groupfeed_element.php
+++ b/views/elements/groupfeed_element.php
@@ -547,6 +547,8 @@ class GroupfeedElement extends Element implements CrawlConstants
         ?>
         <script type="text/javascript"><?php
             $clear = (MOBILE) ? " clear" : "";
+            $drag_above_text = tl('fileupload_helper_drag_textarea');
+            $click_link_text = tl('fileupload_helper_click_textarea');
         ?>
         var updateId = null;
         function comment_form(id, parent_id, group_id)
@@ -577,12 +579,20 @@ class GroupfeedElement extends Element implements CrawlConstants
                     'data-buttons="all,!wikibtn-search,!wikibtn-heading,'+
                     '!wikibtn-slide" '+
                     '></textarea>' +
+                    '<div class="upload-gray-box center black">' +
+                    '<input type="file" id="file-' + id + '" name="file_' + id +
+                    '"  class="none" multiple="multiple" />' +
+                    '<?php e($drag_above_text);?>' +
+                    '<a href="javascript:elt(\'file-' + id + '\').click()">'+
+                    '<?php e($click_link_text); ?></a></div>' +
                     '<button class="button-box float-opposite" ' +
-                    'type="submit"><?php e(tl("groupfeed_element_save"));
-                    ?></button>' +
-                    '<div>&nbsp;</div>'+
+                    'type="submit"><?php e(tl("groupfeed_element_save"));?>'+
+                    '</button><div>&nbsp;</div>' +
                     '</form>';
                 var comment_id = 'comment-' + id;
+                initializeFileHandler(comment_id , "file-" + id,
+                    <?php e(metricToInt(ini_get('upload_max_filesize')));
+                    ?>, "textarea", null, true);
                 editorize(comment_id);
                 elt(comment_id).focus();
             } else {
@@ -628,12 +638,22 @@ class GroupfeedElement extends Element implements CrawlConstants
                     'id="description-'+ id +'" name="description" '+
                     'data-buttons="all,!wikibtn-search,!wikibtn-heading,' +
                     '!wikibtn-slide" ></textarea>' +
+                    '<div class="upload-gray-box center black">' +
+                    '<input type="file" id="file-' + id + '" name="file_' + id +
+                    '"  class="none" multiple="multiple" />' +
+                    '<?php e($drag_above_text);?>' +
+                    '<a href="javascript:elt(\'file-' + id + '\').click()">'+
+                    '<?php e($click_link_text); ?></a></div>' +
                     '<button class="button-box float-opposite" ' +
                     'type="submit"><?php e(tl("groupfeed_element_save"));
                     ?></button>' +
                     '<div>&nbsp;</div>'+
                     '</form>';
-                editorize('description-'+ id);
+                var description_id = 'description-' + id;
+                initializeFileHandler(description_id , "file-" + id,
+                    <?php e(metricToInt(ini_get('upload_max_filesize')));
+                    ?>, "textarea", null, true);
+                editorize(description_id);
             } else {
                 elt(id).innerHTML = "";
             }
@@ -676,12 +696,22 @@ class GroupfeedElement extends Element implements CrawlConstants
                     'id="description-'+ id +'" name="description" '+
                     'data-buttons="all,!wikibtn-search,!wikibtn-heading,' +
                     '!wikibtn-slide" >' + description + '</textarea>'+
+                    '<div class="upload-gray-box center black">' +
+                    '<input type="file" id="file-' + id + '" name="file_' + id +
+                    '"  class="none" multiple="multiple" />' +
+                    '<?php e($drag_above_text);?>' +
+                    '<a href="javascript:elt(\'file-' + id + '\').click()">'+
+                    '<?php e($click_link_text); ?></a></div>' +
                     '<button class="button-box float-opposite" ' +
                     'type="submit"><?php e(tl("groupfeed_element_save"));
                     ?></button>' +
                     '<div>&nbsp;</div>'+
                     '</form>';
-                editorize('description-'+ id);
+                var description_id = 'description-' + id;
+                initializeFileHandler(description_id , "file-" + id,
+                    <?php e(metricToInt(ini_get('upload_max_filesize')));
+                    ?>, "textarea", null, true);
+                editorize(description_id);
             } else {
                 elt(id).innerHTML = "";
                 setDisplay('result-'+id, true);
ViewGit