mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Template/Update (Part 8)
* convert maps tool
This commit is contained in:
31
endpoints/maps/maps.php
Normal file
31
endpoints/maps/maps.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class MapsBaseResponse extends TemplateResponse
|
||||
{
|
||||
protected int $cacheType = CACHE_TYPE_PAGE;
|
||||
|
||||
protected string $template = 'maps';
|
||||
protected string $pageName = 'maps';
|
||||
protected ?int $activeTab = parent::TAB_TOOLS;
|
||||
protected array $breadcrumb = [1, 1];
|
||||
|
||||
protected array $dataLoader = ['zones'];
|
||||
protected array $scripts = [[SC_JS_FILE, 'js/maps.js'], [SC_CSS_STRING, 'zone-picker { margin-left: 4px }']];
|
||||
|
||||
protected function generate() : void
|
||||
{
|
||||
$this->h1 = Lang::maps('maps');
|
||||
|
||||
array_unshift($this->title, $this->h1);
|
||||
|
||||
parent::generate();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Aowow;
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
// tabId 1: Tools g_initHeader()
|
||||
class MapsPage extends GenericPage
|
||||
{
|
||||
protected $tpl = 'maps';
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 1];
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/maps.js'],
|
||||
[SC_CSS_STRING, 'zone-picker { margin-left: 4px }']
|
||||
);
|
||||
|
||||
public function __construct($pageCall, $__)
|
||||
{
|
||||
parent::__construct($pageCall, $__);
|
||||
|
||||
$this->name = Lang::maps('maps');
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
// add conditional js
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
{
|
||||
array_unshift($this->title, $this->name);
|
||||
}
|
||||
|
||||
protected function generatePath() {}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,7 +1,10 @@
|
||||
<?php namespace Aowow; ?>
|
||||
<?php
|
||||
namespace Aowow\Template;
|
||||
|
||||
<?php $this->brick('header'); ?>
|
||||
use \Aowow\Lang;
|
||||
|
||||
$this->brick('header');
|
||||
?>
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
||||
Reference in New Issue
Block a user