create a widget registry for pages so themes can reorder, insert/delete, and relocate widgets to different regions of the page

This commit is contained in:
friendica
2012-09-27 17:48:10 -07:00
parent ba4fe4ff91
commit d261fe271f
5 changed files with 44 additions and 11 deletions

View File

@@ -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;