aboutsummaryrefslogtreecommitdiff
path: root/mod/sitepages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/sitepages')
-rw-r--r--mod/sitepages/actions/add.php53
-rw-r--r--mod/sitepages/actions/addfront.php48
-rw-r--r--mod/sitepages/actions/addfrontsimple.php45
-rw-r--r--mod/sitepages/actions/addmeta.php36
-rw-r--r--mod/sitepages/actions/edit_settings.php50
-rw-r--r--mod/sitepages/sitepages_functions.php15
-rw-r--r--mod/sitepages/start.php22
-rw-r--r--mod/sitepages/views/default/settings/sitepages/edit.php14
-rw-r--r--mod/sitepages/views/default/sitepages/forms/edit.php23
-rw-r--r--mod/sitepages/views/default/sitepages/forms/editfront.php82
-rw-r--r--mod/sitepages/views/default/sitepages/forms/editfrontsimple.php74
-rw-r--r--mod/sitepages/views/default/sitepages/forms/editmeta.php37
-rw-r--r--mod/sitepages/views/default/sitepages/menu.php4
13 files changed, 151 insertions, 352 deletions
diff --git a/mod/sitepages/actions/add.php b/mod/sitepages/actions/add.php
deleted file mode 100644
index bc38d8067..000000000
--- a/mod/sitepages/actions/add.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * Site pages save/edit
- *
- * @package SitePages
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- *
- */
-
-// Make sure we're logged as admin
-admin_gatekeeper();
-
-// Get input data
-$content = get_input('sitepages_content', '', FALSE);
-$page_type = get_input('page_type');
-$tags = get_input('sitepages_tags');
-$tag_array = string_to_tag_array($tags);
-
-// Cache to the session for sticky forms
-// @todo make these work.
-$_SESSION['sitepages_content'] = $content;
-$_SESSION['sitepages_type'] = $type;
-$_SESSION['sitepages_tags'] = $tags;
-
-if (!$sitepage = sitepages_get_sitepage_object($page_type)) {
- $sitepage = sitepages_create_sitepage_object($page_type);
-}
-
-if (empty($content)) {
- register_error(elgg_echo('sitepages:blank'));
-} else {
- $sitepage->title = $type;
- $sitepage->description = $content;
- $sitepage->tags = $tag_array;
-
- if (!$sitepage->save()) {
- register_error(elgg_echo('sitepages:error'));
- } else {
- system_message(elgg_echo('sitepages:posted'));
- // @todo this needs to be accurate for create or update.
- add_to_river('river/sitepages/create', 'create', $_SESSION['user']->guid, $sitepages->guid);
- }
-
- // @todo Good intensions...
- unset($_SESSION['sitepages_content']);
- unset($_SESSION['sitepagestitle']);
- unset($_SESSION['sitepagestags']);
-}
-
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
diff --git a/mod/sitepages/actions/addfront.php b/mod/sitepages/actions/addfront.php
deleted file mode 100644
index 00b04dbcb..000000000
--- a/mod/sitepages/actions/addfront.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- * Site pages front page save/edit
- *
- * @package SitePages
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- *
- */
-
-admin_gatekeeper();
-
-$logged_in_content = get_input('logged_in_content', '', FALSE);
-$logged_out_content = get_input('logged_out_content', '', FALSE);
-
-// do some error checking to make sure you can't lock yourself out of your front page.
-if (FALSE === strpos($logged_out_content, '[loginbox]')) {
- register_error(elgg_echo('sitepages:error:no_login'));
- forward($_SERVER['HTTP_REFERER']);
-}
-
-$css = get_input('css', '', FALSE);
-$loggedin_user_guid = get_loggedin_userid();
-
-// Cache to the session for sticky forms
-// @todo does nothing yet.
-$_SESSION['sitepages:content'] = $content;
-$_SESSION['sitepages:css'] = $css;
-
-if (!$sitepage = sitepages_get_sitepage_object('front')) {
- $sitepage = sitepages_create_sitepage_object('front');
-}
-
-$sitepage->css = $css;
-$sitepage->logged_in_content = $logged_in_content;
-$sitepage->logged_out_content = $logged_out_content;
-
-if ($sitepage->save()) {
- system_message(elgg_echo("sitepages:posted"));
- unset($_SESSION['sitepages:content']);
- unset($_SESSION['sitepages:css']);
-} else {
- register_error(elgg_echo("sitepages:error"));
-}
-
-forward($_SERVER['HTTP_REFERER']);
diff --git a/mod/sitepages/actions/addfrontsimple.php b/mod/sitepages/actions/addfrontsimple.php
deleted file mode 100644
index ee26723e8..000000000
--- a/mod/sitepages/actions/addfrontsimple.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-/**
- * Site pages front page save/edit
- *
- * @package SitePages
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- *
- */
-
-admin_gatekeeper();
-
-$logged_in_content = get_input('logged_in_content', '', FALSE);
-$logged_out_content = get_input('logged_out_content', '', FALSE);
-
-$welcometitle = get_input('welcometitle', '', FALSE);
-$welcomemessage = get_input('welcomemessage', '', FALSE);
-$sidebartitle = get_input('sidebartitle', '', FALSE);
-$sidebarmessage = get_input('sidebarmessage', '', FALSE);
-
-$loggedin_user_guid = get_loggedin_userid();
-
-// Cache to the session for sticky forms
-// @todo does nothing yet.
-$_SESSION['sitepages:content'] = $content;
-$_SESSION['sitepages:css'] = $css;
-
-if (!$sitepagesimple = sitepages_get_sitepage_object('frontsimple')) {
- $sitepagesimple = sitepages_create_sitepage_object('frontsimple');
-}
-
-$sitepagesimple->welcometitle = $welcometitle;
-$sitepagesimple->welcomemessage = $welcomemessage;
-$sitepagesimple->sidebartitle = $sidebartitle;
-$sitepagesimple->sidebarmessage = $sidebarmessage;
-
-if ($sitepagesimple->save()) {
- system_message(elgg_echo("sitepagessimple:posted"));
-} else {
- register_error(elgg_echo("sitepages:error"));
-}
-
-forward($_SERVER['HTTP_REFERER']);
diff --git a/mod/sitepages/actions/addmeta.php b/mod/sitepages/actions/addmeta.php
deleted file mode 100644
index ec72d6339..000000000
--- a/mod/sitepages/actions/addmeta.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * Site pages meta tags and desc page save/edit
- *
- * @package SitePages
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.com/
- *
- */
-
-admin_gatekeeper();
-
-$description = get_input('description', '', FALSE);
-$metatags = get_input('metatags', '', FALSE);
-
-// Cache to the session
-$_SESSION['description'] = $description;
-$_SESSION['metatags'] = $metatags;
-
-if (!$sitepage = sitepages_get_sitepage_object('seo')) {
- $sitepage = sitepages_create_sitepage_object('seo');
-}
-
-$sitepage->title = $metatags;
-$sitepage->description = $description;
-
-if ($sitepage->save()) {
- system_message(elgg_echo("sitepages:seocreated"));
- unset($_SESSION['description']); unset($_SESSION['metatags']);
-} else {
- register_error(elgg_echo("sitepages:error"));
-}
-
-forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
diff --git a/mod/sitepages/actions/edit_settings.php b/mod/sitepages/actions/edit_settings.php
new file mode 100644
index 000000000..d79c38240
--- /dev/null
+++ b/mod/sitepages/actions/edit_settings.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ *
+ */
+
+$page_type = get_input('page_type', 'frontsimple');
+if (!$sitepage = sitepages_get_sitepage_object($page_type)) {
+ $sitepage = sitepages_create_sitepage_object($page_type);
+}
+
+switch ($page_type) {
+ case 'about':
+ case 'terms':
+ case 'privacy':
+ $content = get_input('sitepages_content', '', FALSE);
+ if (empty($content)) {
+ register_error(elgg_echo('sitepages:blank'));
+ forward($_SERVER['HTTP_REFERER']);
+ }
+
+ //$sitepage->title = $page_type;
+ $sitepage->description = $content;
+ $sitepage->tags = string_to_tag_array(get_input('sitepages_tags'));
+
+ break;
+ case 'seo':
+ $sitepage->title = get_input('metatags', '', FALSE);;
+ $sitepage->description = get_input('description', '', FALSE);
+
+ break;
+ case 'frontsimple':
+ default:
+ $params = get_input('params', array());
+ set_plugin_setting('ownfrontpage', $params['ownfrontpage'], 'sitepages');
+
+ $sitepage->welcometitle = get_input('welcometitle', '', FALSE);
+ $sitepage->welcomemessage = get_input('welcomemessage', '', FALSE);
+ $sitepage->sidebartitle = get_input('sidebartitle', '', FALSE);
+ $sitepage->sidebarmessage = get_input('sidebarmessage', '', FALSE);
+
+ break;
+}
+
+if ($sitepage->save()) {
+ system_message(elgg_echo('sitepages:posted'));
+} else {
+ register_error(elgg_echo('sitepages:error'));
+}
+
+forward($_SERVER['HTTP_REFERER']);
diff --git a/mod/sitepages/sitepages_functions.php b/mod/sitepages/sitepages_functions.php
index 5e9a4adc2..72418e81b 100644
--- a/mod/sitepages/sitepages_functions.php
+++ b/mod/sitepages/sitepages_functions.php
@@ -59,10 +59,7 @@ function sitepages_create_sitepage_object($page_type) {
* @param str $section
* @return str html
*/
-function sitepages_get_edit_section_content($page_type) {
- set_context('admin');
-
- $title = elgg_view_title(elgg_echo('sitepages'));
+function sitepages_get_edit_section_content($page_type, $entity=NULL) {
$menu = elgg_view('sitepages/menu', array('page_type' => $page_type));
switch ($page_type) {
@@ -80,11 +77,11 @@ function sitepages_get_edit_section_content($page_type) {
}
- $form .= elgg_view($view, array('page_type' => $page_type));
- $body = $title . $menu . $form;
-
- $content = elgg_view_layout('administration', $body);
- return $content;
+ $form .= elgg_view($view, array(
+ 'page_type' => $page_type,
+ 'entity' => $entity,
+ ));
+ return $menu . $form;
}
/**
diff --git a/mod/sitepages/start.php b/mod/sitepages/start.php
index 180739cca..943688020 100644
--- a/mod/sitepages/start.php
+++ b/mod/sitepages/start.php
@@ -16,7 +16,7 @@
* DRY up actions and views
* Use $entity->view to redirect to url of page.
* The tool settings view is probably not needed as it can be added to the front page edit tab.
- * You can say pg/sitepages/edit|read/any_page_i_want and it will let you.
+ * You can say pg/sitepages/read/any_page_i_want and it will let you.
*/
/**
@@ -50,18 +50,7 @@ function sitepages_init() {
// hook into the walled garden pages
register_plugin_hook('public_pages', 'walled_garden', 'sitepages_public_pages');
- register_action("sitepages/add", FALSE, $CONFIG->pluginspath . "sitepages/actions/add.php");
- register_action("sitepages/addfront", FALSE, $CONFIG->pluginspath . "sitepages/actions/addfront.php");
- register_action("sitepages/addfrontsimple", FALSE, $CONFIG->pluginspath . "sitepages/actions/addfrontsimple.php");
- register_action("sitepages/addmeta", FALSE, $CONFIG->pluginspath . "sitepages/actions/addmeta.php");
- register_action("sitepages/edit", FALSE, $CONFIG->pluginspath . "sitepages/actions/edit.php");
- register_action("sitepages/delete", FALSE, $CONFIG->pluginspath . "sitepages/actions/delete.php");
-
- elgg_add_submenu_item(array(
- 'text' => elgg_echo('sitepages'),
- 'href' => "{$CONFIG->wwwroot}pg/sitepages/edit/front",
- 'parent_id' => 'site',
- ), 'admin', 'default');
+ register_action('settings/sitepages/save', FALSE, "{$CONFIG->pluginspath}sitepages/actions/edit_settings.php");
}
/**
@@ -136,13 +125,6 @@ function sitepages_page_handler($page) {
$page_type = isset($page[1]) ? $page[1] : FALSE;
switch ($action) {
- case 'edit':
- admin_gatekeeper();
- $title = elgg_echo('sitepages');
- $content = sitepages_get_edit_section_content($page_type);
-
- break;
-
case 'read':
$title = elgg_echo('sitepages:' . strtolower($page_type));
$content = sitepages_get_page_content($page_type);
diff --git a/mod/sitepages/views/default/settings/sitepages/edit.php b/mod/sitepages/views/default/settings/sitepages/edit.php
index 8a8a2d271..86cf6760c 100644
--- a/mod/sitepages/views/default/settings/sitepages/edit.php
+++ b/mod/sitepages/views/default/settings/sitepages/edit.php
@@ -8,12 +8,10 @@
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.org/
*/
-?>
-<p>
- <?php echo elgg_echo('sitepages:ownfront'); ?>
- <select name="params[ownfrontpage]">
- <option value="yes" <?php if ($vars['entity']->ownfrontpage == 'yes') echo " selected=\"yes\" "; ?>><?php echo elgg_echo('option:yes'); ?></option>
- <option value="no" <?php if ($vars['entity']->ownfrontpage != 'yes') echo " selected=\"yes\" "; ?>><?php echo elgg_echo('option:no'); ?></option>
- </select>
-</p> \ No newline at end of file
+$page_type = 'front';
+if (isset($vars['page'][2])) {
+ $page_type = $vars['page'][2];
+}
+
+echo sitepages_get_edit_section_content($page_type, $vars['entity']);
diff --git a/mod/sitepages/views/default/sitepages/forms/edit.php b/mod/sitepages/views/default/sitepages/forms/edit.php
index 72fb42ccf..940289dcf 100644
--- a/mod/sitepages/views/default/sitepages/forms/edit.php
+++ b/mod/sitepages/views/default/sitepages/forms/edit.php
@@ -11,7 +11,6 @@
*/
$page_type = $vars['page_type'];
-$action = 'sitepages/add';
if ($sitepages_object = sitepages_get_sitepage_object($page_type)) {
$tags = $sitepages_object->tags;
@@ -24,11 +23,19 @@ if ($sitepages_object = sitepages_get_sitepage_object($page_type)) {
}
// set the required form variables
-$input_area = elgg_view('input/longtext', array('internalname' => 'sitepages_content', 'value' => $description));
-$tag_input = elgg_view('input/tags', array('internalname' => 'sitepages_tags', 'value' => $tags));
-
-$submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
-$hidden_value = elgg_view('input/hidden', array('internalname' => 'page_type', 'value' => $page_type));
+$input_area = elgg_view('input/longtext', array(
+ 'internalname' => 'sitepages_content',
+ 'value' => $description
+));
+$tag_input = elgg_view('input/tags', array(
+ 'internalname' => 'sitepages_tags',
+ 'value' => $tags
+));
+
+$hidden_value = elgg_view('input/hidden', array(
+ 'internalname' => 'page_type',
+ 'value' => $page_type
+));
$tag_label = elgg_echo('tags');
$external_page_title = elgg_echo("sitepages:$page_type");
@@ -42,9 +49,7 @@ $input_area</p></label>
$tag_input</p></label>
$hidden_value
-$hidden_guid
-$submit_input
___EOT;
-echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body)); \ No newline at end of file
+echo $form_body;
diff --git a/mod/sitepages/views/default/sitepages/forms/editfront.php b/mod/sitepages/views/default/sitepages/forms/editfront.php
deleted file mode 100644
index 818bdfd8b..000000000
--- a/mod/sitepages/views/default/sitepages/forms/editfront.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/**
- * Edit form for the custom front page
- *
- * @package SitePages
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.org/
- */
-
-$action = 'sitepages/addfront';
-
-if ($sitepages_object = sitepages_get_sitepage_object('front')) {
- $css = $sitepages_object->css;
- $logged_in_content = $sitepages_object->logged_in_content;
- $logged_out_content = $sitepages_object->logged_out_content;
-} else {
- $css = <<<___EOT
-#elgg_sidebar .entity_listing_info {width:173px;}
-___EOT;
- $logged_in_content = <<<___EOT
-<div id="elgg_content" class="clearfloat sidebar">
- <div id="elgg_sidebar">
- <h3>Newest members:</h3>[userlist list_type=new only_with_avatars=TRUE limit=5]
-</div>
-
-<div id="elgg_page_contents" class="clearfloat">
- <h2>All site activity</h2>
- [activity]
- </div>
-</div>
-___EOT;
- $logged_out_content = <<<___EOT
-<div id="elgg_content" class="clearfloat sidebar">
- <div id="elgg_sidebar">
- [loginbox]
- <h3>Newest members:</h3>[userlist: list_type=new, only_with_avatars=TRUE, limit=5]
-</div>
-
-<div id="elgg_page_contents" class="clearfloat">
- <h2>Welcome to [networkname]</h2><p class="margin_top">Introduction and instructions might go here. Learn about this network, and how to get registered and start adding content.</p>
- <h2>All site activity</h2>
- [activity]
- </div>
-</div>
-___EOT;
-}
-
-// set the required form variables
-$input_css = elgg_view('input/plaintext', array('internalname' => 'css', 'value' => $css, 'class' => 'input_textarea monospace'));
-$input_logged_in_content = elgg_view('input/plaintext', array('internalname' => 'logged_in_content', 'value' => $logged_in_content, 'class' => 'input_textarea monospace'));
-$input_logged_out_content = elgg_view('input/plaintext', array('internalname' => 'logged_out_content', 'value' => $logged_out_content, 'class' => 'input_textarea monospace'));
-$submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
-
-$logged_in_content_title = elgg_echo("sitepages:logged_in_front_content");
-$logged_out_content_title = elgg_echo("sitepages:logged_out_front_content");
-$css_title = elgg_echo("sitepages:css");
-
-//preview link
-// @todo this doesn't do anything.
-//$preview = "<div class=\"page_preview\"><a href=\"#preview\">" . elgg_echo('sitepages:preview') . "</a></div>";
-
-//construct the form
-$form_body = <<<___EOT
-
- <p><label>$css_title
- $input_css</label></p>
-
- <p><label>$logged_in_content_title
- $input_logged_in_content</label></p>
-
- <p><label>$logged_out_content_title
- $input_logged_out_content</label></p>
-
- $hidden_guid
- $submit_input
- $preview
-
-___EOT;
-
-echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body)); \ No newline at end of file
diff --git a/mod/sitepages/views/default/sitepages/forms/editfrontsimple.php b/mod/sitepages/views/default/sitepages/forms/editfrontsimple.php
index 89f4e5673..b1038d982 100644
--- a/mod/sitepages/views/default/sitepages/forms/editfrontsimple.php
+++ b/mod/sitepages/views/default/sitepages/forms/editfrontsimple.php
@@ -9,38 +9,69 @@
* @link http://elgg.org/
*/
-$action = 'sitepages/addfrontsimple';
-
if($sitepages_object = sitepages_get_sitepage_object('frontsimple')){
$welcometitle = $sitepages_object->welcometitle;
$welcomemessage = $sitepages_object->welcomemessage;
$sidebartitle = $sitepages_object->sidebartitle;
$sidebarmessage = $sitepages_object->sidebarmessage;
}else{
- $welcometitle = "";
- $welcomemessage = "";
- $sidebartitle = "";
- $sidebarmessage = "";
+ $welcometitle = '';
+ $welcomemessage = '';
+ $sidebartitle = '';
+ $sidebarmessage = '';
}
// set the required form variables
-$welcometitle_form = elgg_view('input/text', array('internalname' => 'welcometitle', 'value' => $welcometitle));
-$welcomemessage_form = elgg_view('input/longtext', array('internalname' => 'welcomemessage', 'value' => $welcomemessage, 'class' => 'input_textarea monospace'));
-$sidebartitle_form = elgg_view('input/text', array('internalname' => 'sidebartitle', 'value' => $sidebartitle));
-$sidebarmessage_form = elgg_view('input/longtext', array('internalname' => 'sidebarmessage', 'value' => $sidebarmessage, 'class' => 'input_textarea monospace'));;
-$submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
-
-$welcomemessage_title = elgg_echo("sitepages:welcomemessage");
-$sidebarmessage_title = elgg_echo("sitepages:sidebarmessage");
-$welcometitle_title = elgg_echo("sitepages:welcometitle");
-$sidebartitle_title = elgg_echo("sitepages:sidebartitle");
-$welcome_intro = elgg_echo("sitepages:welcomeintro");
-$sidebar_intro = elgg_echo("sitepages:sidebarintro");
+$welcometitle_form = elgg_view('input/text', array(
+ 'internalname' => 'welcometitle',
+ 'value' => $welcometitle
+));
+$welcomemessage_form = elgg_view('input/longtext', array(
+ 'internalname' => 'welcomemessage',
+ 'value' => $welcomemessage,
+ 'class' => 'input_textarea monospace'
+));
+$sidebartitle_form = elgg_view('input/text', array(
+ 'internalname' => 'sidebartitle',
+ 'value' => $sidebartitle
+));
+$sidebarmessage_form = elgg_view('input/longtext', array(
+ 'internalname' => 'sidebarmessage',
+ 'value' => $sidebarmessage,
+ 'class' => 'input_textarea monospace'
+));;
+
+$page_type = elgg_view('input/hidden', array(
+ 'internalname' => 'page_type',
+ 'value' => 'frontsimple',
+));
+
+$welcomemessage_title = elgg_echo('sitepages:welcomemessage');
+$sidebarmessage_title = elgg_echo('sitepages:sidebarmessage');
+$welcometitle_title = elgg_echo('sitepages:welcometitle');
+$sidebartitle_title = elgg_echo('sitepages:sidebartitle');
+$welcome_intro = elgg_echo('sitepages:welcomeintro');
+$sidebar_intro = elgg_echo('sitepages:sidebarintro');
+
+$ownfrontpage_message = elgg_echo('sitepages:ownfront');
+$ownfrontpage = elgg_view('input/pulldown', array(
+ 'internalname' => 'params[ownfrontpage]',
+ 'value' => isset($vars['entity']->ownfrontpage) ? $vars['entity']->ownfrontpage : 'no',
+ 'options_values' => array(
+ 'yes' => elgg_echo('option:yes'),
+ 'no' => elgg_echo('option:no'),
+ ),
+));
//construct the form
$form_body = <<<___EOT
+ <p>
+ $ownfrontpage_message
+ $ownfrontpage
+ </p>
+
<h2>$welcome_intro</h2>
<p><label>$welcometitle_title
$welcometitle_form</label></p>
@@ -52,10 +83,9 @@ $form_body = <<<___EOT
$sidebartitle_form</label></p>
<p><label>$sidebarmessage_title
$sidebarmessage_form</label></p>
-
- $hidden_guid
- $submit_input
+ $page_type
+
___EOT;
-echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body)); \ No newline at end of file
+echo $form_body;
diff --git a/mod/sitepages/views/default/sitepages/forms/editmeta.php b/mod/sitepages/views/default/sitepages/forms/editmeta.php
index b9a454bbf..403c01de1 100644
--- a/mod/sitepages/views/default/sitepages/forms/editmeta.php
+++ b/mod/sitepages/views/default/sitepages/forms/editmeta.php
@@ -9,8 +9,6 @@
* @link http://elgg.org/
*/
-$action = 'sitepages/addmeta';
-
if ($sitepages_object = sitepages_get_sitepage_object('seo')) {
$meta_tags = $sitepages_object->title;
$meta_description = $sitepages_object->description;
@@ -19,25 +17,28 @@ if ($sitepages_object = sitepages_get_sitepage_object('seo')) {
$meta_description = '';
}
-$input_keywords = elgg_view('input/text', array('internalname' => 'metatags', 'value' => $meta_tags));
-$input_description = elgg_view('input/plaintext', array('internalname' => 'description', 'value' => $meta_description));
-$submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
-
-$description = elgg_echo("sitepages:metadescription");
-$metatags = elgg_echo("sitepages:metatags");
-
-$form_body = <<<___EOT
-
-<p><label>$description
-$input_description</p></label>
+$description = elgg_echo('sitepages:metadescription');
+$input_description = elgg_view('input/plaintext', array(
+ 'internalname' => 'description',
+ 'value' => $meta_description
+));
-<p><label>$metatags
-$input_keywords</p></label>
+$metatags = elgg_echo('sitepages:metatags');
+$input_keywords = elgg_view('input/text', array(
+ 'internalname' => 'metatags',
+ 'value' => $meta_tags
+));
-$hidden_guid
-$submit_input
+$page_type = elgg_view('input/hidden', array(
+ 'internalname' => 'page_type',
+ 'value' => 'seo',
+));
+$form_body = <<<___EOT
+<p><label>$description $input_description</p></label>
+<p><label>$metatags $input_keywords</p></label>
+$page_type
___EOT;
//display the form
-echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body)); \ No newline at end of file
+echo $form_body; \ No newline at end of file
diff --git a/mod/sitepages/views/default/sitepages/menu.php b/mod/sitepages/views/default/sitepages/menu.php
index 9c4e39821..4e2ab0c52 100644
--- a/mod/sitepages/views/default/sitepages/menu.php
+++ b/mod/sitepages/views/default/sitepages/menu.php
@@ -10,7 +10,7 @@
*/
$page_type = $vars['page_type'];
-$url = $vars['url'] . 'pg/sitepages/edit/';
+$url = "{$vars['url']}pg/admin/plugin_settings/sitepages/";
?>
<div class="elgg_horizontal_tabbed_nav margin_top">
@@ -21,7 +21,7 @@ $url = $vars['url'] . 'pg/sitepages/edit/';
foreach ($pages as $page) {
$selected = ($page_type == $page) ? 'class = "selected"' : '';
- echo "<li $selected><a href=\"{$url}{$page}\">" . elgg_echo("sitepages:$page") . "</a></li>";
+ echo "<li $selected><a href=\"$url$page\">" . elgg_echo("sitepages:$page") . "</a></li>";
}
?>
</ul>