<?php
namespace App\Dashboard\Templates\Home; class Sysadmin extends \App\Dashboard\Templates\BaseAbstract { public function configureDashboard() { $t1c = new \Engine\Dashboard\Containers\Table1Col(); $t1c->setTitle($this->getName()); $this->dashboard->appendElement($t1c); $serverCurrentInfo = new \App\Dashboard\Widget\ServerCurrentInfo(); $serverLoadLogs = new \App\Dashboard\Widget\ServerLoadLogs(); $diskFreeSpace = new \App\Dashboard\Widget\DiskFreeSpace(); $t1c->appendElement($serverCurrentInfo, 0); $t1c->appendElement($serverLoadLogs, 0); $t1c->appendElement($diskFreeSpace, 0); } public function getDescription() { \App\Loader_Lang::getInstance()->loadAppFile("_customLoad/dashboard/dashboard/_general.lang.php"); $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); $widgetNames = []; foreach ($this->dashboard->getContentLinear()[0]->getContentLinear() as $widget) { $widgetNames[] = $widget->getTitle(); } $widgetNamesStr = implode(", ", $widgetNames); $link = \Engine\Mvc\Dispatcher::getInstance()->getAppUrl('Modules/Home', 'selectFirstTemplate', [ 'template' => addslashes('\\'.__CLASS__), ]); $description = <<<HTML
			<div class="tplRow">
				<div class="tplCol">
					<img src="Modules/Home/View/_img/Sysadmin.png" onclick="requestChangeTemplate('{$link}');" style="cursor:pointer;" tooltip="{$_LANG['dashboard']['tooltips']['selectTemplate']}" />
				</div>
				<div class="tplCol">
					<a onclick="requestChangeTemplate('{$link}');" class="tplLink" href="javascript:;" tooltip="{$_LANG['dashboard']['tooltips']['selectTemplate']}">{$this->getName()}</a>

					<div class="text"><b>{$_LANG['dashboard']['templates']['general']['who']}</b></div>
					<div class="text"><b>{$_LANG['dashboard']['templates']['\\'.__CLASS__]['who']}</b></div>
					<div class="text">{$_LANG['dashboard']['templates']['\\'.__CLASS__]['description']}</div>
				</div>
			</div>
			<div class="tplRow">
				<div class="tplCol">
					<div class="text"><b>{$_LANG['dashboard']['templates']['general']['widgets']}</b></div>
					<div class="text">{$widgetNamesStr}.</div>
				</div>
			</div>
HTML;
return $description; } } 