Browse Source

- Merge with edhelas's branch

pull/5/head
Jaussoin Timothée 14 years ago
parent
commit
f9b15e4e27
  1. 803
      i18n/de.po
  2. 5
      index.php
  3. 7
      jajax.php
  4. 5
      loader.php
  5. 48
      system/Controller/ControllerMain.php
  6. 4
      system/Datas/Attachment.php
  7. 43
      system/Datas/Caps.php
  8. 25
      system/Datas/ConfVar.php
  9. 4
      system/Datas/Post.php
  10. 15
      system/Datas/Presence.php
  11. 6
      system/Event.php
  12. 163
      system/Jabber.php
  13. 2
      system/RPC.php
  14. 2
      system/Tpl/TplPageBuilder.php
  15. 35
      system/User.php
  16. 46
      system/Utils.php
  17. 60
      system/Widget/WidgetBase.php
  18. 2
      system/Widget/WidgetCommon.php
  19. 56
      system/Widget/WidgetWrapper.php
  20. 23
      system/Widget/widgets/Account/Account.php
  21. 179
      system/Widget/widgets/AccountAdd/AccountAdd.php
  22. 30
      system/Widget/widgets/Chat/Chat.php
  23. 2
      system/Widget/widgets/Chat/chat.css
  24. 25
      system/Widget/widgets/ContactCard/ContactCard.php
  25. 58
      system/Widget/widgets/ContactSummary/ContactSummary.php
  26. 20
      system/Widget/widgets/ContactSummary/contactsummary.css
  27. BIN
      system/Widget/widgets/ContactSummary/img/address.png
  28. BIN
      system/Widget/widgets/ContactSummary/img/birth.png
  29. BIN
      system/Widget/widgets/ContactSummary/img/hearth.png
  30. BIN
      system/Widget/widgets/ContactSummary/img/mobile.png
  31. BIN
      system/Widget/widgets/ContactSummary/img/place.png
  32. 54
      system/Widget/widgets/Feed/Feed.php
  33. 9
      system/Widget/widgets/Feed/feed.css
  34. 4
      system/Widget/widgets/Log/Log.php
  35. 80
      system/Widget/widgets/Login/Login.php
  36. BIN
      system/Widget/widgets/Login/img/logo.png
  37. 77
      system/Widget/widgets/Login/login.css
  38. 7
      system/Widget/widgets/Logout/Logout.php
  39. 8
      system/Widget/widgets/Logout/logout.css
  40. 2
      system/Widget/widgets/Notifs/notifs.css
  41. 12
      system/Widget/widgets/Profile/Profile.php
  42. 13
      system/Widget/widgets/Profile/profile.css
  43. 4
      system/Widget/widgets/Roster/Roster.php
  44. 7
      system/Widget/widgets/Roster/roster.css
  45. 9
      system/Widget/widgets/Vcard/Vcard.php
  46. 3
      system/Widget/widgets/Vcard/vcard.css
  47. 49
      system/Widget/widgets/Wall/Wall.php
  48. 2
      system/js/movim.js
  49. 37
      themes/movim/account.tpl
  50. 7
      themes/movim/account_add.tpl
  51. 7
      themes/movim/account_create.tpl
  52. 6
      themes/movim/config.tpl
  53. 11
      themes/movim/css/posts.css
  54. 108
      themes/movim/css/style2.css
  55. 12
      themes/movim/friend.tpl
  56. 6
      themes/movim/help.tpl
  57. 6
      themes/movim/img/default.svg
  58. 5
      themes/movim/main.tpl
  59. 8
      themes/movim/profile.tpl

803
i18n/de.po

@ -3,495 +3,574 @@
# This file was translated from CodingTeam at <http://codingteam.net/>.
msgid ""
msgstr ""
"Project-Id-Version: Movim \n"
"PO-Revision-Date: 2011-08-12 16:13:00\n"
"Project-Id-Version: Movim\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-04-02 21:07+0200\n"
"PO-Revision-Date: 2012-05-09 12:18+0000\n"
"Last-Translator: Kilian Holzinger <Unknown>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-05-11 22:28+0000\n"
"X-Generator: Launchpad (build 15225)\n"
#: ../init.php:7
msgid "MOVIM - Test Client"
msgstr "MOVIM – Test-Instanz"
#: ../system/Controller/ControllerMain.php:40
#: ../system/Controller/ControllerMain.php:59
msgid "%s - Welcome to Movim"
msgstr "%s – Willkommen bei Movim"
#: ../system/Controller/ControllerMain.php:42
#: ../system/Controller/ControllerMain.php:61
#: ../system/Controller/ControllerMain.php:91
#: ../system/Controller/ControllerMain.php:107
msgid "Home"
msgstr "Start"
#: ../system/Controller/ControllerMain.php:43
#: ../system/Controller/ControllerMain.php:71
#: ../system/Controller/ControllerMain.php:92
msgid "Configuration"
msgstr "Einstellungen"
#: ../install/part1.php:59
msgid "PHP version mismatch. Movim requires PHP 5.3 minimum."
msgstr ""
"Die installierte PHP Version stimmt nicht. Movim benötigt mindestens PHP 5.3."
#: ../system/Widget/widgets/Logout/Logout.php:49
msgid "Logout"
msgstr "Abmelden"
#: ../install/part1.php:59
msgid "Actual version : "
msgstr "Aktuelle Version : "
#: ../system/Controller/ControllerMain.php:89
msgid "%s - Configuration"
msgstr "%s – Einstellungen"
#: ../install/part1.php:60
msgid "Update your PHP version or contact your server administrator"
msgstr "Aktualisiere PHP oder melde dich beim Administrator"
#: ../system/Controller/ControllerMain.php:105
msgid "%s - Account Creation"
msgstr "%s – Registrieren"
#: ../install/part1.php:63 ../install/part1.php:67 ../install/part1.php:71
#: ../install/part1.php:89
#, php-format
msgid "Movim requires the %s extension."
msgstr "Movim benötigt die Erweiterung: %s"
#: ../system/Controller/ControllerMain.php:123
msgid "%s - Login to Movim"
msgstr "%s – Anmelden"
#: ../install/part1.php:64
#, php-format
msgid "Install %s and %s packages"
msgstr "Installieren Sie %s und %s Pakete"
#: ../system/Controller/ControllerMain.php:126
msgid "Account Creation"
msgstr "Registrieren"
#: ../install/part1.php:68 ../install/part1.php:72
#, php-format
msgid "Install the %s package"
msgstr "Installiere %s"
#: ../system/Controller/ControllerMain.php:136
msgid "My address"
msgstr "Adresse"
#: ../install/part1.php:75
msgid "Movim's folder must be writable."
msgstr "Das Movim Verzeichnis muß Schreibrechte besitzen."
#: ../system/Controller/ControllerMain.php:137
msgid "Password"
msgstr "Passwort"
#: ../install/part1.php:76
msgid "Enable read and write rights on Movim's root folder"
msgstr ""
"Bitte setzte Lese- und Schreibrechte in dem Ordner, wohin du Movim entpackt "
"hast."
#: ../system/Controller/ControllerMain.php:138
msgid "Come in!"
msgstr "Komm‘ herein!"
#: ../install/part1.php:88
msgid "or"
msgstr "oder"
#: ../lib/GetConf.php:2
#: ../lib/GetConf.php:45
#~ msgid "Error: Cannot load element value'%s'"
#~ msgstr "Fehler: Elementwert »%s« konnte nicht geladen werden"
#: ../install/part1.php:140 ../install/part1.php:150 ../install/part2.php:188
msgid "Movim Installer"
msgstr "Movim Installer"
#: ../lib/GetConf.php:139
#~ msgid "Error: Cannot load file '%s'"
#~ msgstr "Fehler: Datei »%s« konnte nicht geladen werden"
#: ../install/part1.php:140
msgid "Compatibility Test"
msgstr "Kompatibilitätsprüfung"
#: ../lib/WidgetWrapper.php:98
#~ msgid "Error: Requested widget '%s' doesn't exist."
#~ msgstr "Fehler: Angefordertes Widget »%s« ist nicht vorhanden."
#: ../install/part1.php:141
msgid ""
"The following requirements were not met. Please make sure they are all "
"satisfied in order to install Movim."
msgstr ""
"Die folgenden Voraussetzungen sind nicht erfüllt. Behebe die Mängel um Movim "
"installieren zu können."
#: ../system/User.php:67
msgid "Wrong password"
msgstr "Passwort falsch"
#: ../install/part1.php:220
msgid "XMPP Connection Preferences"
msgstr "XMPP Verbindungseinstellungen"
#: ../lib/Widget.php:69
#~ msgid "This is a sample widget."
#~ msgstr "Dies ist ein Beispiel-Widget"
#: ../install/part1.php:233
msgid "BOSH Connection Preferences"
msgstr "BOSH Verbindungseinstellungen"
#: ../lib/XMPPConnect.php:147
#~ msgid "Error: jid `%s' is incorrect"
#~ msgstr "Fehler: Falsche jid »%s«"
#: ../install/part1.php:237
msgid "The Bosh configuration is invalid"
msgstr "Die Einstellungen für BOSH sind nicht in Ordnung"
#: ../lib/widgets/Account/Account.php:3
#: ../lib/widgets/Account/Account.php:34
#~ msgid "Jabber Account"
#~ msgstr "Jabber-Konto"
#: ../install/part1.php:259
msgid "Proxy Preferences"
msgstr "Proxy-Server Einstellungen"
#: ../system/Widget/widgets/Config/Config.php:74
msgid "Submit"
msgstr "Übernehmen"
#: ../install/part1.php:284
msgid "The Database configuration is invalid"
msgstr "Die Datenbankkonfiguration ist ungültig"
#: ../system/Widget/widgets/Config/Config.php:75
msgid "Reset"
msgstr "Zurücksetzen"
#: ../install/part2.php:99 ../install/part2.php:103 ../install/part2.php:107
#, php-format
msgid "Couldn't create directory '%s'."
msgstr "Verzeichnis '%s' konnte nicht erstellt werden!"
#: ../system/Widget/widgets/Chat/Chat.php:86
#~ msgid "Send"
#~ msgstr "Absenden"
#: ../install/part2.php:136
#, php-format
msgid "Couldn't create configuration file '%s'."
msgstr "Die Konfigurationsdatei '%s' konnte nicht erstellt werden!"
#: ../system/Widget/widgets/Config/Config.php:45
msgid "Language"
msgstr "Sprache"
#: ../install/part2.php:188
msgid "Success !"
msgstr "Erfolgreich !"
#: ../lib/widgets/Config.php:45
#~ msgid "Full Name"
#~ msgstr "Name"
#: ../install/part2.php:191
msgid "Valid Bosh"
msgstr "BOSH ist in Ordnung"
#: ../system/Widget/widgets/Config/Config.php:60
msgid "BOSH Connection Prefrences"
msgstr "Verbindungseinstellungen"
#: ../lib/Dispatcher.php:9
#: ../lib/widgets/Config/Config.php:59
#~ msgid "Changing these data can be dangerous and may compromise the connection to the XMPP server"
#~ msgstr "Eine Änderung dieser Daten kann gefährlich sein und die Verbindung zum XMPP-Server behindern."
#: ../install.php:13
#: ../system/Widget/widgets/Config/Config.php:63
msgid "Bosh Host"
msgstr "Server"
#: ../install.php:14
#: ../system/Widget/widgets/Config/Config.php:67
msgid "Bosh Suffix"
msgstr "Suffix"
#: ../install.php:14
#: ../system/Widget/widgets/Config/Config.php:70
msgid "Bosh Port"
msgstr "Port"
#: ../lib/widgets/Config/Config.php:76
#~ msgid "error: "
#~ msgstr "Fehler:"
#: ../system/Widget/widgets/Friends/Friends.php:151
#~ msgid "Contacts"
#~ msgstr "Freunde"
#: ../system/Conf2.php:9
#: ../system/Conf2.php:14
#: ../system/Conf2.php:142
#: ../system/Conf.php:8
#: ../system/Conf.php:13
#: ../system/Conf.php:135
msgid "Couldn't create file %s"
msgstr "Die folgende Datei konnte nicht erstellt werden: %s"
#: ../system/Conf2.php:14
#: ../system/Conf.php:137
msgid "Couldn't create configuration files."
msgstr "Die Konfigurationsdateien konnten nicht erstellt werden."
#: ../lib/XMPPConnect.php:98
#~ msgid "Error: User not logged in."
#~ msgstr "Fehler: Der Benutzer ist nicht angemeldet."
#: ../lib/XMPPConnect.php:102
#~ msgid "Error: JID not provided."
#~ msgstr "Fehler: Die JID ist nicht bekannt."
#: ../lib/XMPPConnect.php:117
#~ msgid "Error: jid '%s' is incorrect"
#~ msgstr "Fehler: Die JID "%s" ist nicht korrekt."
#: ../system/Widget/widgets/Profile/Profile.php:34
msgid "Chat"
msgstr "Tchat"
#: ../install/part2.php:192
msgid "Database Detected"
msgstr "Datenbank Erkannt"
#: ../system/Widget/widgets/Chat/Chat.php:155
msgid "Message"
msgstr "Nachricht"
#: ../install/part2.php:193
msgid "Database Movim schema installed"
msgstr "Das Datenbank-Schema Movim ist installiert"
#: ../system/Widget/widgets/Chat/Chat.php:85
#~ msgid "To"
#~ msgstr "An"
#: ../install/part2.php:196
#, php-format
msgid "You can now access your shiny Movim instance %sJump In !%s"
msgstr ""
"Du kannst jetzt deine nagelneue Movim-Instanz betreten. %sAuf geht's!%s"
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:51
#: ../system/Widget/widgets/Profile/Profile.php:48
msgid "Your avatar"
msgstr "Dein Profilbild"
#: ../install/part2.php:197 ../system/Widget/widgets/Login/Login.php:87
#, php-format
msgid "Please remove the %s folder in order to complete the installation"
msgstr "Bitte entfernen Sie den %s Ordner um die Installation abzuschließen"
#: ../lib/widgets/Friends/Friends.php:111
#~ msgid "Refresh vCard"
#~ msgstr "Die vCard aktualisieren"
#: ../system/Conf.php:38
#, php-format
msgid "Cannot load element value'%s'"
msgstr "Konnte das Element mit dem Wert '%s' nicht laden."
#: ../lib/widgets/Friends/Friends.php:116
#~ msgid "Online"
#~ msgstr "Online"
#: ../system/Conf.php:49
#, php-format
msgid "Cannot load file '%s'"
msgstr "Die Datei '%s' kann nicht gelesen werden."
#: ../lib/widgets/Friends/Friends.php:117
#~ msgid "Offline"
#~ msgstr "Offline"
#: ../system/Jabber.php:107
msgid "User not logged in."
msgstr "Nicht angemeldet!"
#: ../lib/widgets/Friends/Friends.php:118
#~ msgid "Hidden"
#~ msgstr "Versteckt"
#: ../system/Jabber.php:111
msgid "JID not provided."
msgstr "Die JID wurde nicht übermittelt"
#: ../system/Widget/widgets/Profile/Profile.php:36
msgid "Away"
msgstr "Abwesend"
#: ../system/Jabber.php:135
#, php-format
msgid "jid '%s' is incorrect"
msgstr "Die JID '%s' ist inkorrekt."
#: ../lib/widgets/Friends/Friends.php:120
#~ msgid "Do Not Disturb"
#~ msgstr "Nicht stören"
#: ../system/Jabber.php:145 ../system/Widget/widgets/Login/Login.php:117
msgid "Connecting..."
msgstr "Verbindung wird aufgebaut ..."
#: ../lib/widgets/Friends/Friends.php:124
#~ msgid "Refresh Roster"
#~ msgstr "Roster aktualisieren"
#: ../system/Logger.php:27
#, php-format
msgid "Cannot open log file '%s'"
msgstr "Die Logdatei '%s' konnte nicht geöffnet werden."
#: ../system/Widget/widgets/Log/Log.php:33
msgid "Debug console"
msgstr "Debug Konsole"
#: ../system/MovimException.php:15
#, php-format
msgid "Error: %s"
msgstr "Fehler: %s"
#: ../install.php:17
msgid "PHP version mismatch. Movim requires PHP 5.3 minimum."
msgstr "Die installierte PHP Version stimmt nicht. Movim benötigt mindestens PHP 5.3."
#: ../system/User.php:68
msgid "Wrong password"
msgstr "Passwort falsch"
#: ../install.php:2
#: ../install.php:23
msgid "Movim requires the %s extension."
msgstr "Movim benötigt die Erweiterung: %s"
#: ../system/Utils.php:117
msgid "Today"
msgstr "Heute"
#: ../install.php:26
msgid "Movim's folder must be writable."
msgstr "Das Movim Verzeichnis muß Schreibrechte besitzen."
#: ../system/Utils.php:119
msgid "Tomorrow"
msgstr "Morgen"
#: ../install.php:121
msgid "Movim Installer"
msgstr "Movim Installer"
#: ../system/Utils.php:121
msgid "Yesterday"
msgstr "Gestern"
#: ../install.php:125
msgid "Theme"
msgstr "Aussehen"
#: ../system/Utils.php:127
msgid "day"
msgstr "Tag"
#: ../install.php:126
msgid "Default language"
msgstr "Standard Sprache"
#: ../system/Utils.php:130
#, php-format
msgid " %d days ago"
msgstr " vor %d Tagen"
#: ../install.php:127
msgid "Bosh cookie's expiration (s)"
msgstr "Der Bosh-Cookie ist abgelaufen."
#: ../system/Controller/ControllerMain.php:40
#: ../system/Controller/ControllerMain.php:59
#, php-format
msgid "%s - Welcome to Movim"
msgstr "%s – Willkommen bei Movim"
#: ../install.php:128
msgid "Bosh cookie's path"
msgstr "Der Pfad des Bosh-Cookies"
#: ../system/Controller/ControllerMain.php:41
#: ../system/Controller/ControllerMain.php:60
#: ../system/Controller/ControllerMain.php:94
#: ../system/Controller/ControllerMain.php:113
#: ../system/Controller/ControllerMain.php:129
#: ../system/Controller/ControllerMain.php:148
msgid "Home"
msgstr "Start"
#: ../install.php:129
msgid "Bosh cookie's domain"
msgstr "Die Bosh-Cookie-Domain"
#: ../system/Controller/ControllerMain.php:42
#: ../system/Controller/ControllerMain.php:74
#: ../system/Controller/ControllerMain.php:95
#: ../system/Controller/ControllerMain.php:114
#: ../system/Widget/widgets/ContactCard/ContactCard.php:143
#: ../system/Widget/widgets/Vcard/Vcard.php:134
msgid "Profile"
msgstr "Profil"
#: ../install.php:131
msgid "Use HTTPS for Bosh"
msgstr "Verwende HTTPS für Bosh"
#: ../system/Controller/ControllerMain.php:43
#: ../system/Controller/ControllerMain.php:75
#: ../system/Controller/ControllerMain.php:96
#: ../system/Controller/ControllerMain.php:115
msgid "Configuration"
msgstr "Einstellungen"
#: ../install.php:133
msgid "Use only HTTP for Bosh"
msgstr "Nur HTTP für Bosh verwenden"
#: ../system/Controller/ControllerMain.php:93
#, php-format
msgid "%s - Configuration"
msgstr "%s – Einstellungen"
#: ../install.php:135
msgid "Log verbosity"
msgstr "Informationsgehalt des Logs"
#: ../system/Controller/ControllerMain.php:112
#, php-format
msgid "%s - Profile"
msgstr "%s - Profil"
#: ../install.php:136
msgid "Allow account creation"
msgstr "Erlaube die Registrierung von neuen Profilen"
#: ../system/Controller/ControllerMain.php:127
#, php-format
msgid "%s - Account Creation"
msgstr "%s – Registrieren"
#: ../install.php:139
#~ msgid "Bosh server"
#~ msgstr ""
#: ../system/Controller/ControllerMain.php:130
#: ../system/Controller/ControllerMain.php:150
msgid "Account Creation"
msgstr "Registrieren"
#: ../install.php:140
#~ msgid "Bosh suffix"
#~ msgstr ""
#: ../system/Controller/ControllerMain.php:146
#, php-format
msgid "%s - Login to Movim"
msgstr "%s – Anmelden"
#: ../install.php:143
msgid "<h2>Storage</h2>"
msgstr "<h2>Speicherung</h2>"
#: ../system/Widget/widgets/Account/Account.php:169
msgid "Some data are missing !"
msgstr "Es fehlen Daten"
#: ../install.php:19
#: ../install.php:19
#: ../install.php:201
msgid "Couldn't create directory '%s'."
msgstr "Verzeichnis '%s' konnte nicht erstellt werden!"
#: ../system/Widget/widgets/Account/Account.php:175
msgid "Wrong ID"
msgstr "Falsche ID"
#: ../install.php:225
msgid "Couldn't create configuration file '%s'."
msgstr "Die Konfigurationsdatei '%s' konnte nicht erstellt werden!"
#: ../system/Widget/widgets/Account/Account.php:181
msgid "You entered different passwords"
msgstr "Die Passwörter stimmen nicht überein"
#: ../install.php:248
msgid "Compatibility Test"
msgstr "Kompatibilitätsprüfung"
#: ../system/Widget/widgets/Account/Account.php:187
msgid "Invalid name"
msgstr "Unzulässiger Name"
#: ../install.php:249
msgid "The following requirements were not met. Please make sure they are all satisfied in order to install Movim."
msgstr "Die folgenden Voraussetzungen sind nicht erfüllt. Behebe die Mängel um Movim installieren zu können."
#: ../system/Widget/widgets/Account/Account.php:193
msgid "Username already taken"
msgstr "Benutzername bereits vergeben"
#: ../install.php:262
msgid "Movim is installed!"
msgstr "Movim wurde erfolgreich installiert."
#: ../system/Widget/widgets/Account/Account.php:199
msgid "Could not connect to the XMPP server"
msgstr "Eine Verbindung zum XMPP-Server war nicht möglich"
#: ../install.php:263
msgid "You can now access your shiny %sMovim instance%s"
msgstr "Du kannst jetzt auf deine nagelneue Movim-Instanz %sMovim instance%s zugreifen."
#: ../system/Widget/widgets/Account/Account.php:205
msgid "Could not communicate with the XMPP server"
msgstr "Konnte nicht mit dem XMPP kommunizieren."
#: ../system/Cache.php:168
msgid "Couldn't open cache. Please contact the administrator."
msgstr "Cache kann nicht geöffnet werden. Wende dich an den Administrator"
#: ../system/Widget/widgets/Account/Account.php:211
msgid "Unknown error"
msgstr "Unbekannter Fehler."
#: ../system/Conf2.php:3
#: ../system/Conf2.php:5
#: ../system/Conf.php:24
#: ../system/Conf.php:48
msgid "Cannot load element value'%s'"
#: ../system/Widget/widgets/Account/Account.php:226
msgid ""
"Firstly fill in this blank with a brand new account ID, this address will "
"follow you on all the Movim network !"
msgstr ""
"Zunächst füll bitte dieses freie Feld mit einer nagelneuen Adresse aus. "
"Diese begleitet dich überall im Movim Netzwerk."
#: ../system/Conf2.php:15
#: ../system/Conf.php:174
msgid "Cannot load file '%s'"
msgstr "Die Datei '%s' kann nicht gelesen werden."
#: ../system/Jabber.php:110
msgid "User not logged in."
msgstr "Nicht angemeldet!"
#: ../system/Widget/widgets/Account/Account.php:226
msgid "Only alphanumerics elements are authorized"
msgstr "Es sind nur Buchstaben und Zahlen zugelassen."
#: ../system/Jabber.php:114
msgid "JID not provided."
msgstr "Die JID wurde nicht übermittelt"
#: ../system/Jabber.php:133
msgid "jid '%s' is incorrect"
msgstr "Die JID '%s' ist inkorrekt."
#: ../system/Widget/widgets/Account/Account.php:230
#: ../system/Widget/widgets/Login/Login.php:113
msgid "My address"
msgstr "Adresse"
#: ../system/MovimException.php:15
msgid "Error: %s"
msgstr "Fehler: %s"
#: ../system/Widget/widgets/Account/Account.php:241
msgid "Make sure your password is safe :"
msgstr "Wäle ein sicheres Passwort"
#: ../system/Controller/ControllerMain.php:130
#: ../system/Widget/widgets/Config/Config.php:61
msgid "Changing these data can be dangerous and may compromise the connection to the Jabber server"
msgstr "Das Ändern dieser Daten ist eventuell gefährlich und kann die Verbindung zum Jabber-Server kompromitieren"
#: ../system/Widget/widgets/Account/Account.php:241
msgid "A capital letter, a digit and a special character are recommended"
msgstr ""
"Mindestens jeweils ein Großbuchstabe, eine Ziffer und ein Sonderzeichen "
"werden empfohlen."
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:39
#~ msgid "Firstname"
#~ msgstr ""
#: ../system/Widget/widgets/Account/Account.php:241
msgid "8 characters"
msgstr "8 Buchstaben"
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:40
#~ msgid "Family name"
#~ msgstr ""
#: ../system/Widget/widgets/Account/Account.php:241
msgid "Example :"
msgstr "Beispiel:"
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:48
msgid "Nickname"
msgstr "Benutzername"
#: ../system/Widget/widgets/Account/Account.php:243
#: ../system/Widget/widgets/Login/Login.php:115
msgid "Password"
msgstr "Passwort"
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:42
#~ msgid "Name given"
#~ msgstr ""
#: ../system/Widget/widgets/Account/Account.php:252
msgid "Same here !"
msgstr "Das gleiche hier."
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:68
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:54
msgid "Website"
msgstr "Website"
#: ../system/Widget/widgets/Account/Account.php:254
msgid "Retype"
msgstr "Nochmal"
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:45
#~ msgid "About me"
#~ msgstr ""
#: ../system/Widget/widgets/Account/Account.php:263
msgid "Pseudo"
msgstr "Pseudo"
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:62
#~ msgid "Contact informations"
#~ msgstr ""
#: ../system/Widget/widgets/Account/Account.php:271
msgid "Create"
msgstr "Anlegen"
#: ../system/Widget/widgets/Profile/Profile.php:87
#~ msgid "Status"
#~ msgstr ""
#: ../system/Widget/widgets/Chat/Chat.php:50
#: ../system/Widget/widgets/Logout/Logout.php:79
msgid "Online"
msgstr "Verbunden"
#: ../system/Widget/widgets/Wall/Wall.php:35
#~ msgid "This is my custom Wall widget."
#~ msgstr ""
#: ../system/Widget/widgets/Chat/Chat.php:51
#: ../system/Widget/widgets/Logout/Logout.php:80
msgid "Away"
msgstr "Abwesend"
#: ../system/Conf.php:14
#: ../system/Conf.php:152
msgid "Couldn't save img file %s"
msgstr "Konnte die Bilddatei %s nicht speichern."
#: ../system/Widget/widgets/Chat/Chat.php:52
#: ../system/Widget/widgets/Logout/Logout.php:81
msgid "Do Not Disturb"
msgstr "Bitte nicht stören"
#: ../system/Logger.php:27
msgid "Cannot open log file '%s'"
msgstr "Die Logdatei '%s' konnte nicht geöffnet werden."
#: ../system/Widget/widgets/Chat/Chat.php:53
#: ../system/Widget/widgets/Logout/Logout.php:82
msgid "Extended Away"
msgstr "Länger abwesend"
#: ../system/Widget/widgets/Chat/Chat.php:120
msgid "Composing"
msgstr "Stelle zusammen"
#: ../system/Widget/widgets/Chat/Chat.php:54
msgid "Offline"
msgstr "Nicht verbunden"
#: ../system/Widget/widgets/Chat/Chat.php:134
msgid "Paused"
msgstr "Pausiert"
#: ../system/Widget/widgets/Chat/Chat.php:232
msgid "Composing..."
msgstr "Baue Dinge zusammen..."
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:70
msgid "Date of birth"
msgstr "Geburtsdatum"
#: ../system/Widget/widgets/Config/Config.php:45
msgid "Language"
msgstr "Sprache"
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:80
msgid "Refresh the data"
msgstr "Aktualisiere die Daten."
#: ../system/Widget/widgets/Config/Config.php:59
#: ../system/Widget/widgets/Feed/Feed.php:145
#: ../system/Widget/widgets/Vcard/Vcard.php:111
msgid "Submit"
msgstr "Übernehmen"
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:89
msgid "Hye, I'm on Movim !"
msgstr "Hallo, ich bin bei Movim!"
#: ../system/Widget/widgets/Config/Config.php:60
#: ../system/Widget/widgets/Vcard/Vcard.php:112
msgid "Reset"
msgstr "Zurücksetzen"
#: ../system/Widget/widgets/Friendinfos/Friendinfos.php:130
#: ../system/Widget/widgets/ContactCard/ContactCard.php:61
msgid "Remove this contact"
msgstr "Kontakt löschen"
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:45
#: ../system/Widget/widgets/ContactCard/ContactCard.php:75
msgid "No"
msgstr "Nein"
#: ../system/Widget/widgets/ContactCard/ContactCard.php:88
msgid "Yes"
msgstr "Ja"
#: ../system/Widget/widgets/ContactCard/ContactCard.php:100
msgid "Chat"
msgstr "Chat"
#: ../system/Widget/widgets/ContactCard/ContactCard.php:108
#: ../system/Widget/widgets/Vcard/Vcard.php:67
msgid "General Informations"
msgstr "Allgemeine Angaben"
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:47
#: ../system/Widget/widgets/ContactCard/ContactCard.php:110
#: ../system/Widget/widgets/Vcard/Vcard.php:69
msgid "Name"
msgstr "Name"
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:49
msgid "Adress"
#: ../system/Widget/widgets/ContactCard/ContactCard.php:111
#: ../system/Widget/widgets/Vcard/Vcard.php:72
msgid "Nickname"
msgstr "Benutzername"
#: ../system/Widget/widgets/ContactCard/ContactCard.php:112
msgid "Address"
msgstr "Adresse"
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:50
#: ../system/Widget/widgets/ContactCard/ContactCard.php:114
#: ../system/Widget/widgets/Vcard/Vcard.php:75
msgid "Date of Birth"
msgstr "Geburtsdatum"
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:55
#: ../system/Widget/widgets/ContactCard/ContactCard.php:118
#: ../system/Widget/widgets/Vcard/Vcard.php:80
msgid "Website"
msgstr "Website"
#: ../system/Widget/widgets/ContactCard/ContactCard.php:119
#: ../system/Widget/widgets/Vcard/Vcard.php:85
msgid "Avatar"
msgstr "Benutzerbild"
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:58
#: ../system/Widget/widgets/ContactCard/ContactCard.php:122
#: ../system/Widget/widgets/Vcard/Vcard.php:92
msgid "About Me"
msgstr "Über mich"
msgstr "Persönliche Angaben"
#: ../system/Widget/widgets/Friendvcard/Friendvcard.php:141
msgid "Profile"
msgstr "Profil"
#: ../system/Widget/widgets/Feed/Feed.php:44
msgid "Loading your feed ..."
msgstr "Lade ihr Feed ..."
#: ../system/Widget/widgets/Feed/Feed.php:55
msgid "Get older posts"
msgstr "ältere Beiträge"
#: ../system/Widget/widgets/Feed/Feed.php:87
msgid "Me"
msgstr "Mich"
#: ../system/Widget/widgets/Feed/Feed.php:93
msgid "Get the comments"
msgstr "Kommentare anzeigen"
#: ../system/Widget/widgets/Feed/Feed.php:100
msgid "Your feed cannot be loaded."
msgstr "Ihr Feed kann nicht geladen werden."
#: ../system/Widget/widgets/Feed/Feed.php:133
#: ../system/Widget/widgets/Wall/Wall.php:102
msgid "Feed"
msgstr "Meldungen"
#: ../system/Widget/widgets/Feed/Feed.php:141
msgid "What's new ?"
msgstr "Was ist neu ?"
#: ../system/Widget/widgets/Feed/Feed.php:160
msgid "All"
msgstr "Alle"
#: ../system/Widget/widgets/Feed/Feed.php:161
msgid "My Posts"
msgstr "Meine Beiträge"
#: ../system/Widget/widgets/Feed/Feed.php:174
msgid "Create the feed"
msgstr ""
#: ../system/Widget/widgets/Login/Login.php:34
msgid "Wrong username"
msgstr "Falscher Benutzername"
#: ../system/Widget/widgets/Login/Login.php:40
msgid "Invalid JID"
msgstr "Ungültige Jabber-ID"
#: ../system/Widget/widgets/Login/Login.php:46
msgid "The XMPP authentification failed"
msgstr "Die XMPP-Authentifizierung ist fehlgeschlagen."
#: ../system/Widget/widgets/Login/Login.php:52
msgid "The current BOSH URL in invalid"
msgstr "Die aktuelle BOSH-URL ist ungültig"
#: ../system/Widget/widgets/Notifs/Notifs.php:39
#: ../system/Widget/widgets/Login/Login.php:58
msgid "Internal server error"
msgstr "Interner Server-Fehler"
#: ../system/Widget/widgets/Login/Login.php:64
msgid "Session error"
msgstr "Sitzungsfehler"
#: ../system/Widget/widgets/Login/Login.php:70
msgid "Account successfully created"
msgstr "Das Konto wurde erfolgreich angelegt."
#: ../system/Widget/widgets/Login/Login.php:78
msgid "Your web browser is too old to use with Movim."
msgstr "Dein Webbrowser ist zu alt für Movim."
#: ../system/Widget/widgets/Login/Login.php:117
msgid "Come in!"
msgstr "Komm‘ herein!"
#: ../system/Widget/widgets/Login/Login.php:124
#, php-format
msgid "This server host %s accounts"
msgstr "Auf diesem Server befinden sich %s Benutzerkonten"
#: ../system/Widget/widgets/Log/Log.php:33
msgid "Debug console"
msgstr "Debug Konsole"
#: ../system/Widget/widgets/Logout/Logout.php:83
msgid "Logout"
msgstr "Abmelden"
#: ../system/Widget/widgets/Notifs/Notifs.php:45
msgid "wants to talk with you"
msgstr "will mit dir sprechen"
#: ../system/Widget/widgets/Notifs/Notifs.php:41
#: ../system/Widget/widgets/Notifs/Notifs.php:47
msgid "Accept"
msgstr "Fertig"
#: ../system/Widget/widgets/Notifs/Notifs.php:42
#: ../system/Widget/widgets/Notifs/Notifs.php:98
#: ../system/Widget/widgets/Notifs/Notifs.php:48
#: ../system/Widget/widgets/Notifs/Notifs.php:100
msgid "Validate"
msgstr "Überprüfe"
#: ../system/Widget/widgets/Notifs/Notifs.php:43
#: ../system/Widget/widgets/Notifs/Notifs.php:49
msgid "Decline"
msgstr "Ablehnen"
#: ../system/Widget/widgets/Notifs/Notifs.php:97
#: ../system/Widget/widgets/Notifs/Notifs.php:99
msgid "Alias"
msgstr "Alias"
#: ../system/Widget/widgets/Notifs/Notifs.php:99
#: ../system/Widget/widgets/Notifs/Notifs.php:101
msgid "Add a contact"
msgstr "Füge einen Kontakt hinzu"
#: ../system/Widget/widgets/Profile/Profile.php:35
msgid "Do not disturb"
msgstr "Bitte nicht stören."
#: ../system/Widget/widgets/Profile/Profile.php:37
msgid "Away for a long time"
msgstr "Abwesend für längere Zeit"
#: ../system/Widget/widgets/Roster/Roster.php:107
msgid "Show All"
msgstr "Alle anzeigen"
#: ../system/Widget/widgets/Wall/Wall.php:44
msgid "Get the comments"
msgstr "Kommentare anzeigen"
#: ../system/Widget/widgets/Vcard/Vcard.php:54
msgid "Create my vCard"
msgstr ""
#: ../system/Widget/widgets/Wall/Wall.php:51
msgid "Contact's feed cannot be loaded."
msgstr "Die Meldungen dieses KOntaktes können nicht geladen werden."
#: ../system/Widget/widgets/Vcard/Vcard.php:111
msgid "Submitting"
msgstr ""
#: ../system/Widget/widgets/Wall/Wall.php:69
msgid "Feed"
msgstr "Meldungen"
#: ../system/Widget/widgets/Wall/Wall.php:63
#: ../system/Widget/widgets/Wall/Wall.php:109
msgid "Follow"
msgstr "Folgen"
#: ../system/Widget/widgets/Wall/Wall.php:73
#: ../system/Widget/widgets/Wall/Wall.php:122
msgid "Loading the contact feed ..."
msgstr "Lade die Meldungen..."

5
index.php

@ -40,6 +40,7 @@
* events-based API.
*/
ini_set('log_errors', 0);
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL ^ E_DEPRECATED ^ E_NOTICE);
@ -55,10 +56,12 @@ if(!file_exists("config/conf.xml")) {
$rqst = new ControllerMain();
$rqst->handle();
$widgets = WidgetWrapper::getInstance(false);
$widgets->iterateCached('saveCache');
// Closing stuff
WidgetWrapper::destroyInstance();
global $sdb;
$sdb->close();
}
?>

7
jajax.php

@ -27,5 +27,12 @@ $polling = true;
$rpc = new RPC();
$rpc->handle();
$widgets = WidgetWrapper::getInstance(false);
$widgets->iterateCached('saveCache');
// Closing stuff
WidgetWrapper::destroyInstance();
global $sdb;
$sdb->close();
?>

5
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");
@ -17,6 +17,7 @@ require_once(LIB_PATH . "Lang/i18n.php");
require_once(LIB_PATH . "Datajar/loader.php");
load_datajar(array('sqlite'));
require_once(LIB_PATH . "Datas/Caps.php");
require_once(LIB_PATH . "Datas/ConfVar.php");
require_once(LIB_PATH . "Datas/Contact.php");
require_once(LIB_PATH . "Datas/Presence.php");

48
system/Controller/ControllerMain.php

@ -128,19 +128,49 @@ class ControllerMain extends ControllerBase
}
}
function account()
/*function account()
{
if(Conf::getServerConfElement("accountCreation") == 1) {
$this->page->setTitle(t('%s - Account Creation', APP_TITLE));
$this->page->menuAddLink('Movim | Human Network', 'http://www.movim.eu/');
$this->page->setTitle(t('%s - Account', APP_TITLE));
$this->page->menuAddLink(t('Home'), '?q=mainPage');
$this->page->menuAddLink(t('Account Creation'), '?q=account', true);
//$this->page->menuAddLink(t('Help'), '?q=help');
$this->page->menuAddLink(t('Account Creation'), '?q=account', true);
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('account.tpl'));
echo $this->page->build('page.tpl');
} else {
$this->login();
}
}*/
function accountCreate()
{
if(Conf::getServerConfElement("accountCreation") == 1) {
$this->page->setTitle(t('%s - Account Creation', APP_TITLE));
$this->page->menuAddLink(t('Home'), '?q=mainPage');
$this->page->menuAddLink(t('Account Creation'), '?q=accountCreate', true);
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('account_create.tpl'));
echo $this->page->build('page.tpl');
} else {
$this->login();
}
}
function accountAdd()
{
if(Conf::getServerConfElement("accountCreation") == 1) {
$this->page->setTitle(t('%s - Add An Account', APP_TITLE));
$this->page->menuAddLink(t('Home'), '?q=mainPage');
$this->page->menuAddLink(t('Account Creation'), '?q=accountAdd', true);
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('account_add.tpl'));
echo $this->page->build('page.tpl');
} else {
$this->login();
}
@ -152,10 +182,10 @@ 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('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');

4
system/Datas/Attachment.php

@ -37,9 +37,9 @@ class Attachment extends DatajarBase {
}
class AttachmentHandler {
static function getAttachment($node) {
static function getAttachment($key, $node) {
global $sdb;
$attachment = $sdb->select('Attachment', array('node'=> $node));
$attachment = $sdb->select('Attachment', array('key' => $key, 'node'=> $node));
if($attachment != false)
return $attachment;
else

43
system/Datas/Caps.php

@ -0,0 +1,43 @@
<?php
class Caps extends DatajarBase {
protected $node;
protected $category;
protected $type;
protected $name;
protected $features;
protected function type_init() {
$this->node = DatajarType::varchar(256);
$this->category = DatajarType::varchar(128);
$this->type = DatajarType::varchar(128);
$this->name = DatajarType::varchar(128);
$this->features = DatajarType::text();
}
public function setCaps($query) {
$this->node->setval($query['@attributes']['node']);
$this->category->setval($query['identity']['@attributes']['category']);
$this->type->setval($query['identity']['@attributes']['type']);
$this->name->setval($query['identity']['@attributes']['name']);
$this->features->setval(serialize($query['feature']));
}
public function getData($data) {
return $this->$data->getval();
}
}
class CapsHandler {
private $instance;
public function __construct() {
$this->instance = new Caps();
}
public function get($node) {
global $sdb;
$sdb->load($this->instance, array('node' => $node));
return $this->instance;
}
}

25
system/Datas/ConfVar.php

@ -33,7 +33,7 @@ class ConfVar extends DatajarBase {
$this->first = DatajarType::int();
}
public function get() {
public function get($element = false) {
$conf = array();
$arr = get_object_vars($this);
@ -42,7 +42,10 @@ class ConfVar extends DatajarBase {
$conf[$key] = $value->getval();
}
return $conf;
if($element == false)
return $conf;
else
return $conf[$element];
}
public function set($att, $val) {
@ -73,13 +76,17 @@ class UserConf {
->where(array('login' => $login));
$conf = ConfVar::run_query($query);
$arr = $conf[0]->get();
if($element != false)
return $arr[$element];
else
return $arr;
if($conf != false) {
$arr = $conf[0]->get();
if($element != false)
return $arr[$element];
else
return $arr;
} else {
return false;
}
}
}

4
system/Datas/Post.php

@ -74,7 +74,9 @@ class Post extends DatajarBase {
$this->nodeid->setval($array['@attributes']['id']);
$this->parentid->setval($parent);
if(isset($array['entry']['content']))
if(isset($array['entry']['title']))
$this->content->setval($array['entry']['title']);
elseif(isset($array['entry']['content']))
$this->content->setval($array['entry']['content']);
elseif(isset($array['entry']['body']))
$this->content->setval($array['entry']['body']);

15
system/Datas/Presence.php

@ -9,6 +9,9 @@ class Presence extends DatajarBase {
protected $priority;
protected $status;
protected $node;
protected $ver;
protected function type_init() {
$this->key = DatajarType::varchar(128);
$this->jid = DatajarType::varchar(128);
@ -17,6 +20,9 @@ class Presence extends DatajarBase {
$this->presence = DatajarType::int();
$this->priority = DatajarType::int();
$this->status = DatajarType::text();
$this->node = DatajarType::varchar(128);
$this->ver = DatajarType::varchar(128);
}
public function setPresence($array) {
@ -28,6 +34,9 @@ class Presence extends DatajarBase {
$this->ressource->setval($ressource);
$this->status->setval($array['status']);
$this->node->setval($array['c']['@attributes']['node']);
$this->ver->setval($array['c']['@attributes']['ver']);
$this->priority->setval($array['priority']);
if($array['@attributes']['type'] == 'error') {
@ -62,14 +71,18 @@ class Presence extends DatajarBase {
$arr['presence_txt'] = $txt[$this->presence->getval()];
$arr['priority'] = $this->priority->getval();
$arr['status'] = $this->status->getval();
$arr['node'] = $this->node->getval();
$arr['ver'] = $this->ver->getval();
return $arr;
}
}
class PresenceHandler {
private $instance;
public function __contruct() {
$this->instance = new Presence();
}
static public function getPresence($jid, $one = false, $ressource = false) {

6
system/Event.php

@ -28,6 +28,12 @@ class Event
'type' => $type,
'data' => $event,
)));
$widgets->iterateAll('isEvents', array(
array(
'type' => $type,
'data' => $event,
)));
// Outputting any RPC calls.
RPC::commit();

163
system/Jabber.php

@ -39,8 +39,11 @@ class Jabber
$this->jaxl = new JAXL(array(
// User Configuration
'host' => $userConf['host'],
'domain' => isset($userConf['domain']) ? $userConf['domain'] : $userConf['host'],
// Here we need to exchange the host and domain to allow the connexion, Jaxl bug ?
'host' => $userConf['domain'],
'domain' => $userConf['host'],
'boshHost' => $userConf['boshHost'],
'boshSuffix' => $userConf['boshSuffix'],
'boshPort' => $userConf['boshPort'],
@ -77,7 +80,6 @@ class Jabber
// Connect-Disconnect
$this->jaxl->addPlugin('jaxl_post_auth', array(&$this, 'postAuth'));
$this->jaxl->addPlugin('jaxl_post_auth_failure', array(&$this, 'postAuthFailure'));
//$this->jaxl->addPlugin('jaxl_post_roster_update', array(&$this, 'postRosterUpdate'));
$this->jaxl->addPlugin('jaxl_post_disconnect', array(&$this, 'postDisconnect'));
$this->jaxl->addPlugin('jaxl_get_auth_mech', array(&$this, 'postAuthMech'));
@ -144,6 +146,15 @@ class Jabber
self::setStatus(t('Connecting...'), false, false, true);
}
/**
* postAuth
*
* @return void
*/
public function postAuth() {
}
/**
* postAuthFailure
@ -152,7 +163,9 @@ class Jabber
*/
public function postAuthFailure() {
$this->jaxl->shutdown();
throw new MovimException("Login error.");
throw new MovimException("Login error.", 300);
$user = new User();
$user->desauth();
}
@ -241,8 +254,8 @@ class Jabber
public function getEmptyBody($payload) {
$evt = new Event();
// Oooooh, am I disconnected??
if(preg_match('/condition=[\'"]item-not-found[\'"]/', $payload)) {
$evt->runEvent('serverdisconnect', null);
if(preg_match('/condition=[\'"]item-not-found[\'"]/', $payload) || preg_match('/condition=[\'"]improper-addressing[\'"]/', $payload)) {
$this->postAuthFailure();
} else {
$evt->runEvent('incomingemptybody', 'ping');
}
@ -256,7 +269,7 @@ class Jabber
*/
public function getIq($payload) {
$payload = $payload['movim'];
global $sdb;
$evt = new Event();
@ -284,11 +297,23 @@ class Jabber
$evt->runEvent('vcard', $contact);
}
}
elseif($payload['@attributes']['xmlns'] == 'http://jabber.org/protocol/disco#info') {
global $sdb;
$c = new CapsHandler();
$caps = $c->get($payload['query']['@attributes']['node']);
$caps->setCaps($payload['query']);
$sdb->save($caps);
}
// Roster case
elseif($payload['@attributes']['xmlns'] == 'jabber:iq:roster') {
if($payload['@attributes']['type'] == "result") {
global $sdb;
global $sdb;
// If we got the full roster list
if($payload['@attributes']['type'] == 'result') {
foreach($payload['query']['item'] as $item) {
// If we've got only one item in the roster we use it as the only one
@ -302,12 +327,28 @@ class Jabber
}
$evt->runEvent('roster', $payload);
} elseif($payload['type'] == "set") {
$this->getRosterList();
}
// If we got only one item
elseif($payload['@attributes']['type'] == "set") {
$c = new ContactHandler();
$item = $payload['query']['item'];
$contact = $c->get($item['@attributes']['jid']);
// It's a new contact !
if($item['@attributes']['subscription'] == 'remove') {
$evt->runEvent('contactremove', $item['@attributes']['jid']);
}
// Contact removed
elseif(in_array($item['@attributes']['subscription'], array('from', 'to', 'both'))) {
$contact->setContactRosterItem($item);
$sdb->save($contact);
$evt->runEvent('contactadd', $item['@attributes']['jid']);
}
}
}
// Pubsub case
elseif(isset($payload['pubsub']) && !(isset($payload['error']))) {
movim_log($payload);
list($xmlns, $parent) = explode("/", $payload['pubsub']['items']['@attributes']['node']);
if(isset($payload['pubsub']['items']['item'])) {
@ -316,10 +357,12 @@ class Jabber
if(isset($item['id']))
$item = $payload['pubsub']['items']['item'];
// We've got a new Post !
if(isset($item['@attributes']) && isset($item['entry'])) {
$c = new PostHandler();
$post = $c->get($item['@attributes']['id']);
// We save it in the database
if($xmlns == 'urn:xmpp:microblog:0')
$post->setPost($item, $payload['@attributes']['from']);
elseif($xmlns == 'urn:xmpp:microblog:0:comments')
@ -327,16 +370,20 @@ class Jabber
$sdb->save($post);
if($xmlns == 'urn:xmpp:microblog:0')
// And we run the correct event
if($xmlns == 'urn:xmpp:microblog:0') {
$evt->runEvent('post', $item['@attributes']['id']);
$evt->runEvent('stream', $payload);
elseif($xmlns == 'urn:xmpp:microblog:0:comments')
} elseif($xmlns == 'urn:xmpp:microblog:0:comments')
$evt->runEvent('comment', $parent);
}
}
} elseif(isset($payload['pubsub']['publish']['@attributes']['node'])) {
list($xmlns, $id) = explode("/", $payload['pubsub']['publish']['@attributes']['node']);
$this->getComments(false, $id);
if($payload['pubsub']['publish']['@attributes']['node'] == 'urn:xmpp:microblog:0') {
$this->getWallItem($this->getCleanJid(), $payload['pubsub']['publish']['item']['@attributes']['id']);
}
$this->getComments($payload['@attributes']['from'], $id);
} else {
$evt->runEvent('nocomment', $parent);
}
@ -350,8 +397,18 @@ class Jabber
$sdb->save($post);
$evt->runEvent('nostream', $parent);
}
elseif(isset($payload['error']['feature-not-implemented']))
}
elseif(in_array( $payload['error']['@attributes']['code'], array(501, 503)) && $payload['pubsub']['create']['@attributes']['node'] == 'urn:xmpp:microblog:0') {
$conf = new ConfVar();
$sdb->load($conf, array(
'login' => $this->getCleanJid()
));
$conf->set('first', 3);
$sdb->save($conf);
}
elseif(isset($payload['error']['feature-not-implemented']) ||
isset($payload['error']['not-authorized']) ||
isset($payload['error']['service-unavailable']))
$evt->runEvent('nostream');
}
elseif(isset($payload['error']) && isset($payload['error']['item-not-found']))
@ -377,17 +434,14 @@ class Jabber
if($payload['offline'] != JAXL0203::$ns && $payload['type'] == 'chat') { // reject offline message
if($payload['chatState'] == 'active' && $payload['body'] == NULL) {
if($payload['chatState'] == 'active' && $payload['body'] == NULL)
$evt->runEvent('incomeactive', $payload);
}
elseif($payload['chatState'] == 'composing') {
elseif($payload['chatState'] == 'composing')
$evt->runEvent('composing', $payload);
}
elseif($payload['chatState'] == 'paused') {
elseif($payload['chatState'] == 'paused')
$evt->runEvent('paused', $payload);
}
else {
movim_log($payload);
global $sdb;
$m = new Message();
$m->setMessageChat($payload['movim']);
@ -414,7 +468,8 @@ class Jabber
$evt->runEvent('currentpost', $payload);
}
$evt->runEvent('post', $payload);
if($payload['@attributes']['from'] != $this->getCleanJid())
$evt->runEvent('post', $payload['event']['items']['item']['@attributes']['id']);
}
}
}
@ -433,28 +488,34 @@ class Jabber
$evt = new Event();
foreach($payloads as $payload) {
$payload = $payload['movim'];
if($payload['@attributes']['type'] == 'subscribe') {
$evt->runEvent('subscribe', $payload);
} elseif($payload['@attributes']['type'] == 'result') {
} elseif(in_array($payload['@attributes']['type'], array('available', 'unavailable', '', 'error'))) {
}
else {
// We update the presences
list($jid, $ressource) = explode('/',$payload['@attributes']['from']);
// We ask for the entity-capabilities
if(isset($payload['c'])) {
$this->jaxl->JAXL0030(
'discoInfo',
$payload['@attributes']['from'],
$this->jaxl->jid,
false,
$payload['c']['@attributes']['node'].'#'.$payload['c']['@attributes']['ver']
);
// We ask for the entity-capabilities and we prevent to ask our own capabilities
if(isset($payload['c']) && $jid != $this->getCleanJid()) {
$c = new CapsHandler();
$caps = $c->get($payload['c']['@attributes']['node'].'#'.$payload['c']['@attributes']['ver']);
// We ask for the caps only if we haven't found it in the database
if($caps->getData('category') == null) {
$this->jaxl->JAXL0030(
'discoInfo',
$payload['@attributes']['from'],
$this->getCleanJid(),
false,
$payload['c']['@attributes']['node'].'#'.$payload['c']['@attributes']['ver']
);
}
}
$presence = $sdb->select('Presence', array(
$presence = $sdb->select('Presence', array(
'key' => $this->getCleanJid(),
'jid' => $jid,
'ressource' => $ressource
@ -484,11 +545,6 @@ class Jabber
$evt->runEvent('incomingemptybody', 'ping');
}
/*public function postRosterUpdate($payload) {
$evt = new Event();
$evt->runEvent('rosterreceived', $payload);
}*/
/**
* Ask for a vCard
*
@ -544,6 +600,16 @@ class Jabber
public function getWall($jid = false) {
$this->jaxl->JAXL0277('getItems', $jid);
}
/**
* Ask for an item
*
* @param unknown $jid = false
* @return void
*/
public function getWallItem($jid = false, $id) {
$this->jaxl->JAXL0277('getItem', $jid, $id);
}
/**
* Ask for some comments of an article
@ -553,7 +619,7 @@ class Jabber
* @return void
*/
public function getComments($place, $id) {
$this->jaxl->JAXL0277('getComments', 'pubsub.jappix.com', $id);
$this->jaxl->JAXL0277('getComments', $place, $id);
}
/**
@ -564,10 +630,7 @@ class Jabber
*/
public function discover($jid = false)
{
//$this->jaxl->JAXL0030('discoInfo', $jid, $this->jaxl->jid, false, false);
//$this->jaxl->JAXL0030('discoItems', $jid, $this->jaxl->jid, false, false);mov
$this->jaxl->JAXL0277('getItems', 'edhelas@jappix.com');
//psgxs.linkmauve.fr
}
public function discoNodes($pod)

2
system/RPC.php

@ -125,7 +125,7 @@ class RPC
}
}
}
$widgets = WidgetWrapper::getInstance(false);
$widgets->run_widget($widget_name, (string)$request['name'], $params);
}

2
system/Tpl/TplPageBuilder.php

@ -228,7 +228,7 @@ class TplPageBuilder
function widget($name)
{
$widgets = WidgetWrapper::getInstance();
$widgets->run_widget($name, 'build');
$widgets->run_widget($name, 'getCache');
}
/**

35
system/User.php

@ -47,29 +47,48 @@ class User {
{
try{
$data = false;
if( !($data = UserConf::getConf($login)) ) {
$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;
}
$this->xmppSession = Jabber::getInstance($login);
$this->xmppSession->login($login, $pass);
// Careful guys, md5 is _not_ secure. SHA1 recommended here.
if(sha1($pass) == $data['pass']) {
if(sha1($pass) == $data['pass']) {
$sess = Session::start(APP_NAME);
$sess->set('login', $login);
$sess->set('pass', $pass);
$this->username = $login;
$this->username = $login;
$this->password = $pass;
$this->xmppSession = Jabber::getInstance($login);
$this->xmppSession->login($login, $pass);
} else {
throw new MovimException(t("Wrong password"));
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();
}
}

46
system/Utils.php

@ -29,6 +29,15 @@ function sprintln($string)
return call_user_func_array('sprintf', $args) . PHP_EOL;
}
/*
* Return the current microtime
*/
function getTime()
{
$a = explode (' ',microtime());
return(double) $a[0] + $a[1];
}
/**
* Prepare the string (add the a to the links and show the smileys)
*
@ -108,33 +117,38 @@ function prepareString($string) {
* @param timestamp $string
* @return string
*/
function prepareDate($time) {
function prepareDate($time, $hours = true) {
$today = strtotime(date('M j, Y'));
$reldays = ($time - $today)/86400;
if ($reldays >= 0 && $reldays < 1) {
return t('Today') .' - '. date('H:i', $time);
$date = t('Today');
} else if ($reldays >= 1 && $reldays < 2) {
return t('Tomorrow') .' - '. date('H:i', $time);
$date = t('Tomorrow');
} else if ($reldays >= -1 && $reldays < 0) {
return t('Yesterday') .' - '. date('H:i', $time);
}
$date = t('Yesterday');
} else {
if (abs($reldays) < 7) {
if ($reldays > 0) {
$reldays = floor($reldays);
return 'In ' . $reldays . ' '.t('day') . ($reldays != 1 ? 's' : '');
if (abs($reldays) < 7) {
if ($reldays > 0) {
$reldays = floor($reldays);
$date = 'In ' . $reldays . ' '.t('day') . ($reldays != 1 ? 's' : '');
} else {
$reldays = abs(floor($reldays));
$date = t(' %d days ago', $reldays);
}
}
if (abs($reldays) < 182) {
$date = date('l, j F',$time ? $time : time());
} else {
$reldays = abs(floor($reldays));
return t(' %d days ago', $reldays) .' - '. date('H:i', $time);
$date = date('l, j F, Y',$time ? $time : time());
}
}
if (abs($reldays) < 182) {
return date('l, j F - H:i',$time ? $time : time());
} else {
return date('l, j F, Y - H:i',$time ? $time : time());
}
if($hours)
$date .= ' - '. date('H:i', $time);
return $date;
}
/**

60
system/Widget/WidgetBase.php

@ -26,6 +26,8 @@ class WidgetBase
protected $user;
protected $name;
protected $events;
protected $cached;
/**
* Initialises Widget stuff.
@ -56,6 +58,9 @@ class WidgetBase
$this->ajax->defun(get_class($this), $method->name, $params);
}
}
$this->name = get_class($this);
$this->cached = false;
$this->WidgetLoad();
}
@ -92,6 +97,48 @@ class WidgetBase
return $path;
}
private function saveCacheFile()
{
Logger::log(2, 'Cache: Update of '.$this->name.' widget - '.$this->user->getLogin());
$fp = fopen(BASE_PATH."/cache/".md5($this->name.$this->user->getLogin()).".thtml", "w");
ob_start();
$this->build();
$out = ob_get_clean();
fwrite($fp, trim(preg_replace( '/\s+/', ' ',$out)));
fclose($fp);
return $out;
}
public function saveCache()
{
$this->saveCacheFile();
}
public function getCache()
{
$file = BASE_PATH."/cache/".md5($this->name.$this->user->getLogin()).".thtml";
if(file_exists($file)) {
$fp = fopen($file, "r");
echo fread($fp, filesize($file));
fclose($fp);
}
else {
$widgets = WidgetWrapper::getInstance(false);
if($this->cached == true) {
$out = $this->saveCacheFile();
echo $out;
}
else
$this->build();
}
}
public function getName()
{
return $this->name;
}
/**
* Generates and print an ajax call.
@ -181,8 +228,10 @@ class WidgetBase
*/
public function runEvents($proto)
{
if(is_array($this->events) && array_key_exists($proto['type'], $this->events)) {
if(is_array($this->events) && array_key_exists($proto['type'], $this->events)) {
// If a new event came to the widget, we update the cache
//$this->setCacheCall();
$returns = array();
foreach($this->events[$proto['type']] as $handler) {
@ -192,6 +241,15 @@ class WidgetBase
return $returns;
}
}
public function isEvents($proto)
{
if(is_array($this->events) &&
array_key_exists($proto['type'], $this->events) &&
$this->cached == true) {
return true;
}
}
/**
* returns the list of javascript files to be loaded for the widget.

2
system/Widget/WidgetCommon.php

@ -35,7 +35,7 @@ class WidgetCommon extends WidgetBase {
<div class="content">
'.prepareString($message->getData('content')). '</div>';
$attachments = AttachmentHandler::getAttachment($message->getData('nodeid'));
$attachments = AttachmentHandler::getAttachment($user->getLogin(), $message->getData('nodeid'));
if($attachments) {
$tmp .= '<div class="attachment">';
foreach($attachments as $attachment)

56
system/Widget/WidgetWrapper.php

@ -23,8 +23,11 @@
class WidgetWrapper
{
private $register_widgets;
private $all_widgets = array();
private $loaded_widgets = array();
private $loaded_widgets_old;
//private $loaded_widgets_cached = array();
private $cached_widgets;
private static $instance;
@ -44,6 +47,16 @@ class WidgetWrapper
if(is_array($widgets)) {
$this->loaded_widgets_old = $widgets;
}
$this->all_widgets = array();
$widgets_dir = scandir(LIB_PATH ."Widget/widgets/");
foreach($widgets_dir as $widget_dir) {
if(is_dir(LIB_PATH ."Widget/widgets/".$widget_dir) &&
$widget_dir != '..' &&
$widget_dir != '.')
array_push($this->all_widgets, $widget_dir);
}
}
static function getInstance($register = true)
@ -88,11 +101,21 @@ class WidgetWrapper
return $this->loaded_widgets_old;
}
}
function get_all_widgets()
{
return $this->all_widgets;
}
function get_cached_widgets()
{
return $this->cached_widgets;
}
/**
* Loads a widget and returns it.
*/
private function load_widget($widget_name)
public function load_widget($widget_name)
{
// Attempting to load the user's widgets in priority
$widget_path = "";
@ -138,7 +161,7 @@ class WidgetWrapper
if(!is_array($params)) {
$params = array();
}
$result = call_user_func_array(array($widget, $method), $params);
// Collecting stuff generated by the widgets.
$this->css = array_merge($this->css, $widget->loadcss());
@ -164,6 +187,35 @@ class WidgetWrapper
return $buff;
}
function iterateAll($method, array $params = NULL) {
$widgets = $this->get_all_widgets();
$isevent = array();
foreach($widgets as $widget) {
if($this->run_widget($widget, $method, $params))
$isevent[$widget] = true;
}
if(!empty($isevent))
$this->cached_widgets = $isevent;
return $isevent;
}
function iterateCached($method, array $params = NULL)
{
$buff = array();
$widgets = $this->cached_widgets;
if(!empty($widgets)) {
foreach($widgets as $widget => $val) {
$buff[] = $this->run_widget($widget, $method, $params);
}
}
return $buff;
}
/**
* Returns the list of loaded CSS.

23
system/Widget/widgets/Account/Account.php

@ -50,8 +50,9 @@ class Account extends WidgetBase {
// We try to connect to the XMPP Server
$f = fsockopen(XMPP_CONN, XMPP_PORT, $errno, $errstr, 10);
if(!$f) {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=account&err=xmppconnect"));
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountCreate&err=xmppconnect"));
RPC::commit();
exit;
}
@ -62,7 +63,7 @@ class Account extends WidgetBase {
$response = stream_get_contents($f);
if(!$response) {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=account&err=xmppcomm"));
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountCreate&err=xmppcomm"));
RPC::commit();
exit;
}
@ -85,7 +86,7 @@ class Account extends WidgetBase {
if($iq->error) {
list($cond) = $iq->error->children();
if($cond->getName() == 'conflict') {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=account&err=userconflict"));
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountCreate&err=userconflict"));
RPC::commit();
exit;
}
@ -95,7 +96,7 @@ class Account extends WidgetBase {
if($iq = $response->iq and $iq->attributes()->type == 'result') {
$this->localRegistration($data, $conf);
} else {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=account&err=unknown"));
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountCreate&err=unknown"));
RPC::commit();
exit;
}
@ -134,7 +135,7 @@ class Account extends WidgetBase {
function ajaxSubmit($data) {
foreach($data as $value) {
if($value == NULL || $value == '') {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=account&err=datamissing"));
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountCreate&err=datamissing"));
RPC::commit();
exit;
}
@ -142,15 +143,15 @@ class Account extends WidgetBase {
foreach($data as $value) {
if(!filter_var($data['username'].'@'.$data['server'], FILTER_VALIDATE_EMAIL)) {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=account&err=jiderror"));
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountCreate&err=jiderror"));
RPC::commit();
exit;
} elseif($data['password'] != $data['passwordconf']) {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=account&err=passworddiff"));
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountCreate&err=passworddiff"));
RPC::commit();
exit;
} elseif(eregi('[^a-zA-Z0-9_]', $data['nick'])) {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=account&err=nameerr"));
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountCreate&err=nameerr"));
RPC::commit();
exit;
}
@ -220,7 +221,7 @@ class Account extends WidgetBase {
<?php echo $warning; ?>
<form style="width: 500px; float: left;" name="account">
<input type="hidden" name="server" value="<?php echo $conf['host']; ?>">
<h1>Create a new account</h1>
<h1><?php echo t('Create a new account'); ?></h1>
<p style="margin-top: 20px;">
<input
onfocus="accountAdvices('<p><?php echo t('Firstly fill in this blank with a brand new account ID, this address will follow you on all the Movim network !'); ?></p><p><?php echo t('Only alphanumerics elements are authorized'); ?></p>');"
@ -238,7 +239,7 @@ class Account extends WidgetBase {
<input
type="password"
onfocus="
accountAdvices('<p><?php echo t('Make sure your password is safe :'); ?> <ul><li><?php echo t('A capital letter, a digit and a special character are recommended'); ?></li><li><?php echo t('8 characters'); ?></li></ul></p><p><?php echo t('Example :'); ?> m0vimP@ss</p>');"
accountAdvices('<p><?php echo addslashes(t('Make sure your password is safe :')); ?> <ul><li><?php echo addslashes(t('A capital letter, a digit and a special character are recommended')); ?></li><li><?php echo t('8 characters'); ?></li></ul></p><p><?php echo t('Example :'); ?> m0vimP@ss</p>');"
onblur="accountAdvices();"
placeholder="<?php echo t("Password"); ?>"
class="big"
@ -268,7 +269,7 @@ class Account extends WidgetBase {
</p>
<p>
<input type="button" class="big icon submit" style="float: right;" value=" <?php echo t('Create'); ?>" onclick="<?php echo $submit;?>">
<input type="button" class="button big icon submit" style="float: right;" value="<?php echo t('Create'); ?>" onclick="<?php echo $submit;?> this.className='button big icon loading';">
</p>
</form>

179
system/Widget/widgets/AccountAdd/AccountAdd.php

@ -0,0 +1,179 @@
<?php
/**
* @package Widgets
*
* @file Account.php
* This file is part of MOVIM.
*
* @brief The account adding widget.
*
* @author Timothée Jaussoin <edhelas@gmail.com>
*
* @version 1.0
* @date 25 November 2011
*
* Copyright (C)2010 MOVIM project
*
* See COPYING for licensing information.
*/
class AccountAdd extends WidgetBase {
function __construct() {
parent::__construct(true);
}
function ajaxSubmit($data) {
foreach($data as $value) {
if($value == NULL || $value == '') {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountAdd&err=datamissing"));
RPC::commit();
exit;
}
}
foreach($data as $value) {
if(!filter_var($data['jid'], FILTER_VALIDATE_EMAIL)) {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountAdd&err=jiderror"));
RPC::commit();
exit;
} elseif($data['password'] != $data['passwordconf']) {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountAdd&err=passworddiff"));
RPC::commit();
exit;
} elseif(eregi('[^a-zA-Z0-9_]', $data['nick'])) {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountAdd&err=nameerr"));
RPC::commit();
exit;
}
}
unset($data['passwordconf']);
$u = new UserConf();
if($u->getConf($data['jid']) == false) {
$host = end(explode('@', $data['jid']));
$dns = dns_get_record('_xmpp-client._tcp.'.$host);
if(isset($dns[0]['target']) && $dns[0]['target'] != null)
$domain = $dns[0]['target'];
else {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountAdd&err=dnsdomain"));
RPC::commit();
exit;
}
$confvar = Conf::getServerConf();
global $sdb;
$conf = new ConfVar();
$conf
->set('login', $data['jid'])
->set('pass', sha1($data['password']))
->set('host', $host)
->set('domain', $domain)
->set('port', $confvar['port'])
->set('boshHost', $confvar['defBoshHost'])
->set('boshSuffix', $confvar['defBoshSuffix'])
->set('boshPort', $confvar['defBoshPort'])
->set('language', $confvar['defLang'])
->set('first', false);
$sdb->save($conf);
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=mainPage&err=acccreated"));
RPC::commit();
exit;
} else {
RPC::call('movim_reload', RPC::cdata(BASE_URI."index.php?q=accountAdd&err=userconflict"));
RPC::commit();
exit;
}
}
function build()
{
switch ($_GET['err']) {
case 'datamissing':
$warning = '
<div class="error">
'.t('Some data are missing !').'
</div> ';
break;
case 'jiderror':
$warning = '
<div class="error">
'.t('Wrong ID').'
</div> ';
break;
case 'passworddiff':
$warning = '
<div class="error">
'.t('You entered different passwords').'
</div> ';
break;
case 'nameerr':
$warning = '
<div class="error">
'.t('Invalid name').'
</div> ';
break;
case 'userconflict':
$warning = '
<div class="error">
'.t('Username already taken').'
</div> ';
break;
case 'dnsdomain':
$warning = '
<div class="error">
'.t('XMPP Domain error, your account is not a correct Jabber ID').'
</div> ';
break;
}
$submit = $this->genCallAjax('ajaxSubmit', "movim_parse_form('accountAdd')");
?>
<div id="account" style="width: 730px; margin: 0 auto;">
<?php echo $warning; ?>
<h1><?php echo t('Add your login informations'); ?></h1>
<form style="width: 500px; float: left;" name="accountAdd">
<p style="margin-top: 20px;">
<input
type="email"
autofocus
placeholder="<?php echo t("My address"); ?>"
class="big"
style="width: 500px;"
name="jid"/>
</p>
<p>
<input
type="password"
placeholder="<?php echo t("Password"); ?>"
class="big"
style="width: 500px;"
name="password"
/>
</p>
<p>
<input
type="password"
placeholder="<?php echo t("Retype"); ?>"
class="big"
style="width: 500px;"
name="passwordconf"
/>
</p>
<p>
<input type="button" class="button big icon submit" style="float: right;" value="<?php echo t('Create'); ?>" onclick="<?php echo $submit;?> this.className='button big icon loading';">
</p>
</form>
</div>
<?php
}
}

30
system/Widget/widgets/Chat/Chat.php

@ -27,6 +27,8 @@ class Chat extends WidgetBase
$this->registerEvent('message', 'onMessage');
$this->registerEvent('composing', 'onComposing');
$this->registerEvent('presence', 'onPresence');
$this->cached = false;
}
function onPresence($presence)
@ -65,9 +67,6 @@ class Chat extends WidgetBase
$jid = $message->getData('from');
global $sdb;
movim_log("GNNAAAA".$jid);
$contact = new Contact();
$sdb->load($contact, array('key' => $this->user->getLogin(), 'jid' => $jid));
@ -78,9 +77,7 @@ class Chat extends WidgetBase
RPC::call('scrollAllTalks');
$contact->chaton = 1;
$sdb->save($contact);
}
if($message->getData('body') != '') {
}else if($message->getData('body') != '') {
$html = $this->prepareMessage($message);
@ -214,14 +211,16 @@ class Chat extends WidgetBase
$html = '<div class="message ';
if($message->getData('key') == $message->getData('from'))
$html.= 'me';
$content = $message->getData('body');
/*if(preg_match("#^/me#", $message->getData('body'))) {
if(preg_match("#^/me#", $message->getData('body'))) {
$html .= "own ";
$message = "** ".substr($message->getData('body'), 4);
}*/
$content = "** ".substr($message->getData('body'), 4);
}
$html .= '"><span class="date">'.date('H:i', strtotime($message->getData('published'))).'</span>';
$html.= prepareString(htmlentities($message->getData('body'), ENT_COMPAT, "UTF-8")).'</div>';
$html.= prepareString(htmlentities($content, ENT_COMPAT, "UTF-8")).'</div>';
return $html;
}
@ -235,15 +234,20 @@ class Chat extends WidgetBase
array('to' => $contact->getData('jid') , '|from' => $contact->getData('jid'))
)
)
->orderby('published', true)
->orderby('published', false)
->limit(0, 20);
$messages = Message::run_query($query);
if($messages != false) {
$messages = array_reverse($messages);
foreach($messages as $m)
$day = '';
foreach($messages as $m) {
$messageshtml .= $this->prepareMessage($m);
if($day != date('d',strtotime($m->getData('published')))) {
$messageshtml .= '<div class="message presence">'.prepareDate(strtotime($m->getData('published')), false).'</div>';
$day = date('d',strtotime($m->getData('published')));
}
}
}
$style = '';

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

@ -1,7 +1,7 @@
#chats {
position: fixed;
bottom: 0;
right: 0;
right: 200px;
}
#chats .chat {

25
system/Widget/widgets/ContactCard/ContactCard.php

@ -131,6 +131,31 @@ class ContactCard extends WidgetBase
$html .= '
</fieldset>
</form>';
if($presence['node'] != '' && $presence['ver'] != '') {
$clienttype =
array(
'bot' => t('Bot'),
'pc' => t('Desktop'),
'phone' => t('Phone')
);
$c = new CapsHandler();
$caps = $c->get($presence['node'].'#'.$presence['ver']);
$html .='
<form><br />
<fieldset class="protect red">
<legend>'.t('Client Informations').'</legend>';
$html .= $this->displayIf($caps->getData('name'), t('Client Name'));
$html .= $this->displayIf($clienttype[$caps->getData('type')], t('Client Type'));
$html .= '
</fieldset>
</form>';
}
return $html;
}

58
system/Widget/widgets/ContactSummary/ContactSummary.php

@ -37,9 +37,20 @@ class ContactSummary extends WidgetBase
{
$this->xmpp->getVCard($jid);
}
private function testIsSet($element)
{
if(isset($element) && $element != '')
return true;
else
return false;
}
function prepareContactSummary($contact)
{
$gender = getGender();
$marital = getMarital();
$presence = PresenceHandler::getPresence($contact->getData('jid'), true);
$html ='<h1>'.$contact->getTrueName().'</h1><img src="'.$contact->getPhoto().'"/>';
@ -48,6 +59,53 @@ class ContactSummary extends WidgetBase
if($presence != NULL)
$html .= '<div id="status">'.$presence['status'].'</div>';
$html .='<h2>'.t('General Informations').'</h2>';
if($this->testIsSet($contact->getData('name')))
$html .= $contact->getData('name').'<br />';
if($contact->getData('gender') != 'N' && $this->testIsSet($contact->getData('gender')))
$html .= $gender[$contact->getData('gender')].'<br />';
if($contact->getData('marital') != 'none' && $this->testIsSet($contact->getData('marital')))
$html .= '<span class="hearth"></span>'.$marital[$contact->getData('marital')].'<br />';
if($contact->getData('date') != '0000-00-00' && $this->testIsSet($contact->getData('date')))
$html .= '<span class="birth"></span>'.date('j M Y',strtotime($contact->getData('date'))).'<br />';
if($this->testIsSet($contact->getData('jid')))
$html .= '<span class="address"></span>'.$contact->getData('jid').'<br />';
if($this->testIsSet($contact->getData('url')))
$html .= '<span class="website"></span>'.'<a target="_blank" href="'.$contact->getData('url').'">'.$contact->getData('url').'</a>';
//if($this->testIsSet($contact->getData('desc')))
// $html .= t('About Me').prepareString($contact->getData('desc'));
if($presence['node'] != '' && $presence['ver'] != '') {
$clienttype =
array(
'bot' => t('Bot'),
'pc' => t('Desktop'),
'phone' => t('Phone')
);
$c = new CapsHandler();
$caps = $c->get($presence['node'].'#'.$presence['ver']);
if($this->testIsSet($caps->getData('type'))) {
if($caps->getData('type') == 'phone')
$cinfos = '<span class="mobile"></span>';
}
if($this->testIsSet($caps->getData('name')))
$cinfos .= $caps->getData('name').'<br />';
if($cinfos != "")
$html .='<h2>'.t('Client Informations').'</h2>' . $cinfos;
}
return $html;
}

20
system/Widget/widgets/ContactSummary/contactsummary.css

@ -1,6 +1,6 @@
#contactsummary {
text-align: center;
padding-bottom: 10px;
text-align: center;
}
#contactsummary h1 {
@ -13,15 +13,25 @@
}
#contactsummary img {
max-width: 120px;
max-width: 150px;
max-height: 150px;
margin: 0 auto;
padding: 6px;
box-shadow: 0px 0px 5px #DDD;
}
#contactsummary #status {
color: #444;
padding: 3px;
font-size: 11px;
margin-right: 3px;
}
#contactsummary span {
background-repeat: no-repeat;
background-position: 0px 12px;
padding: 8px;
}
#contactsummary span.birth { background-image: url(img/birth.png); }
#contactsummary span.address { background-image: url(img/address.png); }
#contactsummary span.website { background-image: url(img/place.png); }
#contactsummary span.hearth { background-image: url(img/hearth.png); }
#contactsummary span.mobile { background-image: url(img/mobile.png); }

BIN
system/Widget/widgets/ContactSummary/img/address.png

After

Width: 10  |  Height: 10  |  Size: 271 B

BIN
system/Widget/widgets/ContactSummary/img/birth.png

After

Width: 10  |  Height: 10  |  Size: 228 B

BIN
system/Widget/widgets/ContactSummary/img/hearth.png

After

Width: 10  |  Height: 10  |  Size: 307 B

BIN
system/Widget/widgets/ContactSummary/img/mobile.png

After

Width: 10  |  Height: 10  |  Size: 227 B

BIN
system/Widget/widgets/ContactSummary/img/place.png

After

Width: 10  |  Height: 10  |  Size: 432 B

54
system/Widget/widgets/Feed/Feed.php

@ -10,11 +10,14 @@ class Feed extends WidgetCommon {
$this->registerEvent('nocomment', 'onNoComment');
$this->registerEvent('nocommentstream', 'onNoCommentStream');
$this->registerEvent('stream', 'onStream');
$this->registerEvent('vcard', 'onVcard');
$this->cached = true;
}
function onPost($payload) {
function onPost($id) {
$query = Post::query()
->where(array('key' => $this->user->getLogin(), 'nodeid' => $payload['event']['items']['item']['@attributes']['id']));
->where(array('key' => $this->user->getLogin(), 'nodeid' => $id));
$post = Post::run_query($query);
if($post != false) {
@ -23,6 +26,8 @@ class Feed extends WidgetCommon {
}
}
function onVcard($contact) { }
function prepareFeed($start) {
$query = Post::query()
->where(array('key' => $this->user->getLogin(), 'parentid' => ''))
@ -45,7 +50,7 @@ class Feed extends WidgetCommon {
$next = $start + 20;
if(sizeof($messages) > 0)
if(sizeof($messages) > 0 && $html != '')
$html .= '<div class="post older" onclick="'.$this->genCallAjax('ajaxGetFeed', "'".$next."'").'; this.style.display = \'none\'">'.t('Get older posts').'</div>';
}
@ -97,9 +102,29 @@ class Feed extends WidgetCommon {
}
function build()
{
{
$conf_arr = UserConf::getConf();
?>
<div class="tabelem" title="<?php echo t('Feed'); ?>" id="feed">
<?php
if($conf_arr["first"] == 0) {
?>
<script type="text/javascript">
setTimeout('<?php $this->callAjax('ajaxCreateNode'); ?>' , 500);
</script>
<?php
}
elseif($conf_arr["first"] == 3) {
?>
<div class="warning" style="margin: 1.5em;">
<?php echo t("Your server doesn't support post publication, you can only read contact's feeds"); ?>
</div>
<?php
}
else {
?>
<table id="submit">
<tr id="feedmessage">
<td>
@ -144,21 +169,16 @@ class Feed extends WidgetCommon {
</div>
<div id="feedcontent">
<?php
$conf_arr = UserConf::getConf();
if($conf_arr["first"] == 0) {
?>
<a
<?php
/* <a
onclick="<?php $this->callAjax('ajaxCreateNode') ?>"
href="#" class="button tiny icon add">&nbsp;&nbsp;<?php echo t("Create the feed"); ?></a><br />
<?php
}
echo $this->prepareFeed(0);
href="#" class="button tiny icon add">&nbsp;&nbsp;<?php echo t("Create the feed"); ?></a><br />*/
}
echo $this->prepareFeed(0);
?>
?>
</div>
</div>
<?php

9
system/Widget/widgets/Feed/feed.css

@ -31,15 +31,6 @@
text-align: left;
resize: vertical;
padding: 0px;
-webkit-transition-property: height;
-webkit-transition-duration: 0.5s;
-webkit-transition-timing-function: ease-out;
transition-property: height;
transition-duration: 0.5s;
transition-timing-function: ease-out;
-moz-transition-property: height;
-moz-transition-duration: 0.5s;
-moz-transition-timing-function: ease-out;
}
#feed #feedsubmitrow {

4
system/Widget/widgets/Log/Log.php

@ -40,11 +40,11 @@ class Log extends WidgetBase
function onEvent($data)
{
RPC::call('movim_prepend',
/* RPC::call('movim_prepend',
'log_content',
RPC::cdata("<span>%s&gt; data : </span>%s<br />",
date('H:i:s'),
var_export($data, true)));
var_export($data, true)));*/
}
}

80
system/Widget/widgets/Login/Login.php

@ -20,7 +20,8 @@
class Login extends WidgetBase {
function __construct() {
function WidgetLoad()
{
$this->addcss('login.css');
}
@ -40,6 +41,12 @@ class Login extends WidgetBase {
'.t('Invalid JID').'
</div> ';
break;
case 'wrongpass':
$warning = '
<div class="warning">
'.t('Wrong password').'
</div> ';
break;
case 'failauth':
$warning = '
<div class="warning">
@ -70,6 +77,12 @@ class Login extends WidgetBase {
'.t('Account successfully created').'
</div> ';
break;
case 'wrongaccount':
$warning = '
<div class="error">
'.t('Movim fail to authenticate. You entered wrong data').'
</div> ';
break;
}
if(!BROWSER_COMP)
@ -79,54 +92,47 @@ class Login extends WidgetBase {
</div> ';
$serverconf = Conf::getServerConf();
?>
<div id="loginpage">
<?php echo $browser_comp;
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
}
echo $browser_comp;
?>
<div id="quote">
<blockquote>
We don't need no education<br />
We dont need no thought control<br />
No dark sarcasm in the classroom<br />
Teachers leave them kids alone<br />
Hey! Teachers! Leave them kids alone!<br /><br />
All in all it's just another brick in the wall.<br />
All in all you're just another brick in the wall.<br />
</blockquote>
<cite>
<a href="http://en.wikipedia.org/wiki/Roger_Waters">Roger Waters</a>, in
<a href="http://en.wikipedia.org/wiki/Another_Brick_in_the_Wall_%28Part_2%29#Part_2">"Another Brick in the Wall (Part II)"</a> on
<a href="http://en.wikipedia.org/wiki/The_Wall">The Wall</a> by
<a href="http://en.wikipedia.org/wiki/Pink_Floyd">Pink Floyd</a>
</cite>
</div>
<div id="loginpage">
<form id="connectform" action="index.php" method="post">
<?php echo $warning; ?>
<input type="email" name="login" id="login" autofocus required
placeholder="<?php echo t("My address"); ?>"/><br />
<input type="password" name="pass" id="pass" required
placeholder="<?php echo t("Password"); ?>"/><br />
<div id="cells">
<input type="email" name="login" id="login" autofocus required
placeholder="<?php echo t("My address"); ?>"/>
<input type="password" name="pass" id="pass" required
placeholder="<?php echo t("Password"); ?>"/>
<input style="float: right;" 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 style="padding-top: 20px; width: 100%; text-align: center; clear: both;">
<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);
echo t('This server host %s accounts', count($contacts));
?>
if(Conf::getServerConfElement("accountCreation") == 1) {
?> -
<a href="?q=accountCreate"><?php echo t('Create a new account'); ?></a> -
<a href="?q=accountAdd"><?php echo t('Link my actual account'); ?></a>
<?php
}
?>
</span>
</div>
</form>
</div>
<?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
}
}
}

BIN
system/Widget/widgets/Login/img/logo.png

After

Width: 449  |  Height: 146  |  Size: 47 KiB

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

@ -1,4 +1,79 @@
html {
height: 100%;
}
body {
background-color: #274950;
background-image: radial-gradient(center
45deg, ellipse, #6E9EA8 0%, #274950 100%);
background-image: -moz-radial-gradient(center
45deg, ellipse, #6E9EA8 0%, #274950 100%);
background-image: -webkit-radial-gradient(50% 50%, ellipse, #6E9EA8, #274950);
background-repeat: no-repeat;
height: auto;
display: block;
vertical-align: middle;
}
#loginpage {
display: block;
position: fixed;
height: 100px;
background-image: url(img/logo.png);
background-repeat: no-repeat;
background-position: top center;
margin: 0 auto;
width: 1024px;
top: 50%;
margin-top: -170px;
padding-top: 200px;
}
#loginpage input {
background-color: white;
font-size: 1.4em;
border: 1px solid #274950;
box-shadow: inset 0px 3px 5px rgba(0, 0, 0, 0.4);
padding: 0.3em 0.5em;
color: #15414A;
border-radius: 4px;
}
#loginpage input[type=submit] {
background: -moz-linear-gradient(top, #6E9EA8 0%, #274950 100%);
background: -webkit-linear-gradient(top, #6E9EA8 0%, #274950 100%);
color: white;
box-shadow: none;
}
#connectform {
text-align: center;
margin: 0 auto;
}
#connectform span {
display: block;
color: white;
padding: 8px 0px;
text-align: center;
}
#footer {
border: 0px;
position: absolute;
bottom: 0px;
right: 0px;
color: white;
}
.error, .warning {
border-radius: 4px;
display: block;
width: 500px;
margin: 0em auto;
margin-bottom: 1em;
}
/*#loginpage {
min-height: 400px;
background-image: url(img/wall.jpg);
background-repeat: no-repeat;
@ -68,4 +143,4 @@
margin: 0px;
border: none;
}
*/

7
system/Widget/widgets/Logout/Logout.php

@ -28,6 +28,8 @@ class Logout extends WidgetBase
$this->registerEvent('postdisconnected', 'onPostDisconnect');
$this->registerEvent('serverdisconnect', 'onPostDisconnect'); // When you're kicked out
$this->registerEvent('mypresence', 'onMyPresence');
//$this->cached = true;
}
function onMyPresence()
@ -61,6 +63,7 @@ class Logout extends WidgetBase
{
// We update the cache with our status and presence
$presence = Cache::c('presence');
movim_log($presence);
if($show == "boot") $show = $presence['show'];
Cache::c(
'presence',
@ -100,8 +103,8 @@ class Logout extends WidgetBase
</div>
';
$presence = Cache::c('presence');
if($presence['boot'])
$html .= '<script type="text/javascript">setTimeout(\''.$this->genCallAjax('ajaxSetStatus', '"boot"').'\', 1500);</script>';
if($presence['boot'] == true)
$html .= '<script type="text/javascript">setTimeout(\''.$this->genCallAjax('ajaxSetStatus', '"boot"').'\', 5000);</script>';
return $html;
}

8
system/Widget/widgets/Logout/logout.css

@ -3,10 +3,10 @@
}
#logouttab {
position: absolute;
position: fixed;
top: 7px;
left: 50%;
margin-left: 390px;
margin-left: 205px;
overflow: hidden;
display: block;
padding: 5px 15px 5px 25px;
@ -31,10 +31,10 @@
#logoutlist {
border: 1px solid #CCC;
border-top: none;
position: absolute;
position: fixed;
top: 35px;
left: 50%;
margin-left: 380px;
margin-left: 175px;
box-shadow: 0 5px 10px rgba(150, 150, 150, 0.1);
display: none;
background-color: white;

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

@ -14,7 +14,7 @@
#notifs ul li {
padding-bottom: 5px;
border-top: 1px solid white;
border-top: 1px solid #CCC;
border-bottom: 1px solid #DDD;
font-size: 10px;
overflow: auto;

12
system/Widget/widgets/Profile/Profile.php

@ -28,6 +28,8 @@ class Profile extends WidgetBase
$this->addcss('profile.css');
$this->addjs('profile.js');
$this->registerEvent('myvcard', 'onMyVcardReceived');
$this->cached = true;
}
function onMyVcardReceived($vcard = false)
@ -60,7 +62,8 @@ class Profile extends WidgetBase
if(isset($me[0])) {
$me = $me[0];
$html = '
$html ='<h1>'.$me->getTrueName().'</h1><img src="'.$me->getPhoto().'"/>';
/*$html = '
<table>
<tr>
<td>
@ -71,7 +74,7 @@ class Profile extends WidgetBase
</td>
</tr>
</table>
';
';*/
$html .= '
<input
type="text"
@ -81,7 +84,10 @@ class Profile extends WidgetBase
/>
<br />
';
}
} else {
$html .= t('No profile yet ?').'<br /><br />';
$html .= '<a class="button icon add" style="padding-left: 25px;" href="?q=profile">'.t("Create my vCard").'</a><br /><br />';
}
return $html;
}

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

@ -9,14 +9,17 @@
}
#profile h1 {
margin: 0px;
line-height: 1.3em;
padding: 0px;
padding-left: 10px;
border: none;
margin-bottom: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#profile img {
width: 70px;
max-width: 150px;
margin: 0 auto;
}
#profile #status {
@ -27,10 +30,12 @@
border: 1px solid transparent;
text-align: center;
width: 80%;
background-color: transparent;
}
#profile #status:hover {
border-color: #DDD;
background-color: white;
}
#profile .presence_button.online { background-image: url(img/online.png); }

4
system/Widget/widgets/Roster/Roster.php

@ -27,8 +27,12 @@ class Roster extends WidgetBase
$this->addcss('roster.css');
$this->addjs('roster.js');
$this->registerEvent('roster', 'onRoster');
$this->registerEvent('contactadd', 'onRoster');
$this->registerEvent('contactremove', 'onRoster');
$this->registerEvent('presence', 'onPresence');
$this->registerEvent('vcard', 'onVcard');
$this->cached = true;
}
function onPresence($presence)

7
system/Widget/widgets/Roster/roster.css

@ -1,3 +1,7 @@
#roster {
margin-bottom: 60px;
}
#roster ul {
list-style-type: none;
font-size: 13px;
@ -61,7 +65,7 @@
#roster ul li a {
display: block;
white-space: nowrap;
width: 170px;
width: 145px;
overflow: hidden;
text-overflow: ellipsis;
}
@ -93,4 +97,5 @@
padding: 5px 0px;
font-size: 14px;
font-weight: bold;
text-align: center;
}

9
system/Widget/widgets/Vcard/Vcard.php

@ -25,6 +25,8 @@ class Vcard extends WidgetBase
$this->registerEvent('myvcard', 'onMyVcardReceived');
$this->addcss('vcard.css');
$this->addjs('vcard.js');
//$this->cached = true;
}
function onMyVcardReceived()
@ -33,7 +35,10 @@ class Vcard extends WidgetBase
RPC::call('movim_fill', 'vcard', RPC::cdata($html));
}
function ajaxVcardSubmit($vcard) {
function ajaxVcardSubmit($vcard)
{
foreach($vcard as $key => $value)
$vcard[$key] = rawurldecode($value);
# Format it ISO 8601:
$vcard['vCardBDay'] = $vcard['vCardBYear'].'-'.$vcard['vCardBMonth'].'-'.$vcard['vCardBDay'];
$this->xmpp->updateVcard($vcard);
@ -194,7 +199,7 @@ class Vcard extends WidgetBase
function build()
{
?>
<div class="tabelem" title="<?php echo t('Profile'); ?>" id="vcard">
<div class="tabelem" title="<?php echo t('Edit my Profile'); ?>" id="vcard">
<?php
echo $this->prepareInfos();
?>

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

@ -18,6 +18,7 @@
#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 {
@ -35,7 +36,7 @@
#vcard .element span {
font-weight: bold;
width: 170px;
width: 160px;
display: block;
float: left;
padding-right: 2em;

49
system/Widget/widgets/Wall/Wall.php

@ -25,26 +25,30 @@ class Wall extends WidgetCommon
{
$this->addcss('wall.css');
$this->addjs('wall.js');
$this->registerEvent('post', 'onNewPost');
$this->registerEvent('stream', 'onStream');
$this->registerEvent('comment', 'onComment');
$this->registerEvent('nocomment', 'onNoComment');
$this->registerEvent('nocommentstream', 'onNoCommentStream');
$this->registerEvent('nostream', 'onNoStream');
$this->registerEvent('currentpost', 'onNewPost');
}
function onNewPost($payload) {
global $sdb;
$message = $sdb->select('Message', array('nodeid' => $payload['event']['items']['item']['@attributes']['id']));
$html = $this->preparePost($message[0]);
function onNewPost($id) {
$query = Post::query()
->where(array('key' => $this->user->getLogin(), 'nodeid' => $id));
$post = Post::run_query($query);
RPC::call('movim_prepend', 'wall', RPC::cdata($html));
if($post != false) {
$html = $this->preparePost($post[0]);
RPC::call('movim_prepend', 'wall', RPC::cdata($html));
}
}
function onNoStream() {
RPC::call('hideWall');
$html = '<div style="padding: 1.5em; text-align: center;">Ain\'t Nobody Here But Us Chickens...</div>';
RPC::call('movim_fill', 'wall', RPC::cdata($html));
RPC::commit();
}
}
function onStream($payload) {
$html = '';
@ -62,15 +66,22 @@ class Wall extends WidgetCommon
<br /><br />-->
';
global $sdb;
$messages = $sdb->select('Post', array('key' => $this->user->getLogin(), 'jid' => $payload["@attributes"]["from"]), 'updated', true);
$query = Post::query()
->where(array(
'key' => $this->user->getLogin(),
'parentid' => '',
'jid' => $payload["@attributes"]["from"]))
->orderby('updated', true)
->limit('0', '20');
$messages = Post::run_query($query);
if($messages == false) {
RPC::call('hideWall');
$this->onNoStream();
} else {
$html = '';
foreach(array_slice($messages, 0, 20) as $message) {
foreach($messages as $message) {
$html .= $this->preparePost($message);
}
echo $html;
@ -106,22 +117,28 @@ class Wall extends WidgetCommon
</a>
<br /><br />-->
<?php
global $sdb;
$messages = $sdb->select('Post', array('key' => $this->user->getLogin(), 'jid' => $_GET['f'], 'parentid' => ''), 'updated', true);
$query = Post::query()
->where(array(
'key' => $this->user->getLogin(),
'parentid' => '',
'jid' => $_GET['f']))
->orderby('updated', true)
->limit('0', '20');
$messages = Post::run_query($query);
if($messages == false) {
?>
<script type="text/javascript">
<?php echo 'setTimeout(\''.$this->genCallAjax('ajaxWall', '"'.$_GET['f'].'"').'\', 500);'; ?>
</script>
<div style="padding: 1em; text-align: center;">
<div style="padding: 1.5em; text-align: center;">
<?php echo t('Loading the contact feed ...'); ?>
</div>
<?php
} else {
$html = '';
foreach(array_slice($messages, 0, 20) as $message) {
foreach($messages as $message) {
$html .= $this->preparePost($message);
}
echo $html;

2
system/js/movim.js

@ -50,7 +50,7 @@ function movim_parse_form(formname) {
var data = H();
for(var i = 0; i < form.elements.length; i++) {
data.set(form.elements[i].name,
form.elements[i].value);
encodeURIComponent(form.elements[i].value));
}
return data;
}

37
themes/movim/account.tpl

@ -1,7 +1,40 @@
<?php /* -*- mode: html -*- */
?>
<style type="text/css">
html {
height: 100%;
}
body {
background-image: radial-gradient(center
45deg, circle closest-corner, #ffffff 0%, #717171 100%);
background-image: -moz-radial-gradient(center
45deg, ellipse, #6E9EA8 0%, #274950 100%);
background-repeat: no-repeat;
height: auto;
display: block;
vertical-align: middle;
}
.account_button {
margin: 2em auto;
width: 300px;
font-size: 1.6em;
}
h1 {
color: white;
display: block;
margin: 0 auto;
}
</style>
<div id="center">
<br />
<?php $this->widget('Account');?>
<br />
<h1><?php echo t('Make your choice !');?></h1>
<a href="?q=accountCreate">
<div class="account_button button big green"><?php echo t('Create a new account'); ?></div>
</a>
<a href="?q=accountAdd">
<div class="account_button button big green"><?php echo t('Link my actual account'); ?></div>
</a>
</div>

7
themes/movim/account_add.tpl

@ -0,0 +1,7 @@
<?php /* -*- mode: html -*- */
?>
<div id="center">
<br />
<?php $this->widget('AccountAdd');?>
</div>

7
themes/movim/account_create.tpl

@ -0,0 +1,7 @@
<?php /* -*- mode: html -*- */
?>
<div id="center">
<br />
<?php $this->widget('Account');?>
</div>

6
themes/movim/config.tpl

@ -7,11 +7,11 @@
<div id="left">
<?php $this->widget('Profile'); ?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="right">
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="center" class="protect white">
<h1><?php echo t('Configuration'); ?></h1>

11
themes/movim/css/posts.css

@ -144,8 +144,6 @@
transform: scale(1.2);
-moz-transform: scale(1.2);
-webkit-transform: scale(1.2);
-moz-transition-duration: 0.2s;
-webkit-transition-duration: 0.2s;
box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
}
@ -193,15 +191,6 @@ label {
resize: vertical;
padding: 0px;
height: 1.5em;
-webkit-transition-property: height;
-webkit-transition-duration: 0.5s;
-webkit-transition-timing-function: ease-out;
transition-property: height;
transition-duration: 0.5s;
transition-timing-function: ease-out;
-moz-transition-property: height;
-moz-transition-duration: 0.5s;
-moz-transition-timing-function: ease-out;
}
.post table#commentsubmit textarea:focus {

108
themes/movim/css/style2.css

@ -27,10 +27,19 @@ time, mark, audio, video {
body {
font-family: helvetica,sans-serif, Helvetica, "lucida grande",tahoma,verdana,arial,sans-serif;
font-size: 13px;
margin: 0 auto;
margin-top: 35px;
/*margin: 0 auto;
margin-top: 35px;*/
color: #4E4E4E;
height: 100%;
background-color: #274950;
background-image: radial-gradient(center
45deg, ellipse, #6E9EA8 0%, #274950 100%);
background-image: -moz-radial-gradient(center
45deg, ellipse, #6E9EA8 0%, #274950 100%);
background-image: -webkit-radial-gradient(50% 50%, ellipse, #6E9EA8, #274950);
background-repeat: no-repeat;
background-attachment:fixed;
margin: 0 auto;
width: 1000px;
}
.clear {
@ -42,15 +51,11 @@ a:link, a:visited {
text-decoration: none ;
}
#content {
width: 1024px;
margin: 0 auto;
}
.protect {
background-size: 28px;
background-repeat: no-repeat;
background-position: 100% 0px;
background-position: 98% 0px;
}
.protect.white { background-image: url(../img/protect/white.svg); }
@ -69,7 +74,7 @@ hr {
}
h1 {
color: #1F3C48;
color: #183C67;
padding: 10px 20px 0px;
font-size: 1.5em;
}
@ -126,47 +131,67 @@ ul.clean li {
height: 120px;
}
#content {
width: 800px;
margin-right: 200px;
background-color: #EEE;
border-left: 1px solid #DDD;
border-right: 1px solid #DDD;
}
#left
{
width: 210px;
float: left;
height: 100%;
padding-top: 15px;
width: 170px;
padding-top: 50px;
padding-left: 15px;
padding-right: 15px;
}
#center
{
float: left;
width: 599px;
background-color: white;
border-left: 1px solid #DDD;
padding-top: 35px;
min-height: 1000px;
overflow: hidden;
padding: 10px 0px 10px;
min-height: 600px;
border-left: 1px solid #CCC;
}
#right
{
display: block;
float: right;
overflow: auto;
width: 190px;
padding-top: 15px;
width: 194px;
background-color: green;
position: fixed;
top: 0px;
right: -20px;
border-left: 1px solid #DDD;
padding-top: 40px;
padding-left: 5px;
padding-right: 10px;
height: 100%;
background-color: #EFEFEF;
overflow: scroll;
}
#footer {
border-top: 1px solid #CCC;
padding: 0.5em;
text-align: right;
#footer
{
border-top: 1px solid #DDD;
clear: both;
color: gray;
padding: 5px 10px;
text-align: right;
color: #666;
}
/* Widgets */
span#widgettitle {
font-weight: bold;
border-top: 1px solid #DDD;
display: block;
padding: 3px;
background-color: #FDFDFD;
text-align: center;
margin-bottom: 4px;
}
@ -192,7 +217,7 @@ input, select, textarea, .button {
overflow: hidden;
padding: 5px;
color: #333;
background-color: transparent;
background-color: white;
}
input:focus, select:focus, textarea:focus {
@ -260,6 +285,16 @@ input:hover[type=submit], input[type=reset]:hover, input[type=button]:hover, .bu
.button.merged:hover { border: 1px solid #C6C6C6; }
.button.green {
background-color: #40A546;
color: white;
border-color: #297A2E;
}
.button.green:hover {
box-shadow: 0 1px 1px rgba(0, 120, 0, 0.3);
}
fieldset {
border: none;
margin-top: 20px;
@ -295,32 +330,37 @@ label {
width: 100%;
background-color: #444;
min-height: 34px;
position: absolute;
position: fixed;
top: 0px;
left: 0px;
z-index: 1;
background-image: linear-gradient(bottom, rgb(51,51,51) 15%, rgb(68,68,68) 82%);
/*background-image: linear-gradient(bottom, rgb(51,51,51) 15%, rgb(68,68,68) 82%);
background-image: -o-linear-gradient(bottom, rgb(51,51,51) 15%, rgb(68,68,68) 82%);
background-image: -moz-linear-gradient(bottom, rgb(51,51,51) 15%, rgb(68,68,68) 82%);
background-image: -webkit-linear-gradient(bottom, rgb(51,51,51) 15%, rgb(68,68,68) 82%);
background-image: -ms-linear-gradient(bottom, rgb(51,51,51) 15%, rgb(68,68,68) 82%);
background-image: -ms-linear-gradient(bottom, rgb(51,51,51) 15%, rgb(68,68,68) 82%);*/
}
#nav .menu {
width: 810px;
width: 1024px;
margin: 0px auto;
list-style-type: none;
display: block;
overflow: hidden;
clear: both;
padding-left: 210px;
background-image: url(../img/logo.png);
background-repeat: no-repeat;
background-position: 20px 7px;
background-position: 30px 7px;
}
#nav .menu li {
float: left;
}
#nav .menu li:first-child {
width: 210px;
opacity: 0;
}
#nav .menu li a {
padding: 10px 20px;
display: block;

12
themes/movim/friend.tpl

@ -6,15 +6,15 @@
<?php $this->widget('Chat');?>
<div id="left">
<?php $this->widget('Profile');?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
<?php /*$this->widget('Profile');*/?>
<?php $this->widget('ContactSummary');?>
</div>
<div id="right">
<?php $this->widget('ContactSummary');?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="center">
<?php $this->widget('Tabs');?>
<?php /*$this->widget('Tabs');*/?>
<?php $this->widget('Wall');?>
<?php $this->widget('ContactCard');?>
<?php /*$this->widget('ContactCard');*/?>
</div>

6
themes/movim/help.tpl

@ -7,11 +7,11 @@
<div id="left">
<?php $this->widget('Profile'); ?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="right">
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="center">
<h1><?php echo t('Help'); ?></h1>

6
themes/movim/img/default.svg

@ -32,7 +32,7 @@
showgrid="true"
showborder="false"
inkscape:window-width="1920"
inkscape:window-height="1012"
inkscape:window-height="1016"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
@ -46,7 +46,9 @@
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
snapvisiblegridlinesonly="true"
originx="0px"
originy="-3.8281246e-07px" />
</sodipodi:namedview>
<metadata
id="metadata7">

5
themes/movim/main.tpl

@ -6,11 +6,10 @@
<div id="left">
<?php $this->widget('Profile');?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="right">
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="center" class="protect orange">
<h1><?php echo t('Feed'); ?></h1>

8
themes/movim/profile.tpl

@ -8,13 +8,13 @@
<div id="left">
<?php $this->widget('Profile');?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="right">
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="center">
<h1><?php echo t('Profile'); ?></h1>
<h1><?php echo t('Edit my profile'); ?></h1>
<?php $this->widget('Vcard');?>
</div>
Loading…
Cancel
Save