2011-12-27 12:58:28 +00:00
|
|
|
<?php
|
2012-03-24 21:37:47 +00:00
|
|
|
namespace wcf\system\chat\command;
|
2011-12-27 12:58:28 +00:00
|
|
|
use \wcf\system\event\EventHandler;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Default implementation for commands.
|
|
|
|
*
|
|
|
|
* @author Tim Düsterhus
|
2013-01-19 19:36:40 +00:00
|
|
|
* @copyright 2010-2013 Tim Düsterhus
|
2011-12-27 12:58:28 +00:00
|
|
|
* @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
|
2012-03-24 21:37:47 +00:00
|
|
|
* @subpackage system.chat.command
|
2011-12-27 12:58:28 +00:00
|
|
|
*/
|
|
|
|
abstract class AbstractCommand implements ICommand {
|
2012-06-04 19:22:14 +00:00
|
|
|
/**
|
|
|
|
* Instance of the CommandHandler
|
|
|
|
*
|
|
|
|
* @var \wcf\system\chat\command\CommandHandler
|
|
|
|
*/
|
2011-12-27 12:58:28 +00:00
|
|
|
public $commandHandler = null;
|
2012-06-04 19:22:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Should HTML be enabled?
|
|
|
|
*
|
|
|
|
* @var integer
|
2013-01-09 20:34:30 +00:00
|
|
|
* @see \wcf\system\chat\command\ICommand::SETTING_OFF
|
|
|
|
* @see \wcf\system\chat\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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Should BBCodes be enabled?
|
|
|
|
*
|
|
|
|
* @var integer
|
|
|
|
* @see \wcf\system\chat\command\ICommand::SETTING_OFF
|
|
|
|
* @see \wcf\system\chat\command\ICommand::SETTING_ON
|
|
|
|
* @see \wcf\system\chat\command\ICommand::SETTING_USER
|
|
|
|
*/
|
|
|
|
public $enableBBCodes = ICommand::SETTING_OFF;
|
2011-12-27 12:58:28 +00:00
|
|
|
|
2012-06-04 19:22:14 +00:00
|
|
|
/**
|
|
|
|
* Should smilies be enabled?
|
|
|
|
*
|
|
|
|
* @var integer
|
2013-01-09 20:34:30 +00:00
|
|
|
* @see \wcf\system\chat\command\ICommand::SETTING_OFF
|
|
|
|
* @see \wcf\system\chat\command\ICommand::SETTING_ON
|
|
|
|
* @see \wcf\system\chat\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
|
|
|
|
2011-12-27 12:58:28 +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() {
|
2011-12-27 12:58:28 +00:00
|
|
|
EventHandler::getInstance()->fireAction($this, 'didInit');
|
|
|
|
}
|
2011-12-27 13:34:42 +00:00
|
|
|
|
2012-06-04 19:22:14 +00:00
|
|
|
/**
|
|
|
|
* Default-Receiver: Everyone
|
|
|
|
*
|
|
|
|
* @see \wcf\system\chat\command\ICommand::getReceiver()
|
|
|
|
*/
|
2011-12-27 13:34:42 +00:00
|
|
|
public function getReceiver() {
|
|
|
|
return null;
|
|
|
|
}
|
2011-12-27 12:58:28 +00:00
|
|
|
}
|