1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00

update to movim upstream

This commit is contained in:
src386 2016-03-29 14:12:33 +02:00
parent 48cb035f43
commit d44b94a1d6
178 changed files with 41742 additions and 9725 deletions

View file

@ -1,5 +1,8 @@
**Changelog**
1.7.1 2016-?
- Update to movim 0.9 git2016-03-29
1.7 2016-03-17
- Update to movim 0.9 git2016-03-17
- sources/upgrade : dont delete composer.lock

View file

@ -5,7 +5,7 @@ Movim is a decentralized social network, written in PHP and HTML5 and based on t
It is recommended to use a "valid" certificate to use Movim, auto-signed is sometimes problematic. You might want to take a look a StartSSL or Let's Encrypt.
Provided Movim version : 0.9 git2016-03-17
Provided Movim version : 0.9 git2016-03-29
Please read CHANGELOG.

View file

@ -13,7 +13,12 @@ v0.9.1 (trunk)
* Clean properly the tags in the database
* Allow tags with special characters
* Various UI and navigation fixed
* Use UUID as identifiers for the messages and posts
* Delete properly the comments when deleting a post
* Update the dependencies
* Create an internal API to save some memory and improve session handling
* Improve image handling in posts
* Improve overall performances
v0.9
---------------------------

View file

@ -109,7 +109,7 @@ var MovimTpl = {
var selector = document.querySelector('main section > div:first-child:nth-last-child(2) ~ div div');
if(selector != null) {
return (selector.scrollHeight - Math.floor(selector.scrollTop) === selector.clientHeight);
return (selector.scrollHeight - Math.floor(selector.scrollTop) <= selector.clientHeight + 3);
}
},
scrollPanel : function() {

View file

@ -1,6 +1,7 @@
<?php
use Movim\Controller\Base;
class AboutController extends BaseController {
class AboutController extends Base {
function load() {
$this->session_only = false;
}

View file

@ -1,6 +1,7 @@
<?php
use Movim\Controller\Base;
class AccountController extends BaseController {
class AccountController extends Base {
function load() {
$this->session_only = false;
}

View file

@ -1,6 +1,7 @@
<?php
use Movim\Controller\Base;
class AccountnextController extends BaseController {
class AccountnextController extends Base {
function load() {
$this->session_only = false;
}

View file

@ -1,6 +1,7 @@
<?php
use Movim\Controller\Base;
class AdminController extends BaseController {
class AdminController extends Base {
function load() {
$this->session_only = false;
}

View file

@ -1,6 +1,7 @@
<?php
use Movim\Controller\Base;
class AdminloginController extends BaseController
class AdminloginController extends Base
{
function load()
{

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class BlogController extends BaseController {
class BlogController extends Base
{
function load() {
$this->session_only = false;
$this->public = true;

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class ChatController extends BaseController {
class ChatController extends Base
{
function load() {
$this->session_only = true;
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class ConfController extends BaseController {
class ConfController extends Base
{
function load() {
$this->session_only = true;
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class ContactController extends BaseController {
class ContactController extends Base
{
function load() {
$this->session_only = true;
}

View file

@ -1,13 +1,21 @@
<?php
use Movim\Controller\Base;
class DisconnectController extends BaseController {
class DisconnectController extends Base
{
function load() {
$this->session_only = false;
}
function dispatch() {
$user = new User();
$user->desauth();
$session = \Sessionx::start();
requestURL('http://localhost:1560/disconnect/', 2, ['sid' => $session->sessionid]);
$pd = new modl\PresenceDAO();
$pd->clearPresence();
Session::dispose();
$this->redirect('login');
}
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class FeedController extends BaseController {
class FeedController extends Base
{
function load() {
$this->session_only = false;
$this->raw = true;

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class GroupController extends BaseController {
class GroupController extends Base
{
function load() {
$this->session_only = false;
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class HelpController extends BaseController {
class HelpController extends Base
{
function load() {
$this->session_only = true;
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class InfosController extends BaseController {
class InfosController extends Base
{
function load() {
header('Content-type: application/json');
$this->session_only = false;

View file

@ -1,12 +1,13 @@
<?php
use Movim\Controller\Base;
class LoginController extends BaseController {
class LoginController extends Base {
function load() {
$this->session_only = false;
}
function dispatch() {
$this->page->setTitle(__('title.login', APP_TITLE));
$this->page->setTitle(__('page.login'));
$user = new User();
if($user->isLogged()) {

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class NewsController extends BaseController {
class NewsController extends Base
{
function load() {
$this->session_only = true;
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class NodeController extends BaseController {
class NodeController extends Base
{
function load() {
$this->session_only = false;
$this->public = true;

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class NotfoundController extends BaseController {
class NotfoundController extends Base
{
function load() {
$this->session_only = false;
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class RoomController extends BaseController {
class RoomController extends Base
{
function load() {
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class ShareController extends BaseController {
class ShareController extends Base
{
function load() {
$this->session_only = true;
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class TagController extends BaseController {
class TagController extends Base
{
function load() {
$this->session_only = false;
}

View file

@ -1,6 +1,8 @@
<?php
use Movim\Controller\Base;
class VisioController extends BaseController {
class VisioController extends Base
{
function load() {
$this->session_only = true;
$this->raw = true;

View file

@ -21,7 +21,7 @@ class MovimEmoji
$this->_emoji = new Emoji(new EmojiIndex(), $this->getPath());
}
public function replace($string, $large = false)
public function replace($string)
{
$this->_emoji->setAssetUrlFormat($this->getPath());
$string = $this->_emoji->replaceEmojiWithImages($string);
@ -30,7 +30,7 @@ class MovimEmoji
return $string;
}
private function getPath($large = false)
private function getPath()
{
return BASE_URI . 'themes/' . $this->_theme . '/img/emojis/svg/%s.svg';
}
@ -99,48 +99,7 @@ function prepareString($string, $large = false, $preview = false) {
$string = addUrls($string, $preview);
// We add some smileys...
$emoji = MovimEmoji::getInstance();
$string = $emoji->replace($string, $large);
return trim($string);
}
/**
* Fix self-closing tags
*/
function fixSelfClosing($string) {
return preg_replace_callback('/<([^\s<]+)\/>/',
function($match) {
return '<'.$match[1].'></'.$match[1].'>';
}
, $string);
}
/**
* @desc Escape the unescaped ampersand
*/
function escapeAmpersands($string) {
return preg_replace(
'/&[^; ]{0,6}.?/e',
"((substr('\\0',-1) == ';') ? '\\0' : '&amp;'.substr('\\0',1))",
$string);
}
/**
* Remove the content, body and html tags
*/
function cleanHTMLTags($string) {
return str_replace(
array(
'<content type="html">',
'<html xmlns="http://jabber.org/protocol/xhtml-im">',
'<body xmlns="http://www.w3.org/1999/xhtml">',
'</body>',
'</html>',
'</content>'),
'',
$string);
return trim((string)requestURL('http://localhost:1560/emojis/', 2, ['string' => $string]));
}
/**
@ -319,35 +278,7 @@ function stripTags($string)
*/
function purifyHTML($string)
{
$config = \HTMLPurifier_Config::createDefault();
$config->set('HTML.Doctype', 'XHTML 1.1');
$config->set('Cache.SerializerPath', '/tmp');
$config->set('HTML.DefinitionID', 'html5-definitions');
$config->set('HTML.DefinitionRev', 1);
if ($def = $config->maybeGetRawHTMLDefinition()) {
$def->addElement('video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', array(
'src' => 'URI',
'type' => 'Text',
'width' => 'Length',
'height' => 'Length',
'poster' => 'URI',
'preload' => 'Enum#auto,metadata,none',
'controls' => 'Bool',
));
$def->addElement('audio', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', array(
'src' => 'URI',
'preload' => 'Enum#auto,metadata,none',
'muted' => 'Bool',
'controls' => 'Bool',
));
$def->addElement('source', 'Block', 'Flow', 'Common', array(
'src' => 'URI',
'type' => 'Text',
));
}
$purifier = new \HTMLPurifier($config);
return $purifier->purify($string);
return (string)requestURL('http://localhost:1560/purify/', 2, ['html' => urlencode($string)]);
}
/**

View file

@ -0,0 +1,649 @@
<?php
/**
* @file Utils.php
* This file is part of PROJECT.
*
* @brief Description
*
* @author Etenil <etenil@etenilsrealm.nl>
*
* @version 1.0
* @date 20 February 2011
*
* Copyright (C)2011 Etenil
*
* All rights reserved.
*/
use Monolog\Logger;
use Monolog\Handler\SyslogHandler;
use Monolog\Handler\StreamHandler;
class Utils {
public static function log($message, $priority = '')
{
if(LOG_LEVEL != null && LOG_LEVEL > 0) {
$log = new Logger('movim');
$handler = new SyslogHandler('movim');
if(LOG_LEVEL > 1)
$log->pushHandler(new StreamHandler(LOG_PATH.'/movim.log', Logger::DEBUG));
$log->pushHandler($handler, Logger::DEBUG);
$errlines = explode("\n",$message);
foreach ($errlines as $txt) { $log->addDebug($txt); }
}
}
}
/**
* Return the list of gender
*/
function getGender() {
return array('N' => __('gender.nil'),
'M' => __('gender.male'),
'F' => __('gender.female'),
'O' => __('gender.other')
);
}
/**
* Return the list of client types
*/
function getClientTypes() {
return array(
'bot' => __('client.bot'),
'pc' => __('client.desktop'),
'phone' => __('client.phone'),
'handheld' => __('client.phone'),
'web' => __('client.web'),
'registered' => __('client.registered')
);
}
/**
* Return a XEP to namespace association
*/
function getXepNamespace() {
return array(
'0004' => array('name' => 'Data Forms', 'category' => 'client', 'ns' => 'jabber:x:data'),
'0012' => array('name' => 'Last Activity', 'category' => 'chat', 'ns' => 'jabber:iq:last'),
'0030' => array('name' => 'Service Discovery', 'category' => 'client', 'ns' => 'http://jabber.org/protocol/disco#info'),
'0045' => array('name' => 'Multi-User Chat', 'category' => 'chat', 'ns' => 'http://jabber.org/protocol/muc'),
'0050' => array('name' => 'Ad-Hoc Commands', 'category' => 'client', 'ns' => 'http://jabber.org/protocol/commands'),
'0054' => array('name' => 'vcard-temp', 'category' => 'client', 'ns' => 'vcard-temp'),
'0071' => array('name' => 'XHTML-IM', 'category' => 'chat', 'ns' => 'http://jabber.org/protocol/xhtml-im'),
'0080' => array('name' => 'User Location', 'category' => 'profile', 'ns' => 'http://jabber.org/protocol/geoloc'),
'0084' => array('name' => 'User Avatar', 'category' => 'profile', 'ns' => 'urn:xmpp:avatar:data'),
'0085' => array('name' => 'Chat State Notifications', 'category' => 'chat', 'ns' => 'http://jabber.org/protocol/chatstates'),
'0092' => array('name' => 'Software Version', 'category' => 'client', 'ns' => 'jabber:iq:version'),
'0107' => array('name' => 'User Mood', 'category' => 'profile', 'ns' => 'http://jabber.org/protocol/mood'),
'0108' => array('name' => 'User Activity', 'category' => 'profile', 'ns' => 'http://jabber.org/protocol/activity'),
'0115' => array('name' => 'Entity Capabilities', 'category' => 'client', 'ns' => 'http://jabber.org/protocol/caps'),
'0118' => array('name' => 'User Tune', 'category' => 'profile', 'ns' => 'http://jabber.org/protocol/tune'),
'0124' => array('name' => 'Bidirectional-streams Over Synchronous HTTP (BOSH)', 'category' => 'client', 'ns' => 'http://jabber.org/protocol/httpbind'),
'0152' => array('name' => 'Reachability Addresses', 'category' => 'client', 'ns' => 'urn:xmpp:reach:0'),
'0166' => array('name' => 'Jingle', 'category' => 'jingle', 'ns' => 'urn:xmpp:jingle:1'),
'0167' => array('name' => 'Jingle RTP Sessions', 'category' => 'jingle', 'ns' => 'urn:xmpp:jingle:apps:rtp:1'),
'0172' => array('name' => 'User Nickname', 'category' => 'profile', 'ns' => 'http://jabber.org/protocol/nick'),
'0176' => array('name' => 'Jingle ICE-UDP Transport Method', 'category' => 'jingle', 'ns' => 'urn:xmpp:jingle:transports:ice-udp:1'),
'0177' => array('name' => 'Jingle Raw UDP Transport Method', 'category' => 'jingle', 'ns' => 'urn:xmpp:jingle:transports:raw-udp:1'),
'0184' => array('name' => 'Message Delivery Receipts', 'category' => 'chat', 'ns' => 'urn:xmpp:receipts'),
'0186' => array('name' => 'Invisible Command', 'category' => 'chat', 'ns' => 'urn:xmpp:invisible:0'),
'0199' => array('name' => 'XMPP Ping', 'category' => 'client', 'ns' => 'urn:xmpp:ping'),
'0202' => array('name' => 'Entity Time', 'category' => 'client', 'ns' => 'urn:xmpp:time'),
'0224' => array('name' => 'Attention', 'category' => 'chat', 'ns' => 'urn:xmpp:attention:0'),
'0231' => array('name' => 'Bits of Binary', 'category' => 'chat', 'ns' => 'urn:xmpp:bob'),
'0234' => array('name' => 'Jingle File Transfer', 'category' => 'jingle', 'ns' => 'urn:xmpp:jingle:apps:file-transfer:4'),
'0249' => array('name' => 'Direct MUC Invitations', 'category' => 'chat', 'ns' => 'jabber:x:conference'),
'0277' => array('name' => 'Microblogging over XMPP','category' => 'social', 'ns' => 'urn:xmpp:microblog:0'),
'0280' => array('name' => 'Message Carbons', 'category' => 'chat', 'ns' => 'urn:xmpp:carbons:2'),
'0292' => array('name' => 'vCard4 Over XMPP', 'category' => 'profile', 'ns' => 'urn:xmpp:vcard4'),
'0301' => array('name' => 'In-Band Real Time Text', 'category' => 'chat', 'ns' => 'urn:xmpp:rtt:0'),
'0308' => array('name' => 'Last Message Correction', 'category' => 'chat', 'ns' => 'urn:xmpp:message-correct:0'),
'0313' => array('name' => 'Message Archive Management', 'category' => 'chat', 'ns' => 'urn:xmpp:mam:0'),
'0320' => array('name' => 'Use of DTLS-SRTP in Jingle Sessions', 'category' => 'jingle', 'ns' => 'urn:xmpp:jingle:apps:dtls:0'),
'0323' => array('name' => 'Internet of Things - Sensor Data', 'category' => 'iot', 'ns' => 'urn:xmpp:iot:sensordata'),
'0324' => array('name' => 'Internet of Things - Provisioning', 'category' => 'iot', 'ns' => 'urn:xmpp:iot:provisioning'),
'0325' => array('name' => 'Internet of Things - Control', 'category' => 'iot', 'ns' => 'urn:xmpp:iot:control'),
'0326' => array('name' => 'Internet of Things - Concentrators', 'category' => 'iot', 'ns' => 'urn:xmpp:iot:concentrators'),
'0327' => array('name' => 'Rayo', 'category' => 'rayo', 'ns' => 'urn:xmpp:rayo:0'),
'0330' => array('name' => 'Pubsub Subscription', 'category' => 'social', 'ns' => 'urn:xmpp:pubsub:subscription'),
'0332' => array('name' => 'HTTP over XMPP transport', 'category' => 'client', 'ns' => 'urn:xmpp:http'),
'0337' => array('name' => 'Event Logging over XMPP', 'category' => 'client', 'ns' => 'urn:xmpp:eventlog'),
'0338' => array('name' => 'Jingle Grouping Framework', 'category' => 'jingle', 'ns' => 'urn:ietf:rfc:5888'),
'0339' => array('name' => 'Source-Specific Media Attributes in Jingle', 'category' => 'jingle', 'ns' => 'urn:ietf:rfc:5576'),
'0340' => array('name' => 'COnferences with LIghtweight BRIdging (COLIBRI)', 'category' => 'jingle', 'ns' => 'http://jitsi.org/protocol/colibri'),
'0341' => array('name' => 'Rayo CPA', 'category' => 'rayo', 'ns' => 'urn:xmpp:rayo:cpa:0'),
'0342' => array('name' => 'Rayo Fax', 'category' => 'rayo', 'ns' => 'urn:xmpp:rayo:fax:1'),
'0347' => array('name' => 'Internet of Things - Discovery', 'category' => 'iot', 'ns' => 'urn:xmpp:iot:discovery'),
'0348' => array('name' => 'Signing Forms', 'category' => 'client', 'ns' => 'urn:xmpp:xdata:signature:oauth1'),
);
}
/**
* Return a list of all the country
*/
function getCountries() {
return array(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Antigua and Barbuda',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaijan',
'BS' => 'Bahamas The',
'BH' => 'Bahrain',
'BD' => 'Bangladesh',
'BB' => 'Barbados',
'BY' => 'Belarus',
'BE' => 'Belgium',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BO' => 'Bolivia',
'BA' => 'Bosnia and Herzegovina',
'BW' => 'Botswana',
'BV' => 'Bouvet Island (Bouvetoya)',
'BR' => 'Brazil',
'IO' => 'British Indian Ocean Territory (Chagos Archipelago)',
'VG' => 'British Virgin Islands',
'BN' => 'Brunei Darussalam',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'Canada',
'CV' => 'Cape Verde',
'KY' => 'Cayman Islands',
'CF' => 'Central African Republic',
'TD' => 'Chad',
'CL' => 'Chile',
'CN' => 'China',
'CX' => 'Christmas Island',
'CC' => 'Cocos (Keeling) Islands',
'CO' => 'Colombia',
'KM' => 'Comoros The',
'CD' => 'Congo',
'CG' => 'Congo The',
'CK' => 'Cook Islands',
'CR' => 'Costa Rica',
'CI' => 'Cote d\'Ivoire',
'HR' => 'Croatia',
'CU' => 'Cuba',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'DK' => 'Denmark',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'EC' => 'Ecuador',
'EG' => 'Egypt',
'SV' => 'El Salvador',
'GQ' => 'Equatorial Guinea',
'ER' => 'Eritrea',
'EE' => 'Estonia',
'ET' => 'Ethiopia',
'FO' => 'Faroe Islands',
'FK' => 'Falkland Islands (Malvinas)',
'FJ' => 'Fiji The Fiji Islands',
'FI' => 'Finland',
'FR' => 'France, French Republic',
'GF' => 'French Guiana',
'PF' => 'French Polynesia',
'TF' => 'French Southern Territories',
'GA' => 'Gabon',
'GM' => 'Gambia The',
'GE' => 'Georgia',
'DE' => 'Germany',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GR' => 'Greece',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe',
'GU' => 'Guam',
'GT' => 'Guatemala',
'GG' => 'Guernsey',
'GN' => 'Guinea',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HM' => 'Heard Island and McDonald Islands',
'VA' => 'Holy See (Vatican City State)',
'HN' => 'Honduras',
'HK' => 'Hong Kong',
'HU' => 'Hungary',
'IS' => 'Iceland',
'IN' => 'India',
'ID' => 'Indonesia',
'IR' => 'Iran',
'IQ' => 'Iraq',
'IE' => 'Ireland',
'IM' => 'Isle of Man',
'IL' => 'Israel',
'IT' => 'Italy',
'JM' => 'Jamaica',
'JP' => 'Japan',
'JE' => 'Jersey',
'JO' => 'Jordan',
'KZ' => 'Kazakhstan',
'KE' => 'Kenya',
'KI' => 'Kiribati',
'KP' => 'Korea',
'KR' => 'Korea',
'KW' => 'Kuwait',
'KG' => 'Kyrgyz Republic',
'LA' => 'Lao',
'LV' => 'Latvia',
'LB' => 'Lebanon',
'LS' => 'Lesotho',
'LR' => 'Liberia',
'LY' => 'Libyan Arab Jamahiriya',
'LI' => 'Liechtenstein',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'MO' => 'Macao',
'MK' => 'Macedonia',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldives',
'ML' => 'Mali',
'MT' => 'Malta',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'YT' => 'Mayotte',
'MX' => 'Mexico',
'FM' => 'Micronesia',
'MD' => 'Moldova',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'ME' => 'Montenegro',
'MS' => 'Montserrat',
'MA' => 'Morocco',
'MZ' => 'Mozambique',
'MM' => 'Myanmar',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'AN' => 'Netherlands Antilles',
'NL' => 'Netherlands The',
'NC' => 'New Caledonia',
'NZ' => 'New Zealand',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'MP' => 'Northern Mariana Islands',
'NO' => 'Norway',
'OM' => 'Oman',
'PK' => 'Pakistan',
'PW' => 'Palau',
'PS' => 'Palestinian Territory',
'PA' => 'Panama',
'PG' => 'Papua New Guinea',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippines',
'PN' => 'Pitcairn Islands',
'PL' => 'Poland',
'PT' => 'Portugal, Portuguese Republic',
'PR' => 'Puerto Rico',
'QA' => 'Qatar',
'RE' => 'Reunion',
'RO' => 'Romania',
'RU' => 'Russian Federation',
'RW' => 'Rwanda',
'BL' => 'Saint Barthelemy',
'SH' => 'Saint Helena',
'KN' => 'Saint Kitts and Nevis',
'LC' => 'Saint Lucia',
'MF' => 'Saint Martin',
'PM' => 'Saint Pierre and Miquelon',
'VC' => 'Saint Vincent and The Grenadines',
'WS' => 'Samoa',
'SM' => 'San Marino',
'ST' => 'Sao Tome and Principe',
'SA' => 'Saudi Arabia',
'SN' => 'Senegal',
'RS' => 'Serbia',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SK' => 'Slovakia (Slovak Republic)',
'SI' => 'Slovenia',
'SB' => 'Solomon Islands',
'SO' => 'Somalia, Somali Republic',
'ZA' => 'South Africa',
'GS' => 'South Georgia and The South Sandwich Islands',
'ES' => 'Spain',
'LK' => 'Sri Lanka',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SJ' => 'Svalbard & Jan Mayen Islands',
'SZ' => 'Swaziland',
'SE' => 'Sweden',
'CH' => 'Switzerland, Swiss Confederation',
'SY' => 'Syrian Arab Republic',
'TW' => 'Taiwan',
'TJ' => 'Tajikistan',
'TZ' => 'Tanzania',
'TH' => 'Thailand',
'TL' => 'Timor-Leste',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad and Tobago',
'TN' => 'Tunisia',
'TR' => 'Turkey',
'TM' => 'Turkmenistan',
'TC' => 'Turks and Caicos Islands',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'AE' => 'United Arab Emirates',
'GB' => 'United Kingdom',
'US' => 'United States of America',
'UM' => 'United States Minor Outlying Islands',
'VI' => 'United States Virgin Islands',
'UY' => 'Uruguay, Eastern Republic of',
'UZ' => 'Uzbekistan',
'VU' => 'Vanuatu',
'VE' => 'Venezuela',
'VN' => 'Vietnam',
'WF' => 'Wallis and Futuna',
'EH' => 'Western Sahara',
'YE' => 'Yemen',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe'
);
}
/**
* Return the list of marital status
*/
function getMarital() {
return array(
'none' => __('marital.nil'),
'single' => __('marital.single'),
'relationship' => __('marital.relationship'),
'married' => __('marital.married'),
'divorced' => __('marital.divorced'),
'widowed' => __('marital.widowed'),
'cohabiting' => __('marital.cohabiting'),
'union' => __('marital.union')
);
}
function getPresences() {
return array(
1 => __('presence.online'),
2 => __('presence.away'),
3 => __('presence.dnd'),
4 => __('presence.xa'),
5 => __('presence.offline'),
6 => __('presence.error')
);
}
function getPresencesTxt() {
return array(
1 => 'online',
2 => 'away',
3 => 'dnd',
4 => 'xa',
5 => 'offline',
6 => 'server_error'
);
}
function getMood() {
return array(
'afraid' => __('mood.afraid'), // Impressed with fear or apprehension; in fear; apprehensive.
'amazed' => __('mood.amazed'), // Astonished; confounded with fear, surprise or wonder.
'amorous' => __('mood.amorous'), // Inclined to love; having a propensity to love, or to sexual enjoyment; loving, fond, affectionate, passionate, lustful, sexual, etc.
'angry' => __('mood.angry'), // Displaying or feeling anger, i.e., a strong feeling of displeasure, hostility or antagonism towards someone or something, usually combined with an urge to harm.
'annoyed' => __('mood.annoyed'), // To be disturbed or irritated, especially by continued or repeated acts.
'anxious' => __('mood.anxious'), // Full of anxiety or disquietude; greatly concerned or solicitous, esp. respecting something future or unknown; being in painful suspense.
'aroused' => __('mood.aroused'), // To be stimulated in one's feelings, especially to be sexually stimulated.
'ashamed' => __('mood.ashamed'), // Feeling shame or guilt.
'bored' => __('mood.bored'), // Suffering from boredom; uninterested, without attention.
'brave' => __('mood.brave'), // Strong in the face of fear; courageous.
'calm' => __('mood.calm'), // Peaceful, quiet.
'cautious' => __('mood.cautious'), // Taking care or caution; tentative.
'cold' => __('mood.cold'), // Feeling the sensation of coldness, especially to the point of discomfort.
'confident' => __('mood.confident'), // Feeling very sure of or positive about something, especially about one's own capabilities.
'confused' => __('mood.confused'), // Chaotic, jumbled or muddled.
'contemplative' => __('mood.contemplative'), // Feeling introspective or thoughtful.
'contented' => __('mood.contented'), // Pleased at the satisfaction of a want or desire; satisfied.
'cranky' => __('mood.cranky'), // Grouchy, irritable; easily upset.
'crazy' => __('mood.crazy'), // Feeling out of control; feeling overly excited or enthusiastic.
'creative' => __('mood.creative'), // Feeling original, expressive, or imaginative.
'curious' => __('mood.curious'), // Inquisitive; tending to ask questions, investigate, or explore.
'dejected' => __('mood.dejected'), // Feeling sad and dispirited.
'depressed' => __('mood.depressed'), // Severely despondent and unhappy.
'disappointed' => __('mood.disappointed'), // Defeated of expectation or hope; let down.
'disgusted' => __('mood.disgusted'), // Filled with disgust; irritated and out of patience.
'dismayed' => __('mood.dismayed'), // Feeling a sudden or complete loss of courage in the face of trouble or danger.
'distracted' => __('mood.distracted'), // Having one's attention diverted; preoccupied.
'embarrassed' => __('mood.embarrassed'), // Having a feeling of shameful discomfort.
'envious' => __('mood.envious'), // Feeling pain by the excellence or good fortune of another.
'excited' => __('mood.excited'), // Having great enthusiasm.
'flirtatious' => __('mood.flirtatious'), // In the mood for flirting.
'frustrated' => __('mood.frustrated'), // Suffering from frustration; dissatisfied, agitated, or discontented because one is unable to perform an action or fulfill a desire.
'grateful' => __('mood.grateful'), // Feeling appreciation or thanks.
'grieving' => __('mood.grieving'), // Feeling very sad about something, especially something lost; mournful; sorrowful.
'grumpy' => __('mood.grumpy'), // Unhappy and irritable.
'guilty' => __('mood.guilty'), // Feeling responsible for wrongdoing; feeling blameworthy.
'happy' => __('mood.happy'), // Experiencing the effect of favourable fortune; having the feeling arising from the consciousness of well-being or of enjoyment; enjoying good of any kind, as peace, tranquillity, comfort; contented; joyous.
'hopeful' => __('mood.hopeful'), // Having a positive feeling, belief, or expectation that something wished for can or will happen.
'hot' => __('mood.hot'), // Feeling the sensation of heat, especially to the point of discomfort.
'humbled' => __('mood.humbled'), // Having or showing a modest or low estimate of one's own importance; feeling lowered in dignity or importance.
'humiliated' => __('mood.humiliated'), // Feeling deprived of dignity or self-respect.
'hungry' => __('mood.hungry'), // Having a physical need for food.
'hurt' => __('mood.hurt'), // Wounded, injured, or pained, whether physically or emotionally.
'impressed' => __('mood.impressed'), // Favourably affected by something or someone.
'in_awe' => __('mood.in_awe'), // Feeling amazement at something or someone; or feeling a combination of fear and reverence.
'in_love' => __('mood.in_love'), // Feeling strong affection, care, liking, or attraction..
'indignant' => __('mood.indignant'), // Showing anger or indignation, especially at something unjust or wrong.
'interested' => __('mood.interested'), // Showing great attention to something or someone; having or showing interest.
'intoxicated' => __('mood.intoxicated'), // Under the influence of alcohol; drunk.
'invincible' => __('mood.invincible'), // Feeling as if one cannot be defeated, overcome or denied.
'jealous' => __('mood.jealous'), // Fearful of being replaced in position or affection.
'lonely' => __('mood.lonely'), // Feeling isolated, empty, or abandoned.
'lost' => __('mood.lost'), // Unable to find one's way, either physically or emotionally.
'lucky' => __('mood.lucky'), // Feeling as if one will be favored by luck.
'mean' => __('mood.mean'), // Causing or intending to cause intentional harm; bearing ill will towards another; cruel; malicious.
'moody' => __('mood.moody'), // Given to sudden or frequent changes of mind or feeling; temperamental.
'nervous' => __('mood.nervous'), // Easily agitated or alarmed; apprehensive or anxious.
'neutral' => __('mood.neutral'), // Not having a strong mood or emotional state.
'offended' => __('mood.offended'), // Feeling emotionally hurt, displeased, or insulted.
'outraged' => __('mood.outraged'), // Feeling resentful anger caused by an extremely violent or vicious attack, or by an offensive, immoral, or indecent act.
'playful' => __('mood.playful'), // Interested in play; fun, recreational, unserious, lighthearted; joking, silly.
'proud' => __('mood.proud'), // Feeling a sense of one's own worth or accomplishment.
'relaxed' => __('mood.relaxed'), // Having an easy-going mood; not stressed; calm.
'relieved' => __('mood.relieved'), // Feeling uplifted because of the removal of stress or discomfort.
'remorseful' => __('mood.remorseful'), // Feeling regret or sadness for doing something wrong.
'restless' => __('mood.restless'), // Without rest; unable to be still or quiet; uneasy; continually moving.
'sad' => __('mood.sad'), // Feeling sorrow; sorrowful, mournful.
'sarcastic' => __('mood.sarcastic'), // Mocking and ironical.
'satisfied' => __('mood.satisfied'), // Pleased at the fulfillment of a need or desire.
'serious' => __('mood.serious'), // Without humor or expression of happiness; grave in manner or disposition; earnest; thoughtful; solemn.
'shocked' => __('mood.shocked'), // Surprised, startled, confused, or taken aback.
'shy' => __('mood.shy'), // Feeling easily frightened or scared; timid; reserved or coy.
'sick' => __('mood.sick'), // Feeling in poor health; ill.
'sleepy' => __('mood.sleepy'), // Feeling the need for sleep.
'spontaneous' => __('mood.spontaneous'), // Acting without planning; natural; impulsive.
'stressed' => __('mood.stressed'), // Suffering emotional pressure.
'strong' => __('mood.strong'), // Capable of producing great physical force; or, emotionally forceful, able, determined, unyielding.
'surprised' => __('mood.surprised'), // Experiencing a feeling caused by something unexpected.
'thankful' => __('mood.thankful'), // Showing appreciation or gratitude.
'thirsty' => __('mood.thirsty'), // Feeling the need to drink.
'tired' => __('mood.tired'), // In need of rest or sleep.
'undefined' => __('mood.undefined'), // [Feeling any emotion not defined here.]
'weak' => __('mood.weak'), // Lacking in force or ability, either physical or emotional.
'worried' => __('mood.worried') // Thinking about unpleasant things that have happened or that might happen; feeling afraid and unhappy.
);
}
/*
* Generate a standard UUID
*/
function generateUUID($string = false) {
if($string != false)
$data = $string;
else
$data = openssl_random_pseudo_bytes(16);
$data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}
function movim_log($logs) {
$log = new Logger('movim');
$log->pushHandler(new SyslogHandler('movim'));
$log->pushHandler(new StreamHandler(LOG_PATH.'/logger.log', Logger::DEBUG));
if(is_array($logs))
$log->addInfo('', $logs);
else
$log->addInfo($logs);
}
/*
* @desc Generate a simple random key
* @params The size of the key
*/
function generateKey($size) {
// Generating the session cookie's hash.
$hash_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$hash = "";
for($i = 0; $i < $size; $i++) {
$r = mt_rand(0, strlen($hash_chars) - 1);
$hash.= $hash_chars[$r];
}
return $hash;
}
/*
* @desc Get the range aroung a position with a radius
*/
function geoRadius($latitude, $longitude, $radius) {
$lat_range = $range/69.172;
$lon_range = abs($range/(cos($latitude) * 69.172));
$min_lat = number_format($latitude - $lat_range, "4", ".", "");
$max_lat = number_format($latitude + $lat_range, "4", ".", "");
$min_lon = number_format($longitude - $lon_range, "4", ".", "");
$max_lon = number_format($longitude + $lon_range, "4", ".", "");
return array($min_lat, $max_lat, $min_lon, $max_lon);
}
/*
* @desc Request a simple url
*/
function requestURL($url, $timeout = 10, $post = false) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0');
if(is_array($post)) {
$params = '';
foreach($post as $key => $value) {
$params .= $key . '=' . $value .'&';
}
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $params);
}
$rs = array();
$content = curl_exec($ch);
$rs['content'] = $content;
$rs['errno'] = curl_errno($ch);
$rs['errmsg'] = curl_error($ch);
$rs['header'] = curl_getinfo($ch);
if($rs['errno'] == 0) {
return $rs['content'];
} else {
return false;
}
}
/*
* @desc Get the URI of a smiley
*/
function getSmileyPath($id)
{
return BASE_URI.'/themes/material/img/emojis/svg/'.$id.'.svg';
}
/*
* @desc Translate something
*/
function __() {
$args = func_get_args();
$l = Movim\i18n\Locale::start();
$string = array_shift($args);
return $l->translate($string, $args);
}
function createEmailPic($jid, $email) {
$cachefile = DOCUMENT_ROOT.'/cache/'.$jid.'_email.png';
if(file_exists(DOCUMENT_ROOT.'/cache/'.$jid.'_email.png'))
unlink(DOCUMENT_ROOT.'/cache/'.$jid.'_email.png');
$draw = new ImagickDraw();
try {
$draw->setFontSize(13);
$draw->setGravity(Imagick::GRAVITY_CENTER);
$canvas = new Imagick();
$metrics = $canvas->queryFontMetrics($draw, $email);
$canvas->newImage($metrics['textWidth'], $metrics['textHeight'], "transparent", "png");
$canvas->annotateImage($draw, 0, 0, 0, $email);
$canvas->setImageFormat('PNG');
$canvas->writeImage($cachefile);
$canvas->clear();
} catch (ImagickException $e) {
error_log($e->getMessage());
}
}

View file

@ -3,7 +3,7 @@
namespace modl;
class CacheDAO extends SQL {
function get($session, $key) {
function get($key) {
$this->_sql = '
select * from cache
where
@ -13,7 +13,7 @@ class CacheDAO extends SQL {
$this->prepare(
'Cache',
array(
'session' => $session,
'session' => $this->_user,
'name' => $key
)
);
@ -32,7 +32,7 @@ class CacheDAO extends SQL {
$this->prepare(
'Cache',
array(
'session' => $cache->session,
'session' => $this->_user,
'data' => $cache->data,
'timestamp' => $cache->timestamp,
'name' => $cache->name
@ -50,7 +50,7 @@ class CacheDAO extends SQL {
$this->prepare(
'Cache',
array(
'session' => $cache->session,
'session' => $this->_user,
'name' => $cache->name,
'data' => $cache->data,
'timestamp' => $cache->timestamp

View file

@ -14,6 +14,7 @@ class Item extends Model {
public $subscription;
public $num;
public $sub;
public $logo;
public function __construct() {
$this->_struct = '
@ -32,6 +33,8 @@ class Item extends Model {
{"type":"date"},
"description" :
{"type":"text"},
"logo" :
{"type":"bool"},
"updated" :
{"type":"date", "mandatory":true}
}';
@ -76,6 +79,28 @@ class Item extends Model {
$this->updated = date('Y-m-d H:i:s');
}
public function setPicture()
{
$pd = new \Modl\PostnDAO;
$item = $pd->getGroupPicture($this->server, $this->node);
if($item) {
$item->getAttachements();
$p = new \Picture;
$p->fromURL($item->getPicture());
if($p->set($this->server.$this->node)) {
$this->logo = true;
}
}
}
public function getLogo()
{
$p = new \Picture;
return $p->get($this->server.$this->node, 120);
}
public function getName() {
if($this->name != null)
return $this->name;

View file

@ -11,7 +11,8 @@ class ItemDAO extends SQL {
creator = :creator,
created = :created,
updated = :updated,
description = :description
description = :description,
logo = :logo
where server = :server
and jid = :jid
and node = :node';
@ -26,7 +27,8 @@ class ItemDAO extends SQL {
'jid' => $item->jid,
'node' => $item->node,
'creator' => $item->creator,
'description' => $item->description
'description' => $item->description,
'logo' => $item->logo
)
);
@ -43,7 +45,8 @@ class ItemDAO extends SQL {
name,
created,
updated,
description
description,
logo
)
values(
:server,
@ -53,7 +56,8 @@ class ItemDAO extends SQL {
:name,
:created,
:updated,
:description
:description,
:logo
)';
$this->prepare(
@ -66,7 +70,8 @@ class ItemDAO extends SQL {
'server' => $item->server,
'jid' => $item->jid,
'node' => $item->node,
'description' => $item->description
'description' => $item->description,
'logo' => $item->logo
)
);

View file

@ -41,7 +41,7 @@ class Message extends Model {
"jidfrom" :
{"type":"string", "size":96, "mandatory":true },
"resource" :
{"type":"string", "size":128, "mandatory":true },
{"type":"string", "size":128 },
"type" :
{"type":"string", "size":16, "mandatory":true },
"subject" :
@ -96,26 +96,15 @@ class Message extends Model {
if($stanza->subject)
$this->__set('subject', (string)$stanza->subject);
$images = (bool)($this->type == 'chat');
\movim_log((string)$stanza->html->body);
if($stanza->html) {
$xhtml = new \SimpleXMLElement('<body xmlns="http://www.w3.org/1999/xhtml">'.escapeAmpersands((string)$stanza->html->body).'</body>');
$xhtml->registerXPathNamespace('xhtml', 'http://www.w3.org/1999/xhtml');
$img = $xhtml->xpath('//xhtml:img/@src')[0];
if($img) {
$this->sticker = getCid((string)$img);
$xml = \simplexml_load_string((string)$stanza->html->body);
if($xml) {
$results = $xml->xpath('//img/@src');
if(is_array($results) && !empty($results)) {
$this->sticker = getCid((string)$results[0]);
}
}
}
/*if($stanza->html) {
$this->html = \cleanHTMLTags($stanza->html->body->asXML());
$this->html = \fixSelfClosing($this->html);
$this->html = \prepareString($this->html, false, $images);
} else {*/
// $this->html = \prepareString($this->body, false, $images);
//}
if($stanza->replace) {
$this->newid = $this->id;

View file

@ -117,6 +117,28 @@ class Postn extends Model {
return $content;
}
private function getTitle($titles) {
$title = '';
foreach($titles as $t) {
switch($t->attributes()->type) {
case 'html':
case 'xhtml':
$title = strip_tags((string)$t->children()->asXML());
break;
case 'text':
if(trim($t) != '') {
$title = trim($t);
}
break;
default :
$title = (string)$t;
break;
}
}
return $title;
}
public function set($item, $from, $delay = false, $node = false) {
if($item->item)
$entry = $item->item;
@ -150,7 +172,7 @@ class Postn extends Model {
if($entry->entry->source && $entry->entry->source->author->uri)
$this->__set('aid', substr((string)$entry->entry->source->author->uri, 5));
$this->__set('title', (string)$entry->entry->title);
$this->__set('title', $this->getTitle($entry->entry->title));
// Content
if($entry->entry->summary && (string)$entry->entry->summary != '')
@ -182,8 +204,6 @@ class Postn extends Model {
if($delay)
$this->__set('delay', $delay);
$contentimg = $this->setAttachements($entry->entry->link);
// Tags parsing
if($entry->entry->category) {
$td = new \Modl\TagDAO;
@ -205,15 +225,25 @@ class Postn extends Model {
}
}
if($contentimg != '')
$content .= '<br />'.$contentimg;
if(!isset($this->commentplace))
$this->__set('commentplace', $this->origin);
$this->__set('content', trim($content));
$this->contentcleaned = purifyHTML(html_entity_decode($this->content));
$extra = false;
// We try to extract a picture
$xml = \simplexml_load_string('<div>'.$this->contentcleaned.'</div>');
if($xml) {
$results = $xml->xpath('//img/@src');
if(is_array($results) && !empty($results)) {
$extra = (string)$results[0];
$this->picture = true;
}
}
$this->setAttachements($entry->entry->link, $extra);
if($entry->entry->geoloc) {
if($entry->entry->geoloc->lat != 0)
$this->__set('lat', (string)$entry->entry->geoloc->lat);
@ -223,16 +253,14 @@ class Postn extends Model {
}
private function typeIsPicture($type) {
return in_array($type, array('image/jpeg', 'image/png', 'image/jpg', 'image/gif'));
return in_array($type, array('picture', 'image/jpeg', 'image/png', 'image/jpg', 'image/gif'));
}
private function typeIsLink($type) {
return $type == 'text/html';
}
private function setAttachements($links) {
$contentimg = '';
private function setAttachements($links, $extra = false) {
$l = array();
foreach($links as $attachment) {
@ -252,10 +280,12 @@ class Postn extends Model {
}
}
if($extra) {
array_push($l, array('href' => $extra, 'type' => 'picture'));
}
if(!empty($l))
$this->links = serialize($l);
return $contentimg;
}
public function getAttachements()

View file

@ -287,6 +287,27 @@ class PostnDAO extends SQL {
return $this->run('ContactPostn');
}
function getGroupPicture($origin, $node)
{
$this->_sql = '
select * from postn
where postn.origin = :origin
and postn.node = :node
and postn.picture = 1
order by postn.published desc
limit 1';
$this->prepare(
'Postn',
array(
'origin' => $origin,
'node' => $node
)
);
return $this->run('Postn', 'item');
}
function getItem($id) {
$this->_sql = '
select *, postn.aid, privacy.value as privacy from postn
@ -383,7 +404,8 @@ class PostnDAO extends SQL {
}
function getMe($limitf = false, $limitr = false) {
function getMe($limitf = false, $limitr = false)
{
$this->_sql = '
select *, postn.aid, privacy.value as privacy from postn
left outer join contact on postn.aid = contact.jid
@ -404,7 +426,9 @@ class PostnDAO extends SQL {
return $this->run('ContactPostn');
}
function getPublic($origin, $node, $limitf = false, $limitr = false) {
function getPublic($origin, $node, $limitf = false, $limitr = false)
{
$this->_sql = '
select *, postn.aid, privacy.value as privacy from postn
left outer join contact on postn.aid = contact.jid

View file

@ -203,7 +203,7 @@ class PresenceDAO extends SQL {
return $this->run('Presence');
}
function clearPresence($session) {
function clearPresence() {
$this->_sql = '
delete from presence
where
@ -212,7 +212,7 @@ class PresenceDAO extends SQL {
$this->prepare(
'Presence',
array(
'session' => $session
'session' => $this->_user
)
);

View file

@ -14,6 +14,7 @@ class Subscription extends Model {
public $timestamp;
public $name;
public $servicename;
public $logo;
public function __construct() {
$this->_struct = '
@ -39,6 +40,12 @@ class Subscription extends Model {
parent::__construct();
}
public function getLogo()
{
$p = new \Picture;
return $p->get($this->server.$this->node, 120);
}
function set($jid, $server, $node, $s) {
$this->__set('jid', $jid);
$this->__set('server', $server);

View file

@ -80,6 +80,7 @@ class SubscriptionDAO extends SQL {
subscription,
item.name,
item.description,
item.logo,
caps.name as servicename
from subscription
left outer join item
@ -95,7 +96,8 @@ class SubscriptionDAO extends SQL {
subscription,
caps.name,
item.name,
item.description
item.description,
item.logo
order by
subscription.server';

View file

@ -4,17 +4,23 @@
</nav>
<main>
<?php $this->widget('Header'); ?>
<section>
<div>
<header>
<ul class="list middle">
<li>
<span id="menu" class="primary on_mobile icon active gray" onclick="MovimTpl.toggleMenu()"><i class="zmdi zmdi-menu"></i></span>
<span class="primary on_desktop icon gray"><i class="zmdi zmdi-settings"></i></span>
<p class="center"><?php echo __('page.configuration'); ?></p>
</li>
</ul>
</header>
<?php $this->widget('Tabs');?>
<?php $this->widget('Vcard4');?>
<?php $this->widget('Avatar');?>
<?php $this->widget('Config');?>
<?php $this->widget('Account');?>
<?php $this->widget('AdHoc');?>
<?php //$this->widget('ConfigData');?>
<?php //$this->widget('PubsubSubscriptionConfig');?>
</div>
</section>
</main>

View file

@ -4,9 +4,17 @@
</nav>
<main>
<?php $this->widget('Header'); ?>
<section>
<div>
<header>
<ul class="list middle">
<li>
<span id="menu" class="primary on_mobile icon active gray" onclick="MovimTpl.toggleMenu()"><i class="zmdi zmdi-menu"></i></span>
<span class="primary on_desktop icon gray"><i class="zmdi zmdi-help"></i></span>
<p class="center"><?php echo __('page.help'); ?></p>
</li>
</ul>
</header>
<?php $this->widget('Tabs');?>
<?php $this->widget('Help');?>
<?php $this->widget('About');?>

View file

@ -1,7 +1,6 @@
<?php $this->widget('Presence'); ?>
<?php $this->widget('LoginAnonymous'); ?>
<main>
<?php $this->widget('Header');?>
<section>
<div>
<?php $this->widget('Rooms'); ?>

View file

@ -13,7 +13,7 @@
* See COPYING for licensing information.
*/
class About extends WidgetBase
class About extends \Movim\Widget\Base
{
function load()
{

View file

@ -6,7 +6,7 @@ use Moxl\Xec\Action\Register\Get;
use Moxl\Xec\Action\Register\Set;
use Respect\Validation\Validator;
class Account extends WidgetBase
class Account extends \Movim\Widget\Base
{
function load()
{

View file

@ -3,7 +3,7 @@
use Moxl\Xec\Action\Disco\Request;
use Moxl\Xec\Action\Register\Set;
class AccountNext extends WidgetBase {
class AccountNext extends \Movim\Widget\Base {
function load()
{
$this->addjs('accountnext.js');

View file

@ -21,7 +21,7 @@ use Moxl\Xec\Action\Ack\Send;
use Moxl\Xec\Action\Disco\Request;
use Moxl\Stanza\Disco;
class Ack extends WidgetBase {
class Ack extends \Movim\Widget\Base {
function load()
{
$this->registerEvent('ack', 'onAckRequest');

View file

@ -4,7 +4,7 @@ use Moxl\Xec\Action\AdHoc\Get;
use Moxl\Xec\Action\AdHoc\Command;
use Moxl\Xec\Action\AdHoc\Submit;
class AdHoc extends WidgetBase
class AdHoc extends \Movim\Widget\Base
{
function load()
{

View file

@ -15,7 +15,7 @@
* See COPYING for licensing information.
*/
class AdminDB extends WidgetBase
class AdminDB extends \Movim\Widget\Base
{
function load() {

View file

@ -15,7 +15,7 @@
* See COPYING for licensing information.
*/
class AdminLogin extends WidgetBase {
class AdminLogin extends \Movim\Widget\Base {
function load()
{
}

View file

@ -15,7 +15,7 @@
* See COPYING for licensing information.
*/
class AdminMain extends WidgetBase
class AdminMain extends \Movim\Widget\Base
{
function load() {
$this->addjs('admin.js');

View file

@ -15,7 +15,7 @@
* See COPYING for licensing information.
*/
class AdminTest extends WidgetBase
class AdminTest extends \Movim\Widget\Base
{
function load() {
$this->addjs('admintest.js');

View file

@ -15,7 +15,7 @@
* See COPYING for licensing information.
*/
class Api extends WidgetBase {
class Api extends \Movim\Widget\Base {
function load()
{
}
@ -27,8 +27,6 @@ class Api extends WidgetBase {
$this->__(
'api.info',
'<a href="http://api.movim.eu/" target="_blank">',
'</a>',
'<a href="'.$this->route('pods').'">',
'</a>'));
$json = requestURL(MOVIM_API.'status', 1, array('uri' => BASE_URI));

View file

@ -1,6 +1,6 @@
[api]
title = API
info = Here you can register your pod on the official %sMovim API%s and be listed on %sthe pods page%s.
info = Here you can register your pod on the official %sMovim API%s
register = Your pod is not registered on the API
registered = Your pod is registered on the API
wait = Your pod is not yet validated

View file

@ -19,7 +19,7 @@ use Moxl\Xec\Action\Avatar\Get;
use Moxl\Xec\Action\Avatar\Set;
use forxer\Gravatar\Gravatar;
class Avatar extends WidgetBase
class Avatar extends \Movim\Widget\Base
{
function load()
{

View file

@ -4,7 +4,7 @@ use Respect\Validation\Validator;
include_once WIDGETS_PATH.'Post/Post.php';
class Blog extends WidgetBase {
class Blog extends \Movim\Widget\Base {
public $_paging = 10;
private $_from;

View file

@ -22,7 +22,7 @@ use Moxl\Xec\Action\Bookmark\Get;
use Moxl\Xec\Action\Bookmark\Set;
use Moxl\Xec\Action\Presence\Muc;
class Bookmark extends WidgetBase
class Bookmark extends \Movim\Widget\Base
{
private $_list_server;

View file

@ -15,7 +15,7 @@
* See COPYING for licensing information.
*/
class Caps extends WidgetBase
class Caps extends \Movim\Widget\Base
{
private $_table = array();
private $_nslist;

View file

@ -14,7 +14,7 @@ use Respect\Validation\Validator;
use Ramsey\Uuid\Uuid;
class Chat extends WidgetBase
class Chat extends \Movim\Widget\Base
{
private $_pagination = 30;
@ -562,6 +562,9 @@ class Chat extends WidgetBase
function prepareMessage(&$message)
{
$message->jidto = echapJS($message->jidto);
$message->jidfrom = echapJS($message->jidfrom);
if(isset($message->html)) {
$message->body = $message->html;
} else {

View file

@ -6,7 +6,7 @@ use Moxl\Xec\Action\Bookmark\Set;
use Respect\Validation\Validator;
class Chats extends WidgetBase
class Chats extends \Movim\Widget\Base
{
function load()
{

View file

@ -21,7 +21,7 @@
use Moxl\Xec\Action\Storage\Set;
use Respect\Validation\Validator;
class Config extends WidgetBase
class Config extends \Movim\Widget\Base
{
function load()
{

View file

@ -5,7 +5,7 @@ use Moxl\Xec\Action\Vcard4\Get;
use Respect\Validation\Validator;
use Moxl\Xec\Action\Pubsub\GetItems;
class Contact extends WidgetBase
class Contact extends \Movim\Widget\Base
{
private $_paging = 10;

View file

@ -1,6 +1,6 @@
<?php
class Dialog extends WidgetBase
class Dialog extends \Movim\Widget\Base
{
function load()
{

View file

@ -14,7 +14,7 @@ use Moxl\Xec\Action\Pubsub\Delete;
use Respect\Validation\Validator;
class Group extends WidgetBase
class Group extends \Movim\Widget\Base
{
private $_paging = 15;
private $_role = null;
@ -88,11 +88,13 @@ class Group extends WidgetBase
list($server, $node) = array_values($packet->content);
Notification::append(false, $this->__('group.empty'));
if($node != 'urn:xmpp:microblog:0') {
$this->ajaxDelete($server, $node, true);
$this->ajaxGetAffiliations($server, $node);
// Display an error message
RPC::call('Group.clearLoad');
}
}
function onAffiliations($packet)
{
@ -389,8 +391,13 @@ class Group extends WidgetBase
private function prepareHeader($server, $node)
{
$pd = new \Modl\ItemDAO;
$item = $pd->getItem($server, $node);
$id = new \Modl\ItemDAO;
$item = $id->getItem($server, $node);
if($item && !$item->logo) {
$item->setPicture();
$id->set($item);
}
$pd = new \Modl\SubscriptionDAO;
$subscription = $pd->get($server, $node);
@ -406,7 +413,7 @@ class Group extends WidgetBase
private function prepareGroup($server, $node, $page = 0)
{
$pd = new \Modl\PostnDAO();
$pd = new \Modl\PostnDAO;
$posts = $pd->getNodeUnfiltered($server, $node, $page*$this->_paging, $this->_paging);
$view = $this->tpl();

View file

@ -6,7 +6,7 @@ use Respect\Validation\Validator;
use Moxl\Xec\Action\Pubsub\Create;
use Moxl\Xec\Action\Pubsub\TestCreate;
class Groups extends WidgetBase
class Groups extends \Movim\Widget\Base
{
private $_list_server;
@ -175,18 +175,6 @@ class Groups extends WidgetBase
return $html;
}
private function cleanServers($servers) {
$i = 0;
foreach($servers as $c) {
if(filter_var($c->server, FILTER_VALIDATE_EMAIL)) {
unset($servers[$i]);
} elseif(count(explode('.', $c->server))<3) {
unset($servers[$i]);
}
$i++;
}
return $servers;
}
/**
* @brief Validate the server
*

View file

@ -18,7 +18,14 @@
<i class="zmdi zmdi-bookmark"></i>
</span>
{/if}
{if="$value->logo"}
<span class="primary icon bubble">
<img src="{$value->getLogo()}">
</span>
{else}
<span class="primary icon bubble color {$value->node|stringToColor}">{$value->node|firstLetterCapitalize}</span>
{/if}
<p class="line">
{if="$value->name"}
{$value->name}

View file

@ -21,7 +21,13 @@
data-node="{$value->node}"
title="{$value->server} - {$value->node}"
>
{if="$value->logo"}
<span class="primary icon bubble">
<img src="{$value->getLogo()}">
</span>
{else}
<span class="primary icon bubble color {$value->node|stringToColor}">{$value->node|firstLetterCapitalize}</span>
{/if}
<p class="line normal">
{if="$value->name"}
{$value->name}

View file

@ -1,6 +1,6 @@
<?php
class Header extends WidgetBase
class Header extends \Movim\Widget\Base
{
function load()
{

View file

@ -1,6 +1,6 @@
<?php
class Help extends WidgetBase
class Help extends \Movim\Widget\Base
{
function load()
{

View file

@ -15,7 +15,7 @@
* See COPYING for licensing information.
*/
class Infos extends WidgetBase
class Infos extends \Movim\Widget\Base
{
function load() {

View file

@ -4,7 +4,7 @@ use Moxl\Xec\Action\Pubsub\ConfigurePersistentStorage;
use Moxl\Xec\Action\Pubsub\CreatePersistentStorage;
use Moxl\Xec\Action\Storage\Set;
class Init extends WidgetBase
class Init extends \Movim\Widget\Base
{
function load()
{

View file

@ -21,7 +21,7 @@ use Moxl\Xec\Action\Storage\Get;
use Moxl\Xec\Action\Roster\GetList;
use Respect\Validation\Validator;
class Login extends WidgetBase
class Login extends \Movim\Widget\Base
{
function load()
{
@ -36,7 +36,7 @@ class Login extends WidgetBase
function onStart($packet)
{
$pd = new \Modl\PresenceDAO();
$pd->clearPresence($this->user->getLogin());
$pd->clearPresence();
$session = \Sessionx::start();
$session->load();

View file

@ -2,7 +2,7 @@
use Respect\Validation\Validator;
class LoginAnonymous extends WidgetBase
class LoginAnonymous extends \Movim\Widget\Base
{
function load()
{

View file

@ -2,7 +2,7 @@
use Moxl\Xec\Action\Pubsub\GetItems;
class Menu extends WidgetBase
class Menu extends \Movim\Widget\Base
{
private $_paging = 15;

View file

@ -1,6 +1,6 @@
var Menu = {
refresh: function() {
var items = document.querySelectorAll('#menu_widget ul li, #post_widget ul.card li');
var items = document.querySelectorAll('ul#menu_wrapper li, #post_widget ul.card li');
var i = 0;
while(i < items.length)

View file

@ -1,6 +1,6 @@
<?php
class Navigation extends WidgetBase
class Navigation extends \Movim\Widget\Base
{
function load()
{

View file

@ -46,17 +46,12 @@
<p class="normal">{$c->__('page.chats')}</p>
</li>
</a>
<!--
<a class="classic" href="{$c->route('media')}">
<li>
<span class="icon"><i class="zmdi zmdi-photo"></i></span>
<span class="counter"></span>
<span>{$c->__('page.media')}</span>
</li>
</a>-->
</ul>
<ul class="list oppose active">
<ul class="list divided oppose active">
<li class="subheader">
<p>{$c->__('page.account')}</p>
</li>
<a class="classic {if="!$c->supported('pubsub')"}disabled{/if}" href="{$c->route('conf')}">
<li>
<span class="primary icon">
@ -65,7 +60,7 @@
<p class="normal">{$c->__('page.configuration')}</p>
</li>
</a>
<a class="classic" href="{$c->route('help')}">
<a class="classic on_desktop" href="{$c->route('help')}">
<li>
<span class="primary icon">
<i class="zmdi zmdi-help"></i>
@ -73,4 +68,8 @@
<p class="normal">{$c->__('page.help')}</p>
</li>
</a>
<li onclick="Presence_ajaxLogout()">
<span class="primary icon"><i class="zmdi zmdi-sign-in"></i></span>
<p class="normal">{$c->__('status.disconnect')}</p>
</li>
</ul>

View file

@ -1,6 +1,6 @@
<?php
class NotFound extends WidgetBase
class NotFound extends \Movim\Widget\Base
{
function load()
{

View file

@ -1,6 +1,6 @@
<?php
class Notification extends WidgetBase
class Notification extends \Movim\Widget\Base
{
function load()
{

View file

@ -23,7 +23,7 @@ use Moxl\Xec\Action\Roster\AddItem;
use Moxl\Xec\Action\Roster\UpdateItem;
use Moxl\Xec\Action\Presence\Subscribe;
class Notifs extends WidgetBase
class Notifs extends \Movim\Widget\Base
{
function load()
{

View file

@ -20,6 +20,7 @@
use Moxl\Xec\Action\Pubsub\PostPublish;
use Moxl\Xec\Action\Pubsub\PostDelete;
use Moxl\Xec\Action\Pubsub\Delete;
use Moxl\Xec\Action\Pubsub\GetItem;
use Moxl\Xec\Action\Microblog\CommentsGet;
use Moxl\Xec\Action\Microblog\CommentCreateNode;
@ -27,7 +28,7 @@ use Moxl\Xec\Action\Microblog\CommentPublish;
use \Michelf\Markdown;
use Respect\Validation\Validator;
class Post extends WidgetBase
class Post extends \Movim\Widget\Base
{
function load()
{
@ -130,6 +131,11 @@ class Post extends WidgetBase
->setNode($node)
->setId($id)
->request();
$p = new Delete;
$p->setTo($to)
->setNode('urn:xmpp:microblog:0:comments/'.$id)
->request();
}
function ajaxGetComments($jid, $id)
@ -214,9 +220,6 @@ class Post extends WidgetBase
if(!$validate->validate($id))
return;
$pd = new \Modl\PrivacyDAO();
$p = $pd->get($id);
$pd = new \Modl\PostnDAO;
$po = $pd->getItem($id);

View file

@ -133,9 +133,11 @@
<content>
{if="$post->isShort() && isset($attachements.pictures)"}
{loop="$attachements.pictures"}
{if="$value.type != 'picture'"}
<a href="{$value.href}" class="alternate" target="_blank">
<img class="big_picture" type="{$value.type}" src="{$value.href|urldecode}"/>
</a>
{/if}
{/loop}
{elseif="$post->getYoutube()"}
<div class="video_embed">
@ -199,6 +201,7 @@
{if="!$post->isShort() && isset($attachements.pictures)"}
<ul class="list flex middle">
{loop="$attachements.pictures"}
{if="$value.type != 'picture'"}
<li class="block pic">
<span class="primary icon gray">
<i class="zmdi zmdi-image"></i>
@ -207,6 +210,7 @@
<img type="{$value.type}" src="{$value.href|urldecode}"/>
</a>
</li>
{/if}
{/loop}
</ul>
{/if}

View file

@ -27,64 +27,7 @@
</li>
</ul>
{/if}
<!--
<ul class="list flex active middle">
<li class="subheader block large">
<p>{$c->__('chat.frequent')}</p>
</li>
{if="empty($top)"}
<li>
<span class="primary icon gray">
<i class="zmdi zmdi-info-outline"></i>
</span>
<p class="normal">{$c->__('chats.empty_title')}</p>
</li>
{/if}
{loop="$top"}
<li tabindex="{$key+1}" class="block"
onclick="Hello_ajaxChat('{$value->jid}')">
{$url = $value->getPhoto('s')}
{if="$url"}
<span
class="primary icon bubble
{if="$value->value"}
status {$presencestxt[$value->value]}
{/if}">
<img src="{$url}">
</span>
{else}
<span
class="primary icon bubble color {$value->jid|stringToColor}
{if="$value->value"}
status {$presencestxt[$value->value]}
{/if}">
<i class="zmdi zmdi-account"></i>
</span>
{/if}
<p>{$value->getTrueName()}</p>
<p>
{if="isset($value->status)"}
{$value->status}
{else}
{$value->jid}
{/if}
</p>
</li>
{/loop}
<a class="block large" href="{$c->route('chat')}">
<li>
<span class="primary icon">
<i class="zmdi zmdi-comments"></i>
</span>
<span class="control icon">
<i class="zmdi zmdi-chevron-right"></i>
</span>
<p class="normal">{$c->__('hello.chat')}</p>
</li>
</a>
</ul>
-->
<ul class="list thick">
<li>
<span class="primary icon gray">

View file

@ -23,3 +23,15 @@ discover = Discover more articles on the Groups page
comments_disabled = Comments disabled
comment_published = Comment published
[hello]
blog_title = Visit your public blog
blog_text = See your public posts and share them with all your contacts
contact_post = Contact post
share_title = Universal share button
share_text = Bookmark or drag and drop the following button in your toolbar and use it on all the pages you want to share on Movim
share_button = Share on Movim
enter_title = Oh! Hello!
enter_paragraph = It seems that you're new there! Welcome on Movim!
menu_title = Check the Menu
menu_paragraph = All the main Movim features are accessible there. Don't hesitate to navigate through the pages to discover more!

View file

@ -27,7 +27,7 @@ use Moxl\Xec\Action\Pubsub\GetItems;
use Moxl\Stanza\Stream;
use Moxl\Xec\Action\Storage\Get;
class Presence extends WidgetBase
class Presence extends \Movim\Widget\Base
{
function load()
@ -35,6 +35,19 @@ class Presence extends WidgetBase
$this->addcss('presence.css');
$this->addjs('presence.js');
$this->registerEvent('mypresence', 'onMyPresence');
$this->registerEvent('session_up', 'onSessionUp');
$this->registerEvent('session_down', 'onSessionDown');
}
function onSessionUp()
{
$this->ajaxSet();
}
function onSessionDown()
{
$p = new Away;
$p->request();
}
function onMyPresence($packet)
@ -46,11 +59,6 @@ class Presence extends WidgetBase
RPC::call('movim_remove_class', '#presence_widget', 'unfolded');
}
function onPostDisconnect($data)
{
RPC::call('movim_reload', Route::urlize('disconnect'));
}
function ajaxSet($form = false)
{
if($form == false) {
@ -103,9 +111,7 @@ class Presence extends WidgetBase
function ajaxLogout()
{
$pd = new \Modl\PresenceDAO();
$session = \Sessionx::start();
$pd->clearPresence($session->username.'@'.$session->host);
$pd->clearPresence();
$session = \Sessionx::start();
$p = new Unavailable;
@ -226,7 +232,6 @@ class Presence extends WidgetBase
$presencetpl->assign('txt', $txt);
$presencetpl->assign('txts', $txts);
$presencetpl->assign('calllogout', $this->call('ajaxLogout'));
$html = $presencetpl->draw('_presence_list', true);
return $html;

View file

@ -10,10 +10,10 @@
<i class="zmdi zmdi-account"></i>
</span>
{/if}
<!--
<span class="control icon gray">
<i class="zmdi zmdi-edit"></i>
</span>-->
<p class="line">{$me->getTrueName()}</p>
<span class="control icon">
<i class="zmdi zmdi-caret-down"></i>
</span>
<p class="line bold">{$me->getTrueName()}</p>
<p class="line">{$presence->status}</p>
</li>

View file

@ -56,24 +56,6 @@
</ul>
</div>
</form>
<ul class="list active">
<li class="subheader">
<p class="normal">{$c->__('status.disconnect')}</p>
</li>
<li onclick="{$calllogout}">
<span class="primary icon"><i class="zmdi zmdi-sign-in"></i></span>
<p class="normal">{$c->__('status.disconnect')}</p>
</li>
</ul>
<!--
<div class="element large mini">
<label>{$c->__('chatroom.autojoin_label')}</label>
<div class="checkbox">
<input type="checkbox" id="autojoin" name="autojoin"/>
<label for="autojoin"></label>
</div>
</div>
-->
</section>
<div>
<a onclick="Dialog.clear()" class="button flat">

View file

@ -1,159 +1,11 @@
form[name=presence] ul {
margin: 0 -2rem;
}
/*
form[name=presence] li {
padding-left: 7rem;
#presence_widget {
min-width: 20rem;
}
form[name=presence] li span.icon {
left: 1rem;
}*/
/*#presence_widget {
max-width: 15rem;
position: fixed;
top: 0;
right: 0;
z-index: 4;
padding: 0.3em;
box-sizing: border-box;
#presence_widget li {
padding: 2.5rem 0;
}
#presence_widget img.avatar {
width: 2em;
float: left;
border-radius: 3em;
position: relative;
margin-right: 1em;
}
#presence_widget span.bubble {
left: 1.4em;
top: 1.4em;
width: 0.9em;
height: 0.9em;
box-shadow: 0 0 2px rgba(0, 0, 0, 1);
border-radius: 2em;
display: inline-block;
position: absolute;
}
#presence_widget .online span.bubble { background-color: #6FCC43; }
#presence_widget .away span.bubble { background-color: #FFE433; }
#presence_widget .dnd span.bubble { background-color: #D92727; }
#presence_widget .xa span.bubble { background-color: #442178; }
#presence_widget #tab {
color: white;
height: 2.5em;
padding: 0.2em;
width: 14.4rem;
box-sizing: border-box;
float: right;
position: relative;
}
#presence_widget #tab:hover {
cursor: pointer;
border-radius: 0.05em;
background-color: rgba(255, 255, 255, 0.2);
}
#presence_widget span.arrow {
float: right;
padding-right: 0.5em;
line-height: 2em;
}
#presence_widget span.name,
#presence_widget span.status {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: calc(100% - 6em);
display: inline-block;
}
#presence_widget span.status {
font-weight: normal;
font-size: 0.8em;
color: #DDD;
display: block;
}
#presence_widget #list {
width: 14.4rem;
background-color: white;
display: none;
z-index: 6;
}
#presence_widget #list .tab {
padding: 0.2em;
}
#presence_widget #list .tab span.name {
line-height: 2em;
}
#presence_widget #list .tab:hover {
cursor: pointer;
border-radius: 0.1em;
}
#presence_widget.unfolded #tab {
display: none;
}
#presence_widget.unfolded #list {
display: block;
border-radius: 0.1em;
box-shadow: 0 0 0.3em rgba(0, 0, 0, 0.4);
}
#presence_widget textarea.status {
margin: 0.5em 0;
padding: 0.5em;
box-sizing: border-box;
border: 0;
width: 100%;
border-bottom: 1px solid #D4D4D4;
height: 2.7em;
resize: none;
}
@media screen and (max-width: 1024px) {
#presence_widget #tab {
width: auto;
}
}
#presence_widget #list a {
position: relative;
clear: both;
display: block;
font-weight: normal;
line-height: 2.8em;
padding: 0 1em;
}
#presence_widget #list a:hover {
cursor: pointer;
background-color: rgba(0, 0, 0, 0.05);
}
#presence_widget #list a i {
float: right;
line-height: 2.8em;
margin: 0;
}
#presence_widget #list span.bubble {
box-shadow: none;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
display: inline-block;
float: right;
margin-top: 1em;
position: initial;
}
*/

View file

@ -1,20 +1,3 @@
function postStart() {
if(localStorage.postStart == 1) {
// We disable the notifications for a couple of seconds
Notification.inhibit(10);
Presence_ajaxSet();
//Presence_ajaxConfigGet();
Presence_ajaxServerCapsGet();
Presence_ajaxBookmarksGet();
Presence_ajaxUserRefresh();
Presence_ajaxFeedRefresh();
Presence_ajaxServerDisco();
//Menu_ajaxRefresh();
localStorage.postStart = 0;
}
}
var Presence = {
refresh : function() {
var textarea = document.querySelector('form[name=presence] textarea');
@ -37,11 +20,28 @@ var Presence = {
}
i++;
}
},
postStart : function() {
if(localStorage.postStart == 1) {
// We disable the notifications for a couple of seconds
Notification.inhibit(10);
Presence_ajaxSet();
//Presence_ajaxConfigGet();
Presence_ajaxServerCapsGet();
Presence_ajaxBookmarksGet();
Presence_ajaxUserRefresh();
Presence_ajaxFeedRefresh();
Presence_ajaxServerDisco();
//Menu_ajaxRefresh();
localStorage.postStart = 0;
}
}
}
MovimWebsocket.attach(function()
{
Presence.refresh();
postStart();
Presence.postStart();
});

View file

@ -24,7 +24,7 @@ use Moxl\Xec\Action\Microblog\CommentCreateNode;
use \Michelf\Markdown;
use Respect\Validation\Validator;
class Publish extends WidgetBase
class Publish extends \Movim\Widget\Base
{
function load()
{
@ -211,7 +211,6 @@ class Publish extends WidgetBase
$p->setLink($form->embed->value);
if(in_array($embed->type, array('photo', 'rich'))) {
$key = key($embed->images);
$p->setImage($embed->images[0]['value'], $embed->title, $embed->images[0]['mime']);
}
@ -285,10 +284,8 @@ class Publish extends WidgetBase
$validate_server = Validator::stringType()->noWhitespace()->length(6, 40);
$validate_node = Validator::stringType()->length(3, 100);
if(!$validate_server->validate($server)
|| !$validate_node->validate($node)
) return false;
else return true;
return ($validate_server->validate($server)
&& $validate_node->validate($node));
}
function display()

View file

@ -55,7 +55,7 @@
name="embed"
placeholder="http://myawesomewebsite.com/ or http://mynicepictureurl.com/"
onpaste="var e=this; setTimeout(function(){Publish_ajaxEmbedTest(e.value);}, 4);"
{if="$attachement != false"}value="{$attachement.href}"{/if}
{if="isset($attachement) && $attachement != false"}value="{$attachement.href}"{/if}
>
<label for="embed">{$c->__('post.link')}</label>

View file

@ -11,6 +11,6 @@
</section>
<div class="no_bar">
<a onclick="Dialog.clear()" class="button flat">
{$c->__('button.cancel')}
{$c->__('button.close')}
</a>
</div>

View file

@ -7,7 +7,7 @@ use Moxl\Xec\Action\Presence\Unavailable;
use Respect\Validation\Validator;
class Rooms extends WidgetBase
class Rooms extends \Movim\Widget\Base
{
function load()
{
@ -58,7 +58,6 @@ class Rooms extends WidgetBase
{
$view = $this->tpl();
$cd = new \Modl\ContactDAO;
$view->assign('username', $this->user->getUser());
Dialog::fill($view->draw('_rooms_add', true));
@ -188,6 +187,7 @@ class Rooms extends WidgetBase
$sd = new \modl\SubscriptionDAO();
$cd = new \modl\ConferenceDAO();
if($sd->getSubscribed()) {
foreach($sd->getSubscribed() as $s) {
array_push($arr,
array(
@ -198,6 +198,7 @@ class Rooms extends WidgetBase
'tags' => unserialize($s->tags),
'node' => $s->node));
}
}
foreach($cd->getAll() as $c) {
array_push($arr,

View file

@ -36,7 +36,7 @@
<h1>{$c->__('room.anonymous_title')}</h1>
<h4>{$c->__('room.anonymous_login', $room)}</h4>
</div>
<ul class="simple divided thick">
<ul class="list thick">
<li>
<form
name="loginanonymous">

View file

@ -6,10 +6,8 @@ use Moxl\Xec\Action\Roster\RemoveItem;
use Moxl\Xec\Action\Presence\Subscribe;
use Moxl\Xec\Action\Presence\Unsubscribe;
class Roster extends WidgetBase
class Roster extends \Movim\Widget\Base
{
private $grouphtml;
function load()
{
$this->addcss('roster.css');
@ -186,7 +184,8 @@ class Roster extends WidgetBase
* @param
* @returns $result: a json for the contacts and one for the groups
*/
function prepareRoster(){
function prepareRoster()
{
//Contacts
$contactdao = new \Modl\ContactDAO();
$contacts = $contactdao->getRoster();
@ -275,10 +274,8 @@ class Roster extends WidgetBase
* $caps: an array of capabilities
* @returns
*/
function prepareContact(&$c, $oc, $caps){
$arr = array();
$jid = false;
function prepareContact(&$c, $oc, $caps)
{
$presencestxt = getPresencesTxt();
// We add some basic information

View file

@ -2,7 +2,7 @@
use Respect\Validation\Validator;
class Share extends WidgetBase
class Share extends \Movim\Widget\Base
{
function load()
{

View file

@ -17,7 +17,7 @@
use Modl\SessionxDAO;
class Statistics extends WidgetBase
class Statistics extends \Movim\Widget\Base
{
function load()
{
@ -95,12 +95,6 @@ class Statistics extends WidgetBase
$this->view->assign('cache_path', BASE_URI.'cache/');
}
public function ajaxGetSessions($hashs)
{
$sd = new SessionxDAO;
$sessions = $sd->getAll();
}
function getTime($date)
{
return prepareDate(strtotime($date));

View file

@ -7,7 +7,7 @@ use Ramsey\Uuid\Uuid;
use Respect\Validation\Validator;
class Stickers extends WidgetBase
class Stickers extends \Movim\Widget\Base
{
function load()
{

View file

@ -18,7 +18,7 @@
* See COPYING for licensing information.
*/
class Subscribe extends WidgetBase {
class Subscribe extends \Movim\Widget\Base {
function load()
{

View file

@ -1,6 +1,6 @@
<?php
class Syndication extends WidgetBase
class Syndication extends \Movim\Widget\Base
{
function load()
{

View file

@ -10,7 +10,7 @@
* @author Timothée Jaussoin <edhelas@gmail.com>
*/
class System extends WidgetBase {
class System extends \Movim\Widget\Base {
function load()
{

View file

@ -18,7 +18,7 @@
* See COPYING for licensing information.
*/
class Tabs extends WidgetBase
class Tabs extends \Movim\Widget\Base
{
function load()
{

View file

@ -2,7 +2,7 @@
use Moxl\Xec\Action\Upload\Request;
class Upload extends WidgetBase {
class Upload extends \Movim\Widget\Base {
function load()
{
$this->addjs('upload.js');

Some files were not shown because too many files have changed in this diff Show more