Browse Source

- Update the translations

- New News page with two column design
- Add nice looking icons for some placeholders
- Fix missing JS/CSS in Avatar
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
af21a6048b
  1. 4
      app/assets/js/movim_utils.js
  2. 4
      app/models/contact/ContactDAO.php
  3. 31
      app/models/postn/Postn.php
  4. 20
      app/models/postn/PostnDAO.php
  5. 25
      app/views/news.tpl
  6. 10
      app/widgets/About/about.tpl
  7. 78
      app/widgets/Avatar/Avatar.php
  8. 3
      app/widgets/Avatar/avatar.tpl
  9. 2
      app/widgets/Bookmark/Bookmark.php
  10. 12
      app/widgets/Bookmark/_bookmark_muc_add.tpl
  11. 4
      app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php
  12. 2
      app/widgets/Feed/_feed_empty.tpl
  13. 19
      app/widgets/Help/Help.php
  14. 12
      app/widgets/Help/help.js
  15. 95
      app/widgets/Help/help.tpl
  16. 20
      app/widgets/Help/locales.ini
  17. 1
      app/widgets/Login/login.css
  18. 2
      app/widgets/Media/_media_empty.tpl
  19. 87
      app/widgets/Menu/Menu.php
  20. 24
      app/widgets/Menu/_menu_list.tpl
  21. 3
      app/widgets/Menu/_menu_refresh.tpl
  22. 2
      app/widgets/Menu/locales.ini
  23. 55
      app/widgets/Menu/menu.css
  24. 26
      app/widgets/Menu/menu.js
  25. 3
      app/widgets/Menu/menu.tpl
  26. 1
      app/widgets/Node/Node.php
  27. 1
      app/widgets/Node/node.tpl
  28. 9
      app/widgets/Notifs/Notifs.php
  29. 23
      app/widgets/Notifs/_notifs_from.tpl
  30. 21
      app/widgets/Notifs/notifs.css
  31. 59
      app/widgets/Post/Post.php
  32. 49
      app/widgets/Post/_post.tpl
  33. 7
      app/widgets/Post/_post_empty.tpl
  34. 2
      app/widgets/Post/locales.ini
  35. 27
      app/widgets/Post/post.css
  36. 8
      app/widgets/Post/post.tpl
  37. 2
      app/widgets/Roster/roster.css
  38. 2
      app/widgets/Roster/roster.tpl
  39. 15
      app/widgets/Vcard4/Vcard4.php
  40. 10
      app/widgets/WidgetCommon/_submit_form.tpl
  41. 85
      linker.php
  42. 1145
      locales/ar.po
  43. 1086
      locales/be.po
  44. 1082
      locales/bn.po
  45. 1133
      locales/br.po
  46. 1098
      locales/da.po
  47. 1217
      locales/de.po
  48. 1111
      locales/el.po
  49. 1104
      locales/eo.po
  50. 1199
      locales/es.po
  51. 1081
      locales/fa.po
  52. 1139
      locales/fi.po
  53. 1227
      locales/fr.po
  54. 1086
      locales/gl.po
  55. 1208
      locales/he.po
  56. 1081
      locales/hr.po
  57. 1110
      locales/id.po
  58. 1081
      locales/io.po
  59. 1186
      locales/it.po
  60. 1164
      locales/ja.po
  61. 1081
      locales/kk.po
  62. 1144
      locales/lv.po
  63. 1081
      locales/messages.pot
  64. 1126
      locales/nl.po
  65. 1087
      locales/no.po
  66. 1163
      locales/oc.po
  67. 1139
      locales/pt.po
  68. 1092
      locales/ro.po
  69. 1181
      locales/ru.po
  70. 1089
      locales/uk.po
  71. 1186
      locales/zh.po
  72. 2
      src/Movim/Daemon/Session.php
  73. 6
      system/Picture.php
  74. 59
      themes/movim/css/style.css
  75. 14
      themes/movim/css/template.css
  76. BIN
      themes/movim/img/icons/placeholder/chat.png
  77. BIN
      themes/movim/img/icons/placeholder/explore.png
  78. BIN
      themes/movim/img/icons/placeholder/file.png
  79. BIN
      themes/movim/img/icons/placeholder/media.png
  80. BIN
      themes/movim/img/icons/placeholder/newspaper.png
  81. BIN
      themes/movim/img/icons/placeholder/plane.png

4
app/assets/js/movim_utils.js

@ -79,8 +79,8 @@ function movim_parse_form(formname) {
data.set(form.elements[i].name,
form.elements[i].value);
}
}
return data;
}
return data;
}
/**

4
app/models/contact/ContactDAO.php

@ -7,12 +7,14 @@ class ContactDAO extends SQL {
parent::__construct();
}
function get($jid) {
function get($jid = null) {
$this->_sql = '
select *, privacy.value as privacy from contact
left outer join privacy
on contact.jid = privacy.pkey
where jid = :jid';
if($jid == null) $jid = $this->_user;
$this->prepare(
'Contact',

31
app/models/postn/Postn.php

@ -220,6 +220,37 @@ class Postn extends Model {
return $contentimg;
}
public function getAttachements()
{
$attachements = null;
if(isset($this->links)) {
$attachements = array('pictures' => array(), 'files' => array(), 'links' => array());
$links = unserialize($this->links);
foreach($links as $l) {
switch($l['rel']) {
case 'enclosure' :
if(in_array($l['type'], array('image/jpeg', 'image/png', 'image/jpg'))) {
array_push($attachements['pictures'], $l);
} else {
array_push($attachements['files'], $l);
}
break;
case 'alternate' :
array_push($attachements['links'], array('href' => $l['href'], 'url' => parse_url($l['href'])));
break;
}
}
}
if(empty($attachements['pictures'])) unset($attachements['pictures']);
if(empty($attachements['files'])) unset($attachements['files']);
if(empty($attachements['links'])) unset($attachements['links']);
return $attachements;
}
public function getPlace() {
if(isset($this->lat, $this->lon) && $this->lat != '' && $this->lon != '') {
return true;

20
app/models/postn/PostnDAO.php

@ -220,6 +220,26 @@ class PostnDAO extends SQL {
return $this->run('ContactPostn');
}
function getItem($id) {
$this->_sql = '
select *, postn.aid, privacy.value as privacy from postn
left outer join contact on postn.aid = contact.jid
left outer join privacy on postn.nodeid = privacy.pkey
where postn.session = :session
and postn.nodeid = :nodeid
order by postn.published desc';
$this->prepare(
'Postn',
array(
'session' => $this->_user,
'nodeid' => $id
)
);
return $this->run('ContactPostn', 'item');
}
function getAllPosts($jid, $limitf = false, $limitr = false) {
$this->_sql = '

25
app/views/news.tpl

@ -3,20 +3,31 @@
<?php $this->widget('Presence');?>
<?php $this->widget('Chat');?>
<?php $this->widget('VisioExt');?>
<div id="main">
<div id="container">
<div id="left">
<?php $this->widget('Profile');?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Bookmark');?>
<?php $this->widget('Bookmark'); ?>
</div>
<?php $this->widget('Menu');?>
<?php $this->widget('Post');?>
</div>
<!--<div id="main"> -->
<!--<div id="left">
<?php //$this->widget('Profile');?>
<?php //$this->widget('Notifs');?>
<?php //$this->widget('Bookmark');?>
</div>-->
<div id="center">
<?php $this->widget('News');?>
</div>
<!--<div id="center">-->
</div>
<?php //$this->widget('News');?>
<!--</div>-->
<!--</div>-->
<div id="right">
<?php $this->widget('Roster');?>
</div>

10
app/widgets/About/about.tpl

@ -4,7 +4,7 @@
<p>{$c->__('info')}
<a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero General Public License v3</a>.
</p>
<h2>{$c->__('title.thanks')}</h2>
<h2><i class="fa fa-users"></i> {$c->__('title.thanks')}</h2>
<dl>
<dt>{$c->__('title.developers')}</dt><dd><a href="http://edhelas.mov.im/">Jaussoin Timothée aka edhelas</a></dd>
<dt></dt><dd><a href="https://launchpad.net/~nodpounod">Ho Christine aka nodpounod</a></dd>
@ -77,8 +77,8 @@
<h2><i class="fa fa-rocket"></i> {$c->__('title.software')}</h2>
<dl>
<dt>Database Library</dt><dd>Modl - Movim DB Layer <a href="https://launchpad.net/modl">launchpad.net/modl</a> under AGPLv3</dd>
<dt>XMPP Library</dt><dd>Moxl - Movim XMPP Library <a href="https://launchpad.net/moxl">launchpad.net/moxl</a> under AGPLv3</dd>
<dt>Database Library</dt><dd>Modl - Movim DB Layer - <i class="fa fa-github"></i> <a href="https://github.com/edhelas/modl">GitHub Modl</a> under AGPLv3</dd>
<dt>XMPP Library</dt><dd>Moxl - Movim XMPP Library - <i class="fa fa-github"></i> <a href="https://github.com/edhelas/moxl">GitHub Moxl</a> under AGPLv3</dd>
</dl>
<br />
<dl>
@ -87,9 +87,9 @@
</dl>
<h2><i class="fa fa-html5"></i> {$c->__('title.resources')}</h2>
<dl>
<dt>Icons</dt><dd>Famfamfam <a href="http://www.famfamfam.com/">www.famfamfam.com</a> under CC BY 3.0</dd>
<dt></dt><dd>Icomoon <a href="http://keyamoon.com/">by Keyamoon</a> under CC BY 3.0</dd>
<dt>Icons</dt><dd>Icomoon <a href="http://keyamoon.com/">by Keyamoon</a> under CC BY 3.0</dd>
<dt></dt><dd>FontAwesome <a href="http://fortawesome.github.io/">by Dave Gandy</a> under CC BY 3.0</dd>
<dt></dt><dd>Boyan Kostov <a href="http://boyankostov.com/">boyankostov.com</a> <a href="https://www.iconfinder.com/iconsets/flatified">Free for commercial use</a></dd>
</dl>
<h2><i class="fa fa-code"></i> {$c->__('title.api')}</h2>

78
app/widgets/Avatar/Avatar.php

@ -22,37 +22,37 @@ class Avatar extends WidgetBase
{
function load()
{
$this->registerEvent('myavatarvalid', 'onAvatarPublished');
$this->registerEvent('myavatarinvalid', 'onAvatarNotPublished');
$this->registerEvent('myvcard', 'onMyAvatar');
$this->addcss('avatar.css');
$this->addjs('avatar.js');
$this->addjs('avatar.js');
$cd = new \modl\ContactDAO();
$me = $cd->get($this->user->getLogin());
$p = new Picture;
if(!$p->get($this->user->getLogin())) {
$this->view->assign(
'getavatar',
$this->call('ajaxGetAvatar')
);
$this->view->assign('form', $this->prepareForm(new \modl\Contact()));
} else {
$this->view->assign('getavatar', '');
$this->view->assign('form', $this->prepareForm($me));
}
$this->registerEvent('avatar_get_handle', 'onMyAvatar');
$this->registerEvent('avatar_set_handle', 'onMyAvatar');
$this->registerEvent('avatar_set_errorfeaturenotimplemented', 'onMyAvatarError');
$this->registerEvent('avatar_set_errorbadrequest', 'onMyAvatarError');
$this->registerEvent('avatar_set_errornotallowed', 'onMyAvatarError');
}
function onMyAvatar($c) {
$html = $this->prepareForm($c);
function onMyAvatar($me)
{
$me = $packet->content;
$html = $this->prepareForm($me);
RPC::call('movim_fill', 'avatar_form', $html);
Notification::appendNotification($this->__('avatar.updated'), 'success');
}
function onMyAvatarError()
{
$cd = new \modl\ContactDAO();
$me = $cd->get();
$html = $this->prepareForm($me);
RPC::call('movim_fill', 'avatar_form', $html);
RPC::commit();
Notification::appendNotification($this->__('avatar.not_updated'), 'error');
}
function prepareForm($me) {
function prepareForm($me)
{
$avatarform = $this->tpl();
$p = new Picture;
@ -69,20 +69,8 @@ class Avatar extends WidgetBase
return $avatarform->draw('_avatar_form', true);
}
function onAvatarPublished()
function ajaxGetAvatar()
{
RPC::call('movim_button_reset', '#avatarvalidate');
Notification::appendNotification($this->__('avatar.updated'), 'success');
RPC::commit();
}
function onAvatarNotPublished()
{
Notification::appendNotification($this->__('avatar.not_updated'), 'error');
RPC::commit();
}
function ajaxGetAvatar() {
$r = new Get;
$r->setTo($this->user->getLogin())
->setMe()
@ -98,4 +86,22 @@ class Avatar extends WidgetBase
$r = new Set;
$r->setData($avatar->photobin->value)->request();
}
function display()
{
$cd = new \modl\ContactDAO();
$me = $cd->get();
$p = new Picture;
if(!$p->get($this->user->getLogin())) {
$this->view->assign(
'getavatar',
$this->call('ajaxGetAvatar')
);
$this->view->assign('form', $this->prepareForm(new \modl\Contact()));
} else {
$this->view->assign('getavatar', '');
$this->view->assign('form', $this->prepareForm($me));
}
}
}

3
app/widgets/Avatar/avatar.tpl

@ -3,7 +3,8 @@
<script type="text/javascript">
MovimWebsocket.attach(function() {
{$getavatar}
});</script>
});
</script>
<div id="avatar_form">
{$form}
</div>

2
app/widgets/Bookmark/Bookmark.php

@ -203,7 +203,7 @@ class Bookmark extends WidgetBase
'autojoin' => $form['autojoin'],
'nick' => $form['nick'],
'jid' => $form['jid']);
movim_log(serialize($item));
$this->ajaxSetBookmark($item);
}
}

12
app/widgets/Bookmark/_bookmark_muc_add.tpl

@ -5,7 +5,7 @@
<div id="bookmarkmucadderror"></div>
<div class="element large mini">
<input name="jid" placeholder="{$c->__('chatroom.id')}"/>
<input name="jid" placeholder="{$c->__('chatroom.id')} (chatroom@server.com)"/>
</div>
<div class="element large mini">
<input name="name" placeholder="{$c->__('chatroom.name')}"/>
@ -13,6 +13,7 @@
<div class="element large mini">
<input name="nick" placeholder="{$c->__('chatroom.nickname')}"/>
</div>
<!--
<div class="element large mini">
<label>{$c->__('chatroom.autojoin_label')}</label>
<div class="checkbox">
@ -20,18 +21,19 @@
<label for="autojoin"></label>
</div>
</div>
-->
</fieldset>
<div class="menu">
<a
class="button icon yes black merged left"
class="button color green merged left"
onclick="{$submit}"
>
{$c->__('button.add')}
<i class="fa fa-plus"></i> {$c->__('button.add')}
</a><a
class="button icon no black merged right"
class="button black merged right"
onclick="movim_toggle_display('#bookmarkmucadd')"
>
{$c->__('button.close')}
<i class="fa fa-times"></i> {$c->__('button.close')}
</a>
</div>
</form>

4
app/widgets/ContactPubsubSubscription/ContactPubsubSubscription.php

@ -40,7 +40,9 @@ class ContactPubsubSubscription extends WidgetBase
$html = '<ul class="list">';
foreach($list as $item){
$html .= '<li><a href="'.Route::urlize('node', array($item[1], $item[0])).'">'.$item[2].'</a></li>';
if(is_array($item)) {
$html .= '<li><a href="'.Route::urlize('node', array($item['server'], $item['node'])).'">'.$item['title'].'</a></li>';
}
}
$html .= '</ul>';

2
app/widgets/Feed/_feed_empty.tpl

@ -1,4 +1,4 @@
<div class="placeholder padded">
<div class="placeholder icon">
<h1>{$c->__('feed.empty_title')}</h1>
<p>{$c->__('feed.empty')}</p>
</div>

19
app/widgets/Help/Help.php

@ -22,28 +22,11 @@ class Help extends WidgetBase
{
function load()
{
$this->addjs('help.js');
}
function display()
{
$this->view->assign('missing_info1',
$this->__(
'missing.info1',
'<a href="http://wiki.movim.eu/en:dev:roadmaps" target="_blank">',
'</a>'));
$this->view->assign('missing_info2',
$this->__(
'missing.info2',
'<a href="http://wiki.movim.eu/whoami#how_can_i_help" target="_blank">',
'</a>'));
$this->view->assign('faq_info1',
$this->__(
'faq.info1',
'<a href="http://wiki.movim.eu/whoami#faq" target="_blank">',
'</a>',
'<a href="xmpp:movim@conference.movim.eu" target="_blank">movim@conference.movim.eu</a>',
'<a href="http://wiki.movim.eu/en:mailing_list" target="_blank">',
'</a>'));
}
}

12
app/widgets/Help/help.js

@ -0,0 +1,12 @@
var Help = {
joinChatroom : function() {
var hash = new H();
hash.set('jid', 'movim@conference.movim.eu');
hash.set('name', 'Movim Chatroom');
hash.set('nick', false);
hash.set('autojoin', 0);
Bookmark_ajaxBookmarkMucAdd(hash);
Bookmark_ajaxBookmarkMucJoin('movim@conference.movim.eu', '');
}
}

95
app/widgets/Help/help.tpl

@ -1,39 +1,60 @@
<div class="tabelem paddedtop" title="{$c->__('page.help')}" id="help">
<h1><i class="fa fa-life-ring"></i> {$c->__('page.help')}</h1>
<div class="tabelem paddedtop" title="{$c->__('page.help')}" id="help_widget">
<h1><i class="fa fa-life-ring"></i> {$c->__('page.help')}</h1>
<div class="block third">
<div class="placeholder icon file">
<p class="paddedtop">{$c->__('wiki.question')}</p>
<a class="button color blue" href="http://wiki.movim.eu" target="_blank">
<i class="fa fa-file-text-o"></i> {$c->__('wiki.button')}
</a>
</div>
</div>
<div class="block third">
<div class="placeholder icon chat">
<p class="paddedtop">{$c->__('chatroom.question')}</p>
<a class="button color green" href="#" onclick="Help.joinChatroom()">
<i class="fa fa-envelope-o"></i> {$c->__('chatroom.button')}
</a>
</div>
</div>
<div class="block third ">
<div class="placeholder icon plane">
<p class="paddedtop">{$c->__('ml.question')}</p>
<a class="button color orange" href="http://wiki.movim.eu/en:mailing_list" target="_blank">
<i class="fa fa-envelope-o"></i> {$c->__('ml.button')}
</a>
</div>
</div>
<div class="clear spacetop"></div>
<h1><i class="fa fa-question"></i> {$c->__('help.faq')}</h1>
<h2>{$c->__('what.title')}</h2>
<p>{$c->__('what.info1', '<a href="http://wiki.movim.eu/whoami" target="_blank">', '</a>')}</p>
<h2>{$c->__('banner.title')}</h2>
<center>
<div title="{function="getFlagTitle("white")"}" style="width: 60px; height: 50px; display: inline-block;" class="protect white"></div>
<div title="{function="getFlagTitle("green")"}" style="width: 60px; height: 50px; display: inline-block;" class="protect green"></div>
<div title="{function="getFlagTitle("orange")"}" style="width: 60px; height: 50px; display: inline-block;" class="protect orange"></div>
<div title="{function="getFlagTitle("red")"}" style="width: 60px; height: 50px; display: inline-block;" class="protect red"></div>
<div title="{function="getFlagTitle("black")"}" title="{$c->__('Help')}" style="width: 60px; height: 50px; display: inline-block;" class="protect black"></div>
</center>
<p>{$c->__('banner.info1')}</p>
<p>
<ul class="clean">
<li>{$c->__('banner.white')}</li>
<li>{$c->__('banner.green')}</li>
<li>{$c->__('banner.orange')}</li>
<li>{$c->__('banner.red')}</li>
<li>{$c->__('banner.black')}</li>
</ul>
</p>
<h2>{$c->__('missing.title')}</h2>
<p>{$missing_info1}</p>
<p>{$missing_info2}</p>
<h2>{$c->__('faq.title')}</h2>
<p>{$faq_info1}</p>
<div class="block large">
<h2>{$c->__('banner.title')}</h2>
<center>
<div title="{function="getFlagTitle("white")"}" style="width: 60px; height: 50px; display: inline-block;" class="protect white"></div>
<div title="{function="getFlagTitle("green")"}" style="width: 60px; height: 50px; display: inline-block;" class="protect green"></div>
<div title="{function="getFlagTitle("orange")"}" style="width: 60px; height: 50px; display: inline-block;" class="protect orange"></div>
<div title="{function="getFlagTitle("red")"}" style="width: 60px; height: 50px; display: inline-block;" class="protect red"></div>
<div title="{function="getFlagTitle("black")"}" title="{$c->__('Help')}" style="width: 60px; height: 50px; display: inline-block;" class="protect black"></div>
</center>
<p>{$c->__('banner.info1')}</p>
<p>
<ul class="clean">
<li>{$c->__('banner.white')}</li>
<li>{$c->__('banner.green')}</li>
<li>{$c->__('banner.orange')}</li>
<li>{$c->__('banner.red')}</li>
<li>{$c->__('banner.black')}</li>
</ul>
</p>
</div>
</div>

20
app/widgets/Help/locales.ini

@ -1,5 +1,4 @@
what.title = 'What is Movim?'
what.info1 = "Visit the page %s What is Movim ? %s to know more about the project, its aims and understand how it works."
help.faq = 'Frequently Asked Questions'
[banners]
banner.title = 'What do the little banners refer to ?'
@ -10,11 +9,14 @@ banner.orange = 'Orange, all your contact list can see your information'
banner.red = 'Red, everybody in the XMPP network can see your information'
banner.black = 'Black, the whole Internet can see your information'
[missings]
missing.title = "Some features are missing/I can't do everything I used to do on other social networks"
missing.info1 = "Although Movim is evolving fast, many (many) features are missing. Be patient ;). You can have a look %sat next versions's roadmaps%s to know if the one you want is on its way."
missing.info2 = "Don't forget that Movim is an open source project, a helping hand is always welcome (see %sCan I participate%s)"
[wiki]
wiki.question = 'Looking for some documentation ?'
wiki.button = 'Read the Wiki'
[faq]
faq.title = "I can't find the answer to my question here"
faq.info1 = "Go to the %sto the Frequently Asked Questions%s or come ask your question on the official chatroom %s or via our mailing-list (%ssee the dedicated page%s)."
[ml]
ml.question = 'Talk with us by email ?'
ml.button = 'Join the Mailing List'
[chatroom]
chatroom.question = 'Chat with the team ?'
chatroom.button = 'Join the Chatroom'

1
app/widgets/Login/login.css

@ -151,6 +151,7 @@ body {
#loginpage #sessions ul li img {
height: 3em;
float: left;
border-radius: 0.2em;
}
#loginpage #sessions ul li span {

2
app/widgets/Media/_media_empty.tpl

@ -1,4 +1,4 @@
<div class="placeholder paddedtop">
<div class="placeholder paddedtop icon media">
<h1>{$c->__('error.whoops')}</h1>
<p class="paddedtop">
{$c->__('error.media_not_found')}

87
app/widgets/Menu/Menu.php

@ -0,0 +1,87 @@
<?php
/**
* @package Widgets
*
* @file Menu.php
* This file is part of Movim.
*
* @brief General Menu
*
* @author Jaussoin Timothée <edhelas_at_movim_dot_com>
*
* @version 1.0
* @date 1 december 2014
*
* Copyright (C)2014 MOVIM project
*
* See COPYING for licensing information.
*/
class Menu extends WidgetCommon
{
private $_paging = 15;
function load()
{
$this->registerEvent('post', 'onStream');
$this->registerEvent('stream', 'onStream');
$this->addcss('menu.css');
$this->addjs('menu.js');
}
function onStream()
{
$pd = new \Modl\PostnDAO;
$count = $pd->getCountSince(Cache::c('since'));
if($count > 0) {
$view = $this->tpl();
$view->assign('count', $count);
$view->assign('refresh', $this->call('ajaxGetMenuList', "''", "''", 0));
RPC::call('movim_posts_unread', $count);
RPC::call('movim_fill', 'menu_refresh', $view->draw('_menu_refresh', true));
}
}
function ajaxGetMenuList($server = null, $node = null, $page = 0)
{
$html = $this->prepareMenuList($server, $node, $page);
if($page > 0) {
RPC::call('movim_append', 'menu_widget', $html);
} else {
RPC::call('movim_fill', 'menu_widget', $html);
}
RPC::call('Menu.refresh');
}
function prepareMenuList($server = null, $node = null, $page = 0)
{
$view = $this->tpl();
$pd = new \Modl\PostnDAO;
Cache::c('since', date(DATE_ISO8601, strtotime($pd->getLastDate())));
$next = $page + 1;
if($server == null || $node == null) {
$view->assign('history', $this->call('ajaxGetMenuList', "''", "''", $next));
$items = $pd->getNews($page*$this->_paging, $this->_paging);
} else {
$view->assign('history', $this->call('ajaxGetMenuList', '"'.$server.'"', '"'.$node.'"', $next));
$items = $pd->getNode($server, $node, $page*$this->_paging, $this->_paging);
}
$view->assign('items', $items);
$view->assign('page', $page);
return $view->draw('_menu_list', true);
}
function display()
{
}
}

24
app/widgets/Menu/_menu_list.tpl

@ -0,0 +1,24 @@
<div id="menu_refresh"></div>
{if="$items"}
<ul>
{loop="$items"}
<li class="padded" data-id="{$value->nodeid}">
<span class="tag">{$value->node}</span>
{if="current(explode('.', $value->jid)) == 'nsfw'"}
<span class="tag">NSFW</span>
{/if}
<h1>{$value->title}</h1>
<span class="date">{$value->published|strtotime|prepareDate}</span>
</li>
{/loop}
<li class="older" onclick="{$history} this.parentNode.removeChild(this);">
<i class="fa fa-history"></i> {$c->__('post.older')}
</li>
</ul>
{elseif="$page == 0"}
<div class="placeholder padded">
<h1>{$c->__('menu.empty_title')}</h1>
<p>{$c->__('menu.empty')}</p>
</div>
{/if}

3
app/widgets/Menu/_menu_refresh.tpl

@ -0,0 +1,3 @@
<a class="button color green" onclick="{$refresh}">
<i class="fa fa-refresh"></i> {$c->__('post.new_items', $count)} - {$c->__('button.refresh')}
</a>

2
app/widgets/Menu/locales.ini

@ -0,0 +1,2 @@
menu.empty_title = 'Hello'
menu.empty = 'Welcome on your news feed, here you will see all the posts published in the groups you have subscribed.'

55
app/widgets/Menu/menu.css

@ -0,0 +1,55 @@
#menu_widget {
border-right: 1px solid #DDD;
}
#menu_widget #menu_refresh {
text-align: center;
font-size: 1.2em;
}
#menu_widget #menu_refresh a {
margin: 1em;
}
#menu_widget ul {
list-style-type: none;
}
#menu_widget ul li {
min-height: 3em;
border-bottom: 1px solid #DDD;
}
#menu_widget ul li.active,
#menu_widget ul li:not(.older):hover {
background-color: rgba(0, 0, 0, 0.05);
cursor: pointer;
}
#menu_widget ul li h1 {
font-size: 1.2em;
}
#menu_widget ul li span.tag {
float: right;
background-color: gray;
color: white;
border-radius: 0.2em;
font-weight: bold;
padding: 0.2em 0.5em;
font-size: 0.8em;
clear: right;
margin-bottom: 0.3em;
}
#menu_widget ul li.older {
border-radius: 0;
margin-bottom: 0;
}
#main {
background-color: black;
height: 100%;
position: absolute;
width: 100%;
}

26
app/widgets/Menu/menu.js

@ -0,0 +1,26 @@
var Menu = {
refresh: function() {
var items = document.querySelectorAll('#menu_widget ul li');
var i = 0;
while(i < items.length -1)
{
items[i].onclick = function(e) {
Post_ajaxGetPost(this.dataset.id);
Menu.reset(items);
movim_add_class(this, 'active');
}
i++;
}
},
reset: function(list) {
for(i = 0; i < list.length; i++) {
movim_remove_class(list[i], 'active');
}
}
}
MovimWebsocket.attach(function() {
Menu.refresh();
});

3
app/widgets/Menu/menu.tpl

@ -0,0 +1,3 @@
<div id="menu_widget">
{$c->prepareMenuList()}
</div>

1
app/widgets/Node/Node.php

@ -47,6 +47,7 @@ class Node extends WidgetCommon
if(isset($_GET['s']) && isset($_GET['n'])) {
$this->view->assign('server', $_GET['s']);
$this->view->assign('node', $_GET['n']);
$this->view->assign('refresh', $this->call('ajaxGetItems', "'".$_GET['s']."'", "'".$_GET['n']."'"));
$this->view->assign('getaffiliations', $this->call('ajaxGetAffiliations', "'".$_GET['s']."'", "'".$_GET['n']."'"));
$this->view->assign('getmetadata', $this->call('ajaxGetMetadata', "'".$_GET['s']."'", "'".$_GET['n']."'"));
$this->view->assign('hash', md5($_GET['s'].$_GET['n']));

1
app/widgets/Node/node.tpl

@ -27,6 +27,7 @@
<script type="text/javascript">
MovimWebsocket.attach(function()
{
{$refresh}
{$getaffiliations}
{$getmetadata}
});

9
app/widgets/Notifs/Notifs.php

@ -56,11 +56,16 @@ class Notifs extends WidgetCommon
$contacts = $cd->getRosterFrom();
$invitations = array();
foreach(\Cache::c('activenotifs') as $key => $value) {
array_push($invitations, $cd->get($key));
$notifs = \Cache::c('activenotifs');
if(is_array($notifs)) {
foreach($notifs as $key => $value) {
array_push($invitations, $cd->get($key));
}
}
$nft = $this->tpl();
$nft->assign('invitations', $invitations);
$nft->assign('contacts', $contacts);
return $nft->draw('_notifs_from', true);

23
app/widgets/Notifs/_notifs_from.tpl

@ -5,6 +5,7 @@
</li>
{/if}
{loop="$invitations"}
{if="isset($value)"}
<li>
<a href="{$c->route('friend', $value->jid)}">
<img src="{$value->getPhoto('xs')}"/> {$value->getTrueName()}
@ -19,26 +20,6 @@
<i class="fa fa-plus oppose"></i> {$c->__('button.add')}
</a>
</li>
{/if}
{/loop}
</ul>
<!--<ul>
{loop="$contacts"}
<li>
<img src="{$value->getPhoto('xs')}"/> {$value->getTrueName()}
</li>
{/loop}
</ul>
'.$this->call("ajaxAddRoster", "'".$from."'").'
setTimeout(function() {'.
$this->call("ajaxSubscribed", "'".$from."'").
'}, 1000);
setTimeout(function() {'.
$this->call("ajaxSubscribe", "'".$from."'").
'}, 2000);
">
<i class="fa fa-plus"></i> '.t("Add").'
</a><a
class="button color red alone merged right"
onclick="'.$this->call("ajaxRefuse", "'".$from."'").'">
-->

21
app/widgets/Notifs/notifs.css

@ -1,24 +1,3 @@
/*#notifslist {
clear: both;
}
#notifslist li {
overflow: hidden;
line-height: 3em;
list-style-type: none;
}
#notifslist li a:not(.button) {
display: block;
}
#notifslist li.title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
*/
#notifs_widget li:not(:first-child) {
margin-bottom: 0.5em;
}

59
app/widgets/Post/Post.php

@ -0,0 +1,59 @@
<?php
/**
* @package Widgets
*
* @file Post.php
* This file is part of Movim.
*
* @brief The Post visualisation widget
*
* @author Jaussoin Timothée <edhelas_at_movim_dot_com>
*
* @version 1.0
* @date 1 december 2014
*
* Copyright (C)2014 MOVIM project
*
* See COPYING for licensing information.
*/
class Post extends WidgetCommon
{
function load()
{
$this->addcss('post.css');
}
function ajaxGetPost($id)
{
$html = $this->preparePost($id);
RPC::call('movim_fill', 'post_widget', $html);
}
function prepareEmpty()
{
$view = $this->tpl();
return $view->draw('_post_empty', true);
}
function preparePost($id)
{
$pd = new \Modl\PostnDAO;
$p = $pd->getItem($id);
$view = $this->tpl();
if(isset($p)) {
$view->assign('post', $p);
$view->assign('attachements', $p->getAttachements());
return $view->draw('_post', true);
} else {
return $this->prepareEmpty();
}
}
function display()
{
}
}

49
app/widgets/Post/_post.tpl

@ -0,0 +1,49 @@
<article>
{if="isset($attachements.pictures)"}
<div
class="picture"
style="background-image: url('{$attachements['pictures'][0]['href']}');"
>
</div>
{/if}
<header class="paddedbottom">
<h1>{$post->title}</h1>
<span>
<i class="fa fa-sitemap"></i>
<a href="{$c->route('node', array($post->jid, $post->node))}">
{$post->node}
</a>
</span>
-
<span class="date">
<i class="fa fa-clock-o"></i>
{$post->published|strtotime|prepareDate}
</span>
</header>
<section class="content padded">
{$post->contentcleaned}
</section>
<footer>
<div class="enclosures">
{if="isset($attachements.links)"}
{loop="$attachements.links"}
<a href="{$value.href}" class="alternate" target="_blank">
<img src="http://g.etfv.co/{$value.href}"/>{$value.href}
</a>
{/loop}
{/if}
{if="isset($attachements.files)"}
{loop="$attachements.files"}
<a
href="{$value.href}"
class="enclosure"
type="{$value.type}"
target="_blank">{$value.href}
</a>
{/loop}
{/if}
</div>
</footer>
</article>

7
app/widgets/Post/_post_empty.tpl

@ -0,0 +1,7 @@
<div class="placeholder icon newspaper">
<h1>{$c->__('post.news_feed')}</h1>
<p class="paddedtop">{$c->__('post.placeholder')}</p>
<a class="button color green" href="{$c->route('explore')}">
<i class="fa fa-compass"></i> {$c->__('page.explore')}
</a>
</div>

2
app/widgets/Post/locales.ini

@ -0,0 +1,2 @@
post.news_feed = 'News Feed'
post.placeholder = 'Discover and register to the groups you are interested in'

27
app/widgets/Post/post.css

@ -0,0 +1,27 @@
#post_widget {
/*width: calc(75% - 15rem);*/
}
#post_widget article {
padding-bottom: 1em;
}
#post_widget div.picture {
padding-bottom: 25%;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
#post_widget article header,
#post_widget article section.content,
#post_widget article footer {
max-width: 600px;
margin: 0 auto;
background-color: white;
}
#post_widget div.picture ~ header {
margin-top: -3em;
box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.3);
}

8
app/widgets/Post/post.tpl

@ -0,0 +1,8 @@
<div id="post_widget">
{$c->prepareEmpty()}
<script type="text/javascript">
/*MovimWebsocket.attach(function() {
{$get_post}
});*/
</script>
</div>

2
app/widgets/Roster/roster.css

@ -40,7 +40,7 @@
background-color: #454545;
height: 2em;
width: calc(100% - 1em);
margin: 0.5em;
margin: 0 0.5em;
border-radius: 0.2em;
}

2
app/widgets/Roster/roster.tpl

@ -5,7 +5,7 @@
{$c->__('roster.no_contacts')}
<br />
<br />
<a class="button color green icon users" href="{$c->route('explore')}">{$c->__('page.explore')}</a>
<a class="button color green" href="{$c->route('explore')}"><i class="fa fa-compass"></i> {$c->__('page.explore')}</a>
</span>
<div ng-show="contacts != null && !group.tombstone" ng-repeat="group in contacts" id="group{{group.agroup}}" ng-class="{groupshown: rosterCtrl.groupIsShown(group.agroup)}" >

15
app/widgets/Vcard4/Vcard4.php

@ -22,20 +22,16 @@ class Vcard4 extends WidgetBase
{
function load()
{
$this->registerEvent('myvcard4valid', 'onMyVcard4Received');
$this->registerEvent('myvcard4invalid', 'onMyVcard4NotReceived');
$this->registerEvent('myvcard', 'onMyVcard4');
$this->registerEvent('vcard4_get_handle', 'onMyVcard4');
$this->registerEvent('vcard4_set_handle', 'onMyVcard4');
}
function display()
{
$cd = new \Modl\ContactDAO();
$me = $cd->get($this->user->getLogin());
$me = $cd->get();
$this->view->assign(
'getvcard',
$this->call('ajaxGetVcard')
);
$this->view->assign('getvcard', $this->call('ajaxGetVcard'));
if($me == null) {
$this->view->assign('form', $this->prepareForm(new \modl\Contact()));
@ -92,7 +88,8 @@ class Vcard4 extends WidgetBase
return $vcardform->draw('_vcard4_form', true);
}
function onMyVcard4($c) {
function onMyVcard4($packet) {
$c = $packet->content;
$html = $this->prepareForm($c);
Notification::appendNotification($this->__('vcard.updated'), 'success');

10
app/widgets/WidgetCommon/_submit_form.tpl

@ -36,13 +36,15 @@
{/loop}
</ul>
{if="$gallery == null"}
<div class="placeholder paddedtop">
<div class="placeholder paddedtop icon media">
<h1>{$c->__('error.whoops')}</h1>
<p>
<p class="paddedtop">
{$c->__('error.media_not_found')}<br />
{$c->__('error.media_ask_upload')}<br /><br />
<a class="button color green" href="{$c->route('media')}"><i class="fa fa-folder-open"></i> {$c->__('page.media')}</a>
{$c->__('error.media_ask_upload')}
</p>
<a class="button color green" href="{$c->route('media')}"><i class="fa fa-folder-open"></i> {$c->__('page.media')}</a>
<br /><br /><br />
</div>
{/if}
<div class="menu">

85
linker.php

@ -24,7 +24,7 @@ $connector($config->websocketurl, array('xmpp'))->then(function($conn) use (&$st
$conn->on('message', function($message) use ($conn, $loop) {
if($message != '') {
//fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received', 'green')."\n");
if($message == '</stream:stream>') {
$conn->close();
@ -64,40 +64,47 @@ $connector($config->websocketurl, array('xmpp'))->then(function($conn) use (&$st
});
$stdin->removeAllListeners('data');
$stdin->on('data', function ($data) use ($conn, $loop) {
$messages = explode("\n", trim($data));
foreach ($messages as $message) {
//fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received from the browser', 'green')."\n");
$msg = json_decode($message);
if($msg->func == 'message' && $msg->body != '') {
$msg = $msg->body;
} elseif($msg->func == 'unregister') {
$conn->close();
$loop->stop();
} else {
return;
}
$rpc = new \RPC();
$rpc->handle_json($msg);
$xml = \Moxl\API::commit();
\Moxl\API::clear();
if(!empty($xml)) {
//fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
$conn->send(trim($xml));
}
$msg = json_encode(\RPC::commit());
\RPC::clear();
if(!empty($msg)) {
//fwrite(STDERR, colorize($msg, 'yellow')." : ".colorize('sent to the browser', 'green')."\n");
echo base64_encode(gzcompress($msg, 9))."END";
$stdin->on('data', function ($data) use ($conn, $loop, &$buffer) {
// A little bit of signalisation to use properly the buffer
if(substr($data, -3) == "END") {
$messages = explode("END", $buffer . substr($data, 0, -3));
$buffer = '';
foreach ($messages as $message) {
//fwrite(STDERR, colorize($message, 'yellow')." : ".colorize('received from the browser', 'green')."\n");
$msg = json_decode($message);
if($msg->func == 'message' && $msg->body != '') {
$msg = $msg->body;
} elseif($msg->func == 'unregister') {
$conn->close();
$loop->stop();
} else {
return;
}
$rpc = new \RPC();
$rpc->handle_json($msg);
$xml = \Moxl\API::commit();
\Moxl\API::clear();
if(!empty($xml)) {
//fwrite(STDERR, colorize(trim($xml), 'yellow')." : ".colorize('sent to XMPP', 'green')."\n");
$conn->send(trim($xml));
}
$msg = json_encode(\RPC::commit());
\RPC::clear();
if(!empty($msg)) {
//fwrite(STDERR, colorize($msg, 'yellow')." : ".colorize('sent to the browser', 'green')."\n");
echo base64_encode(gzcompress($msg, 9))."END";
}
}
} else {
$buffer .= $data;
}
});
@ -117,10 +124,12 @@ $stdin->on('data', function ($data) use ($loop) {
$msg = json_decode($message);
if($msg->func == 'message' && $msg->body != '') {
$msg = $msg->body;
} elseif($msg->func == 'unregister') {
$loop->stop();
if(isset($msg)) {
if($msg->func == 'message' && $msg->body != '') {
$msg = $msg->body;
} elseif($msg->func == 'unregister') {
$loop->stop();
}
} else {
return;
}

1145
locales/ar.po
File diff suppressed because it is too large
View File

1086
locales/be.po
File diff suppressed because it is too large
View File

1082
locales/bn.po
File diff suppressed because it is too large
View File

1133
locales/br.po
File diff suppressed because it is too large
View File

1098
locales/da.po
File diff suppressed because it is too large
View File

1217
locales/de.po
File diff suppressed because it is too large
View File

1111
locales/el.po
File diff suppressed because it is too large
View File

1104
locales/eo.po
File diff suppressed because it is too large
View File

1199
locales/es.po
File diff suppressed because it is too large
View File

1081
locales/fa.po
File diff suppressed because it is too large
View File

1139
locales/fi.po
File diff suppressed because it is too large
View File

1227
locales/fr.po
File diff suppressed because it is too large
View File

1086
locales/gl.po
File diff suppressed because it is too large
View File

1208
locales/he.po
File diff suppressed because it is too large
View File

1081
locales/hr.po
File diff suppressed because it is too large
View File

1110
locales/id.po
File diff suppressed because it is too large
View File

1081
locales/io.po
File diff suppressed because it is too large
View File

1186
locales/it.po
File diff suppressed because it is too large
View File

1164
locales/ja.po
File diff suppressed because it is too large
View File

1081
locales/kk.po
File diff suppressed because it is too large
View File

1144
locales/lv.po
File diff suppressed because it is too large
View File

1081
locales/messages.pot
File diff suppressed because it is too large
View File

1126
locales/nl.po
File diff suppressed because it is too large
View File

1087
locales/no.po
File diff suppressed because it is too large
View File

1163
locales/oc.po
File diff suppressed because it is too large
View File

1139
locales/pt.po
File diff suppressed because it is too large
View File

1092
locales/ro.po
File diff suppressed because it is too large
View File

1181
locales/ru.po
File diff suppressed because it is too large
View File

1089
locales/uk.po
File diff suppressed because it is too large
View File

1186
locales/zh.po
File diff suppressed because it is too large
View File

2
src/Movim/Daemon/Session.php

@ -98,7 +98,7 @@ class Session {
public function messageIn(ConnectionInterface $from, $msg)
{
$this->timestamp = time();
$this->process->stdin->write($msg."\n");
$this->process->stdin->write($msg."END");
}
public function messageOut($msg)

6
system/Picture.php

@ -97,8 +97,10 @@ class Picture {
if($this->_bin) {
$source = imagecreatefromstring($this->_bin);
imagejpeg($source, $path, 95);
imagedestroy($source);
if($source != false) {
imagejpeg($source, $path, 95);
imagedestroy($source);
}
}
}

59
themes/movim/css/style.css

@ -122,12 +122,16 @@ hr {
h1 {
color: #183C67;
line-height: 2.5em;
line-height: 1.5em;
font-size: 1.5em;
margin: 0px;
vertical-align: bottom;
}
div > h1 {
line-height: 2.5em;
}
h2 {
line-height: 2.5em;
font-size: 1.2em;
@ -210,12 +214,46 @@ ul.clean li {
#content {
width: 100%;
position: relative;
/*position: relative;*/
margin-top: 3em;
}
#container {
height: calc(100% - 3em);
position: absolute;
width: calc(100% - 15rem);
background-color: white;
}
#container > div {
display: block;
max-height: 100%;
float: left;
box-sizing: border-box;
position: relative;
overflow-y: auto;
}
#container > div:first-child {
overflow: hidden;
height: 100%;
}
#container > div:hover {
overflow-y: auto;
}
#container > div:nth-child(2) {
width: calc(30% - 6rem);
height: 100%;
}
#container > div:nth-child(3) {
width: calc(70% - 6rem);
}
#main {
background-color: rgba(0, 0, 0, 0.05);
background-color: white;
}
#main:after {
@ -234,6 +272,7 @@ ul.clean li {
float: left;
width: 12rem;
top: 0;
background-color: rgba(0, 0, 0, 0.05);
}
#left:before {
@ -282,7 +321,7 @@ ul.clean li {
top: 3em;
right: 0;
padding-top: 0em;
/*height: 100%;*/
padding-top: 0.5em;
height: calc(100% - 3em);
z-index: 2;
background-color: rgba(36, 36, 36, 1);
@ -665,4 +704,16 @@ dl dd {
text-align: center;
}
.placeholder.icon {
background-image: url(../img/icons/placeholder/chat.png);
background-size: 35%;
padding-top: 10em;
background-repeat: no-repeat;
background-position: center 1em;
}
.placeholder.icon.newspaper { background-image: url(../img/icons/placeholder/newspaper.png); }
.placeholder.icon.media { background-image: url(../img/icons/placeholder/media.png); }
.placeholder.icon.explore { background-image: url(../img/icons/placeholder/explore.png); }
.placeholder.icon.plane { background-image: url(../img/icons/placeholder/plane.png); }
.placeholder.icon.file { background-image: url(../img/icons/placeholder/file.png); }

14
themes/movim/css/template.css

@ -11,6 +11,18 @@
clear: left;
}
.block.third {
width: 33.33%;
}
.block.third:nth-child(3) {
float: right;
}
.block.third:nth-child(2) {
float: none;
}
.block h1 {
padding: 0;
}
@ -28,6 +40,7 @@
}
@media screen and (max-width: 1400px) {
.block.third,
.block {
width: 100%;
}
@ -39,6 +52,7 @@
}
@media screen and (max-width: 1024px) {
.block.third,
.block {
width: 100%;
padding: 0.5rem;

BIN
themes/movim/img/icons/placeholder/chat.png

After

Width: 512  |  Height: 512  |  Size: 4.6 KiB

BIN
themes/movim/img/icons/placeholder/explore.png

After

Width: 512  |  Height: 512  |  Size: 28 KiB

BIN
themes/movim/img/icons/placeholder/file.png

After

Width: 512  |  Height: 512  |  Size: 3.6 KiB

BIN
themes/movim/img/icons/placeholder/media.png

After

Width: 512  |  Height: 512  |  Size: 10 KiB

BIN
themes/movim/img/icons/placeholder/newspaper.png

After

Width: 512  |  Height: 512  |  Size: 4.5 KiB

BIN
themes/movim/img/icons/placeholder/plane.png

After

Width: 512  |  Height: 512  |  Size: 23 KiB

Loading…
Cancel
Save