Changeset 1495
- Timestamp:
- 08/21/11 15:04:36 (21 months ago)
- Location:
- xmpp
- Files:
-
- 6 modified
-
de.xml (modified) (1 diff)
-
en.xml (modified) (1 diff)
-
files/lib/page/ChatPage.class.php (modified) (2 diffs)
-
options.xml (modified) (2 diffs)
-
package.xml (modified) (1 diff)
-
templates/chat.tpl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xmpp/de.xml
r1492 r1495 12 12 <item name="wcf.acp.option.module_xmpp"><![CDATA[XMPP Integration]]></item> 13 13 <item name="wcf.acp.option.module_xmpp.description"><![CDATA[Aktiviert die XMPP Integration.]]></item> 14 <item name="wcf.acp.option.category.general.http.chat"><![CDATA[Chat]]></item> 15 <item name="wcf.acp.option.category.general.http.chat.description"><![CDATA[]]></item> 16 <item name="wcf.acp.option.xmpp_http"><![CDATA[XMPP HTTP-binding]]></item> 17 <item name="wcf.acp.option.xmpp_http.description"><![CDATA[To run the example you'll also need an HTTP server with proxy capabilities because it's not allowed to make cross-domain AJAX requests.]]></item> 14 <item name="wcf.acp.option.category.general.http.xmpp"><![CDATA[XMPP]]></item> 15 <item name="wcf.acp.option.category.general.http.xmpp.description"><![CDATA[]]></item> 16 <item name="wcf.acp.option.category.general.http.xmpp.chat"><![CDATA[Chat]]></item> 17 <item name="wcf.acp.option.category.general.http.xmpp.chat.description"><![CDATA[]]></item> 18 19 <item name="wcf.acp.option.xmpp_domain"><![CDATA[Domain]]></item> 20 <item name="wcf.acp.option.xmpp_domain.description"><![CDATA[Server Ìber den sich der Benutzer anmeldet. Beispiel: talk.easy-coding.de]]></item> 21 <item name="wcf.acp.option.xmpp_auth_cookie"><![CDATA[Cookie Login]]></item> 22 <item name="wcf.acp.option.xmpp_auth_cookie.description"><![CDATA[Insofern der XMPP Server die Authentifizierung mit Cookie & Salz erlaubt, mÌssen registrierte Benutzer durch Aktivieren dieser Funktion kein Passwort fÌr XMPP Anfragen eingeben.]]></item> 23 24 <item name="wcf.acp.option.xmpp_chat_http"><![CDATA[HTTP-binding]]></item> 25 <item name="wcf.acp.option.xmpp_chat_http.description"><![CDATA[Der Pfad Ìber den das HTTP-bindung des Jabber Servers erreichbar ist. Unter UmstÀnden muss eine .htaccess angelegt werden, siehe <a href="{@RELATIVE_WCF_DIR}acp/dereferrer.php?url=http://amiadogroup.github.com/candy/">github</a>.]]></item> 26 <item name="wcf.acp.option.xmpp_chat_autojoin"><![CDATA[RÀume]]></item> 27 <item name="wcf.acp.option.xmpp_chat_autojoin.description"><![CDATA[Der HTTP Chat wird automatisch diese RÀume betreten. Mehrere RÀume können durch Zeilenumbruch getrennt eingegeben werden.]]></item> 28 <item name="wcf.acp.option.xmpp_chat_anonymous"><![CDATA[Anonymer Zugang]]></item> 29 <item name="wcf.acp.option.xmpp_chat_anonymous.description"><![CDATA[Insofern der XMPP Serer anonyme Logins erlaubt, kann diese Option aktiviert werden, damit sich GÀste Ìber den Web-Chat anmelden können.]]></item> 18 30 </category> 19 31 </language> -
xmpp/en.xml
r1492 r1495 12 12 <item name="wcf.acp.option.module_xmpp"><![CDATA[XMPP Integration]]></item> 13 13 <item name="wcf.acp.option.module_xmpp.description"><![CDATA[Enables the XMPP Integration.]]></item> 14 <item name="wcf.acp.option.category.general.http.chat"><![CDATA[Chat]]></item> 15 <item name="wcf.acp.option.category.general.http.chat.description"><![CDATA[]]></item> 16 <item name="wcf.acp.option.xmpp_http"><![CDATA[XMPP HTTP-binding]]></item> 17 <item name="wcf.acp.option.xmpp_http.description"><![CDATA[To run the example you'll also need an HTTP server with proxy capabilities because it's not allowed to make cross-domain AJAX requests.]]></item> 14 <item name="wcf.acp.option.category.general.http.xmpp"><![CDATA[XMPP]]></item> 15 <item name="wcf.acp.option.category.general.http.xmpp.description"><![CDATA[]]></item> 16 <item name="wcf.acp.option.category.general.http.xmpp.chat"><![CDATA[Chat]]></item> 17 <item name="wcf.acp.option.category.general.http.xmpp.chat.description"><![CDATA[]]></item> 18 19 <item name="wcf.acp.option.xmpp_domain"><![CDATA[Domain]]></item> 20 <item name="wcf.acp.option.xmpp_domain.description"><![CDATA[Server to authenticate. Example: talk.easy-coding.de]]></item> 21 <item name="wcf.acp.option.xmpp_auth_cookie"><![CDATA[Cookie Login]]></item> 22 <item name="wcf.acp.option.xmpp_auth_cookie.description"><![CDATA[Depending on the server authentication with cookie and salt may be allowed. Active this so that registered users don't need to enter their password for xmpp queries.]]></item> 23 24 <item name="wcf.acp.option.xmpp_chat_http"><![CDATA[XMPP HTTP-binding]]></item> 25 <item name="wcf.acp.option.xmpp_chat_http.description"><![CDATA[To run the chat you'll also need an HTTP server with proxy capabilities because it's not allowed to make cross-domain AJAX requests, see <a href="{@RELATIVE_WCF_DIR}acp/dereferrer.php?url=http://amiadogroup.github.com/candy/">github</a>.]]></item> 26 <item name="wcf.acp.option.xmpp_chat_autojoin"><![CDATA[Rooms]]></item> 27 <item name="wcf.acp.option.xmpp_chat_autojoin.description"><![CDATA[Autojoin to the following rooms. Enter multiple rooms divided by linebreak.]]></item> 28 <item name="wcf.acp.option.xmpp_chat_anonymous"><![CDATA[Anonymous Access]]></item> 29 <item name="wcf.acp.option.xmpp_chat_anonymous.description"><![CDATA[Depending on the server communication anonymous access is granted. Enable this to allow anonymous access via the webchat.]]></item> 18 30 </category> 19 31 </language> -
xmpp/files/lib/page/ChatPage.class.php
r1493 r1495 12 12 13 13 /** 14 * supported languages 15 * @var array<string> 16 */ 17 protected $valid_languages = array( 18 'de', 19 'en', 20 'fr', 21 ); 22 23 /** 24 * @return string 25 */ 26 protected function getLanguageCode() { 27 return in_array(WCF::getLanguage()->getLanguageCode(), $this->valid_languages) 28 ? WCF::getLanguage()->getLanguageCode() 29 : 'en'; 30 } 31 32 /** 14 33 * @see Page::assignVariables() 15 34 */ 16 35 public function assignVariables() { 17 36 parent::assignVariables(); 37 38 $autojoin_str = ''; 39 foreach(explode("\n", XMPP_CHAT_AUTOJOIN) as $row) { 40 $autojoin_str .= ',[\''.$row.'\']'; 41 } 42 $autojoin_str = ltrim($autojoin_str, ','); 43 44 45 $username = ''; 46 $password = ''; 47 if(WCF::getUser()->userID) { 48 $username = urlencode(WCF::getUser()->username).'@'.XMPP_DOMAIN; 49 if(XMPP_AUTH_COOKIE) { 50 $password = WCF::getUser()->password.WCF::getUser()->salt; 51 } 52 } else if (XMPP_CHAT_ANONYMOUS) { 53 $username = XMPP_DOMAIN; 54 } 18 55 19 56 WCF::getTPL()->assign(array( 20 57 'allowSpidersToIndexThisPage' => true, 21 'username' => WCF::getUser()->userID ? WCF::getUser()->username : false 58 'xmpp_lang' => $this->getLanguageCode(), 59 'xmpp_http' => XMPP_HTTP, 60 'xmpp_domain' => XMPP_DOMAIN, 61 'xmpp_username' => $username, 62 'xmpp_password' => $password, 63 'xmpp_chat_autojoin' => $autojoin_str 22 64 )); 23 65 } … … 30 72 throw new IllegalLinkException(); 31 73 } 32 74 33 75 require_once(WCF_DIR.'lib/page/util/menu/PageMenu.class.php'); 34 76 PageMenu::setActiveMenuItem('wcf.header.menu.chat'); 35 77 36 78 parent::show(); 37 79 } -
xmpp/options.xml
r1492 r1495 3 3 <import> 4 4 <categories> 5 <category name="general.http. chat">5 <category name="general.http.xmpp"> 6 6 <parent>general.http</parent> 7 <showorder>1</showorder> 8 </category> 9 <category name="general.http.xmpp.chat"> 10 <parent>general.http.xmpp</parent> 7 11 <showorder>1</showorder> 8 12 </category> … … 15 19 <defaultvalue>1</defaultvalue> 16 20 </option> 17 <option name="xmpp_http"> 18 <categoryname>general.http.chat</categoryname> 21 22 <option name="xmpp_domain"> 23 <categoryname>general.http.xmpp</categoryname> 19 24 <optiontype>text</optiontype> 20 <defaultvalue></defaultvalue> 25 <defaultvalue></defaultvalue><!-- e.g. talk.easy-coding.de --> 21 26 <showorder>1</showorder> 27 </option> 28 <option name="xmpp_auth_cookie"> 29 <categoryname>general.http.xmpp</categoryname> 30 <optiontype>boolean</optiontype> 31 <defaultvalue>false</defaultvalue> 32 <showorder>2</showorder> 33 </option> 34 35 <option name="xmpp_chat_http"> 36 <categoryname>general.http.xmpp.chat</categoryname> 37 <optiontype>text</optiontype> 38 <defaultvalue>http-bind/</defaultvalue> 39 <showorder>1</showorder> 40 </option> 41 <option name="xmpp_chat_autojoin"> 42 <categoryname>general.http.xmpp.chat</categoryname> 43 <optiontype>textarea</optiontype> 44 <defaultvalue></defaultvalue><!-- line separated e.g. www@conference.talk.easy-coding.de --> 45 <showorder>2</showorder> 46 </option> 47 <option name="xmpp_chat_anonymous"> 48 <categoryname>general.http.xmpp.chat</categoryname> 49 <optiontype>boolean</optiontype> 50 <defaultvalue>true</defaultvalue> 51 <showorder>3</showorder> 22 52 </option> 23 53 </options> -
xmpp/package.xml
r1491 r1495 4 4 <packageinformation> 5 5 <packagename>XMPP Integration</packagename> 6 <packagedescription>Includes a JavaScript-based multi-user chat client for xmpp/jabber. </packagedescription>7 <version> 0.2.0</version>6 <packagedescription>Includes a JavaScript-based multi-user chat client for xmpp/jabber. For features will follow.</packagedescription> 7 <version>1.0.0 Beta 1</version> 8 8 <date>DATE</date> 9 9 <plugin>com.woltlab.wcf.page.user.profile</plugin> -
xmpp/templates/chat.tpl
r1493 r1495 2 2 <head> 3 3 <title>{lang}wcf.header.menu.chat{/lang} - {lang}{PAGE_TITLE}{/lang}</title> 4 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> 5 <script type="text/javascript">jQuery.noConflict();</script> 4 6 {include file='headInclude' sandbox=false} 7 8 <link rel="stylesheet" type="text/css" href="{@RELATIVE_WCF_DIR}images/candy/default.css" /> 9 <script type="text/javascript" src="{@RELATIVE_WCF_DIR}js/3rdParty/candy.libs.bundle.js"></script> 10 <script type="text/javascript" src="{@RELATIVE_WCF_DIR}js/3rdParty/candy.min.js"></script> 11 <script type="text/javascript"> 12 //<![CDATA[ 13 onloadEvents.push(function(){ 14 Candy.init('{$xmpp_http}', { 15 core: { 16 debug: false 17 {if $autojoin_str},autojoin: [{@$autojoin_str}]{/if} 18 }, 19 view: { 20 resources: '{@RELATIVE_WCF_DIR}images/candy/', 21 language: '{$xmpp_lang}' 22 } 23 }); 24 Candy.Core.connect({if $xmpp_username}'{$xmpp_username}'{/if}{if $xmpp_password}, '{$xmpp_password}'{/if}); 25 }); 26 //]]> 27 </script> 5 28 </head> 6 29 <body{if $templateName|isset} id="tpl{$templateName|ucfirst}"{/if}> … … 13 36 </ul> 14 37 <div class="mainHeadline"> 15 <img src="{icon}chatL.png{/icon}" alt="" /> 38 <img src="{icon}chatL.png{/icon}" alt="" /> 16 39 <div class="headlineContainer"> 17 40 <h2>{lang}wcf.header.menu.chat{/lang}</h2> … … 19 42 </div> 20 43 21 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> 22 <script type="text/javascript">jQuery.noConflict();</script> 23 <link rel="stylesheet" type="text/css" href="{@RELATIVE_WCF_DIR}images/candy/default.css" /> 24 <script type="text/javascript" src="{@RELATIVE_WCF_DIR}js/3rdParty/candy.libs.bundle.js"></script> 25 <script type="text/javascript" src="{@RELATIVE_WCF_DIR}js/3rdParty/candy.min.js"></script> 26 <script type="text/javascript"> 27 //<![CDATA[ 28 onloadEvents.push(function(){ 29 Candy.init('http-bind/', { 30 core: { 31 debug: false, 32 autojoin: ['www@conference.talk.easy-coding.de'] 33 }, 34 view: { 35 resources: '{@RELATIVE_WCF_DIR}images/candy/', 36 language: 'de' 37 } 38 }); 39 Candy.Core.connect({if $username}{$username|json_encode}{/if}); 40 }); 41 //]]> 42 </script> 44 {if $userMessages|isset}{@$userMessages}{/if} 43 45 44 {if $userMessages|isset}{@$userMessages}{/if} 45 <p class="info">Die Chat Integration in das Forum befindet sich noch im Aufbau. Mit eurem Jabber Client könnt ihr aber schon fleiÃig mitchatten. Mehr unter : <a href="http://www.easy-coding.de/easy-coding-xmpp-server-talk-easy-coding-de-t7173.html">easy-coding XMPP Server - talk.easy-coding.de</a></p> 46 <p class="info">Die Chat Integration in das Forum befindet sich noch im Aufbau. Mehr unter : <a href="http://www.easy-coding.de/easy-coding-xmpp-server-talk-easy-coding-de-t7173.html">easy-coding XMPP Server - talk.easy-coding.de</a></p> 46 47 47 48 <div style="position:relative"><div id="candy"></div></div>
