aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-29 20:54:42 -0700
committerfriendica <info@friendica.com>2013-08-29 20:54:42 -0700
commit74582630177b104f35113cee77d2c7ac5f74f412 (patch)
tree031770083dc6e2462e6190b59e6c59c6ea5c0624 /include
parent85e291f5357bc28b108378816af97b545aacca3f (diff)
downloadvolse-hubzilla-74582630177b104f35113cee77d2c7ac5f74f412.tar.gz
volse-hubzilla-74582630177b104f35113cee77d2c7ac5f74f412.tar.bz2
volse-hubzilla-74582630177b104f35113cee77d2c7ac5f74f412.zip
I've got a pretty good idea of how to bootstrap, parse and render Comanche now. This does not mean it's close to being presentable - far from it.
Diffstat (limited to 'include')
-rw-r--r--include/comanche.php27
1 files changed, 22 insertions, 5 deletions
diff --git a/include/comanche.php b/include/comanche.php
index 21182175e..cf7ecd7c5 100644
--- a/include/comanche.php
+++ b/include/comanche.php
@@ -75,11 +75,21 @@ function comanche_menu($name) {
return render_menu($m);
}
-function comanche_widget($name) {
+function comanche_replace_region($match) {
$a = get_app();
- // placeholder for now
- $m = menu_fetch($name,$a->profile['profile_uid'],get_observer_hash());
- return render_menu($m);
+ if(array_key_exists($match[1],$a->page))
+ return $a->page[$match[1]];
+}
+
+// Widgets will have to get any operational arguments from the session,
+// the global app environment, or config storage until we implement argument passing
+
+
+function comanche_widget($name,$args = null) {
+ $a = get_app();
+ $func = 'widget_' . trim($name);
+ if(function_exists($func))
+ return $func($args);
}
@@ -103,4 +113,11 @@ function comanche_region(&$a,$s) {
}
return $s;
-} \ No newline at end of file
+}
+
+
+function widget_profile($args) {
+ $a = get_app();
+ $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);
+ return profile_sidebar($a->profile, $block, true);
+}