| @ -1,82 +0,0 @@ | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <?php | |||||
| $desc = get_category_info(null); | |||||
| ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { | |||||
| if (empty($postTitle)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||||
| echo $postTitle; | |||||
| } ?>"/><br><br> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>"><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="tag" value="<?php if (isset($postTag)) { | |||||
| echo $postTag; | |||||
| } ?>"/><br><br> | |||||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||||
| echo $postUrl; | |||||
| } ?>"/><br> | |||||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } ?></textarea> | |||||
| <br><br> | |||||
| Featured Audio <span class="required">*</span> (SoundCloud Only)<br><textarea rows="3" cols="20" class="text <?php if (isset($postAudio)) { | |||||
| if (empty($postAudio)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="audio"><?php if (isset($postAudio)) { | |||||
| echo $postAudio; | |||||
| } ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||||
| if (empty($postContent)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||||
| echo $postContent; | |||||
| } ?></textarea><br/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="publish" class="submit" value="Publish"/> <input type="submit" name="draft" class="draft" value="Save as draft"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,58 +0,0 @@ | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| Title <span class="required">*</span><br><input type="text" class="text <?php if (isset($postTitle)) { | |||||
| if (empty($postTitle)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||||
| echo $postTitle; | |||||
| } ?>"/><br><br> | |||||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||||
| echo $postUrl; | |||||
| } ?>"/><br> | |||||
| <span class="help">If the url leave empty we will use the page title.</span><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } ?></textarea> | |||||
| <br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||||
| if (empty($postContent)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||||
| echo $postContent; | |||||
| } ?></textarea><br/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="submit" class="submit" value="Add category"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -0,0 +1,123 @@ | |||||
| <?php | |||||
| $type = $type; | |||||
| if ($type != 'is_post' && $type != 'is_image' && $type != 'is_video' && $type != 'is_audio' && $type != 'is_link' && $type != 'is_quote') { | |||||
| $add = site_url() . 'admin/content'; | |||||
| header("location: $add"); | |||||
| } | |||||
| $desc = get_category_info(null); | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| Title <span class="required">*</span> | |||||
| <br> | |||||
| <input type="text" class="text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';}} ?>" name="title" value="<?php if (isset($postTitle)) { echo $postTitle;} ?>"/> | |||||
| <br><br> | |||||
| Category <span class="required">*</span> | |||||
| <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>"><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> | |||||
| <br> | |||||
| <input type="text" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error';}} ?>" name="tag" value="<?php if (isset($postTag)) { echo $postTag; } ?>"/> | |||||
| <br><br> | |||||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { echo $postUrl;} ?>"/> | |||||
| <br> | |||||
| <span class="help">If the url leave empty we will use the post title.</span> | |||||
| <br><br> | |||||
| Meta Description (optional)<br> | |||||
| <textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { echo $p->description;} ?></textarea> | |||||
| <br><br> | |||||
| <?php if ($type == 'is_audio'):?> | |||||
| Featured Audio <span class="required">*</span> (SoundCloud Only) | |||||
| <br> | |||||
| <textarea rows="3" cols="20" class="text <?php if (isset($postAudio)) { if (empty($postAudio)) { echo 'error';} } ?>" name="audio"><?php if (isset($postAudio)) { echo $postAudio;} ?></textarea> | |||||
| <input type="hidden" name="is_audio" value="is_audio"> | |||||
| <br> | |||||
| <?php endif;?> | |||||
| <?php if ($type == 'is_video'):?> | |||||
| Featured Video <span class="required">*</span> (Youtube Only) | |||||
| <br> | |||||
| <textarea rows="3" cols="20" class="text <?php if (isset($postVideo)) { if (empty($postVideo)) { echo 'error';} } ?>" name="video"><?php if (isset($postVideo)) { echo $postVideo;} ?></textarea> | |||||
| <input type="hidden" name="is_video" value="is_video"> | |||||
| <br> | |||||
| <?php endif;?> | |||||
| <?php if ($type == 'is_image'):?> | |||||
| Featured Image <span class="required">*</span> | |||||
| <br> | |||||
| <textarea rows="3" cols="20" class="text <?php if (isset($postImage)) { if (empty($postImage)) { echo 'error';} } ?>" name="image"><?php if (isset($postImage)) { echo $postImage;} ?></textarea> | |||||
| <input type="hidden" name="is_image" value="is_image"> | |||||
| <br> | |||||
| <?php endif;?> | |||||
| <?php if ($type == 'is_quote'):?> | |||||
| Featured Quote <span class="required">*</span> | |||||
| <br> | |||||
| <textarea rows="3" cols="20" class="text <?php if (isset($postQuote)) { if (empty($postQuote)) { echo 'error';} } ?>" name="quote"><?php if (isset($postQuote)) { echo $postQuote;} ?></textarea> | |||||
| <input type="hidden" name="is_quote" value="is_quote"> | |||||
| <br> | |||||
| <?php endif;?> | |||||
| <?php if ($type == 'is_link'):?> | |||||
| Featured Link <span class="required">*</span> | |||||
| <br> | |||||
| <textarea rows="3" cols="20" class="text <?php if (isset($postLink)) { if (empty($postLink)) { echo 'error';} } ?>" name="link"><?php if (isset($postLink)) { echo $postLink;} ?></textarea> | |||||
| <input type="hidden" name="is_link" value="is_link"> | |||||
| <br> | |||||
| <?php endif;?> | |||||
| <?php if ($type == 'is_post'):?> | |||||
| <input type="hidden" name="is_post" value="is_post"> | |||||
| <?php endif;?> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error'; } } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { echo $postContent;} ?></textarea> | |||||
| <br/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="publish" class="submit" value="Publish"/> <input type="submit" name="draft" class="draft" value="Save as draft"/> | |||||
| </form> | |||||
| </div> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,82 +0,0 @@ | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <?php | |||||
| $desc = get_category_info(null); | |||||
| ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { | |||||
| if (empty($postTitle)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||||
| echo $postTitle; | |||||
| } ?>"/><br><br> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>"><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="tag" value="<?php if (isset($postTag)) { | |||||
| echo $postTag; | |||||
| } ?>"/><br><br> | |||||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||||
| echo $postUrl; | |||||
| } ?>"/><br> | |||||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } ?></textarea> | |||||
| <br><br> | |||||
| Featured Image <span class="required">*</span> <br><textarea rows="3" cols="20" class="text <?php if (isset($postImage)) { | |||||
| if (empty($postImage)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="image"><?php if (isset($postImage)) { | |||||
| echo $postImage; | |||||
| } ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||||
| if (empty($postContent)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||||
| echo $postContent; | |||||
| } ?></textarea><br/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="publish" class="submit" value="Publish"/> <input type="submit" name="draft" class="draft" value="Save as draft"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,82 +0,0 @@ | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <?php | |||||
| $desc = get_category_info(null); | |||||
| ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { | |||||
| if (empty($postTitle)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||||
| echo $postTitle; | |||||
| } ?>"/><br><br> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>"><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="tag" value="<?php if (isset($postTag)) { | |||||
| echo $postTag; | |||||
| } ?>"/><br><br> | |||||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||||
| echo $postUrl; | |||||
| } ?>"/><br> | |||||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } ?></textarea> | |||||
| <br><br> | |||||
| Featured Link <span class="required">*</span> <br><textarea rows="3" cols="20" class="text <?php if (isset($postLink)) { | |||||
| if (empty($postLink)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="link" ><?php if (isset($postLink)) { | |||||
| echo $postLink; | |||||
| } ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||||
| if (empty($postContent)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||||
| echo $postContent; | |||||
| } ?></textarea><br/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="publish" class="submit" value="Publish"/> <input type="submit" name="draft" class="draft" value="Save as draft"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,75 +0,0 @@ | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <?php | |||||
| $desc = get_category_info(null); | |||||
| ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { | |||||
| if (empty($postTitle)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||||
| echo $postTitle; | |||||
| } ?>"/><br><br> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>"><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="tag" value="<?php if (isset($postTag)) { | |||||
| echo $postTag; | |||||
| } ?>"/><br><br> | |||||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||||
| echo $postUrl; | |||||
| } ?>"/><br> | |||||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } ?></textarea> | |||||
| <br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||||
| if (empty($postContent)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||||
| echo $postContent; | |||||
| } ?></textarea><br/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="publish" class="submit" value="Publish"/> <input type="submit" name="draft" class="draft" value="Save as draft"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,82 +0,0 @@ | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <?php | |||||
| $desc = get_category_info(null); | |||||
| ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { | |||||
| if (empty($postTitle)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||||
| echo $postTitle; | |||||
| } ?>"/><br><br> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>"><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="tag" value="<?php if (isset($postTag)) { | |||||
| echo $postTag; | |||||
| } ?>"/><br><br> | |||||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||||
| echo $postUrl; | |||||
| } ?>"/><br> | |||||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } ?></textarea> | |||||
| <br><br> | |||||
| Featured Quote <span class="required">*</span> <br><textarea rows="3" cols="20" class="text <?php if (isset($postQuote)) { | |||||
| if (empty($postQuote)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="quote"><?php if (isset($postQuote)) { | |||||
| echo $postQuote; | |||||
| } ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||||
| if (empty($postContent)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||||
| echo $postContent; | |||||
| } ?></textarea><br/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="publish" class="submit" value="Publish"/> <input type="submit" name="draft" class="draft" value="Save as draft"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,82 +0,0 @@ | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <?php | |||||
| $desc = get_category_info(null); | |||||
| ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| Title <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTitle)) { | |||||
| if (empty($postTitle)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="title" value="<?php if (isset($postTitle)) { | |||||
| echo $postTitle; | |||||
| } ?>"/><br><br> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>"><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="tag" value="<?php if (isset($postTag)) { | |||||
| echo $postTag; | |||||
| } ?>"/><br><br> | |||||
| Url (optional)<br><input type="text" class="text" name="url" value="<?php if (isset($postUrl)) { | |||||
| echo $postUrl; | |||||
| } ?>"/><br> | |||||
| <span class="help">If the url leave empty we will use the post title.</span><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } ?></textarea> | |||||
| <br><br> | |||||
| Featured Video <span class="required">*</span> (YouTube Only)<br><textarea rows="3" cols="20" class="text <?php if (isset($postVideo)) { | |||||
| if (empty($postVideo)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="video" ><?php if (isset($postVideo)) { | |||||
| echo $postVideo; | |||||
| } ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <textarea id="wmd-input" class="wmd-input <?php if (isset($postContent)) { | |||||
| if (empty($postContent)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="content" cols="20" rows="10"><?php if (isset($postContent)) { | |||||
| echo $postContent; | |||||
| } ?></textarea><br/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="publish" class="submit" value="Publish"/> <input type="submit" name="draft" class="draft" value="Save as draft"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,9 +1,9 @@ | |||||
| <h2>Add content</h2> | <h2>Add content</h2> | ||||
| <p><a href="<?php echo site_url();?>add/post">Regular post</a><br>Creating regular blog post.</p> | |||||
| <p><a href="<?php echo site_url();?>add/image">Image post</a><br>Creating blog post with featured image.</p> | |||||
| <p><a href="<?php echo site_url();?>add/video">Video post</a><br>Creating blog post with featured video.</p> | |||||
| <p><a href="<?php echo site_url();?>add/audio">Audio post</a><br>Creating blog post with featured audio.</p> | |||||
| <p><a href="<?php echo site_url();?>add/link">Link post</a><br>Creating blog post with featured link.</p> | |||||
| <p><a href="<?php echo site_url();?>add/quote">Quote post</a><br>Creating blog post with featured quote.</p> | |||||
| <p><a href="<?php echo site_url();?>add/content?type=post">Regular post</a><br>Creating regular blog post.</p> | |||||
| <p><a href="<?php echo site_url();?>add/content?type=image">Image post</a><br>Creating blog post with featured image.</p> | |||||
| <p><a href="<?php echo site_url();?>add/content?type=video">Video post</a><br>Creating blog post with featured video.</p> | |||||
| <p><a href="<?php echo site_url();?>add/content?type=audio">Audio post</a><br>Creating blog post with featured audio.</p> | |||||
| <p><a href="<?php echo site_url();?>add/content?type=link">Link post</a><br>Creating blog post with featured link.</p> | |||||
| <p><a href="<?php echo site_url();?>add/content?type=quote">Quote post</a><br>Creating blog post with featured quote.</p> | |||||
| <p><a href="<?php echo site_url();?>add/page">Static page</a><br>Creating static page.</p> | <p><a href="<?php echo site_url();?>add/page">Static page</a><br>Creating static page.</p> | ||||
| @ -1,130 +0,0 @@ | |||||
| <?php | |||||
| if (isset($p->file)) { | |||||
| $url = $p->file; | |||||
| } else { | |||||
| $url = $oldfile; | |||||
| } | |||||
| $desc = get_category_info(null); | |||||
| $content = file_get_contents($url); | |||||
| $oldtitle = get_content_tag('t', $content, 'Untitled'); | |||||
| $olddescription = get_content_tag('d', $content); | |||||
| $oldtag = get_content_tag('tag', $content); | |||||
| $oldaudio = get_content_tag('audio', $content); | |||||
| $oldcontent = remove_html_comments($content); | |||||
| $dir = substr($url, 0, strrpos($url, '/')); | |||||
| $isdraft = explode('/', $dir); | |||||
| $oldurl = explode('_', $url); | |||||
| if (empty($oldtag)) { | |||||
| $oldtag = $oldurl[1]; | |||||
| } | |||||
| $oldmd = str_replace('.md', '', $oldurl[2]); | |||||
| if (isset($_GET['destination'])) { | |||||
| $destination = $_GET['destination']; | |||||
| } else { | |||||
| $destination = 'admin'; | |||||
| } | |||||
| $replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/'; | |||||
| // Category string | |||||
| $cat = explode('/', $replaced); | |||||
| $category = $cat[count($cat) - 3]; | |||||
| $dt = str_replace($replaced, '', $oldurl[0]); | |||||
| $t = str_replace('-', '', $dt); | |||||
| $time = new DateTime($t); | |||||
| $timestamp = $time->format("Y-m-d H:i:s"); | |||||
| // The post date | |||||
| $postdate = strtotime($timestamp); | |||||
| if (config('permalink.type') == 'post') { | |||||
| $delete = site_url() . 'post/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } else { | |||||
| // The post URL | |||||
| $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| 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> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>" <?php if($category === $d->md) { echo 'selected="selected"';} ?>><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" value="<?php echo $oldtag ?>"/><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 post title.</span><br><br> | |||||
| Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> | |||||
| Hour, Minute, Second<br><input | |||||
| type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } else {echo $olddescription;}?></textarea> | |||||
| <br><br> | |||||
| Featured Audio <span class="required">*</span> (SoundCloud Only)<br><textarea rows="3" cols="20" class="text <?php if (isset($postAudio)) { | |||||
| if (empty($postAudio)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="audio" ><?php echo $oldaudio ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <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="is_audio" class="text" value="is_audio"/> | |||||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <?php if ($isdraft[4] == 'draft') { ?> | |||||
| <input type="submit" name="publishdraft" class="submit" value="Publish draft"/> <input type="submit" name="updatedraft" class="draft" value="Update draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php } else { ?> | |||||
| <input type="submit" name="updatepost" class="submit" value="Update post"/> <input type="submit" name="revertpost" class="revert" value="Revert to draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php }?> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,87 +0,0 @@ | |||||
| <?php | |||||
| if (isset($p->file)) { | |||||
| $url = $p->file; | |||||
| } else { | |||||
| $url = $oldfile; | |||||
| } | |||||
| $content = file_get_contents($url); | |||||
| $oldtitle = get_content_tag('t', $content, 'Untitled'); | |||||
| $olddescription = get_content_tag('d', $content); | |||||
| $oldcontent = remove_html_comments($content); | |||||
| if (isset($_GET['destination'])) { | |||||
| $destination = $_GET['destination']; | |||||
| } else { | |||||
| $destination = 'admin'; | |||||
| } | |||||
| $dir = substr($url, 0, strrpos($url, '/')); | |||||
| $oldurl = str_replace($dir . '/', '', $url); | |||||
| $oldmd = str_replace('.md', '', $oldurl); | |||||
| if (isset($p->url)) { | |||||
| $delete = $p->url . '/delete?destination=' . $destination; | |||||
| } | |||||
| else { | |||||
| if(empty($sub)) { | |||||
| $delete = site_url() . $oldmd . '/delete?destination=' . $destination; | |||||
| } | |||||
| else { | |||||
| $delete = site_url() . $static .'/'. $sub . '/delete?destination=' . $destination; | |||||
| } | |||||
| } | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| 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> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } else {echo $olddescription;}?></textarea> | |||||
| <br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <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="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="submit" class="submit" value="Save category"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,62 +0,0 @@ | |||||
| <?php | |||||
| $filename = 'content/data/frontpage/frontpage.md'; | |||||
| if (file_exists($filename)) { | |||||
| $content = file_get_contents($filename); | |||||
| $oldtitle = get_content_tag('t', $content, 'Welcome'); | |||||
| $oldcontent = remove_html_comments($content); | |||||
| } else { | |||||
| $oldtitle = 'Welcome'; | |||||
| $oldcontent = 'Welcome to our website.'; | |||||
| } | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| 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> | |||||
| <br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <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="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="submit" class="submit" value="Save"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,130 +0,0 @@ | |||||
| <?php | |||||
| if (isset($p->file)) { | |||||
| $url = $p->file; | |||||
| } else { | |||||
| $url = $oldfile; | |||||
| } | |||||
| $desc = get_category_info(null); | |||||
| $content = file_get_contents($url); | |||||
| $oldtitle = get_content_tag('t', $content, 'Untitled'); | |||||
| $olddescription = get_content_tag('d', $content); | |||||
| $oldtag = get_content_tag('tag', $content); | |||||
| $oldimage = get_content_tag('image', $content); | |||||
| $oldcontent = remove_html_comments($content); | |||||
| $dir = substr($url, 0, strrpos($url, '/')); | |||||
| $isdraft = explode('/', $dir); | |||||
| $oldurl = explode('_', $url); | |||||
| if (empty($oldtag)) { | |||||
| $oldtag = $oldurl[1]; | |||||
| } | |||||
| $oldmd = str_replace('.md', '', $oldurl[2]); | |||||
| if (isset($_GET['destination'])) { | |||||
| $destination = $_GET['destination']; | |||||
| } else { | |||||
| $destination = 'admin'; | |||||
| } | |||||
| $replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/'; | |||||
| // Category string | |||||
| $cat = explode('/', $replaced); | |||||
| $category = $cat[count($cat) - 3]; | |||||
| $dt = str_replace($replaced, '', $oldurl[0]); | |||||
| $t = str_replace('-', '', $dt); | |||||
| $time = new DateTime($t); | |||||
| $timestamp = $time->format("Y-m-d H:i:s"); | |||||
| // The post date | |||||
| $postdate = strtotime($timestamp); | |||||
| // The post URL | |||||
| if (config('permalink.type') == 'post') { | |||||
| $delete = site_url() . 'post/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } else { | |||||
| // The post URL | |||||
| $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| 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> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>" <?php if($category === $d->md) { echo 'selected="selected"';} ?>><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" value="<?php echo $oldtag ?>"/><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 post title.</span><br><br> | |||||
| Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> | |||||
| Hour, Minute, Second<br><input | |||||
| type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } else {echo $olddescription;}?></textarea> | |||||
| <br><br> | |||||
| Featured Image <span class="required">*</span> <br><textarea rows="3" cols="20" class="text <?php if (isset($postImage)) { | |||||
| if (empty($postImage)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="image" ><?php echo $oldimage ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <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="is_image" class="text" value="is_image"/> | |||||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <?php if ($isdraft[4] == 'draft') { ?> | |||||
| <input type="submit" name="publishdraft" class="submit" value="Publish draft"/> <input type="submit" name="updatedraft" class="draft" value="Update draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php } else { ?> | |||||
| <input type="submit" name="updatepost" class="submit" value="Update post"/> <input type="submit" name="revertpost" class="revert" value="Revert to draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php }?> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,131 +0,0 @@ | |||||
| <?php | |||||
| if (isset($p->file)) { | |||||
| $url = $p->file; | |||||
| } else { | |||||
| $url = $oldfile; | |||||
| } | |||||
| $desc = get_category_info(null); | |||||
| $content = file_get_contents($url); | |||||
| $oldtitle = get_content_tag('t', $content, 'Untitled'); | |||||
| $olddescription = get_content_tag('d', $content); | |||||
| $oldtag = get_content_tag('tag', $content); | |||||
| $oldlink = get_content_tag('link', $content); | |||||
| $oldcontent = remove_html_comments($content); | |||||
| $dir = substr($url, 0, strrpos($url, '/')); | |||||
| $isdraft = explode('/', $dir); | |||||
| $oldurl = explode('_', $url); | |||||
| if (empty($oldtag)) { | |||||
| $oldtag = $oldurl[1]; | |||||
| } | |||||
| $oldmd = str_replace('.md', '', $oldurl[2]); | |||||
| if (isset($_GET['destination'])) { | |||||
| $destination = $_GET['destination']; | |||||
| } else { | |||||
| $destination = 'admin'; | |||||
| } | |||||
| $replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/'; | |||||
| // Category string | |||||
| $cat = explode('/', $replaced); | |||||
| $category = $cat[count($cat) - 3]; | |||||
| $dt = str_replace($replaced, '', $oldurl[0]); | |||||
| $t = str_replace('-', '', $dt); | |||||
| $time = new DateTime($t); | |||||
| $timestamp = $time->format("Y-m-d H:i:s"); | |||||
| // The post date | |||||
| $postdate = strtotime($timestamp); | |||||
| // The post URL | |||||
| if (config('permalink.type') == 'post') { | |||||
| $delete = site_url() . 'post/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } else { | |||||
| // The post URL | |||||
| $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| 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> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>" <?php if($category === $d->md) { echo 'selected="selected"';} ?>><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" value="<?php echo $oldtag ?>"/><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 post title.</span><br><br> | |||||
| Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> | |||||
| Hour, Minute, Second<br><input | |||||
| type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } else {echo $olddescription;}?></textarea> | |||||
| <br><br> | |||||
| Featured Link <span class="required">*</span> <br><textarea rows="3" cols="20" class="text <?php if (isset($postLink)) { | |||||
| if (empty($postLink)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="link" ><?php echo $oldlink ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <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="is_link" class="text" value="is_link"/> | |||||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <?php if ($isdraft[4] == 'draft') { ?> | |||||
| <input type="submit" name="publishdraft" class="submit" value="Publish draft"/> <input type="submit" name="updatedraft" class="draft" value="Update draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php } else { ?> | |||||
| <input type="submit" name="updatepost" class="submit" value="Update post"/> <input type="submit" name="revertpost" class="revert" value="Revert to draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php }?> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,125 +0,0 @@ | |||||
| <?php | |||||
| if (isset($p->file)) { | |||||
| $url = $p->file; | |||||
| } else { | |||||
| $url = $oldfile; | |||||
| } | |||||
| $desc = get_category_info(null); | |||||
| $content = file_get_contents($url); | |||||
| $oldtitle = get_content_tag('t', $content, 'Untitled'); | |||||
| $olddescription = get_content_tag('d', $content); | |||||
| $oldtag = get_content_tag('tag', $content); | |||||
| $oldcontent = remove_html_comments($content); | |||||
| $dir = substr($url, 0, strrpos($url, '/')); | |||||
| $isdraft = explode('/', $dir); | |||||
| $oldurl = explode('_', $url); | |||||
| if (empty($oldtag)) { | |||||
| $oldtag = $oldurl[1]; | |||||
| } | |||||
| $oldmd = str_replace('.md', '', $oldurl[2]); | |||||
| if (isset($_GET['destination'])) { | |||||
| $destination = $_GET['destination']; | |||||
| } else { | |||||
| $destination = 'admin'; | |||||
| } | |||||
| $replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/'; | |||||
| // Category string | |||||
| $cat = explode('/', $replaced); | |||||
| $category = $cat[count($cat) - 3]; | |||||
| $dt = str_replace($replaced, '', $oldurl[0]); | |||||
| $t = str_replace('-', '', $dt); | |||||
| $time = new DateTime($t); | |||||
| $timestamp = $time->format("Y-m-d H:i:s"); | |||||
| // The post date | |||||
| $postdate = strtotime($timestamp); | |||||
| // The post URL | |||||
| if (config('permalink.type') == 'post') { | |||||
| $delete = site_url() . 'post/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } else { | |||||
| // The post URL | |||||
| $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| 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> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>" <?php if($category === $d->md) { echo 'selected="selected"';} ?>><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" value="<?php echo $oldtag ?>"/><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 post title.</span><br><br> | |||||
| Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> | |||||
| Hour, Minute, Second<br><input | |||||
| type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } else { echo $olddescription;} ?></textarea> | |||||
| <br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <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="is_post" class="text" value="is_post"/> | |||||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <?php if ($isdraft[4] == 'draft') { ?> | |||||
| <input type="submit" name="publishdraft" class="submit" value="Publish draft"/> <input type="submit" name="updatedraft" class="draft" value="Update draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php } else { ?> | |||||
| <input type="submit" name="updatepost" class="submit" value="Update post"/> <input type="submit" name="revertpost" class="revert" value="Revert to draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php }?> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,66 +0,0 @@ | |||||
| <?php | |||||
| if (isset($_SESSION[config("site.url")]['user'])) { | |||||
| $user = $_SESSION[config("site.url")]['user']; | |||||
| } | |||||
| $filename = 'content/' . $user . '/author.md'; | |||||
| if (file_exists($filename)) { | |||||
| $content = file_get_contents($filename); | |||||
| $oldtitle = get_content_tag('t', $content, 'user'); | |||||
| $oldcontent = remove_html_comments($content); | |||||
| } else { | |||||
| $oldtitle = $user; | |||||
| $oldcontent = 'Just another HTMLy user.'; | |||||
| } | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| 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> | |||||
| <br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <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="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <input type="submit" name="submit" class="submit" value="Save"/> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||
| @ -1,131 +0,0 @@ | |||||
| <?php | |||||
| if (isset($p->file)) { | |||||
| $url = $p->file; | |||||
| } else { | |||||
| $url = $oldfile; | |||||
| } | |||||
| $desc = get_category_info(null); | |||||
| $content = file_get_contents($url); | |||||
| $oldtitle = get_content_tag('t', $content, 'Untitled'); | |||||
| $olddescription = get_content_tag('d', $content); | |||||
| $oldtag = get_content_tag('tag', $content); | |||||
| $oldquote = get_content_tag('quote', $content); | |||||
| $oldcontent = remove_html_comments($content); | |||||
| $dir = substr($url, 0, strrpos($url, '/')); | |||||
| $isdraft = explode('/', $dir); | |||||
| $oldurl = explode('_', $url); | |||||
| if (empty($oldtag)) { | |||||
| $oldtag = $oldurl[1]; | |||||
| } | |||||
| $oldmd = str_replace('.md', '', $oldurl[2]); | |||||
| if (isset($_GET['destination'])) { | |||||
| $destination = $_GET['destination']; | |||||
| } else { | |||||
| $destination = 'admin'; | |||||
| } | |||||
| $replaced = substr($oldurl[0], 0, strrpos($oldurl[0], '/')) . '/'; | |||||
| // Category string | |||||
| $cat = explode('/', $replaced); | |||||
| $category = $cat[count($cat) - 3]; | |||||
| $dt = str_replace($replaced, '', $oldurl[0]); | |||||
| $t = str_replace('-', '', $dt); | |||||
| $time = new DateTime($t); | |||||
| $timestamp = $time->format("Y-m-d H:i:s"); | |||||
| // The post date | |||||
| $postdate = strtotime($timestamp); | |||||
| // The post URL | |||||
| if (config('permalink.type') == 'post') { | |||||
| $delete = site_url() . 'post/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } else { | |||||
| // The post URL | |||||
| $delete = site_url() . date('Y/m', $postdate) . '/' . $oldmd . '/delete?destination=' . $destination; | |||||
| } | |||||
| ?> | |||||
| <link rel="stylesheet" type="text/css" href="<?php echo site_url() ?>system/admin/editor/css/editor.css"/> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery.min.js"></script> | |||||
| <script src="<?php echo site_url() ?>system/resources/js/jquery-ui.min.js"></script> | |||||
| <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> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/Markdown.Extra.js"></script> | |||||
| <link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css"> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/jquery.ajaxfileupload.js"></script> | |||||
| <?php if (isset($error)) { ?> | |||||
| <div class="error-message"><?php echo $error ?></div> | |||||
| <?php } ?> | |||||
| <div class="wmd-panel"> | |||||
| <form method="POST"> | |||||
| 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> | |||||
| Category <span class="required">*</span> <br> | |||||
| <select name="category"> | |||||
| <option value="uncategorized">Uncategorized</option> | |||||
| <?php foreach ($desc as $d):?> | |||||
| <option value="<?php echo $d->md;?>" <?php if($category === $d->md) { echo 'selected="selected"';} ?>><?php echo $d->title;?></option> | |||||
| <?php endforeach;?> | |||||
| </select> | |||||
| <br><br> | |||||
| Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { | |||||
| if (empty($postTag)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" value="<?php echo $oldtag ?>"/><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 post title.</span><br><br> | |||||
| Year, Month, Day<br><input type="date" name="date" class="text" value="<?php echo date('Y-m-d', $postdate); ?>"><br> | |||||
| Hour, Minute, Second<br><input | |||||
| type="time" name="time" class="text" value="<?php echo $time->format('H:i:s'); ?>"><br><br> | |||||
| Meta Description (optional)<br><textarea name="description" rows="3" cols="20"><?php if (isset($p->description)) { | |||||
| echo $p->description; | |||||
| } else {echo $olddescription;}?></textarea> | |||||
| <br><br> | |||||
| Featured Quote <span class="required">*</span> <br><textarea rows="3" cols="20" class="text <?php if (isset($postQuote)) { | |||||
| if (empty($postQuote)) { | |||||
| echo 'error'; | |||||
| } | |||||
| } ?>" name="quote"><?php echo $oldquote ?></textarea><br><br> | |||||
| <div id="wmd-button-bar" class="wmd-button-bar"></div> | |||||
| <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="is_quote" class="text" value="is_quote"/> | |||||
| <input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/> | |||||
| <input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>"> | |||||
| <?php if ($isdraft[4] == 'draft') { ?> | |||||
| <input type="submit" name="publishdraft" class="submit" value="Publish draft"/> <input type="submit" name="updatedraft" class="draft" value="Update draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php } else { ?> | |||||
| <input type="submit" name="updatepost" class="submit" value="Update post"/> <input type="submit" name="revertpost" class="revert" value="Revert to draft"/> <a href="<?php echo $delete ?>">Delete</a> | |||||
| <?php }?> | |||||
| </form> | |||||
| </div> | |||||
| <div id="insertImageDialog" title="Insert Image"> | |||||
| <h4>URL</h4> | |||||
| <input type="text" placeholder="Enter image URL" /> | |||||
| <h4>Upload</h4> | |||||
| <form method="post" action="" enctype="multipart/form-data"> | |||||
| <input type="file" name="file" id="file" /> | |||||
| </form> | |||||
| <style> | |||||
| #insertImageDialog { display:none; padding: 10px; font-size:12px;} | |||||
| .wmd-prompt-background {z-index:10!important;} | |||||
| </style> | |||||
| </div> | |||||
| <div id="wmd-preview" class="wmd-panel wmd-preview"></div> | |||||
| <!-- Declare the base path. Important --> | |||||
| <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> | |||||
| <script type="text/javascript" src="<?php echo site_url() ?>system/admin/editor/js/editor.js"></script> | |||||