Commit | Line | Data |
---|---|---|
11fd4618 MW |
1 | <?php |
2 | namespace wcf\data\box; | |
3 | use wcf\data\DatabaseObjectEditor; | |
4 | ||
5 | /** | |
6 | * Provides functions to edit boxes. | |
7 | * | |
8 | * @author Marcel Werk | |
c839bd49 | 9 | * @copyright 2001-2018 WoltLab GmbH |
11fd4618 | 10 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
e71525e4 MW |
11 | * @package WoltLabSuite\Core\Data\Box |
12 | * @since 3.0 | |
4bef7e27 | 13 | * |
01d8af08 MS |
14 | * @method static Box create(array $parameters = []) |
15 | * @method Box getDecoratedObject() | |
16 | * @mixin Box | |
11fd4618 MW |
17 | */ |
18 | class BoxEditor extends DatabaseObjectEditor { | |
19 | /** | |
20 | * @inheritDoc | |
21 | */ | |
22 | protected static $baseClass = Box::class; | |
95d50edd AE |
23 | |
24 | /** | |
25 | * Creates the template file for "tpl"-type boxes. | |
26 | * | |
27 | * @param integer $languageID | |
28 | * @param string $content | |
29 | */ | |
30 | public function writeTemplate($languageID, $content) { | |
31 | if ($this->getDecoratedObject()->boxType === 'tpl') { | |
32 | file_put_contents(WCF_DIR . 'templates/' . $this->getDecoratedObject()->getTplName(($languageID ?: null)) . '.tpl', $content); | |
33 | } | |
34 | } | |
11fd4618 | 35 | } |