diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-12 19:28:30 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-12 19:28:30 +0000 |
commit | 889ee044c55b73fc0a6b5f384920e8682bea5bcb (patch) | |
tree | 6b632bc6eeba3cad590068bad66a318905fdf51b /mod/sitepages/views | |
parent | 95a6f5ef7e15cb2c5a47cfdae691b8c790e00559 (diff) | |
download | elgg-889ee044c55b73fc0a6b5f384920e8682bea5bcb.tar.gz elgg-889ee044c55b73fc0a6b5f384920e8682bea5bcb.tar.bz2 |
DRY'd up the edit code in site pages.
git-svn-id: http://code.elgg.org/elgg/trunk@5706 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/sitepages/views')
-rw-r--r-- | mod/sitepages/views/default/sitepages/menu.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mod/sitepages/views/default/sitepages/menu.php b/mod/sitepages/views/default/sitepages/menu.php index 9913a3ff7..9b3fecddf 100644 --- a/mod/sitepages/views/default/sitepages/menu.php +++ b/mod/sitepages/views/default/sitepages/menu.php @@ -15,10 +15,14 @@ $url = $vars['url'] . 'pg/sitepages/edit/'; <div class="elgg_horizontal_tabbed_nav margin_top"> <ul> - <li <?php if($page_type == 'front') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>front"><?php echo elgg_echo('sitepages:frontpage'); ?></a></li> - <li <?php if($page_type == 'about') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>about"><?php echo elgg_echo('sitepages:about'); ?></a></li> - <li <?php if($page_type == 'terms') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>terms"><?php echo elgg_echo('sitepages:terms'); ?></a></li> - <li <?php if($page_type == 'privacy') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>privacy"><?php echo elgg_echo('sitepages:privacy'); ?></a></li> - <li <?php if($page_type == 'seo') echo "class = 'selected'"; ?>><a href="<?php echo $url; ?>seo"><?php echo elgg_echo('sitepages:seo'); ?></a></li> +<?php + // @todo let users be able to add static content pages. + $pages = array('front', 'about', 'terms', 'privacy', 'seo'); + + foreach ($pages as $page) { + $select = ($page_type == $page) ? 'class = "selected"' : ''; + echo "<li $selected><a href=\"{$url}{$page}\">" . elgg_echo("sitepages:$page") . "</a></li>"; + } +?> </ul> </div>
\ No newline at end of file |