Browse Source

- Create a display() method to prevent extra sourcecode execution when Moxl receive payloads

pull/16/head
Jaussoin Timothée 12 years ago
parent
commit
84f4f9c7b8
  1. 5
      app/widgets/Bookmark/Bookmark.php
  2. 3
      app/widgets/Chat/Chat.php
  3. 5
      app/widgets/Explore/Explore.php
  4. 5
      app/widgets/Feed/Feed.php
  5. 5
      app/widgets/Login/Login.php
  6. 6
      app/widgets/News/News.php
  7. 3
      app/widgets/Node/Node.php
  8. 5
      app/widgets/NodeConfig/NodeConfig.php
  9. 3
      app/widgets/PubsubSubscriptionConfig/PubsubSubscriptionConfig.php
  10. 5
      app/widgets/Roster/Roster.php
  11. 3
      app/widgets/ServerNodes/ServerNodes.php
  12. 5
      app/widgets/Vcard4/Vcard4.php
  13. 9
      system/widget/WidgetBase.php

5
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"));

3
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());
}

5
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());

5
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()));

5
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));

6
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...
*/

3
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']);

5
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']);

3
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')

5
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');

3
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']."'"));

5
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());

9
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));
}

Loading…
Cancel
Save