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/backrouter.php | 8 +- app/class/controller.php | 9 ++ app/class/controllerart.php | 38 +++--- app/class/model.php | 22 +++- app/class/modelrender.php | 225 ++++++++++++++++++----------------- app/class/routes.php | 12 +- app/class/sleekdbw.php | 180 ---------------------------- app/view/templates/body.php | 0 app/view/templates/confirmdelete.php | 44 +++++++ app/view/templates/connect.php | 2 +- app/view/templates/delete.php | 44 ------- app/view/templates/edit.php | 5 +- app/view/templates/editrightbar.php | 2 +- app/view/templates/edittopbar.php | 15 ++- app/view/templates/home.php | 10 +- app/view/templates/layout.php | 2 +- app/view/templates/navart.php | 4 +- app/view/templates/read.php | 6 +- app/view/templates/readcreate.php | 5 - 19 files changed, 250 insertions(+), 383 deletions(-) delete mode 100644 app/class/sleekdbw.php delete mode 100644 app/view/templates/body.php create mode 100644 app/view/templates/confirmdelete.php delete mode 100644 app/view/templates/delete.php delete mode 100644 app/view/templates/readcreate.php (limited to 'app') diff --git a/app/class/backrouter.php b/app/class/backrouter.php index bcd1202..356a021 100644 --- a/app/class/backrouter.php +++ b/app/class/backrouter.php @@ -4,6 +4,7 @@ class Backrouter { protected $route; + protected $altorouter; const ROUTES = [ 'art' => ['art', 'read'], @@ -35,6 +36,11 @@ class Backrouter 'aff=co' => ['connect', 'desktop'], ]; + public function __construct($router) + { + $this->altorouter = $router; + } + public function run() { if($this->matchroute()) { $this->callmethod(); @@ -57,7 +63,7 @@ class Backrouter $class = 'controller' . $method[0]; $function = $method[1]; - $controller = new $class($this->route->id()); + $controller = new $class($this->altorouter); $params = array_slice($method, 2); $controller->$function(...$params); } diff --git a/app/class/controller.php b/app/class/controller.php index afeefb0..db13d5a 100644 --- a/app/class/controller.php +++ b/app/class/controller.php @@ -28,6 +28,9 @@ class Controller $this->plates->registerFunction('url', function (string $string, array $vars = []) use ($router) { return $router->generate($string, $vars); }); + $this->plates->registerFunction('uart', function (string $string, string $id) use ($router) { + return $router->generate($string, ['art' => $id]); + }); } public function useriseditor() @@ -57,6 +60,7 @@ class Controller $commonsparams = []; $commonsparams['router'] = $this->router; $commonsparams['user'] = $this->user; + $commonsparams['css'] = Model::csspath(); return $commonsparams; } @@ -92,6 +96,11 @@ class Controller header('Location: ' . $url); } + public function routedirect(string $route, array $vars = []) + { + $this->redirect($this->router->generate($route, $vars)); + } + } diff --git a/app/class/controllerart.php b/app/class/controllerart.php index 9143375..0010f33 100644 --- a/app/class/controllerart.php +++ b/app/class/controllerart.php @@ -86,7 +86,7 @@ class Controllerart extends Controller $artlist = $this->artmanager->list(); - if(isset($_SESSION['workspace'])) { + if (isset($_SESSION['workspace'])) { $showleftpanel = $_SESSION['workspace']['showleftpanel']; $showrightpanel = $_SESSION['workspace']['showrightpanel']; } else { @@ -97,7 +97,7 @@ class Controllerart extends Controller $this->showtemplate('edit', ['art' => $this->art, 'artexist' => true, 'tablist' => $tablist, 'artlist' => $artlist, 'showleftpanel' => $showleftpanel, 'showrightpanel' => $showrightpanel]); } else { - $this->redirect('?id=' . $this->art->id()); + $this->routedirect('artread/', ['art' => $this->art->id()]); } } @@ -112,25 +112,35 @@ class Controllerart extends Controller public function add($id) { $this->setart($id); - $this->art->reset(); - $this->artmanager->add($this->art); - $this->redirect('?id=' . $this->art->id() . '&aff=edit'); + if ($this->user->canedit() && !$this->importart()) { + $this->art->reset(); + $this->artmanager->add($this->art); + $this->routedirect('artedit', ['art' => $this->art->id()]); + } else { + $this->routedirect('artread/', ['art' => $this->art->id()]); + } } - public function delete($id) + public function confirmdelete($id) { $this->setart($id); if ($this->user->canedit() && $this->importart()) { - if (isset($_POST['deleteconfirm']) && $_POST['deleteconfirm'] == true) { - $this->artmanager->delete($this->art); - $this->redirect('?id=' . $this->art->id()); - } else { - $this->showtemplate('delete', ['art' => $this->art, 'artexist' => true]); - } + $this->showtemplate('confirmdelete', ['art' => $this->art, 'artexist' => true]); + } else { - $this->redirect('?id=' . $this->art->id()); + $this->routedirect('artread/', ['art' => $this->art->id()]); + } + } + + public function delete($id) + { + $this->setart($id); + if ($this->user->canedit() && $this->importart()) { + + $this->artmanager->delete($this->art); } + $this->routedirect('backrouter'); } public function update($id) @@ -146,7 +156,7 @@ class Controllerart extends Controller } - $this->redirect('?id=' . $this->art->id() . '&aff=edit'); + $this->routedirect('artupdate', ['art' => $this->art->id()]); 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; + } + } diff --git a/app/class/modelrender.php b/app/class/modelrender.php index e2f6495..ed50893 100644 --- a/app/class/modelrender.php +++ b/app/class/modelrender.php @@ -12,7 +12,7 @@ class Modelrender extends Modelart public function renderhead(Art2 $art) { - + $head = $this->gethead($art); $this->write($art); return $head; @@ -39,7 +39,7 @@ class Modelrender extends Modelart $text = $art->$element(); } $elements[$element] = PHP_EOL . '<' . $element . '>' . PHP_EOL . $this->markdown($text) . PHP_EOL . '' . PHP_EOL; - + } return $elements; @@ -59,7 +59,7 @@ class Modelrender extends Modelart public function getbody(string $html, array $elements) { - $html = preg_replace_callback('~\%(SECTION|ASIDE|NAV|HEADER|FOOTER)\%~', function ($match) use ($elements) { + $html = preg_replace_callback('~\%(SECTION|ASIDE|NAV|HEADER|FOOTER)\%~', function ($match) use ($elements) { return $elements[strtolower($match[1])]; }, $html); return $html; @@ -89,184 +89,187 @@ class Modelrender extends Modelart } + + public function gethead(Art2 $art) { $head = ''; $head .= '' . PHP_EOL; - $head .= ''.$art->title() .'' . PHP_EOL; - $head .= '' . PHP_EOL; + $head .= '' . $art->title() . '' . PHP_EOL; + $head .= '' . PHP_EOL; $head .= '' . PHP_EOL; if (isset($art->template('array')['quickcss'])) { $tempaltequickcssart = $art->template('array')['quickcss']; - $head .= '' . PHP_EOL; + $head .= '' . PHP_EOL; } - $head .= '' . PHP_EOL; + $head .= '' . PHP_EOL; + if (isset($art->template('array')['css'])) { $tempaltecssart = $art->template('array')['css']; - $head .= '' . PHP_EOL; + $head .= '' . PHP_EOL; } - $head .= '' . PHP_EOL; - + $head .= '' . PHP_EOL; + if (isset($art->template('array')['javascript'])) { $templatejsart = $art->template('array')['javascript']; - $head .= '' . PHP_EOL; + $head .= '' . PHP_EOL; } - $head .= '' . PHP_EOL; + $head .= '' . PHP_EOL; return $head; -} + } -public function elementsrender(Art2 $art) -{ - foreach ($this->getelements($art) as $element => $text) { - if (in_array($element, self::TEXT_ELEMENTS)) { - $elements[$element] = $this->markdown($text); + public function elementsrender(Art2 $art) + { + foreach ($this->getelements($art) as $element => $text) { + if (in_array($element, self::TEXT_ELEMENTS)) { + $elements[$element] = $this->markdown($text); + } } + return $elements; } - return $elements; -} -public function parser(Art2 $art, string $text) -{ - $text = str_replace('%TITLE%', $art->title(), $text); - $text = str_replace('%DESCRIPTION%', $art->description(), $text); + public function parser(Art2 $art, string $text) + { + $text = str_replace('%TITLE%', $art->title(), $text); + $text = str_replace('%DESCRIPTION%', $art->description(), $text); - $text = str_replace(self::SUMMARY, $this->sumparser($text), $text); + $text = str_replace(self::SUMMARY, $this->sumparser($text), $text); - $text = str_replace('href="=', 'href="?id=', $text); + $text = str_replace('href="=', 'href="?id=', $text); - $text = $this->tooltip($art->linkfrom('array'), $text); + $text = $this->tooltip($art->linkfrom('array'), $text); - $text = str_replace('href="http', ' class="external" target="_blank" href="http', $text); - $text = str_replace('$3', $text); - return $text; -} + public function autourl($text) + { + $text = preg_replace('#( |\R|>)(https?:\/\/((\S+)\.([^< ]+)))#', '$1$3', $text); + return $text; + } -public function markdown($text) -{ + public function markdown($text) + { //use Michelf\MarkdownExtra; - $fortin = new Michelf\MarkdownExtra; + $fortin = new Michelf\MarkdownExtra; // id in headers - $fortin->header_id_func = function ($header) { - return preg_replace('/[^\w]/', '', strtolower($header)); - }; - $fortin->hard_wrap = true; - $text = $fortin->transform($text); - return $text; -} + $fortin->header_id_func = function ($header) { + return preg_replace('/[^\w]/', '', strtolower($header)); + }; + $fortin->hard_wrap = true; + $text = $fortin->transform($text); + return $text; + } -public function tooltip(array $linkfrom, string $text) -{ - $descriptions = []; - $artlist = $this->getlisterid($linkfrom); - foreach ($artlist as $art) { - $descriptions[$art->id()] = $art->description(); - } + public function tooltip(array $linkfrom, string $text) + { + $descriptions = []; + $artlist = $this->getlisterid($linkfrom); + foreach ($artlist as $art) { + $descriptions[$art->id()] = $art->description(); + } - foreach ($linkfrom as $id) { - if (isset($descriptions[$id])) { - $linkfrom = 'href="?id=' . $id . '"'; - $titlelinkfrom = ' title="' . $descriptions[$id] . '" ' . $linkfrom; - $text = str_replace($linkfrom, $titlelinkfrom, $text); + foreach ($linkfrom as $id) { + if (isset($descriptions[$id])) { + $linkfrom = 'href="?id=' . $id . '"'; + $titlelinkfrom = ' title="' . $descriptions[$id] . '" ' . $linkfrom; + $text = str_replace($linkfrom, $titlelinkfrom, $text); + } } + return $text; } - return $text; -} -function sumparser($text) -{ - preg_match_all('#(.+)#iU', $text, $out); + function sumparser($text) + { + preg_match_all('#(.+)#iU', $text, $out); - $sum = []; - foreach ($out[2] as $key => $value) { - $sum[$value][$out[1][$key]] = $out[3][$key]; - } + $sum = []; + foreach ($out[2] as $key => $value) { + $sum[$value][$out[1][$key]] = $out[3][$key]; + } - $sumstring = ''; - $last = 0; - foreach ($sum as $title => $list) { - foreach ($list as $h => $link) { - if ($h > $last) { - for ($i = 1; $i <= ($h - $last); $i++) { - $sumstring .= '
    '; - } - $sumstring .= '
  • ' . $link . '
  • '; - } elseif ($h < $last) { - for ($i = 1; $i <= ($last - $h); $i++) { - $sumstring .= '
'; + $sumstring = ''; + $last = 0; + foreach ($sum as $title => $list) { + foreach ($list as $h => $link) { + if ($h > $last) { + for ($i = 1; $i <= ($h - $last); $i++) { + $sumstring .= '
    '; + } + $sumstring .= '
  • ' . $link . '
  • '; + } elseif ($h < $last) { + for ($i = 1; $i <= ($last - $h); $i++) { + $sumstring .= '
'; + } + $sumstring .= '
  • ' . $link . '
  • '; + } elseif ($h = $last) { + $sumstring .= '
  • ' . $link . '
  • '; } - $sumstring .= '
  • ' . $link . '
  • '; - } elseif ($h = $last) { - $sumstring .= '
  • ' . $link . '
  • '; + $last = $h; } - $last = $h; } + for ($i = 1; $i <= ($last); $i++) { + $sumstring .= ''; + } + return $sumstring; } - for ($i = 1; $i <= ($last); $i++) { - $sumstring .= ''; - } - return $sumstring; -} //tag auto menu -public function autotaglist() -{ - $pattern = "/%%(\w*)%%/"; - preg_match_all($pattern, $this->md(), $out); - return $out[1]; + public function autotaglist() + { + $pattern = "/%%(\w*)%%/"; + preg_match_all($pattern, $this->md(), $out); + return $out[1]; -} + } -public function autotaglistupdate($taglist) -{ - foreach ($taglist as $tag => $artlist) { - $replace = '
      '; - foreach ($artlist as $art) { - $replace .= '
    • ' . $art->title() . '
    • '; + public function autotaglistupdate($taglist) + { + foreach ($taglist as $tag => $artlist) { + $replace = ''; + $text = str_replace('%%' . $tag . '%%', $replace, $text); } - $replace .= '
    '; - $text = str_replace('%%' . $tag . '%%', $replace, $text); } -} -public function autotaglistcalc($taglist) -{ - foreach ($taglist as $tag => $artlist) { - foreach ($artlist as $art) { - if (!in_array($art->id(), $this->linkfrom('array')) && $art->id() != $this->id()) { - $this->linkfrom[] = $art->id(); + public function autotaglistcalc($taglist) + { + foreach ($taglist as $tag => $artlist) { + foreach ($artlist as $art) { + if (!in_array($art->id(), $this->linkfrom('array')) && $art->id() != $this->id()) { + $this->linkfrom[] = $art->id(); + } } } } -} diff --git a/app/class/routes.php b/app/class/routes.php index bd9fd71..89f82e6 100644 --- a/app/class/routes.php +++ b/app/class/routes.php @@ -9,11 +9,19 @@ class Routes public function match() { $router = new AltoRouter(); - $router->setBasePath('/' . Config::basepath()); + if(!empty(Config::basepath())) { + $router->setBasePath(DIRECTORY_SEPARATOR . Config::basepath()); + } $router->addRoutes([ ['GET|POST', '/', 'Backrouter#run', 'backrouter'], ['GET', '/[a:art]/', 'Controllerart#read', 'artread/'], - ['GET', '/[a:art]/edit/', 'Controllerart#edit', 'artedit/'], + ['GET', '/[a:art]', 'Controllerart#read', 'artread'], + ['GET', '/[a:art]/add', 'Controllerart#add', 'artadd'], + ['GET', '/[a:art]/edit', 'Controllerart#edit', 'artedit'], + ['GET', '/[a:art]/log', 'Controllerart#log', 'artlog'], + ['POST', '/[a:art]/edit', 'Controllerart#update', 'artupdate'], + ['GET', '/[a:art]/delete', 'Controllerart#confirmdelete', 'artconfirmdelete'], + ['POST', '/[a:art]/delete', 'Controllerart#delete', 'artdelete'], ]); $match = $router->match(); diff --git a/app/class/sleekdbw.php b/app/class/sleekdbw.php deleted file mode 100644 index dd77752..0000000 --- a/app/class/sleekdbw.php +++ /dev/null @@ -1,180 +0,0 @@ -storePath . 'data/'; - $lengh = strlen($listPath); - $list = []; - foreach (glob($listPath . '*.json') as $filename) { - $list[] = substr(substr($filename, $lengh), 0, -5); - } - return $list; - } - - public function getbyid($id) - { - return $this->getStoreDocumentById($id); - } - - public function updatebyid($id, $data) - { - foreach ($data as $key => $value) { - // Do not update the _id reserved index of a store. - if ($key != '_id') { - $data[$key] = $value; - } - } - $storePath = $this->storePath . 'data/' . $id . '.json'; - if (file_exists($storePath)) { - // Wait until it's unlocked, then update data. - file_put_contents($storePath, json_encode($data), LOCK_EX); - } - // Check do we need to wipe the cache for this store. - if ($this->deleteCacheOnCreate === true) $this->_emptyAllCache(); - return true; - } - - - - - - - // Writes an object in a store. - protected function writeInStore($storeData) - { - // Cast to array - $storeData = (array)$storeData; - // Check if it has _id key - if (empty($storeData['_id'])) throw new \Exception('Lack of id in this object'); - if (in_array($storeData['_id'], $this->getStoreIdList())) throw new \Exception('Id already used'); - // Add the system ID with the store data array. - $id = $storeData['_id']; - // Prepare storable data - $storableJSON = json_encode($storeData); - if ($storableJSON === false) throw new \Exception('Unable to encode the data array, please provide a valid PHP associative array'); - // Define the store path - $storePath = $this->storePath . 'data/' . $id . '.json'; - if (!file_put_contents($storePath, $storableJSON)) { - throw new \Exception("Unable to write the object file! Please check if PHP has write permission."); - } - return $storeData; - } - - - // Find store objects with conditions, sorting order, skip and limits. - protected function findStoreDocuments() - { - $found = []; - $storeIdList = $this->getStoreIdList(); - $searchRank = []; - // Start collecting and filtering data. - foreach ($storeIdList as $id) { - // Collect data of current iteration. - $data = $this->getStoreDocumentById($id); - if (!empty($data)) { - // Filter data found. - if (empty($this->conditions)) { - // Append all data of this store. - $found[] = $data; - } else { - // Append only passed data from this store. - $storePassed = true; - // Iterate each conditions. - foreach ($this->conditions as $condition) { - // Check for valid data from data source. - $validData = true; - $fieldValue = ''; - try { - $fieldValue = $this->getNestedProperty($condition['fieldName'], $data); - } catch (\Exception $e) { - $validData = false; - $storePassed = false; - } - if ($validData === true) { - // Check the type of rule. - if ($condition['condition'] === '=') { - // Check equal. - if ($fieldValue != $condition['value']) $storePassed = false; - } else if ($condition['condition'] === '!=') { - // Check not equal. - if ($fieldValue == $condition['value']) $storePassed = false; - } else if ($condition['condition'] === '>') { - // Check greater than. - if ($fieldValue <= $condition['value']) $storePassed = false; - } else if ($condition['condition'] === '>=') { - // Check greater equal. - if ($fieldValue < $condition['value']) $storePassed = false; - } else if ($condition['condition'] === '<') { - // Check less than. - if ($fieldValue >= $condition['value']) $storePassed = false; - } else if ($condition['condition'] === '<=') { - // Check less equal. - if ($fieldValue > $condition['value']) $storePassed = false; - } - } - } - // Check if current store is updatable or not. - if ($storePassed === true) { - // Append data to the found array. - $found[] = $data; - } - } - } - } - if (count($found) > 0) { - // Check do we need to sort the data. - if ($this->orderBy['order'] !== false) { - // Start sorting on all data. - $found = $this->sortArray($this->orderBy['field'], $found, $this->orderBy['order']); - } - // If there was text search then we would also sort the result by search ranking. - if (!empty($this->searchKeyword)) { - $found = $this->performSerach($found); - } - // Skip data - if ($this->skip > 0) $found = array_slice($found, $this->skip); - // Limit data. - if ($this->limit > 0) $found = array_slice($found, 0, $this->limit); - } - return $found; - } - - - - // Method to boot a store. - protected function bootStore() - { - $store = trim($this->storeName); - // Validate the store name. - if (!$store || empty($store)) throw new \Exception('Invalid store name was found'); - // Prepare store name. - if (substr($store, -1) !== '/') $store = $store . '/'; - // Store directory path. - $this->storePath = $this->dataDirectory . $store; - // Check if the store exists. - if (!file_exists($this->storePath)) { - // The directory was not found, create one with cache directory. - if (!mkdir($this->storePath, 0777, true)) throw new \Exception('Unable to create the store path at ' . $this->storePath); - // Create the cache directory. - if (!mkdir($this->storePath . 'cache', 0777, true)) throw new \Exception('Unable to create the store\'s cache directory at ' . $this->storePath . 'cache'); - // Create the data directory. - if (!mkdir($this->storePath . 'data', 0777, true)) throw new \Exception('Unable to create the store\'s data directory at ' . $this->storePath . 'data'); - // Check if PHP has write permission in that directory. - if (!is_writable($this->storePath)) throw new \Exception('Store path is not writable at "' . $this->storePath . '." Please change store path permission.'); - // Finally check if the directory is readable by PHP. - if (!is_readable($this->storePath)) throw new \Exception('Store path is not readable at "' . $this->storePath . '." Please change store path permission.'); - } - } - - - - -} - -?> \ No newline at end of file diff --git a/app/view/templates/body.php b/app/view/templates/body.php deleted file mode 100644 index e69de29..0000000 diff --git a/app/view/templates/confirmdelete.php b/app/view/templates/confirmdelete.php new file mode 100644 index 0000000..e05f6da --- /dev/null +++ b/app/view/templates/confirmdelete.php @@ -0,0 +1,44 @@ +layout('layout', ['title' => 'delete', 'description' => 'delete', 'css' => $css . 'delete.css']) ?> + + +start('page') ?> + + +insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?> + +
    + +

    Delete

    + +
      +
    • Id : title() ?>
    • +
    • Title : title() ?>
    • +
    • Article(s) linked to this one : linkto('sort') ?>
    • +
    • Article(s) linked from this one : linkfrom('sort') ?>
    • +
    • Number of edits : editcount() ?>
    • +
    + +linkto())) { ?> + +

    Article linked to :

    + + + + + +
    + + +
    + + +
    + + + +stop() ?> \ No newline at end of file diff --git a/app/view/templates/connect.php b/app/view/templates/connect.php index 3e2aeba..a4d58e7 100644 --- a/app/view/templates/connect.php +++ b/app/view/templates/connect.php @@ -1,4 +1,4 @@ -layout('layout', ['title' => 'Connect', 'description' => 'connect']) ?> +layout('layout', ['title' => 'Connect', 'description' => 'connect', 'css' => $css . 'connect.css']) ?> diff --git a/app/view/templates/delete.php b/app/view/templates/delete.php deleted file mode 100644 index be54451..0000000 --- a/app/view/templates/delete.php +++ /dev/null @@ -1,44 +0,0 @@ -layout('layout', ['title' => 'delete', 'description' => 'delete']) ?> - - -start('page') ?> - - -insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?> - -
    - -

    Delete

    - -
      -
    • Id : title() ?>
    • -
    • Title : title() ?>
    • -
    • Article(s) linked to this one : linkto('sort') ?>
    • -
    • Article(s) linked from this one : linkfrom('sort') ?>
    • -
    • Number of edits : editcount() ?>
    • -
    - -linkto())) { ?> - -

    Article linked to :

    - - - - - -
    - - -
    - - -
    - - - -stop() ?> \ No newline at end of file diff --git a/app/view/templates/edit.php b/app/view/templates/edit.php index 33d42f4..7379378 100644 --- a/app/view/templates/edit.php +++ b/app/view/templates/edit.php @@ -1,4 +1,4 @@ -layout('layout', ['title' => '✏ '.$art->title()]) ?> +layout('layout', ['title' => '✏ '.$art->title(), 'css' => $css . 'edit.css']) ?> @@ -24,9 +24,6 @@ - - - diff --git a/app/view/templates/editrightbar.php b/app/view/templates/editrightbar.php index 92d5f81..a6cc2a0 100644 --- a/app/view/templates/editrightbar.php +++ b/app/view/templates/editrightbar.php @@ -7,7 +7,7 @@ - + -
    - -
    -
    + + - + - + βœ– delete - πŸ‘ - ΒΆ + 🏠 + πŸ‘ + ΒΆ id() ?> diff --git a/app/view/templates/home.php b/app/view/templates/home.php index 2303f0f..5c3a007 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -1,4 +1,4 @@ -layout('layout', ['title' => 'home']) ?> +layout('layout', ['title' => 'home', 'css' => $css . 'home.css']) ?> @@ -80,10 +80,10 @@ - ✏ - πŸ‘ - πŸ—‘ - ΒΆ + ✏ + πŸ‘ + πŸ—‘ + ΒΆ tag('sort') ?> description() ?> linkto('sort') ?> diff --git a/app/view/templates/layout.php b/app/view/templates/layout.php index 7439f48..c20264d 100644 --- a/app/view/templates/layout.php +++ b/app/view/templates/layout.php @@ -6,7 +6,7 @@ <?= $title ?> - + section('customhead')?> section('arthead')?> diff --git a/app/view/templates/navart.php b/app/view/templates/navart.php index 6f4388c..f747eca 100644 --- a/app/view/templates/navart.php +++ b/app/view/templates/navart.php @@ -53,10 +53,10 @@ div#dropmenu { canedit() && $artexist) { ?>
  • - display + display
  • - edit + edit
  • diff --git a/app/view/templates/read.php b/app/view/templates/read.php index 35b1e7d..1911cf6 100644 --- a/app/view/templates/read.php +++ b/app/view/templates/read.php @@ -53,8 +53,10 @@ $this->stop(); } else { echo '

    ' . $alertnotexist . '

    '; if ($cancreate) { - $this->insert('readcreate', ['id' => $art->id()]); - } + ?> + ⭐ Create + - - - -
    \ No newline at end of file -- cgit v1.2.3