From d261fe271fdee747244c76f7ba4679b8372a2e8c Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 27 Sep 2012 17:48:10 -0700 Subject: create a widget registry for pages so themes can reorder, insert/delete, and relocate widgets to different regions of the page --- index.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 3c45a3b4c..f8069445f 100644 --- a/index.php +++ b/index.php @@ -158,6 +158,8 @@ $a->apps = $arr['app_menu']; if(strlen($a->module)) { + + /** * * We will always have a module name. @@ -176,10 +178,19 @@ if(strlen($a->module)) { */ if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) { - include_once("mod/{$a->module}.php"); - $a->module_loaded = true; + if((strpos($a->module,'admin') === 0) && (! is_site_admin())) { + $a->module_loaded = false; + notice( t('Permission denied.') . EOL); + goaway(z_root()); + } + else { + include_once("mod/{$a->module}.php"); + $a->module_loaded = true; + } } + + /** * * The URL provided does not resolve to a valid module. @@ -362,6 +373,13 @@ head_add_js('mod_' . $a->module . '.js'); '$js_strings' => js_strings() )); +$arr = $a->get_widgets(); +if(count($arr)) { + foreach($arr as $x) { + $a->page[$x['location']] .= $x['html']; + } +} + $page = $a->page; $profile = $a->profile; -- cgit v1.2.3