aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/class/controllerfont.php6
-rw-r--r--app/class/modelfont.php10
2 files changed, 14 insertions, 2 deletions
diff --git a/app/class/controllerfont.php b/app/class/controllerfont.php
index 7a59cd6..8f87e3a 100644
--- a/app/class/controllerfont.php
+++ b/app/class/controllerfont.php
@@ -2,7 +2,9 @@
class Controllerfont extends Controller
{
-
+ /**
+ * @var Modelfont
+ */
protected $fontmanager;
public function __construct($router)
@@ -16,6 +18,8 @@ class Controllerfont extends Controller
{
if($this->user->iseditor()) {
+ $this->fontmanager->fontdircheck();
+
$fontlist = $this->fontmanager->getfontlist();
$this->showtemplate('font', ['fontlist' => $fontlist, 'fonttypes' => $this->fontmanager->getfonttypes(), 'fontfile' => Model::globalpath().'fonts.css']);
diff --git a/app/class/modelfont.php b/app/class/modelfont.php
index 213da11..8e7645e 100644
--- a/app/class/modelfont.php
+++ b/app/class/modelfont.php
@@ -4,7 +4,15 @@ class Modelfont extends Model
{
const FONT_TYPES = ['woff2', 'woff', 'otf', 'ttf', 'eot', 'svg'];
-
+
+ public function fontdircheck()
+ {
+ if(!is_dir(Model::FONT_DIR)) {
+ return mkdir(Model::FONT_DIR);
+ } else {
+ return true;
+ }
+ }
public function getfontlist()
{