diff --git a/app/widgets/Bookmark/Bookmark.php b/app/widgets/Bookmark/Bookmark.php index f78a96b66..aec8151a0 100644 --- a/app/widgets/Bookmark/Bookmark.php +++ b/app/widgets/Bookmark/Bookmark.php @@ -28,7 +28,10 @@ class Bookmark extends WidgetBase $this->registerEvent('groupsubscribed', 'onGroupSubscribed'); $this->registerEvent('groupunsubscribed', 'onGroupUnsubscribed'); - + } + + function display() + { $this->view->assign('subscriptionconfig', Route::urlize('conf', false, 'groupsubscribedlistconfig')); $this->view->assign('getbookmark', $this->genCallAjax("ajaxGetBookmark")); diff --git a/app/widgets/Chat/Chat.php b/app/widgets/Chat/Chat.php index fedf582cc..b8bfbb116 100644 --- a/app/widgets/Chat/Chat.php +++ b/app/widgets/Chat/Chat.php @@ -30,7 +30,10 @@ class Chat extends WidgetBase $this->registerEvent('paused', 'onPaused'); $this->registerEvent('attention', 'onAttention'); $this->registerEvent('presence', 'onPresence'); + } + function display() + { $this->view->assign('chats', $this->prepareChats()); } diff --git a/app/widgets/Explore/Explore.php b/app/widgets/Explore/Explore.php index 974294dd6..b6b939193 100644 --- a/app/widgets/Explore/Explore.php +++ b/app/widgets/Explore/Explore.php @@ -4,7 +4,10 @@ class Explore extends WidgetCommon { function WidgetLoad() { $this->addcss('explore.css'); - + } + + function display() + { $this->view->assign('contacts', $this->prepareContacts()); $this->view->assign('servers', $this->prepareServers()); diff --git a/app/widgets/Feed/Feed.php b/app/widgets/Feed/Feed.php index 329a67649..678871dfb 100644 --- a/app/widgets/Feed/Feed.php +++ b/app/widgets/Feed/Feed.php @@ -24,7 +24,10 @@ class Feed extends WidgetCommon { $this->registerEvent('nodecreationerror', 'onNodeCreationError'); $this->registerEvent('config', 'onConfig'); - + } + + function display() + { $this->view->assign('blog_url', Route::urlize('blog', array($this->user->getLogin(), 'urn:xmpp:microblog:0'))); $this->view->assign('feed_url', Route::urlize('feed',array($this->user->getLogin(), 'urn:xmpp:microblog:0'))); $this->view->assign('friend_url', Route::urlize('friend',$this->user->getLogin())); diff --git a/app/widgets/Login/Login.php b/app/widgets/Login/Login.php index 0349a0d2f..61fd8917e 100644 --- a/app/widgets/Login/Login.php +++ b/app/widgets/Login/Login.php @@ -26,7 +26,10 @@ class Login extends WidgetBase { $this->addjs('login.js'); $this->registerEvent('config', 'onConfig'); $this->registerEvent('moxlerror', 'onMoxlError'); - + } + + function display() + { $submit = $this->genCallAjax('ajaxLogin', "movim_parse_form('login')"); $this->view->assign('submit', $submit); $this->view->assign('conf', \system\Conf::getServerConf($submit)); diff --git a/app/widgets/News/News.php b/app/widgets/News/News.php index 9b62c3fe3..ce7dc7488 100644 --- a/app/widgets/News/News.php +++ b/app/widgets/News/News.php @@ -8,9 +8,13 @@ class News extends WidgetCommon { { $this->registerEvent('opt_post', 'onStream'); $this->registerEvent('stream', 'onStream'); - + } + + function display() + { $this->view->assign('news', $this->prepareNews(-1)); } + /** * @todo nexthtml not always set... Add comments... */ diff --git a/app/widgets/Node/Node.php b/app/widgets/Node/Node.php index 8fbf1522b..401fa08e0 100644 --- a/app/widgets/Node/Node.php +++ b/app/widgets/Node/Node.php @@ -32,7 +32,10 @@ class Node extends WidgetCommon $this->registerEvent('pubsubmetadata', 'onPubsubMetadata'); $this->registerEvent('pubsubsubscribederror', 'onPubsubSubscribedError'); $this->registerEvent('pubsubunsubscribed', 'onPubsubUnsubscribed'); + } + function display() + { if(isset($_GET['s']) && isset($_GET['n'])) { $this->view->assign('server', $_GET['s']); $this->view->assign('node', $_GET['n']); diff --git a/app/widgets/NodeConfig/NodeConfig.php b/app/widgets/NodeConfig/NodeConfig.php index ee42b7183..fe431c706 100644 --- a/app/widgets/NodeConfig/NodeConfig.php +++ b/app/widgets/NodeConfig/NodeConfig.php @@ -26,7 +26,10 @@ class NodeConfig extends WidgetBase $this->registerEvent('pubsubconfig', 'onConfigForm'); $this->registerEvent('pubsubconfigsubmited', 'onGroupConfig'); $this->registerEvent('deletionsuccess', 'onGroupDeleted'); - + } + + function display() + { if(isset($_GET['s']) && isset($_GET['n'])) { $nd = new modl\ItemDAO(); $node = $nd->getItem($_GET['s'], $_GET['n']); diff --git a/app/widgets/PubsubSubscriptionConfig/PubsubSubscriptionConfig.php b/app/widgets/PubsubSubscriptionConfig/PubsubSubscriptionConfig.php index f30ef4eff..e5ba8e137 100644 --- a/app/widgets/PubsubSubscriptionConfig/PubsubSubscriptionConfig.php +++ b/app/widgets/PubsubSubscriptionConfig/PubsubSubscriptionConfig.php @@ -26,7 +26,10 @@ class PubsubSubscriptionConfig extends WidgetBase $this->registerEvent('groupsubscribedlist', 'onGroupSubscribedList'); $this->registerEvent('groupadded', 'onGroupAdded'); $this->registerEvent('groupremoved', 'onGroupRemoved'); + } + function display() + { $this->view->assign( 'getsubscribedlist', $this->genCallAjax('ajaxGetGroupSubscribedList') diff --git a/app/widgets/Roster/Roster.php b/app/widgets/Roster/Roster.php index 54bb62a89..5dbcecbb4 100644 --- a/app/widgets/Roster/Roster.php +++ b/app/widgets/Roster/Roster.php @@ -31,7 +31,10 @@ class Roster extends WidgetBase $this->registerEvent('contactadd', 'onRoster'); $this->registerEvent('contactremove', 'onRoster'); $this->registerEvent('presence', 'onPresence'); - + } + + function display() + { $this->view->assign('offline_shown', ''); $offline_state = Cache::c('offlineshown'); diff --git a/app/widgets/ServerNodes/ServerNodes.php b/app/widgets/ServerNodes/ServerNodes.php index a0468d2a2..0070bb312 100644 --- a/app/widgets/ServerNodes/ServerNodes.php +++ b/app/widgets/ServerNodes/ServerNodes.php @@ -26,7 +26,10 @@ class ServerNodes extends WidgetCommon $this->registerEvent('discoerror', 'onDiscoError'); $this->registerEvent('creationsuccess', 'onCreationSuccess'); $this->registerEvent('creationerror', 'onCreationError'); + } + function display() + { if($_GET['s'] != null) { $this->view->assign('server', $this->prepareServer($_GET['s'])); $this->view->assign('get_nodes', $this->genCallAjax('ajaxGetNodes', "'".$_GET['s']."'")); diff --git a/app/widgets/Vcard4/Vcard4.php b/app/widgets/Vcard4/Vcard4.php index 680d8ce95..a1eb173b6 100644 --- a/app/widgets/Vcard4/Vcard4.php +++ b/app/widgets/Vcard4/Vcard4.php @@ -22,7 +22,10 @@ class Vcard4 extends WidgetBase $this->registerEvent('myvcard4valid', 'onMyVcard4Received'); $this->registerEvent('myvcard4invalid', 'onMyVcard4NotReceived'); $this->registerEvent('myvcard', 'onMyVcard4'); - + } + + function display() + { $cd = new \modl\ContactDAO(); $me = $cd->get($this->user->getLogin()); diff --git a/system/widget/WidgetBase.php b/system/widget/WidgetBase.php index 1418443e7..747b49079 100644 --- a/system/widget/WidgetBase.php +++ b/system/widget/WidgetBase.php @@ -94,6 +94,14 @@ class WidgetBase { echo $this->draw(); } + + /* + * @desc Preload some sourcecode for the draw method + */ + function display() + { + + } /** * Return the template's HTML code @@ -102,6 +110,7 @@ class WidgetBase */ function draw() { + $this->display(); return trim($this->view->draw(strtolower($this->name), true)); }