diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-03-16 22:12:16 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-03-16 22:12:16 -0400 |
commit | 50f98abfd3a9843c8e4ac0433a4fbf41757be46e (patch) | |
tree | 7e3aea7503f03fd0c9589ae70485e34a6c5ec345 | |
parent | 32fb1f65c5179ba8f7b31374d5311c4110ef6e28 (diff) |
Merge and improve pull-request #666 (custom stylesheet)
-rw-r--r-- | app/Schema/Mysql.php | 8 | ||||
-rw-r--r-- | app/Schema/Postgres.php | 8 | ||||
-rw-r--r-- | app/Schema/Sqlite.php | 8 | ||||
-rw-r--r-- | app/Template/config/application.php | 3 | ||||
-rw-r--r-- | app/Template/layout.php | 4 |
5 files changed, 28 insertions, 3 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index b4db10a4..a78ffacf 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,13 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 53; +const VERSION = 54; + +function version_54($pdo) +{ + $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)'); + $rq->execute(array('application_stylesheet', '')); +} function version_53($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index 331205fa..2396000f 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,13 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 34; +const VERSION = 35; + +function version_35($pdo) +{ + $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)'); + $rq->execute(array('application_stylesheet', '')); +} function version_34($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 551e186e..0e0512d0 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,13 @@ use Core\Security; use PDO; use Model\Link; -const VERSION = 52; +const VERSION = 53; + +function version_53($pdo) +{ + $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)'); + $rq->execute(array('application_stylesheet', '')); +} function version_52($pdo) { diff --git a/app/Template/config/application.php b/app/Template/config/application.php index 26f3743e..f6c9db94 100644 --- a/app/Template/config/application.php +++ b/app/Template/config/application.php @@ -20,6 +20,9 @@ <?= $this->formSelect('application_date_format', $date_formats, $values, $errors) ?><br/> <p class="form-help"><?= t('ISO format is always accepted, example: "%s" and "%s"', date('Y-m-d'), date('Y_m_d')) ?></p> + <?= $this->formLabel(t('Custom Stylesheet'), 'application_stylesheet') ?> + <?= $this->formTextarea('application_stylesheet', $values, $errors) ?><br/> + <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> </div> diff --git a/app/Template/layout.php b/app/Template/layout.php index 9290a21e..68028240 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -17,6 +17,10 @@ <?= $this->css($this->u('app', 'colors'), false) ?> <?= $this->css('assets/css/app.css') ?> + <?php if ($this->config->get('application_stylesheet')): ?> + <style><?= $this->e($this->config->get('application_stylesheet')) ?></style> + <?php endif ?> + <link rel="icon" type="image/png" href="assets/img/favicon.png"> <link rel="apple-touch-icon" href="assets/img/touch-icon-iphone.png"> <link rel="apple-touch-icon" sizes="72x72" href="assets/img/touch-icon-ipad.png"> |