summaryrefslogtreecommitdiff
path: root/public/app/views/admin
diff options
context:
space:
mode:
authorGeo Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-20 17:10:06 +0300
committerGeo Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-04-20 17:10:06 +0300
commitd9bce23822117d03b1630f002d3ee0491ac83d4b (patch)
treea7a2ac4864043f72ba1a54c2b98de5fd13daca67 /public/app/views/admin
parent423505cdf54c52947482509329c2a1c8ece97c39 (diff)
downloadclassroom-d9bce23822117d03b1630f002d3ee0491ac83d4b.tar.gz
classroom-d9bce23822117d03b1630f002d3ee0491ac83d4b.tar.bz2
classroom-d9bce23822117d03b1630f002d3ee0491ac83d4b.zip
hashing passwords; compatibility with dotNet
Diffstat (limited to 'public/app/views/admin')
-rw-r--r--public/app/views/admin/admin-menu.php10
-rw-r--r--public/app/views/admin/edit_lesson.php (renamed from public/app/views/admin/new_lesson.php)16
-rw-r--r--public/app/views/admin/skeleton.php28
3 files changed, 37 insertions, 17 deletions
diff --git a/public/app/views/admin/admin-menu.php b/public/app/views/admin/admin-menu.php
index d7e7b09..a06d2eb 100644
--- a/public/app/views/admin/admin-menu.php
+++ b/public/app/views/admin/admin-menu.php
@@ -4,26 +4,26 @@
*
* imported variables:
* ---
- * @param $action (string) : array of articles
+ * @param $action (string): array of articles
+ * @param $id (int): id of entity (when editing entity) | 0: new entity
*
* example call:
* ---
* Render::template("sections/admin_panel.php",[
* 'action' => 'posts',
+ * 'id' => 4
* ])
* -----------------------------------------------------------------------------
*/
-
$admin_options = [
- 'new_lesson' => 'Νέο Μάθημα',
+ 'edit_lesson' => 'Νέο Μάθημα',
'lessons' => 'Μαθήματα',
'categories' => 'Κατηγορίες',
'pages' => 'Σελίδες',
'privileges' => 'Πρόσβαση',
'users' => 'Χρήστες'
];
-
?>
<div class="top-bar">
@@ -32,7 +32,7 @@ $admin_options = [
<?php foreach($admin_options as $opt => $label) : ?>
- <?php if ($opt == $action) : ?>
+ <?php if (($opt == $action) & (!$id)) : ?>
<span class="btn btn-primary selected"><?=$label?></span>
<?php else : ?>
diff --git a/public/app/views/admin/new_lesson.php b/public/app/views/admin/edit_lesson.php
index c48fc82..30dd42f 100644
--- a/public/app/views/admin/new_lesson.php
+++ b/public/app/views/admin/edit_lesson.php
@@ -1,11 +1,19 @@
<?php
-// if no (lesson-)id is specified, then id=0 (new lesson)
-if (!isset($id)) $id=0;
+ // some labels (if editing new or existing record)
+ // --- -- -- - - -
+ if ($id == 0) {
+ $action_title = "Δημιουργία Μαθήματος";
+ $action_button = "Δημιουργία";
+
+ } else {
+ $action_title = "Επεξεργασία Μαθήματος";
+ $action_button = "Αποθήκευση Αλλαγών";
+ }
?>
<!-- title bar -->
<div class="title-bar">
- <div><h5>Επεξεργασία Μαθήματος</h5></div>
+ <div><h5><?=$action_title?></h5></div>
<div>
<button type="button" class="btn pull-right"
data-toggle="modal" data-target="#editorModal" data-action="preview">
@@ -129,7 +137,7 @@ if (!isset($id)) $id=0;
<div class="col-4">
<button class="btn btn-primary col-sm-12" type="submit">
- Καταχώριση
+ <?=$action_button?>
</button>
</div>
diff --git a/public/app/views/admin/skeleton.php b/public/app/views/admin/skeleton.php
index fea346f..927bd2d 100644
--- a/public/app/views/admin/skeleton.php
+++ b/public/app/views/admin/skeleton.php
@@ -7,7 +7,9 @@
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes', ['administration' => true]);
+ Render::view('components/header_includes', ////////////////////////////
+ ['administration' => true]
+ );
?>
@@ -17,16 +19,26 @@
<div class="classroom admin-container">
<?php
- Render::view('admin/admin-menu',[
- 'action' => $action
- ])
- ?>
-
- <?php
- Render::view("admin/{$action}");
+ // sometimes an ID (int) is needed
+ // ex. editing a page or a lesson we need page-ID or lesson-ID
+ // --- -- -- - - -
+ if (!isset($id)) $id=0;
+
+ // render menu
+ ////////////////////////////////////////////////////////////////////
+ Render::view('admin/admin-menu',[ ////////////////////////////
+ 'action' => $action,
+ 'id' => $id
+ ]);
+
+ // render main content
+ ////////////////////////////////////////////////////////////////////
+ Render::view("admin/{$action}",[ 'id' => $id ]); ////////////////
?>
</div>
+ <!-- js admin script -->
+ <script>var entity_id = <?= $id ?>;</script>
<script src="/assets/js/admin/<?= $action ?>.js"></script>
</body>