Skip to content

Commit

Permalink
feature(routing): Render theme_sandbox shell with view
Browse files Browse the repository at this point in the history
  • Loading branch information
ewinslow committed May 28, 2015
1 parent f8530d1 commit 42013a5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
36 changes: 2 additions & 34 deletions mod/developers/start.php
Expand Up @@ -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;
}

Expand Down
37 changes: 37 additions & 0 deletions mod/developers/views/default/resources/theme_sandbox.php
@@ -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.