Skip to content

Commit

Permalink
chore: style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
samerton committed Jun 8, 2024
1 parent de7b060 commit 9a1a437
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 26 deletions.
1 change: 0 additions & 1 deletion 403.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @var User $user
* @var Widgets $widgets
*/

header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');

const PAGE = 403;
Expand Down
1 change: 0 additions & 1 deletion 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @var User $user
* @var Widgets $widgets
*/

header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');

const PAGE = 404;
Expand Down
1 change: 0 additions & 1 deletion core/classes/Templates/FakeSmarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* @version 2.2.0
* @deprecated
*/

class FakeSmarty
{
private TemplateEngine $_engine;
Expand Down
2 changes: 1 addition & 1 deletion core/classes/Templates/SmartyTemplateBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract class SmartyTemplateBase extends TemplateBase
* @param string $version
* @param string $nameless_version
* @param string $author
* @param bool $panelTemplate
* @param bool $panelTemplate
*/
public function __construct(string $name, string $version, string $nameless_version, string $author, bool $panelTemplate = false)
{
Expand Down
6 changes: 3 additions & 3 deletions core/classes/Templates/SmartyTemplateEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
* @license MIT
* @version 2.2.0
*/

class SmartyTemplateEngine extends TemplateEngine
{
private Smarty $_smarty;

/**
* @param string $template Template name to load
* @param bool $panelTemplate Whether this is a panel template or not
* @param string $template Template name to load
* @param bool $panelTemplate Whether this is a panel template or not
* @throws SmartyException
*/
public function __construct(string $template, bool $panelTemplate = false)
Expand Down Expand Up @@ -77,6 +76,7 @@ public function fetch(string $templateFile): string
$templateFile = str_replace('.tpl', '', $templateFile);

$this->_smarty->assign($this->getVariables());

return $this->_smarty->fetch("$templateFile.tpl");
}

Expand Down
9 changes: 4 additions & 5 deletions core/classes/Templates/TemplateEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @license MIT
* @version 2.2.0
*/

abstract class TemplateEngine
{
private array $_variables;
Expand All @@ -22,7 +21,7 @@ public function __construct()
* TODO: mixed type for $value
*
* @param string $key
* @param mixed $value
* @param mixed $value
* @return void
*/
public function addVariable(string $key, $value): void
Expand Down Expand Up @@ -67,18 +66,18 @@ public function getVariables(): array
*
* @param string $templateFile Path to template file to render.
*/
public abstract function render(string $templateFile): void;
abstract public function render(string $templateFile): void;

/**
* Fetch a generated template file using the set template engine.
*
* @param string $templateFile Path to template file to render.
* @return string HTML to render
*/
public abstract function fetch(string $templateFile): string;
abstract public function fetch(string $templateFile): string;

/**
* Clear template cache directory.
*/
public abstract function clearCache(): void;
abstract public function clearCache(): void;
}
1 change: 0 additions & 1 deletion core/includes/maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* @var User $user
* @var Widgets $widgets
*/

$pages = new Pages();

const PAGE = 'maintenance';
Expand Down
1 change: 0 additions & 1 deletion core/includes/tfa_signin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* @var User $user
* @var Widgets $widgets
*/

if (isset($_POST['username'])) {
$_SESSION['username'] = $_POST['username'];
} else {
Expand Down
1 change: 0 additions & 1 deletion core/templates/backend_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* @var string $page_title
* @var TemplateBase $template
*/

const BACK_END = true;

if (file_exists(ROOT_PATH . '/custom/panel_templates/' . PANEL_TEMPLATE . '/template.php')) {
Expand Down
1 change: 0 additions & 1 deletion core/templates/cc_navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
* @var Navigation $cc_nav
* @var TemplateBase $template
*/

$template->getEngine()->addVariable('CC_NAV_LINKS', $cc_nav->returnNav());
1 change: 0 additions & 1 deletion core/templates/frontend_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* @var string $page_title
* @var User $user
*/

const FRONT_END = true;

// Set current page URL in session, provided it's not the login page
Expand Down
2 changes: 1 addition & 1 deletion core/templates/panel_navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
'user_title' => Output::getClean($user->data()->user_title),
'avatar' => $user->getAvatar(),
'integrations' => $user_integrations ?? [],
]
],
]);
1 change: 0 additions & 1 deletion custom/panel_templates/Default/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
if (!class_exists('Default_Panel_Template')) {
class Default_Panel_Template extends SmartyTemplateBase
{

private Language $_language;

// Constructor - set template name, version, Nameless version and author here
Expand Down
11 changes: 4 additions & 7 deletions custom/templates/DefaultRevamp/template_settings/settings.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?php
/**
* Default Revamp template settings
* Default Revamp template settings.
*
* @author Samerton
* @version 2.2.0
* @license MIT
*/

/**
* @var Cache $cache
* @var Language $language
*
* @var Cache $cache
* @var Language $language
* @var TemplateBase $current_template
*/

if (Input::exists()) {
if (Token::check()) {
$cache->setCache('template_settings');
Expand Down

0 comments on commit 9a1a437

Please sign in to comment.