Browse Source

Continued with the installer

pull/5/head
Kilian Holzinger kilian.holzinger@gmail.com 13 years ago
parent
commit
941489cf05
  1. 4
      build.sh
  2. 10
      image.php
  3. 23
      install/index.php
  4. 2
      install/part0.php
  5. 1
      install/part1.php
  6. 2
      install/template.php
  7. 4
      loader.php
  8. 2
      system/Controller/ControllerBase.php
  9. 10
      system/Controller/ControllerMain.php
  10. 13
      system/Datas/Presence.php
  11. 91
      system/User.php
  12. 5
      system/Widget/widgets/Chat/chat.css
  13. 35
      system/Widget/widgets/Config/Config.php
  14. 6
      system/Widget/widgets/Feed/Feed.php
  15. 201
      system/Widget/widgets/Login/Login.php
  16. 54
      system/Widget/widgets/Login/login.css
  17. 8
      system/Widget/widgets/Login/login.js
  18. 70
      system/Widget/widgets/Notifs/Notifs.php
  19. 10
      system/Widget/widgets/Notifs/notifs.css
  20. 10
      system/Widget/widgets/Notifs/notifs.js
  21. 7
      system/Widget/widgets/Profile/Profile.php
  22. 6
      system/Widget/widgets/Profile/profile.css
  23. 10
      system/Widget/widgets/Profile/profile.js
  24. 159
      system/Widget/widgets/Vcard/Vcard.php
  25. 53
      system/Widget/widgets/Vcard/vcard.css
  26. 4
      system/js/movimrpc.js
  27. 180
      themes/movim/css/forms.css
  28. 7
      themes/movim/css/posts.css
  29. 4
      themes/movim/friend.tpl
  30. 2
      themes/movim/help.tpl
  31. 1
      themes/movim/page.tpl
  32. 3
      themes/movim/profile.tpl

4
build.sh

@ -31,7 +31,7 @@ package() {
}
moxl() {
moxl_temp="moxl"
moxl_temp="Moxl"
# Checking out Moxl.
bzr branch $MOXL_REPO $moxl_temp
rm -rf "$SYSTEM_PATH/Moxl"
@ -52,7 +52,7 @@ clean() {
rm -rf "${SYSTEM_PATH}/Moxl"
rm -rf "${SYSTEM_PATH}/Datajar"
rm -rf datajar
rm -rf moxl
rm -rf Moxl
}
# Doing the job

10
image.php

@ -74,17 +74,13 @@ if(isset($_GET['c'])) {
else {
$user = new User();
//$contact = $sdb->select('Contact', array('key' => $user->getLogin(), 'jid' => $_GET['c']));
$c = new \Contact();
$c = new Contact();
$query = \Contact::query()->select()
$query = Contact::query()->select()
->where(array(
'key' => $user->getLogin(),
'jid' => $_GET['c']));
$contact = \Contact::run_query($query);
movim_log($contact[0]->getData('phototype'));
$contact = Contact::run_query($query);
if($contact[0]->getData('phototype') != '' &&
$contact[0]->getData('photobin') != '' &&

23
install/index.php

@ -326,17 +326,6 @@ if(file_exists($conffile)){
$file = $tmpfile;
}
/*if($file == $tmpfile){
$install = True;
}else{
$install = False;
}
*/
//When the tests do not fail, we just create some directories and succeed to the next step
if(isset($_POST['step'])) {
$handle = $_POST['step'];
@ -397,14 +386,16 @@ if(isset($_POST['step'])) {
//The BOSH settings
#TODO: Check if bosh settings are right and whether open Bosh (e.g. connect to random xmpp); when bosh closed warn the user
}case 3: {
include_once("../system/Moxl/loader.php");
#ToDo: Test Connection
try{
}catch(MoxlException $e){
$Session = array();
//Apennd it to the error array
$errors[] = $e->getMessage();
#$errors[] = $e->getMessage();
//The apge is displayed again:
$display = 3;
}
#$display = 3;
if(True){
$_POST['boshOpen'] = True;
}

2
install/part0.php

@ -34,7 +34,7 @@
<div class="<?php is_valid((datajar_version() >= 0.01)); ?>">
<?php echo t('<a href="http://datajar.movim.eu">Datajar</a> version: '.datajar_version().'<br> Required: 0.01') ?>
</div>
<div class="<?php is_valid(True); ?>">
<div class="<?php is_valid(true); ?>">
<?php echo t('<a href="https://launchpad.net/moxl">Moxl</a> version: asd<br> Required: asdasd') ?>
</div>
</p>

1
install/part1.php

@ -1,4 +1,3 @@
<div id="left" style="width: 230px; padding-top: 10px;">

2
install/template.php

@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $title; ?></title>
<link rel="shortcut icon" href="../themes/movim/img/favicon.ico" />
<link rel="stylesheet" href="../themes/movim/css/style2.css" type="text/css" />
<link rel="stylesheet" href="style2.css" type="text/css" />
<script type="text/javascript">
function changeDB(select)
{

4
loader.php

@ -8,8 +8,8 @@ define('PROPERTIES_PATH', BASE_PATH.'page/properties/');
define('THEMES_PATH', BASE_PATH . 'themes/');
define('USERS_PATH', BASE_PATH . 'user/');
//define('DB_DEBUG', true);
//define('DB_LOGFILE', BASE_PATH . 'log/queries.log');
define('DB_DEBUG', true);
define('DB_LOGFILE', BASE_PATH . 'log/queries.log');
// Loads up all system libraries.
require_once(LIB_PATH . "Lang/i18n.php");

2
system/Controller/ControllerBase.php

@ -57,7 +57,7 @@ class ControllerBase
$user = new user();
if($user->isLogged()) {
try{
$lang = UserConf::getConf(false,'language');
$lang = $user->getConfig('language');//UserConf::getConf(false,'language');
load_language($lang);
}
catch(MovimException $e) {

10
system/Controller/ControllerMain.php

@ -182,12 +182,7 @@ class ControllerMain extends ControllerBase
function login()
{
$this->page->setTitle(t('%s - Login to Movim', APP_TITLE));
//$this->page->menuAddLink('Movim | Human Network', 'http://www.movim.eu/');
$this->page->menuAddLink(t('Home'), '?q=mainPage', true);
//if(Conf::getServerConfElement("accountCreation") == 1)
// $this->page->menuAddLink(t('Account Creation'), '?q=account');
//$this->page->menuAddLink(t('Help'), '?q=help');
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('login.tpl'));
@ -205,11 +200,6 @@ class ControllerMain extends ControllerBase
$this->page->setTitle(t('%s - Help Page', APP_TITLE));
if(!$user->isLogged()) {
/*$this->page->menuAddLink('Movim | Human Network', 'http://www.movim.eu/');
$this->page->menuAddLink(t('Home'), '?q=mainPage');
if(Conf::getServerConfElement("accountCreation") == 1)
$this->page->menuAddLink(t('Account Creation'), '?q=account');
$this->page->menuAddLink(t('Help'), '?q=help', true);*/
$this->login();
} else {
$this->page->menuAddLink(t('Home'), '?q=mainPage');

13
system/Datas/Presence.php

@ -118,12 +118,15 @@ class PresenceHandler {
}
}
public function clearPresence() {
global $sdb;
static public function clearPresence() {
$user = new User();
$presences = $sdb->select('Presence', array('key' => $user->getLogin()));
$query = Presence::query()
->where(
array('key' => $user->getLogin()));
$presences = Presence::run_query($query);
foreach($presences as $presence)
$sdb->delete($presence);
$presence->delete();
}
}

91
system/User.php

@ -10,6 +10,7 @@ class User {
private $username = '';
private $password = '';
private $config = array();
/**
* Class constructor. Reloads the user's session or attempts to authenticate
@ -20,19 +21,9 @@ class User {
{
if($this->isLogged()) {
global $session;
//$sess = Session::start(APP_NAME);
$this->username = $session['user'].'@'.$session['host'];
//$this->password = $sess->get('pass');
/*$this->xmppSession = Jabber::getInstance($this->username);*/
}
/*else if(isset($_POST['login'])
&& isset($_POST['pass'])
&& $_POST['login'] != ''
&& $_POST['pass'] != '') {
$this->authenticate($_POST['login'], $_POST['pass']);
}*/
$this->config = $session['config'];
}
}
/**
@ -41,71 +32,18 @@ class User {
function isLogged()
{
// User is not logged in if both the session vars and the members are unset.
//$sess = Session::start(APP_NAME);
//return (($this->username != '' && $this->password != '') || $sess->get('login'));
global $session;
return $session['on'];
}
/*function authenticate($login,$pass)
{
try{
$data = UserConf::getConf($login);
if( $data == false ) {
// We check if we wants to create an account
header('Location:'.BASE_URI.'index.php?q=disconnect&err=noaccount');
exit;
}
// Careful guys, md5 is _not_ secure. SHA1 recommended here.
if(sha1($pass) == $data['pass']) {
$sess = Session::start(APP_NAME);
$sess->set('login', $login);
$sess->set('pass', $pass);
$this->username = $login;
$this->password = $pass;
$this->xmppSession = Jabber::getInstance($login);
$this->xmppSession->login($login, $pass);
} else {
header('Location:'.BASE_URI.'index.php?q=disconnect&err=wrongpass');
exit;
}
}
catch(MovimException $e){
echo $e->getMessage();
// If we've got an error on a new account
if($e->getCode() == 300)
{
global $sdb;
$conf = new ConfVar();
$sdb->load($conf, array(
'login' => $this->getLogin()
));
if($conf->get('first') == 0)
$conf->set('first', 2);
$sdb->save($conf);
header('Location:'.BASE_URI.'index.php?q=disconnect&err=wrongaccount');
exit;
}
return $e->getMessage();
}
}*/
function desauth()
{
PresenceHandler::clearPresence();
// $sess = Session::start('jaxl');
// Session::dispose('jaxl');
$p = new moxl\PresenceUnavaiable();
$p->request();
if($this->isLogged()) {
$p = new moxl\PresenceUnavaiable();
$p->request();
}
$sess = Session::start(APP_NAME);
Session::dispose(APP_NAME);
@ -128,6 +66,21 @@ class User {
{
return $this->password;
}
function setConfig(array $config)
{
global $session;
$session['config'] = $config;
$sess = Session::start(APP_NAME);
$sess->set('session', $session);
}
function getConfig($key)
{
if(isset($this->config[$key]))
return $this->config[$key];
}
}

5
system/Widget/widgets/Chat/chat.css

@ -72,6 +72,7 @@
height: 20px;
margin: 1px;
margin-bottom: 0px;
margin-top: 0px;
}
#chats .chat .messages .message.me span.date {
@ -83,11 +84,11 @@
border: 1px solid #444;
padding: 2px;
overflow: auto;
border-bottom: none;
border-bottom: 0px;
background-color: white;
height: 1.2em;
resize: none;
display: none;
border-top: 0px;
}
#chats .chat:hover textarea {

35
system/Widget/widgets/Config/Config.php

@ -23,44 +23,69 @@ class Config extends WidgetBase
function WidgetLoad()
{
$this->addcss('config.css');
$this->registerEvent('config', 'onConfig');
}
function onConfig(array $data)
{
$this->user->setConfig($data);
}
function ajaxSubmit($data) {
$usr = new User();
$usr->setLang($data['language']);
$s = new moxl\StorageSet();
$s->setXmlns('movim:prefs')
->setData(serialize($data))
->request();
}
function ajaxGet() {
$s = new moxl\StorageGet();
$s->setXmlns('movim:prefs')
->request();
}
function build()
{
$languages = load_lang_array();
/* We load the user configuration */
$conf = UserConf::getConf();
$conf = $this->user->getConfig('language');
$submit = $this->genCallAjax('ajaxSubmit', "movim_parse_form('general')")
. "this.className='button icon loading merged right'; setTimeout(function() {location.reload(true)}, 2000);";
?>
<div id="config">
<form enctype="multipart/form-data" method="post" action="index.php" name="general">
<div class="element">
<label id="lock" for="language"><?php echo t('Language'); ?></label>
<div class="select">
<select name="language" id="language">
<option value="en">English (default)</option>
<?php
foreach($languages as $key => $value ) {
if($key == $conf['language']) { ?>
if($key == $conf) { ?>
<option value="<?php echo $key; ?>" selected="selected"><?php echo $value; ?></option>
<?php } else {?>
<option value="<?php echo $key; ?>"><?php echo $value; ?></option>
<?php }
} ?>
</select>
</div>
</div>
<hr />
<<<<<<< TREE
<!--<label id="lock" for="soundnotif"><?php echo t('Enable Sound Notification:'); ?></label>
<input type="checkbox" name="soundnotif" value="soundnotif" checked="checked" /><br /> -->
<input value="<?php echo t('Submit'); ?>" onclick="<?php echo $submit; ?>" type="button" class="button icon yes merged right" style="float: right;">
<input type="reset" value="<?php echo t('Reset'); ?>" class="button icon no merged left" style="float: right;">
=======
<br />
<a onclick="<?php echo $submit; ?>" type="button" class="button icon yes merged right" style="float: right;"><?php echo t('Submit'); ?></a>
<!--<a type="reset" value="<?php echo t('Reset'); ?>" class="button icon no merged left" style="float: right;">-->
>>>>>>> MERGE-SOURCE
</p>
</form>
<br /><br />
<div class="message info"><?php echo t("This configuration is shared wherever you are connected !");?></div>
</div>
<?php
}

6
system/Widget/widgets/Feed/Feed.php

@ -5,7 +5,7 @@ class Feed extends WidgetCommon {
{
$this->addcss('feed.css');
$this->addjs('feed.js');
$this->registerEvent('post', 'onPost');
$this->registerEvent('post', 'onStream');
$this->registerEvent('comment', 'onComment');
$this->registerEvent('nocomment', 'onNoComment');
$this->registerEvent('nocommentstream', 'onNoCommentStream');
@ -45,7 +45,7 @@ class Feed extends WidgetCommon {
function onPostPublishError($error) {
$html .=
'<div class="error">'.t('An error occured : ').$error.'</div>';
'<div class="message error">'.t('An error occured : ').$error.'</div>';
RPC::call('movim_fill', 'feednotifs', RPC::cdata($html));
}
@ -85,8 +85,6 @@ class Feed extends WidgetCommon {
function onStream($payload) {
$html = '';
$i = 0;
$html = $this->prepareFeed(0);
if($html == '')

201
system/Widget/widgets/Login/Login.php

@ -24,6 +24,12 @@ class Login extends WidgetBase {
{
$this->addcss('login.css');
$this->addjs('login.js');
$this->registerEvent('config', 'onConfig');
}
function onConfig(array $data)
{
$this->user->setConfig($data);
}
private function displayWarning($warning)
@ -32,67 +38,67 @@ class Login extends WidgetBase {
switch ($warning) {
case 'noaccount':
$warning = '
<div class="warning">
<div class="message warning">
'.t('Wrong username').'
</div> ';
break;
case 'invalidjid':
$warning = '
<div class="warning">
<div class="message warning">
'.t('Invalid JID').'
</div> ';
break;
case 'errormechanism':
$warning = '
<div class="error">
<div class="message error">
'.t('Authentification mechanism not supported by Movim').'
</div> ';
break;
case 'errorchallenge':
$warning = '
<div class="error">
<div class="message error">
'.t('Empty Challenge from the server').'
</div> ';
break;
case 'dnsdomain':
$warning = '
<div class="error">
<div class="message error">
'.t('XMPP Domain error, your account is not a correct Jabber ID').'
</div> ';
break;
case 'datamissing':
$warning = '
<div class="error">
<div class="message error">
'.t('Some data are missing !').'
</div> ';
break;
case 'wrongpass':
$warning = '
<div class="warning">
<div class="message warning">
'.t('Wrong password').'
</div> ';
break;
case 'failauth':
$warning = '
<div class="warning">
<div class="message warning">
'.t('The XMPP authentification failed').'
</div> ';
break;
case 'bosherror':
$warning = '
<div class="warning">
<div class="message error">
'.t('The current BOSH URL in invalid').'
</div> ';
break;
case 'internal':
$warning = '
<div class="error">
<div class="message error">
'.t('Internal server error').'
</div> ';
break;
case 'session':
$warning = '
<div class="error">
<div class="message error">
'.t('Session error').'
</div> ';
break;
@ -104,7 +110,7 @@ class Login extends WidgetBase {
break;
case 'wrongaccount':
$warning = '
<div class="error">
<div class="message error">
'.t('Movim failed to authenticate. You entered wrong data').'
</div> ';
break;
@ -112,6 +118,7 @@ class Login extends WidgetBase {
RPC::call('movim_fill', 'warning',
RPC::cdata($warning));
RPC::call('loginButtonSet', t("Come in!"));
RPC::commit();
exit;
@ -165,7 +172,7 @@ class Login extends WidgetBase {
'port'=> 5222,
'host'=> $host,
'domain' => $domain,
'ressource' => 'moxl',
'ressource' => 'moxl'.md5(date()),
'user' => $user,
'password' => $element['pass']);
@ -183,135 +190,61 @@ class Login extends WidgetBase {
RPC::call('enterMovim', BASE_URI.'?q=mainPage');
RPC::commit();
}
function ajaxGetConfig()
{
$s = new moxl\StorageGet();
$s->setXmlns('movim:prefs')
->request(); $evt = new \Event();
$evt->runEvent('nostream');
}
function build()
{
$submit = $this->genCallAjax('ajaxLogin', "movim_parse_form('login')");
?>
<div id="loginpage">
<?php
if(file_exists(BASE_PATH.'install/part1.php')) { ?>
<div class="warning">
<?php echo t('Please remove the %s folder in order to complete the installation', 'install/'); ?>
</div>
<?php
}?>
<div id="warning"></div>
<form name="login" id="connectform">
<input type="email" name="login" id="login" />
<input type="password" name="pass" id="pass" />
<input
onclick="<?php echo $submit; ?>"
type="button"
name="submit" value="Come In!"/>
</form>
</div>
<?php
/* switch ($_GET['err']) {
case 'noaccount':
$warning = '
<div class="warning">
'.t('Wrong username').'
</div> ';
break;
case 'invalidjid':
$warning = '
<div class="warning">
'.t('Invalid JID').'
</div> ';
break;
case 'wrongpass':
$warning = '
<div class="warning">
'.t('Wrong password').'
</div> ';
break;
case 'failauth':
$warning = '
<div class="warning">
'.t('The XMPP authentification failed').'
</div> ';
break;
case 'bosherror':
$warning = '
<div class="warning">
'.t('The current BOSH URL in invalid').'
</div> ';
break;
case 'internal':
$warning = '
<div class="error">
'.t('Internal server error').'
</div> ';
break;
case 'session':
$warning = '
<div class="error">
'.t('Session error').'
</div> ';
break;
case 'acccreated':
$warning = '
<div class="error valid">
'.t('Account successfully created').'
</div> ';
break;
case 'wrongaccount':
$warning = '
<div class="error">
'.t('Movim failed to authenticate. You entered wrong data').'
</div> ';
break;
}
if(!BROWSER_COMP)
$browser_comp = '
<div class="warning">
'.t('Your web browser is too old to use with Movim.').'
</div> ';
$serverconf = Conf::getServerConf();
echo $browser_comp;
?>
<div id="loginpage">
<form id="connectform" action="index.php" method="post">
<?php echo $warning; ?>
<div id="cells">
<input type="email" name="login" id="login" autofocus required
<?php
if(!BROWSER_COMP) {
echo '
<div class="message warning">
'.t('Your web browser is too old to use with Movim.').'
</div> ';
} else {
if(file_exists(BASE_PATH.'install/part1.php')) { ?>
<div class="message warning">
<?php echo t('Please remove the %s folder in order to complete the installation', 'install/'); ?>
</div>
<?php
}?>
<div id="warning"></div>
<form
name="login"
id="connectform"
onkeypress="if(event.keyCode == 13) {<?php echo $submit; ?> loginButtonSet('<?php echo t('Connecting...');?>', true);}">
<div class="element">
<input type="email" name="login" id="login" autofocus required autocomplete="off"
placeholder="<?php echo t("My address"); ?>"/>
<input type="password" name="pass" id="pass" required
</div>
<div class="element">
<input type="password" name="pass" id="pass" required
placeholder="<?php echo t("Password"); ?>"/>
</div>
<a
class="button icon yes"
onclick="<?php echo $submit; ?> loginButtonSet('<?php echo t('Connecting...');?>', true);"
id="submit"
name="submit"><?php echo t("Come in!"); ?></a>
</form>
<?php
}
?>
</div>
<?php
<input
onclick="if(document.querySelector('#login').value != '' && document.querySelector('#pass').value != '') {this.value = '<?php echo t('Connecting...');?>'; this.className='button icon loading'}"
type="submit"
name="submit" value="<?php echo t("Come in!"); ?>"/>
</div>
<span>
<?php
//$query = ConfVar::query();
//$contacts = ConfVar::run_query($query);
$contacts = ConfVar::run_query(ConfVar::query()->select());
$conf = Conf::getServerConf();
echo t('This server hosts %s accounts', count($contacts));
if($conf["accountCreation"] == 1
&& ($conf['maxUsers'] == -1
|| count($contacts) < $conf['maxUsers'])) {
?> -
<a href="?q=accountCreate"><?php echo t('Create a new account'); ?></a> -
<a href="?q=accountAdd"><?php echo t('Link my current account'); ?></a>
<?php
}
?>
</span>
</div>
</form>
</div>*/
}
}

54
system/Widget/widgets/Login/login.css

@ -22,7 +22,7 @@ body {
margin-top: -170px;
padding-top: 200px;
}
/*
#loginpage input {
background-color: white;
font-size: 1.4em;
@ -39,10 +39,57 @@ body {
color: white;
box-shadow: none;
}
*/
#connectform {
text-align: center;
margin: 0 auto;
width: 665px;
}
#connectform .element {
min-height: 0px;
max-width: 250px;
clear: none;
}
#connectform .element input {
max-width: auto;
font-size: 1.4em;
border: 1px solid #274950;
box-shadow: inset 0px 3px 5px rgba(0, 0, 0, 0.4);
padding: 0.1em 0.5em;
color: #15414A;
background-color: white;
}
#connectform a[name=submit] {
border: 1px solid #274950;
background-color: #547D86;
background: linear-gradient(top, #B9D1D6 0%, #547D86 2px, #547D86 32px, #274950 100%);
background: -moz-linear-gradient(top, #B9D1D6 0%, #547D86 2px, #547D86 32px, #274950 100%);
background: -webkit-linear-gradient(top, #B9D1D6 0%, #547D86 2px, #547D86 32px, #274950 100%);
color: white;
box-shadow: none;
min-width: 130px;
font-size: 1.4em;
text-shadow: -1px -1px 1px #274950;
padding-top: 4px;
overflow: hidden;
padding-left: 20px;
float: right;
margin-top: 5px;
height: 30px;
}
#connectform a[name=submit]:active {
background: linear-gradient(top, #274950 0%, #456C74 2px, #456C74 32px, #6A959F 100%);
background: -moz-linear-gradient(top, #274950 0%, #456C74 2px, #456C74 32px, #6A959F 100%);
background: -webkit-linear-gradient(top, #274950 0%, #456C74 2px, #456C74 32px, #6A959F 100%);
background-color: #274950;
}
#connectform a[name=submit]:before {
color: white;
}
#connectform span {
@ -60,8 +107,7 @@ body {
color: white;
}
.error, .warning {
border-radius: 4px;
.message.error, .message.warning {
display: block;
width: 500px;
margin: 0em auto;

8
system/Widget/widgets/Login/login.js

@ -1,3 +1,11 @@
function enterMovim(url) {
window.location.href = url;
}
function loginButtonSet(val, loading) {
document.querySelector('#submit').innerHTML = val;
if(loading)
document.querySelector('#submit').className = 'button icon loading';
else
document.querySelector('#submit').className = 'button icon yes';
}

70
system/Widget/widgets/Notifs/Notifs.php

@ -120,6 +120,10 @@ class Notifs extends WidgetBase
function ajaxAddContact($jid, $alias) {
if(checkJid($jid)) {
$r = new moxl\RosterAddItem();
$r->setTo($jid)
->request();
$p = new moxl\PresenceSubscribe();
$p->setTo($jid)
->request();
@ -159,35 +163,43 @@ class Notifs extends WidgetBase
}
?>
<li>
<input
id="addjid"
class="tiny"
value="user@server.tld"
onfocus="myFocus(this);"
onblur="myBlur(this);"
/>
<input
id="addalias"
class="tiny"
value="<?php echo t('Alias'); ?>"
onfocus="myFocus(this);"
onblur="myBlur(this);"
/>
<a
class="button tiny icon yes merged right"
href="#"
id="addvalidate"
onclick="<?php $this->callAjax("ajaxAddContact", "getAddJid()", "getAddAlias()"); ?> cancelAddJid();">
<?php echo t('Send request'); ?>
</a>
<a
class="button tiny icon no merged left"
href="#"
id="addrefuse"
onclick="cancelAddJid();">
<?php echo t('Cancel'); ?>
</a>
<form id="addcontact">
<div class="element large">
<label for="addjid"><?php echo t('JID'); ?></label>
<input
id="addjid"
class="tiny"
placeholder="user@server.tld"
onfocus="myFocus(this);"
onblur="myBlur(this);"
/>
</div>
<div class="element large">
<label for="addalias"><?php echo t('Alias'); ?></label>
<input
id="addalias"
type="text"
class="tiny"
placeholder="<?php echo t('Alias'); ?>"
onfocus="myFocus(this);"
onblur="myBlur(this);"
/>
</div>
<a
class="button tiny icon yes merged right"
href="#"
id="addvalidate"
onclick="<?php $this->callAjax("ajaxAddContact", "getAddJid()", "getAddAlias()"); ?> cancelAddJid();">
<?php echo t('Send request'); ?>
</a>
<a
class="button tiny icon no merged left"
href="#"
id="addrefuse"
onclick="cancelAddJid();">
<?php echo t('Cancel'); ?>
</a>
</form>
</li>
</ul>

10
system/Widget/widgets/Notifs/notifs.css

@ -31,12 +31,14 @@
margin-top: 5px;
}
#notifs #notifsalias, #notifs #addjid, #notifs #addalias {
#notifs #notifsalias/*, #notifs #addjid, #notifs #addalias*/ {
display: none;
width: 92%;
margin-top: 3px;
}
#notifs #notifsvalidate, #notifs #addvalidate, #notifs #addrefuse {
#notifs #addcontact, #notifs #notifsvalidate/*, #notifs #addvalidate, #notifs #addrefuse*/ {
display: none;
}
#notifs .element {
min-height: 20px;
}

10
system/Widget/widgets/Notifs/notifs.js

@ -10,17 +10,19 @@ function showAlias(n) {
function addJid(n) {
n.style.display = "none";
document.querySelector('#addvalidate').style.display = "block";
/* document.querySelector('#addvalidate').style.display = "block";
document.querySelector('#addrefuse').style.display = "block";
document.querySelector('#addalias').style.display = "block";
document.querySelector('#addjid').style.display = "block";
document.querySelector('#addjid').style.display = "block";*/
document.querySelector('#addcontact').style.display = "block";
}
function cancelAddJid() {
document.querySelector('#addvalidate').style.display = "none";
/* document.querySelector('#addvalidate').style.display = "none";
document.querySelector('#addrefuse').style.display = "none";
document.querySelector('#addalias').style.display = "none";
document.querySelector('#addjid').style.display = "none";
document.querySelector('#addjid').style.display = "none";*/
document.querySelector('#addcontact').style.display = "none";
document.querySelector('#addstart').style.display = "inline";
}

7
system/Widget/widgets/Profile/Profile.php

@ -66,9 +66,12 @@ class Profile extends WidgetBase
$p = new moxl\PresenceXA();
$p->setStatus($status)->request();
break;
default :
$p = new moxl\PresenceChat();
$p->setStatus($status)->request();
break;
}
//$this->xmpp->setStatus(rawurldecode($status), $presence['show']);
}
}
function prepareVcard($vcard = false)
{

6
system/Widget/widgets/Profile/profile.css

@ -24,12 +24,12 @@
#profile #status {
border: 1px solid transparent;
min-height: 1.2em;
resize: vertical;
resize: none;
color: white;
text-align: center;
background-color: transparent;
width: 90%;
height: 20px;
font-style: italic;
}
#profile #status:hover {

10
system/Widget/widgets/Profile/profile.js

@ -9,7 +9,11 @@ function showPresence(n)
function getStatusText()
{
status = document.querySelector('#profile #status');
console.log(status.value);
return encodeURIComponent(status.value);
status = document.querySelector('#profile #status').value;
return encodeURIComponent(status);
}
movim_add_onload(function()
{
movim_textarea_autoheight(document.querySelector('#profile #status'));
});

159
system/Widget/widgets/Vcard/Vcard.php

@ -24,6 +24,7 @@ class Vcard extends WidgetBase
{
$this->registerEvent('myvcardvalid', 'onMyVcardReceived');
$this->registerEvent('myvcardinvalid', 'onMyVcardNotReceived');
$this->registerEvent('myvcard', 'onMyVcardReceived');
$this->addcss('vcard.css');
$this->addjs('vcard.js');
}
@ -101,14 +102,15 @@ class Vcard extends WidgetBase
if(!isset($me[0])) {
?>
<div class="warning">
<div class="message info">
<?php echo "It's your first time on Movim! To fill in a
few informations about you and display them to your
contacts, create your virtual card by clicking the next button."; ?>
<a
onclick="<?php echo $submit; ?>" style="float: right; margin: 5px 0px 0px 0px;"
href="#" class="button big icon add"><?php echo t("Create my vCard"); ?></a><br />
</div>
<a
onclick="<?php echo $this->genCallAjax('ajaxGetVcard'); ?>" style="float: right; margin: 5px 0px 0px 0px;"
href="#" class="button big icon add"><?php echo t("Create my vCard"); ?></a>
<?php
}
@ -119,7 +121,12 @@ class Vcard extends WidgetBase
if($error == 'vcardfeaturenotimpl') {
$html .= '
<div class="error">'.t("Profil not updated : Your server does not support the vCard feature").'</div>';
<div class="message error">'.t("Profil not updated : Your server does not support the vCard feature").'</div>';
}
if($error == 'vcardbadrequest') {
$html .= '
<div class="message error">'.t("Profil not updated : Request error").'</div>';
}
$html .= '
@ -127,90 +134,109 @@ class Vcard extends WidgetBase
<fieldset class="protect red">
<legend>'.t('General Informations').'</legend>';
$html .= '<div class="element"><span>'.t('Name').'</span>
$html .= '<div class="element">
<label for="fn">'.t('Name').'</label>
<input type="text" name="fn" class="content" value="'.$me->getData('fn').'">
</div>';
$html .= '<div class="element"><span>'.t('Nickname').'</span>
<input type="text" name ="name" class="content" value="'.$me->getData('name').'">
$html .= '<div class="element">
<label for="name">'.t('Nickname').'</label>
<input type="text" name="name" class="content" value="'.$me->getData('name').'">
</div>';
$html .= '<div class="element"><span>'.t('Date of Birth').'</span>';
$html .= '<select name="day" class="datepicker"><option value="-1">'.t('Day').'</option>';
for($i=1; $i<= 31; $i++){
if($i < 10){
$j = '0'.$i;
} else {
$j = $i;
}
if($i == substr( $me->getData('date'), 8)) {
$html .= '<option value="'.$j.'" selected>'.$j.'</option>';
} else {
$html .= '<option value="'.$j.'">'.$j.'</option>';
}
}
$html .= '</select>';
$html .= '<select name="month" class="datepicker"><option value="-1">'.t('Month').'</option>';
for($i=1; $i<= 12; $i++){
if($i < 10){
$j = '0'.$i;
} else {
$j = $i;
}
if($i == substr( $me->getData('date'), 5, 2)) {
$html .= '<option value="'.$j.'" selected>'.$j.'</option>';
} else {
$html .= '<option value="'.$j.'">'.$j.'</option>';
}
}
$html .= '</select>';
$html .= '<select name="year" class="datepicker"><option value="-1">'.t('Year').'</option>';
for($i=date('o'); $i>= 1920; $i--){
if($i == substr( $me->getData('date'), 0, 4)) {
$html .= '<option value="'.$i.'" selected>'.$i.'</option>';
} else {
$html .= '<option value="'.$i.'">'.$i.'</option>';
}
}
$html .= '</select></div>';
$html .= '<div class="element ">
<label for="day">'.t('Date of Birth').'</label>';
$html .= '
<div class="select" style="width: 29%; float: left;">
<select name="day" class="datepicker">
<option value="-1">'.t('Day').'</option>';
for($i=1; $i<= 31; $i++){
if($i < 10){
$j = '0'.$i;
} else {
$j = $i;
}
if($i == substr( $me->getData('date'), 8)) {
$html .= '<option value="'.$j.'" selected>'.$j.'</option>';
} else {
$html .= '<option value="'.$j.'">'.$j.'</option>';
}
}
$html .= ' </select>
</div>';
$html .= '
<div class="select" style="width: 29%; float: left;">
<select name="month" class="datepicker">
<option value="-1">'.t('Month').'</option>';
for($i=1; $i<= 12; $i++){
if($i < 10){
$j = '0'.$i;
} else {
$j = $i;
}
if($i == substr( $me->getData('date'), 5, 2)) {
$html .= '<option value="'.$j.'" selected>'.$j.'</option>';
} else {
$html .= '<option value="'.$j.'">'.$j.'</option>';
}
}
$html .= ' </select>
</div>';
$html .= '
<div class="select" style="width: 29%; float: left;">
<select name="year" class="datepicker">
<option value="-1">'.t('Year').'</option>';
for($i=date('o'); $i>= 1920; $i--){
if($i == substr( $me->getData('date'), 0, 4)) {
$html .= '<option value="'.$i.'" selected>'.$i.'</option>';
} else {
$html .= '<option value="'.$i.'">'.$i.'</option>';
}
}
$html .= ' </select>
</div>
</div>';
$html .= '<br />
<div class="element"><span style="padding-top: 5px;">'.t('Gender').'</span>
<select name="gender">';
$html .= '<div class="element">
<label for="gender">'.t('Gender').'</label>
<div class="select"><select name="gender">';
foreach(getGender() as $key => $value) {
$html .= '<option ';
if($key == $me->getData('gender'))
$html .= 'selected ';
$html .= 'value="'.$key.'">'.$value.'</option>';
}
$html .= ' </select>
$html .= ' </select></div>
</div>';
$html .= '<div class="element"><span style="padding-top: 5px;">'.t('Marital Status').'</span>
<select name="marital">';
$html .= '<div class="element"><label for="marital">'.t('Marital Status').'</label>
<div class="select"><select name="marital">';
foreach(getMarital() as $key => $value) {
$html .= '<option ';
if($key == $me->getData('marital'))
$html .= 'selected ';
$html .= 'value="'.$key.'">'.$value.'</option>';
}
$html .= ' </select>
$html .= ' </select></div>
</div>';
$html .= '<br />
<div class="element"><span>'.t('Website').'</span>
$html .= '<div class="element"><label for="url">'.t('Website').'</label>
<input type="url" name ="url" class="content" value="'.$me->getData('url').'">
</div>';
$html .= '<br />
<div class="element"><span>'.t('Avatar').'</span>
$html .= '<div class="element"><label for="avatar">'.t('Avatar').'</label>
<input type="file" onchange="vCardImageLoad(this.files);">
<img id="vCardPhotoPreview" src="data:'.$me->getData('phototype').';base64,'.$me->getData('photobin').'">
<input type="hidden" name="phototype" value="'.$me->getData('phototype').'">
<input type="hidden" name="photobin" value="'.$me->getData('photobin').'"><br />
<span></span><input type="file" onchange="vCardImageLoad(this.files);">
</div>';
$html .= '<br />
<div class="element"><span>'.t('About Me').'</span>
$html .= '<div class="element"><label for="desc">'.t('About Me').'</label>
<textarea name ="desc" class="content" onkeyup="movim_textarea_autoheight(this);">'.trim($me->getData('desc')).'</textarea>
</div>';
@ -220,18 +246,17 @@ class Vcard extends WidgetBase
<legend>'.t('Geographic Position').'</legend>';
$html .= '<div class="warning"><a class="button tiny" style="float: right;" onclick="getPos(this);">Récupérer ma position</a></div>';
$html .= '<div id="geolocation"></div>';
$html .= '<div class="element"><span>'.t('Latitude').'</span>
$html .= '<div class="element"><label>'.t('Latitude').'</label>
<input type="text" name="lat" class="content" value="Latitude" readonly>
</div>';
$html .= '<div class="element"><span>'.t('Longitude').'</span>
$html .= '<div class="element"><label>'.t('Longitude').'</label>
<input type="text" name="long" class="content" value="Longitude" readonly>
</div>';
$html .= '<hr />
</fieldset>';*/
$html .= '<input
value="'.t('Submit').'"
$html .= '<hr /><br />';
$html .= '<a
onclick="
'.$submit.' this.value = \''.t('Submitting').'\';
this.className=\'button icon loading merged right\'"
@ -242,8 +267,8 @@ class Vcard extends WidgetBase
$html .= 'yes';
$html .= ' merged right"
type="button" style="float: right;"
> ';
$html .= '<input type="reset" value="'.t('Reset').'" class="button icon no merged left" style="float: right;">';
>'.t('Submit').'</a>';
//$html .= '<a type="reset" class="button icon no merged left" style="float: right;">'.t('Reset').'</a>';
$html .= '

53
system/Widget/widgets/Vcard/vcard.css

@ -2,57 +2,6 @@
padding: 1em 1.5em;
}
#vcard .element {
padding: 5px;
clear: both;
overflow: auto;
width: 100%;
}
#vcard img {
max-width: 200px;
padding: 5px;
border: 1px solid #CCC;
}
#vcard input[type=text], #vcard input[type=url], #vcard textarea {
border: 1px solid transparent;
margin: -5px;
background-color: transparent;
}
#vcard input[type=text]:hover, #vcard input[type=url]:hover, #vcard textarea:hover {
border-color: #DDD;
}
#vcard input[type=text]:focus, #vcard input[type=url]:focus, #vcard textarea:focus {
border-color: #CCC;
}
#vcard input:invalid, #vcard input:invalid:hover, #vcard input:invalid:focus {
border-color: #983A3A;
}
#vcard .element span {
font-weight: bold;
width: 160px;
display: block;
float: left;
padding-right: 2em;
text-align: right;
min-height: 2em;
}
#vcard .content {
display: block;
float: left;
width: 370px;
resize: none;
}
#vcard .datepicker {
display: block;
float: left;
width: 80px;
margin: 0 auto;
}

4
system/js/movimrpc.js

@ -94,9 +94,9 @@ function MovimRPC()
movim_xmlhttp.onreadystatechange = function()
{
if(movim_xmlhttp.readyState == 4 && movim_xmlhttp.status == 200) {
//if(movim_xmlhttp.readyState == 4 && movim_xmlhttp.status == 200) {
handler(movim_xmlhttp.responseXML);
}
//}
if(movim_xmlhttp.readyState == 4 && movim_xmlhttp.status == 500) {
var url = window.location.href;
var urlparts = url.split('/');

180
themes/movim/css/forms.css

@ -0,0 +1,180 @@
form * {
margin: 0px;
padding: 0px;
float: none;
}
fieldset {
border: none;
margin-top: 20px;
border-top: 1px solid #DCDCDC;
}
legend {
float: left;
position: relative;
top: -25px;
clear: both;
}
form .element:nth-child(2) {
clear: both;
}
form .element {
overflow: auto;
min-height: 80px;
width: 50%;
float: left;
}
form .element.large {
width: 100%;
}
form .element > label {
display: block;
}
form .element > *:not(label):not(img) {
display: block;
width: 90%;
border: 1px solid #999;
min-height: 30px;
border-radius: 4px;
background-color: white;
box-shadow: inset 0 2px 1px #ddd;
margin: 5px 0px;
margin-right: 5px;
padding-left: 5px;
}
form .element > *:not(label):not(img):focus {
border: 1px solid gray;
box-shadow: inset 0 2px 2px #bbb;
outline: none;
background-color: white;
}
form .element textarea, textarea {
padding: 10px 0px;
resize: vertical;
background-color: white;
}
form .element .select {
box-shadow: 0 1px 1px #ddd;
border-top: 1px solid #ccc;
border-bottom: 1px solid #888;
padding: 0px;
height: 20px;
position: relative;
overflow: hidden;
background-image: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.04) 2px);
background-image: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.04) 2px);
background-image: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.04) 2px);
background-color: white;
background-size: 100% 100%;
}
form .element .select:hover {
box-shadow: 0px 1px 1px #ccc;
border: 1px solid gray;
}
form .element .select select {
width: 120%;
background-color: transparent;
display: block;
padding-top: 5px;
padding-left: 5px;
height: 30px;
}
form .element .select:before {
content: "▶";
font: 11px sans-serif;
font-weight: bold;
color: #444;
right: 0px;
transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
padding: 8px;
position: absolute;
display: block;
}
form .element .select select option {
height: 20px;
padding: 5px;
}
input[type=submit], input[type=reset], input[type=button], .button, .button:link, .button:visited {
display: inline-block;
border: 1px solid #999;
border-radius: 4px;
box-shadow: 0 1px 1px #ddd;
border-top: 1px solid #ccc;
border-bottom: 1px solid #888;
padding: 0px 10px;
position: relative;
overflow: hidden;
background-image: -moz-linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.04) 2px);
background-image: -webkit-linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.04) 2px);
background-image: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.04) 2px);
background-color: white;
background-size: 100% 100%;
}
input:hover[type=submit], input[type=reset]:hover, input[type=button]:hover, .button:hover {
box-shadow: 0px 1px 1px #ccc;
border: 1px solid gray;
cursor: pointer;
}
.button.icon {
padding-left: 35px;
background-repeat: no-repeat;
line-height: 28px;
position: relative;
overflow: hidden;
}
.button.icon:before {
content: "✘";
font: 14px sans-serif;
font-weight: bold;
color: #444;
left: 0px;
padding: 5px 10px;
position: absolute;
background-position: 6px 6px;
background-repeat: no-repeat;
min-width: 10px;
min-height: 10px;
}
.icon.yes:before { content: "✔"; padding: 6px 10px;}
.icon.no:before { content: "✘"; padding: 6px 10px; }
.icon.bubble { background-image: url(../img/icons/comments_icon.png); }
.icon.bubbleadd { background-image: url(../img/icons/comments_add.png); }
.icon.bubbleold { background-image: url(../img/icons/comments_show.png); }
.icon.follow:before { content:"⇒" }
.icon.chat:before { background-image: url(../img/icons/chat_icon.png); content:"";}
.icon.add:before { content: "+"; }
.icon.rm { background-image: url(../img/icons/rm_icon.png); }
.icon.submit:before { content: "▼"; }
.icon.loading:before { content: "◕"; }
.tiny.icon.loading:before { padding: 4px 7px; }
.tiny.icon {
font-size: 11px;
line-height: 22px;
padding-left: 23px;
}
.tiny.icon:before {
padding: 5px 6px;
font-size: 11px;
}

7
themes/movim/css/posts.css

@ -166,13 +166,6 @@
color: #333;
}
label {
float:left;
text-align:right;
width: auto;
padding: 5px 9px 5px 9px;
}
.post table#commentsubmit {
border-spacing: 0px;
background-color: white;

4
themes/movim/friend.tpl

@ -2,7 +2,7 @@
?>
<?php $this->widget('Poller');?>
<?php /*$this->widget('Logout');*/?>
<?php $this->widget('Logout');?>
<?php $this->widget('Chat');?>
<div id="left">
@ -10,7 +10,7 @@
<?php $this->widget('ContactSummary');?>
</div>
<div id="right">
<?php /*$this->widget('Notifs');*/?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="center">

2
themes/movim/help.tpl

@ -10,7 +10,7 @@
</div>
<div id="right">
<?php /*$this->widget('Notifs');*/?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="center">

1
themes/movim/page.tpl

@ -9,6 +9,7 @@
<?php
$this->addCss('css/style2.css');
$this->addCss('css/posts.css');
$this->addCss('css/forms.css');
$this->addCss('css/animations.css');
?>
<?php $this->scripts();?>

3
themes/movim/profile.tpl

@ -4,14 +4,13 @@
<?php $this->widget('Poller');?>
<?php $this->widget('Logout');?>
<?php $this->widget('Chat');?>
<?php /*$this->widget('Log');*/?>
<div id="left">
<?php $this->widget('Profile');?>
</div>
<div id="right">
<?php /*$this->widget('Notifs');*/?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="center">

Loading…
Cancel
Save