88 lines
2.1 KiB
PHP
88 lines
2.1 KiB
PHP
<?php
|
|
|
|
class defaultTheme extends Plugin
|
|
{
|
|
|
|
public function init()
|
|
{
|
|
$this->dbFields = array(
|
|
'showDefaultThumbnail' => false,
|
|
'dateFormat' => 'relative',
|
|
'accentColor' => 'default',
|
|
'background' => '',
|
|
'backgroundTiled' => true,
|
|
'banner' => '',
|
|
'smallThumb' => false,
|
|
'bannerTiled' => false
|
|
);
|
|
}
|
|
|
|
public function form()
|
|
{
|
|
$html = '';
|
|
|
|
$html .= PluginSettings::medias($this, 'background', 'Blog background');
|
|
$html .= PluginSettings::bool($this, 'backgroundTiled', 'Tiled blog background');
|
|
$html .= PluginSettings::medias($this, 'banner', 'Banner background');
|
|
$html .= PluginSettings::bool($this, 'bannerTiled', 'Tiled Banner background');
|
|
|
|
$html .= PluginSettings::bool($this, 'showDefaultThumbnail', 'Show Default Thumbnail');
|
|
$html .= PluginSettings::bool($this, 'smallThumb', 'Small Thumbnail');
|
|
$html .= PluginSettings::values($this,'dateFormat', 'Date format', ['noshow'=>'No show', 'relative'=>'Relative', 'absolute'=>'Absolute'], 'Change the date format for the main page.');
|
|
$html .= PluginSettings::values($this,'accentColor', 'Accent Color', [
|
|
'default'=>'Blue',
|
|
'red'=>'Red',
|
|
'pink'=>'Pink',
|
|
'grape'=>'Grape',
|
|
'violet'=>'Violet',
|
|
'indigo'=>'Indigo',
|
|
'cyan'=>'Cyan',
|
|
'teal'=>'Teal',
|
|
'green'=>'Green',
|
|
'lime'=>'Lime',
|
|
'yellow'=>'Yellow',
|
|
'orange'=>'Orange'
|
|
], 'Change the accent color on the whole theme.');
|
|
|
|
return $html;
|
|
}
|
|
|
|
public function smallThumb()
|
|
{
|
|
return $this->getValue('smallThumb');
|
|
}
|
|
|
|
public function showDefaultThumbnail()
|
|
{
|
|
return $this->getValue('showDefaultThumbnail');
|
|
}
|
|
|
|
public function dateFormat()
|
|
{
|
|
return $this->getValue('dateFormat');
|
|
}
|
|
|
|
public function haveBanner() {
|
|
return ($this->getValue('banner') != '');
|
|
}
|
|
|
|
public function haveBackground() {
|
|
return ($this->getValue('background') != '');
|
|
}
|
|
|
|
public function bannerURI()
|
|
{
|
|
if ($this->getValue('banner') == '') {
|
|
return '';
|
|
}
|
|
return new Media($this->getValue('banner'))->permalink();
|
|
}
|
|
|
|
public function backgroundURI()
|
|
{
|
|
if ($this->getValue('background') == '') {
|
|
return '';
|
|
}
|
|
return new Media($this->getValue('background'))->permalink();
|
|
}
|
|
}
|