diff options
-rw-r--r-- | app/class/config.php | 31 | ||||
-rw-r--r-- | app/class/media.php | 34 | ||||
-rw-r--r-- | app/class/model.php | 1 | ||||
-rw-r--r-- | app/view/templates/admin.php | 24 | ||||
-rw-r--r-- | app/view/templates/alert.php | 5 | ||||
-rw-r--r-- | app/view/templates/media.php | 16 | ||||
-rw-r--r-- | app/view/templates/read.php | 12 | ||||
-rw-r--r-- | composer.json | 2 |
8 files changed, 34 insertions, 91 deletions
diff --git a/app/class/config.php b/app/class/config.php index 71ce329..26adf62 100644 --- a/app/class/config.php +++ b/app/class/config.php @@ -22,8 +22,6 @@ abstract class Config protected static $defaultbody = '%HEADER%'. PHP_EOL .PHP_EOL . '%NAV%'. PHP_EOL .PHP_EOL . '%ASIDE%'. PHP_EOL .PHP_EOL . '%MAIN%'. PHP_EOL .PHP_EOL . '%FOOTER%'; protected static $defaultart = ''; protected static $defaultfavicon = ''; - protected static $showeditmenu = true; - protected static $editsymbol = 'pen'; protected static $analytics = ''; protected static $externallinkblank = true; protected static $internallinkblank = false; @@ -204,16 +202,6 @@ abstract class Config return self::$defaultfavicon; } - public static function showeditmenu() - { - return self::$showeditmenu; - } - - public static function editsymbol() - { - return self::$editsymbol; - } - public static function analytics() { return self::$analytics; @@ -375,25 +363,6 @@ abstract class Config } } - public static function setshoweditmenu($showeditmenu) - { - if(is_bool($showeditmenu)) { - self::$showeditmenu = $showeditmenu; - } elseif (is_string($showeditmenu)) { - if($showeditmenu === 'on') { - self::$showeditmenu = true; - } - } - } - - public static function seteditsymbol($editsymbol) - { - if(is_string($editsymbol)) - { - self::$editsymbol = $editsymbol; - } - } - public static function setanalytics($analytics) { if(is_string($analytics) && strlen($analytics) < 25) { diff --git a/app/class/media.php b/app/class/media.php index eccc58b..f48c3b9 100644 --- a/app/class/media.php +++ b/app/class/media.php @@ -12,7 +12,7 @@ class Media private $length; const IMAGE = array('jpg', 'jpeg', 'gif', 'png'); - const SOUND = array('mp3', 'flac'); + const SOUND = array('mp3', 'flac', 'wav', 'ogg'); const VIDEO = array('mp4', 'mov', 'avi', 'mkv'); @@ -79,6 +79,36 @@ class Media return $this->path . $this->id . '.' . $this->extension; } + /** + * Generate html code depending on media type + * + * @return string html code + */ + public function getcode() : string + { + switch ($this->type) { + case 'image': + $code = ' . ')'; + break; + + case 'other': + $code = '[' . $this->id . '](' . $this->getincludepath() . ')'; + break; + + case 'sound': + $code = '<audio controls src="' . $this->getincludepath() . '"></audio>'; + break; + + case 'video': + $code = '<video controls src="' . $this->getincludepath() . '"><video/>'; + break; + + } + + return $code; + + } + // _________________________________________________ G E T ____________________________________________________ @@ -199,5 +229,3 @@ class Media } - -?>
\ No newline at end of file diff --git a/app/class/model.php b/app/class/model.php index 5815861..6f5a62d 100644 --- a/app/class/model.php +++ b/app/class/model.php @@ -21,7 +21,6 @@ abstract class Model const COLUMNS = ['id', 'title', 'description', 'tag', 'date', 'datemodif', 'datecreation', 'secure', 'linkfrom', 'linkto', 'visitcount', 'affcount', 'editcount']; const TEXT_ELEMENTS = ['header', 'nav', 'main', 'aside', 'footer']; - const EDIT_SYMBOLS = ['pen', 'tool', 'none']; const MAX_ID_LENGTH = 64; const PASSWORD_HASH = true; diff --git a/app/view/templates/admin.php b/app/view/templates/admin.php index 97442ac..c1f3b73 100644 --- a/app/view/templates/admin.php +++ b/app/view/templates/admin.php @@ -204,30 +204,6 @@ <i>(This modifications need re-rendering)</i> - <h4>Edit quick menu</h4> - - <div class="checkbox"> - <input type="hidden" name="showeditmenu" value="false"> - <input type="checkbox" name="showeditmenu" id="showeditmenu" value="true" <?= Config::showeditmenu() === true ? 'checked' : '' ?>> - <label for="showeditmenu">Show editor menu in top right corner of pages</label> - </div> - - <?php - if (Config::showeditmenu() === true) { - ?> - <label for="editsymbol">Symbol</label> - <select name="editsymbol" id="editsymbol"> - <?php - foreach (Model::EDIT_SYMBOLS as $symbol) { - ?> - <option value="<?= $symbol ?>" <?= Config::editsymbol() === $symbol ? 'selected' : '' ?>><?= $symbol ?></option> - <?php - } - ?> - </select> - <?php - } - ?> </article> diff --git a/app/view/templates/alert.php b/app/view/templates/alert.php index 0adfc9a..24f77ed 100644 --- a/app/view/templates/alert.php +++ b/app/view/templates/alert.php @@ -23,12 +23,7 @@ $this->stop(); <main class="alert"> - <?php - if ($readernav) { - $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist, 'canedit' => $canedit]); - } - ?> diff --git a/app/view/templates/media.php b/app/view/templates/media.php index 0f60368..ecd61b8 100644 --- a/app/view/templates/media.php +++ b/app/view/templates/media.php @@ -141,21 +141,7 @@ foreach ($medialist as $media) { <td><?= $media->width() ?></td> <td><?= $media->height() ?></td> <td><?= $media->length() ?></td> - <td class="code"><code> - <?php - if($media->type() == 'image') { - ?> -  ?>) - <?php - } elseif ($media->type() == 'other') { - ?> - [<?= $media->id() ?>](<?= $media->getincludepath() ?>) - <?php - } else { - echo $media->getincludepath(); - } - ?> - </code></td> + <td class="code"><code><?= $media->getcode() ?></code></td> </tr> <?php diff --git a/app/view/templates/read.php b/app/view/templates/read.php index 54b137e..27c3d87 100644 --- a/app/view/templates/read.php +++ b/app/view/templates/read.php @@ -15,17 +15,7 @@ $this->stop(); <body> - - <?php - if ($readernav) { - $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist, 'canedit' => $canedit]); - } - - - - echo $body; - - ?> +<?= $body ?> </body> diff --git a/composer.json b/composer.json index 78bb37e..72053b6 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "w-cms", "description": "point'n think", - "version": "1.5.6", + "version": "1.5.7", "require": { "michelf/php-markdown": "^1.8", "league/plates": "3.*", |