aboutsummaryrefslogtreecommitdiff
path: root/mod/developers/views
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-14 01:30:46 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-14 01:30:46 +0000
commit75efcff5e18fce2d62a69228021d60684e0390c1 (patch)
tree6e5fcf20a271bbe7906d48961e341edcf46b474e /mod/developers/views
parent0333b2d640de54ddc41962846ade5f055ef0fa7c (diff)
downloadelgg-75efcff5e18fce2d62a69228021d60684e0390c1.tar.gz
elgg-75efcff5e18fce2d62a69228021d60684e0390c1.tar.bz2
Refs #2903 navigation updated for theme preview
git-svn-id: http://code.elgg.org/elgg/trunk@8217 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/developers/views')
-rw-r--r--mod/developers/views/default/admin/developers/preview.php2
-rw-r--r--mod/developers/views/default/theme_preview/forms.php9
-rw-r--r--mod/developers/views/default/theme_preview/general.php9
-rw-r--r--mod/developers/views/default/theme_preview/grid.php7
-rw-r--r--mod/developers/views/default/theme_preview/header.php43
-rw-r--r--mod/developers/views/default/theme_preview/icons.php7
-rw-r--r--mod/developers/views/default/theme_preview/nav.php7
-rw-r--r--mod/developers/views/default/theme_preview/objects.php9
-rw-r--r--mod/developers/views/default/theme_preview/widgets.php10
9 files changed, 58 insertions, 45 deletions
diff --git a/mod/developers/views/default/admin/developers/preview.php b/mod/developers/views/default/admin/developers/preview.php
index 59e403bf7..3d16e5a42 100644
--- a/mod/developers/views/default/admin/developers/preview.php
+++ b/mod/developers/views/default/admin/developers/preview.php
@@ -3,6 +3,6 @@
* CSS Preview
*/
-$url = elgg_get_site_url() . 'documentation/theming/preview/index.php';
+$url = elgg_get_site_url() . 'pg/theme_preview/';
?>
<iframe id="developers-iframe" src="<?php echo $url; ?>"></iframe> \ No newline at end of file
diff --git a/mod/developers/views/default/theme_preview/forms.php b/mod/developers/views/default/theme_preview/forms.php
index 90cc5dcc8..621f71b33 100644
--- a/mod/developers/views/default/theme_preview/forms.php
+++ b/mod/developers/views/default/theme_preview/forms.php
@@ -5,14 +5,11 @@
$url = current_page_url();
+$ipsum = elgg_get_config('tp_ipsum');
+
?>
<div class="elgg-page mal">
- <h1 class="mbs">
- <a href="index.php">Index</a> > <a href="<?php echo $url; ?>"><?php echo $title; ?></a>
- </h1>
- <div class="mbl">
- <a href="nav.php">< previous</a>&nbsp;&nbsp;<a href="objects.php">next ></a>
- </div>
+ <?php echo elgg_view('theme_preview/header', $vars); ?>
<h2>Form</h2>
<form action="#">
<fieldset>
diff --git a/mod/developers/views/default/theme_preview/general.php b/mod/developers/views/default/theme_preview/general.php
index e64a60748..52400ab1d 100644
--- a/mod/developers/views/default/theme_preview/general.php
+++ b/mod/developers/views/default/theme_preview/general.php
@@ -3,15 +3,12 @@
* General CSS
*/
+$ipsum = elgg_get_config('tp_ipsum');
+
?>
<div class="elgg-page mal">
- <h1 class="mbs">
- <a href="index.php">Index</a> > <a href="<?php echo $url; ?>"><?php echo $title; ?></a>
- </h1>
- <div class="mbl">
- < previous&nbsp;&nbsp;<a href="nav.php">next ></a>
- </div>
+ <?php echo elgg_view('theme_preview/header', $vars); ?>
<h2>Headings</h2>
<div class="mbl">
<h1>Level 1 heading</h1>
diff --git a/mod/developers/views/default/theme_preview/grid.php b/mod/developers/views/default/theme_preview/grid.php
index 8e85d5c72..95e14cfd5 100644
--- a/mod/developers/views/default/theme_preview/grid.php
+++ b/mod/developers/views/default/theme_preview/grid.php
@@ -5,12 +5,7 @@
?>
<div class="elgg-page mal">
- <h1 class="mbs">
- <a href="index.php">Index</a> > <a href="<?php echo $url; ?>"><?php echo $title; ?></a>
- </h1>
- <div class="mbl">
- <a href="objects.php">< previous</a>&nbsp;&nbsp;<a href="widgets.php">next ></a>
- </div>
+ <?php echo elgg_view('theme_preview/header', $vars); ?>
<style>
h3 {text-align: center;}
diff --git a/mod/developers/views/default/theme_preview/header.php b/mod/developers/views/default/theme_preview/header.php
new file mode 100644
index 000000000..0aa12347a
--- /dev/null
+++ b/mod/developers/views/default/theme_preview/header.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Header for theme preview pages
+ *
+ * @uses $vars['title']
+ * @uses $vars['page']
+ * @uses $vars['pages']
+ */
+$index_url = 'pg/theme_preview/';
+$index_url = elgg_normalize_url($index_url);
+
+$url = current_page_url();
+
+$title = elgg_echo("theme_preview:{$vars['page']}");
+
+$index = array_search($vars['page'], $vars['pages']);
+echo $index;
+
+$previous = '< previous';
+if ($index > 0) {
+ $previous = elgg_view('output/url', array(
+ 'href' => "pg/theme_preview/{$vars['pages'][$index - 1]}",
+ 'text' => $previous,
+ ));
+}
+
+$next = 'next >';
+if ($index < (count($vars['pages']) - 1)) {
+ $next = elgg_view('output/url', array(
+ 'href' => "pg/theme_preview/{$vars['pages'][$index + 1]}",
+ 'text' => $next,
+ ));
+}
+
+echo <<<HTML
+<h1 class="mbs">
+ <a href="$index_url">Index</a> >
+ <a href="$url">$title</a>
+</h1>
+<div class="mbl">
+ $previous&nbsp;&nbsp;$next
+</div>
+HTML;
diff --git a/mod/developers/views/default/theme_preview/icons.php b/mod/developers/views/default/theme_preview/icons.php
index 792818e31..89aa8cbc6 100644
--- a/mod/developers/views/default/theme_preview/icons.php
+++ b/mod/developers/views/default/theme_preview/icons.php
@@ -6,12 +6,7 @@
?>
<style>li {margin: 10px; float: left;} ul {background-color: #e0e0e0;}</style>
<div class="elgg-page mal">
- <h1 class="mbs">
- <a href="index.php">Index</a> > <a href="<?php echo $url; ?>"><?php echo $title; ?></a>
- </h1>
- <div class="mbl">
- <a href="widgets.php">< previous</a>&nbsp;&nbsp;next >
- </div>
+ <?php echo elgg_view('theme_preview/header', $vars); ?>
<h2>Icon Sprites</h2>
<ul class="mbl clearfix">
<li><span class="elgg-icon elgg-icon-settings"></span>Settings</li>
diff --git a/mod/developers/views/default/theme_preview/nav.php b/mod/developers/views/default/theme_preview/nav.php
index 7fdf49a8e..4e6f4d3d6 100644
--- a/mod/developers/views/default/theme_preview/nav.php
+++ b/mod/developers/views/default/theme_preview/nav.php
@@ -11,12 +11,7 @@ elgg_push_breadcrumb('Third');
?>
<div class="elgg-page mal">
- <h1 class="mbs">
- <a href="index.php">Index</a> > <a href="<?php echo $url; ?>"><?php echo $title; ?></a>
- </h1>
- <div class="mbl">
- <a href="general.php">< previous</a>&nbsp;&nbsp;<a href="forms.php">next ></a>
- </div>
+ <?php echo elgg_view('theme_preview/header', $vars); ?>
<h2>Breadcrumbs</h2>
<div class="mbl">
<?php echo elgg_view('navigation/breadcrumbs'); ?>
diff --git a/mod/developers/views/default/theme_preview/objects.php b/mod/developers/views/default/theme_preview/objects.php
index fc773afb9..d385fcdc0 100644
--- a/mod/developers/views/default/theme_preview/objects.php
+++ b/mod/developers/views/default/theme_preview/objects.php
@@ -5,15 +5,12 @@
$url = current_page_url();
+$ipsum = elgg_get_config('tp_ipsum');
+
?>
<div class="elgg-page mal">
- <h1 class="mbs">
- <a href="index.php">Index</a> > <a href="<?php echo $url; ?>"><?php echo $title; ?></a>
- </h1>
- <div class="mbl">
- <a href="forms.php">< previous</a>&nbsp;&nbsp;<a href="grid.php">next ></a>
- </div>
+ <?php echo elgg_view('theme_preview/header', $vars); ?>
<h2>Modules</h2>
<div class="mbl clearfix">
<div class="elgg-col elgg-col-1of2">
diff --git a/mod/developers/views/default/theme_preview/widgets.php b/mod/developers/views/default/theme_preview/widgets.php
index 7f3fc938c..32ee487c8 100644
--- a/mod/developers/views/default/theme_preview/widgets.php
+++ b/mod/developers/views/default/theme_preview/widgets.php
@@ -10,8 +10,7 @@ elgg_register_plugin_hook_handler('view', 'widgets/friends/edit', 'css_widget_co
elgg_register_plugin_hook_handler('permissions_check', 'all', 'css_permissions_override');
function css_widget_content() {
- global $ipsum;
- return $ipsum;
+ return elgg_get_config('tp_ipsum');
}
function css_permissions_override() {
@@ -21,12 +20,7 @@ function css_permissions_override() {
?>
<div class="elgg-page mal">
- <h1 class="mbs">
- <a href="index.php">Index</a> > <a href="<?php echo $url; ?>"><?php echo $title; ?></a>
- </h1>
- <div class="mbl">
- <a href="grid.php">< previous</a>&nbsp;&nbsp;<a href="icons.php">next ></a>
- </div>
+ <?php echo elgg_view('theme_preview/header', $vars); ?>
<?php
$w = array();
for ($i=1; $i<=6; $i++) {