diff options
author | friendica <info@friendica.com> | 2012-09-27 17:48:10 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-09-27 17:48:10 -0700 |
commit | d261fe271fdee747244c76f7ba4679b8372a2e8c (patch) | |
tree | 90da2f6f16c484243c4b422d32b72ddd9e04965f /boot.php | |
parent | ba4fe4ff919fa3250db33eee2425870f10107e81 (diff) | |
download | volse-hubzilla-d261fe271fdee747244c76f7ba4679b8372a2e8c.tar.gz volse-hubzilla-d261fe271fdee747244c76f7ba4679b8372a2e8c.tar.bz2 volse-hubzilla-d261fe271fdee747244c76f7ba4679b8372a2e8c.zip |
create a widget registry for pages so themes can reorder, insert/delete, and relocate widgets to different regions of the page
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -369,6 +369,7 @@ if(! class_exists('App')) { public $account = null; private $channel = null; + private $widgets = array(); public $language; public $module_loaded = false; @@ -603,6 +604,20 @@ if(! class_exists('App')) { return $this->channel; } + function set_widget($title,$html, $location = 'aside') { + $this->widgets[] = array('title' => $title, 'html' => $html, 'location' => $location); + } + + function get_widgets($location) { + if($location && count($this->widgets)) { + $ret = array(); + foreach($widgets as $w) + if($w['location'] == $location) + $ret[] = $w; + return $ret; + } + return $this->widgets; + } function set_pager_total($n) { $this->pager['total'] = intval($n); @@ -1142,9 +1157,6 @@ function profile_load(&$a, $nickname, $profile = 0) { require_once($theme_info_file); } - if(! (x($a->page,'aside'))) - $a->page['aside'] = ''; - if(local_user() && local_user() == $a->profile['uid']) { $a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array( '$editprofile' => t('Edit profile'), @@ -1154,7 +1166,7 @@ function profile_load(&$a, $nickname, $profile = 0) { $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false); - $a->page['aside'] .= profile_sidebar($a->profile, $block); + $a->set_widget('profile',profile_sidebar($a->profile, $block)); /*if(! $block) $a->page['aside'] .= contact_block();*/ |