diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-26 18:25:08 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-26 18:25:08 +0000 |
commit | b027f962af16d074398d1351a90d863aaf5469f3 (patch) | |
tree | cb547da86008491ce9a25cafae56800fd4944229 /mod/sitepages/views/default | |
parent | fd878435ffeb7478aa745f76dfcea608301a04ba (diff) | |
download | elgg-b027f962af16d074398d1351a90d863aaf5469f3.tar.gz elgg-b027f962af16d074398d1351a90d863aaf5469f3.tar.bz2 |
Updating Sitepages plugin settings for new administration layout.
git-svn-id: http://code.elgg.org/elgg/trunk@6242 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/sitepages/views/default')
6 files changed, 93 insertions, 141 deletions
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> |