diff --git a/system/Cache.php b/system/Cache.php index ad48191d8..f2cdff532 100644 --- a/system/Cache.php +++ b/system/Cache.php @@ -108,23 +108,8 @@ class Cache $md5 = md5($data); $time = time(); - $cd = new \modl\CacheDAO(); - //$var = $cd->get($cache_key) - + $cd = new \modl\CacheDAO(); $c = new \modl\Cache(); - - /*$var = new CacheVar(); - - $query = CacheVar::query()->select() - ->where(array( - 'key' => $cache_key)) - ->limit(0, 1); - $result = CacheVar::run_query($query); - - - if($result) { - $var = $result[0]; - }*/ $c->key = $cache_key; $c->data = $data; @@ -132,8 +117,6 @@ class Cache $c->timestamp = $time; $cd->set($c); - - //$var->run_query($var->query()->save($var)); } /** @@ -146,8 +129,6 @@ class Cache $cd = new \modl\CacheDAO(); $var = $cd->get($cache_key); - //$var = new CacheVar(); - //if($var->load(array('key' => $cache_key))) { if(isset($var)) { return unserialize(gzuncompress(base64_decode(str_replace("\\'", "'", $var->data)))); diff --git a/system/Controller/ControllerMain.php b/system/Controller/ControllerMain.php index dbf71922e..823ce749d 100644 --- a/system/Controller/ControllerMain.php +++ b/system/Controller/ControllerMain.php @@ -64,17 +64,12 @@ class ControllerMain extends ControllerBase function friend() { $user = new User(); + + $cd = new \modl\ContactDAO(); + $contact = $cd->get($_GET['f']); - $query = Contact::query() - ->where( - array( - 'jid' => $_GET['f'] - ) - ); - $contact = Contact::run_query($query); - - if(isset($contact[0])) - $name = $contact[0]->getTrueName(); + if(isset($contact)) + $name = $contact->getTrueName(); else $name = $_GET['f']; diff --git a/system/Session.php b/system/Session.php index eac58b823..dc38e0a1c 100644 --- a/system/Session.php +++ b/system/Session.php @@ -127,16 +127,13 @@ class Session */ public function remove($varname) { - $var = new SessionVar(); - $var->load(array( - 'session' => self::$sid, - 'container' => $this->container, - 'name' => $varname)); - - $query = $var->query()->delete($var); - $var->run_query($query); + $sd = new modl\SessionDAO(); + $sd->delete(self::$sid, $this->container, $varname); } - + + /** + * Deletes all variables of the session. + */ public function delete_container() { $sd = new modl\SessionDAO(); diff --git a/system/Widget/WidgetCommon.php b/system/Widget/WidgetCommon.php index b4a8b8806..705c73708 100644 --- a/system/Widget/WidgetCommon.php +++ b/system/Widget/WidgetCommon.php @@ -405,9 +405,7 @@ class WidgetCommon extends WidgetBase { return $tmp; } - function onComment($parent) { - //list($parent, $comments) = $params; - + function onComment($parent) { $p = new \modl\ContactPost(); $p->nodeid = $parent; diff --git a/system/Widget/widgets/ContactInfo/ContactInfo.php b/system/Widget/widgets/ContactInfo/ContactInfo.php index a4ad3e268..bfa299cc8 100644 --- a/system/Widget/widgets/ContactInfo/ContactInfo.php +++ b/system/Widget/widgets/ContactInfo/ContactInfo.php @@ -169,7 +169,7 @@ class ContactInfo extends WidgetCommon id="friendremoveyes" style="float: left; display: none;" onclick="'.$this->genCallAjax("ajaxRemoveContact", "'".$_GET['f']."'") - . 'this.className=\'button tiny icon loading merged left\'; setTimeout(function() {location.reload(true)}, 2000);" + . 'this.className=\'button tiny icon loading merged left\'; setTimeout(function() {location.reload(false)}, 2000);" > '.t('Yes').' @@ -193,7 +193,7 @@ class ContactInfo extends WidgetCommon class="button tiny icon add" href="#" onclick="'.$this->genCallWidget("Roster","ajaxAddContact", "'".$_GET['f']."'", "''") - . 'this.className=\'button tiny icon loading merged left\'; setTimeout(function() {location.reload(true)}, 2000);" + . 'this.className=\'button tiny icon loading merged left\'; setTimeout(function() {location.reload(false)}, 2000);" > '.t('Invite this user').' '; diff --git a/system/Widget/widgets/Logout/Logout.php b/system/Widget/widgets/Logout/Logout.php index 34b96210a..937db5692 100644 --- a/system/Widget/widgets/Logout/Logout.php +++ b/system/Widget/widgets/Logout/Logout.php @@ -90,21 +90,14 @@ class Logout extends WidgetBase function preparePresence() { $txt = getPresences(); + $txts = getPresencesTxt(); global $session; - $query = Presence::query()->select() - ->where(array( - 'key' => $this->user->getLogin(), - 'jid' => $this->user->getLogin(), - 'ressource' => $session['ressource'])) - ->limit(0, 1); - $data = Presence::run_query($query); - - if($data) - $presence = $data[0]->getPresence(); + $pd = new \modl\PresenceDAO(); + $p = $pd->getPresence($this->user->getLogin(), $session['ressource']); - $html = '
'.$txt[$presence['presence']].'
'; + $html = '
'.$txt[$p->presence].'
'; $html .= '
diff --git a/system/Widget/widgets/Notifs/Notifs.php b/system/Widget/widgets/Notifs/Notifs.php index 81e35d23d..8952444fa 100644 --- a/system/Widget/widgets/Notifs/Notifs.php +++ b/system/Widget/widgets/Notifs/Notifs.php @@ -163,11 +163,8 @@ class Notifs extends WidgetCommon } // Contact request pending - $query = RosterLink::query()->where( - array( - 'key' => $this->user->getLogin(), - 'rosterask' => 'subscribe')); - $subscribes = Contact::run_query($query); + $cd = new \modl\ContactDAO(); + $subscribes = $cd->getRosterSubscribe(); if(sizeof($subscribes) != 0) { $notifsnum += sizeof($subscribes); @@ -181,8 +178,8 @@ class Notifs extends WidgetCommon foreach($subscribes as $s) { $html .= '
  • - - + + '. $s->getTrueName().' diff --git a/system/Widget/widgets/Notifs/notifs.css b/system/Widget/widgets/Notifs/notifs.css index c586b8921..763d6e24e 100644 --- a/system/Widget/widgets/Notifs/notifs.css +++ b/system/Widget/widgets/Notifs/notifs.css @@ -128,8 +128,7 @@ } #notifslist ul li img { -display: none; - height: 24px; + margin-top: 2px; max-width: 24px; float: left; border-radius: 2px; diff --git a/system/Widget/widgets/Roster/Roster.php b/system/Widget/widgets/Roster/Roster.php index cf59e56c2..43710b894 100644 --- a/system/Widget/widgets/Roster/Roster.php +++ b/system/Widget/widgets/Roster/Roster.php @@ -30,7 +30,6 @@ class Roster extends WidgetBase $this->registerEvent('contactadd', 'onRoster'); $this->registerEvent('contactremove', 'onRoster'); $this->registerEvent('presence', 'onPresence'); - //this->registerEvent('vcard', 'onVcard'); $this->cached = false; } @@ -42,23 +41,6 @@ class Roster extends WidgetBase RPC::cdata($arr['jid']), RPC::cdata($arr['presence_txt'])); } - /*function onVcard($contact) - { - $query = \Presence::query()->select() - ->where(array( - 'key' => $this->user->getLogin(), - 'jid' => $contact->getData('jid'))) - ->limit(0, 1); - $data = \Presence::run_query($query); - - $c = array(); - $c[0] = $contact; - $c[1] = $data[0]; - - $html = $this->prepareRosterElement($c, true); - RPC::call('movim_fill', 'roster'.$contact->getData('jid'), RPC::cdata($html)); - }*/ - function onRoster() { $html = $this->prepareRoster(); diff --git a/system/Widget/widgets/Vcard/Vcard.php b/system/Widget/widgets/Vcard/Vcard.php index 8be69d0fc..cd5d98803 100644 --- a/system/Widget/widgets/Vcard/Vcard.php +++ b/system/Widget/widgets/Vcard/Vcard.php @@ -89,17 +89,13 @@ class Vcard extends WidgetBase } function prepareInfos($error = false) { - $query = Contact::query() - ->where( - array( - 'jid' => $this->user->getLogin() - ) - ); - $me = Contact::run_query($query); + + $cd = new \modl\ContactDAO(); + $me = $cd->get($this->user->getLogin()); $submit = $this->genCallAjax('ajaxVcardSubmit', "movim_parse_form('vcard')"); - if(!isset($me[0])) { + if(!isset($me)) { ?>
    '.t("Profile not updated : Request error").'
    '; } - if($me->getData('public') == '1') + if($me->public == '1') $color = 'black'; else $color = 'red'; @@ -140,17 +135,17 @@ class Vcard extends WidgetBase $html .= '
    - +
    '; $html .= '
    - +
    '; $html .= '
    - +
    '; $html .= '
    @@ -166,7 +161,7 @@ class Vcard extends WidgetBase } else { $j = $i; } - if($i == substr( $me->getData('date'), 8)) { + if($i == substr( $me->date, 8)) { $html .= ''; } else { $html .= ''; @@ -186,7 +181,7 @@ class Vcard extends WidgetBase } else { $j = $i; } - if($i == substr( $me->getData('date'), 5, 2)) { + if($i == substr( $me->date, 5, 2)) { $html .= ''; } else { $html .= ''; @@ -200,7 +195,7 @@ class Vcard extends WidgetBase '; foreach(getGender() as $key => $value) { $html .= ''; } @@ -227,7 +222,7 @@ class Vcard extends WidgetBase
    +
    '; $html .= '
    - +
    - -
    + +
    '; $html .= '
    - +
    '; $html .= '
    '; @@ -257,14 +252,14 @@ class Vcard extends WidgetBase '.t('Geographic Position').''; $html .= '
    - +
    '; $html .= '
    -
    '; - $html .= '
    - -
    '; - - $html .= '
    - ';*/ + $html .= '

    '; $html .= 'Ain\'t Nobody Here But Us Chickens...
    '; RPC::call('movim_fill', 'wall', RPC::cdata($html)); @@ -73,9 +62,6 @@ class Wall extends WidgetCommon $pl = $pd->getContact($from, $start+1, 10); // We ask for the HTML of all the posts - /*foreach($pl as $post) { - $htmlmessages .= $this->printPost($post); - }*/ $htmlmessages = $this->preparePosts($pl);