Permalink
Browse files

feature(routing): Render theme_sandbox shell with view

  • Loading branch information...
ewinslow committed May 27, 2015
1 parent f8530d1 commit 42013a5da449ac293a1dc33768a5566d2883cde6
Showing with 39 additions and 34 deletions.
  1. +2 −34 mod/developers/start.php
  2. +37 −0 mod/developers/views/default/resources/theme_sandbox.php
View
@@ -204,41 +204,9 @@ function developers_theme_sandbox_controller($page) {
if (!isset($page[0])) {
forward('theme_sandbox/intro');
}
set_input('page', $page[0]);
elgg_load_css('dev.theme_sandbox');
$pages = array(
'buttons',
'components',
'forms',
'grid',
'icons',
'javascript',
'layouts',
'modules',
'navigation',
'typography',
);
foreach ($pages as $page_name) {
elgg_register_menu_item('theme_sandbox', array(
'name' => $page_name,
'text' => elgg_echo("theme_sandbox:$page_name"),
'href' => "theme_sandbox/$page_name",
));
}
elgg_require_js('elgg/dev/theme_sandbox');
$title = elgg_echo("theme_sandbox:{$page[0]}");
$body = elgg_view("theme_sandbox/{$page[0]}");
$layout = elgg_view_layout('theme_sandbox', array(
'title' => $title,
'content' => $body,
));
echo elgg_view_page("Theme Sandbox : $title", $layout, 'theme_sandbox');
echo elgg_view('resources/theme_sandbox');
return true;
}
@@ -0,0 +1,37 @@
<?php
$page = get_input('page');
elgg_load_css('dev.theme_sandbox');
$pages = array(
'buttons',
'components',
'forms',
'grid',
'icons',
'javascript',
'layouts',
'modules',
'navigation',
'typography',
);
foreach ($pages as $page_name) {
elgg_register_menu_item('theme_sandbox', array(
'name' => $page_name,
'text' => elgg_echo("theme_sandbox:$page_name"),
'href' => "theme_sandbox/$page_name",
));
}
elgg_require_js('elgg/dev/theme_sandbox');
$title = elgg_echo("theme_sandbox:{$page}");
$body = elgg_view("theme_sandbox/{$page}");
$layout = elgg_view_layout('theme_sandbox', array(
'title' => $title,
'content' => $body,
));
echo elgg_view_page("Theme Sandbox : $title", $layout, 'theme_sandbox');

0 comments on commit 42013a5

Please sign in to comment.