1134 changed files with 24061 additions and 19930 deletions
			
			
		- 
					14.htaccess
- 
					2VERSION
- 
					7app/assets/js/movim_tpl.js
- 
					8app/controllers/MainController.php
- 
					8app/controllers/NewsController.php
- 
					7app/controllers/PodsController.php
- 
					21app/helpers/StringHelper.php
- 
					4app/models/config/Config.php
- 
					5app/models/config/ConfigDAO.php
- 
					21app/models/contact/Contact.php
- 
					26app/models/contact/ContactDAO.php
- 
					45app/models/postn/Postn.php
- 
					163app/models/postn/PostnDAO.php
- 
					22app/views/about.tpl
- 
					23app/views/blog.tpl
- 
					3app/views/chat.tpl
- 
					5app/views/conf.tpl
- 
					7app/views/contact.tpl
- 
					2app/views/help.tpl
- 
					7app/views/login.tpl
- 
					5app/views/main.tpl
- 
					30app/views/news.tpl
- 
					65app/views/page.tpl
- 
					18app/views/pods.tpl
- 
					29app/widgets/About/about.tpl
- 
					2app/widgets/AccountNext/AccountNext.php
- 
					2app/widgets/AccountNext/_accountnext_registered.tpl
- 
					118app/widgets/AdHoc/AdHoc.php
- 
					32app/widgets/AdHoc/_adhoc_form.tpl
- 
					13app/widgets/AdHoc/_adhoc_list.tpl
- 
					8app/widgets/AdHoc/_adhoc_note.tpl
- 
					33app/widgets/AdHoc/adhoc.js
- 
					1app/widgets/AdHoc/adhoc.tpl
- 
					1app/widgets/AdHoc/locales.ini
- 
					2app/widgets/AdminDB/AdminDB.php
- 
					24app/widgets/AdminDB/admindb.tpl
- 
					13app/widgets/AdminMain/AdminMain.php
- 
					96app/widgets/AdminMain/adminmain.tpl
- 
					4app/widgets/AdminMain/locales.ini
- 
					10app/widgets/AdminTest/admintest.css
- 
					46app/widgets/AdminTest/admintest.tpl
- 
					2app/widgets/AdminTest/locales.ini
- 
					17app/widgets/Avatar/Avatar.php
- 
					60app/widgets/Avatar/_avatar_form.tpl
- 
					52app/widgets/Avatar/avatar.css
- 
					92app/widgets/Avatar/avatar.js
- 
					2app/widgets/Avatar/locales.ini
- 
					39app/widgets/Blog/Blog.php
- 
					61app/widgets/Blog/blog.tpl
- 
					10app/widgets/Caps/caps.css
- 
					2app/widgets/Caps/caps.tpl
- 
					84app/widgets/Chat/Chat.php
- 
					2app/widgets/Chat/_chat.tpl
- 
					35app/widgets/Chat/_chat_header.tpl
- 
					47app/widgets/Chat/_chat_header_room.tpl
- 
					32app/widgets/Chat/_chat_message.tpl
- 
					37app/widgets/Chat/_chat_messages.tpl
- 
					5app/widgets/Chat/_chat_state.tpl
- 
					9app/widgets/Chat/chat.css
- 
					32app/widgets/Chats/Chats.php
- 
					6app/widgets/Chats/_chats.tpl
- 
					20app/widgets/Chats/_chats_add.tpl
- 
					18app/widgets/Chats/_chats_add_extend.tpl
- 
					2app/widgets/Chats/chats.js
- 
					2app/widgets/Chats/chats.tpl
- 
					4app/widgets/Chats/locales.ini
- 
					14app/widgets/Config/Config.php
- 
					18app/widgets/Config/_config_form.tpl
- 
					15app/widgets/Config/locales.ini
- 
					81app/widgets/Contact/Contact.php
- 
					110app/widgets/Contact/_contact.tpl
- 
					10app/widgets/Contact/_contact_edit.tpl
- 
					30app/widgets/Contact/_contact_explore.tpl
- 
					70app/widgets/Contact/_contact_header.tpl
- 
					2app/widgets/Contact/contact.tpl
- 
					5app/widgets/Contact/locales.ini
- 
					153app/widgets/ContactAction/ContactAction.php
- 
					3app/widgets/ContactAction/contactaction.tpl
- 
					5app/widgets/ContactAction/locales.ini
- 
					151app/widgets/ContactCard/ContactCard.php
- 
					7app/widgets/ContactCard/contactcard.css
- 
					6app/widgets/ContactCard/contactcard.tpl
- 
					15app/widgets/ContactCard/locales.ini
- 
					163app/widgets/ContactInfo/ContactInfo.php
- 
					12app/widgets/ContactInfo/contactinfo.css
- 
					3app/widgets/ContactInfo/contactinfo.tpl
- 
					13app/widgets/ContactInfo/locales.ini
- 
					76app/widgets/ContactManage/ContactManage.php
- 
					35app/widgets/ContactManage/_contact_manage_form.tpl
- 
					5app/widgets/ContactManage/contactmanage.tpl
- 
					4app/widgets/ContactManage/locales.ini
- 
					74app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php
- 
					5app/widgets/ContactPubsubSubscription/contactpubsubsubscription.js
- 
					10app/widgets/ContactPubsubSubscription/contactpubsubsubscription.tpl
- 
					2app/widgets/ContactPubsubSubscription/locales.ini
- 
					76app/widgets/ContactSummary/ContactSummary.php
- 
					20app/widgets/ContactSummary/_contactsummary_content.tpl
- 
					37app/widgets/ContactSummary/contactsummary.css
- 
					11app/widgets/ContactSummary/contactsummary.tpl
- 
					5app/widgets/Dialog/Dialog.php
| @ -1 +1 @@ | |||
| 0.8.1 | |||
| 0.9 | |||
| @ -1,14 +1,10 @@ | |||
| <?php /* -*- mode: html -*- */ | |||
| ?> | |||
| <main> | |||
|     <section> | |||
|         <div> | |||
|             <?php $this->widget('Tabs');?> | |||
| 
 | |||
| <div id="main"> | |||
|     <div id="left"> | |||
|     </div> | |||
| 
 | |||
|     <?php $this->widget('Tabs');?> | |||
| 
 | |||
|     <div id="center"> | |||
|         <?php $this->widget('About');?> | |||
|         <?php $this->widget('Caps');?> | |||
|     </div> | |||
| </div> | |||
|             <?php $this->widget('About');?> | |||
|             <?php $this->widget('Caps');?> | |||
|         </div> | |||
|     </section> | |||
| </main> | |||
| @ -1,14 +1,11 @@ | |||
| <?php /* -*- mode: html -*- */ | |||
| ?> | |||
| <main> | |||
|     <section> | |||
|         <div> | |||
|             <?php //$this->widget('Tabs');?> | |||
| 
 | |||
| <div id="main"> | |||
|     <div id="left"> | |||
|         <?php $this->widget('ContactSummary');?> | |||
|     </div> | |||
| 
 | |||
|     <?php $this->widget('Tabs');?> | |||
|     <div id="center"> | |||
|         <?php $this->widget('Blog');?> | |||
|         <?php $this->widget('ContactCard');?> | |||
|     </div> | |||
| </div> | |||
|             <?php $this->widget('Blog');?> | |||
|             <?php //$this->widget('ContactSummary');?> | |||
|             <?php //$this->widget('ContactCard');?> | |||
|         </div> | |||
|     </section> | |||
| </main> | |||
| @ -1,17 +1,16 @@ | |||
| <nav class="color dark"> | |||
|     <?php $this->widget('Presence');?> | |||
|     <?php $this->widget('Navigation');?> | |||
|     <?php $this->widget('Presence');?> | |||
| </nav> | |||
| 
 | |||
| <main> | |||
|     <?php $this->widget('Header'); ?> | |||
|     <section> | |||
|         <div> | |||
|             <?php $this->widget('Notifs');?> | |||
|             <?php $this->widget('Roster');?> | |||
|         </div> | |||
|         <div> | |||
|             <?php $this->widget('Notifs');?> | |||
|             <?php $this->widget('Tabs');?> | |||
|         <div id="contact_widget"> | |||
|             <?php $this->widget('Contact');?> | |||
|         </div> | |||
|     </section> | |||
|  | |||
| @ -1,9 +1,8 @@ | |||
| <?php $this->widget('Presence'); ?> | |||
| <main> | |||
|     <section> | |||
|     <div> | |||
|         <?php $this->widget('Login'); ?> | |||
|     </div> | |||
|         <div> | |||
|             <?php $this->widget('Login'); ?> | |||
|         </div> | |||
|     </section> | |||
| 
 | |||
| </main> | |||
| @ -1,20 +1,14 @@ | |||
| <?php /* -*- mode: html -*- */ | |||
| ?> | |||
| <?php $this->widget('Presence');?> | |||
| <?php $this->widget('Chat');?> | |||
| <?php $this->widget('VisioExt');?> | |||
| <?php $this->widget('Init');?> | |||
| 
 | |||
| <div id="container"> | |||
|     <div id="left"> | |||
|         <?php $this->widget('Profile');?> | |||
|         <?php $this->widget('Notifs');?> | |||
|         <?php $this->widget('Bookmark'); ?> | |||
|     </div> | |||
|     <?php $this->widget('Menu');?> | |||
|     <?php $this->widget('Post');?> | |||
| </div> | |||
| 
 | |||
| <div id="right"> | |||
|     <?php $this->widget('Roster');?> | |||
| </div> | |||
| <nav class="color dark"> | |||
|     <?php $this->widget('Navigation');?> | |||
|     <?php $this->widget('Presence');?> | |||
| </nav> | |||
| 
 | |||
| <main> | |||
|     <?php $this->widget('Header');?> | |||
|     <section> | |||
|         <?php $this->widget('Menu');?> | |||
|         <?php $this->widget('Post');?> | |||
|     </section> | |||
| </main> | |||
| @ -1,12 +1,8 @@ | |||
| <?php /* -*- mode: html -*- */ | |||
| ?> | |||
| 
 | |||
| <div id="main"> | |||
|     <div id="left"> | |||
|     </div> | |||
| 
 | |||
|     <div id="center"> | |||
|         <?php $this->widget('Pods');?> | |||
|         <div class="spacetop clear"></div> | |||
|     </div> | |||
| <main> | |||
|     <?php $this->widget('Header'); ?> | |||
|     <section> | |||
|         <div> | |||
|             <?php $this->widget('Pods');?> | |||
|         </div> | |||
|     </section> | |||
| </div> | |||
| @ -0,0 +1,118 @@ | |||
| <?php | |||
| 
 | |||
| use Moxl\Xec\Action\AdHoc\Get; | |||
| use Moxl\Xec\Action\AdHoc\Command; | |||
| use Moxl\Xec\Action\AdHoc\Submit; | |||
| 
 | |||
| class AdHoc extends WidgetBase | |||
| { | |||
|     function load() | |||
|     { | |||
|         $this->addjs('adhoc.js'); | |||
|         $this->registerEvent('adhoc_get_handle', 'onList'); | |||
|         $this->registerEvent('adhoc_command_handle', 'onCommand'); | |||
|         $this->registerEvent('adhoc_submit_handle', 'onCommand'); | |||
|     } | |||
| 
 | |||
|     function onList($package) | |||
|     { | |||
|         $list = $package->content; | |||
|         $html = $this->prepareList($list); | |||
|         RPC::call('movim_fill', 'adhoc_widget', $html); | |||
|         RPC::call('AdHoc.refresh'); | |||
|     } | |||
| 
 | |||
|     function onCommand($package) | |||
|     { | |||
|         $command = $package->content; | |||
| 
 | |||
|         $view = $this->tpl(); | |||
| 
 | |||
|         if(isset($command->note)) { | |||
|             $view->assign('note', $command->note); | |||
| 
 | |||
|             Dialog::fill($view->draw('_adhoc_note', true)); | |||
|         } | |||
| 
 | |||
|         if(isset($command->x)) { | |||
|             $xml = new \XMPPtoForm(); | |||
|             $form = $xml->getHTML($command->x->asXML()); | |||
| 
 | |||
|             $view->assign('form', $form); | |||
|             $view->assign('attributes', $command->attributes()); | |||
|             $view->assign('actions', null); | |||
|             if(isset($command->actions)) { | |||
|                 $view->assign('actions', $command->actions); | |||
|             } | |||
| 
 | |||
|             Dialog::fill($view->draw('_adhoc_form', true), true); | |||
|         } | |||
| 
 | |||
|         RPC::call('AdHoc.initForm'); | |||
|     } | |||
| 
 | |||
|     function prepareList($list) | |||
|     { | |||
|         $view = $this->tpl(); | |||
|         $view->assign('list', $list); | |||
|         return $view->draw('_adhoc_list', true); | |||
|     } | |||
| 
 | |||
|     function ajaxGet() | |||
|     { | |||
|         $session = \Sessionx::start(); | |||
| 
 | |||
|         $g = new Get; | |||
|         $g->setTo($session->host) | |||
|           ->request(); | |||
|     } | |||
| 
 | |||
|     function ajaxCommand($jid, $node) | |||
|     { | |||
|         $c = new Command; | |||
|         $c->setTo($jid) | |||
|           ->setNode($node) | |||
|           ->request(); | |||
|     } | |||
| 
 | |||
|     function ajaxSubmit($data, $node, $sessionid) | |||
|     { | |||
|         $session = \Sessionx::start(); | |||
| 
 | |||
|         $s = new Submit; | |||
|         $s->setTo($session->host) | |||
|           ->setNode($node) | |||
|           ->setData($data) | |||
|           ->setSessionid($sessionid) | |||
|           ->request(); | |||
|     } | |||
| 
 | |||
|     function getIcon($command) | |||
|     { | |||
|         $icons = array( | |||
|             'http://jabber.org/protocol/admin#delete-user' => 'md-delete', | |||
|             'http://jabber.org/protocol/admin#end-user-session' => 'md-stop', | |||
|             'http://jabber.org/protocol/admin#change-user-password' => 'md-lock', | |||
|             'ping' => 'md-swap-horiz', | |||
|             'http://jabber.org/protocol/admin#shutdown' => 'md-settings-power', | |||
|             'http://jabber.org/protocol/admin#add-user' => 'md-person-add', | |||
|             'http://jabber.org/protocol/admin#user-stats' => 'md-people', | |||
|             'uptime' => 'md-access-time', | |||
|             'http://jabber.org/protocol/admin#server-buddy' => 'md-stop', | |||
|             'http://jabber.org/protocol/admin#get-user-roster' => 'md-format-list-bulleted', | |||
|             'http://jabber.org/protocol/admin#get-online-users' => 'md-trending-up', | |||
|             'http://jabber.org/protocol/admin#announce' => 'md-notifications', | |||
|         ); | |||
| 
 | |||
|         if(array_key_exists($command, $icons)) { | |||
|             return $icons[$command]; | |||
|         } else { | |||
|             return 'md-chevron-right'; | |||
|         } | |||
|     } | |||
| 
 | |||
|     function display() | |||
|     { | |||
| 
 | |||
|     } | |||
| } | |||
| @ -0,0 +1,32 @@ | |||
| <section class="scroll"> | |||
|     <form name="command" data-sessionid="{$attributes->sessionid}" data-node="{$attributes->node}"> | |||
|         {$form} | |||
|     </form> | |||
| </section> | |||
| <div> | |||
|     <a onclick="Dialog.clear()" class="button flat"> | |||
|         {$c->__('button.close')} | |||
|     </a> | |||
|     {if="$actions != null"} | |||
|         {if="isset($actions->next)"} | |||
|             <a onclick="AdHoc.submit()" class="button flat"> | |||
|                 {$c->__('button.next')} | |||
|             </a> | |||
|         {/if} | |||
|         {if="isset($actions->previous)"} | |||
|             <a onclick="" class="button flat"> | |||
|                 {$c->__('button.previous')} | |||
|             </a> | |||
|         {/if} | |||
|         {if="isset($actions->cancel)"} | |||
|             <a onclick="" class="button flat"> | |||
|                 {$c->__('button.cancel')} | |||
|             </a> | |||
|         {/if} | |||
|         {if="isset($actions->complete)"} | |||
|             <!--<a onclick="" class="button flat"> | |||
|                 {$c->__('button.submit')} | |||
|             </a>--> | |||
|         {/if} | |||
|     {/if} | |||
| </div> | |||
| @ -0,0 +1,13 @@ | |||
| <ul class="divided active"> | |||
|     {loop="$list"} | |||
|         <li class="action" data-node="{$value->attributes()->node}" data-jid="{$value->attributes()->jid}"> | |||
|             <span class="icon gray"> | |||
|                 <i class="md {$c->getIcon((string)$value->attributes()->node)}"></i> | |||
|             </span> | |||
|             <div class="action"> | |||
|                 <i class="md md-chevron-right"></i> | |||
|             </div> | |||
|             <span>{$value->attributes()->name}</span> | |||
|         </li> | |||
|     {/loop} | |||
| </ul> | |||
| @ -0,0 +1,8 @@ | |||
| <section> | |||
|     <h4 class="gray">{$note}</h4> | |||
| </section> | |||
| <div> | |||
|     <a onclick="Dialog.clear()" class="button flat"> | |||
|         {$c->__('button.close')} | |||
|     </a> | |||
| </div> | |||
| @ -0,0 +1,33 @@ | |||
| var AdHoc = { | |||
|     refresh: function() { | |||
|         var items = document.querySelectorAll('#adhoc_widget li'); | |||
|         var i = 0; | |||
|          | |||
|         while(i < items.length) | |||
|         { | |||
|             items[i].onclick = function() { | |||
|                 AdHoc_ajaxCommand(this.dataset.jid, this.dataset.node); | |||
|             }; | |||
| 
 | |||
|             i++; | |||
|         } | |||
|     }, | |||
|     initForm: function() { | |||
|         var textareas = document.querySelectorAll('#dialog form[name=command] textarea'); | |||
|         var i = 0; | |||
| 
 | |||
|         while(i < textareas.length) | |||
|         { | |||
|             movim_textarea_autoheight(textareas[i]); | |||
|             i++; | |||
|         } | |||
|     }, | |||
|     submit: function() { | |||
|         var form = document.querySelector('#dialog form[name=command]'); | |||
|         AdHoc_ajaxSubmit(movim_parse_form('command'), form.dataset.node, form.dataset.sessionid); | |||
|     } | |||
| } | |||
| 
 | |||
| MovimWebsocket.attach(function() { | |||
|     AdHoc_ajaxGet(); | |||
| }); | |||
| @ -0,0 +1 @@ | |||
| <div class="tabelem" title="{$c->__('adhoc.title')}" id="adhoc_widget" ></div> | |||
| @ -0,0 +1 @@ | |||
| adhoc.title     = 'Actions' | |||
| @ -1,16 +1,51 @@ | |||
| <div class="tabelem" title="{$c->__('page.feed')}" id="blog" > | |||
|     <h1 class="paddedtopbottom">{$title}</h1> | |||
|     <div class="posthead paddedtopbottom"> | |||
|         <a  | |||
|             class="button color orange merged left"  | |||
|             href="{$feed}" | |||
|             target="_blank" | |||
|         > | |||
|             <i class="fa fa-rss"></i> {$c->__('page.feed')} (Atom) | |||
|         </a> | |||
|     </div> | |||
| <div class="tabelem divided" title="{$c->__('page.feed')}" id="blog" > | |||
| 
 | |||
|     {$posts} | |||
|     <ul class="thick"> | |||
|         <li class="action"> | |||
|             <div class="action"> | |||
|                 <a  | |||
|                     href="{$c->route('feed', array($contact->jid, 'urn:xmpp:microblog:0'))}" | |||
|                     target="_blank" | |||
|                 > | |||
|                     <i class="md md-wifi-tethering"></i> Atom | |||
|                 </a> | |||
|             </div> | |||
|             <span class="icon gray"> | |||
|                 <i class="md md-edit"></i> | |||
|             </span> | |||
|             <span> | |||
|                 <h2>{$c->__('blog.title', $contact->getTrueName())}</h2> | |||
|             </span> | |||
|         </li> | |||
|     </ul> | |||
| 
 | |||
|     <div class="spacetop clear"></div> | |||
|     {loop="$posts"} | |||
|         <article> | |||
|             <header> | |||
|                 <ul class="thick"> | |||
|                     <li class="condensed"> | |||
|                         <span class="icon bubble"> | |||
|                             <img src="{$value->getContact()->getPhoto('s')}"> | |||
|                         </span> | |||
|                         <h2> | |||
|                             {if="$value->title != null"} | |||
|                                 {$value->title} | |||
|                             {else} | |||
|                                 {$c->__('post.default_title')} | |||
|                             {/if} | |||
|                         </h2> | |||
|                         <p> | |||
|                             {if="$value->node == 'urn:xmpp:microblog:0'"} | |||
|                                 {$value->getContact()->getTrueName()} -  | |||
|                             {/if} | |||
|                             {$value->published|strtotime|prepareDate} | |||
|                         </p> | |||
|                     </li> | |||
|                 </ul> | |||
|             </header> | |||
|             <section> | |||
|                 {$value->contentcleaned} | |||
|             </section> | |||
|         </article> | |||
|     {/loop} | |||
| </div> | |||
| @ -1,14 +1,21 @@ | |||
| <span id="back" class="icon" onclick="MovimTpl.hidePanel(); Chat_ajaxGet();"><i class="md md-arrow-back"></i></span> | |||
| 
 | |||
| <ul class="active"> | |||
|     <li onclick="Chats_ajaxClose('{$jid}'); MovimTpl.hidePanel();"> | |||
|         <span class="icon"> | |||
|             <i class="md md-close"></i> | |||
|         </span> | |||
|     </li> | |||
| </ul> | |||
| {if="$contact != null"} | |||
|     <h2>{$contact->getTrueName()}</h2> | |||
| {else} | |||
|     <h2>{$jid}</h2> | |||
| {/if} | |||
| <div> | |||
|     <span class="on_desktop icon"><i class="md md-forum"></i></span> | |||
|     <h2>{$c->__('page.chats')}</h2> | |||
| </div> | |||
| <div> | |||
|     <ul class="active"> | |||
|         <li onclick="Chats_ajaxClose('{$jid|echapJS}'); MovimTpl.hidePanel();"> | |||
|             <span class="icon"> | |||
|                 <i class="md md-close"></i> | |||
|             </span> | |||
|         </li> | |||
|     </ul> | |||
|     <h2 class="active r1" onclick="MovimTpl.hidePanel(); Chat_ajaxGet();"> | |||
|         <span id="back" class="icon"><i class="md md-arrow-back"></i></span> | |||
|         {if="$contact != null"} | |||
|             {$contact->getTrueName()} | |||
|         {else} | |||
|             {$jid|echapJS} | |||
|         {/if} | |||
|     </h2> | |||
| </div> | |||
| @ -1,20 +1,27 @@ | |||
| <span id="back" class="icon" onclick="MovimTpl.hidePanel(); Chat_ajaxGet();"><i class="md md-arrow-back"></i></span> | |||
| 
 | |||
| <ul class="active"> | |||
|     <li onclick="Rooms_ajaxList('{$room}')"> | |||
|         <span class="icon"> | |||
|             <i class="md md-menu"></i> | |||
|         </span> | |||
|     </li> | |||
|     <li onclick="Rooms_ajaxRemoveConfirm('{$room}')"> | |||
|         <span class="icon"> | |||
|             <i class="md md-delete"></i> | |||
|         </span> | |||
|     </li> | |||
|     <li onclick="Rooms_ajaxExit('{$room}'); MovimTpl.hidePanel();"> | |||
|         <span class="icon"> | |||
|             <i class="md md-close"></i> | |||
|         </span> | |||
|     </li> | |||
| </ul> | |||
| <h2>{$room}</h2> | |||
| <div> | |||
|     <span class="on_desktop icon"><i class="md md-forum"></i></span> | |||
|     <h2>{$c->__('page.chats')}</h2> | |||
| </div> | |||
| <div> | |||
|     <ul class="active"> | |||
|         <li onclick="Rooms_ajaxList('{$room}')"> | |||
|             <span class="icon"> | |||
|                 <i class="md md-menu"></i> | |||
|             </span> | |||
|         </li> | |||
|         <li onclick="Rooms_ajaxRemoveConfirm('{$room}')"> | |||
|             <span class="icon"> | |||
|                 <i class="md md-delete"></i> | |||
|             </span> | |||
|         </li> | |||
|         <li onclick="Rooms_ajaxExit('{$room}'); MovimTpl.hidePanel();"> | |||
|             <span class="icon"> | |||
|                 <i class="md md-close"></i> | |||
|             </span> | |||
|         </li> | |||
|     </ul> | |||
|     <h2 class="active r3" onclick="MovimTpl.hidePanel(); Chat_ajaxGet();"> | |||
|         <span id="back" class="icon" ><i class="md md-arrow-back"></i></span> | |||
|         {$room} | |||
|     </h2> | |||
| </div> | |||
| @ -0,0 +1,32 @@ | |||
| {if="$message->body != ''"} | |||
| <li {if="$message->jidfrom != $jid"}class="oppose"{/if}> | |||
|     <span class="icon bubble {if="$contact->updated == null && !array_key_exists($message->resource, $contacts)"}color {$message->resource|stringToColor}{/if}"> | |||
|         {if="$message->jidfrom == $jid"} | |||
|             {if="$contact->updated != null"} | |||
|                 <img src="{$contact->getPhoto('s', $jid)}"> | |||
|             {elseif="array_key_exists($message->resource, $contacts)"} | |||
|                 <img src="{$contacts[$message->resource]->getPhoto('s', $jid)}"> | |||
|             {else} | |||
|                 {$message->resource|firstLetterCapitalize} | |||
|             {/if} | |||
|         {else} | |||
|             <img src="{$me->getPhoto('s')}"> | |||
|         {/if} | |||
|     </span> | |||
|     <div class="bubble"> | |||
|         {if="preg_match('#^\?OTR#', $message->body)"} | |||
|             <i class="md md-lock"></i> {$c->__('message.encrypted')} | |||
|         {else} | |||
|             {if="isset($message->html)"} | |||
|                 {$message->html|prepareString} | |||
|             {else} | |||
|                 {$message->body|htmlentities:ENT_COMPAT,'UTF-8'|prepareString} | |||
|             {/if} | |||
|         {/if} | |||
|         <span class="info">{$message->delivered|strtotime|prepareDate}</span> | |||
|         {if="$message->type == 'groupchat'"} | |||
|             <span class="info">{$message->resource} - </span> | |||
|         {/if} | |||
|     </div> | |||
| </li> | |||
| {/if} | |||
| @ -0,0 +1,5 @@ | |||
| <ul class="simple thin"> | |||
|     <li> | |||
|         <p>{$message}</p> | |||
|     </li> | |||
| </ul> | |||
| @ -0,0 +1,18 @@ | |||
| <br /> | |||
| {loop="$contacts"} | |||
|     {if="$group != $value->groupname"} | |||
|         <li class="subheader">{$value->groupname}</li> | |||
|     {/if} | |||
|     <li class="condensed" onclick="Chats_ajaxOpen('{$value->jid}'); Dialog.clear()"> | |||
|         <span class="icon bubble"> | |||
|             <img | |||
|                 class="avatar" | |||
|                 src="{$value->getPhoto('s')}" | |||
|                 alt="avatar" | |||
|             /> | |||
|         </span> | |||
|         <span>{$value->getTrueName()}</span> | |||
|         <p class="wrap">{$value->jid}</p> | |||
|     </li> | |||
|     {$group = $value->groupname} | |||
| {/loop} | |||
| @ -1,3 +1,3 @@ | |||
| <ul id="chats_widget_list" class="thick active divided"> | |||
| <ul id="chats_widget_list" class="thick active divided spaced"> | |||
|     {$list} | |||
| </ul> | |||
| @ -1,13 +1,16 @@ | |||
| config.feed_configuration   = 'Feed Configuration' | |||
| #config.feed_configuration   = 'Feed Configuration' | |||
| config.general              = 'General' | |||
| config.language             = 'Language' | |||
| config.roster               = 'Roster display' | |||
| config.roster_show          = 'Show the offline contacts' | |||
| config.roster_hide          = 'Hide the offline contacts' | |||
| config.appearence           = 'Appearence' | |||
| config.background_color     = 'Background color' | |||
| config.font_size            = 'Font size' | |||
| config.notifications        = 'Notifications' | |||
| config.pattern              = 'Pattern' | |||
| #config.background_color     = 'Background color' | |||
| #config.font_size            = 'Font size' | |||
| #config.notifications        = 'Notifications' | |||
| #config.pattern              = 'Pattern' | |||
| config.info                 = 'This configuration is shared wherever you are connected !'         | |||
| config.updated              = 'Configuration updated' | |||
| 
 | |||
| notifications.message       = 'Notifify on incoming message' | |||
| notifications.message       = 'Notify on incoming message' | |||
| notifications.desktop       = 'Use desktop notifications' | |||
| @ -1,23 +1,31 @@ | |||
| <h2 class="padded">{$c->__('last_registered')}</h2> | |||
| <br /> | |||
| <h2>{$c->__('explore')}</h2> | |||
| 
 | |||
| <ul class="active"> | |||
| <ul class="flex card active thick"> | |||
| {loop="$users"} | |||
|     <li class="condensed" onclick="Contact_ajaxGetContact('{$value->jid}');"> | |||
|         <span class="icon bubble"><img class="avatar" src="{$value->getPhoto('m')}"/></span> | |||
|     <li class="{if="$value->description != ''"}condensed{/if} block" style="background-image: url();" onclick="Contact_ajaxGetContact('{$value->jid}');"> | |||
|         <span class="icon bubble"> | |||
|             <img src="{$value->getPhoto('m')}"/> | |||
|         </span> | |||
|         <span>{$value->getTrueName()}</span> | |||
|         <p> | |||
|          | |||
|             {if="$value->getAge()"} | |||
|                 <span class="tag blue on_desktop">{$value->getAge()}</span> | |||
|                 <span class="info">{$c->__('age.years', $value->getAge())}</span> | |||
|             {/if} | |||
|             {if="$value->getGender()"} | |||
|                 <span class="tag green on_desktop">{$value->getGender()}</span> | |||
|                 <span class="info">{$value->getGender()}</span> | |||
|             {/if} | |||
|             <!-- | |||
|             {if="$value->getMarital()"} | |||
|                 <span class="tag yellow on_desktop">{$value->getMarital()}</span> | |||
|                 <span class="info">{$value->getMarital()}</span> | |||
|             {/if} | |||
|             --> | |||
|          | |||
|             {if="$value->description != ''"} | |||
|             <p> | |||
|                 {$value->description|strip_tags} | |||
|             </p> | |||
|             {/if} | |||
|             <br/> | |||
|             <span class="desc on_desktop">{$value->description|strip_tags}</span> | |||
|         </p> | |||
|     </li> | |||
| {/loop} | |||
| </ul> | |||
| @ -1,36 +1,50 @@ | |||
| <span id="back" class="icon" onclick="MovimTpl.hidePanel(); Contact_ajaxClear();"><i class="md md-arrow-back"></i></span> | |||
| {if="$contactr != null"} | |||
|     <ul class="active"> | |||
|         <li onclick="{$edit}"> | |||
|             <span class="icon"> | |||
|                 <i class="md md-edit"></i> | |||
|             </span> | |||
|         </li> | |||
|         <li onclick="{$delete}"> | |||
|             <span class="icon"> | |||
|                 <i class="md md-delete"></i> | |||
|             </span> | |||
|         </li> | |||
|     </ul> | |||
|     <h2>{$contactr->getTrueName()}</h2> | |||
| {else} | |||
|     {if="$contact != null"} | |||
|         <ul> | |||
|             <li onclick="Roster_ajaxDisplaySearch('{$jid}')"> | |||
| <div> | |||
|     <span class="icon"><i class="md md-people"></i></span> | |||
|     <h2>{$c->__('page.contacts')}</h2> | |||
| </div> | |||
| <div> | |||
|     {if="$contactr != null"} | |||
|         <ul class="active"> | |||
|             <li onclick="{$edit}"> | |||
|                 <span class="icon"> | |||
|                     <i class="md md-person-add"></i> | |||
|                     <i class="md md-edit"></i> | |||
|                 </span> | |||
|             </li> | |||
|         </ul> | |||
|         <h2>{$contact->getTrueName()}</h2> | |||
|     {else} | |||
|         <ul> | |||
|             <li onclick="Roster_ajaxDisplaySearch('{$jid}')"> | |||
|             <li onclick="{$delete}"> | |||
|                 <span class="icon"> | |||
|                     <i class="md md-person-add"></i> | |||
|                     <i class="md md-delete"></i> | |||
|                 </span> | |||
|             </li> | |||
|         </ul> | |||
|         <h2>{$jid}</h2> | |||
|         <h2 class="active r2" onclick="MovimTpl.hidePanel(); Contact_ajaxClear();"> | |||
|             <span id="back" class="icon" ><i class="md md-arrow-back"></i></span> | |||
|             {$contactr->getTrueName()} | |||
|         </h2> | |||
|     {else} | |||
|         {if="$contact != null"} | |||
|             <ul class="active"> | |||
|                 <li onclick="Roster_ajaxDisplaySearch('{$jid}')"> | |||
|                     <span class="icon"> | |||
|                         <i class="md md-person-add"></i> | |||
|                     </span> | |||
|                 </li> | |||
|             </ul> | |||
|             <h2 class="active r2" onclick="MovimTpl.hidePanel(); Contact_ajaxClear();"> | |||
|                 <span id="back" class="icon" ><i class="md md-arrow-back"></i></span> | |||
|                 {$contact->getTrueName()} | |||
|             </h2> | |||
|         {else} | |||
|             <ul class="active"> | |||
|                 <li onclick="Roster_ajaxDisplaySearch('{$jid}')"> | |||
|                     <span class="icon"> | |||
|                         <i class="md md-person-add"></i> | |||
|                     </span> | |||
|                 </li> | |||
|             </ul> | |||
|             <h2 class="active r2" onclick="MovimTpl.hidePanel(); Contact_ajaxClear();"> | |||
|                 <span id="back" class="icon" ><i class="md md-arrow-back"></i></span> | |||
|                 {$jid} | |||
|             </h2> | |||
|         {/if} | |||
|     {/if} | |||
| {/if} | |||
| </div> | |||
| @ -1,3 +1,3 @@ | |||
| <div id="contact_widget" class="tabelem" title="{$c->__('page.profile')}"> | |||
| <div class="tabelem" title="{$c->__('page.profile')}"> | |||
|     {$c->prepareEmpty()} | |||
| </div> | |||
| @ -1,153 +0,0 @@ | |||
| <?php | |||
| 
 | |||
| /** | |||
|  * @package Widgets | |||
|  * | |||
|  * @file ContactAction.php | |||
|  * This file is part of MOVIM. | |||
|  * | |||
|  * @brief Do some actions on a contact | |||
|  * | |||
|  * @author Jaussoin Timothée <edhelas@gmail.com> | |||
|  * | |||
|  * Copyright (C)2013 MOVIM project | |||
|  * | |||
|  * See COPYING for licensing information. | |||
|  */ | |||
| 
 | |||
| use Moxl\Xec\Action\Roster\AddItem; | |||
| use Moxl\Xec\Action\Roster\RemoveItem; | |||
| use Moxl\Xec\Action\Presence\Subscribe; | |||
| use Moxl\Xec\Action\Presence\Unsubscribe; | |||
| 
 | |||
| class ContactAction extends WidgetCommon | |||
| { | |||
|     /** | |||
|      * @brief Adding a new contact  | |||
|      * @param $jid  | |||
|      * @param $alias  | |||
|      * @returns  | |||
|      */ | |||
|     function ajaxAddContact($jid) { | |||
|         $r = new AddItem; | |||
|         $r->setTo($jid) | |||
|           ->setFrom($this->user->getLogin()) | |||
|           ->request(); | |||
|     } | |||
|      | |||
|     function ajaxSubscribeContact($jid) { | |||
|         $p = new Subscribe; | |||
|         $p->setTo($jid) | |||
|           ->request(); | |||
|     } | |||
|      | |||
|      | |||
|     function ajaxRemoveContact($jid) {          | |||
|         $r = new RemoveItem; | |||
|         $r->setTo($jid) | |||
|           ->request(); | |||
|     } | |||
|      | |||
|     function ajaxUnsubscribeContact($jid) {          | |||
|         $p = new Unsubscribe; | |||
|         $p->setTo($jid) | |||
|           ->request(); | |||
|     } | |||
|      | |||
|     function prepareContactInfo() | |||
|     { | |||
|         $cd = new \modl\ContactDAO(); | |||
|         $c = $cd->getRosterItem($_GET['f']); | |||
|          | |||
|         $html = ''; | |||
|          | |||
|         if(isset($c)) {             | |||
|             // Chat button
 | |||
|             if($c->jid != $this->user->getLogin()) { | |||
|                 $presences = getPresences(); | |||
|                  | |||
|                 $html .='<h2>'.$this->__('action.title').'</h2>'; | |||
|                  | |||
|                 $ptoc = array( | |||
|                     1 => 'green', | |||
|                     2 => 'yellow', | |||
|                     3 => 'red',  | |||
|                     4 => 'purple' | |||
|                 ); | |||
| 
 | |||
|                 if($c->value && !in_array((int)$c->value, array(5, 6))) { | |||
|                     $html .= ' | |||
|                         <a | |||
|                             class="button color '.$ptoc[(int)$c->value].'" | |||
|                             id="friendchat" | |||
|                             onclick="'.$this->genCallWidget("Chat","ajaxOpenTalk", "'".$c->jid."'").'" | |||
|                         > | |||
|                             <i class="fa fa-comment"></i> '.$presences[(int)$c->value].' - '.$this->__('action.chat').' | |||
|                         </a>'; | |||
|                 } | |||
|             } | |||
|              | |||
|             $html .= '<div style="clear: both;"></div><br />'; | |||
|              | |||
|             $html .=' | |||
|             <a | |||
|                 class="button color black" | |||
|                 id="friendremoveask" | |||
|                 onclick="
 | |||
|                     document.querySelector(\'#friendremoveyes\').style.display = \'block\';
 | |||
|                     document.querySelector(\'#friendremoveno\').style.display = \'block\';
 | |||
|                     this.style.display = \'none\' | |||
|                 "
 | |||
|             > | |||
|                 <i class="fa fa-minus"></i> '.$this->__('action.remove').' | |||
|             </a> | |||
| 
 | |||
|             <a | |||
|                 class="button color green merged left';
 | |||
|             if(!isset($c->presence) || $c->presence == 5) | |||
|                 $html .=' left'; | |||
|             $html .= '"
 | |||
|                 id="friendremoveyes" | |||
|                 style="float: left; display: none;" | |||
|                 onclick="
 | |||
|                     setTimeout(function() {'. | |||
|                         $this->call("ajaxRemoveContact", "'".$_GET['f']."'"). | |||
|                     '}, 1500);'. | |||
|                     $this->call("ajaxUnsubscribeContact", "'".$_GET['f']."'"). | |||
|                 'this.className=\'button color green icon loading merged left\'; setTimeout(function() {location.reload(false)}, 2000);"
 | |||
|             > | |||
|                 <i class="fa fa-check"></i> '.__('button.yes').' | |||
|             </a> | |||
| 
 | |||
|             <a | |||
|                 class="button color red merged right" | |||
|                 style="float: left; display: none;" | |||
|                 id="friendremoveno" | |||
|                 onclick="
 | |||
|                     document.querySelector(\'#friendremoveask\').style.display = \'block\';
 | |||
|                     document.querySelector(\'#friendremoveyes\').style.display = \'none\';
 | |||
|                     this.style.display = \'none\' | |||
|                 "
 | |||
|             > | |||
|                 <i class="fa fa-times"></i> '.__('button.no').' | |||
|             </a>'; | |||
|         } elseif($_GET['f'] != $this->user->getLogin()) { | |||
|             $html .='<h2>'.$this->__('action.actions').'</h2>'; | |||
|              | |||
|             $html .=' | |||
|             <a | |||
|                 class="button color purple" | |||
|                 onclick="
 | |||
|                     setTimeout(function() {'. | |||
|                         $this->call("ajaxAddContact", "'".$_GET['f']."'"). | |||
|                     '}, 1500);'. | |||
|                 $this->call("ajaxSubscribeContact", "'".$_GET['f']."'"). | |||
|                 'this.className=\'button color purple icon loading merged left\'; setTimeout(function() {location.reload(false)}, 3000);"
 | |||
|             > | |||
|                 <i class="fa fa-plus"></i> '.$this->__('action.invite').' | |||
|             </a>'; | |||
|         } | |||
|          | |||
|         return $html; | |||
|     } | |||
| } | |||
| @ -1,3 +0,0 @@ | |||
| <div class="paddedtopbottom" id="contactaction_widget"> | |||
|     {$c->prepareContactInfo()} | |||
| </div> | |||
| @ -1,5 +0,0 @@ | |||
| action.title       = 'Actions' | |||
| action.chat        = 'Chat' | |||
| action.actions     = 'Actions' | |||
| action.invite      = 'Invite this user' | |||
| action.remove      = 'Remove this contact' | |||
| @ -1,151 +0,0 @@ | |||
| <?php | |||
| 
 | |||
| /** | |||
|  * @package Widgets | |||
|  * | |||
|  * @file Roster.php | |||
|  * This file is part of MOVIM. | |||
|  * | |||
|  * @brief The Roster widget | |||
|  * | |||
|  * @author Jaussoin Timothée <edhelas@gmail.com> | |||
|  * | |||
|  * @version 1.0 | |||
|  * @date 30 August 2010 | |||
|  * | |||
|  * Copyright (C)2010 MOVIM project | |||
|  * | |||
|  * See COPYING for licensing information. | |||
|  */ | |||
| 
 | |||
| class ContactCard extends WidgetCommon | |||
| { | |||
| 
 | |||
|     function load() | |||
|     { | |||
|     	$this->addcss('contactcard.css'); | |||
| 		$this->registerEvent('vcard', 'onVcard'); | |||
|     } | |||
|      | |||
|     function display() | |||
|     { | |||
|         $cd = new \Modl\ContactDAO(); | |||
|         $this->view->assign('contact', $cd->get($_GET['f'])); | |||
|     } | |||
| 
 | |||
|     function onVcard($contact) | |||
|     { | |||
|         $html = $this->prepareContactCard($contact); | |||
|         RPC::call('movim_fill', 'contactcard', $html); | |||
|     } | |||
| 
 | |||
|     function prepareContactCard($contact) | |||
|     { | |||
|         $gender = getGender(); | |||
|         $marital = getMarital(); | |||
|          | |||
|         $html = ''; | |||
| 
 | |||
|         $html .= ' | |||
|             <form name="vcard" id="vcardform"> | |||
|             <h1 class="padded">'.$this->__('Profile').'</h1> | |||
|                 <fieldset> | |||
|                     <legend>'.$this->__('general.legend').'</legend>'; | |||
|                      | |||
|             if($this->testIsSet($contact->fn)) | |||
|             $html .= '<div class="element simple"> | |||
|                         <label for="fn">'.$this->__('general.name').'</label> | |||
|                         <span>'.$contact->fn.'</span> | |||
|                       </div>'; | |||
| 
 | |||
|             if($this->testIsSet($contact->name))                         | |||
|             $html .= '<div class="element simple"> | |||
|                         <label for="name">'.$this->__('general.nickname').'</label> | |||
|                         <span>'.$contact->name.'</span> | |||
|                       </div>'; | |||
| 
 | |||
|             if(strtotime($contact->date) != 0) | |||
|             $html .= '<div class="element simple"> | |||
|                         <label for="day">'.$this->__('general.date_of_birth').'</label> | |||
|                         <span>'.prepareDate(strtotime($contact->date), false).'</span> | |||
|                       </div>'; | |||
|              | |||
|             if($contact->gender != 'N' && $this->testIsSet($contact->gender)) | |||
|             $html .= '<div class="element simple"> | |||
|                         <label for="gender">'.$this->__('general.gender').'</label> | |||
|                         <span>'.$gender[(string)$contact->gender].'</span> | |||
|                       </div>'; | |||
|         | |||
|             if($contact->marital != 'none' && $this->testIsSet($contact->marital))                | |||
|             $html .= '<div class="element simple"> | |||
|                         <label for="marital">'.$this->__('general.marital').'</label> | |||
|                         <span>'.$marital[(string)$contact->marital].'</span> | |||
|                       </div>'; | |||
| 
 | |||
|             if($this->testIsSet($contact->email)) { | |||
|                 if(filter_var($contact->email, FILTER_VALIDATE_EMAIL)) { | |||
|                     $html .= '<div class="element simple"> | |||
|                                 <label for="url">'.$this->__('general.email').'</label> | |||
|                                 <img src="'.$contact->getPhoto('email').'"/> | |||
|                               </div>'; | |||
|                 } else { | |||
|                     $html .= '<div class="element simple"> | |||
|                                 <label for="url">'.$this->__('general.email').'</label> | |||
|                                 '.$contact->email.' | |||
|                               </div>';                     | |||
|                 } | |||
|             } | |||
|                        | |||
|             if($this->testIsSet($contact->url)) { | |||
|                 if(filter_var($contact->url, FILTER_VALIDATE_URL)) { | |||
|                     $html .= '<div class="element simple"> | |||
|                                 <label for="url">'.$this->__('general.legend').'</label> | |||
|                                 <a target="_blank" href="'.$contact->url.'">'.$contact->url.'</a> | |||
|                               </div>'; | |||
|                 } else { | |||
|                     $html .= '<div class="element simple"> | |||
|                                 <label for="url">'.$this->__('general.legend').'</label> | |||
|                                 '.$contact->url.' | |||
|                               </div>';      | |||
|                 } | |||
|             } | |||
|                | |||
|             if($this->testIsSet($contact->description) && prepareString($contact->description) != '') | |||
|             $html .= '<div class="element large simple"> | |||
|                         <label for="desc">'.$this->__('general.about').'</label> | |||
|                         <span style="white-space: pre-wrap;">'.prepareString($contact->description).'</span> | |||
|                       </div>'; | |||
|                        | |||
|             if($this->testIsSet($contact->adrlocality) || | |||
|                $this->testIsSet($contact->adrcountry)) { | |||
|                 $html .= '</fieldset> | |||
|                             <br /> | |||
|                           <fieldset> | |||
|                             <legend>'.$this->__('position.legend').'</legend>'; | |||
|                              | |||
|                 if($this->testIsSet($contact->adrlocality)) { | |||
|                     $locality = '<div class="element simple"> | |||
|                                 <label for="adrlocality">'.$this->__('position.locality').'</label> | |||
|                                 <span>'.$contact->adrlocality; | |||
|                     if($contact->adrpostalcode != 0) | |||
|                         $locality .= ' ('.$contact->adrpostalcode.')'; | |||
|                     $locality .= '</span> | |||
|                               </div>'; | |||
|                      | |||
|                     $html .= $locality; | |||
|                 } | |||
|                              | |||
|                 if($this->testIsSet($contact->adrcountry)) | |||
|                 $html .= '<div class="element simple"> | |||
|                             <label for="adrcountry">'.$this->__('position.coutry').'</label> | |||
|                             <span>'.$contact->adrcountry.'</span> | |||
|                           </div>'; | |||
|             } | |||
|                        | |||
|             $html .= '</fieldset> | |||
|                       <div class="config_button" onclick="'.$this->genCallWidget("ContactSummary","ajaxRefreshVcard", "'".$contact->jid."'").'"></div> | |||
|                 </form>'; | |||
|          | |||
|         return $html; | |||
|     } | |||
| } | |||
| @ -1,7 +0,0 @@ | |||
| #contactcard h1 { | |||
|     padding: 0; | |||
| } | |||
| 
 | |||
| #contactcard .protect { | |||
|     margin-right: -1rem; | |||
| } | |||
| @ -1,6 +0,0 @@ | |||
| <div class="tabelem paddedtop" title="{$c->__('page.profile')}" id="contactcard"> | |||
|     <div class="protect red" title="{function="getFlagTitle("red")"}"></div> | |||
|         {if="isset($contact)"} | |||
|             {$c->prepareContactCard($contact)} | |||
|         {/if} | |||
| </div> | |||
| @ -1,15 +0,0 @@ | |||
| [general] | |||
| general.legend          = 'General Informations' | |||
| general.name            = 'Name' | |||
| general.nickname        = 'Nickname' | |||
| general.date_of_birth   = 'Date of Birth' | |||
| general.gender          = 'Gender' | |||
| general.marital         = 'Marital Status' | |||
| general.email           = 'Email' | |||
| general.website         = 'Website' | |||
| general.about           = 'About Me' | |||
| 
 | |||
| [position] | |||
| position.legend         = 'Geographic Position' | |||
| position.locality       = 'Locality' | |||
| position.country        = 'Country' | |||
| @ -1,163 +0,0 @@ | |||
| <?php | |||
| 
 | |||
| /** | |||
|  * @package Widgets | |||
|  * | |||
|  * @file ContactInfo.php | |||
|  * This file is part of MOVIM. | |||
|  * | |||
|  * @brief Display some informations on a Contact | |||
|  * | |||
|  * @author Jaussoin Timothée <edhelas@gmail.com> | |||
|  * | |||
|  * Copyright (C)2013 MOVIM project | |||
|  * | |||
|  * See COPYING for licensing information. | |||
|  */ | |||
| 
 | |||
| class ContactInfo extends WidgetCommon | |||
| {     | |||
|     function load() | |||
|     { | |||
|     	$this->addcss('contactinfo.css'); | |||
|         $this->registerEvent('tune', 'onTune');     | |||
|     } | |||
| 
 | |||
|     function onTune($from) | |||
|     { | |||
|         $html = $this->prepareContactInfo($from);      | |||
|         RPC::call('movim_fill', 'contactinfo', $html); | |||
|     } | |||
| 
 | |||
|     function prepareContactInfo($from = false) | |||
|     { | |||
|         $cd = new \Modl\ContactDAO(); | |||
|         if($from != $this->user->getLogin()) | |||
|             $c = $cd->getRosterItem($from); | |||
|         else | |||
|             $c = $cd->get($from); | |||
|          | |||
|         $html = ''; | |||
|          | |||
|         if(isset($c)) { | |||
|             // Mood
 | |||
|             if($c->mood) { | |||
|                 $moodarray = getMood(); | |||
|                  | |||
|                 $html .= '<h2><i class="fa fa-smile-o"></i> '.$this->__('mood.title').'</h2>'; | |||
|                 $mood = ''; | |||
|                 foreach(unserialize($c->mood) as $m) | |||
|                     $mood .= $moodarray[$m].','; | |||
|                 $html .= $this->__('mood.im').substr($mood, 0, -1).'<br />'; | |||
|             } | |||
|              | |||
|             // Tune
 | |||
|             if($c->tuneartist || $c->tunetitle) { | |||
|                 $album = $artist = $title = $img = ''; | |||
|                  | |||
|                 $html .= '<h2><i class="fa fa-music"></i> '.$this->__('listen.title').'</h2>'; | |||
|                 if($c->tuneartist) | |||
|                     $artist = $c->tuneartist. ' - '; | |||
|                 if($c->tunetitle) | |||
|                     $title = $c->tunetitle; | |||
|                 if($c->tunesource) | |||
|                     $album = $this->__('listen.on').' '.$c->tunesource; | |||
|                      | |||
|                 if($c->tunesource) { | |||
|                     $l = str_replace( | |||
|                         ' ',  | |||
|                         '%20',  | |||
|                         'http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=80c1aa3abfa9e3d06f404a2e781e38f9&artist='. | |||
|                             $c->tuneartist. | |||
|                             '&album='. | |||
|                             $c->tunesource. | |||
|                             '&format=json' | |||
|                         ); | |||
|                      | |||
|                     $json = json_decode(requestURL($l, 2)); | |||
|                      | |||
|                     $img = $json->album->image[2]->{'#text'}; | |||
|                     $url = $json->album->url; | |||
|                     if(isset($img) && $img != '') { | |||
|                         $img = ' | |||
|                             <a href="'.$url.'" target="_blank"> | |||
|                                 <img src="'.$img.'"/> | |||
|                             </a>'; | |||
|                     } | |||
|                 } | |||
|                      | |||
|                 $html .= $artist.$title.' '.$album.$img; | |||
|             } | |||
|              | |||
|             // Last seen
 | |||
|             if($c->delay != null  | |||
|                 && $c->delay  | |||
|                 && $c->delay != '0000-00-00 00:00:00') { | |||
|                 $html .= '<h2><i class="fa fa-clock-o"></i> '.$this->__('last.title').'</h2>'; | |||
|                 $html .= prepareDate(strtotime($c->delay)).'<br />'; | |||
|             } | |||
| 
 | |||
|             // Client informations
 | |||
|             if( $c->node != null  | |||
|                 && $c->ver != null  | |||
|                 && $c->node  | |||
|                 && $c->ver) {                 | |||
|                 $node = $c->node.'#'.$c->ver; | |||
| 
 | |||
|                 $cad = new \Modl\CapsDAO(); | |||
|                 $caps = $cad->get($node); | |||
| 
 | |||
|                 $clienttype = getClientTypes(); | |||
|                          | |||
|                 if(isset($caps) && $caps->name != '' && $caps->type != '' ) { | |||
|                     $cinfos = ''; | |||
|                     if(isset($clienttype[$caps->type])) | |||
|                         $type = ' ('.$clienttype[$caps->type].')'; | |||
|                     else | |||
|                         $type = ''; | |||
|                      | |||
|                     $cinfos .=  $caps->name.$type.'<br />'; | |||
|                      | |||
|                     $html .='<h2><i class="fa fa-info-circle"></i> '.$this->__('client.title').'</h2>' . $cinfos; | |||
|                 } | |||
|             } | |||
| 
 | |||
|             $html .= '<div class="clear"></div>'; | |||
| 
 | |||
|             // Accounts
 | |||
|             if($c->twitter && $c->twitter != '') { | |||
|                 $html .= ' | |||
|                     <a | |||
|                         class="button color blue" | |||
|                         target="_blank" | |||
|                         href="https://twitter.com/'.$c->twitter.'"> | |||
|                         <i class="fa fa-twitter"></i> @'.$c->twitter.' | |||
|                     </a>'; | |||
|             } | |||
|              | |||
|             if($c->skype && $c->skype != '') { | |||
|                 $html .= ' | |||
|                     <a | |||
|                         class="button color green" | |||
|                         target="_blank" | |||
|                         href="callto://'.$c->skype.'"> | |||
|                         <i class="fa fa-skype"></i> '.$c->skype.' | |||
|                     </a>'; | |||
|             } | |||
|              | |||
|             if($c->yahoo && $c->yahoo != '') { | |||
|                 $html .= ' | |||
|                     <a | |||
|                         class="button color purple" | |||
|                         target="_blank" | |||
|                         href="ymsgr:sendIM?'.$c->yahoo.'"> | |||
|                         <i class="fa fa-yahoo"></i> '.$c->yahoo.' | |||
|                     </a>'; | |||
|             } | |||
| 
 | |||
|             $html .= '<div class="clear"></div>'; | |||
|         } | |||
|          | |||
|         return $html; | |||
|     } | |||
| } | |||
| @ -1,12 +0,0 @@ | |||
| #contactinfo a { | |||
|     display: inline-block; | |||
|     margin-top: 1em; | |||
| } | |||
| 
 | |||
| #contactinfo a:first-child { | |||
|     margin-top: 2em; | |||
| } | |||
| 
 | |||
| #contactinfo img { | |||
|     width: 100%; | |||
| } | |||
| @ -1,3 +0,0 @@ | |||
| <div id="contactinfo" class="paddedtop"> | |||
|     {$c->prepareContactInfo($_GET['f'])} | |||
| </div>   | |||
| @ -1,13 +0,0 @@ | |||
| [mood] | |||
| mood.title          = 'Mood' | |||
| mood.im             = "I'm " | |||
| 
 | |||
| [listen] | |||
| listen.title        = 'Listening' | |||
| listen.on           = 'on' | |||
| 
 | |||
| [last] | |||
| last.title          = 'Last seen' | |||
| 
 | |||
| [client] | |||
| client.title        = 'Client Informations' | |||
| @ -1,76 +0,0 @@ | |||
| <?php | |||
| 
 | |||
| /** | |||
|  * @package Widgets | |||
|  * | |||
|  * @file ContactManage.php | |||
|  * This file is part of MOVIM. | |||
|  * | |||
|  * @brief A little widget which manage the current contact | |||
|  * | |||
|  * @author Jaussoin Timothée <edhelas@gmail.com> | |||
|  * | |||
|  * @version 1.0 | |||
|  * @date 24 March 2013 | |||
|  * | |||
|  * Copyright (C)2013 MOVIM project | |||
|  * | |||
|  * See COPYING for licensing information. | |||
|  */ | |||
| 
 | |||
| use Moxl\Xec\Action\Roster\UpdateItem; | |||
| 
 | |||
| class ContactManage extends WidgetCommon | |||
| { | |||
|     function load()  | |||
|     { | |||
|         $this->registerEvent('roster_updateitem_handle', 'onRoster'); | |||
|     } | |||
|      | |||
|     function display() | |||
|     { | |||
|         $this->view->assign('ok', ($_GET['f'] != $this->user->getLogin())); | |||
|         $this->view->assign('contact', $this->prepareContactManage($_GET['f'])); | |||
|     } | |||
| 
 | |||
|     public function onRoster($packet) | |||
|     { | |||
|         $contact = $packet->content[0]; | |||
|          | |||
|         $html = $this->prepareContactManage($contact->jid); | |||
|         Notification::append(null, $this->__('contact.updated')); | |||
|         RPC::call('movim_fill', 'contactmanage', $html); | |||
|     } | |||
|      | |||
|     public function ajaxContactManage($form)  | |||
|     { | |||
|         $rd = new UpdateItem; | |||
|         $rd->setTo(echapJid($form['jid'])) | |||
|            ->setFrom($this->user->getLogin()) | |||
|            ->setName(htmlspecialchars($form['alias'])) | |||
|            ->setGroup(htmlspecialchars($form['group'])) | |||
|            ->request(); | |||
|     } | |||
|      | |||
|     private function prepareContactManage($jid)  | |||
|     { | |||
|         $rd = new \Modl\RosterLinkDAO(); | |||
|         $groups = $rd->getGroups(); | |||
|         $rl     = $rd->get($jid); | |||
|          | |||
|         $html = ''; | |||
| 
 | |||
|         if(isset($rl)) { | |||
|             $form = $this->tpl(); | |||
|             $form->assign('submit',  | |||
|                 $this->call( | |||
|                     'ajaxContactManage',  | |||
|                     "movim_parse_form('manage')")); | |||
|             $form->assign('rl', $rl); | |||
|             $form->assign('groups', $groups); | |||
|             $html = $form->draw('_contact_manage_form', true); | |||
|         } | |||
|          | |||
|         return $html; | |||
|     }     | |||
| } | |||
| @ -1,35 +0,0 @@ | |||
| <h2>{$c->__('title')}</h2> | |||
| <form name="manage"> | |||
|     <input type="hidden" name="jid" value="{$rl->jid}"/> | |||
|     <div class="element large mini"> | |||
|         <input  | |||
|             name="alias"  | |||
|             id="alias"  | |||
|             class="tiny"  | |||
|             placeholder="{$c->__('alias')}"  | |||
|             value="{$rl->rostername}"/> | |||
|     </div> | |||
|     <div class="element large mini"> | |||
|         <datalist id="group" style="display: none;"> | |||
|             {if="is_array($groups)"} | |||
|                 {loop="$groups"} | |||
|                     <option value="{$value}"/> | |||
|                 {/loop} | |||
|             {/if} | |||
|         </datalist> | |||
|         <input  | |||
|             name="group"  | |||
|             list="group"  | |||
|             id="alias"  | |||
|             class="tiny"  | |||
|             placeholder="{$c->__('group')}"  | |||
|             value="{$rl->groupname}"/> | |||
|     </div> | |||
|      | |||
|     <a  | |||
|         name="submit"  | |||
|         class="button color green"  | |||
|         onclick="{$submit} this.style.display = 'none';"> | |||
|         <i class="fa fa-check"></i> {$c->__('button.save')} | |||
|     </a> | |||
| </form> | |||
| @ -1,5 +0,0 @@ | |||
| <div id="contactmanage" class="paddedtop"> | |||
|     {if="$ok"} | |||
|         {$contact} | |||
|     {/if} | |||
| </div> | |||
| @ -1,4 +0,0 @@ | |||
| title           = 'Manage' | |||
| alias           = 'Alias' | |||
| group           = 'Group' | |||
| contact.updated = 'Contact updated' | |||
| @ -1,74 +0,0 @@ | |||
| <?php | |||
| 
 | |||
| /** | |||
|  * @package Widgets | |||
|  * | |||
|  * @file ContactPubsubSubscription.php | |||
|  * This file is part of MOVIM. | |||
|  * | |||
|  * @brief The Group configuration widget | |||
|  * | |||
|  * @author Ho Christine <nodpounod@gmail.com> | |||
|  * | |||
|  * @version 1.0 | |||
|  * @date 24 March 2013 | |||
|  * | |||
|  * Copyright (C)2010 MOVIM project | |||
|  * | |||
|  * See COPYING for licensing information. | |||
|  */ | |||
| 
 | |||
| use Moxl\Xec\Action\PubsubSubscription\ListGetFriends; | |||
| 
 | |||
| class ContactPubsubSubscription extends WidgetBase | |||
| { | |||
|     function load() | |||
|     { | |||
|         $this->registerEvent('groupsubscribedlist', 'onGroupSubscribedList'); | |||
|         $this->registerEvent('groupsubscribedlisterror', 'onGroupSubscribedListError'); | |||
|         $this->addjs('contactpubsubsubscription.js'); | |||
|     } | |||
|      | |||
|     function display() | |||
|     { | |||
|         $this->view->assign('refresh', $this->call('ajaxGetGroupSubscribedList', "'".$_GET['f']."'")); | |||
|     } | |||
|      | |||
|     function prepareList($list)  | |||
|     {  | |||
|         if(is_array(array_slice($list, 0, 1))){ | |||
|             $html = '<ul class="list">'; | |||
|              | |||
|             foreach($list as $item){ | |||
|                 if(is_array($item)) { | |||
|                     $html .= '<li><a href="'.Route::urlize('node', array($item[1], $item[0])).'">'.$item[2].'</a></li>'; | |||
|                 } | |||
|             } | |||
|              | |||
|             $html .= '</ul>'; | |||
|             return $html; | |||
|         } else { | |||
|             Notification::append(null, $this->__('not_found')); | |||
|         } | |||
|     } | |||
|      | |||
|     function onGroupSubscribedList($list)  | |||
|     { | |||
|         $html = $this->prepareList($list); | |||
|         RPC::call('movim_fill', 'publicgroups', $html);  | |||
|     } | |||
|      | |||
|     function onGroupSubscribedListError($error) | |||
|     { | |||
|         //Notification::appendNotification($error, 'error');
 | |||
|         RPC::call('hidePubsubSubscription'); | |||
|     } | |||
|      | |||
|     function ajaxGetGroupSubscribedList($to) | |||
|     { | |||
|         $r = new ListGetFriends; | |||
|         $r->setTo($to)->request(); | |||
|     } | |||
| } | |||
| 
 | |||
| ?>
 | |||
| @ -1,5 +0,0 @@ | |||
| function hidePubsubSubscription() { | |||
|     wall = document.querySelector("#groupsubscribedlistfromfriend"); | |||
|     wall.parentNode.removeChild(wall); | |||
|     createTabs(); | |||
| } | |||
| @ -1,10 +0,0 @@ | |||
| <div class="tabelem" title="{$c->__('title')}" id="groupsubscribedlistfromfriend"> | |||
|     <div class="protect red" title="{function="getFlagTitle("red")"}"></div> | |||
|     <h1 class="paddedtopbottom">{$c->__('title')}</h1> | |||
|     <script type="text/javascript"> | |||
|         MovimWebsocket.attach(function() { | |||
|             {$refresh} | |||
|         }); | |||
|     </script> | |||
|     <div id="publicgroups" class="paddedtop"></div> | |||
| </div> | |||
| @ -1,2 +0,0 @@ | |||
| title           = 'Public groups' | |||
| not_found       = 'No public groups found' | |||
| @ -1,76 +0,0 @@ | |||
| <?php | |||
| 
 | |||
| /** | |||
|  * @package Widgets | |||
|  * | |||
|  * @file ContactSummary.php | |||
|  * This file is part of MOVIM. | |||
|  * | |||
|  * @brief Contact Summary widget | |||
|  * | |||
|  * @author Jaussoin Timothée <edhelas@movim.eu> | |||
|  * | |||
|  * Copyright (C)2014 MOVIM project | |||
|  * | |||
|  * See COPYING for licensing information. | |||
|  */ | |||
| 
 | |||
| use Moxl\Xec\Action\Vcard\Get; | |||
| 
 | |||
| class ContactSummary extends WidgetCommon | |||
| { | |||
|     function load() | |||
|     { | |||
|         $this->addcss('contactsummary.css'); | |||
|         $this->registerEvent('vcard_get_handle', 'onVcard'); | |||
|     } | |||
|      | |||
|     function display() | |||
|     { | |||
|         $cd = new \Modl\ContactDAO(); | |||
|         $contact = $cd->getRosterItem($_GET['f']); | |||
| 
 | |||
|         if(!isset($contact)) { | |||
|             $contact = $cd->get($_GET['f']); | |||
|         } | |||
|          | |||
|         if(isset($contact)) { | |||
|             $this->view->assign('contact', $contact); | |||
|         } else { | |||
|             $contact = new \Modl\Contact(); | |||
|             $contact->jid = $_GET['f']; | |||
|             $this->view->assign('contact', $contact); | |||
|         } | |||
| 
 | |||
|         $this->view->assign('refresh', $this->call('ajaxRefreshVcard', "'".$_GET['f']."'")); | |||
|     } | |||
|      | |||
|     function onVcard($packet) | |||
|     { | |||
|         $contact = $packet->content; | |||
| 
 | |||
|         // We try to get more informations on the contact
 | |||
|         $cd = new \Modl\ContactDAO(); | |||
|         $contact_roster = $cd->getRosterItem($contact->jid); | |||
| 
 | |||
|         if(!isset($contact_roster)) { | |||
|             $contact_roster = $contact; | |||
|         } | |||
|          | |||
|         $html = $this->prepareContactSummary($contact_roster); | |||
|         RPC::call('movim_fill', 'contactsummary', $html); | |||
|     } | |||
|      | |||
|     function ajaxRefreshVcard($jid) | |||
|     { | |||
|         $r = new Get; | |||
|         $r->setTo(echapJid($jid))->request(); | |||
|     } | |||
|      | |||
|     function prepareContactSummary($contact) | |||
|     { | |||
|         $csc = $this->tpl(); | |||
|         $csc->assign('contact', $contact); | |||
|         return $csc->draw('_contactsummary_content', true); | |||
|     } | |||
| } | |||
| @ -1,20 +0,0 @@ | |||
| <div class="profile" | |||
|     {if="$contact->loclatitude"} | |||
|         data-lat="{$contact->loclatitude}" | |||
|         data-lon="{$contact->loclongitude}" | |||
|         data-avatar="{$contact->getPhoto('s')}" | |||
|         data-date="{$contact->loctimestamp|strtotime|prepareDate}" | |||
|     {/if}> | |||
|     <a | |||
|         class="avatar" | |||
|         style="background-image: url({$contact->getPhoto('l')});" | |||
|         href="{$c->route('friend',$contact->jid)}"> | |||
|     </a> | |||
|     <h1 class="paddedbottom">{$contact->getTrueName()}</h1> | |||
| 
 | |||
|     {if="$contact->status"} | |||
|         <div class="status"> | |||
|             {$contact->status|prepareString} | |||
|         </div> | |||
|     {/if} | |||
| </div> | |||
| @ -1,37 +0,0 @@ | |||
| #contactsummary_widget { | |||
|     line-height: 1.5em; | |||
|     padding-bottom: 1rem; | |||
| } | |||
| 
 | |||
| #contactsummary_widget h1 { | |||
|     text-align: center; | |||
|     color: #333; | |||
|     margin-bottom: 0.5em; | |||
|     line-height: 1.5em; | |||
| } | |||
| 
 | |||
| #contactsummary_widget a.avatar { | |||
|     width: 92%; | |||
|     padding-bottom: 92%; | |||
|     box-shadow: 0 0.1em 0.2em rgba(0, 0, 0, 0.25), 0 0.1em 0.5em rgba(0, 0, 0, 0.20); | |||
|     display: block; | |||
|     margin: 4%; | |||
|     background-size: 100%; | |||
|     border-radius: 0.5em; | |||
| } | |||
| 
 | |||
| #contactsummary_widget a.url { | |||
|     width: 100%; | |||
|     display: block; | |||
|     white-space: nowrap; | |||
|     overflow: hidden; | |||
|     text-overflow: ellipsis; | |||
| 
 | |||
|     box-sizing: border-box; | |||
|     -webkit-box-sizing: border-box; | |||
|     -moz-box-sizing: border-box; | |||
| } | |||
| 
 | |||
| #contactsummary_widget .status { | |||
|     text-align: center; | |||
| } | |||
| @ -1,11 +0,0 @@ | |||
| <div id="contactsummary_widget"> | |||
|     {$c->prepareContactSummary($contact)} | |||
|      | |||
|     <script type="text/javascript"> | |||
|         MovimWebsocket.attach(function() | |||
|         { | |||
|             {$refresh} | |||
|             MovimMap.addContact(); | |||
|         }); | |||
|     </script> | |||
| </div> | |||
Some files were not shown because too many files changed in this diff
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue