1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-24 22:00:09 +00:00
Tims-Chat/file/lib/system/command/AbstractCommand.class.php

70 lines
1.6 KiB
PHP
Raw Normal View History

<?php
namespace chat\system\command;
use \wcf\system\event\EventHandler;
/**
* Default implementation for commands.
2014-02-28 16:06:50 +00:00
*
* @author Tim Düsterhus
2014-02-27 22:05:09 +00:00
* @copyright 2010-2014 Tim Düsterhus
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
2013-01-19 19:36:40 +00:00
* @package be.bastelstu.chat
* @subpackage system.chat.command
*/
abstract class AbstractCommand implements ICommand {
2012-06-04 19:22:14 +00:00
/**
* Instance of the CommandHandler
*
* @var \chat\system\command\CommandHandler
2012-06-04 19:22:14 +00:00
*/
public $commandHandler = null;
2012-06-04 19:22:14 +00:00
/**
* Should HTML be enabled?
*
* @var integer
* @see \chat\system\command\ICommand::SETTING_OFF
* @see \chat\system\command\ICommand::SETTING_ON
2012-06-04 19:22:14 +00:00
*/
2013-01-09 20:34:30 +00:00
public $enableHTML = ICommand::SETTING_OFF;
2012-06-04 19:22:14 +00:00
/**
* Should smilies be enabled?
*
* @var integer
* @see \chat\system\command\ICommand::SETTING_OFF
* @see \chat\system\command\ICommand::SETTING_ON
* @see \chat\system\command\ICommand::SETTING_USER
2012-06-04 19:22:14 +00:00
*/
2013-01-09 20:34:30 +00:00
public $enableSmilies = ICommand::SETTING_OFF;
2012-06-04 19:22:14 +00:00
public function __construct(CommandHandler $commandHandler) {
EventHandler::getInstance()->fireAction($this, 'shouldInit');
$this->commandHandler = $commandHandler;
2012-03-24 21:29:07 +00:00
}
2012-06-04 19:22:14 +00:00
/**
* Fires the didInit-event.
* You should call this when everything is properly inserted.
*/
2012-03-24 21:29:07 +00:00
public function didInit() {
EventHandler::getInstance()->fireAction($this, 'didInit');
}
2012-06-04 19:22:14 +00:00
/**
* Default-Receiver: Everyone
*
* @see \chat\system\command\ICommand::getReceiver()
2012-06-04 19:22:14 +00:00
*/
public function getReceiver() {
return null;
}
/**
* No additionaldata by default.
*/
public function getAdditionalData() {
return null;
}
}