Skip to content

Commit

Permalink
Compatibility with KB v1.2.29
Browse files Browse the repository at this point in the history
  • Loading branch information
creecros committed May 25, 2023
1 parent 8200b2f commit ec80a18
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ public function initialize()
$customizer['login_btn_width'] = $this->configModel->get('login_btn_width', '95');
$customizer['login_note'] = $this->configModel->get('login_note', '');

//Templates and Assets
if (!file_exists('plugins/ApplicationBranding')) {
$this->template->setTemplateOverride('header/title', 'customizer:header/title');
$this->template->setTemplateOverride('layout', 'customizer:layout/layout');
$this->template->setTemplateOverride('auth/index', 'customizer:layout/index');
}

$this->template->hook->attach('template:config:sidebar', 'customizer:config/sidebar');
$this->template->setTemplateOverride('header/user_dropdown', 'customizer:header/user_dropdown');
Expand Down Expand Up @@ -122,6 +116,19 @@ public function initialize()
} else {
$this->template->setTemplateOverride('header/title', 'customizer:header/title_older_kb');
}

//Templates and Assets
if (!file_exists('plugins/ApplicationBranding')) {
$this->template->setTemplateOverride('header/title', 'customizer:header/title');
if (strpos(APP_VERSION, 'master') !== false || strpos(APP_VERSION, 'main') !== false && file_exists('ChangeLog')) { $wasmaster = trim(file_get_contents('ChangeLog', false, null, 8, 6), ' '); }
if (version_compare($wasmaster, '1.2.29') >= 0) {
$this->template->setTemplateOverride('layout', 'customizer:layout/layout_1229');
} else {
$this->template->setTemplateOverride('layout', 'customizer:layout/layout');
}

$this->template->setTemplateOverride('auth/index', 'customizer:layout/index');
}

}

Expand Down
88 changes: 88 additions & 0 deletions Template/layout/layout_1229.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="<?= $this->app->jsLang() ?>">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="referrer" content="no-referrer">

<?php if (isset($board_public_refresh_interval)): ?>
<meta http-equiv="refresh" content="<?= $board_public_refresh_interval ?>">
<?php endif ?>

<?= $this->asset->colorCss() ?>
<?= $this->asset->css('assets/css/vendor.min.css') ?>
<?php if (! isset($not_editable)): ?>
<?= $this->asset->css('assets/css/'.$this->user->getTheme().'.min.css') ?>
<?php else: ?>
<?= $this->asset->css('assets/css/light.min.css') ?>
<?php endif ?>
<?php if (file_exists('assets/css/print.min.css')) :?>
<?= $this->asset->css('assets/css/print.min.css', true, 'print') ?>
<?php endif ?>
<?= $this->asset->customCss() ?>

<?php if (! isset($not_editable)): ?>
<?= $this->asset->js('assets/js/vendor.min.js') ?>
<?= $this->asset->js('assets/js/app.min.js') ?>
<?php endif ?>

<?= $this->hook->asset('css', 'template:layout:css') ?>
<?= $this->hook->asset('js', 'template:layout:js') ?>
<?php if (null !== $this->task->customizerFileModel->getByType(2)) : ?>
<link rel="icon" type="image/png" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<link rel="apple-touch-icon" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<link rel="apple-touch-icon" sizes="72x72" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<link rel="apple-touch-icon" sizes="114x114" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<link rel="apple-touch-icon" sizes="144x144" href="<?= $this->url->href('CustomizerFileController', 'image', array('plugin' => 'customizer', 'file_id' => $this->task->customizerFileModel->getIdByType(2))) ?>">
<?php else: ?>
<link rel="icon" type="image/png" href="<?= $this->url->dir() ?>assets/img/favicon.png">
<link rel="apple-touch-icon" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="72x72" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="114x114" href="<?= $this->url->dir() ?>assets/img/touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="144x144" href="<?= $this->url->dir() ?>assets/img/touch-icon-ipad-retina.png">
<?php endif ?>


<title>
<?php if (isset($page_title)): ?>
<?= $this->text->e($page_title) ?>
<?php elseif (isset($title)): ?>
<?= $this->text->e($title) ?>
<?php else: ?>
Kanboard
<?php endif ?>
</title>

<?= $this->hook->render('template:layout:head') ?>
</head>
<body data-status-url="<?= $this->url->href('UserAjaxController', 'status') ?>"
data-login-url="<?= $this->url->href('AuthController', 'login') ?>"
data-keyboard-shortcut-url="<?= $this->url->href('DocumentationController', 'shortcuts') ?>"
data-timezone="<?= $this->app->getTimezone() ?>"
data-js-date-format="<?= $this->app->getJsDateFormat() ?>"
data-js-time-format="<?= $this->app->getJsTimeFormat() ?>"
data-js-modal-close-msg="<?= t('Close window?\\n\\nChanges that you made have not been saved.') ?>"
>

<?php if (isset($no_layout) && $no_layout): ?>
<?= $this->app->flashMessage() ?>
<?= $content_for_layout ?>
<?php else: ?>
<?= $this->hook->render('template:layout:top') ?>
<?= $this->render('header', array(
'title' => $title,
'description' => isset($description) ? $description : '',
'board_selector' => isset($board_selector) ? $board_selector : array(),
'project' => isset($project) ? $project : array(),
)) ?>
<section class="page">
<?= $this->app->flashMessage() ?>
<?= $content_for_layout ?>
</section>
<?= $this->hook->render('template:layout:bottom') ?>
<?php endif ?>
</body>
</html>

0 comments on commit ec80a18

Please sign in to comment.