diff options
10 files changed, 68 insertions, 47 deletions
diff --git a/mod/developers/start.php b/mod/developers/start.php index 5763d5d34..e8e2b8506 100644 --- a/mod/developers/start.php +++ b/mod/developers/start.php @@ -34,8 +34,16 @@ function developers_theme_preview_controller($page) { $page[0] = 'index'; } + $pages = array('general', 'nav', 'forms', 'objects', 'grid', 'widgets', 'icons'); + + elgg_set_config('tp_ipsum', "Sed scelerisque sagittis lorem. Phasellus sodales. + Nulla urna justo, vehicula in, suscipit nec, molestie sed, tellus."); + $title = elgg_echo("theme_preview:{$page[0]}"); - $page = elgg_view("theme_preview/{$page[0]}"); + $page = elgg_view("theme_preview/{$page[0]}", array( + 'pages' => $pages, + 'page' => $page[0], + )); echo elgg_view_page($title, $page, 'theme_preview'); -}
\ No newline at end of file +} 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> <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 <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> <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 $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> 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> <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> <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> <a href="icons.php">next ></a> - </div> + <?php echo elgg_view('theme_preview/header', $vars); ?> <?php $w = array(); for ($i=1; $i<=6; $i++) { |