diff options
-rw-r--r-- | mod/developers/languages/en.php | 2 | ||||
-rw-r--r-- | mod/developers/start.php | 27 | ||||
-rw-r--r-- | mod/developers/views/default/page/shells/theme_preview.php | 23 | ||||
-rw-r--r-- | mod/developers/views/default/theme_preview/header.php | 42 | ||||
-rw-r--r-- | mod/developers/views/default/theme_preview/index.php | 22 | ||||
-rw-r--r-- | mod/developers/views/default/theme_preview/navigation.php (renamed from mod/developers/views/default/theme_preview/nav.php) | 0 |
6 files changed, 41 insertions, 75 deletions
diff --git a/mod/developers/languages/en.php b/mod/developers/languages/en.php index 5a8b8fdb0..98adcb1ea 100644 --- a/mod/developers/languages/en.php +++ b/mod/developers/languages/en.php @@ -20,7 +20,7 @@ $english = array( // theme preview 'theme_preview:general' => 'General', - 'theme_preview:nav' => 'Navigation', + 'theme_preview:navigation' => 'Navigation', 'theme_preview:forms' => 'Forms', 'theme_preview:objects' => 'Objects', 'theme_preview:grid' => 'Grid', diff --git a/mod/developers/start.php b/mod/developers/start.php index e6f4d46b5..9e1d02361 100644 --- a/mod/developers/start.php +++ b/mod/developers/start.php @@ -31,16 +31,29 @@ function developers_setup_menu() { */ function developers_theme_preview_controller($page) { if (!isset($page[0])) { - $page[0] = 'index'; + forward('pg/theme_preview/general'); } - $pages = array('general', 'nav', 'forms', 'objects', 'grid', 'widgets', 'icons'); + $pages = array( + 'general', + 'navigation', + 'forms', + 'objects', + 'grid', + 'widgets', + 'icons', + ); + + foreach ($pages as $page_name) { + elgg_register_menu_item('page', array( + 'name' => $page_name, + 'title' => elgg_echo("theme_preview:$page_name"), + 'url' => "pg/theme_preview/$page_name", + )); + } $title = elgg_echo("theme_preview:{$page[0]}"); - $page = elgg_view("theme_preview/{$page[0]}", array( - 'pages' => $pages, - 'page' => $page[0], - )); + $body = elgg_view("theme_preview/{$page[0]}"); - echo elgg_view_page($title, $page, 'theme_preview'); + echo elgg_view_page($title, $body, 'theme_preview'); } diff --git a/mod/developers/views/default/page/shells/theme_preview.php b/mod/developers/views/default/page/shells/theme_preview.php index 6652c609a..e986a3965 100644 --- a/mod/developers/views/default/page/shells/theme_preview.php +++ b/mod/developers/views/default/page/shells/theme_preview.php @@ -17,6 +17,13 @@ header("Content-type: text/html; charset=UTF-8"); <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $vars['title']; ?></title> <link rel="stylesheet" href="<?php echo $screen; ?>" type="text/css" /> + <style> + .elgg-page-body { margin: 20px } + .elgg-page-header:after {content:'.'; display:block; clear:both; height:0; visibility: hidden} + .elgg-page-header .elgg-menu-page > li {float:left; padding: 5px} + .elgg-page-header .elgg-menu-page > li > a {padding: 2px 4px} + .elgg-page-header .elgg-menu-page > li.elgg-state-selected > a {background-color:#0054A7;} + </style> <!--[if gt IE 6]> <link rel="stylesheet" type="text/css" href="<?php echo $ie_url; ?>" /> <![endif]--> @@ -34,8 +41,18 @@ foreach (elgg_get_js() as $script) { </head> <body> -<?php -echo $vars['body']; -?> +<div class="elgg-page"> + <div class="elgg-page-header"> + <div class="elgg-inner"> + <?php echo elgg_view_menu('page'); ?> + </div> + </div> + <div class="elgg-page-body"> + <div class="elgg-inner"> + <?php echo elgg_view_title($vars['title']); ?> + <?php echo $vars['body']; ?> + </div> + </div> +</div> </body> </html>
\ No newline at end of file diff --git a/mod/developers/views/default/theme_preview/header.php b/mod/developers/views/default/theme_preview/header.php deleted file mode 100644 index 8a4a80449..000000000 --- a/mod/developers/views/default/theme_preview/header.php +++ /dev/null @@ -1,42 +0,0 @@ -<?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']); - -$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/index.php b/mod/developers/views/default/theme_preview/index.php deleted file mode 100644 index 5bb554d06..000000000 --- a/mod/developers/views/default/theme_preview/index.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Main index for theme preview - */ - -$url = "pg/theme_preview"; -$url = elgg_normalize_url($url); - -echo <<<HTML -<div class="elgg-page mal"> - <h1 class="mbl"><a href="$url/index">Index</a></h1> - <ul class="mtl"> - <li><a href="$url/general">General CSS</a></li> - <li><a href="$url/nav">Navigation CSS</a></li> - <li><a href="$url/forms">Form CSS</a></li> - <li><a href="$url/objects">Lists, modules, image blocks CSS</a></li> - <li><a href="$url/grid">Grid CSS</a></li> - <li><a href="$url/widgets">Widgets CSS</a></li> - <li><a href="$url/icons">Icons CSS</a></li> - </ul> -</div> -HTML; diff --git a/mod/developers/views/default/theme_preview/nav.php b/mod/developers/views/default/theme_preview/navigation.php index 4e6f4d3d6..4e6f4d3d6 100644 --- a/mod/developers/views/default/theme_preview/nav.php +++ b/mod/developers/views/default/theme_preview/navigation.php |