_binary From a5895cdbb2b5c9e23da45deb48459a9e9710d5d3 Mon Sep 17 00:00:00 2001
From: epinapala <epinapala@ebay.com>
Date: Fri, 17 Oct 2014 00:23:50 -0700
Subject: [PATCH 1/2] Creating another patch With all suggested changes, Please
 see summary below (1) The single feed and category icons look different in
 size. This might be an optical illusion caused by differences in padding in
 the two icons, but is still disconcerting. The category icon should not be
 bar, two indented bars, bar, indented bar. Instead, just use bar indented
 bar, bar indented bar. - Fixed icons as per your suggestion. (2) The single
 feed and category buttons only work when using the admin (non-collapsed)
 controller. They don't show up at all when using the group (collapsed)
 controller. - This is fixed, also When moving from expanded controller to
 collapsed controller, view is also retained. (3) Category view is not doing
 sufficient isset checks. It generates Notices like: NOTICE: Undefined index:
 SUBTITLE at line 104 in
 /Applications/MAMP/htdocs/git/yioop/views/elements/groupfeed_element.php

NOTICE: Undefined index: SUBTITLE at line 122 in /Applications/MAMP/htdocs/git/yioop/views/elements/groupfeed_element.php

- These errors and another on the same page are all fixed byt checking using isset()

(4) In the wiki, I don't see what the Preview button does which is useful. When I click either Save or Preview it says that the page is saved. So it does not seem to be previewing changes. For the extra-button I would really like a strong use-case for why it is needed.
- When you click on Preview, that doesnt save the wiki content. I am not sure why this happened when you tried. I tried again multiple times and clicking on Preview just shows the preview. The idea behing having a seperate preview button is to save additional POST call to the server, Again, this is somethign I found very handy on Media wiki.

(5) You are also adding a lot of code for the help wiki, but no way the end user can test it. This needs to be testable before the patch goes live. Have at least one place where help has been added so I can test this new functionality.
- I added a sample help button on manageGroups action -  ?c=admin&YIOOP_TOKEN=obbrFXEgrts|1413522871&a=manageGroups. Please let me know If you need the buttons rendered anywhere else.
---
 controllers/api_controller.php              |  130 ++
 controllers/components/social_component.php |   76 +-
 controllers/controller.php                  |    1 +
 css/search.css                              |   84 +-
 fix_empty_poster.patch                      | 1978 +++++++++++++++++++++++++++
 index.php                                   |    5 +-
 locale/ar/configure.ini                     |    3 +
 locale/bn/configure.ini                     |    3 +
 locale/de/configure.ini                     |    3 +
 locale/en-US/configure.ini                  |    5 +-
 locale/es/configure.ini                     |    3 +
 locale/fa/configure.ini                     |    3 +
 locale/fr-FR/configure.ini                  |    3 +
 locale/he/configure.ini                     |    3 +
 locale/hi/configure.ini                     |    3 +
 locale/in-ID/configure.ini                  |    3 +
 locale/it/configure.ini                     |    3 +
 locale/ja/configure.ini                     |    3 +
 locale/kn/configure.ini                     |    3 +
 locale/ko/configure.ini                     |    3 +
 locale/pl/configure.ini                     |    3 +
 locale/pt/configure.ini                     |    3 +
 locale/ru/configure.ini                     |    3 +
 locale/te/configure.ini                     |    3 +
 locale/th/configure.ini                     |    3 +
 locale/tr/configure.ini                     |    3 +
 locale/vi-VN/configure.ini                  |    3 +
 locale/zh-CN/configure.ini                  |    3 +
 models/group_model.php                      |    2 +-
 scripts/basic.js                            |  300 ++++
 views/admin_view.php                        |    1 +
 views/api_view.php                          |   61 +
 views/elements/api_element.php              |  108 ++
 views/elements/element.php                  |   22 +
 views/elements/groupfeed_element.php        |   91 +-
 views/elements/help_element.php             |  100 ++
 views/elements/managegroups_element.php     |   21 +-
 views/elements/wiki_element.php             |    9 +
 views/group_view.php                        |    1 +
 views/layouts/api_layout.php                |   63 +
 40 files changed, 3100 insertions(+), 21 deletions(-)
 create mode 100644 controllers/api_controller.php
 create mode 100644 fix_empty_poster.patch
 create mode 100644 views/api_view.php
 create mode 100644 views/elements/api_element.php
 create mode 100644 views/elements/help_element.php
 create mode 100644 views/layouts/api_layout.php

diff --git a/controllers/api_controller.php b/controllers/api_controller.php
new file mode 100644
index 0000000..641067a
--- /dev/null
+++ b/controllers/api_controller.php
@@ -0,0 +1,130 @@
+<?php
+
+/*
+ *  SeekQuarry/Yioop --
+ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
+ *
+ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
+ *
+ *  LICENSE:
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  END LICENSE
+ *
+ *  @author Eswara Rajesh Pinapala epinapala@live.com
+ *  @package seek_quarry
+ *  @subpackage element
+ *  @license http://www.gnu.org/licenses/ GPL3
+ *  @link http://www.seekquarry.com/
+ *  @copyright 2009 - 2014
+ *  @filesource
+ */
+
+/**
+ * Description of ApiController
+ *
+ * @author epinapala
+ */
+if (!defined('BASE_DIR')) {
+    echo "BAD REQUEST";
+    exit();
+}
+/** Load base controller class if needed */
+require_once BASE_DIR . "/controllers/controller.php";
+/** Loads common constants for web crawling */
+require_once BASE_DIR . "/lib/crawl_constants.php";
+/** For Wiki Parsing */
+require_once BASE_DIR . "/lib/wiki_parser.php";
+
+/**
+ * Controller used to handle user group activities outside of
+ * the admin panel setting. This either could be because the admin panel
+ * is "collapsed" or because the request concerns a wiki page.
+ *
+ * @author Eswara Rajesh Pinapala
+ * @package seek_quarry
+ * @subpackage controller
+ */
+class ApiController extends Controller implements CrawlConstants {
+
+    /**
+     * Says which activities (roughly methods invoke for the api) this
+     * controller will respond to (note: more activities will be loaded from
+     * components)
+     * @var array
+     */
+    var $activities = array("wiki");
+
+    /**
+     * Used to process requests related to user group activities outside of
+     * the admin panel setting. This either could be because the admin panel
+     * is "collapsed" or because the request concerns a wiki page.
+     */
+    function processRequest() {
+        $data = array();
+        if (!PROFILE) {
+            return $this->configureRequest();
+        }
+        if (isset($_SESSION['USER_ID'])) {
+            $user_id = $_SESSION['USER_ID'];
+            $data['ADMIN'] = 1;
+        } else {
+            $user_id = $_SERVER['REMOTE_ADDR'];
+        }
+        $data['SCRIPT'] = "";
+        $token_okay = $this->checkCSRFToken(CSRF_TOKEN, $user_id);
+
+        $data = array_merge($data, $this->processSession());
+
+        if (isset($data["VIEW"])) {
+            $view = $data["VIEW"];
+        } else {
+            $view = 'api';
+        }
+        $_SESSION['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
+        $this->displayView($view, $data);
+    }
+
+    /**
+     * Used to perform the actual activity call to be done by the
+     * api_controller.
+     * processSession is called from @see processRequest, which does some
+     * cleaning of fields if the CSRFToken is not valid. It is more likely
+     * that that api_controller may be involved in such requests as it can
+     * be invoked either when a user is logged in or not and for users with and
+     * without accounts. processSession makes sure the $_REQUEST'd activity is
+     * valid (or falls back to groupFeeds) then calls it. If someone uses
+     * the Settings link to change the language or default number of feed
+     * elements to view, this method sets up the $data variable so that
+     * the back/cancel button on that page works correctly.
+     */
+    function processSession() {
+        if (isset($_REQUEST['a']) &&
+                in_array($_REQUEST['a'], $this->activities)) {
+            $activity = $_REQUEST['a'];
+        } else {
+            $activity = "groupFeeds";
+        }
+        $data = $this->call($activity);
+        $data['ACTIVITY_CONTROLLER'] = "group";
+        $data['ACTIVITY_METHOD'] = $activity; //for settings controller
+        if (!is_array($data)) {
+            $data = array();
+        }
+        return $data;
+    }
+}
+
+?>
diff --git a/controllers/components/social_component.php b/controllers/components/social_component.php
index 3327ffc..5294091 100644
--- a/controllers/components/social_component.php
+++ b/controllers/components/social_component.php
@@ -718,6 +718,59 @@ class SocialComponent extends Component implements CrawlConstants
         }
         $possible_arguments = array("addcomment", "deletepost", "addgroup",
             "newthread", "updatepost", "status", "upvote", "downvote");
+        if (isset($_REQUEST['v']) && $_REQUEST['v'] == 'grouped') {
+            $data['MODE'] = 'grouped';
+            if(isset($_REQUEST['just_group_id'])){
+            $data['JUST_GROUP_ID'] = $_REQUEST['just_group_id'];
+            }
+            if (isset($_REQUEST['limit'])) {
+                $limit = $parent->clean($_REQUEST['limit'], "int");
+            } else {
+                $limit = 0;
+            }
+            //$data['NUM_SHOWN'] = (isset($_REQUEST['limit'])
+            //      && $_REQUEST['limit'] > 0 ) ? $_REQUEST['limit'] : 5;
+            $data['GROUPS'] = $group_model->getRows($limit, $results_per_page,
+                    $data['NUM_GROUPS'], array(), array($user_id, false));
+            $num_shown = count($data['GROUPS']);
+            for ($i = 0; $i < $num_shown; $i++) {
+                $search_array = array(array("group_id", "=",
+                        $data['GROUPS'][$i]['GROUP_ID'], ""),
+                    array("pub_date", "", "", "DESC"));
+                $item = $group_model->getGroupItems(
+                        0,
+                        1,
+                        $search_array,
+                        $user_id);
+                $data['GROUPS'][$i]['NUM_POSTS'] =
+                        $group_model->getGroupItemCount(
+                                $search_array, $user_id);
+                $data['GROUPS'][$i]['NUM_THREADS'] =
+                        $group_model->getGroupItemCount(
+                                $search_array,
+                                $user_id,
+                                $data['GROUPS'][$i]['GROUP_ID']
+                                );
+                $data['GROUPS'][$i]['NUM_PAGES'] =
+                        $group_model->getGroupPageCount(
+                        $data['GROUPS'][$i]['GROUP_ID']);
+                if (isset($item[0]['TITLE'])) {
+                    $data['GROUPS'][$i]["ITEM_TITLE"] = $item[0]['TITLE'];
+                    $data['GROUPS'][$i]["THREAD_ID"] = $item[0]['PARENT_ID'];
+                } else {
+                    $data['GROUPS'][$i]["ITEM_TITLE"] =
+                            tl('accountaccess_component_no_posts_yet');
+                    $data['GROUPS'][$i]["THREAD_ID"] = -1;
+                }
+            }
+            $data['NUM_SHOWN'] = $num_shown;
+            $data['LIMIT'] = $limit;
+            $data['RESULTS_PER_PAGE'] = $results_per_page;
+            $data['PAGING_QUERY'] = "./?c=$controller_name&amp;a=groupFeeds";
+            $data['OTHER_PAGING_QUERY'] =
+            "./?c=$other_controller_name&amp;a=groupFeeds";
+            return $data;
+        }
         if(isset($_REQUEST['arg']) &&
             in_array($_REQUEST['arg'], $possible_arguments)) {
             switch($_REQUEST['arg'])
@@ -1245,11 +1298,21 @@ EOD;
         }
         $group = $group_model->getGroupById($group_id, $user_id);
         $data["CAN_EDIT"] = false;
-        $data["MODE"] = "read";
+        if((isset($_REQUEST['c'])) && $_REQUEST['c'] == "api"){
+            $data['MODE'] = 'api';
+            $data['VIEW'] = 'api';
+        }else {
+            $data["MODE"] = "read";
+        }
         if(!$group) {
+            if($data['MODE'] !== 'api'){
             $data['SCRIPT'] .= "doMessage('<h1 class=\"red\" >".
                 tl("group_controller_no_group_access").
                 "</h1>');";
+            }else{
+                $data['errors'] =  array();
+                $data['errors'][] = tl("group_controller_no_group_access");
+            }
             $group_id = PUBLIC_GROUP_ID;
             $group = $group_model->getGroupById($group_id, $user_id);
         } else {
@@ -1292,7 +1355,8 @@ EOD;
                 case "edit":
                     if(!$data["CAN_EDIT"]) { continue; }
                     if(isset($_REQUEST['caret']) &&
-                       isset($_REQUEST['scroll_top'])) {
+                       isset($_REQUEST['scroll_top'])
+                            && !isset($page)) {
                         $caret = $parent->clean($_REQUEST['caret'],
                             'int');
                         $scroll_top= $parent->clean($_REQUEST['scroll_top'],
@@ -1304,7 +1368,11 @@ EOD;
                             "} ".
                             "wiki.scrollTop = $scroll_top;";
                     }
-                    $data["MODE"] = "edit";
+                    if(isset($page)){
+                        $data["MODE"] = "read";
+                    }else{
+                        $data["MODE"] = "edit";
+                    }
                     $page_info = $group_model->getPageInfoByName($group_id,
                         $page_name, $locale_tag, 'resources');
                     /* if page not yet created than $page_info will be null
@@ -1609,7 +1677,7 @@ EOD;
             $page_name = tl('group_controller_main');
         }
         $data["GROUP"] = $group;
-        if(in_array($data["MODE"], array("read", "edit", "media"))) {
+        if(in_array($data["MODE"], array("read", "edit", "media","api"))) {
             if(!isset($data["PAGE"]) || !$data['PAGE']) {
                 $data["PAGE_NAME"] = $page_name;
                 if(isset($search_page_info) && $search_page_info) {
diff --git a/controllers/controller.php b/controllers/controller.php
index 7b8bdfd..863ddd1 100755
--- a/controllers/controller.php
+++ b/controllers/controller.php
@@ -254,6 +254,7 @@ abstract class Controller
                 $data['TOTAL_ELAPSED_TIME'] += $mail_total_time;
             }
         }
+        $data['c'] = isset($_REQUEST['c']) ? $_REQUEST['c'] : NULL;
         $this->view($view)->render($data);
     }
     /**
diff --git a/css/search.css b/css/search.css
index d96382f..cf0b54b 100755
--- a/css/search.css
+++ b/css/search.css
@@ -2199,7 +2199,7 @@ div.group-result
     font-size: 16pt;
     max-width: 9in;
     min-height: 6.5in;
-    min-width: 9in;
+    min-width: 8in;
     padding-left: 0.1in;
     padding-right: 0.1in;
     padding-bottom: 0.1in;
@@ -2763,3 +2763,85 @@ table.wikitable > caption
     z-index: 200;
 }
 
+.html-ltr #help
+{
+    border-radius: 8px;
+    float: left;
+    width: 4.0in;
+    position: absolute;
+    left: 11.5in;
+    top: 135px;
+}
+
+.html-rtl #help
+{
+    border-radius: 8px;
+    float: left;
+    width: 4.0in;
+    position: absolute;
+    right: 11.5in;
+    top: 135px;
+}
+
+.html-ltr #small-margin-help
+{
+    border-radius: 8px;
+    float: left;
+    width: 4.0in;
+    position: absolute;
+    left: 11.5in;
+    top: 135px;
+}
+
+.html-rtl #small-margin-help
+{
+    border-radius: 8px;
+    float: left;
+    width: 4.0in;
+    position: absolute;
+    right: 9.5in;
+    top: 135px;
+}
+
+.html-ltr #mobile-help
+{
+    float: left;
+    width: 3in;
+    position: absolute;
+    top: 142px;
+}
+
+.html-rtl #mobile-help
+{
+    float: left;
+    width: 3in;
+    position: absolute;
+    top: 142px;
+}
+
+.help-pane{
+    display : none;
+    width: 320px;
+    border:2px solid #0094ff;
+}
+
+.small-margin-help-pane {
+display: none;
+width: 380px;
+border: 2px solid #0094ff;
+left: -1in;
+top: 1in;
+}
+
+.help-pane h2 {
+    background:#0094ff;
+    color:white;
+    padding:10px;
+}
+.help-pane p {
+    color:#333;
+    padding:10px;
+}
+.wiki-resource-image{
+    max-width:100%;
+}
diff --git a/fix_empty_poster.patch b/fix_empty_poster.patch
new file mode 100644
index 0000000..d2cbbd4
--- /dev/null
+++ b/fix_empty_poster.patch
@@ -0,0 +1,1978 @@
+From 5ad9d236c03a57525daa3a729334b4a6b600c838 Mon Sep 17 00:00:00 2001
+From: epinapala <epinapala@ebay.com>
+Date: Fri, 17 Oct 2014 00:09:18 -0700
+Subject: [PATCH 1/4] Creating another patch With all suggested changes, Please
+ see summary below (1) The single feed and category icons look different in
+ size. This might be an optical illusion caused by differences in padding in
+ the two icons, but is still disconcerting. The category icon should not be
+ bar, two indented bars, bar, indented bar. Instead, just use bar indented
+ bar, bar indented bar. - Fixed icons as per your suggestion. (2) The single
+ feed and category buttons only work when using the admin (non-collapsed)
+ controller. They don't show up at all when using the group (collapsed)
+ controller. - This is fixed, also When moving from expanded controller to
+ collapsed controller, view is also retained. (3) Category view is not doing
+ sufficient isset checks. It generates Notices like: NOTICE: Undefined index:
+ SUBTITLE at line 104 in
+ /Applications/MAMP/htdocs/git/yioop/views/elements/groupfeed_element.php
+
+NOTICE: Undefined index: SUBTITLE at line 122 in /Applications/MAMP/htdocs/git/yioop/views/elements/groupfeed_element.php
+
+- These errors and another on the same page are all fixed byt checking using isset()
+
+(4) In the wiki, I don't see what the Preview button does which is useful. When I click either Save or Preview it says that the page is saved. So it does not seem to be previewing changes. For the extra-button I would really like a strong use-case for why it is needed.
+- When you click on Preview, that doesnt save the wiki content. I am not sure why this happened when you tried. I tried again multiple times and clicking on Preview just shows the preview. The idea behing having a seperate preview button is to save additional POST call to the server, Again, this is somethign I found very handy on Media wiki.
+
+(5) You are also adding a lot of code for the help wiki, but no way the end user can test it. This needs to be testable before the patch goes live. Have at least one place where help has been added so I can test this new functionality.
+- I added a sample help button on manageGroups action -  ?c=admin&YIOOP_TOKEN=obbrFXEgrts|1413522871&a=manageGroups. Please let me know If you need the buttons rendered anywhere else.
+---
+ .gitignore                                  |   6 +-
+ controllers/api_controller.php              | 130 ++++++++++++
+ controllers/components/social_component.php |  76 ++++++-
+ controllers/controller.php                  |   1 +
+ css/search.css                              |  84 +++++++-
+ index.php                                   |   5 +-
+ locale/ar/configure.ini                     |   3 +
+ locale/bn/configure.ini                     |   3 +
+ locale/de/configure.ini                     |   3 +
+ locale/en-US/configure.ini                  |   5 +-
+ locale/es/configure.ini                     |   3 +
+ locale/fa/configure.ini                     |   3 +
+ locale/fr-FR/configure.ini                  |   3 +
+ locale/he/configure.ini                     |   3 +
+ locale/hi/configure.ini                     |   3 +
+ locale/in-ID/configure.ini                  |   3 +
+ locale/it/configure.ini                     |   3 +
+ locale/ja/configure.ini                     |   3 +
+ locale/kn/configure.ini                     |   3 +
+ locale/ko/configure.ini                     |   3 +
+ locale/pl/configure.ini                     |   3 +
+ locale/pt/configure.ini                     |   3 +
+ locale/ru/configure.ini                     |   3 +
+ locale/te/configure.ini                     |   3 +
+ locale/th/configure.ini                     |   3 +
+ locale/tr/configure.ini                     |   3 +
+ locale/vi-VN/configure.ini                  |   3 +
+ locale/zh-CN/configure.ini                  |   3 +
+ models/group_model.php                      |   2 +-
+ scripts/basic.js                            | 300 ++++++++++++++++++++++++++++
+ views/admin_view.php                        |   1 +
+ views/api_view.php                          |  61 ++++++
+ views/elements/api_element.php              | 108 ++++++++++
+ views/elements/element.php                  |  22 ++
+ views/elements/groupfeed_element.php        |  91 ++++++++-
+ views/elements/help_element.php             | 100 ++++++++++
+ views/elements/managegroups_element.php     |  21 +-
+ views/elements/wiki_element.php             |   9 +
+ views/group_view.php                        |   1 +
+ views/layouts/api_layout.php                |  63 ++++++
+ 40 files changed, 1126 insertions(+), 23 deletions(-)
+ create mode 100644 controllers/api_controller.php
+ create mode 100644 views/api_view.php
+ create mode 100644 views/elements/api_element.php
+ create mode 100644 views/elements/help_element.php
+ create mode 100644 views/layouts/api_layout.php
+
+diff --git a/.gitignore b/.gitignore
+index fb633b5..f946ad8 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -1,2 +1,4 @@
+-local_config.php
+-.DS_Store
++local_config.php
++.DS_Store
++nbproject/
++/.idea/
+diff --git a/controllers/api_controller.php b/controllers/api_controller.php
+new file mode 100644
+index 0000000..641067a
+--- /dev/null
++++ b/controllers/api_controller.php
+@@ -0,0 +1,130 @@
++<?php
++
++/*
++ *  SeekQuarry/Yioop --
++ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
++ *
++ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
++ *
++ *  LICENSE:
++ *
++ *  This program is free software: you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation, either version 3 of the License, or
++ *  (at your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
++ *
++ *  END LICENSE
++ *
++ *  @author Eswara Rajesh Pinapala epinapala@live.com
++ *  @package seek_quarry
++ *  @subpackage element
++ *  @license http://www.gnu.org/licenses/ GPL3
++ *  @link http://www.seekquarry.com/
++ *  @copyright 2009 - 2014
++ *  @filesource
++ */
++
++/**
++ * Description of ApiController
++ *
++ * @author epinapala
++ */
++if (!defined('BASE_DIR')) {
++    echo "BAD REQUEST";
++    exit();
++}
++/** Load base controller class if needed */
++require_once BASE_DIR . "/controllers/controller.php";
++/** Loads common constants for web crawling */
++require_once BASE_DIR . "/lib/crawl_constants.php";
++/** For Wiki Parsing */
++require_once BASE_DIR . "/lib/wiki_parser.php";
++
++/**
++ * Controller used to handle user group activities outside of
++ * the admin panel setting. This either could be because the admin panel
++ * is "collapsed" or because the request concerns a wiki page.
++ *
++ * @author Eswara Rajesh Pinapala
++ * @package seek_quarry
++ * @subpackage controller
++ */
++class ApiController extends Controller implements CrawlConstants {
++
++    /**
++     * Says which activities (roughly methods invoke for the api) this
++     * controller will respond to (note: more activities will be loaded from
++     * components)
++     * @var array
++     */
++    var $activities = array("wiki");
++
++    /**
++     * Used to process requests related to user group activities outside of
++     * the admin panel setting. This either could be because the admin panel
++     * is "collapsed" or because the request concerns a wiki page.
++     */
++    function processRequest() {
++        $data = array();
++        if (!PROFILE) {
++            return $this->configureRequest();
++        }
++        if (isset($_SESSION['USER_ID'])) {
++            $user_id = $_SESSION['USER_ID'];
++            $data['ADMIN'] = 1;
++        } else {
++            $user_id = $_SERVER['REMOTE_ADDR'];
++        }
++        $data['SCRIPT'] = "";
++        $token_okay = $this->checkCSRFToken(CSRF_TOKEN, $user_id);
++
++        $data = array_merge($data, $this->processSession());
++
++        if (isset($data["VIEW"])) {
++            $view = $data["VIEW"];
++        } else {
++            $view = 'api';
++        }
++        $_SESSION['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
++        $this->displayView($view, $data);
++    }
++
++    /**
++     * Used to perform the actual activity call to be done by the
++     * api_controller.
++     * processSession is called from @see processRequest, which does some
++     * cleaning of fields if the CSRFToken is not valid. It is more likely
++     * that that api_controller may be involved in such requests as it can
++     * be invoked either when a user is logged in or not and for users with and
++     * without accounts. processSession makes sure the $_REQUEST'd activity is
++     * valid (or falls back to groupFeeds) then calls it. If someone uses
++     * the Settings link to change the language or default number of feed
++     * elements to view, this method sets up the $data variable so that
++     * the back/cancel button on that page works correctly.
++     */
++    function processSession() {
++        if (isset($_REQUEST['a']) &&
++                in_array($_REQUEST['a'], $this->activities)) {
++            $activity = $_REQUEST['a'];
++        } else {
++            $activity = "groupFeeds";
++        }
++        $data = $this->call($activity);
++        $data['ACTIVITY_CONTROLLER'] = "group";
++        $data['ACTIVITY_METHOD'] = $activity; //for settings controller
++        if (!is_array($data)) {
++            $data = array();
++        }
++        return $data;
++    }
++}
++
++?>
+diff --git a/controllers/components/social_component.php b/controllers/components/social_component.php
+index 3327ffc..5294091 100644
+--- a/controllers/components/social_component.php
++++ b/controllers/components/social_component.php
+@@ -718,6 +718,59 @@ class SocialComponent extends Component implements CrawlConstants
+         }
+         $possible_arguments = array("addcomment", "deletepost", "addgroup",
+             "newthread", "updatepost", "status", "upvote", "downvote");
++        if (isset($_REQUEST['v']) && $_REQUEST['v'] == 'grouped') {
++            $data['MODE'] = 'grouped';
++            if(isset($_REQUEST['just_group_id'])){
++            $data['JUST_GROUP_ID'] = $_REQUEST['just_group_id'];
++            }
++            if (isset($_REQUEST['limit'])) {
++                $limit = $parent->clean($_REQUEST['limit'], "int");
++            } else {
++                $limit = 0;
++            }
++            //$data['NUM_SHOWN'] = (isset($_REQUEST['limit'])
++            //      && $_REQUEST['limit'] > 0 ) ? $_REQUEST['limit'] : 5;
++            $data['GROUPS'] = $group_model->getRows($limit, $results_per_page,
++                    $data['NUM_GROUPS'], array(), array($user_id, false));
++            $num_shown = count($data['GROUPS']);
++            for ($i = 0; $i < $num_shown; $i++) {
++                $search_array = array(array("group_id", "=",
++                        $data['GROUPS'][$i]['GROUP_ID'], ""),
++                    array("pub_date", "", "", "DESC"));
++                $item = $group_model->getGroupItems(
++                        0,
++                        1,
++                        $search_array,
++                        $user_id);
++                $data['GROUPS'][$i]['NUM_POSTS'] =
++                        $group_model->getGroupItemCount(
++                                $search_array, $user_id);
++                $data['GROUPS'][$i]['NUM_THREADS'] =
++                        $group_model->getGroupItemCount(
++                                $search_array,
++                                $user_id,
++                                $data['GROUPS'][$i]['GROUP_ID']
++                                );
++                $data['GROUPS'][$i]['NUM_PAGES'] =
++                        $group_model->getGroupPageCount(
++                        $data['GROUPS'][$i]['GROUP_ID']);
++                if (isset($item[0]['TITLE'])) {
++                    $data['GROUPS'][$i]["ITEM_TITLE"] = $item[0]['TITLE'];
++                    $data['GROUPS'][$i]["THREAD_ID"] = $item[0]['PARENT_ID'];
++                } else {
++                    $data['GROUPS'][$i]["ITEM_TITLE"] =
++                            tl('accountaccess_component_no_posts_yet');
++                    $data['GROUPS'][$i]["THREAD_ID"] = -1;
++                }
++            }
++            $data['NUM_SHOWN'] = $num_shown;
++            $data['LIMIT'] = $limit;
++            $data['RESULTS_PER_PAGE'] = $results_per_page;
++            $data['PAGING_QUERY'] = "./?c=$controller_name&amp;a=groupFeeds";
++            $data['OTHER_PAGING_QUERY'] =
++            "./?c=$other_controller_name&amp;a=groupFeeds";
++            return $data;
++        }
+         if(isset($_REQUEST['arg']) &&
+             in_array($_REQUEST['arg'], $possible_arguments)) {
+             switch($_REQUEST['arg'])
+@@ -1245,11 +1298,21 @@ EOD;
+         }
+         $group = $group_model->getGroupById($group_id, $user_id);
+         $data["CAN_EDIT"] = false;
+-        $data["MODE"] = "read";
++        if((isset($_REQUEST['c'])) && $_REQUEST['c'] == "api"){
++            $data['MODE'] = 'api';
++            $data['VIEW'] = 'api';
++        }else {
++            $data["MODE"] = "read";
++        }
+         if(!$group) {
++            if($data['MODE'] !== 'api'){
+             $data['SCRIPT'] .= "doMessage('<h1 class=\"red\" >".
+                 tl("group_controller_no_group_access").
+                 "</h1>');";
++            }else{
++                $data['errors'] =  array();
++                $data['errors'][] = tl("group_controller_no_group_access");
++            }
+             $group_id = PUBLIC_GROUP_ID;
+             $group = $group_model->getGroupById($group_id, $user_id);
+         } else {
+@@ -1292,7 +1355,8 @@ EOD;
+                 case "edit":
+                     if(!$data["CAN_EDIT"]) { continue; }
+                     if(isset($_REQUEST['caret']) &&
+-                       isset($_REQUEST['scroll_top'])) {
++                       isset($_REQUEST['scroll_top'])
++                            && !isset($page)) {
+                         $caret = $parent->clean($_REQUEST['caret'],
+                             'int');
+                         $scroll_top= $parent->clean($_REQUEST['scroll_top'],
+@@ -1304,7 +1368,11 @@ EOD;
+                             "} ".
+                             "wiki.scrollTop = $scroll_top;";
+                     }
+-                    $data["MODE"] = "edit";
++                    if(isset($page)){
++                        $data["MODE"] = "read";
++                    }else{
++                        $data["MODE"] = "edit";
++                    }
+                     $page_info = $group_model->getPageInfoByName($group_id,
+                         $page_name, $locale_tag, 'resources');
+                     /* if page not yet created than $page_info will be null
+@@ -1609,7 +1677,7 @@ EOD;
+             $page_name = tl('group_controller_main');
+         }
+         $data["GROUP"] = $group;
+-        if(in_array($data["MODE"], array("read", "edit", "media"))) {
++        if(in_array($data["MODE"], array("read", "edit", "media","api"))) {
+             if(!isset($data["PAGE"]) || !$data['PAGE']) {
+                 $data["PAGE_NAME"] = $page_name;
+                 if(isset($search_page_info) && $search_page_info) {
+diff --git a/controllers/controller.php b/controllers/controller.php
+index 7b8bdfd..863ddd1 100755
+--- a/controllers/controller.php
++++ b/controllers/controller.php
+@@ -254,6 +254,7 @@ abstract class Controller
+                 $data['TOTAL_ELAPSED_TIME'] += $mail_total_time;
+             }
+         }
++        $data['c'] = isset($_REQUEST['c']) ? $_REQUEST['c'] : NULL;
+         $this->view($view)->render($data);
+     }
+     /**
+diff --git a/css/search.css b/css/search.css
+index d96382f..cf0b54b 100755
+--- a/css/search.css
++++ b/css/search.css
+@@ -2199,7 +2199,7 @@ div.group-result
+     font-size: 16pt;
+     max-width: 9in;
+     min-height: 6.5in;
+-    min-width: 9in;
++    min-width: 8in;
+     padding-left: 0.1in;
+     padding-right: 0.1in;
+     padding-bottom: 0.1in;
+@@ -2763,3 +2763,85 @@ table.wikitable > caption
+     z-index: 200;
+ }
+ 
++.html-ltr #help
++{
++    border-radius: 8px;
++    float: left;
++    width: 4.0in;
++    position: absolute;
++    left: 11.5in;
++    top: 135px;
++}
++
++.html-rtl #help
++{
++    border-radius: 8px;
++    float: left;
++    width: 4.0in;
++    position: absolute;
++    right: 11.5in;
++    top: 135px;
++}
++
++.html-ltr #small-margin-help
++{
++    border-radius: 8px;
++    float: left;
++    width: 4.0in;
++    position: absolute;
++    left: 11.5in;
++    top: 135px;
++}
++
++.html-rtl #small-margin-help
++{
++    border-radius: 8px;
++    float: left;
++    width: 4.0in;
++    position: absolute;
++    right: 9.5in;
++    top: 135px;
++}
++
++.html-ltr #mobile-help
++{
++    float: left;
++    width: 3in;
++    position: absolute;
++    top: 142px;
++}
++
++.html-rtl #mobile-help
++{
++    float: left;
++    width: 3in;
++    position: absolute;
++    top: 142px;
++}
++
++.help-pane{
++    display : none;
++    width: 320px;
++    border:2px solid #0094ff;
++}
++
++.small-margin-help-pane {
++display: none;
++width: 380px;
++border: 2px solid #0094ff;
++left: -1in;
++top: 1in;
++}
++
++.help-pane h2 {
++    background:#0094ff;
++    color:white;
++    padding:10px;
++}
++.help-pane p {
++    color:#333;
++    padding:10px;
++}
++.wiki-resource-image{
++    max-width:100%;
++}
+diff --git a/index.php b/index.php
+index 6d4d781..4ea5236 100755
+--- a/index.php
++++ b/index.php
+@@ -124,8 +124,9 @@ if (function_exists('lcfirst') === false) {
+         return (string)(strtolower(substr($str, 0, 1)).substr($str, 1));
+     }
+ }
+-$available_controllers = array( "admin", "archive",  "cache", "classifier",
+-    "crawl", "fetch", "group", "machine", "resource", "search", "settings",
++$available_controllers = array( "admin", "api", "archive",  "cache", "classifier",
++    "crawl", "fetch", "group", "machine", "resource", "search",
++    "settings",
+     "statistics", "static");
+ if(!WEB_ACCESS) {
+ $available_controllers = array("admin", "archive", "cache", "crawl", "fetch",
+diff --git a/locale/ar/configure.ini b/locale/ar/configure.ini
+index 08844aa..d6bc5e2 100755
+--- a/locale/ar/configure.ini
++++ b/locale/ar/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/bn/configure.ini b/locale/bn/configure.ini
+index 0f6bb07..0e1c73f 100755
+--- a/locale/bn/configure.ini
++++ b/locale/bn/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/de/configure.ini b/locale/de/configure.ini
+index 384c3bc..9c92c70 100755
+--- a/locale/de/configure.ini
++++ b/locale/de/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/en-US/configure.ini b/locale/en-US/configure.ini
+index dc5715f..bd9552d 100755
+--- a/locale/en-US/configure.ini
++++ b/locale/en-US/configure.ini
+@@ -3233,7 +3233,7 @@ wiki_element_archive_info = "To archive a page so it won&#039;t appear in search
+ ; wiki_element.php line: 384
+ wiki_element_edit_reason = "Edit Reason:"
+ ;
+-; wiki_element.php line: 392
++; wiki_element.php line: 393
+ wiki_element_savebutton = "Save"
+ ;
+ ; wiki_element.php line: 396
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = "Media List Page"
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = "The uploaded items below will all appear when this page is read as a gallery or media list."
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = "Preview"
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = "Page Resources"
+ ;
+diff --git a/locale/es/configure.ini b/locale/es/configure.ini
+index dcd55af..ecaf8cf 100755
+--- a/locale/es/configure.ini
++++ b/locale/es/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/fa/configure.ini b/locale/fa/configure.ini
+index 4a60883..a76687a 100755
+--- a/locale/fa/configure.ini
++++ b/locale/fa/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/fr-FR/configure.ini b/locale/fr-FR/configure.ini
+index c3a16cb..98e4562 100755
+--- a/locale/fr-FR/configure.ini
++++ b/locale/fr-FR/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/he/configure.ini b/locale/he/configure.ini
+index c528da5..0564177 100755
+--- a/locale/he/configure.ini
++++ b/locale/he/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/hi/configure.ini b/locale/hi/configure.ini
+index b6f6e8f..47af7cf 100755
+--- a/locale/hi/configure.ini
++++ b/locale/hi/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/in-ID/configure.ini b/locale/in-ID/configure.ini
+index 76d2840..5282a5c 100755
+--- a/locale/in-ID/configure.ini
++++ b/locale/in-ID/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/it/configure.ini b/locale/it/configure.ini
+index 11c9844..acad5ee 100755
+--- a/locale/it/configure.ini
++++ b/locale/it/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/ja/configure.ini b/locale/ja/configure.ini
+index 06dc5e7..6dfebc3 100755
+--- a/locale/ja/configure.ini
++++ b/locale/ja/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/kn/configure.ini b/locale/kn/configure.ini
+index 74f46af..c70e3df 100755
+--- a/locale/kn/configure.ini
++++ b/locale/kn/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/ko/configure.ini b/locale/ko/configure.ini
+index 11b84f7..c42163b 100755
+--- a/locale/ko/configure.ini
++++ b/locale/ko/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/pl/configure.ini b/locale/pl/configure.ini
+index 3e8a064..c8ca748 100755
+--- a/locale/pl/configure.ini
++++ b/locale/pl/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/pt/configure.ini b/locale/pt/configure.ini
+index 4310ca6..30e71bd 100755
+--- a/locale/pt/configure.ini
++++ b/locale/pt/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/ru/configure.ini b/locale/ru/configure.ini
+index a6e4185..60f17dd 100755
+--- a/locale/ru/configure.ini
++++ b/locale/ru/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/te/configure.ini b/locale/te/configure.ini
+index 50a739c..91e47d4 100755
+--- a/locale/te/configure.ini
++++ b/locale/te/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/th/configure.ini b/locale/th/configure.ini
+index e7ed27d..0ffb090 100755
+--- a/locale/th/configure.ini
++++ b/locale/th/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/tr/configure.ini b/locale/tr/configure.ini
+index 82fe851..a459061 100755
+--- a/locale/tr/configure.ini
++++ b/locale/tr/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/vi-VN/configure.ini b/locale/vi-VN/configure.ini
+index 5c99ae9..7a761bc 100755
+--- a/locale/vi-VN/configure.ini
++++ b/locale/vi-VN/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/locale/zh-CN/configure.ini b/locale/zh-CN/configure.ini
+index 87bd5b6..7914cc0 100755
+--- a/locale/zh-CN/configure.ini
++++ b/locale/zh-CN/configure.ini
+@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
+ ; wiki_element.php line: 397
+ wiki_element_ml_description = ""
+ ;
++; wiki_element.php line: 399
++wiki_element_previewbutton = ""
++;
+ ; wiki_element.php line: 414
+ wiki_view_page_resources = ""
+ ;
+diff --git a/models/group_model.php b/models/group_model.php
+index 857a2bd..36c844a 100644
+--- a/models/group_model.php
++++ b/models/group_model.php
+@@ -969,7 +969,7 @@ class GroupModel extends Model
+     function getPageInfoByName($group_id, $name, $locale_tag, $mode)
+     {
+         $db = $this->db;
+-        if($mode == "edit") {
++        if($mode == "edit" || $mode == "api") {
+             $sql = "SELECT HP.PAGE_ID AS ID, HP.PAGE AS PAGE,
+                 GP.DISCUSS_THREAD AS DISCUSS_THREAD FROM GROUP_PAGE GP,
+                 GROUP_PAGE_HISTORY HP WHERE GP.GROUP_ID = ?
+diff --git a/scripts/basic.js b/scripts/basic.js
+index 52658e6..27e81dd 100755
+--- a/scripts/basic.js
++++ b/scripts/basic.js
+@@ -180,3 +180,303 @@ function toggleDisplay(id)
+     }
+     obj.style.display = value;
+ }
++
++current_activity_closed = true;
++current_activity_top = 0;
++/*
++ * Toggles Help element from display:none and display block.
++ * Also changes the width of the Current activity accordingly.
++ * @param {String} help element's id to toggle.
++ * @param {String} isMobile flag true/false.
++ */
++function toggleHelp(id, isMobile, target_c)
++{
++    var activity = (target_c === "admin") ? 'current-activity'
++    : 'small-margin-current-activity';
++    var images = document.querySelectorAll(".wiki-resource-image");
++    var all_help_elements =
++            document.getElementsByClassName(activity);
++    var help_node = all_help_elements[0];
++    if (current_activity_closed === true) {
++        current_activity_top = getCssProperty(help_node, 'top');
++    }
++    obj = elt(id);
++
++    if (isMobile === false) {
++        toggleDisplay(id);
++        var new_width;
++        var decrease_width_by = Math.floor(getCssProperty(obj, 'width') / 3);
++        //Calculate pixel to inch. clientWidth only returns in pixels.
++        if (obj.style.display === "none") {
++            new_width = Math.floor(getCssProperty(help_node, 'width'))
++                    + decrease_width_by;
++        } else if (obj.style.display === "block") {
++            new_width = Math.floor(getCssProperty(help_node, 'width'))
++                    - decrease_width_by;
++        }
++
++        if (new_width !== undefined) {
++            help_node.style.maxWidth = new_width + "px";
++        }
++    } else {
++        toggleDisplay(id);
++        var height_after_toggle = (obj.clientHeight);
++        //Calculate pixel to inch. clientWidth only returns in pixels.
++        if (obj.style.display === "none") {
++            //on closing, restore top
++            help_node.style.top = current_activity_top + "px";
++            current_activity_closed = true;
++        } else if (obj.style.display === "block") {
++            help_node.style.top = current_activity_top
++                    + height_after_toggle + "px";
++            /* The div.clientHeight doesnt include the height
++            of the images inside the div before the images are completely
++            loaded. So we iterate through the
++            image elements, as each image loads add the image
++            height to the top of the current_activity div dynamically. */
++            for (var i = 0; i < images.length; i++) {
++                var image = images[i];
++                image.onload = function(){
++                    help_node.style.top =  getCssProperty(help_node, 'top')
++                            + this.height + 'px';
++                };
++            }
++            current_activity_closed = false;
++        }
++    }
++}
++
++/*
++ * gets the Css property given an element and property name.
++ * @param {Element} elm to get the Css property for
++ * @param {String} Css property name.
++ */
++function getCssProperty(elm, property)
++{
++    //always returns in px
++    return parseInt(window.getComputedStyle(elm, null)
++        .getPropertyValue(property));
++}
++
++/**
++ * This is a JS function to convert yioop wiki markup to
++ * html.
++ * @param {String} wiki_text tobe parsed as HTML
++ * @returns {String} parsed html
++ */
++function parseWikiContent(wiki_text, group_id, page_id)
++{
++    var html = wiki_text;
++
++    /* note that line breaks from a text area are sent
++    as \r\n , so make sure we clean them up to replace
++    all \r\n with \n */
++    html = html.replace(/\r\n/g, "\n");
++
++    html = parseLists(html);
++
++    //Regex replace normal links
++    html = html.replace(/[^\[](http[^\[\s]*)/g, function (m, l) {
++    // normal link
++        return '<a href="' + l + '">' + l + '</a>';
++    });
++
++    //Regex replace for external links
++    html = html.replace(/[\[](http.*)[!\]]/g, function (m, l) {
++    // external link
++        var p = l.replace(/[\[\]]/g, '').split(/ /);
++        var link = p.shift();
++        return '<a href="' + link + '">'
++        + (p.length ? p.join(' ') : link) + '</a>';
++    });
++
++    //Regex replace for headings
++    html = html.replace(/(?:^|\n)([=]+)(.*)\1/g,
++            function (match, contents, t) {
++                return '<h'
++                        + contents.length + '>'
++                        + t
++                        + '</h'
++                        + contents.length
++                        + '>';
++            });
++
++    //Regex replace for Bold characters
++    html = html.replace(/'''(.*?)'''/g, function (match, contents) {
++        return '<b>' + contents + '</b>';
++    });
++
++    //Regex replace for Italic characters
++    html = html.replace(/''(.*?)''/g, function (match, contents) {
++        return '<i>' + contents + '</i>';
++    });
++
++    //Regex for resource extraction.
++    html = html.replace(/{{resource:(.+?)\|(.+?)}}/g,
++            function (match, contents, desc) {
++                return '<img src="' + "?c=resource&a=get&f=resources&g="
++                + group_id
++                + "&p=" + page_id
++                + "&n=" + contents + '" alt="' + desc
++                + '" class="wiki-resource-image"/>';
++            });
++
++    //Regex replace for HR
++    html = html.replace(/----(.*?)/g, function (match, contents) {
++        return '<hr>' + contents + '</hr>';
++    });
++
++    //replace nowiki with pre tags
++    html = html.replace(/<nowiki>(.*?)<\/nowiki>/g, function(match, contents) {
++        return '<pre>' + contents + '</pre>';
++    });
++
++    //Regex replace for blocks
++    html = html.replace(/(?:^|\n+)([^# =\*<].+)(?:\n+|$)/gm,
++            function (match, contents) {
++                if (contents.match(/^\^+$/))
++                    return contents;
++                return "\n<div>" + contents + "</div>\n";
++            });
++
++    return html;
++}
++
++/**
++ * Lists need to be recursively parsed. So the below function is used
++ * to recursively convert wiki markup to html.
++ * @param {String} str
++ * @returns {String}
++ */
++function parseLists(str)
++{
++    return str.replace(/(?:(?:(?:^|\n)[\*#].*)+)/g, function (match) {
++        var listType = match.match(/(^|\n)#/) ? 'ol' : 'ul';
++        match = match.replace(/(^|\n)[\*#][ ]{0,1}/g, "$1");
++        match = parseLists(match);
++        return '<'
++                + listType + '><li>'
++                + match.replace(/^\n/, '')
++                .split(/\n/).join('</li><li>')
++                + '</li></' + listType
++                + '>';
++    });
++}
++
++/**
++ * get does a GET HTTP call on the url passed.
++ * Also fires the callback functions passed as
++ * params appropriately.
++ *
++ * @param {String} url
++ * @param {String} response_type
++ * @param {function} success_call_back
++ * @param {function} error_handler
++ */
++var get = function (url, response_type, success_call_back, error_handler)
++{
++    var request = makeRequest();
++    request.open('GET', url, true);
++    request.responseType = response_type;
++    request.onload = function () {
++        var status = request.status;
++        if (status == 200) {
++            success_call_back && success_call_back(request.response);
++        } else {
++            error_handler && error_handler(status);
++        }
++    };
++    request.send();
++};
++
++/**
++ * takes in the help point id, uses it to fetch wiki content, then
++ * wiki content is being eval'd to be painted int he help pane.
++ * Ajax call happens only if help needs to be displayed.
++ * @param {object} help_point element
++ * @param {String} is_mobile flag to check if the client is mobile
++ * or not.
++ */
++function displayHelpForId(help_point,
++                is_mobile,target_c,csrf_token_key,csrf_token_value)
++{
++    var help_group_id = 7;
++    var c = 'api';
++    var a = "wiki";
++    var arg = "read";
++
++    if ((elt("help-frame").style.display) === "block") {
++        toggleHelp('help-frame', is_mobile,target_c);
++        return;
++    }
++    get("?c=" + c + "&group_id=" + help_group_id + "&" +
++            "arg=" + arg + "&" +
++            "a=" + a + "&" +
++            csrf_token_key +'=' + csrf_token_value + "&" +
++            "page_name=" + help_point.getAttribute("data-pagename"),
++            'json',
++            function (data) {
++                elt("help-frame-body").innerHTML = parseWikiContent(
++                        data.wiki_content,
++                        data.group_id,
++                        data.page_id
++                        );
++                elt('page_name').innerHTML = data.page_name + ' <a href="'+
++                        getEditLink(
++                        target_c,
++                        csrf_token_key,
++                        csrf_token_value,
++                        help_group_id,
++                        data.page_name) +'">'+
++                        '[Edit]</a>' ;
++
++                toggleHelp('help-frame', is_mobile,target_c);
++            },
++            function (status) {
++                toggleHelp('help-frame', is_mobile,target_c);
++            });
++    event.preventDefault();
++}
++
++/**
++ * Simple function to construct the Wiki Edit hyperlink with passed in params.
++ * @param {type} target_c
++ * @param {type} csrf_token
++ * @param {type} group_id
++ * @param {type} page_name
++ * @returns {String}
++ */
++function getEditLink(target_c,
++                csrf_token_key, csrf_token_value, group_id, page_name)
++{
++    return '?c=' + target_c +
++            '&'+ csrf_token_key +'=' + csrf_token_value +
++            '&group_id=' + group_id +
++            '&arg=edit' +
++            '&a=wiki' +
++            '&page_name=' + page_name;
++}
++
++
++/**
++ * this function grabs the contents of the wiki text area,
++ * converts them into html then populates the preview
++ * div with parsed html contents. It takes in a page id and group id that are
++ * required to render image urls, If any exist.
++ * @param {type} page_id
++ * @param {type} group_id
++ */
++function renderPreview(page_id, group_id)
++{
++    if (event.preventDefault)
++        event.preventDefault();
++    event.returnValue = false;
++    var textArea = document.getElementById('wiki-page');
++    var div = document.getElementById('wiki-preview');
++    div.innerHTML = "<hr>"
++            + "<p>"
++            + parseWikiContent(
++            textArea.value,
++            group_id,
++            page_id) + "</p> <hr>";
++}
+\ No newline at end of file
+diff --git a/views/admin_view.php b/views/admin_view.php
+index ddec49e..e3044d8 100755
+--- a/views/admin_view.php
++++ b/views/admin_view.php
+@@ -75,6 +75,7 @@ class AdminView extends View
+         if(!MOBILE) {e(' ['.$data['CURRENT_ACTIVITY'].']');}?></span></h1>
+         <?php
+         $this->element("activity")->render($data);
++        $this->element("help")->render($data);
+         if(isset($data['ELEMENT'])) {
+             $element = $data['ELEMENT'];
+             $this->element($element)->render($data);
+diff --git a/views/api_view.php b/views/api_view.php
+new file mode 100644
+index 0000000..07ebb8b
+--- /dev/null
++++ b/views/api_view.php
+@@ -0,0 +1,61 @@
++<?php
++/**
++ * SeekQuarry/Yioop --
++ * Open Source Pure PHP Search Engine, Crawler, and Indexer
++ *
++ * Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
++ *
++ * LICENSE:
++ *
++ * This program is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation, either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
++ *
++ * END LICENSE
++ *
++ * @author Eswara Rajesh Pinapala epinapala@live.com
++ * @package seek_quarry
++ * @subpackage view
++ * @license http://www.gnu.org/licenses/ GPL3
++ * @link http://www.seekquarry.com/
++ * @copyright 2009 - 2014
++ * @filesource
++ */
++if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}
++/**
++ * View used to draw and allow editing of wiki page when not in the admin view
++ * (so activities panel on side is not present.) This is also used to draw
++ * wiki pages for public groups when not logged.
++ *
++ * @author Eswara Rajesh Pinapala
++ * @package seek_quarry
++ * @subpackage view
++ */
++class ApiView extends View
++{
++    /** This view is drawn on a web layout
++     * @var string
++     */
++    var $layout = "api";
++
++    /**
++     * Draws a minimal container with a WikiElement in it on which a group
++     * wiki page can be drawn
++     *
++     * @param array $data with fields used for drawing the container and page
++     */
++    function renderView($data)
++    {
++        $this->element("api")->render($data);
++    }
++}
++?>
+diff --git a/views/elements/api_element.php b/views/elements/api_element.php
+new file mode 100644
+index 0000000..59e9920
+--- /dev/null
++++ b/views/elements/api_element.php
+@@ -0,0 +1,108 @@
++<?php
++
++/**
++ * SeekQuarry/Yioop --
++ * Open Source Pure PHP Search Engine, Crawler, and Indexer
++ *
++ * Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
++ *
++ * LICENSE:
++ *
++ * This program is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation, either version 3 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
++ *
++ * END LICENSE
++ *
++ * @author Eswara Rajesh Pinapala epinapala@live.com
++ * @package seek_quarry
++ * @subpackage view
++ * @license http://www.gnu.org/licenses/ GPL3
++ * @link http://www.seekquarry.com/
++ * @copyright 2009 - 2014
++ * @filesource
++ */
++if (!defined('BASE_DIR')) {
++    echo "BAD REQUEST";
++    exit();
++}
++/** Loads common constants for web crawling */
++require_once BASE_DIR . "/lib/crawl_constants.php";
++
++/**
++ * Element responsible for drawing wiki pages in either admin or wiki view
++ * It is also responsible for rendering wiki history pages, and listings of
++ * wiki pages available for a group
++ *
++ * @author Eswara Rajesh Pinapala
++ * @package seek_quarry
++ * @subpackage element
++ */
++class ApiElement extends Element implements CrawlConstants {
++
++    /**
++     * Draw a wiki page for group, or, depending on $data['MODE'] a listing
++     * of all pages for a group, or the history of revisions of a given page
++     * or the edit page form
++     *
++     * @param array $data fields contain data about the page being
++     * displayeed or edited, or the list of pages being displayed.
++     */
++    function render($data) {
++        $logged_in = isset($data["ADMIN"]) && $data["ADMIN"];
++        $can_edit = $logged_in && isset($data["CAN_EDIT"]) && $data["CAN_EDIT"];
++        $this->renderJsonDocument($data, $can_edit, $logged_in);
++    }
++
++    /**
++     * Used to send a Wiki content response for reading. If the page does
++     * not exist various create/login-to-create etc messages are displayed
++     * depending of it the user is logged in. and has write permissions
++     * on the group.
++     * @param array $data fields PAGE used for page contents
++     * @param bool $can_edit whether the current user has permissions to
++     *     edit or create this page
++     * @param bool $logged_in whethe current user is logged in or not
++     */
++    function renderJsonDocument($data, $can_edit, $logged_in) {
++        $out_array = array();
++        if ($data["PAGE"]) {
++            $out_array["wiki_content"] = html_entity_decode($data['PAGE'],
++                    ENT_QUOTES);
++            $out_array['group_id'] = $data['GROUP']['GROUP_ID'];
++            $out_array['group_name'] = $data['GROUP']['GROUP_NAME'];
++            $out_array['page_id'] = $data['PAGE_ID'];
++            $out_array['page_name'] = $data['PAGE_NAME'];
++            $http_code = 200;
++        } else if (!$logged_in) {
++            $out_array["logged_in"] = false;
++            $http_code = 401;
++        }
++        if ($can_edit) {
++            $out_array["can_edit"] = true;
++        }
++
++        if (isset($data['errors']) && count($data['errors']) > 0) {
++            $out_array['errors'] = json_encode(
++                    array_map(
++                            function($string) {
++                        return html_entity_decode($string, ENT_QUOTES);
++                    }, $data['errors']));
++        }
++
++        header("Content-Type: application/json");
++        http_response_code($http_code);
++        e(json_encode($out_array));
++        exit();
++    }
++
++}
+diff --git a/views/elements/element.php b/views/elements/element.php
+index 046ed54..3910c02 100755
+--- a/views/elements/element.php
++++ b/views/elements/element.php
+@@ -67,5 +67,27 @@ abstract class Element
+      * that should be used in drawing the view
+      */
+     public abstract function render($data);
++
++    /**
++     * This method is used to render the help button,
++     * given a help point  csrf token and target controller name.
++     *
++     * @param  $help_point_id - used to set as help button id
++     * @param  $csrf_token_value - csrf token to make api call/open edit link
++     * @param  $target_c - target controller to remember the view.
++     * @return String button html.
++     */
++    public function renderHelpButton($help_point_id,
++            $csrf_token_value, $target_c) {
++        $is_mobile = MOBILE ? "true" : "false";
++        return '<button type="button"
++                    href=""
++                    onclick="javascript:displayHelpForId(this,'
++                . $is_mobile . ',\'' . $target_c . '\',\''. CSRF_TOKEN .'\',\''
++                . $csrf_token_value . '\')" '
++                . 'data-pagename="' . $help_point_id . '">?</button>';
++    }
++
+ }
++
+ ?>
+diff --git a/views/elements/groupfeed_element.php b/views/elements/groupfeed_element.php
+index b910273..d66c792 100644
+--- a/views/elements/groupfeed_element.php
++++ b/views/elements/groupfeed_element.php
+@@ -77,7 +77,11 @@ class GroupfeedElement extends Element implements CrawlConstants
+         if(!$is_status) { 
+             if($is_admin || $logged_in) { ?>
+                 <div class="float-same admin-collapse">[<a
+-                href="<?php e($other_paging_query) ?>" ><?php
++                href="<?php e($other_paging_query);
++                if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
++                    e("&amp;v=grouped");
++                }
++                ?>" ><?php
+                 e($arrows); ?></a>]<?php
+                 if(isset($data['SUBSCRIBE_LINK'])) {
+                     if($data['SUBSCRIBE_LINK'] == PUBLIC_JOIN) {
+@@ -101,7 +105,7 @@ class GroupfeedElement extends Element implements CrawlConstants
+                 }?> >
+         <?php
+         }
+-        if($data['SUBTITLE'] != "" && $logged_in) { ?>
++        if(isset($data['SUBTITLE']) && $data['SUBTITLE'] != "" && $logged_in) { ?>
+             <div class="float-opposite">
+             <?php
+             if(isset($data["WIKI_PAGE_NAME"])) { ?>
+@@ -115,11 +119,16 @@ class GroupfeedElement extends Element implements CrawlConstants
+             <?php } ?>
+             </div>
+         <?php
++        }else if(isset($data['MODE']) && $data['MODE'] == 'grouped'
++                && isset ($data['JUST_GROUP_ID'])){
++            ?><div class="float-opposite"><a href="<?php
++                        e($base_query . "&amp;v=grouped")  ?>"><?php
++                        e(tl('groupfeed_element_back'))?></a></div><?php
+         }
+         if($is_admin) {
+             ?>
+             <h2><?php
+-            if($data['SUBTITLE'] == "") {
++            if(!isset($data['SUBTITLE']) || $data['SUBTITLE'] == "") {
+                 e(tl('groupfeed_element_recent_activity'));
+             } else {
+                 if(isset($data['JUST_THREAD'])) {
+@@ -152,18 +161,81 @@ class GroupfeedElement extends Element implements CrawlConstants
+                     e(tl('groupfeed_element_user',
+                         $data['PAGES'][0]["USER_NAME"]));
+                 } else {
+-                    e("[{$data['SUBTITLE']}]");
++                    if(isset($data['SUBTITLE'])) e("[{$data['SUBTITLE']}]");
+                 }
+             }
+             ?>
+-            </h2>
+             <?php
+         }
+-        ?>
++        if(!isset($data['JUST_THREAD']) && !isset($data['JUST_GROUP_ID'])){
++            e("<a href=\"" . $paging_query . "\">"
++                    . "<img src=\"resources/list.png\" /></a>" . "  " );
++            e("<a href=\"" . $paging_query . "&amp;v=grouped\">"
++                    . "<img src=\"resources/grouped.png\" /></a>". " " );
++            }
++        ?></h2>
+         <div>
+         &nbsp;
+         </div>
+         <?php
++      if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
++        //Grouped View
++        //var_dump($data['GROUPS']);
++        if (isset($data['JUST_GROUP_ID'])) {
++                foreach ($data['GROUPS'] as $group) {
++                    if($group['GROUP_ID'] == $data['JUST_GROUP_ID']){
++                    e("<div class=\"access-result\">" .
++                            "<div><b>" .
++                            "<a href=\"$paging_query&amp;just_group_id=" .
++                            $group['GROUP_ID'] . "&amp;v=grouped" . "\" " .
++                            "rel=\"nofollow\">" .
++                            $group['GROUP_NAME'] . "</a> " .
++                            "[<a href=\"$paging_query&amp;group_id=" .
++                            $group['GROUP_ID'] . "&amp;a=wiki\">" .
++                            tl('manageaccount_element_group_wiki') . "</a>] " .
++                            "(" . tl('manageaccount_element_group_stats',
++                                    $group['NUM_POSTS'],
++                                    $group['NUM_THREADS']) . ")</b>" .
++                            "</div>" .
++                            "<div class=\"slight-pad\">" .
++                            "<b>" . tl('manageaccount_element_last_post')
++                            . "</b> " .
++                            "<a href=\"$paging_query&amp;just_thread=" .
++                            $group['THREAD_ID'] . "\">" .
++                            $group['ITEM_TITLE'] . "</a>" .
++                            "</div>" .
++                            "</div>");
++                    $data['TOTAL_ROWS'] = 1;
++                    }
++                }
++            } else {
++                foreach ($data['GROUPS'] as $group) {
++                    e("<div class=\"access-result\">" .
++                            "<div><b>" .
++                            "<a href=\"$paging_query&amp;just_group_id=" .
++                            $group['GROUP_ID'] . "&amp;v=grouped" . "\" " .
++                            "rel=\"nofollow\">" .
++                            $group['GROUP_NAME'] . "</a> " .
++                            "[<a href=\"$paging_query&amp;group_id=" .
++                            $group['GROUP_ID'] . "&amp;a=wiki\">" .
++                            tl('manageaccount_element_group_wiki') . "</a>] " .
++                            "(" . tl('manageaccount_element_group_stats',
++                                    $group['NUM_POSTS'],
++                                    $group['NUM_THREADS']) . ")</b>" .
++                            "</div>" .
++                            "<div class=\"slight-pad\">" .
++                            "<b>" . tl('manageaccount_element_last_post')
++                            . "</b> " .
++                            "<a href=\"$paging_query&amp;just_thread=" .
++                            $group['THREAD_ID'] . "\">" .
++                            $group['ITEM_TITLE'] . "</a>" .
++                            "</div>" .
++                            "</div>");
++                    $data['TOTAL_ROWS'] = $data['NUM_GROUPS'];
++                }
++            }
++        $paging_query .= "&amp;v=grouped";
++       }else{
+         $open_in_tabs = $data['OPEN_IN_TABS'];
+         $time = time();
+         $can_comment = array(GROUP_READ_COMMENT, GROUP_READ_WRITE,
+@@ -375,6 +447,7 @@ class GroupfeedElement extends Element implements CrawlConstants
+             </div>
+             <?php
+             } //end foreach
++       }//No grouped View
+             $data['FRAGMENT'] = "";
+             if(isset($data['JUST_THREAD']) && $logged_in) {
+                 $data['FRAGMENT'] = '#result-'.$page['ID'];
+@@ -397,6 +470,7 @@ class GroupfeedElement extends Element implements CrawlConstants
+         if(!$is_status) {
+             $this->renderScripts($data);
+         }
++
+     }
+     /**
+      * Used to render the Javascript that appears at the non-status updating
+@@ -462,7 +536,8 @@ class GroupfeedElement extends Element implements CrawlConstants
+                     ?></label></b></h2>'+
+                     '<textarea class="short-text-area" '+
+                     'id="comment-'+ id +'" name="description" '+
+-                    'data-buttons="all,!wikibtn-search,!wikibtn-heading,!wikibtn-slide" '+
++                    'data-buttons="all,!wikibtn-search,!wikibtn-heading,'+
++                    '!wikibtn-slide" '+
+                     '></textarea>' +
+                     '<button class="button-box float-opposite" ' +
+                     'type="submit"><?php e(tl("groupfeed_element_save"));
+@@ -603,4 +678,4 @@ class GroupfeedElement extends Element implements CrawlConstants
+         <?php
+     }
+ }
+- ?>
++?>
+\ No newline at end of file
+diff --git a/views/elements/help_element.php b/views/elements/help_element.php
+new file mode 100644
+index 0000000..8a54055
+--- /dev/null
++++ b/views/elements/help_element.php
+@@ -0,0 +1,100 @@
++<?php
++/*
++ *  SeekQuarry/Yioop --
++ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
++ *
++ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
++ *
++ *  LICENSE:
++ *
++ *  This program is free software: you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation, either version 3 of the License, or
++ *  (at your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
++ *
++ *  END LICENSE
++ *
++ *  @author Eswara Rajesh Pinapala epinapala@live.com
++ *  @package seek_quarry
++ *  @subpackage element
++ *  @license http://www.gnu.org/licenses/ GPL3
++ *  @link http://www.seekquarry.com/
++ *  @copyright 2009 - 2014
++ *  @filesource
++ */
++if (!defined('BASE_DIR')) {
++    echo "BAD REQUEST";
++    exit();
++}
++
++/**
++ * This element is used to display the list of available activities
++ * in the AdminView
++ *
++ * @author Eswara Rajesh Pinapala
++ *
++ * @package seek_quarry
++ * @subpackage element
++ */
++class HelpElement extends Element {
++
++    /**
++     * Displays a list of admin activities
++     *
++     * @param array $data  available activities and CSRF token
++     */
++    function render($data) {
++        ?>
++        <?php
++            if (MOBILE) { ?>
++                <div id="mobile-help">
++                    <div id="help-frame" class="frame help-pane">
++                        <div id="help-frame-head">
++                            <h2 id="page_name"></h2>
++                        </div>
++
++                        <div id="help-frame-body" class="wordwrap">
++
++                        </div>
++                        <div id="help-frame-editor" class="wordwrap">
++
++                        </div>
++                    </div>
++                </div>
++            <?php } else {
++                if($data['c'] != 'admin'){
++                    $help_class_add = "small-margin-help-pane";
++                    $help_id ="small-margin-help";
++                }else{
++                    $help_id = "help";
++                }
++                ?>
++                <div id="<?php e($help_id); ?>">
++                  <div id="help-frame" class="frame help-pane <?php
++                  e($help_class_add); ?>">
++                      <div id="help-frame-head">
++                          <h2 id="page_name"></h2>
++                      </div>
++
++                    <div id="help-frame-body" class="wordwrap">
++
++                    </div>
++                    <div id="help-frame-editor" class="wordwrap">
++
++                    </div>
++                  </div>
++                </div>
++                <?php
++            }
++    }
++
++}
++?>
+\ No newline at end of file
+diff --git a/views/elements/managegroups_element.php b/views/elements/managegroups_element.php
+index fa06f58..b1e1df8 100755
+--- a/views/elements/managegroups_element.php
++++ b/views/elements/managegroups_element.php
+@@ -93,6 +93,7 @@ class ManagegroupsElement extends Element
+         <?php
+             $group_url = "?c=admin&amp;".CSRF_TOKEN."=".$data[CSRF_TOKEN];
+             $base_url = $group_url . "&amp;a=manageGroups";
++            $wiki_url = $group_url . "&amp;a=wiki&amp;group_id=";
+             $group_url .= "&amp;a=groupFeeds&amp;just_group_id=";
+             if(isset($data['browse'])) {
+                 $base_url .= "&amp;browse=".$data['browse'];
+@@ -199,7 +200,15 @@ class ManagegroupsElement extends Element
+                         ($group['MEMBER_ACCESS'] != GROUP_PRIVATE ||
+                         $group["OWNER_ID"] == $_SESSION['USER_ID'])) {
+                         e("<td><a href='".$group_url.$group['GROUP_ID']."' >".
+-                            $group_column."</a></td>");
++                            $group_column."</a>".
++                                " <a href=\""
++                                . $wiki_url. $group['GROUP_ID']
++                                ."\">"
++                                ."["
++                                . (tl('manageaccount_element_group_wiki'))
++                                ."]"
++                                . "</a>"
++                                ."</td>");
+                     } else {
+                         e("<td>$group_column</td>");
+                     }
+@@ -317,7 +326,11 @@ class ManagegroupsElement extends Element
+                 ?> /></td><?php
+                 if($addgroup) { ?>
+                     <td>[<a href="<?php e($browse_url); ?>"><?php 
+-                        e(tl('managegroups_element_browse')); ?></a>]</td>
++                        e(tl('managegroups_element_browse')); ?></a>]
++                    <?php
++                    e($this->renderHelpButton("browse_url", $data[CSRF_TOKEN],
++                            $_REQUEST['c']));
++                    ?></td>
+                 <?php
+                 }
+         ?></tr>
+@@ -385,11 +398,11 @@ class ManagegroupsElement extends Element
+                         if($data['CURRENT_GROUP']['owner'] ==
+                             $user_array['USER_NAME']) {
+                             e("<td>".
+-                                $data['MEMBERSHIP_CODES'][$user_array['STATUS']] .
++                            $data['MEMBERSHIP_CODES'][$user_array['STATUS']] .
+                                 "</td>");
+                             e("<td>" . tl('managegroups_element_groupowner') .
+                                 "</td><td><span class='gray'>".
+-                                tl('managegroups_element_delete')."</span></td>");
++                            tl('managegroups_element_delete')."</span></td>");
+                         } else {
+                             e("<td>".$data['MEMBERSHIP_CODES'][
+                                 $user_array['STATUS']]);
+diff --git a/views/elements/wiki_element.php b/views/elements/wiki_element.php
+index d157de9..15e5e53 100644
+--- a/views/elements/wiki_element.php
++++ b/views/elements/wiki_element.php
+@@ -391,8 +391,17 @@ class WikiElement extends Element implements CrawlConstants
+             <div id="save-container" class="top-margin center">
+             <button class="button-box" type="submit"><?php
+                 e(tl('wiki_element_savebutton')); ?></button>
++            <button id="wiki-preview-btn"
++                    onclick="javascript:renderPreview('<?php
++                        e($data["PAGE_ID"] . "','"
++                      . $data['GROUP']['GROUP_ID']);
++            ?>')" class="button-box"><?php
++                e(tl('wiki_element_previewbutton')); ?></button>
+             </div>
+         </form>
++        <div id="wiki-preview">
++
++        </div>
+         <div class="top-margin" id="media-list-page">
+         <h2><?php e(tl('wiki_element_media_list'))?></h2>
+         <p><?php e(tl('wiki_element_ml_description'))?></p>
+diff --git a/views/group_view.php b/views/group_view.php
+index a5404ae..cf99488 100644
+--- a/views/group_view.php
++++ b/views/group_view.php
+@@ -114,6 +114,7 @@ class GroupView extends View implements CrawlConstants
+             $element = $data['ELEMENT'];
+             $this->element($element)->render($data);
+         }
++        $this->element("help")->render($data);
+         if(PROFILE) {
+         ?>
+         <script type="text/javascript">
+diff --git a/views/layouts/api_layout.php b/views/layouts/api_layout.php
+new file mode 100644
+index 0000000..557bb37
+--- /dev/null
++++ b/views/layouts/api_layout.php
+@@ -0,0 +1,63 @@
++<?php
++
++/*
++ *  SeekQuarry/Yioop --
++ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
++ *
++ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
++ *
++ *  LICENSE:
++ *
++ *  This program is free software: you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation, either version 3 of the License, or
++ *  (at your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
++ *
++ *  END LICENSE
++ *
++ *  @author Eswara Rajesh Pinapala epinapala@live.com
++ *  @package seek_quarry
++ *  @subpackage element
++ *  @license http://www.gnu.org/licenses/ GPL3
++ *  @link http://www.seekquarry.com/
++ *  @copyright 2009 - 2014
++ *  @filesource
++ */
++
++if (!defined('BASE_DIR')) {
++    echo "BAD REQUEST";
++    exit();
++}
++
++/**
++ * Layout used for the seek_quarry Website
++ * including pages such as search landing page
++ * and settings page
++ *
++ * @author Eswara Rajesh Pinapala
++ * @package seek_quarry
++ * @subpackage layout
++ */
++class ApiLayout extends Layout {
++
++    /**
++     * Responsible for drawing the prefix/suffix (if any for the API response)
++     *
++     * @param array $data  an array of data set up by the controller to be
++     * be used in drawing the WebLayout and its View.
++     */
++    function render($data) {
++        $this->view->renderView($data);
++    }
++
++}
++
++?>
+-- 
+1.9.3 (Apple Git-50)
+
+
+From d0a5d786c8bce14fa61e926614ae74606d8c4f6c Mon Sep 17 00:00:00 2001
+From: epinapala <epinapala@ebay.com>
+Date: Fri, 17 Oct 2014 00:09:52 -0700
+Subject: [PATCH 2/4]  Adding binary files(icons)
+
+---
+ resources/grouped.png | Bin 0 -> 3358 bytes
+ resources/list.png    | Bin 0 -> 3453 bytes
+ 2 files changed, 0 insertions(+), 0 deletions(-)
+ create mode 100644 resources/grouped.png
+ create mode 100644 resources/list.png
+
+diff --git a/resources/grouped.png b/resources/grouped.png
+new file mode 100644
+index 0000000000000000000000000000000000000000..ba7ceed2b8d88732bcc90fe783b44eb63bf1faac
+GIT binary patch
+literal 3358
+zcmZ`+2{@Ep|9(vNon%W)Q$&`*SSM7*GBWlpOIgRxXv}0ATSQs2G}eqnBD|518nTXL
+z&uhz`EkYq#!hiI>-}`<4@4CKoUFSUKxzByyzw`T@>pIu-+&4DVWn&g(1^|Ff52<BJ
+zeS(iWBRzHW4-Vb}0A?)@1j1MkfdCt0F|HooXaGR6Jt78}^9=J*rn<bL)i;O`^cQk1
+zU7-va`B04c!x~86dI-(;LRpIr5_gZ$^1QgyJ9lwz$%5;QjJ#iIm>}0!b+}GF>}nVK
+z@$=G!-2=l(kpPX&(4Tn$i<A330)RNpS&$=p8E~b>7?QO0)3v?rg6wxPK(7^XLJ9Dz
+zdtJ~c-sm1tam8K<#)nV+ZqEXm{vjP<160`3M#HkgzZ|V2QY5+cfr#dQ;F9p=jCkzX
+zPU~In6ckA-D=$^Tng5)#TsF9~RNipEbs>C@;AAAQS#?)!P?z}fUPgD?Exyjvn}vk*
+z6wdVc4ccFXbWDC3Nwk|c{}(+vSc#Oz0>nT*iV}R`okQYgt^Fz9>5HH%`Guiv684qR
+z_7MwAz$M*kEh(gahHT<%G1O@{H(po-iPV;XlxkKTM<r!aTozs8RhmTs!k()&k8$ds
+z#QVIX{q3Xu{mnz%(npIwl5<GpLjf1^!Q6NG+1|XX33<@5j1j1fp)^n?QLSX#;4X2A
+z#@&`9VtE3ZeW(G<vCz1$?k|V%R|V;1Ahl#HEq8Z!i6D((Q_H^Im2fy=`&Y=$vYP&A
+z5Xp<OHB*c&wB~+V_G~=2OsFI?OLEq47ZrabJR5#y$HK;b-ck6y(R}=_=GHTQTqkX_
+zLiL1Z-W5m(mpol_<I1;2*8PhN0%6%+JnncA8uj<w;#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i_J3l3^VOioiT_6-{;KkClv-vDW;N(PN2bB7imUOYo+3$4>#F&6
+zrd7)(t_U#e$zFrOME*2`L8d|L!NZ6rMV(JHnsrO03-zXP6R;XIdC5aAcYa~e57Uo-
+zTdW#!Rwu17c{4p$qqp}!d?*fh)*NClHAs(ObXsl{1uwl~Z{6k*(PmPa;8`g((*k54
+zXH#OdOh7h#V%`qQ67z=U7NGHHS;yJJ7$#Ilij{hd>{;E3Pb#PmIr@{?N5m8F*rHt2
+WL>blJQ~z!NKu_CHt3uP^&i?@gVG<(%
+
+literal 0
+HcmV?d00001
+
+diff --git a/resources/list.png b/resources/list.png
+new file mode 100644
+index 0000000000000000000000000000000000000000..fc873811b5a1e40f26623409435585a95125c5ea
+GIT binary patch
+literal 3453
+zcmZ`*2Q-^s9}cxQRjWoCrL>LMBSH})h`nmmj!lTD6{}Wj)~H=krNjEyC^}+CR8dr|
+z+O=x7s2asb|Kl6yeD|Dt-}^rId7j_>{q8;QdG8tOYcbOC&;bAdMs0+;@#zzI)@i6t
+zNB@wJ9RPq%-5m}$)P}=>h8VPqyB7)oKrlYc3N&RO;UrD>ctPrJWr0v%2@RAbVg$qk
+zVY>Gl<hqu_D9#sh>Xe{_yENvPMI2k)MA)ts-=v}8SR<na=`d)rUU<;c$@}A{;+6d)
+z{V9P!<?XPag@H>`hke`t5wc6<4onpQm3l)^%Fa)hPU02u?*ssqdgM7-fN$fg;(n24
+zx5z3LJ6S2tfb{Qn^yD)?z>!vfDr<@usoaRKC!6rJYizoJ$hHB1BL9u-M9igb%YC*q
+zBwjtYFkRG%OVCLo57=EMsejn97;%7eG~nK@iG>YmW!2uz?#=My?7p~Ng3C-}$xPg$
+z_=U?v7ggYedO3=IQK3R)@fq}hIM7ESoDZ~nSj41bAk8atiCm?qB#bC(R~=&)xkw98
+z)T&dzj?m2(Pktqgyy)u6Ar*<o6SEQ5+Y}~{DLEwPCFex>HX#7+z{Qf?F#S{3J&v(~
+z&ar`kwqZ8#$<mM1d_3W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$~_u7pSqi=3nyD
+zHzkl87V8UzKmr2;#R8?o&=^;Ugo1(sL|hUgDG5Ghfc=Aguns|BAAi9=P5$;#NBKKp
+z+<md`XdmF2uY)5x0ILK7odx=*{kc!9yUV{L`S|~p)@g!}vlWPhm^kDg?^7x4428nc
+z-o6-=zyGPfvIOim^S`iv$N7_Q=!V9kPpg1&chdI3qA;goti##vlqLUC|9{5+dKqBc
+zQKwn|R{tIQKe4~~FvwZr|51oPtNa^1EweHm4D!#BDbp!n>pf0S@mO13)$}Iqx`j7W
+z8<2s|Ma~G_A@S<n9PLmo(lVH=jFN31!Eo5lWBc{-+blis=2E@)8$K;q!ku!a>T0bH
+zQ0O|#Sggv7e6b))t)d-7VugA&IN~ya$lz9)k@8C03CV=%!6z6ps<zWMUTxvf7Lk#O
+zd>|2`ce$)3x~rGXqx9aa7SNo`IIi0CQ_FinokA83ioLY1#O$7;OG46yCNT<Is#GmW
+zw+D2vFs*hC`2v;xyT4e6h5!byM%2|}_|-RRS;t^KnjJ(_4}T@U<|0<2Ni8dJ-_14b
+z2$GZh>{i<i3y$(g_{j^_G4O^iX?1ieeD)`h5O}$T`N0~eRf9EMxKXCu*@f2D&{wZg
+Hv%m8%?s7l|
+
+literal 0
+HcmV?d00001
+
+-- 
+1.9.3 (Apple Git-50)
+
+
+From e434d115601ae930168571c50514936872b89fa0 Mon Sep 17 00:00:00 2001
+From: epinapala <epinapala@ebay.com>
+Date: Fri, 17 Oct 2014 00:16:08 -0700
+Subject: [PATCH 3/4] Make Collapse/expand views for just_group_id more
+ seamless
+
+---
+ views/elements/groupfeed_element.php | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/views/elements/groupfeed_element.php b/views/elements/groupfeed_element.php
+index d66c792..746d357 100644
+--- a/views/elements/groupfeed_element.php
++++ b/views/elements/groupfeed_element.php
+@@ -75,7 +75,12 @@ class GroupfeedElement extends Element implements CrawlConstants
+             $other_paging_query .= "&num=".$data['RESULTS_PER_PAGE'];
+         }
+         if(!$is_status) { 
+-            if($is_admin || $logged_in) { ?>
++            if($is_admin || $logged_in) { 
++                if(isset($data['JUST_GROUP_ID'])){
++                    $other_paging_query .= "&amp;just_group_id=" 
++                            . $data['JUST_GROUP_ID'];
++                }
++                ?>
+                 <div class="float-same admin-collapse">[<a
+                 href="<?php e($other_paging_query);
+                 if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
+-- 
+1.9.3 (Apple Git-50)
+
+
+From ef03ce3a0aaf68fe3d1fd255c3d5814ea034b982 Mon Sep 17 00:00:00 2001
+From: epinapala <epinapala@ebay.com>
+Date: Fri, 17 Oct 2014 00:19:29 -0700
+Subject: [PATCH 4/4] Restoring .gitignore
+
+---
+ .gitignore | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/.gitignore b/.gitignore
+index f946ad8..3986446 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -1,4 +1,2 @@
+ local_config.php
+ .DS_Store
+-nbproject/
+-/.idea/
+-- 
+1.9.3 (Apple Git-50)
+
diff --git a/index.php b/index.php
index 6d4d781..4ea5236 100755
--- a/index.php
+++ b/index.php
@@ -124,8 +124,9 @@ if (function_exists('lcfirst') === false) {
         return (string)(strtolower(substr($str, 0, 1)).substr($str, 1));
     }
 }
-$available_controllers = array( "admin", "archive",  "cache", "classifier",
-    "crawl", "fetch", "group", "machine", "resource", "search", "settings",
+$available_controllers = array( "admin", "api", "archive",  "cache", "classifier",
+    "crawl", "fetch", "group", "machine", "resource", "search",
+    "settings",
     "statistics", "static");
 if(!WEB_ACCESS) {
 $available_controllers = array("admin", "archive", "cache", "crawl", "fetch",
diff --git a/locale/ar/configure.ini b/locale/ar/configure.ini
index 08844aa..d6bc5e2 100755
--- a/locale/ar/configure.ini
+++ b/locale/ar/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/bn/configure.ini b/locale/bn/configure.ini
index 0f6bb07..0e1c73f 100755
--- a/locale/bn/configure.ini
+++ b/locale/bn/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/de/configure.ini b/locale/de/configure.ini
index 384c3bc..9c92c70 100755
--- a/locale/de/configure.ini
+++ b/locale/de/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/en-US/configure.ini b/locale/en-US/configure.ini
index dc5715f..bd9552d 100755
--- a/locale/en-US/configure.ini
+++ b/locale/en-US/configure.ini
@@ -3233,7 +3233,7 @@ wiki_element_archive_info = "To archive a page so it won&#039;t appear in search
 ; wiki_element.php line: 384
 wiki_element_edit_reason = "Edit Reason:"
 ;
-; wiki_element.php line: 392
+; wiki_element.php line: 393
 wiki_element_savebutton = "Save"
 ;
 ; wiki_element.php line: 396
@@ -3242,6 +3242,9 @@ wiki_element_media_list = "Media List Page"
 ; wiki_element.php line: 397
 wiki_element_ml_description = "The uploaded items below will all appear when this page is read as a gallery or media list."
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = "Preview"
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = "Page Resources"
 ;
diff --git a/locale/es/configure.ini b/locale/es/configure.ini
index dcd55af..ecaf8cf 100755
--- a/locale/es/configure.ini
+++ b/locale/es/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/fa/configure.ini b/locale/fa/configure.ini
index 4a60883..a76687a 100755
--- a/locale/fa/configure.ini
+++ b/locale/fa/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/fr-FR/configure.ini b/locale/fr-FR/configure.ini
index c3a16cb..98e4562 100755
--- a/locale/fr-FR/configure.ini
+++ b/locale/fr-FR/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/he/configure.ini b/locale/he/configure.ini
index c528da5..0564177 100755
--- a/locale/he/configure.ini
+++ b/locale/he/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/hi/configure.ini b/locale/hi/configure.ini
index b6f6e8f..47af7cf 100755
--- a/locale/hi/configure.ini
+++ b/locale/hi/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/in-ID/configure.ini b/locale/in-ID/configure.ini
index 76d2840..5282a5c 100755
--- a/locale/in-ID/configure.ini
+++ b/locale/in-ID/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/it/configure.ini b/locale/it/configure.ini
index 11c9844..acad5ee 100755
--- a/locale/it/configure.ini
+++ b/locale/it/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/ja/configure.ini b/locale/ja/configure.ini
index 06dc5e7..6dfebc3 100755
--- a/locale/ja/configure.ini
+++ b/locale/ja/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/kn/configure.ini b/locale/kn/configure.ini
index 74f46af..c70e3df 100755
--- a/locale/kn/configure.ini
+++ b/locale/kn/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/ko/configure.ini b/locale/ko/configure.ini
index 11b84f7..c42163b 100755
--- a/locale/ko/configure.ini
+++ b/locale/ko/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/pl/configure.ini b/locale/pl/configure.ini
index 3e8a064..c8ca748 100755
--- a/locale/pl/configure.ini
+++ b/locale/pl/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/pt/configure.ini b/locale/pt/configure.ini
index 4310ca6..30e71bd 100755
--- a/locale/pt/configure.ini
+++ b/locale/pt/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/ru/configure.ini b/locale/ru/configure.ini
index a6e4185..60f17dd 100755
--- a/locale/ru/configure.ini
+++ b/locale/ru/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/te/configure.ini b/locale/te/configure.ini
index 50a739c..91e47d4 100755
--- a/locale/te/configure.ini
+++ b/locale/te/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/th/configure.ini b/locale/th/configure.ini
index e7ed27d..0ffb090 100755
--- a/locale/th/configure.ini
+++ b/locale/th/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/tr/configure.ini b/locale/tr/configure.ini
index 82fe851..a459061 100755
--- a/locale/tr/configure.ini
+++ b/locale/tr/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/vi-VN/configure.ini b/locale/vi-VN/configure.ini
index 5c99ae9..7a761bc 100755
--- a/locale/vi-VN/configure.ini
+++ b/locale/vi-VN/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/locale/zh-CN/configure.ini b/locale/zh-CN/configure.ini
index 87bd5b6..7914cc0 100755
--- a/locale/zh-CN/configure.ini
+++ b/locale/zh-CN/configure.ini
@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
 ; wiki_element.php line: 397
 wiki_element_ml_description = ""
 ;
+; wiki_element.php line: 399
+wiki_element_previewbutton = ""
+;
 ; wiki_element.php line: 414
 wiki_view_page_resources = ""
 ;
diff --git a/models/group_model.php b/models/group_model.php
index 857a2bd..36c844a 100644
--- a/models/group_model.php
+++ b/models/group_model.php
@@ -969,7 +969,7 @@ class GroupModel extends Model
     function getPageInfoByName($group_id, $name, $locale_tag, $mode)
     {
         $db = $this->db;
-        if($mode == "edit") {
+        if($mode == "edit" || $mode == "api") {
             $sql = "SELECT HP.PAGE_ID AS ID, HP.PAGE AS PAGE,
                 GP.DISCUSS_THREAD AS DISCUSS_THREAD FROM GROUP_PAGE GP,
                 GROUP_PAGE_HISTORY HP WHERE GP.GROUP_ID = ?
diff --git a/scripts/basic.js b/scripts/basic.js
index 52658e6..27e81dd 100755
--- a/scripts/basic.js
+++ b/scripts/basic.js
@@ -180,3 +180,303 @@ function toggleDisplay(id)
     }
     obj.style.display = value;
 }
+
+current_activity_closed = true;
+current_activity_top = 0;
+/*
+ * Toggles Help element from display:none and display block.
+ * Also changes the width of the Current activity accordingly.
+ * @param {String} help element's id to toggle.
+ * @param {String} isMobile flag true/false.
+ */
+function toggleHelp(id, isMobile, target_c)
+{
+    var activity = (target_c === "admin") ? 'current-activity'
+    : 'small-margin-current-activity';
+    var images = document.querySelectorAll(".wiki-resource-image");
+    var all_help_elements =
+            document.getElementsByClassName(activity);
+    var help_node = all_help_elements[0];
+    if (current_activity_closed === true) {
+        current_activity_top = getCssProperty(help_node, 'top');
+    }
+    obj = elt(id);
+
+    if (isMobile === false) {
+        toggleDisplay(id);
+        var new_width;
+        var decrease_width_by = Math.floor(getCssProperty(obj, 'width') / 3);
+        //Calculate pixel to inch. clientWidth only returns in pixels.
+        if (obj.style.display === "none") {
+            new_width = Math.floor(getCssProperty(help_node, 'width'))
+                    + decrease_width_by;
+        } else if (obj.style.display === "block") {
+            new_width = Math.floor(getCssProperty(help_node, 'width'))
+                    - decrease_width_by;
+        }
+
+        if (new_width !== undefined) {
+            help_node.style.maxWidth = new_width + "px";
+        }
+    } else {
+        toggleDisplay(id);
+        var height_after_toggle = (obj.clientHeight);
+        //Calculate pixel to inch. clientWidth only returns in pixels.
+        if (obj.style.display === "none") {
+            //on closing, restore top
+            help_node.style.top = current_activity_top + "px";
+            current_activity_closed = true;
+        } else if (obj.style.display === "block") {
+            help_node.style.top = current_activity_top
+                    + height_after_toggle + "px";
+            /* The div.clientHeight doesnt include the height
+            of the images inside the div before the images are completely
+            loaded. So we iterate through the
+            image elements, as each image loads add the image
+            height to the top of the current_activity div dynamically. */
+            for (var i = 0; i < images.length; i++) {
+                var image = images[i];
+                image.onload = function(){
+                    help_node.style.top =  getCssProperty(help_node, 'top')
+                            + this.height + 'px';
+                };
+            }
+            current_activity_closed = false;
+        }
+    }
+}
+
+/*
+ * gets the Css property given an element and property name.
+ * @param {Element} elm to get the Css property for
+ * @param {String} Css property name.
+ */
+function getCssProperty(elm, property)
+{
+    //always returns in px
+    return parseInt(window.getComputedStyle(elm, null)
+        .getPropertyValue(property));
+}
+
+/**
+ * This is a JS function to convert yioop wiki markup to
+ * html.
+ * @param {String} wiki_text tobe parsed as HTML
+ * @returns {String} parsed html
+ */
+function parseWikiContent(wiki_text, group_id, page_id)
+{
+    var html = wiki_text;
+
+    /* note that line breaks from a text area are sent
+    as \r\n , so make sure we clean them up to replace
+    all \r\n with \n */
+    html = html.replace(/\r\n/g, "\n");
+
+    html = parseLists(html);
+
+    //Regex replace normal links
+    html = html.replace(/[^\[](http[^\[\s]*)/g, function (m, l) {
+    // normal link
+        return '<a href="' + l + '">' + l + '</a>';
+    });
+
+    //Regex replace for external links
+    html = html.replace(/[\[](http.*)[!\]]/g, function (m, l) {
+    // external link
+        var p = l.replace(/[\[\]]/g, '').split(/ /);
+        var link = p.shift();
+        return '<a href="' + link + '">'
+        + (p.length ? p.join(' ') : link) + '</a>';
+    });
+
+    //Regex replace for headings
+    html = html.replace(/(?:^|\n)([=]+)(.*)\1/g,
+            function (match, contents, t) {
+                return '<h'
+                        + contents.length + '>'
+                        + t
+                        + '</h'
+                        + contents.length
+                        + '>';
+            });
+
+    //Regex replace for Bold characters
+    html = html.replace(/'''(.*?)'''/g, function (match, contents) {
+        return '<b>' + contents + '</b>';
+    });
+
+    //Regex replace for Italic characters
+    html = html.replace(/''(.*?)''/g, function (match, contents) {
+        return '<i>' + contents + '</i>';
+    });
+
+    //Regex for resource extraction.
+    html = html.replace(/{{resource:(.+?)\|(.+?)}}/g,
+            function (match, contents, desc) {
+                return '<img src="' + "?c=resource&a=get&f=resources&g="
+                + group_id
+                + "&p=" + page_id
+                + "&n=" + contents + '" alt="' + desc
+                + '" class="wiki-resource-image"/>';
+            });
+
+    //Regex replace for HR
+    html = html.replace(/----(.*?)/g, function (match, contents) {
+        return '<hr>' + contents + '</hr>';
+    });
+
+    //replace nowiki with pre tags
+    html = html.replace(/<nowiki>(.*?)<\/nowiki>/g, function(match, contents) {
+        return '<pre>' + contents + '</pre>';
+    });
+
+    //Regex replace for blocks
+    html = html.replace(/(?:^|\n+)([^# =\*<].+)(?:\n+|$)/gm,
+            function (match, contents) {
+                if (contents.match(/^\^+$/))
+                    return contents;
+                return "\n<div>" + contents + "</div>\n";
+            });
+
+    return html;
+}
+
+/**
+ * Lists need to be recursively parsed. So the below function is used
+ * to recursively convert wiki markup to html.
+ * @param {String} str
+ * @returns {String}
+ */
+function parseLists(str)
+{
+    return str.replace(/(?:(?:(?:^|\n)[\*#].*)+)/g, function (match) {
+        var listType = match.match(/(^|\n)#/) ? 'ol' : 'ul';
+        match = match.replace(/(^|\n)[\*#][ ]{0,1}/g, "$1");
+        match = parseLists(match);
+        return '<'
+                + listType + '><li>'
+                + match.replace(/^\n/, '')
+                .split(/\n/).join('</li><li>')
+                + '</li></' + listType
+                + '>';
+    });
+}
+
+/**
+ * get does a GET HTTP call on the url passed.
+ * Also fires the callback functions passed as
+ * params appropriately.
+ *
+ * @param {String} url
+ * @param {String} response_type
+ * @param {function} success_call_back
+ * @param {function} error_handler
+ */
+var get = function (url, response_type, success_call_back, error_handler)
+{
+    var request = makeRequest();
+    request.open('GET', url, true);
+    request.responseType = response_type;
+    request.onload = function () {
+        var status = request.status;
+        if (status == 200) {
+            success_call_back && success_call_back(request.response);
+        } else {
+            error_handler && error_handler(status);
+        }
+    };
+    request.send();
+};
+
+/**
+ * takes in the help point id, uses it to fetch wiki content, then
+ * wiki content is being eval'd to be painted int he help pane.
+ * Ajax call happens only if help needs to be displayed.
+ * @param {object} help_point element
+ * @param {String} is_mobile flag to check if the client is mobile
+ * or not.
+ */
+function displayHelpForId(help_point,
+                is_mobile,target_c,csrf_token_key,csrf_token_value)
+{
+    var help_group_id = 7;
+    var c = 'api';
+    var a = "wiki";
+    var arg = "read";
+
+    if ((elt("help-frame").style.display) === "block") {
+        toggleHelp('help-frame', is_mobile,target_c);
+        return;
+    }
+    get("?c=" + c + "&group_id=" + help_group_id + "&" +
+            "arg=" + arg + "&" +
+            "a=" + a + "&" +
+            csrf_token_key +'=' + csrf_token_value + "&" +
+            "page_name=" + help_point.getAttribute("data-pagename"),
+            'json',
+            function (data) {
+                elt("help-frame-body").innerHTML = parseWikiContent(
+                        data.wiki_content,
+                        data.group_id,
+                        data.page_id
+                        );
+                elt('page_name').innerHTML = data.page_name + ' <a href="'+
+                        getEditLink(
+                        target_c,
+                        csrf_token_key,
+                        csrf_token_value,
+                        help_group_id,
+                        data.page_name) +'">'+
+                        '[Edit]</a>' ;
+
+                toggleHelp('help-frame', is_mobile,target_c);
+            },
+            function (status) {
+                toggleHelp('help-frame', is_mobile,target_c);
+            });
+    event.preventDefault();
+}
+
+/**
+ * Simple function to construct the Wiki Edit hyperlink with passed in params.
+ * @param {type} target_c
+ * @param {type} csrf_token
+ * @param {type} group_id
+ * @param {type} page_name
+ * @returns {String}
+ */
+function getEditLink(target_c,
+                csrf_token_key, csrf_token_value, group_id, page_name)
+{
+    return '?c=' + target_c +
+            '&'+ csrf_token_key +'=' + csrf_token_value +
+            '&group_id=' + group_id +
+            '&arg=edit' +
+            '&a=wiki' +
+            '&page_name=' + page_name;
+}
+
+
+/**
+ * this function grabs the contents of the wiki text area,
+ * converts them into html then populates the preview
+ * div with parsed html contents. It takes in a page id and group id that are
+ * required to render image urls, If any exist.
+ * @param {type} page_id
+ * @param {type} group_id
+ */
+function renderPreview(page_id, group_id)
+{
+    if (event.preventDefault)
+        event.preventDefault();
+    event.returnValue = false;
+    var textArea = document.getElementById('wiki-page');
+    var div = document.getElementById('wiki-preview');
+    div.innerHTML = "<hr>"
+            + "<p>"
+            + parseWikiContent(
+            textArea.value,
+            group_id,
+            page_id) + "</p> <hr>";
+}
\ No newline at end of file
diff --git a/views/admin_view.php b/views/admin_view.php
index ddec49e..e3044d8 100755
--- a/views/admin_view.php
+++ b/views/admin_view.php
@@ -75,6 +75,7 @@ class AdminView extends View
         if(!MOBILE) {e(' ['.$data['CURRENT_ACTIVITY'].']');}?></span></h1>
         <?php
         $this->element("activity")->render($data);
+        $this->element("help")->render($data);
         if(isset($data['ELEMENT'])) {
             $element = $data['ELEMENT'];
             $this->element($element)->render($data);
diff --git a/views/api_view.php b/views/api_view.php
new file mode 100644
index 0000000..07ebb8b
--- /dev/null
+++ b/views/api_view.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * SeekQuarry/Yioop --
+ * Open Source Pure PHP Search Engine, Crawler, and Indexer
+ *
+ * Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
+ *
+ * LICENSE:
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * END LICENSE
+ *
+ * @author Eswara Rajesh Pinapala epinapala@live.com
+ * @package seek_quarry
+ * @subpackage view
+ * @license http://www.gnu.org/licenses/ GPL3
+ * @link http://www.seekquarry.com/
+ * @copyright 2009 - 2014
+ * @filesource
+ */
+if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}
+/**
+ * View used to draw and allow editing of wiki page when not in the admin view
+ * (so activities panel on side is not present.) This is also used to draw
+ * wiki pages for public groups when not logged.
+ *
+ * @author Eswara Rajesh Pinapala
+ * @package seek_quarry
+ * @subpackage view
+ */
+class ApiView extends View
+{
+    /** This view is drawn on a web layout
+     * @var string
+     */
+    var $layout = "api";
+
+    /**
+     * Draws a minimal container with a WikiElement in it on which a group
+     * wiki page can be drawn
+     *
+     * @param array $data with fields used for drawing the container and page
+     */
+    function renderView($data)
+    {
+        $this->element("api")->render($data);
+    }
+}
+?>
diff --git a/views/elements/api_element.php b/views/elements/api_element.php
new file mode 100644
index 0000000..59e9920
--- /dev/null
+++ b/views/elements/api_element.php
@@ -0,0 +1,108 @@
+<?php
+
+/**
+ * SeekQuarry/Yioop --
+ * Open Source Pure PHP Search Engine, Crawler, and Indexer
+ *
+ * Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
+ *
+ * LICENSE:
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * END LICENSE
+ *
+ * @author Eswara Rajesh Pinapala epinapala@live.com
+ * @package seek_quarry
+ * @subpackage view
+ * @license http://www.gnu.org/licenses/ GPL3
+ * @link http://www.seekquarry.com/
+ * @copyright 2009 - 2014
+ * @filesource
+ */
+if (!defined('BASE_DIR')) {
+    echo "BAD REQUEST";
+    exit();
+}
+/** Loads common constants for web crawling */
+require_once BASE_DIR . "/lib/crawl_constants.php";
+
+/**
+ * Element responsible for drawing wiki pages in either admin or wiki view
+ * It is also responsible for rendering wiki history pages, and listings of
+ * wiki pages available for a group
+ *
+ * @author Eswara Rajesh Pinapala
+ * @package seek_quarry
+ * @subpackage element
+ */
+class ApiElement extends Element implements CrawlConstants {
+
+    /**
+     * Draw a wiki page for group, or, depending on $data['MODE'] a listing
+     * of all pages for a group, or the history of revisions of a given page
+     * or the edit page form
+     *
+     * @param array $data fields contain data about the page being
+     * displayeed or edited, or the list of pages being displayed.
+     */
+    function render($data) {
+        $logged_in = isset($data["ADMIN"]) && $data["ADMIN"];
+        $can_edit = $logged_in && isset($data["CAN_EDIT"]) && $data["CAN_EDIT"];
+        $this->renderJsonDocument($data, $can_edit, $logged_in);
+    }
+
+    /**
+     * Used to send a Wiki content response for reading. If the page does
+     * not exist various create/login-to-create etc messages are displayed
+     * depending of it the user is logged in. and has write permissions
+     * on the group.
+     * @param array $data fields PAGE used for page contents
+     * @param bool $can_edit whether the current user has permissions to
+     *     edit or create this page
+     * @param bool $logged_in whethe current user is logged in or not
+     */
+    function renderJsonDocument($data, $can_edit, $logged_in) {
+        $out_array = array();
+        if ($data["PAGE"]) {
+            $out_array["wiki_content"] = html_entity_decode($data['PAGE'],
+                    ENT_QUOTES);
+            $out_array['group_id'] = $data['GROUP']['GROUP_ID'];
+            $out_array['group_name'] = $data['GROUP']['GROUP_NAME'];
+            $out_array['page_id'] = $data['PAGE_ID'];
+            $out_array['page_name'] = $data['PAGE_NAME'];
+            $http_code = 200;
+        } else if (!$logged_in) {
+            $out_array["logged_in"] = false;
+            $http_code = 401;
+        }
+        if ($can_edit) {
+            $out_array["can_edit"] = true;
+        }
+
+        if (isset($data['errors']) && count($data['errors']) > 0) {
+            $out_array['errors'] = json_encode(
+                    array_map(
+                            function($string) {
+                        return html_entity_decode($string, ENT_QUOTES);
+                    }, $data['errors']));
+        }
+
+        header("Content-Type: application/json");
+        http_response_code($http_code);
+        e(json_encode($out_array));
+        exit();
+    }
+
+}
diff --git a/views/elements/element.php b/views/elements/element.php
index 046ed54..3910c02 100755
--- a/views/elements/element.php
+++ b/views/elements/element.php
@@ -67,5 +67,27 @@ abstract class Element
      * that should be used in drawing the view
      */
     public abstract function render($data);
+
+    /**
+     * This method is used to render the help button,
+     * given a help point  csrf token and target controller name.
+     *
+     * @param  $help_point_id - used to set as help button id
+     * @param  $csrf_token_value - csrf token to make api call/open edit link
+     * @param  $target_c - target controller to remember the view.
+     * @return String button html.
+     */
+    public function renderHelpButton($help_point_id,
+            $csrf_token_value, $target_c) {
+        $is_mobile = MOBILE ? "true" : "false";
+        return '<button type="button"
+                    href=""
+                    onclick="javascript:displayHelpForId(this,'
+                . $is_mobile . ',\'' . $target_c . '\',\''. CSRF_TOKEN .'\',\''
+                . $csrf_token_value . '\')" '
+                . 'data-pagename="' . $help_point_id . '">?</button>';
+    }
+
 }
+
 ?>
diff --git a/views/elements/groupfeed_element.php b/views/elements/groupfeed_element.php
index b910273..d66c792 100644
--- a/views/elements/groupfeed_element.php
+++ b/views/elements/groupfeed_element.php
@@ -77,7 +77,11 @@ class GroupfeedElement extends Element implements CrawlConstants
         if(!$is_status) { 
             if($is_admin || $logged_in) { ?>
                 <div class="float-same admin-collapse">[<a
-                href="<?php e($other_paging_query) ?>" ><?php
+                href="<?php e($other_paging_query);
+                if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
+                    e("&amp;v=grouped");
+                }
+                ?>" ><?php
                 e($arrows); ?></a>]<?php
                 if(isset($data['SUBSCRIBE_LINK'])) {
                     if($data['SUBSCRIBE_LINK'] == PUBLIC_JOIN) {
@@ -101,7 +105,7 @@ class GroupfeedElement extends Element implements CrawlConstants
                 }?> >
         <?php
         }
-        if($data['SUBTITLE'] != "" && $logged_in) { ?>
+        if(isset($data['SUBTITLE']) && $data['SUBTITLE'] != "" && $logged_in) { ?>
             <div class="float-opposite">
             <?php
             if(isset($data["WIKI_PAGE_NAME"])) { ?>
@@ -115,11 +119,16 @@ class GroupfeedElement extends Element implements CrawlConstants
             <?php } ?>
             </div>
         <?php
+        }else if(isset($data['MODE']) && $data['MODE'] == 'grouped'
+                && isset ($data['JUST_GROUP_ID'])){
+            ?><div class="float-opposite"><a href="<?php
+                        e($base_query . "&amp;v=grouped")  ?>"><?php
+                        e(tl('groupfeed_element_back'))?></a></div><?php
         }
         if($is_admin) {
             ?>
             <h2><?php
-            if($data['SUBTITLE'] == "") {
+            if(!isset($data['SUBTITLE']) || $data['SUBTITLE'] == "") {
                 e(tl('groupfeed_element_recent_activity'));
             } else {
                 if(isset($data['JUST_THREAD'])) {
@@ -152,18 +161,81 @@ class GroupfeedElement extends Element implements CrawlConstants
                     e(tl('groupfeed_element_user',
                         $data['PAGES'][0]["USER_NAME"]));
                 } else {
-                    e("[{$data['SUBTITLE']}]");
+                    if(isset($data['SUBTITLE'])) e("[{$data['SUBTITLE']}]");
                 }
             }
             ?>
-            </h2>
             <?php
         }
-        ?>
+        if(!isset($data['JUST_THREAD']) && !isset($data['JUST_GROUP_ID'])){
+            e("<a href=\"" . $paging_query . "\">"
+                    . "<img src=\"resources/list.png\" /></a>" . "  " );
+            e("<a href=\"" . $paging_query . "&amp;v=grouped\">"
+                    . "<img src=\"resources/grouped.png\" /></a>". " " );
+            }
+        ?></h2>
         <div>
         &nbsp;
         </div>
         <?php
+      if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
+        //Grouped View
+        //var_dump($data['GROUPS']);
+        if (isset($data['JUST_GROUP_ID'])) {
+                foreach ($data['GROUPS'] as $group) {
+                    if($group['GROUP_ID'] == $data['JUST_GROUP_ID']){
+                    e("<div class=\"access-result\">" .
+                            "<div><b>" .
+                            "<a href=\"$paging_query&amp;just_group_id=" .
+                            $group['GROUP_ID'] . "&amp;v=grouped" . "\" " .
+                            "rel=\"nofollow\">" .
+                            $group['GROUP_NAME'] . "</a> " .
+                            "[<a href=\"$paging_query&amp;group_id=" .
+                            $group['GROUP_ID'] . "&amp;a=wiki\">" .
+                            tl('manageaccount_element_group_wiki') . "</a>] " .
+                            "(" . tl('manageaccount_element_group_stats',
+                                    $group['NUM_POSTS'],
+                                    $group['NUM_THREADS']) . ")</b>" .
+                            "</div>" .
+                            "<div class=\"slight-pad\">" .
+                            "<b>" . tl('manageaccount_element_last_post')
+                            . "</b> " .
+                            "<a href=\"$paging_query&amp;just_thread=" .
+                            $group['THREAD_ID'] . "\">" .
+                            $group['ITEM_TITLE'] . "</a>" .
+                            "</div>" .
+                            "</div>");
+                    $data['TOTAL_ROWS'] = 1;
+                    }
+                }
+            } else {
+                foreach ($data['GROUPS'] as $group) {
+                    e("<div class=\"access-result\">" .
+                            "<div><b>" .
+                            "<a href=\"$paging_query&amp;just_group_id=" .
+                            $group['GROUP_ID'] . "&amp;v=grouped" . "\" " .
+                            "rel=\"nofollow\">" .
+                            $group['GROUP_NAME'] . "</a> " .
+                            "[<a href=\"$paging_query&amp;group_id=" .
+                            $group['GROUP_ID'] . "&amp;a=wiki\">" .
+                            tl('manageaccount_element_group_wiki') . "</a>] " .
+                            "(" . tl('manageaccount_element_group_stats',
+                                    $group['NUM_POSTS'],
+                                    $group['NUM_THREADS']) . ")</b>" .
+                            "</div>" .
+                            "<div class=\"slight-pad\">" .
+                            "<b>" . tl('manageaccount_element_last_post')
+                            . "</b> " .
+                            "<a href=\"$paging_query&amp;just_thread=" .
+                            $group['THREAD_ID'] . "\">" .
+                            $group['ITEM_TITLE'] . "</a>" .
+                            "</div>" .
+                            "</div>");
+                    $data['TOTAL_ROWS'] = $data['NUM_GROUPS'];
+                }
+            }
+        $paging_query .= "&amp;v=grouped";
+       }else{
         $open_in_tabs = $data['OPEN_IN_TABS'];
         $time = time();
         $can_comment = array(GROUP_READ_COMMENT, GROUP_READ_WRITE,
@@ -375,6 +447,7 @@ class GroupfeedElement extends Element implements CrawlConstants
             </div>
             <?php
             } //end foreach
+       }//No grouped View
             $data['FRAGMENT'] = "";
             if(isset($data['JUST_THREAD']) && $logged_in) {
                 $data['FRAGMENT'] = '#result-'.$page['ID'];
@@ -397,6 +470,7 @@ class GroupfeedElement extends Element implements CrawlConstants
         if(!$is_status) {
             $this->renderScripts($data);
         }
+
     }
     /**
      * Used to render the Javascript that appears at the non-status updating
@@ -462,7 +536,8 @@ class GroupfeedElement extends Element implements CrawlConstants
                     ?></label></b></h2>'+
                     '<textarea class="short-text-area" '+
                     'id="comment-'+ id +'" name="description" '+
-                    'data-buttons="all,!wikibtn-search,!wikibtn-heading,!wikibtn-slide" '+
+                    'data-buttons="all,!wikibtn-search,!wikibtn-heading,'+
+                    '!wikibtn-slide" '+
                     '></textarea>' +
                     '<button class="button-box float-opposite" ' +
                     'type="submit"><?php e(tl("groupfeed_element_save"));
@@ -603,4 +678,4 @@ class GroupfeedElement extends Element implements CrawlConstants
         <?php
     }
 }
- ?>
+?>
\ No newline at end of file
diff --git a/views/elements/help_element.php b/views/elements/help_element.php
new file mode 100644
index 0000000..8a54055
--- /dev/null
+++ b/views/elements/help_element.php
@@ -0,0 +1,100 @@
+<?php
+/*
+ *  SeekQuarry/Yioop --
+ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
+ *
+ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
+ *
+ *  LICENSE:
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  END LICENSE
+ *
+ *  @author Eswara Rajesh Pinapala epinapala@live.com
+ *  @package seek_quarry
+ *  @subpackage element
+ *  @license http://www.gnu.org/licenses/ GPL3
+ *  @link http://www.seekquarry.com/
+ *  @copyright 2009 - 2014
+ *  @filesource
+ */
+if (!defined('BASE_DIR')) {
+    echo "BAD REQUEST";
+    exit();
+}
+
+/**
+ * This element is used to display the list of available activities
+ * in the AdminView
+ *
+ * @author Eswara Rajesh Pinapala
+ *
+ * @package seek_quarry
+ * @subpackage element
+ */
+class HelpElement extends Element {
+
+    /**
+     * Displays a list of admin activities
+     *
+     * @param array $data  available activities and CSRF token
+     */
+    function render($data) {
+        ?>
+        <?php
+            if (MOBILE) { ?>
+                <div id="mobile-help">
+                    <div id="help-frame" class="frame help-pane">
+                        <div id="help-frame-head">
+                            <h2 id="page_name"></h2>
+                        </div>
+
+                        <div id="help-frame-body" class="wordwrap">
+
+                        </div>
+                        <div id="help-frame-editor" class="wordwrap">
+
+                        </div>
+                    </div>
+                </div>
+            <?php } else {
+                if($data['c'] != 'admin'){
+                    $help_class_add = "small-margin-help-pane";
+                    $help_id ="small-margin-help";
+                }else{
+                    $help_id = "help";
+                }
+                ?>
+                <div id="<?php e($help_id); ?>">
+                  <div id="help-frame" class="frame help-pane <?php
+                  e($help_class_add); ?>">
+                      <div id="help-frame-head">
+                          <h2 id="page_name"></h2>
+                      </div>
+
+                    <div id="help-frame-body" class="wordwrap">
+
+                    </div>
+                    <div id="help-frame-editor" class="wordwrap">
+
+                    </div>
+                  </div>
+                </div>
+                <?php
+            }
+    }
+
+}
+?>
\ No newline at end of file
diff --git a/views/elements/managegroups_element.php b/views/elements/managegroups_element.php
index fa06f58..b1e1df8 100755
--- a/views/elements/managegroups_element.php
+++ b/views/elements/managegroups_element.php
@@ -93,6 +93,7 @@ class ManagegroupsElement extends Element
         <?php
             $group_url = "?c=admin&amp;".CSRF_TOKEN."=".$data[CSRF_TOKEN];
             $base_url = $group_url . "&amp;a=manageGroups";
+            $wiki_url = $group_url . "&amp;a=wiki&amp;group_id=";
             $group_url .= "&amp;a=groupFeeds&amp;just_group_id=";
             if(isset($data['browse'])) {
                 $base_url .= "&amp;browse=".$data['browse'];
@@ -199,7 +200,15 @@ class ManagegroupsElement extends Element
                         ($group['MEMBER_ACCESS'] != GROUP_PRIVATE ||
                         $group["OWNER_ID"] == $_SESSION['USER_ID'])) {
                         e("<td><a href='".$group_url.$group['GROUP_ID']."' >".
-                            $group_column."</a></td>");
+                            $group_column."</a>".
+                                " <a href=\""
+                                . $wiki_url. $group['GROUP_ID']
+                                ."\">"
+                                ."["
+                                . (tl('manageaccount_element_group_wiki'))
+                                ."]"
+                                . "</a>"
+                                ."</td>");
                     } else {
                         e("<td>$group_column</td>");
                     }
@@ -317,7 +326,11 @@ class ManagegroupsElement extends Element
                 ?> /></td><?php
                 if($addgroup) { ?>
                     <td>[<a href="<?php e($browse_url); ?>"><?php 
-                        e(tl('managegroups_element_browse')); ?></a>]</td>
+                        e(tl('managegroups_element_browse')); ?></a>]
+                    <?php
+                    e($this->renderHelpButton("browse_url", $data[CSRF_TOKEN],
+                            $_REQUEST['c']));
+                    ?></td>
                 <?php
                 }
         ?></tr>
@@ -385,11 +398,11 @@ class ManagegroupsElement extends Element
                         if($data['CURRENT_GROUP']['owner'] ==
                             $user_array['USER_NAME']) {
                             e("<td>".
-                                $data['MEMBERSHIP_CODES'][$user_array['STATUS']] .
+                            $data['MEMBERSHIP_CODES'][$user_array['STATUS']] .
                                 "</td>");
                             e("<td>" . tl('managegroups_element_groupowner') .
                                 "</td><td><span class='gray'>".
-                                tl('managegroups_element_delete')."</span></td>");
+                            tl('managegroups_element_delete')."</span></td>");
                         } else {
                             e("<td>".$data['MEMBERSHIP_CODES'][
                                 $user_array['STATUS']]);
diff --git a/views/elements/wiki_element.php b/views/elements/wiki_element.php
index d157de9..15e5e53 100644
--- a/views/elements/wiki_element.php
+++ b/views/elements/wiki_element.php
@@ -391,8 +391,17 @@ class WikiElement extends Element implements CrawlConstants
             <div id="save-container" class="top-margin center">
             <button class="button-box" type="submit"><?php
                 e(tl('wiki_element_savebutton')); ?></button>
+            <button id="wiki-preview-btn"
+                    onclick="javascript:renderPreview('<?php
+                        e($data["PAGE_ID"] . "','"
+                      . $data['GROUP']['GROUP_ID']);
+            ?>')" class="button-box"><?php
+                e(tl('wiki_element_previewbutton')); ?></button>
             </div>
         </form>
+        <div id="wiki-preview">
+
+        </div>
         <div class="top-margin" id="media-list-page">
         <h2><?php e(tl('wiki_element_media_list'))?></h2>
         <p><?php e(tl('wiki_element_ml_description'))?></p>
diff --git a/views/group_view.php b/views/group_view.php
index a5404ae..cf99488 100644
--- a/views/group_view.php
+++ b/views/group_view.php
@@ -114,6 +114,7 @@ class GroupView extends View implements CrawlConstants
             $element = $data['ELEMENT'];
             $this->element($element)->render($data);
         }
+        $this->element("help")->render($data);
         if(PROFILE) {
         ?>
         <script type="text/javascript">
diff --git a/views/layouts/api_layout.php b/views/layouts/api_layout.php
new file mode 100644
index 0000000..557bb37
--- /dev/null
+++ b/views/layouts/api_layout.php
@@ -0,0 +1,63 @@
+<?php
+
+/*
+ *  SeekQuarry/Yioop --
+ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
+ *
+ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
+ *
+ *  LICENSE:
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  END LICENSE
+ *
+ *  @author Eswara Rajesh Pinapala epinapala@live.com
+ *  @package seek_quarry
+ *  @subpackage element
+ *  @license http://www.gnu.org/licenses/ GPL3
+ *  @link http://www.seekquarry.com/
+ *  @copyright 2009 - 2014
+ *  @filesource
+ */
+
+if (!defined('BASE_DIR')) {
+    echo "BAD REQUEST";
+    exit();
+}
+
+/**
+ * Layout used for the seek_quarry Website
+ * including pages such as search landing page
+ * and settings page
+ *
+ * @author Eswara Rajesh Pinapala
+ * @package seek_quarry
+ * @subpackage layout
+ */
+class ApiLayout extends Layout {
+
+    /**
+     * Responsible for drawing the prefix/suffix (if any for the API response)
+     *
+     * @param array $data  an array of data set up by the controller to be
+     * be used in drawing the WebLayout and its View.
+     */
+    function render($data) {
+        $this->view->renderView($data);
+    }
+
+}
+
+?>
-- 
1.9.3 (Apple Git-50)


From c5654ebe49d85f06476682deed029adf1690eab8 Mon Sep 17 00:00:00 2001
From: epinapala <epinapala@ebay.com>
Date: Fri, 17 Oct 2014 00:24:58 -0700
Subject: [PATCH 2/2] Make Collapse/expand views for just_group_id more
 seamless

---
 fix_empty_poster.patch               | 1978 ----------------------------------
 resources/grouped.png                |  Bin 0 -> 3358 bytes
 resources/list.png                   |  Bin 0 -> 3453 bytes
 views/elements/groupfeed_element.php |    7 +-
 4 files changed, 6 insertions(+), 1979 deletions(-)
 delete mode 100644 fix_empty_poster.patch
 create mode 100644 resources/grouped.png
 create mode 100644 resources/list.png

diff --git a/fix_empty_poster.patch b/fix_empty_poster.patch
deleted file mode 100644
index d2cbbd4..0000000
--- a/fix_empty_poster.patch
+++ /dev/null
@@ -1,1978 +0,0 @@
-From 5ad9d236c03a57525daa3a729334b4a6b600c838 Mon Sep 17 00:00:00 2001
-From: epinapala <epinapala@ebay.com>
-Date: Fri, 17 Oct 2014 00:09:18 -0700
-Subject: [PATCH 1/4] Creating another patch With all suggested changes, Please
- see summary below (1) The single feed and category icons look different in
- size. This might be an optical illusion caused by differences in padding in
- the two icons, but is still disconcerting. The category icon should not be
- bar, two indented bars, bar, indented bar. Instead, just use bar indented
- bar, bar indented bar. - Fixed icons as per your suggestion. (2) The single
- feed and category buttons only work when using the admin (non-collapsed)
- controller. They don't show up at all when using the group (collapsed)
- controller. - This is fixed, also When moving from expanded controller to
- collapsed controller, view is also retained. (3) Category view is not doing
- sufficient isset checks. It generates Notices like: NOTICE: Undefined index:
- SUBTITLE at line 104 in
- /Applications/MAMP/htdocs/git/yioop/views/elements/groupfeed_element.php
-
-NOTICE: Undefined index: SUBTITLE at line 122 in /Applications/MAMP/htdocs/git/yioop/views/elements/groupfeed_element.php
-
-- These errors and another on the same page are all fixed byt checking using isset()
-
-(4) In the wiki, I don't see what the Preview button does which is useful. When I click either Save or Preview it says that the page is saved. So it does not seem to be previewing changes. For the extra-button I would really like a strong use-case for why it is needed.
-- When you click on Preview, that doesnt save the wiki content. I am not sure why this happened when you tried. I tried again multiple times and clicking on Preview just shows the preview. The idea behing having a seperate preview button is to save additional POST call to the server, Again, this is somethign I found very handy on Media wiki.
-
-(5) You are also adding a lot of code for the help wiki, but no way the end user can test it. This needs to be testable before the patch goes live. Have at least one place where help has been added so I can test this new functionality.
-- I added a sample help button on manageGroups action -  ?c=admin&YIOOP_TOKEN=obbrFXEgrts|1413522871&a=manageGroups. Please let me know If you need the buttons rendered anywhere else.
----
- .gitignore                                  |   6 +-
- controllers/api_controller.php              | 130 ++++++++++++
- controllers/components/social_component.php |  76 ++++++-
- controllers/controller.php                  |   1 +
- css/search.css                              |  84 +++++++-
- index.php                                   |   5 +-
- locale/ar/configure.ini                     |   3 +
- locale/bn/configure.ini                     |   3 +
- locale/de/configure.ini                     |   3 +
- locale/en-US/configure.ini                  |   5 +-
- locale/es/configure.ini                     |   3 +
- locale/fa/configure.ini                     |   3 +
- locale/fr-FR/configure.ini                  |   3 +
- locale/he/configure.ini                     |   3 +
- locale/hi/configure.ini                     |   3 +
- locale/in-ID/configure.ini                  |   3 +
- locale/it/configure.ini                     |   3 +
- locale/ja/configure.ini                     |   3 +
- locale/kn/configure.ini                     |   3 +
- locale/ko/configure.ini                     |   3 +
- locale/pl/configure.ini                     |   3 +
- locale/pt/configure.ini                     |   3 +
- locale/ru/configure.ini                     |   3 +
- locale/te/configure.ini                     |   3 +
- locale/th/configure.ini                     |   3 +
- locale/tr/configure.ini                     |   3 +
- locale/vi-VN/configure.ini                  |   3 +
- locale/zh-CN/configure.ini                  |   3 +
- models/group_model.php                      |   2 +-
- scripts/basic.js                            | 300 ++++++++++++++++++++++++++++
- views/admin_view.php                        |   1 +
- views/api_view.php                          |  61 ++++++
- views/elements/api_element.php              | 108 ++++++++++
- views/elements/element.php                  |  22 ++
- views/elements/groupfeed_element.php        |  91 ++++++++-
- views/elements/help_element.php             | 100 ++++++++++
- views/elements/managegroups_element.php     |  21 +-
- views/elements/wiki_element.php             |   9 +
- views/group_view.php                        |   1 +
- views/layouts/api_layout.php                |  63 ++++++
- 40 files changed, 1126 insertions(+), 23 deletions(-)
- create mode 100644 controllers/api_controller.php
- create mode 100644 views/api_view.php
- create mode 100644 views/elements/api_element.php
- create mode 100644 views/elements/help_element.php
- create mode 100644 views/layouts/api_layout.php
-
-diff --git a/.gitignore b/.gitignore
-index fb633b5..f946ad8 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -1,2 +1,4 @@
--local_config.php
--.DS_Store
-+local_config.php
-+.DS_Store
-+nbproject/
-+/.idea/
-diff --git a/controllers/api_controller.php b/controllers/api_controller.php
-new file mode 100644
-index 0000000..641067a
---- /dev/null
-+++ b/controllers/api_controller.php
-@@ -0,0 +1,130 @@
-+<?php
-+
-+/*
-+ *  SeekQuarry/Yioop --
-+ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
-+ *
-+ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
-+ *
-+ *  LICENSE:
-+ *
-+ *  This program is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ *
-+ *  END LICENSE
-+ *
-+ *  @author Eswara Rajesh Pinapala epinapala@live.com
-+ *  @package seek_quarry
-+ *  @subpackage element
-+ *  @license http://www.gnu.org/licenses/ GPL3
-+ *  @link http://www.seekquarry.com/
-+ *  @copyright 2009 - 2014
-+ *  @filesource
-+ */
-+
-+/**
-+ * Description of ApiController
-+ *
-+ * @author epinapala
-+ */
-+if (!defined('BASE_DIR')) {
-+    echo "BAD REQUEST";
-+    exit();
-+}
-+/** Load base controller class if needed */
-+require_once BASE_DIR . "/controllers/controller.php";
-+/** Loads common constants for web crawling */
-+require_once BASE_DIR . "/lib/crawl_constants.php";
-+/** For Wiki Parsing */
-+require_once BASE_DIR . "/lib/wiki_parser.php";
-+
-+/**
-+ * Controller used to handle user group activities outside of
-+ * the admin panel setting. This either could be because the admin panel
-+ * is "collapsed" or because the request concerns a wiki page.
-+ *
-+ * @author Eswara Rajesh Pinapala
-+ * @package seek_quarry
-+ * @subpackage controller
-+ */
-+class ApiController extends Controller implements CrawlConstants {
-+
-+    /**
-+     * Says which activities (roughly methods invoke for the api) this
-+     * controller will respond to (note: more activities will be loaded from
-+     * components)
-+     * @var array
-+     */
-+    var $activities = array("wiki");
-+
-+    /**
-+     * Used to process requests related to user group activities outside of
-+     * the admin panel setting. This either could be because the admin panel
-+     * is "collapsed" or because the request concerns a wiki page.
-+     */
-+    function processRequest() {
-+        $data = array();
-+        if (!PROFILE) {
-+            return $this->configureRequest();
-+        }
-+        if (isset($_SESSION['USER_ID'])) {
-+            $user_id = $_SESSION['USER_ID'];
-+            $data['ADMIN'] = 1;
-+        } else {
-+            $user_id = $_SERVER['REMOTE_ADDR'];
-+        }
-+        $data['SCRIPT'] = "";
-+        $token_okay = $this->checkCSRFToken(CSRF_TOKEN, $user_id);
-+
-+        $data = array_merge($data, $this->processSession());
-+
-+        if (isset($data["VIEW"])) {
-+            $view = $data["VIEW"];
-+        } else {
-+            $view = 'api';
-+        }
-+        $_SESSION['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
-+        $this->displayView($view, $data);
-+    }
-+
-+    /**
-+     * Used to perform the actual activity call to be done by the
-+     * api_controller.
-+     * processSession is called from @see processRequest, which does some
-+     * cleaning of fields if the CSRFToken is not valid. It is more likely
-+     * that that api_controller may be involved in such requests as it can
-+     * be invoked either when a user is logged in or not and for users with and
-+     * without accounts. processSession makes sure the $_REQUEST'd activity is
-+     * valid (or falls back to groupFeeds) then calls it. If someone uses
-+     * the Settings link to change the language or default number of feed
-+     * elements to view, this method sets up the $data variable so that
-+     * the back/cancel button on that page works correctly.
-+     */
-+    function processSession() {
-+        if (isset($_REQUEST['a']) &&
-+                in_array($_REQUEST['a'], $this->activities)) {
-+            $activity = $_REQUEST['a'];
-+        } else {
-+            $activity = "groupFeeds";
-+        }
-+        $data = $this->call($activity);
-+        $data['ACTIVITY_CONTROLLER'] = "group";
-+        $data['ACTIVITY_METHOD'] = $activity; //for settings controller
-+        if (!is_array($data)) {
-+            $data = array();
-+        }
-+        return $data;
-+    }
-+}
-+
-+?>
-diff --git a/controllers/components/social_component.php b/controllers/components/social_component.php
-index 3327ffc..5294091 100644
---- a/controllers/components/social_component.php
-+++ b/controllers/components/social_component.php
-@@ -718,6 +718,59 @@ class SocialComponent extends Component implements CrawlConstants
-         }
-         $possible_arguments = array("addcomment", "deletepost", "addgroup",
-             "newthread", "updatepost", "status", "upvote", "downvote");
-+        if (isset($_REQUEST['v']) && $_REQUEST['v'] == 'grouped') {
-+            $data['MODE'] = 'grouped';
-+            if(isset($_REQUEST['just_group_id'])){
-+            $data['JUST_GROUP_ID'] = $_REQUEST['just_group_id'];
-+            }
-+            if (isset($_REQUEST['limit'])) {
-+                $limit = $parent->clean($_REQUEST['limit'], "int");
-+            } else {
-+                $limit = 0;
-+            }
-+            //$data['NUM_SHOWN'] = (isset($_REQUEST['limit'])
-+            //      && $_REQUEST['limit'] > 0 ) ? $_REQUEST['limit'] : 5;
-+            $data['GROUPS'] = $group_model->getRows($limit, $results_per_page,
-+                    $data['NUM_GROUPS'], array(), array($user_id, false));
-+            $num_shown = count($data['GROUPS']);
-+            for ($i = 0; $i < $num_shown; $i++) {
-+                $search_array = array(array("group_id", "=",
-+                        $data['GROUPS'][$i]['GROUP_ID'], ""),
-+                    array("pub_date", "", "", "DESC"));
-+                $item = $group_model->getGroupItems(
-+                        0,
-+                        1,
-+                        $search_array,
-+                        $user_id);
-+                $data['GROUPS'][$i]['NUM_POSTS'] =
-+                        $group_model->getGroupItemCount(
-+                                $search_array, $user_id);
-+                $data['GROUPS'][$i]['NUM_THREADS'] =
-+                        $group_model->getGroupItemCount(
-+                                $search_array,
-+                                $user_id,
-+                                $data['GROUPS'][$i]['GROUP_ID']
-+                                );
-+                $data['GROUPS'][$i]['NUM_PAGES'] =
-+                        $group_model->getGroupPageCount(
-+                        $data['GROUPS'][$i]['GROUP_ID']);
-+                if (isset($item[0]['TITLE'])) {
-+                    $data['GROUPS'][$i]["ITEM_TITLE"] = $item[0]['TITLE'];
-+                    $data['GROUPS'][$i]["THREAD_ID"] = $item[0]['PARENT_ID'];
-+                } else {
-+                    $data['GROUPS'][$i]["ITEM_TITLE"] =
-+                            tl('accountaccess_component_no_posts_yet');
-+                    $data['GROUPS'][$i]["THREAD_ID"] = -1;
-+                }
-+            }
-+            $data['NUM_SHOWN'] = $num_shown;
-+            $data['LIMIT'] = $limit;
-+            $data['RESULTS_PER_PAGE'] = $results_per_page;
-+            $data['PAGING_QUERY'] = "./?c=$controller_name&amp;a=groupFeeds";
-+            $data['OTHER_PAGING_QUERY'] =
-+            "./?c=$other_controller_name&amp;a=groupFeeds";
-+            return $data;
-+        }
-         if(isset($_REQUEST['arg']) &&
-             in_array($_REQUEST['arg'], $possible_arguments)) {
-             switch($_REQUEST['arg'])
-@@ -1245,11 +1298,21 @@ EOD;
-         }
-         $group = $group_model->getGroupById($group_id, $user_id);
-         $data["CAN_EDIT"] = false;
--        $data["MODE"] = "read";
-+        if((isset($_REQUEST['c'])) && $_REQUEST['c'] == "api"){
-+            $data['MODE'] = 'api';
-+            $data['VIEW'] = 'api';
-+        }else {
-+            $data["MODE"] = "read";
-+        }
-         if(!$group) {
-+            if($data['MODE'] !== 'api'){
-             $data['SCRIPT'] .= "doMessage('<h1 class=\"red\" >".
-                 tl("group_controller_no_group_access").
-                 "</h1>');";
-+            }else{
-+                $data['errors'] =  array();
-+                $data['errors'][] = tl("group_controller_no_group_access");
-+            }
-             $group_id = PUBLIC_GROUP_ID;
-             $group = $group_model->getGroupById($group_id, $user_id);
-         } else {
-@@ -1292,7 +1355,8 @@ EOD;
-                 case "edit":
-                     if(!$data["CAN_EDIT"]) { continue; }
-                     if(isset($_REQUEST['caret']) &&
--                       isset($_REQUEST['scroll_top'])) {
-+                       isset($_REQUEST['scroll_top'])
-+                            && !isset($page)) {
-                         $caret = $parent->clean($_REQUEST['caret'],
-                             'int');
-                         $scroll_top= $parent->clean($_REQUEST['scroll_top'],
-@@ -1304,7 +1368,11 @@ EOD;
-                             "} ".
-                             "wiki.scrollTop = $scroll_top;";
-                     }
--                    $data["MODE"] = "edit";
-+                    if(isset($page)){
-+                        $data["MODE"] = "read";
-+                    }else{
-+                        $data["MODE"] = "edit";
-+                    }
-                     $page_info = $group_model->getPageInfoByName($group_id,
-                         $page_name, $locale_tag, 'resources');
-                     /* if page not yet created than $page_info will be null
-@@ -1609,7 +1677,7 @@ EOD;
-             $page_name = tl('group_controller_main');
-         }
-         $data["GROUP"] = $group;
--        if(in_array($data["MODE"], array("read", "edit", "media"))) {
-+        if(in_array($data["MODE"], array("read", "edit", "media","api"))) {
-             if(!isset($data["PAGE"]) || !$data['PAGE']) {
-                 $data["PAGE_NAME"] = $page_name;
-                 if(isset($search_page_info) && $search_page_info) {
-diff --git a/controllers/controller.php b/controllers/controller.php
-index 7b8bdfd..863ddd1 100755
---- a/controllers/controller.php
-+++ b/controllers/controller.php
-@@ -254,6 +254,7 @@ abstract class Controller
-                 $data['TOTAL_ELAPSED_TIME'] += $mail_total_time;
-             }
-         }
-+        $data['c'] = isset($_REQUEST['c']) ? $_REQUEST['c'] : NULL;
-         $this->view($view)->render($data);
-     }
-     /**
-diff --git a/css/search.css b/css/search.css
-index d96382f..cf0b54b 100755
---- a/css/search.css
-+++ b/css/search.css
-@@ -2199,7 +2199,7 @@ div.group-result
-     font-size: 16pt;
-     max-width: 9in;
-     min-height: 6.5in;
--    min-width: 9in;
-+    min-width: 8in;
-     padding-left: 0.1in;
-     padding-right: 0.1in;
-     padding-bottom: 0.1in;
-@@ -2763,3 +2763,85 @@ table.wikitable > caption
-     z-index: 200;
- }
- 
-+.html-ltr #help
-+{
-+    border-radius: 8px;
-+    float: left;
-+    width: 4.0in;
-+    position: absolute;
-+    left: 11.5in;
-+    top: 135px;
-+}
-+
-+.html-rtl #help
-+{
-+    border-radius: 8px;
-+    float: left;
-+    width: 4.0in;
-+    position: absolute;
-+    right: 11.5in;
-+    top: 135px;
-+}
-+
-+.html-ltr #small-margin-help
-+{
-+    border-radius: 8px;
-+    float: left;
-+    width: 4.0in;
-+    position: absolute;
-+    left: 11.5in;
-+    top: 135px;
-+}
-+
-+.html-rtl #small-margin-help
-+{
-+    border-radius: 8px;
-+    float: left;
-+    width: 4.0in;
-+    position: absolute;
-+    right: 9.5in;
-+    top: 135px;
-+}
-+
-+.html-ltr #mobile-help
-+{
-+    float: left;
-+    width: 3in;
-+    position: absolute;
-+    top: 142px;
-+}
-+
-+.html-rtl #mobile-help
-+{
-+    float: left;
-+    width: 3in;
-+    position: absolute;
-+    top: 142px;
-+}
-+
-+.help-pane{
-+    display : none;
-+    width: 320px;
-+    border:2px solid #0094ff;
-+}
-+
-+.small-margin-help-pane {
-+display: none;
-+width: 380px;
-+border: 2px solid #0094ff;
-+left: -1in;
-+top: 1in;
-+}
-+
-+.help-pane h2 {
-+    background:#0094ff;
-+    color:white;
-+    padding:10px;
-+}
-+.help-pane p {
-+    color:#333;
-+    padding:10px;
-+}
-+.wiki-resource-image{
-+    max-width:100%;
-+}
-diff --git a/index.php b/index.php
-index 6d4d781..4ea5236 100755
---- a/index.php
-+++ b/index.php
-@@ -124,8 +124,9 @@ if (function_exists('lcfirst') === false) {
-         return (string)(strtolower(substr($str, 0, 1)).substr($str, 1));
-     }
- }
--$available_controllers = array( "admin", "archive",  "cache", "classifier",
--    "crawl", "fetch", "group", "machine", "resource", "search", "settings",
-+$available_controllers = array( "admin", "api", "archive",  "cache", "classifier",
-+    "crawl", "fetch", "group", "machine", "resource", "search",
-+    "settings",
-     "statistics", "static");
- if(!WEB_ACCESS) {
- $available_controllers = array("admin", "archive", "cache", "crawl", "fetch",
-diff --git a/locale/ar/configure.ini b/locale/ar/configure.ini
-index 08844aa..d6bc5e2 100755
---- a/locale/ar/configure.ini
-+++ b/locale/ar/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/bn/configure.ini b/locale/bn/configure.ini
-index 0f6bb07..0e1c73f 100755
---- a/locale/bn/configure.ini
-+++ b/locale/bn/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/de/configure.ini b/locale/de/configure.ini
-index 384c3bc..9c92c70 100755
---- a/locale/de/configure.ini
-+++ b/locale/de/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/en-US/configure.ini b/locale/en-US/configure.ini
-index dc5715f..bd9552d 100755
---- a/locale/en-US/configure.ini
-+++ b/locale/en-US/configure.ini
-@@ -3233,7 +3233,7 @@ wiki_element_archive_info = "To archive a page so it won&#039;t appear in search
- ; wiki_element.php line: 384
- wiki_element_edit_reason = "Edit Reason:"
- ;
--; wiki_element.php line: 392
-+; wiki_element.php line: 393
- wiki_element_savebutton = "Save"
- ;
- ; wiki_element.php line: 396
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = "Media List Page"
- ; wiki_element.php line: 397
- wiki_element_ml_description = "The uploaded items below will all appear when this page is read as a gallery or media list."
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = "Preview"
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = "Page Resources"
- ;
-diff --git a/locale/es/configure.ini b/locale/es/configure.ini
-index dcd55af..ecaf8cf 100755
---- a/locale/es/configure.ini
-+++ b/locale/es/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/fa/configure.ini b/locale/fa/configure.ini
-index 4a60883..a76687a 100755
---- a/locale/fa/configure.ini
-+++ b/locale/fa/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/fr-FR/configure.ini b/locale/fr-FR/configure.ini
-index c3a16cb..98e4562 100755
---- a/locale/fr-FR/configure.ini
-+++ b/locale/fr-FR/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/he/configure.ini b/locale/he/configure.ini
-index c528da5..0564177 100755
---- a/locale/he/configure.ini
-+++ b/locale/he/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/hi/configure.ini b/locale/hi/configure.ini
-index b6f6e8f..47af7cf 100755
---- a/locale/hi/configure.ini
-+++ b/locale/hi/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/in-ID/configure.ini b/locale/in-ID/configure.ini
-index 76d2840..5282a5c 100755
---- a/locale/in-ID/configure.ini
-+++ b/locale/in-ID/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/it/configure.ini b/locale/it/configure.ini
-index 11c9844..acad5ee 100755
---- a/locale/it/configure.ini
-+++ b/locale/it/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/ja/configure.ini b/locale/ja/configure.ini
-index 06dc5e7..6dfebc3 100755
---- a/locale/ja/configure.ini
-+++ b/locale/ja/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/kn/configure.ini b/locale/kn/configure.ini
-index 74f46af..c70e3df 100755
---- a/locale/kn/configure.ini
-+++ b/locale/kn/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/ko/configure.ini b/locale/ko/configure.ini
-index 11b84f7..c42163b 100755
---- a/locale/ko/configure.ini
-+++ b/locale/ko/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/pl/configure.ini b/locale/pl/configure.ini
-index 3e8a064..c8ca748 100755
---- a/locale/pl/configure.ini
-+++ b/locale/pl/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/pt/configure.ini b/locale/pt/configure.ini
-index 4310ca6..30e71bd 100755
---- a/locale/pt/configure.ini
-+++ b/locale/pt/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/ru/configure.ini b/locale/ru/configure.ini
-index a6e4185..60f17dd 100755
---- a/locale/ru/configure.ini
-+++ b/locale/ru/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/te/configure.ini b/locale/te/configure.ini
-index 50a739c..91e47d4 100755
---- a/locale/te/configure.ini
-+++ b/locale/te/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/th/configure.ini b/locale/th/configure.ini
-index e7ed27d..0ffb090 100755
---- a/locale/th/configure.ini
-+++ b/locale/th/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/tr/configure.ini b/locale/tr/configure.ini
-index 82fe851..a459061 100755
---- a/locale/tr/configure.ini
-+++ b/locale/tr/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/vi-VN/configure.ini b/locale/vi-VN/configure.ini
-index 5c99ae9..7a761bc 100755
---- a/locale/vi-VN/configure.ini
-+++ b/locale/vi-VN/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/locale/zh-CN/configure.ini b/locale/zh-CN/configure.ini
-index 87bd5b6..7914cc0 100755
---- a/locale/zh-CN/configure.ini
-+++ b/locale/zh-CN/configure.ini
-@@ -3242,6 +3242,9 @@ wiki_element_media_list = ""
- ; wiki_element.php line: 397
- wiki_element_ml_description = ""
- ;
-+; wiki_element.php line: 399
-+wiki_element_previewbutton = ""
-+;
- ; wiki_element.php line: 414
- wiki_view_page_resources = ""
- ;
-diff --git a/models/group_model.php b/models/group_model.php
-index 857a2bd..36c844a 100644
---- a/models/group_model.php
-+++ b/models/group_model.php
-@@ -969,7 +969,7 @@ class GroupModel extends Model
-     function getPageInfoByName($group_id, $name, $locale_tag, $mode)
-     {
-         $db = $this->db;
--        if($mode == "edit") {
-+        if($mode == "edit" || $mode == "api") {
-             $sql = "SELECT HP.PAGE_ID AS ID, HP.PAGE AS PAGE,
-                 GP.DISCUSS_THREAD AS DISCUSS_THREAD FROM GROUP_PAGE GP,
-                 GROUP_PAGE_HISTORY HP WHERE GP.GROUP_ID = ?
-diff --git a/scripts/basic.js b/scripts/basic.js
-index 52658e6..27e81dd 100755
---- a/scripts/basic.js
-+++ b/scripts/basic.js
-@@ -180,3 +180,303 @@ function toggleDisplay(id)
-     }
-     obj.style.display = value;
- }
-+
-+current_activity_closed = true;
-+current_activity_top = 0;
-+/*
-+ * Toggles Help element from display:none and display block.
-+ * Also changes the width of the Current activity accordingly.
-+ * @param {String} help element's id to toggle.
-+ * @param {String} isMobile flag true/false.
-+ */
-+function toggleHelp(id, isMobile, target_c)
-+{
-+    var activity = (target_c === "admin") ? 'current-activity'
-+    : 'small-margin-current-activity';
-+    var images = document.querySelectorAll(".wiki-resource-image");
-+    var all_help_elements =
-+            document.getElementsByClassName(activity);
-+    var help_node = all_help_elements[0];
-+    if (current_activity_closed === true) {
-+        current_activity_top = getCssProperty(help_node, 'top');
-+    }
-+    obj = elt(id);
-+
-+    if (isMobile === false) {
-+        toggleDisplay(id);
-+        var new_width;
-+        var decrease_width_by = Math.floor(getCssProperty(obj, 'width') / 3);
-+        //Calculate pixel to inch. clientWidth only returns in pixels.
-+        if (obj.style.display === "none") {
-+            new_width = Math.floor(getCssProperty(help_node, 'width'))
-+                    + decrease_width_by;
-+        } else if (obj.style.display === "block") {
-+            new_width = Math.floor(getCssProperty(help_node, 'width'))
-+                    - decrease_width_by;
-+        }
-+
-+        if (new_width !== undefined) {
-+            help_node.style.maxWidth = new_width + "px";
-+        }
-+    } else {
-+        toggleDisplay(id);
-+        var height_after_toggle = (obj.clientHeight);
-+        //Calculate pixel to inch. clientWidth only returns in pixels.
-+        if (obj.style.display === "none") {
-+            //on closing, restore top
-+            help_node.style.top = current_activity_top + "px";
-+            current_activity_closed = true;
-+        } else if (obj.style.display === "block") {
-+            help_node.style.top = current_activity_top
-+                    + height_after_toggle + "px";
-+            /* The div.clientHeight doesnt include the height
-+            of the images inside the div before the images are completely
-+            loaded. So we iterate through the
-+            image elements, as each image loads add the image
-+            height to the top of the current_activity div dynamically. */
-+            for (var i = 0; i < images.length; i++) {
-+                var image = images[i];
-+                image.onload = function(){
-+                    help_node.style.top =  getCssProperty(help_node, 'top')
-+                            + this.height + 'px';
-+                };
-+            }
-+            current_activity_closed = false;
-+        }
-+    }
-+}
-+
-+/*
-+ * gets the Css property given an element and property name.
-+ * @param {Element} elm to get the Css property for
-+ * @param {String} Css property name.
-+ */
-+function getCssProperty(elm, property)
-+{
-+    //always returns in px
-+    return parseInt(window.getComputedStyle(elm, null)
-+        .getPropertyValue(property));
-+}
-+
-+/**
-+ * This is a JS function to convert yioop wiki markup to
-+ * html.
-+ * @param {String} wiki_text tobe parsed as HTML
-+ * @returns {String} parsed html
-+ */
-+function parseWikiContent(wiki_text, group_id, page_id)
-+{
-+    var html = wiki_text;
-+
-+    /* note that line breaks from a text area are sent
-+    as \r\n , so make sure we clean them up to replace
-+    all \r\n with \n */
-+    html = html.replace(/\r\n/g, "\n");
-+
-+    html = parseLists(html);
-+
-+    //Regex replace normal links
-+    html = html.replace(/[^\[](http[^\[\s]*)/g, function (m, l) {
-+    // normal link
-+        return '<a href="' + l + '">' + l + '</a>';
-+    });
-+
-+    //Regex replace for external links
-+    html = html.replace(/[\[](http.*)[!\]]/g, function (m, l) {
-+    // external link
-+        var p = l.replace(/[\[\]]/g, '').split(/ /);
-+        var link = p.shift();
-+        return '<a href="' + link + '">'
-+        + (p.length ? p.join(' ') : link) + '</a>';
-+    });
-+
-+    //Regex replace for headings
-+    html = html.replace(/(?:^|\n)([=]+)(.*)\1/g,
-+            function (match, contents, t) {
-+                return '<h'
-+                        + contents.length + '>'
-+                        + t
-+                        + '</h'
-+                        + contents.length
-+                        + '>';
-+            });
-+
-+    //Regex replace for Bold characters
-+    html = html.replace(/'''(.*?)'''/g, function (match, contents) {
-+        return '<b>' + contents + '</b>';
-+    });
-+
-+    //Regex replace for Italic characters
-+    html = html.replace(/''(.*?)''/g, function (match, contents) {
-+        return '<i>' + contents + '</i>';
-+    });
-+
-+    //Regex for resource extraction.
-+    html = html.replace(/{{resource:(.+?)\|(.+?)}}/g,
-+            function (match, contents, desc) {
-+                return '<img src="' + "?c=resource&a=get&f=resources&g="
-+                + group_id
-+                + "&p=" + page_id
-+                + "&n=" + contents + '" alt="' + desc
-+                + '" class="wiki-resource-image"/>';
-+            });
-+
-+    //Regex replace for HR
-+    html = html.replace(/----(.*?)/g, function (match, contents) {
-+        return '<hr>' + contents + '</hr>';
-+    });
-+
-+    //replace nowiki with pre tags
-+    html = html.replace(/<nowiki>(.*?)<\/nowiki>/g, function(match, contents) {
-+        return '<pre>' + contents + '</pre>';
-+    });
-+
-+    //Regex replace for blocks
-+    html = html.replace(/(?:^|\n+)([^# =\*<].+)(?:\n+|$)/gm,
-+            function (match, contents) {
-+                if (contents.match(/^\^+$/))
-+                    return contents;
-+                return "\n<div>" + contents + "</div>\n";
-+            });
-+
-+    return html;
-+}
-+
-+/**
-+ * Lists need to be recursively parsed. So the below function is used
-+ * to recursively convert wiki markup to html.
-+ * @param {String} str
-+ * @returns {String}
-+ */
-+function parseLists(str)
-+{
-+    return str.replace(/(?:(?:(?:^|\n)[\*#].*)+)/g, function (match) {
-+        var listType = match.match(/(^|\n)#/) ? 'ol' : 'ul';
-+        match = match.replace(/(^|\n)[\*#][ ]{0,1}/g, "$1");
-+        match = parseLists(match);
-+        return '<'
-+                + listType + '><li>'
-+                + match.replace(/^\n/, '')
-+                .split(/\n/).join('</li><li>')
-+                + '</li></' + listType
-+                + '>';
-+    });
-+}
-+
-+/**
-+ * get does a GET HTTP call on the url passed.
-+ * Also fires the callback functions passed as
-+ * params appropriately.
-+ *
-+ * @param {String} url
-+ * @param {String} response_type
-+ * @param {function} success_call_back
-+ * @param {function} error_handler
-+ */
-+var get = function (url, response_type, success_call_back, error_handler)
-+{
-+    var request = makeRequest();
-+    request.open('GET', url, true);
-+    request.responseType = response_type;
-+    request.onload = function () {
-+        var status = request.status;
-+        if (status == 200) {
-+            success_call_back && success_call_back(request.response);
-+        } else {
-+            error_handler && error_handler(status);
-+        }
-+    };
-+    request.send();
-+};
-+
-+/**
-+ * takes in the help point id, uses it to fetch wiki content, then
-+ * wiki content is being eval'd to be painted int he help pane.
-+ * Ajax call happens only if help needs to be displayed.
-+ * @param {object} help_point element
-+ * @param {String} is_mobile flag to check if the client is mobile
-+ * or not.
-+ */
-+function displayHelpForId(help_point,
-+                is_mobile,target_c,csrf_token_key,csrf_token_value)
-+{
-+    var help_group_id = 7;
-+    var c = 'api';
-+    var a = "wiki";
-+    var arg = "read";
-+
-+    if ((elt("help-frame").style.display) === "block") {
-+        toggleHelp('help-frame', is_mobile,target_c);
-+        return;
-+    }
-+    get("?c=" + c + "&group_id=" + help_group_id + "&" +
-+            "arg=" + arg + "&" +
-+            "a=" + a + "&" +
-+            csrf_token_key +'=' + csrf_token_value + "&" +
-+            "page_name=" + help_point.getAttribute("data-pagename"),
-+            'json',
-+            function (data) {
-+                elt("help-frame-body").innerHTML = parseWikiContent(
-+                        data.wiki_content,
-+                        data.group_id,
-+                        data.page_id
-+                        );
-+                elt('page_name').innerHTML = data.page_name + ' <a href="'+
-+                        getEditLink(
-+                        target_c,
-+                        csrf_token_key,
-+                        csrf_token_value,
-+                        help_group_id,
-+                        data.page_name) +'">'+
-+                        '[Edit]</a>' ;
-+
-+                toggleHelp('help-frame', is_mobile,target_c);
-+            },
-+            function (status) {
-+                toggleHelp('help-frame', is_mobile,target_c);
-+            });
-+    event.preventDefault();
-+}
-+
-+/**
-+ * Simple function to construct the Wiki Edit hyperlink with passed in params.
-+ * @param {type} target_c
-+ * @param {type} csrf_token
-+ * @param {type} group_id
-+ * @param {type} page_name
-+ * @returns {String}
-+ */
-+function getEditLink(target_c,
-+                csrf_token_key, csrf_token_value, group_id, page_name)
-+{
-+    return '?c=' + target_c +
-+            '&'+ csrf_token_key +'=' + csrf_token_value +
-+            '&group_id=' + group_id +
-+            '&arg=edit' +
-+            '&a=wiki' +
-+            '&page_name=' + page_name;
-+}
-+
-+
-+/**
-+ * this function grabs the contents of the wiki text area,
-+ * converts them into html then populates the preview
-+ * div with parsed html contents. It takes in a page id and group id that are
-+ * required to render image urls, If any exist.
-+ * @param {type} page_id
-+ * @param {type} group_id
-+ */
-+function renderPreview(page_id, group_id)
-+{
-+    if (event.preventDefault)
-+        event.preventDefault();
-+    event.returnValue = false;
-+    var textArea = document.getElementById('wiki-page');
-+    var div = document.getElementById('wiki-preview');
-+    div.innerHTML = "<hr>"
-+            + "<p>"
-+            + parseWikiContent(
-+            textArea.value,
-+            group_id,
-+            page_id) + "</p> <hr>";
-+}
-\ No newline at end of file
-diff --git a/views/admin_view.php b/views/admin_view.php
-index ddec49e..e3044d8 100755
---- a/views/admin_view.php
-+++ b/views/admin_view.php
-@@ -75,6 +75,7 @@ class AdminView extends View
-         if(!MOBILE) {e(' ['.$data['CURRENT_ACTIVITY'].']');}?></span></h1>
-         <?php
-         $this->element("activity")->render($data);
-+        $this->element("help")->render($data);
-         if(isset($data['ELEMENT'])) {
-             $element = $data['ELEMENT'];
-             $this->element($element)->render($data);
-diff --git a/views/api_view.php b/views/api_view.php
-new file mode 100644
-index 0000000..07ebb8b
---- /dev/null
-+++ b/views/api_view.php
-@@ -0,0 +1,61 @@
-+<?php
-+/**
-+ * SeekQuarry/Yioop --
-+ * Open Source Pure PHP Search Engine, Crawler, and Indexer
-+ *
-+ * Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
-+ *
-+ * LICENSE:
-+ *
-+ * This program is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ *
-+ * END LICENSE
-+ *
-+ * @author Eswara Rajesh Pinapala epinapala@live.com
-+ * @package seek_quarry
-+ * @subpackage view
-+ * @license http://www.gnu.org/licenses/ GPL3
-+ * @link http://www.seekquarry.com/
-+ * @copyright 2009 - 2014
-+ * @filesource
-+ */
-+if(!defined('BASE_DIR')) {echo "BAD REQUEST"; exit();}
-+/**
-+ * View used to draw and allow editing of wiki page when not in the admin view
-+ * (so activities panel on side is not present.) This is also used to draw
-+ * wiki pages for public groups when not logged.
-+ *
-+ * @author Eswara Rajesh Pinapala
-+ * @package seek_quarry
-+ * @subpackage view
-+ */
-+class ApiView extends View
-+{
-+    /** This view is drawn on a web layout
-+     * @var string
-+     */
-+    var $layout = "api";
-+
-+    /**
-+     * Draws a minimal container with a WikiElement in it on which a group
-+     * wiki page can be drawn
-+     *
-+     * @param array $data with fields used for drawing the container and page
-+     */
-+    function renderView($data)
-+    {
-+        $this->element("api")->render($data);
-+    }
-+}
-+?>
-diff --git a/views/elements/api_element.php b/views/elements/api_element.php
-new file mode 100644
-index 0000000..59e9920
---- /dev/null
-+++ b/views/elements/api_element.php
-@@ -0,0 +1,108 @@
-+<?php
-+
-+/**
-+ * SeekQuarry/Yioop --
-+ * Open Source Pure PHP Search Engine, Crawler, and Indexer
-+ *
-+ * Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
-+ *
-+ * LICENSE:
-+ *
-+ * This program is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation, either version 3 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ *
-+ * END LICENSE
-+ *
-+ * @author Eswara Rajesh Pinapala epinapala@live.com
-+ * @package seek_quarry
-+ * @subpackage view
-+ * @license http://www.gnu.org/licenses/ GPL3
-+ * @link http://www.seekquarry.com/
-+ * @copyright 2009 - 2014
-+ * @filesource
-+ */
-+if (!defined('BASE_DIR')) {
-+    echo "BAD REQUEST";
-+    exit();
-+}
-+/** Loads common constants for web crawling */
-+require_once BASE_DIR . "/lib/crawl_constants.php";
-+
-+/**
-+ * Element responsible for drawing wiki pages in either admin or wiki view
-+ * It is also responsible for rendering wiki history pages, and listings of
-+ * wiki pages available for a group
-+ *
-+ * @author Eswara Rajesh Pinapala
-+ * @package seek_quarry
-+ * @subpackage element
-+ */
-+class ApiElement extends Element implements CrawlConstants {
-+
-+    /**
-+     * Draw a wiki page for group, or, depending on $data['MODE'] a listing
-+     * of all pages for a group, or the history of revisions of a given page
-+     * or the edit page form
-+     *
-+     * @param array $data fields contain data about the page being
-+     * displayeed or edited, or the list of pages being displayed.
-+     */
-+    function render($data) {
-+        $logged_in = isset($data["ADMIN"]) && $data["ADMIN"];
-+        $can_edit = $logged_in && isset($data["CAN_EDIT"]) && $data["CAN_EDIT"];
-+        $this->renderJsonDocument($data, $can_edit, $logged_in);
-+    }
-+
-+    /**
-+     * Used to send a Wiki content response for reading. If the page does
-+     * not exist various create/login-to-create etc messages are displayed
-+     * depending of it the user is logged in. and has write permissions
-+     * on the group.
-+     * @param array $data fields PAGE used for page contents
-+     * @param bool $can_edit whether the current user has permissions to
-+     *     edit or create this page
-+     * @param bool $logged_in whethe current user is logged in or not
-+     */
-+    function renderJsonDocument($data, $can_edit, $logged_in) {
-+        $out_array = array();
-+        if ($data["PAGE"]) {
-+            $out_array["wiki_content"] = html_entity_decode($data['PAGE'],
-+                    ENT_QUOTES);
-+            $out_array['group_id'] = $data['GROUP']['GROUP_ID'];
-+            $out_array['group_name'] = $data['GROUP']['GROUP_NAME'];
-+            $out_array['page_id'] = $data['PAGE_ID'];
-+            $out_array['page_name'] = $data['PAGE_NAME'];
-+            $http_code = 200;
-+        } else if (!$logged_in) {
-+            $out_array["logged_in"] = false;
-+            $http_code = 401;
-+        }
-+        if ($can_edit) {
-+            $out_array["can_edit"] = true;
-+        }
-+
-+        if (isset($data['errors']) && count($data['errors']) > 0) {
-+            $out_array['errors'] = json_encode(
-+                    array_map(
-+                            function($string) {
-+                        return html_entity_decode($string, ENT_QUOTES);
-+                    }, $data['errors']));
-+        }
-+
-+        header("Content-Type: application/json");
-+        http_response_code($http_code);
-+        e(json_encode($out_array));
-+        exit();
-+    }
-+
-+}
-diff --git a/views/elements/element.php b/views/elements/element.php
-index 046ed54..3910c02 100755
---- a/views/elements/element.php
-+++ b/views/elements/element.php
-@@ -67,5 +67,27 @@ abstract class Element
-      * that should be used in drawing the view
-      */
-     public abstract function render($data);
-+
-+    /**
-+     * This method is used to render the help button,
-+     * given a help point  csrf token and target controller name.
-+     *
-+     * @param  $help_point_id - used to set as help button id
-+     * @param  $csrf_token_value - csrf token to make api call/open edit link
-+     * @param  $target_c - target controller to remember the view.
-+     * @return String button html.
-+     */
-+    public function renderHelpButton($help_point_id,
-+            $csrf_token_value, $target_c) {
-+        $is_mobile = MOBILE ? "true" : "false";
-+        return '<button type="button"
-+                    href=""
-+                    onclick="javascript:displayHelpForId(this,'
-+                . $is_mobile . ',\'' . $target_c . '\',\''. CSRF_TOKEN .'\',\''
-+                . $csrf_token_value . '\')" '
-+                . 'data-pagename="' . $help_point_id . '">?</button>';
-+    }
-+
- }
-+
- ?>
-diff --git a/views/elements/groupfeed_element.php b/views/elements/groupfeed_element.php
-index b910273..d66c792 100644
---- a/views/elements/groupfeed_element.php
-+++ b/views/elements/groupfeed_element.php
-@@ -77,7 +77,11 @@ class GroupfeedElement extends Element implements CrawlConstants
-         if(!$is_status) { 
-             if($is_admin || $logged_in) { ?>
-                 <div class="float-same admin-collapse">[<a
--                href="<?php e($other_paging_query) ?>" ><?php
-+                href="<?php e($other_paging_query);
-+                if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
-+                    e("&amp;v=grouped");
-+                }
-+                ?>" ><?php
-                 e($arrows); ?></a>]<?php
-                 if(isset($data['SUBSCRIBE_LINK'])) {
-                     if($data['SUBSCRIBE_LINK'] == PUBLIC_JOIN) {
-@@ -101,7 +105,7 @@ class GroupfeedElement extends Element implements CrawlConstants
-                 }?> >
-         <?php
-         }
--        if($data['SUBTITLE'] != "" && $logged_in) { ?>
-+        if(isset($data['SUBTITLE']) && $data['SUBTITLE'] != "" && $logged_in) { ?>
-             <div class="float-opposite">
-             <?php
-             if(isset($data["WIKI_PAGE_NAME"])) { ?>
-@@ -115,11 +119,16 @@ class GroupfeedElement extends Element implements CrawlConstants
-             <?php } ?>
-             </div>
-         <?php
-+        }else if(isset($data['MODE']) && $data['MODE'] == 'grouped'
-+                && isset ($data['JUST_GROUP_ID'])){
-+            ?><div class="float-opposite"><a href="<?php
-+                        e($base_query . "&amp;v=grouped")  ?>"><?php
-+                        e(tl('groupfeed_element_back'))?></a></div><?php
-         }
-         if($is_admin) {
-             ?>
-             <h2><?php
--            if($data['SUBTITLE'] == "") {
-+            if(!isset($data['SUBTITLE']) || $data['SUBTITLE'] == "") {
-                 e(tl('groupfeed_element_recent_activity'));
-             } else {
-                 if(isset($data['JUST_THREAD'])) {
-@@ -152,18 +161,81 @@ class GroupfeedElement extends Element implements CrawlConstants
-                     e(tl('groupfeed_element_user',
-                         $data['PAGES'][0]["USER_NAME"]));
-                 } else {
--                    e("[{$data['SUBTITLE']}]");
-+                    if(isset($data['SUBTITLE'])) e("[{$data['SUBTITLE']}]");
-                 }
-             }
-             ?>
--            </h2>
-             <?php
-         }
--        ?>
-+        if(!isset($data['JUST_THREAD']) && !isset($data['JUST_GROUP_ID'])){
-+            e("<a href=\"" . $paging_query . "\">"
-+                    . "<img src=\"resources/list.png\" /></a>" . "  " );
-+            e("<a href=\"" . $paging_query . "&amp;v=grouped\">"
-+                    . "<img src=\"resources/grouped.png\" /></a>". " " );
-+            }
-+        ?></h2>
-         <div>
-         &nbsp;
-         </div>
-         <?php
-+      if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
-+        //Grouped View
-+        //var_dump($data['GROUPS']);
-+        if (isset($data['JUST_GROUP_ID'])) {
-+                foreach ($data['GROUPS'] as $group) {
-+                    if($group['GROUP_ID'] == $data['JUST_GROUP_ID']){
-+                    e("<div class=\"access-result\">" .
-+                            "<div><b>" .
-+                            "<a href=\"$paging_query&amp;just_group_id=" .
-+                            $group['GROUP_ID'] . "&amp;v=grouped" . "\" " .
-+                            "rel=\"nofollow\">" .
-+                            $group['GROUP_NAME'] . "</a> " .
-+                            "[<a href=\"$paging_query&amp;group_id=" .
-+                            $group['GROUP_ID'] . "&amp;a=wiki\">" .
-+                            tl('manageaccount_element_group_wiki') . "</a>] " .
-+                            "(" . tl('manageaccount_element_group_stats',
-+                                    $group['NUM_POSTS'],
-+                                    $group['NUM_THREADS']) . ")</b>" .
-+                            "</div>" .
-+                            "<div class=\"slight-pad\">" .
-+                            "<b>" . tl('manageaccount_element_last_post')
-+                            . "</b> " .
-+                            "<a href=\"$paging_query&amp;just_thread=" .
-+                            $group['THREAD_ID'] . "\">" .
-+                            $group['ITEM_TITLE'] . "</a>" .
-+                            "</div>" .
-+                            "</div>");
-+                    $data['TOTAL_ROWS'] = 1;
-+                    }
-+                }
-+            } else {
-+                foreach ($data['GROUPS'] as $group) {
-+                    e("<div class=\"access-result\">" .
-+                            "<div><b>" .
-+                            "<a href=\"$paging_query&amp;just_group_id=" .
-+                            $group['GROUP_ID'] . "&amp;v=grouped" . "\" " .
-+                            "rel=\"nofollow\">" .
-+                            $group['GROUP_NAME'] . "</a> " .
-+                            "[<a href=\"$paging_query&amp;group_id=" .
-+                            $group['GROUP_ID'] . "&amp;a=wiki\">" .
-+                            tl('manageaccount_element_group_wiki') . "</a>] " .
-+                            "(" . tl('manageaccount_element_group_stats',
-+                                    $group['NUM_POSTS'],
-+                                    $group['NUM_THREADS']) . ")</b>" .
-+                            "</div>" .
-+                            "<div class=\"slight-pad\">" .
-+                            "<b>" . tl('manageaccount_element_last_post')
-+                            . "</b> " .
-+                            "<a href=\"$paging_query&amp;just_thread=" .
-+                            $group['THREAD_ID'] . "\">" .
-+                            $group['ITEM_TITLE'] . "</a>" .
-+                            "</div>" .
-+                            "</div>");
-+                    $data['TOTAL_ROWS'] = $data['NUM_GROUPS'];
-+                }
-+            }
-+        $paging_query .= "&amp;v=grouped";
-+       }else{
-         $open_in_tabs = $data['OPEN_IN_TABS'];
-         $time = time();
-         $can_comment = array(GROUP_READ_COMMENT, GROUP_READ_WRITE,
-@@ -375,6 +447,7 @@ class GroupfeedElement extends Element implements CrawlConstants
-             </div>
-             <?php
-             } //end foreach
-+       }//No grouped View
-             $data['FRAGMENT'] = "";
-             if(isset($data['JUST_THREAD']) && $logged_in) {
-                 $data['FRAGMENT'] = '#result-'.$page['ID'];
-@@ -397,6 +470,7 @@ class GroupfeedElement extends Element implements CrawlConstants
-         if(!$is_status) {
-             $this->renderScripts($data);
-         }
-+
-     }
-     /**
-      * Used to render the Javascript that appears at the non-status updating
-@@ -462,7 +536,8 @@ class GroupfeedElement extends Element implements CrawlConstants
-                     ?></label></b></h2>'+
-                     '<textarea class="short-text-area" '+
-                     'id="comment-'+ id +'" name="description" '+
--                    'data-buttons="all,!wikibtn-search,!wikibtn-heading,!wikibtn-slide" '+
-+                    'data-buttons="all,!wikibtn-search,!wikibtn-heading,'+
-+                    '!wikibtn-slide" '+
-                     '></textarea>' +
-                     '<button class="button-box float-opposite" ' +
-                     'type="submit"><?php e(tl("groupfeed_element_save"));
-@@ -603,4 +678,4 @@ class GroupfeedElement extends Element implements CrawlConstants
-         <?php
-     }
- }
-- ?>
-+?>
-\ No newline at end of file
-diff --git a/views/elements/help_element.php b/views/elements/help_element.php
-new file mode 100644
-index 0000000..8a54055
---- /dev/null
-+++ b/views/elements/help_element.php
-@@ -0,0 +1,100 @@
-+<?php
-+/*
-+ *  SeekQuarry/Yioop --
-+ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
-+ *
-+ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
-+ *
-+ *  LICENSE:
-+ *
-+ *  This program is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ *
-+ *  END LICENSE
-+ *
-+ *  @author Eswara Rajesh Pinapala epinapala@live.com
-+ *  @package seek_quarry
-+ *  @subpackage element
-+ *  @license http://www.gnu.org/licenses/ GPL3
-+ *  @link http://www.seekquarry.com/
-+ *  @copyright 2009 - 2014
-+ *  @filesource
-+ */
-+if (!defined('BASE_DIR')) {
-+    echo "BAD REQUEST";
-+    exit();
-+}
-+
-+/**
-+ * This element is used to display the list of available activities
-+ * in the AdminView
-+ *
-+ * @author Eswara Rajesh Pinapala
-+ *
-+ * @package seek_quarry
-+ * @subpackage element
-+ */
-+class HelpElement extends Element {
-+
-+    /**
-+     * Displays a list of admin activities
-+     *
-+     * @param array $data  available activities and CSRF token
-+     */
-+    function render($data) {
-+        ?>
-+        <?php
-+            if (MOBILE) { ?>
-+                <div id="mobile-help">
-+                    <div id="help-frame" class="frame help-pane">
-+                        <div id="help-frame-head">
-+                            <h2 id="page_name"></h2>
-+                        </div>
-+
-+                        <div id="help-frame-body" class="wordwrap">
-+
-+                        </div>
-+                        <div id="help-frame-editor" class="wordwrap">
-+
-+                        </div>
-+                    </div>
-+                </div>
-+            <?php } else {
-+                if($data['c'] != 'admin'){
-+                    $help_class_add = "small-margin-help-pane";
-+                    $help_id ="small-margin-help";
-+                }else{
-+                    $help_id = "help";
-+                }
-+                ?>
-+                <div id="<?php e($help_id); ?>">
-+                  <div id="help-frame" class="frame help-pane <?php
-+                  e($help_class_add); ?>">
-+                      <div id="help-frame-head">
-+                          <h2 id="page_name"></h2>
-+                      </div>
-+
-+                    <div id="help-frame-body" class="wordwrap">
-+
-+                    </div>
-+                    <div id="help-frame-editor" class="wordwrap">
-+
-+                    </div>
-+                  </div>
-+                </div>
-+                <?php
-+            }
-+    }
-+
-+}
-+?>
-\ No newline at end of file
-diff --git a/views/elements/managegroups_element.php b/views/elements/managegroups_element.php
-index fa06f58..b1e1df8 100755
---- a/views/elements/managegroups_element.php
-+++ b/views/elements/managegroups_element.php
-@@ -93,6 +93,7 @@ class ManagegroupsElement extends Element
-         <?php
-             $group_url = "?c=admin&amp;".CSRF_TOKEN."=".$data[CSRF_TOKEN];
-             $base_url = $group_url . "&amp;a=manageGroups";
-+            $wiki_url = $group_url . "&amp;a=wiki&amp;group_id=";
-             $group_url .= "&amp;a=groupFeeds&amp;just_group_id=";
-             if(isset($data['browse'])) {
-                 $base_url .= "&amp;browse=".$data['browse'];
-@@ -199,7 +200,15 @@ class ManagegroupsElement extends Element
-                         ($group['MEMBER_ACCESS'] != GROUP_PRIVATE ||
-                         $group["OWNER_ID"] == $_SESSION['USER_ID'])) {
-                         e("<td><a href='".$group_url.$group['GROUP_ID']."' >".
--                            $group_column."</a></td>");
-+                            $group_column."</a>".
-+                                " <a href=\""
-+                                . $wiki_url. $group['GROUP_ID']
-+                                ."\">"
-+                                ."["
-+                                . (tl('manageaccount_element_group_wiki'))
-+                                ."]"
-+                                . "</a>"
-+                                ."</td>");
-                     } else {
-                         e("<td>$group_column</td>");
-                     }
-@@ -317,7 +326,11 @@ class ManagegroupsElement extends Element
-                 ?> /></td><?php
-                 if($addgroup) { ?>
-                     <td>[<a href="<?php e($browse_url); ?>"><?php 
--                        e(tl('managegroups_element_browse')); ?></a>]</td>
-+                        e(tl('managegroups_element_browse')); ?></a>]
-+                    <?php
-+                    e($this->renderHelpButton("browse_url", $data[CSRF_TOKEN],
-+                            $_REQUEST['c']));
-+                    ?></td>
-                 <?php
-                 }
-         ?></tr>
-@@ -385,11 +398,11 @@ class ManagegroupsElement extends Element
-                         if($data['CURRENT_GROUP']['owner'] ==
-                             $user_array['USER_NAME']) {
-                             e("<td>".
--                                $data['MEMBERSHIP_CODES'][$user_array['STATUS']] .
-+                            $data['MEMBERSHIP_CODES'][$user_array['STATUS']] .
-                                 "</td>");
-                             e("<td>" . tl('managegroups_element_groupowner') .
-                                 "</td><td><span class='gray'>".
--                                tl('managegroups_element_delete')."</span></td>");
-+                            tl('managegroups_element_delete')."</span></td>");
-                         } else {
-                             e("<td>".$data['MEMBERSHIP_CODES'][
-                                 $user_array['STATUS']]);
-diff --git a/views/elements/wiki_element.php b/views/elements/wiki_element.php
-index d157de9..15e5e53 100644
---- a/views/elements/wiki_element.php
-+++ b/views/elements/wiki_element.php
-@@ -391,8 +391,17 @@ class WikiElement extends Element implements CrawlConstants
-             <div id="save-container" class="top-margin center">
-             <button class="button-box" type="submit"><?php
-                 e(tl('wiki_element_savebutton')); ?></button>
-+            <button id="wiki-preview-btn"
-+                    onclick="javascript:renderPreview('<?php
-+                        e($data["PAGE_ID"] . "','"
-+                      . $data['GROUP']['GROUP_ID']);
-+            ?>')" class="button-box"><?php
-+                e(tl('wiki_element_previewbutton')); ?></button>
-             </div>
-         </form>
-+        <div id="wiki-preview">
-+
-+        </div>
-         <div class="top-margin" id="media-list-page">
-         <h2><?php e(tl('wiki_element_media_list'))?></h2>
-         <p><?php e(tl('wiki_element_ml_description'))?></p>
-diff --git a/views/group_view.php b/views/group_view.php
-index a5404ae..cf99488 100644
---- a/views/group_view.php
-+++ b/views/group_view.php
-@@ -114,6 +114,7 @@ class GroupView extends View implements CrawlConstants
-             $element = $data['ELEMENT'];
-             $this->element($element)->render($data);
-         }
-+        $this->element("help")->render($data);
-         if(PROFILE) {
-         ?>
-         <script type="text/javascript">
-diff --git a/views/layouts/api_layout.php b/views/layouts/api_layout.php
-new file mode 100644
-index 0000000..557bb37
---- /dev/null
-+++ b/views/layouts/api_layout.php
-@@ -0,0 +1,63 @@
-+<?php
-+
-+/*
-+ *  SeekQuarry/Yioop --
-+ *  Open Source Pure PHP Search Engine, Crawler, and Indexer
-+ *
-+ *  Copyright (C) 2009 - 2014  Chris Pollett chris@pollett.org
-+ *
-+ *  LICENSE:
-+ *
-+ *  This program is free software: you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation, either version 3 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-+ *
-+ *  END LICENSE
-+ *
-+ *  @author Eswara Rajesh Pinapala epinapala@live.com
-+ *  @package seek_quarry
-+ *  @subpackage element
-+ *  @license http://www.gnu.org/licenses/ GPL3
-+ *  @link http://www.seekquarry.com/
-+ *  @copyright 2009 - 2014
-+ *  @filesource
-+ */
-+
-+if (!defined('BASE_DIR')) {
-+    echo "BAD REQUEST";
-+    exit();
-+}
-+
-+/**
-+ * Layout used for the seek_quarry Website
-+ * including pages such as search landing page
-+ * and settings page
-+ *
-+ * @author Eswara Rajesh Pinapala
-+ * @package seek_quarry
-+ * @subpackage layout
-+ */
-+class ApiLayout extends Layout {
-+
-+    /**
-+     * Responsible for drawing the prefix/suffix (if any for the API response)
-+     *
-+     * @param array $data  an array of data set up by the controller to be
-+     * be used in drawing the WebLayout and its View.
-+     */
-+    function render($data) {
-+        $this->view->renderView($data);
-+    }
-+
-+}
-+
-+?>
--- 
-1.9.3 (Apple Git-50)
-
-
-From d0a5d786c8bce14fa61e926614ae74606d8c4f6c Mon Sep 17 00:00:00 2001
-From: epinapala <epinapala@ebay.com>
-Date: Fri, 17 Oct 2014 00:09:52 -0700
-Subject: [PATCH 2/4]  Adding binary files(icons)
-
----
- resources/grouped.png | Bin 0 -> 3358 bytes
- resources/list.png    | Bin 0 -> 3453 bytes
- 2 files changed, 0 insertions(+), 0 deletions(-)
- create mode 100644 resources/grouped.png
- create mode 100644 resources/list.png
-
-diff --git a/resources/grouped.png b/resources/grouped.png
-new file mode 100644
-index 0000000000000000000000000000000000000000..ba7ceed2b8d88732bcc90fe783b44eb63bf1faac
-GIT binary patch
-literal 3358
-zcmZ`+2{@Ep|9(vNon%W)Q$&`*SSM7*GBWlpOIgRxXv}0ATSQs2G}eqnBD|518nTXL
-z&uhz`EkYq#!hiI>-}`<4@4CKoUFSUKxzByyzw`T@>pIu-+&4DVWn&g(1^|Ff52<BJ
-zeS(iWBRzHW4-Vb}0A?)@1j1MkfdCt0F|HooXaGR6Jt78}^9=J*rn<bL)i;O`^cQk1
-zU7-va`B04c!x~86dI-(;LRpIr5_gZ$^1QgyJ9lwz$%5;QjJ#iIm>}0!b+}GF>}nVK
-z@$=G!-2=l(kpPX&(4Tn$i<A330)RNpS&$=p8E~b>7?QO0)3v?rg6wxPK(7^XLJ9Dz
-zdtJ~c-sm1tam8K<#)nV+ZqEXm{vjP<160`3M#HkgzZ|V2QY5+cfr#dQ;F9p=jCkzX
-zPU~In6ckA-D=$^Tng5)#TsF9~RNipEbs>C@;AAAQS#?)!P?z}fUPgD?Exyjvn}vk*
-z6wdVc4ccFXbWDC3Nwk|c{}(+vSc#Oz0>nT*iV}R`okQYgt^Fz9>5HH%`Guiv684qR
-z_7MwAz$M*kEh(gahHT<%G1O@{H(po-iPV;XlxkKTM<r!aTozs8RhmTs!k()&k8$ds
-z#QVIX{q3Xu{mnz%(npIwl5<GpLjf1^!Q6NG+1|XX33<@5j1j1fp)^n?QLSX#;4X2A
-z#@&`9VtE3ZeW(G<vCz1$?k|V%R|V;1Ahl#HEq8Z!i6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YjDBANx8wVemM02;?}>Kkcu5;yhgc9m&`K@3g21LXTIVax${ef4r$u
-zwPO^H!1(xK(f<Bae+@ac-^~Aq{X5QId}DVE4nwU1*27uP7l+1D#W=^~-D$}Gt^VJP
-z|MoJ%dZ4LU|5pDi_J3l3^VOioiT_6-{;KkClv-vDW;N(PN2bB7imUOYo+3$4>#F&6
-zrd7)(t_U#e$zFrOME*2`L8d|L!NZ6rMV(JHnsrO03-zXP6R;XIdC5aAcYa~e57Uo-
-zTdW#!Rwu17c{4p$qqp}!d?*fh)*NClHAs(ObXsl{1uwl~Z{6k*(PmPa;8`g((*k54
-zXH#OdOh7h#V%`qQ67z=U7NGHHS;yJJ7$#Ilij{hd>{;E3Pb#PmIr@{?N5m8F*rHt2
-WL>blJQ~z!NKu_CHt3uP^&i?@gVG<(%
-
-literal 0
-HcmV?d00001
-
-diff --git a/resources/list.png b/resources/list.png
-new file mode 100644
-index 0000000000000000000000000000000000000000..fc873811b5a1e40f26623409435585a95125c5ea
-GIT binary patch
-literal 3453
-zcmZ`*2Q-^s9}cxQRjWoCrL>LMBSH})h`nmmj!lTD6{}Wj)~H=krNjEyC^}+CR8dr|
-z+O=x7s2asb|Kl6yeD|Dt-}^rId7j_>{q8;QdG8tOYcbOC&;bAdMs0+;@#zzI)@i6t
-zNB@wJ9RPq%-5m}$)P}=>h8VPqyB7)oKrlYc3N&RO;UrD>ctPrJWr0v%2@RAbVg$qk
-zVY>Gl<hqu_D9#sh>Xe{_yENvPMI2k)MA)ts-=v}8SR<na=`d)rUU<;c$@}A{;+6d)
-z{V9P!<?XPag@H>`hke`t5wc6<4onpQm3l)^%Fa)hPU02u?*ssqdgM7-fN$fg;(n24
-zx5z3LJ6S2tfb{Qn^yD)?z>!vfDr<@usoaRKC!6rJYizoJ$hHB1BL9u-M9igb%YC*q
-zBwjtYFkRG%OVCLo57=EMsejn97;%7eG~nK@iG>YmW!2uz?#=My?7p~Ng3C-}$xPg$
-z_=U?v7ggYedO3=IQK3R)@f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VIorQjnFj1ne=BKy
-z5tjY{0R8#1P6o&;-~s^1KDnFT#NO0HLY>gwVh+w|N0eBQx9=$%0DuKSPp94}tOGE}
-z+snrv8l(jJ&48ZH&tM1$_?v?DR07@9GX%oX7!*)OOj=AFq)Z0{0$~_u7pSqi=3nyD
-zHzkl87V8UzKmr2;#R8?o&=^;Ugo1(sL|hUgDG5Ghfc=Aguns|BAAi9=P5$;#NBKKp
-z+<md`XdmF2uY)5x0ILK7odx=*{kc!9yUV{L`S|~p)@g!}vlWPhm^kDg?^7x4428nc
-z-o6-=zyGPfvIOim^S`iv$N7_Q=!V9kPpg1&chdI3qA;goti##vlqLUC|9{5+dKqBc
-zQKwn|R{tIQKe4~~FvwZr|51oPtNa^1EweHm4D!#BDbp!n>pf0S@mO13)$}Iqx`j7W
-z8<2s|Ma~G_A@S<n9PLmo(lVH=jFN31!Eo5lWBc{-+blis=2E@)8$K;q!ku!a>T0bH
-zQ0O|#Sggv7e6b))t)d-7VugA&IN~ya$lz9)k@8C03CV=%!6z6ps<zWMUTxvf7Lk#O
-zd>|2`ce$)3x~rGXqx9aa7SNo`IIi0CQ_FinokA83ioLY1#O$7;OG46yCNT<Is#GmW
-zw+D2vFs*hC`2v;xyT4e6h5!byM%2|}_|-RRS;t^KnjJ(_4}T@U<|0<2Ni8dJ-_14b
-z2$GZh>{i<i3y$(g_{j^_G4O^iX?1ieeD)`h5O}$T`N0~eRf9EMxKXCu*@f2D&{wZg
-Hv%m8%?s7l|
-
-literal 0
-HcmV?d00001
-
--- 
-1.9.3 (Apple Git-50)
-
-
-From e434d115601ae930168571c50514936872b89fa0 Mon Sep 17 00:00:00 2001
-From: epinapala <epinapala@ebay.com>
-Date: Fri, 17 Oct 2014 00:16:08 -0700
-Subject: [PATCH 3/4] Make Collapse/expand views for just_group_id more
- seamless
-
----
- views/elements/groupfeed_element.php | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/views/elements/groupfeed_element.php b/views/elements/groupfeed_element.php
-index d66c792..746d357 100644
---- a/views/elements/groupfeed_element.php
-+++ b/views/elements/groupfeed_element.php
-@@ -75,7 +75,12 @@ class GroupfeedElement extends Element implements CrawlConstants
-             $other_paging_query .= "&num=".$data['RESULTS_PER_PAGE'];
-         }
-         if(!$is_status) { 
--            if($is_admin || $logged_in) { ?>
-+            if($is_admin || $logged_in) { 
-+                if(isset($data['JUST_GROUP_ID'])){
-+                    $other_paging_query .= "&amp;just_group_id=" 
-+                            . $data['JUST_GROUP_ID'];
-+                }
-+                ?>
-                 <div class="float-same admin-collapse">[<a
-                 href="<?php e($other_paging_query);
-                 if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
--- 
-1.9.3 (Apple Git-50)
-
-
-From ef03ce3a0aaf68fe3d1fd255c3d5814ea034b982 Mon Sep 17 00:00:00 2001
-From: epinapala <epinapala@ebay.com>
-Date: Fri, 17 Oct 2014 00:19:29 -0700
-Subject: [PATCH 4/4] Restoring .gitignore
-
----
- .gitignore | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/.gitignore b/.gitignore
-index f946ad8..3986446 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -1,4 +1,2 @@
- local_config.php
- .DS_Store
--nbproject/
--/.idea/
--- 
-1.9.3 (Apple Git-50)
-
diff --git a/resources/grouped.png b/resources/grouped.png
new file mode 100644
index 0000000000000000000000000000000000000000..ba7ceed2b8d88732bcc90fe783b44eb63bf1faac
GIT binary patch
diff --git a/resources/list.png b/resources/list.png
new file mode 100644
index 0000000000000000000000000000000000000000..fc873811b5a1e40f26623409435585a95125c5ea
GIT binary patch
diff --git a/views/elements/groupfeed_element.php b/views/elements/groupfeed_element.php
index d66c792..746d357 100644
--- a/views/elements/groupfeed_element.php
+++ b/views/elements/groupfeed_element.php
@@ -75,7 +75,12 @@ class GroupfeedElement extends Element implements CrawlConstants
             $other_paging_query .= "&num=".$data['RESULTS_PER_PAGE'];
         }
         if(!$is_status) { 
-            if($is_admin || $logged_in) { ?>
+            if($is_admin || $logged_in) { 
+                if(isset($data['JUST_GROUP_ID'])){
+                    $other_paging_query .= "&amp;just_group_id=" 
+                            . $data['JUST_GROUP_ID'];
+                }
+                ?>
                 <div class="float-same admin-collapse">[<a
                 href="<?php e($other_paging_query);
                 if(isset($data['MODE']) && $data['MODE'] == 'grouped'){
-- 
1.9.3 (Apple Git-50)

