This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
rangitaki/rcc/edit/index.php

173 lines
5.1 KiB
PHP
Raw Permalink Normal View History

2015-12-06 15:19:16 +01:00
<?php
2016-03-11 18:54:58 +01:00
/**
* PHP Version 7
*
* @category Blogging
* @package Rcc
* @author Marcel Kapfer (mmk2410) <marcelmichaelkapfer@yahoo.co.nz>
* @license MIT License
* @link https://mmk2410.org/rangitaki
*
* Edit page of RCC (Rangitaki Control Center)
*
* The MIT License
*
* Copyright 2015 mmk2410.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
2015-12-06 15:19:16 +01:00
date_default_timezone_set('UTC');
?>
<!DOCTYPE html>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<html>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<head>
<meta charset="UTF-8">
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<title>Rangitaki Control Center</title>
2016-03-11 18:54:58 +01:00
<meta name="robots" content="nofollow, noindex, noarchive, nosnippet">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
user-scalable=0" name="viewport"/>
<meta name="theme-color" content="#383838">
<meta name="description" content="Rangitaki Control Center (RCC)">
2015-12-06 15:19:16 +01:00
<link rel="stylesheet" href="../res/rcc.css"/>
2016-03-11 18:54:58 +01:00
<link href='//fonts.googleapis.com/css?family=Roboto:400,500,700,300,
400italic,100,100italic,900' rel='stylesheet'
type='text/css'> <!--Font-->
2015-12-06 15:19:16 +01:00
</head>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<body>
2016-03-11 18:54:58 +01:00
<div class="header">
<a href="../" class="title">Rangitaki Control Center</a>
</div>
<div class="main">
<?php
session_start();
if ($_SESSION['login']) {
include_once "../../res/php/ArticleGenerator.php";
$directory = "./../../articles/" . $_GET['blog'] . "/";
$article = $_GET['post'] . ".md";
?>
<!-- Edit Post -->
2015-12-06 15:19:16 +01:00
<section class="card">
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<div class="headline">Edit Post</div>
2016-03-11 18:54:58 +01:00
<p>Title:
<br><br>
<input type="text" class="itextfield"
value="<?php
echo ArticleGenerator::getTitle($directory, $article);
?>" name="title" id="title"/>
2015-12-06 15:19:16 +01:00
</p>
2016-03-11 18:54:58 +01:00
<p>Date:
<br><br>
<input type="text" class="itextfield"
value="<?php
echo ArticleGenerator::getDate($directory, $article);
?>" name="date" id="date"/>
2015-12-06 15:19:16 +01:00
</p>
2016-03-11 18:54:58 +01:00
<p>Author:
<br><br>
<input type="text" class="itextfield"
value="<?php
echo ArticleGenerator::getAuthor($directory, $article);
?>" name="author" id="author"/>
</p>
<p>Tags:
<br><br>
<input type="text" class="itextfield"
value="<?php
$tags = "";
foreach (
ArticleGenerator::getTags($directory, $article)
as $tag) {
$tags = $tags . ', ' . $tag;
}
$tags = substr($tags, 2);
echo $tags;
?>" name="tags" id="tags"/>
</p>
2015-12-06 15:19:16 +01:00
<p>Text:</p>
<textarea class="itextarea" name="text" id="text">
2016-03-11 18:54:58 +01:00
<?php
echo ArticleGenerator::getText($directory, $article);
?>
2015-12-06 15:19:16 +01:00
</textarea>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<br><br>
<a class="button" id="save_changes">SAVE CHANGES</a>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
</section>
2016-03-11 18:54:58 +01:00
<!-- Go Back -->
2015-12-06 15:19:16 +01:00
<section class="card">
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<div class="headline">Back</div>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<p>
Go back to the RCC home. All changes will be lost.
</p>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<a class="button" href="../">BACK</a>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
</section>
2016-03-11 18:54:58 +01:00
<?php
} else {
?>
<!-- Access denied -->
2015-12-06 15:19:16 +01:00
<section class="card">
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<div class="headline">Access denied</div>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<p>
2016-03-11 18:54:58 +01:00
The access to this area is not granted. Make sure you're logged
in.
2015-12-06 15:19:16 +01:00
</p>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
<a class="button" href="../">BACK</a>
2016-03-11 18:54:58 +01:00
2015-12-06 15:19:16 +01:00
</section>
2016-03-11 18:54:58 +01:00
<?php
}
?>
</div>
<script>
var getVariables = <?php echo json_encode($_GET); ?>;
</script>
<script src="../../res/js/jquery-2.1.4.min.js"></script>
<script src="../res/rcc.js"></script>
<script src="../res/edit.js"></script>
2015-12-06 15:19:16 +01:00
</body>
</html>