Skip to content

Commit

Permalink
en view add del page, missing sys msg added, version update
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocari committed Oct 13, 2024
1 parent 69ba7db commit 2b8c75a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ private function pagesDelete() {
try{
$file_path = $_POST['del_page'];
if(file_exists($file_path) and unlink($file_path)){
$this->layout()->addSystemMessage('success', 'file_deleted');
$this->layout()->addSystemMessage('success', 'element_deleted');
}
}
catch (Exception $e){
Expand Down
31 changes: 31 additions & 0 deletions app/views/en/admin/pages/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,31 @@

<?php echo $this->renderMessage('info','Custom pages have <b>no routing identifier</b>! For more information see <a target="_blank" href="https://github.com/nekocari/miniTCG/wiki/Add-a-new-page">wiki on GitHub</a>.'); ?>

<form method="post" action="">
<div class="row">
<div class="col-12 col-md">
<div class="input-group">
<div class="input-group-text">new Page:</div>
<input class="form-control" type="text" name="filename" value="" placeholder="dateiname" pattern="[a-z0-9_\-]+">
<div class="input-group-text">.php</div>
</div>
</div>
<div class="col-12 col-md">
<div class="input-group">
<div class="input-group-text">Language:</div>
<select class="form-select" name="lang">
<?php foreach(SUPPORTED_LANGUAGES as $key => $lang){ ?>
<option value="<?php echo $key; ?>"><?php echo $lang; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-12 col-md">
<button class="btn btn-primary" type="submit" name="add_page" value="1">add</button>
</div>
</div>
</form>

<div class="table-responsive">

<table class="table table-striped">
Expand All @@ -25,6 +50,12 @@
<td><?php echo SUPPORTED_LANGUAGES[$page['language']]; ?></td>
<td><?php echo $page['filename']; ?></td>
<td class="text-right">
<form class="d-inline" method="POST" action="">
<button class="btn btn-sm btn-danger" name="del_page" value="<?php echo $page['path']; ?>" type="submit"
onclick="return confirm('Sicher?')">
<i class="fas fa-times"></i> <span class="d-none d-md-inline">delete</span>
</button>
</form>
<form class="d-inline" method="POST" action="<?php echo ROUTES::getUri('admin_pages_edit'); ?>">
<button class="btn btn-sm btn-primary" name="file_path" value="<?php echo $page['path']; ?>" type="submit">
<i class="fas fa-pencil-alt"></i> <span class="d-none d-md-inline">edit</span>
Expand Down
2 changes: 1 addition & 1 deletion config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@


// no need to edit here -------------------------------------------------------------------------------------
define('APP_VERSION','v1.3.1.1 beta');
define('APP_VERSION','v1.3.1.2 beta');
define('PATH', dirname(__FILE__).'/../'); // relative path
define('DEFAULT_FOLDER_PAGES','app/views/[lang]/pages/'); // default path for pages without controller setup
define('SERVER_URL', $_SERVER['SERVER_NAME']); // current server
Expand Down

0 comments on commit 2b8c75a

Please sign in to comment.