diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-07-15 17:59:57 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-07-15 17:59:57 +0000 |
commit | bcfbbf1b7cf2a0c96af1dfe55c919c09eceac916 (patch) | |
tree | e22653836d685eedbe81df5f4b1c118e6324c86d /mod/pages/views/default/forms | |
parent | ff5846ea6cb4e5edc84c99c6eda7b37dccce8bf5 (diff) | |
download | elgg-bcfbbf1b7cf2a0c96af1dfe55c919c09eceac916.tar.gz elgg-bcfbbf1b7cf2a0c96af1dfe55c919c09eceac916.tar.bz2 |
First pass at standardizing pages.
git-svn-id: http://code.elgg.org/elgg/trunk@6716 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/pages/views/default/forms')
-rw-r--r-- | mod/pages/views/default/forms/pages/edit.php | 168 | ||||
-rw-r--r-- | mod/pages/views/default/forms/pages/editwelcome.php | 102 |
2 files changed, 130 insertions, 140 deletions
diff --git a/mod/pages/views/default/forms/pages/edit.php b/mod/pages/views/default/forms/pages/edit.php index 2ad454073..2095e4fd8 100644 --- a/mod/pages/views/default/forms/pages/edit.php +++ b/mod/pages/views/default/forms/pages/edit.php @@ -1,106 +1,100 @@ <?php - /** - * Elgg Pages - * - * @package ElggPages - * @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.com/ - */ +/** + * Page edit form. + * + * @package ElggPages + */ - $parent_guid = get_input('parent_guid'); - $container_guid = get_input('container_guid'); - if (!$container_guid) $container_guid = page_owner(); - - $new_page = false; - if (!$vars['entity']) { - $new_page = true; - - // bootstrap the access permissions in the entity array so we can use defaults - if (defined('ACCESS_DEFAULT')) { - $vars['entity']->access_id = ACCESS_DEFAULT; - $vars['entity']->write_access_id = ACCESS_DEFAULT; - } else { - $vars['entity']->access_id = 0; - $vars['entity']->write_access_id = 0; - } +$parent_guid = get_input('parent_guid'); +$container_guid = get_input('container_guid'); +if (!$container_guid) { + $container_guid = page_owner(); +} - // pull in sticky values from session - if (isset($_SESSION['page_description'])) { - $vars['entity']->description = $_SESSION['page_description']; - $vars['entity']->tags = $_SESSION['page_tags']; - $vars['entity']->access_id = $_SESSION['page_read_access']; - $vars['entity']->write_access_id = $_SESSION['page_write_access']; +$new_page = false; +if (!$vars['entity']) { + $new_page = true; - // clear them - unset($_SESSION['page_description']); - unset($_SESSION['page_tags']); - unset($_SESSION['page_read_access']); - unset($_SESSION['page_write_access']); - } + // bootstrap the access permissions in the entity array so we can use defaults + if (defined('ACCESS_DEFAULT')) { + $vars['entity']->access_id = ACCESS_DEFAULT; + $vars['entity']->write_access_id = ACCESS_DEFAULT; + } else { + $vars['entity']->access_id = 0; + $vars['entity']->write_access_id = 0; + } + + // pull in sticky values from session + if (isset($_SESSION['page_description'])) { + $vars['entity']->description = $_SESSION['page_description']; + $vars['entity']->tags = $_SESSION['page_tags']; + $vars['entity']->access_id = $_SESSION['page_read_access']; + $vars['entity']->write_access_id = $_SESSION['page_write_access']; + + // clear them + unset($_SESSION['page_description']); + unset($_SESSION['page_tags']); + unset($_SESSION['page_read_access']); + unset($_SESSION['page_write_access']); } +} ?> <div class="contentWrapper"> <form action="<?php echo $vars['url']; ?>action/pages/edit" method="post"> <?php - echo elgg_view('input/securitytoken'); - if (is_array($vars['config']->pages) && sizeof($vars['config']->pages) > 0) - foreach($vars['config']->pages as $shortname => $valtype) { - - $disabled = ""; - - if (!$new_page && ($shortname == 'title')) - { - $disabled = true; - } +echo elgg_view('input/securitytoken'); +if (is_array($vars['config']->pages) && sizeof($vars['config']->pages) > 0) { + foreach($vars['config']->pages as $shortname => $valtype) { + $disabled = ""; + + if (!$new_page && ($shortname == 'title')) { + $disabled = true; + } ?> - <p> - <label> - <?php echo elgg_echo("pages:{$shortname}") ?><br /> - <?php echo elgg_view("input/{$valtype}",array( - 'internalname' => $shortname, - 'value' => $vars['entity']->$shortname, - 'disabled' => $disabled - )); ?> - </label> - </p> +<p> + <label> + <?php echo elgg_echo("pages:{$shortname}") ?><br /> + <?php echo elgg_view("input/{$valtype}",array( + 'internalname' => $shortname, + 'value' => $vars['entity']->$shortname, + 'disabled' => $disabled + )); ?> + </label> +</p> <?php - - } - $cats = elgg_view('categories',$vars); - if (!empty($cats)) { - + + } +} + +$cats = elgg_view('categories', $vars); +if (!empty($cats)) { ?> - <p> - <?php - echo $cats; - ?> - </p> +<p> + <?php + echo $cats; + ?> +</p> <?php - - } + } + +?> +<p> +<?php +if (!$new_page) { + ?><input type="hidden" name="pages_guid" value="<?php echo $vars['entity']->getGUID(); ?>" /><?php +} + +if ($container_guid) { + ?><input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" /><?php +} ?> - <p> - <?php - if (!$new_page) - { - ?><input type="hidden" name="pages_guid" value="<?php echo $vars['entity']->getGUID(); ?>" /><?php - } - ?> - <?php - if ($container_guid) - { - ?><input type="hidden" name="container_guid" value="<?php echo $container_guid; ?>" /><?php - } - ?> - <input type="hidden" name="parent_guid" value="<?php if (!$new_page) echo $vars['entity']->parent_guid; else echo $parent_guid; ?>" /> - <input type="hidden" name="owner_guid" value="<?php if (!$new_page) echo $vars['entity']->owner_guid; else echo page_owner(); ?>" /> - <input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" /> - </p> + <input type="hidden" name="parent_guid" value="<?php if (!$new_page) echo $vars['entity']->parent_guid; else echo $parent_guid; ?>" /> + <input type="hidden" name="owner_guid" value="<?php if (!$new_page) echo $vars['entity']->owner_guid; else echo page_owner(); ?>" /> + <input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" /> +</p> </form> -</div> +</div>
\ No newline at end of file diff --git a/mod/pages/views/default/forms/pages/editwelcome.php b/mod/pages/views/default/forms/pages/editwelcome.php index 39d8d05ca..41721484b 100644 --- a/mod/pages/views/default/forms/pages/editwelcome.php +++ b/mod/pages/views/default/forms/pages/editwelcome.php @@ -1,59 +1,55 @@ <?php - /** - * Elgg Pages Edit welcome page - * - * @package ElggPages - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - */ - - //set some variables - if($vars['entity']){ - foreach($vars['entity'] as $welcome){ - $current_message = $welcome->description; - $object_guid = $welcome->guid; - $access_id = $welcome->access_id; - } - }else{ - $current_message = ''; - $object_guid = ''; - $access_id = ACCESS_PRIVATE; - } - - $page_owner = $vars['owner']->guid; - +/** + * Welcome page edit form + * + * @package ElggPages + */ + +//set some variables +if($vars['entity']) { + foreach($vars['entity'] as $welcome) { + $current_message = $welcome->description; + $object_guid = $welcome->guid; + $access_id = $welcome->access_id; + } +} else { + $current_message = ''; + $object_guid = ''; + $access_id = ACCESS_PRIVATE; +} + +$page_owner = $vars['owner']->guid; + ?> <form action="<?php echo $vars['url']; ?>action/pages/editwelcome" method="post"> - <p class="longtext_inputarea"> - <label> - <?php echo elgg_view("input/longtext",array( - 'internalname' => "pages_welcome", - 'value' => $current_message, - 'disabled' => $disabled - )); ?> - </label> - </p> - <p> - <label> - <?php echo elgg_echo('access'); ?><br /> - <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?> - </label> - </p> - <input type="hidden" name="owner_guid" value="<?php echo $page_owner; ?>" /> - - <?php - echo elgg_view('input/securitytoken'); + <p class="longtext_inputarea"> + <label> + <?php echo elgg_view("input/longtext",array( + 'internalname' => "pages_welcome", + 'value' => $current_message, + 'disabled' => $disabled + )); ?> + </label> +</p> +<p> + <label> + <?php echo elgg_echo('access'); ?><br /> + <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?> + </label> +</p> +<input type="hidden" name="owner_guid" value="<?php echo $page_owner; ?>" /> + +<?php + echo elgg_view('input/securitytoken'); + + //if it is editing, include the object guid + if ($object_guid != ''){ + ?> + <input type="hidden" name="object_guid" value="<?php echo $object_guid; ?>" /> +<?php + } + ?> - //if it is editing, include the object guid - if($object_guid != ''){ - ?> - <input type="hidden" name="object_guid" value="<?php echo $object_guid; ?>" /> - <?php - } - ?> - - <input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" /> +<input type="submit" class="submit_button" value="<?php echo elgg_echo("save"); ?>" /> </form> |