From e3ae2734233fd11e5fedd7cd2fc3f87cff79dc20 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sat, 19 Feb 2011 00:32:08 +0000 Subject: theme_preview is using more familiar/correct page handling practices git-svn-id: http://code.elgg.org/elgg/trunk@8300 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/developers/languages/en.php | 2 +- mod/developers/start.php | 27 ++++++--- .../views/default/page/shells/theme_preview.php | 23 +++++++- .../views/default/theme_preview/header.php | 42 -------------- .../views/default/theme_preview/index.php | 22 -------- mod/developers/views/default/theme_preview/nav.php | 65 ---------------------- .../views/default/theme_preview/navigation.php | 65 ++++++++++++++++++++++ 7 files changed, 106 insertions(+), 140 deletions(-) delete mode 100644 mod/developers/views/default/theme_preview/header.php delete mode 100644 mod/developers/views/default/theme_preview/index.php delete mode 100644 mod/developers/views/default/theme_preview/nav.php create mode 100644 mod/developers/views/default/theme_preview/navigation.php (limited to 'mod/developers') 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"); <?php echo $vars['title']; ?> + @@ -34,8 +41,18 @@ foreach (elgg_get_js() as $script) { - +
+
+
+ +
+
+
+
+ + +
+
+
\ 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 @@ - 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 << - Index > - $title - -
- $previous  $next -
-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 @@ - -

Index

- - -HTML; diff --git a/mod/developers/views/default/theme_preview/nav.php b/mod/developers/views/default/theme_preview/nav.php deleted file mode 100644 index 4e6f4d3d6..000000000 --- a/mod/developers/views/default/theme_preview/nav.php +++ /dev/null @@ -1,65 +0,0 @@ - -
- -

Breadcrumbs

-
- -
-

Tabs

-
- 'First', 'url' => "$url#"), - array('title' => 'Second', 'url' => "$url#", 'selected' => true), - array('title' => 'Third', 'url' => "$url#"), - ); - echo elgg_view('navigation/tabs', array('tabs' => $tabs)); - ?> -
-

Pagination

-
- 1000, - 'limit' => 10, - 'offset' => 230, - ); - echo elgg_view('navigation/pagination', $params); - ?> -
-

Site Menu

-
-
- setSelected(true); - echo elgg_view('navigation/menu/site', $params); - ?> -
-
-

Page Menu

-
- setParent($params['menu']['default'][1]); - $params['menu']['default'][1]->addChild($m); - echo elgg_view('navigation/menu/page', $params); - ?> -
-
diff --git a/mod/developers/views/default/theme_preview/navigation.php b/mod/developers/views/default/theme_preview/navigation.php new file mode 100644 index 000000000..4e6f4d3d6 --- /dev/null +++ b/mod/developers/views/default/theme_preview/navigation.php @@ -0,0 +1,65 @@ + +
+ +

Breadcrumbs

+
+ +
+

Tabs

+
+ 'First', 'url' => "$url#"), + array('title' => 'Second', 'url' => "$url#", 'selected' => true), + array('title' => 'Third', 'url' => "$url#"), + ); + echo elgg_view('navigation/tabs', array('tabs' => $tabs)); + ?> +
+

Pagination

+
+ 1000, + 'limit' => 10, + 'offset' => 230, + ); + echo elgg_view('navigation/pagination', $params); + ?> +
+

Site Menu

+
+
+ setSelected(true); + echo elgg_view('navigation/menu/site', $params); + ?> +
+
+

Page Menu

+
+ setParent($params['menu']['default'][1]); + $params['menu']['default'][1]->addChild($m); + echo elgg_view('navigation/menu/page', $params); + ?> +
+
-- cgit v1.2.3