Browse Source

- Start to remove old widgets

- Add Twimoji pack
- Load library  heyupdate/emoji to replace properly the emoji
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
4096cad284
  1. 13
      app/helpers/StringHelper.php
  2. 3
      app/widgets/Chat/Chat.php
  3. 2
      app/widgets/Chat/chat.css
  4. 153
      app/widgets/ContactAction/ContactAction.php
  5. 3
      app/widgets/ContactAction/contactaction.tpl
  6. 5
      app/widgets/ContactAction/locales.ini
  7. 151
      app/widgets/ContactCard/ContactCard.php
  8. 7
      app/widgets/ContactCard/contactcard.css
  9. 6
      app/widgets/ContactCard/contactcard.tpl
  10. 15
      app/widgets/ContactCard/locales.ini
  11. 163
      app/widgets/ContactInfo/ContactInfo.php
  12. 12
      app/widgets/ContactInfo/contactinfo.css
  13. 3
      app/widgets/ContactInfo/contactinfo.tpl
  14. 13
      app/widgets/ContactInfo/locales.ini
  15. 76
      app/widgets/ContactManage/ContactManage.php
  16. 35
      app/widgets/ContactManage/_contact_manage_form.tpl
  17. 5
      app/widgets/ContactManage/contactmanage.tpl
  18. 4
      app/widgets/ContactManage/locales.ini
  19. 74
      app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php
  20. 5
      app/widgets/ContactPubsubSubscription/contactpubsubsubscription.js
  21. 10
      app/widgets/ContactPubsubSubscription/contactpubsubsubscription.tpl
  22. 2
      app/widgets/ContactPubsubSubscription/locales.ini
  23. 76
      app/widgets/ContactSummary/ContactSummary.php
  24. 20
      app/widgets/ContactSummary/_contactsummary_content.tpl
  25. 37
      app/widgets/ContactSummary/contactsummary.css
  26. 11
      app/widgets/ContactSummary/contactsummary.tpl
  27. 1
      composer.json
  28. 4
      themes/material/css/list.css
  29. BIN
      themes/material/img/smileys/aloneyeah.png
  30. BIN
      themes/material/img/smileys/ange.gif
  31. BIN
      themes/material/img/smileys/angry.png
  32. BIN
      themes/material/img/smileys/confused.gif
  33. BIN
      themes/material/img/smileys/confused.png
  34. BIN
      themes/material/img/smileys/cool.png
  35. BIN
      themes/material/img/smileys/cry.gif
  36. BIN
      themes/material/img/smileys/epic.png
  37. BIN
      themes/material/img/smileys/evil.png
  38. BIN
      themes/material/img/smileys/fapfap.png
  39. BIN
      themes/material/img/smileys/fou.gif
  40. BIN
      themes/material/img/smileys/frown.gif
  41. BIN
      themes/material/img/smileys/genius.png
  42. BIN
      themes/material/img/smileys/grin.png
  43. BIN
      themes/material/img/smileys/gusta.png
  44. BIN
      themes/material/img/smileys/happy.png
  45. BIN
      themes/material/img/smileys/heart.png
  46. BIN
      themes/material/img/smileys/heink.gif
  47. BIN
      themes/material/img/smileys/jap.gif
  48. BIN
      themes/material/img/smileys/locked.png
  49. BIN
      themes/material/img/smileys/loop.png
  50. BIN
      themes/material/img/smileys/neutral.png
  51. BIN
      themes/material/img/smileys/okay.gif
  52. BIN
      themes/material/img/smileys/pencil.png
  53. BIN
      themes/material/img/smileys/petrus75.gif
  54. BIN
      themes/material/img/smileys/pfff.gif
  55. BIN
      themes/material/img/smileys/pt1cable.gif
  56. BIN
      themes/material/img/smileys/redface.gif
  57. BIN
      themes/material/img/smileys/sad.png
  58. BIN
      themes/material/img/smileys/shocked.png
  59. BIN
      themes/material/img/smileys/smiley.png
  60. BIN
      themes/material/img/smileys/tongue.png
  61. BIN
      themes/material/img/smileys/trolldad.png
  62. BIN
      themes/material/img/smileys/trollface.png
  63. BIN
      themes/material/img/smileys/trollol.png
  64. BIN
      themes/material/img/smileys/users.png
  65. BIN
      themes/material/img/smileys/wink.png
  66. BIN
      themes/material/img/smileys/wondering.png

13
app/helpers/StringHelper.php

@ -1,5 +1,8 @@
<?php
use HeyUpdate\Emoji\Emoji;
use HeyUpdate\Emoji\EmojiIndex;
/**
* Prepare the string (add the a to the links and show the smileys)
*
@ -125,12 +128,17 @@ function prepareString($string) {
$config = $cd->get();
$theme = $config->theme;
$path = BASE_URI . 'themes/' . $theme . '/img/smileys/';
$path = BASE_URI . 'themes/' . $theme . '/img/emojis/';
/*
foreach($smileys as $key => $value) {
$replace = ' <img class="smiley" alt="smiley" src="'.$path.$value.'">';
$string = preg_replace('/(^|[ ])('.$key.')/', $replace, $string);
}
}*/
$emoji = new Emoji(new EmojiIndex(), $path.'%s.png');
$string = $emoji->replaceEmojiWithImages($string);
return trim($string);
}
@ -310,4 +318,3 @@ function stringToColor($string) {
function firstLetterCapitalize($string) {
return ucfirst(strtolower(mb_substr($string, 0, 2)));
}

3
app/widgets/Chat/Chat.php

@ -33,6 +33,8 @@ class Chat extends WidgetCommon
&& $message->type != 'groupchat') {
Notification::append('chat|'.$from, $contact->getTrueName(), $message->body, $contact->getPhoto('s'), 4);
}
RPC::call('movim_fill', $from.'_state', '');
// If the message is from me
} else {
$from = $message->jidto;
@ -45,7 +47,6 @@ class Chat extends WidgetCommon
}
RPC::call('movim_append', $from.'_conversation', $this->prepareMessage($message, $from, $contact, $me));
RPC::call('movim_fill', $from.'_state', '');
RPC::call('MovimTpl.scrollPanel');
}

2
app/widgets/Chat/chat.css

@ -18,10 +18,10 @@
#chat_widget .chat_box form > div {
min-height: 0;
margin-bottom: -1rem;
}
#chat_widget .chat_box form textarea {
margin-bottom: 0;
padding: 3rem 0px 1rem;
}

153
app/widgets/ContactAction/ContactAction.php

@ -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;
}
}

3
app/widgets/ContactAction/contactaction.tpl

@ -1,3 +0,0 @@
<div class="paddedtopbottom" id="contactaction_widget">
{$c->prepareContactInfo()}
</div>

5
app/widgets/ContactAction/locales.ini

@ -1,5 +0,0 @@
action.title = 'Actions'
action.chat = 'Chat'
action.actions = 'Actions'
action.invite = 'Invite this user'
action.remove = 'Remove this contact'

151
app/widgets/ContactCard/ContactCard.php

@ -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;
}
}

7
app/widgets/ContactCard/contactcard.css

@ -1,7 +0,0 @@
#contactcard h1 {
padding: 0;
}
#contactcard .protect {
margin-right: -1rem;
}

6
app/widgets/ContactCard/contactcard.tpl

@ -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>

15
app/widgets/ContactCard/locales.ini

@ -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'

163
app/widgets/ContactInfo/ContactInfo.php

@ -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;
}
}

12
app/widgets/ContactInfo/contactinfo.css

@ -1,12 +0,0 @@
#contactinfo a {
display: inline-block;
margin-top: 1em;
}
#contactinfo a:first-child {
margin-top: 2em;
}
#contactinfo img {
width: 100%;
}

3
app/widgets/ContactInfo/contactinfo.tpl

@ -1,3 +0,0 @@
<div id="contactinfo" class="paddedtop">
{$c->prepareContactInfo($_GET['f'])}
</div>

13
app/widgets/ContactInfo/locales.ini

@ -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'

76
app/widgets/ContactManage/ContactManage.php

@ -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;
}
}

35
app/widgets/ContactManage/_contact_manage_form.tpl

@ -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>

5
app/widgets/ContactManage/contactmanage.tpl

@ -1,5 +0,0 @@
<div id="contactmanage" class="paddedtop">
{if="$ok"}
{$contact}
{/if}
</div>

4
app/widgets/ContactManage/locales.ini

@ -1,4 +0,0 @@
title = 'Manage'
alias = 'Alias'
group = 'Group'
contact.updated = 'Contact updated'

74
app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php

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

5
app/widgets/ContactPubsubSubscription/contactpubsubsubscription.js

@ -1,5 +0,0 @@
function hidePubsubSubscription() {
wall = document.querySelector("#groupsubscribedlistfromfriend");
wall.parentNode.removeChild(wall);
createTabs();
}

10
app/widgets/ContactPubsubSubscription/contactpubsubsubscription.tpl

@ -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>

2
app/widgets/ContactPubsubSubscription/locales.ini

@ -1,2 +0,0 @@
title = 'Public groups'
not_found = 'No public groups found'

76
app/widgets/ContactSummary/ContactSummary.php

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

20
app/widgets/ContactSummary/_contactsummary_content.tpl

@ -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>

37
app/widgets/ContactSummary/contactsummary.css

@ -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;
}

11
app/widgets/ContactSummary/contactsummary.tpl

@ -1,11 +0,0 @@
<div id="contactsummary_widget">
{$c->prepareContactSummary($contact)}
<script type="text/javascript">
MovimWebsocket.attach(function()
{
{$refresh}
MovimMap.addContact();
});
</script>
</div>

1
composer.json

@ -15,6 +15,7 @@
"movim/moxl": "dev-ws",
"embed/embed": "dev-master",
"heyupdate/emoji": "0.2.*@dev",
"cboden/ratchet": "0.3.*",
"react/child-process": "0.5.*@dev",

4
themes/material/css/list.css

@ -156,13 +156,14 @@ ul li div.bubble {
line-height: 2.75rem;
position: relative;
box-sizing: border-box;
display: inline-block;
display: block;
border-color: transparent;
font-size: 1.75rem;
background-color: #E5E5E5;
border-color: #E5E5E5;
max-width: 100%;
min-width: 50%;
float: left;
/*word-break: break-all;*/
}
@ -248,4 +249,3 @@ ul.menu:hover {
color: black;
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.26), 0px 2px 10px 0px rgba(0, 0, 0, 0.16);
}

BIN
themes/material/img/smileys/aloneyeah.png

Before

Width: 44  |  Height: 50  |  Size: 3.5 KiB

BIN
themes/material/img/smileys/ange.gif

Before

Width: 21  |  Height: 21  |  Size: 403 B

BIN
themes/material/img/smileys/angry.png

Before

Width: 16  |  Height: 16  |  Size: 452 B

BIN
themes/material/img/smileys/confused.gif

Before

Width: 15  |  Height: 22  |  Size: 110 B

BIN
themes/material/img/smileys/confused.png

Before

Width: 16  |  Height: 16  |  Size: 422 B

BIN
themes/material/img/smileys/cool.png

Before

Width: 16  |  Height: 16  |  Size: 410 B

BIN
themes/material/img/smileys/cry.gif

Before

Width: 16  |  Height: 16  |  Size: 176 B

BIN
themes/material/img/smileys/epic.png

Before

Width: 54  |  Height: 50  |  Size: 4.9 KiB

BIN
themes/material/img/smileys/evil.png

Before

Width: 16  |  Height: 17  |  Size: 493 B

BIN
themes/material/img/smileys/fapfap.png

Before

Width: 53  |  Height: 50  |  Size: 4.0 KiB

BIN
themes/material/img/smileys/fou.gif

Before

Width: 15  |  Height: 15  |  Size: 122 B

BIN
themes/material/img/smileys/frown.gif

Before

Width: 15  |  Height: 15  |  Size: 94 B

BIN
themes/material/img/smileys/genius.png

Before

Width: 59  |  Height: 50  |  Size: 4.2 KiB

BIN
themes/material/img/smileys/grin.png

Before

Width: 16  |  Height: 16  |  Size: 447 B

BIN
themes/material/img/smileys/gusta.png

Before

Width: 49  |  Height: 50  |  Size: 1.9 KiB

BIN
themes/material/img/smileys/happy.png

Before

Width: 16  |  Height: 16  |  Size: 442 B

BIN
themes/material/img/smileys/heart.png

Before

Width: 16  |  Height: 16  |  Size: 248 B

BIN
themes/material/img/smileys/heink.gif

Before

Width: 15  |  Height: 15  |  Size: 282 B

BIN
themes/material/img/smileys/jap.gif

Before

Width: 20  |  Height: 20  |  Size: 457 B

BIN
themes/material/img/smileys/locked.png

Before

Width: 16  |  Height: 16  |  Size: 199 B

BIN
themes/material/img/smileys/loop.png

Before

Width: 16  |  Height: 16  |  Size: 133 B

BIN
themes/material/img/smileys/neutral.png

Before

Width: 16  |  Height: 16  |  Size: 360 B

BIN
themes/material/img/smileys/okay.gif

Before

Width: 52  |  Height: 50  |  Size: 2.1 KiB

BIN
themes/material/img/smileys/pencil.png

Before

Width: 16  |  Height: 16  |  Size: 203 B

BIN
themes/material/img/smileys/petrus75.gif

Before

Width: 15  |  Height: 15  |  Size: 883 B

BIN
themes/material/img/smileys/pfff.gif

Before

Width: 15  |  Height: 15  |  Size: 1.1 KiB

BIN
themes/material/img/smileys/pt1cable.gif

Before

Width: 15  |  Height: 15  |  Size: 500 B

BIN
themes/material/img/smileys/redface.gif

Before

Width: 15  |  Height: 15  |  Size: 95 B

BIN
themes/material/img/smileys/sad.png

Before

Width: 16  |  Height: 16  |  Size: 425 B

BIN
themes/material/img/smileys/shocked.png

Before

Width: 16  |  Height: 16  |  Size: 397 B

BIN
themes/material/img/smileys/smiley.png

Before

Width: 16  |  Height: 16  |  Size: 442 B

BIN
themes/material/img/smileys/tongue.png

Before

Width: 16  |  Height: 16  |  Size: 382 B

BIN
themes/material/img/smileys/trolldad.png

Before

Width: 43  |  Height: 50  |  Size: 3.4 KiB

BIN
themes/material/img/smileys/trollface.png

Before

Width: 62  |  Height: 50  |  Size: 4.3 KiB

BIN
themes/material/img/smileys/trollol.png

Before

Width: 43  |  Height: 50  |  Size: 1.9 KiB

BIN
themes/material/img/smileys/users.png

Before

Width: 16  |  Height: 16  |  Size: 386 B

BIN
themes/material/img/smileys/wink.png

Before

Width: 16  |  Height: 16  |  Size: 452 B

BIN
themes/material/img/smileys/wondering.png

Before

Width: 16  |  Height: 16  |  Size: 419 B

Loading…
Cancel
Save