From a64af357ff41a61f5248e2052274315b390e979c Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sun, 11 Nov 2018 22:04:49 +0100 Subject: clean --- app/class/model.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'app/class/model.php') diff --git a/app/class/model.php b/app/class/model.php index 3f4be4a..d7f34da 100644 --- a/app/class/model.php +++ b/app/class/model.php @@ -3,16 +3,34 @@ class Model { const CONFIG_FILE = 'config.json'; - const GLOBAL_CSS_DIR = '.' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'global' . DIRECTORY_SEPARATOR . 'global.css'; + const CSS_DIR = 'assets' . DIRECTORY_SEPARATOR .'css' . DIRECTORY_SEPARATOR; const MEDIA_DIR = '.' . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR; const TEMPLATES_DIR = '.'. DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'view' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR; - const RENDER_DIR = '.'. DIRECTORY_SEPARATOR . 'assets'. DIRECTORY_SEPARATOR . 'render' . DIRECTORY_SEPARATOR; + const RENDER_DIR = 'assets'. DIRECTORY_SEPARATOR . 'render' . DIRECTORY_SEPARATOR; const DATABASE_DIR = '.' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR; const MEDIA_EXTENSIONS = array('jpeg', 'jpg', 'JPG', 'png', 'gif', 'mp3', 'mp4', 'mov', 'wav', 'flac', 'pdf'); const MEDIA_TYPES = ['image', 'video', 'sound', 'other']; const TEXT_ELEMENTS = ['header', 'nav', 'section', 'aside', 'footer']; + public static function renderpath() + { + $basepath = ''; + if(!empty(Config::basepath())) { + $basepath = Config::basepath() . DIRECTORY_SEPARATOR ; + } + return DIRECTORY_SEPARATOR . $basepath . Model::RENDER_DIR; + } + + public static function csspath() + { + $basepath = ''; + if(!empty(Config::basepath())) { + $basepath = Config::basepath() . DIRECTORY_SEPARATOR ; + } + return DIRECTORY_SEPARATOR . $basepath . Model::CSS_DIR; + } + } -- cgit v1.2.3