mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Read $_GET['id'] and pass it to template
This commit is contained in:
parent
aabebd820e
commit
063fb644b0
@ -6,10 +6,15 @@
|
||||
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
|
||||
* @package timwolla.wcf.chat
|
||||
*/
|
||||
if (typeof TimWolla == undefined) var TimWolla = {};
|
||||
if (typeof TimWolla.WCF == undefined) var TimWolla.WCF = {};
|
||||
if (typeof TimWolla == 'undefined') var TimWolla = {};
|
||||
if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {};
|
||||
|
||||
var TimWolla.WCF.Chat = {};
|
||||
|
||||
(function ($, document) {
|
||||
|
||||
TimWolla.WCF.Chat = function(roomID, messageID) { this.init(roomID, messageID); };
|
||||
TimWolla.WCF.Chat.prototype = {
|
||||
init: function(roomID, messageID) {
|
||||
history.replaceState({}, '', 'index.php/Chat/'+roomID);
|
||||
}
|
||||
};
|
||||
})(jQuery, document);
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
namespace wcf\page;
|
||||
use \wcf\system\WCF;
|
||||
|
||||
/**
|
||||
* Shows the chat-interface
|
||||
@ -11,8 +12,39 @@
|
||||
* @subpackage page
|
||||
*/
|
||||
class ChatPage extends AbstractPage {
|
||||
public $roomID = 0;
|
||||
//public $neededModules = array('CHAT_ACTIVE');
|
||||
//public $neededPermissions = array('user.chat.canEnter');
|
||||
|
||||
/**
|
||||
* @see wcf\page\IPage::show()
|
||||
* @see \wcf\page\IPage::assignVariables()
|
||||
*/
|
||||
public function assignVariables() {
|
||||
parent::assignVariables();
|
||||
|
||||
WCF::getTPL()->assign(array(
|
||||
'roomID' => $this->roomID
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\page\IPage::readData()
|
||||
*/
|
||||
public function readData() {
|
||||
parent::readData();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\page\IPage::readParameters()
|
||||
*/
|
||||
public function readParameters() {
|
||||
parent::readParameters();
|
||||
|
||||
if (isset($_GET['id'])) $this->roomID = (int) $_GET['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see \wcf\page\IPage::show()
|
||||
*/
|
||||
public function show() {
|
||||
\wcf\system\menu\page\PageMenu::getInstance()->setActiveMenuItem('wcf.header.menu.chat');
|
||||
|
@ -4,6 +4,11 @@
|
||||
<title>{lang}wcf.chat.title{/lang} - {PAGE_TITLE|language}</title>
|
||||
|
||||
{include file='headInclude' sandbox=false}
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
new TimWolla.WCF.Chat({$roomID},1);
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body id="tpl{$templateName|ucfirst}">
|
||||
|
Loading…
Reference in New Issue
Block a user