1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00
Tims-Chat/file/acp/be.bastelstu.chat.install.php

61 lines
1.5 KiB
PHP
Raw Normal View History

2012-10-15 10:14:41 +00:00
<?php
2013-05-24 00:21:49 +00:00
namespace be\bastelstu\chat;
2012-10-15 10:14:41 +00:00
/**
* Handles installation of Tims Chat.
*
* @author Tim Düsterhus
2014-02-27 22:05:09 +00:00
* @copyright 2010-2014 Tim Düsterhus
2012-10-15 10:14:41 +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-10-15 10:14:41 +00:00
*/
2012-12-20 17:46:38 +00:00
// @codingStandardsIgnoreFile
2012-10-15 10:14:41 +00:00
final class Install {
/**
* Contains all the styles the current installation has.
*
* @var array<\wcf\data\style\Style>
*/
private $styles = null;
2013-10-06 14:30:18 +00:00
/**
* Do we need to update the page title?
*
* @var boolean
*/
private $updateTitle = false;
2012-10-15 10:14:41 +00:00
public function __construct() {
$this->styles = \wcf\system\style\StyleHandler::getInstance()->getAvailableStyles();
2013-10-06 14:30:18 +00:00
if (!defined('PAGE_TITLE') || !PAGE_TITLE) $this->updateTitle = true;
2012-10-15 10:14:41 +00:00
}
/**
* Resets styles.
*/
public function execute() {
foreach ($this->styles as $style) {
\wcf\system\style\StyleHandler::getInstance()->resetStylesheet($style);
}
2013-10-06 14:30:18 +00:00
if ($this->updateTitle) {
$sql = "UPDATE
wcf".WCF_N."_option
SET
optionValue = ?
WHERE
optionName = ?";
$stmt = \wcf\system\WCF::getDB()->prepareStatement($sql);
$stmt->execute(array('Tims Chat 3', 'page_title'));
\wcf\data\option\OptionEditor::resetCache();
}
\wcf\system\dashboard\DashboardHandler::setDefaultValues('com.woltlab.wcf.user.DashboardPage', array(
// content
'be.bastelstu.chat.onlineList' => 1
));
2012-10-15 10:14:41 +00:00
}
}
$install = new Install();
$install->execute();