mirror of
https://github.com/danpros/htmly.git
synced 2026-04-18 11:36:20 +05:30
Various improvements
Various improvements
This commit is contained in:
parent
cd9341c155
commit
36f4c2d4df
19 changed files with 655 additions and 115 deletions
|
|
@ -1,6 +1,11 @@
|
|||
<?php
|
||||
|
||||
$url = $p->file;
|
||||
if(isset($p->file)) {
|
||||
$url = $p->file;
|
||||
}
|
||||
else {
|
||||
$url = $oldfile;
|
||||
}
|
||||
$content = file_get_contents($url);
|
||||
$arr = explode('t-->', $content);
|
||||
if(isset($arr[1])) {
|
||||
|
|
@ -12,23 +17,30 @@
|
|||
$oldcontent = ltrim($arr[0]);
|
||||
}
|
||||
|
||||
$destination = $_GET['destination'];
|
||||
$dir = substr($url, 0, strrpos($url, '/'));
|
||||
$oldurl = str_replace($dir . '/','',$url);
|
||||
$oldmd = str_replace('.md','',$oldurl);
|
||||
|
||||
$delete = site_url() . $oldmd . '/delete?destination=' . $destination;
|
||||
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css" />
|
||||
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Converter.js"></script>
|
||||
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Sanitizer.js"></script>
|
||||
<script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Editor.js"></script>
|
||||
<?php if (isset($error)) { ?>
|
||||
<div class="error-message"><?php echo $error ?></div>
|
||||
<?php } ?>
|
||||
<div class="wmd-panel">
|
||||
<form method="POST">
|
||||
Title: <br><input type="text" name="title" class="text" value="<?php echo $oldtitle?>"/><br><br>
|
||||
Url: <br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br><br>
|
||||
Title <span class="required">*</span><br><input type="text" name="title" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" value="<?php echo $oldtitle?>"/><br><br>
|
||||
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
|
||||
<span class="help">If the url leave empty we will use the page title.</span><br><br>
|
||||
<div id="wmd-button-bar" class="wmd-button-bar"></div>
|
||||
<textarea id="wmd-input" class="wmd-input" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
|
||||
<textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error';}} ?>" name="content" cols="20" rows="10"><?php echo $oldcontent ?></textarea><br>
|
||||
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
|
||||
<input type="submit" name="submit" class="submit" value="Submit"/>
|
||||
<input type="submit" name="submit" class="submit" value="Save"/> <a href="<?php echo $delete?>">Delete</a>
|
||||
</form>
|
||||
</div>
|
||||
<div id="wmd-preview" class="wmd-panel wmd-preview"></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue