From d1f7d279bd4b0c043d63d660c925e5a9050693bb Mon Sep 17 00:00:00 2001 From: danpros Date: Thu, 18 Feb 2021 14:08:51 +0700 Subject: [PATCH] Admin panel revamp and simple menu builder --- config/config.ini.example | 5 - system/admin/admin.php | 22 +- system/admin/editor/README.txt | 0 system/admin/editor/css/editor.css | 5 - system/admin/views/add-content.html.php | 198 ++-- system/admin/views/add-page.html.php | 105 +- system/admin/views/backup.html.php | 4 +- system/admin/views/categories.html.php | 10 +- system/admin/views/clear-cache.html.php | 4 - system/admin/views/config.html.php | 28 +- system/admin/views/delete-category.html.php | 4 +- system/admin/views/delete-page.html.php | 4 +- system/admin/views/delete-post.html.php | 4 +- system/admin/views/edit-content.html.php | 223 +++-- system/admin/views/edit-page.html.php | 109 ++- system/admin/views/import.html.php | 6 +- system/admin/views/layout.html.php | 320 +++++- system/admin/views/login.html.php | 17 +- system/admin/views/main.html.php | 10 +- system/admin/views/menu.html.php | 411 ++++++++ system/admin/views/popular-posts.html.php | 9 +- system/admin/views/posts-list.html.php | 37 +- system/admin/views/static-pages.html.php | 5 + system/admin/views/update.html.php | 4 +- system/admin/views/user-draft.html.php | 35 +- system/admin/views/user-posts.html.php | 35 +- system/htmly.php | 245 +++-- system/includes/functions.php | 199 ++-- system/resources/css/admin.css | 1033 -------------------- system/resources/css/adminlte.min.css | 11 + system/resources/css/font-awesome.css | 4 + system/resources/css/toolbar.css | 2 +- system/resources/fonts/FontAwesome.otf | Bin 0 -> 93888 bytes system/resources/fonts/fontawesome-webfont.eot | Bin 0 -> 60767 bytes system/resources/fonts/fontawesome-webfont.svg | 565 +++++++++++ system/resources/fonts/fontawesome-webfont.ttf | Bin 0 -> 122092 bytes system/resources/fonts/fontawesome-webfont.woff | Bin 0 -> 71508 bytes system/resources/fonts/fontawesome-webfont.woff2 | Bin 0 -> 56780 bytes .../fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20335 bytes .../fonts/glyphicons-halflings-regular.svg | 229 +++++ .../fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 41280 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23320 bytes system/resources/js/adminlte.min.js | 6 + system/resources/js/bootstrap.min.js | 6 + system/resources/js/jquery.nestable++.js | 189 ++++ system/resources/js/jquery.nestable.js | 484 +++++++++ themes/clean/layout.html.php | 2 +- themes/default/css/style.css | 2 +- themes/default/layout.html.php | 23 - themes/readme.txt | 2 +- themes/twentyfifteen/layout.html.php | 1 + 51 files changed, 2946 insertions(+), 1671 deletions(-) delete mode 100644 system/admin/editor/README.txt create mode 100644 system/admin/views/menu.html.php create mode 100644 system/admin/views/static-pages.html.php delete mode 100644 system/resources/css/admin.css create mode 100644 system/resources/css/adminlte.min.css create mode 100644 system/resources/css/font-awesome.css create mode 100644 system/resources/fonts/FontAwesome.otf create mode 100644 system/resources/fonts/fontawesome-webfont.eot create mode 100644 system/resources/fonts/fontawesome-webfont.svg create mode 100644 system/resources/fonts/fontawesome-webfont.ttf create mode 100644 system/resources/fonts/fontawesome-webfont.woff create mode 100644 system/resources/fonts/fontawesome-webfont.woff2 create mode 100644 system/resources/fonts/glyphicons-halflings-regular.eot create mode 100644 system/resources/fonts/glyphicons-halflings-regular.svg create mode 100644 system/resources/fonts/glyphicons-halflings-regular.ttf create mode 100644 system/resources/fonts/glyphicons-halflings-regular.woff create mode 100644 system/resources/js/adminlte.min.js create mode 100644 system/resources/js/bootstrap.min.js create mode 100644 system/resources/js/jquery.nestable++.js create mode 100644 system/resources/js/jquery.nestable.js diff --git a/config/config.ini.example b/config/config.ini.example index 87facb9..e8ca3f6 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -30,11 +30,6 @@ social.twitter = "https://twitter.com" social.facebook = "https://www.facebook.com" social.tumblr = "http://www.tumblr.com" -; Custom menu link. -; See example below: -; "Google->http://www.google.com|Wikipedia->http://www.wikipedia.org". -blog.menu = "" - ; Breadcrumb home text. Useful when installed on subfolder. breadcrumb.home = "Home" diff --git a/system/admin/admin.php b/system/admin/admin.php index 3fc4f80..82cc14a 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -43,7 +43,7 @@ function session($user, $pass) { $user_file = 'config/users/' . $user . '.ini'; if (!file_exists($user_file)) { - return $str = '
  • Username not found in our record.
  • '; + return $str = '
    '; } $user_enc = user('encryption', $user); @@ -58,14 +58,14 @@ function session($user, $pass) $_SESSION[config("site.url")]['user'] = $user; header('location: admin'); } else { - return $str = '
  • Your username and password mismatch.
  • '; + return $str = '
    '; } } else if (old_password_verify($pass, $user_enc, $user_pass)) { update_user($user, $pass, $user_role); $_SESSION[config("site.url")]['user'] = $user; header('location: admin'); } else { - return $str = '
  • Your username and password mismatch.
  • '; + return $str = '
    '; } } @@ -672,7 +672,7 @@ function get_user_posts() if (isset($_SESSION[config("site.url")]['user'])) { $posts = get_profile_posts($_SESSION[config("site.url")]['user'], 1, 5); if (!empty($posts)) { - echo ''; + echo '
    '; echo ''; if (config("views.counter") == "true") echo ''; @@ -695,7 +695,7 @@ function get_user_posts() echo ''; echo ''; echo ''; - echo ''; + echo ''; echo ''; } echo '
    ' . i18n('Title') . '' . i18n('Published') . 'Views' . $p->views . '' . $p->category . '' . $p->tag . '' . i18n('Edit') . ' ' . i18n('Delete') . '' . i18n('Edit') . ' ' . i18n('Delete') . '
    '; @@ -710,7 +710,7 @@ function get_user_pages() $posts = get_static_post(null); if (!empty($posts)) { krsort($posts); - echo ''; + echo '
    '; echo ''; if (config("views.counter") == "true") echo ''; @@ -731,7 +731,7 @@ function get_user_pages() echo ''; if (config("views.counter") == "true") echo ''; - echo ''; + echo ''; echo ''; $shortUrl = substr($p->url, strrpos($p->url, "/") + 1); @@ -739,10 +739,10 @@ function get_user_pages() foreach ($subPages as $sp) { echo ''; - echo ''; + echo ''; if (config("views.counter") == "true") echo ''; - echo ''; + echo ''; echo ''; } } @@ -758,7 +758,7 @@ function get_backup_files() $files = get_zip_files(); if (!empty($files)) { krsort($files); - echo '
    ' . i18n('Title') . 'Views' . $p->title . '' . $p->views . '' . i18n('Add_sub') . ' ' . i18n('Edit') . ' ' . i18n('Delete') . '' . i18n('Add_sub') . ' ' . i18n('Edit') . ' ' . i18n('Delete') . '
    »' . $sp->title . ' » ' . $sp->title . '' . $sp->views . '' . i18n('Edit') . ' ' . i18n('Delete') . '' . i18n('Edit') . ' ' . i18n('Delete') . '
    '; + echo '
    '; echo ''; $i = 0; $len = count($files); @@ -790,7 +790,7 @@ function get_backup_files() echo ''; echo ''; echo ''; - echo ''; + echo ''; echo ''; } echo '
    ' . i18n('Filename') . 'Date' . i18n('Operations') . '
    ' . $name . '' . $timestamp . 'Download
    Download
    '; diff --git a/system/admin/editor/README.txt b/system/admin/editor/README.txt deleted file mode 100644 index e69de29..0000000 diff --git a/system/admin/editor/css/editor.css b/system/admin/editor/css/editor.css index 52a09ca..8294c11 100644 --- a/system/admin/editor/css/editor.css +++ b/system/admin/editor/css/editor.css @@ -9,9 +9,7 @@ blockquote { } .wmd-panel { - width: 44%; float: left; - padding-right: 20px; } .wmd-button-bar { @@ -30,13 +28,10 @@ blockquote { .wmd-input { min-height: 300px; - width: 96%; - padding: 2%; } .wmd-preview { background-color: #E4EBF1; - width: 46%; float: left; padding: 2%; } diff --git a/system/admin/views/add-content.html.php b/system/admin/views/add-content.html.php index dacea89..d19f7f9 100644 --- a/system/admin/views/add-content.html.php +++ b/system/admin/views/add-content.html.php @@ -14,7 +14,6 @@ $tags = tag_cloud(true); ?> - @@ -74,103 +73,112 @@ $( function() {
    -
    -
    - -
    - -

    - -
    - -

    - -
    - -

    - -
    - -
    - If the url leave empty we will use the post title. -

    - -
    - -

    - - - -
    - - -
    - - - - -
    - - -
    - - - - -
    - - -
    - - - - -
    - - -
    - - - - -
    - - -
    - - - - - - -
    - -
    - - -
    -
    +
    +
    +
    +
    +
    + + +
    + + +
    + + +
    + + +
    +
    + +
    + + + +
    + + + + + +
    + + + + + + +
    + + + + + + +
    + + + + + + +
    + + + + + + +
    + + + + + + +
    +
    +
    +
    +
    + +
    +
    + +

    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + +
    +

    URL

    + +

    Upload

    +
    + +
    +
    - - -
    -

    URL

    - -

    Upload

    -
    - -
    -
    \ No newline at end of file diff --git a/system/admin/views/add-page.html.php b/system/admin/views/add-page.html.php index 5fb3bf2..3ab7bf8 100644 --- a/system/admin/views/add-page.html.php +++ b/system/admin/views/add-page.html.php @@ -12,54 +12,67 @@
    -
    -
    - -
    - -

    - - -
    - -
    - If the url leave empty we will use the page title. -

    - -
    - -

    - - - -
    - - -
    - - - - - - - -
    -
    - - +
    +
    +
    +
    +
    + + +
    + + + +
    + + +
    +
    + + + +
    + +
    +
    + +
    +
    + +
    + +
    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + -
    -

    URL

    - -

    Upload

    -
    - -
    +
    +

    URL

    + +

    Upload

    +
    + +
    +
    -
    \ No newline at end of file diff --git a/system/admin/views/backup.html.php b/system/admin/views/backup.html.php index d6fc60f..84bb868 100644 --- a/system/admin/views/backup.html.php +++ b/system/admin/views/backup.html.php @@ -10,6 +10,8 @@ if (login()) { } } ?> - Create backup

    Your backups

    +
    + Create backup +

    \ No newline at end of file diff --git a/system/admin/views/categories.html.php b/system/admin/views/categories.html.php index fa20fcc..0eccea7 100644 --- a/system/admin/views/categories.html.php +++ b/system/admin/views/categories.html.php @@ -1,7 +1,9 @@ - - - +

    Categories

    +
    + +

    +
    @@ -19,7 +21,7 @@ - +
    Name title;?> body;?> md) + get_categorycount($d->md); echo $total?> md) == 0 && get_draftcount($d->md) == 0 ){echo '' . i18n('Delete') . '';}?> md) == 0 && get_draftcount($d->md) == 0 ){echo '' . i18n('Delete') . '';}?>
    \ No newline at end of file diff --git a/system/admin/views/clear-cache.html.php b/system/admin/views/clear-cache.html.php index 2359c66..25ca233 100644 --- a/system/admin/views/clear-cache.html.php +++ b/system/admin/views/clear-cache.html.php @@ -5,10 +5,6 @@ $draft = array(); $files = glob('content/*/blog/*.md', GLOB_NOSORT); $draft = glob('content/*/draft/*.md', GLOB_NOSORT); -if (!empty($files) || !empty($draft)) { - migrate_old_content(); -} - rebuilt_cache('all'); foreach (glob('cache/page/*.cache', GLOB_NOSORT) as $file) { diff --git a/system/admin/views/config.html.php b/system/admin/views/config.html.php index b6fa129..313fdcb 100644 --- a/system/admin/views/config.html.php +++ b/system/admin/views/config.html.php @@ -1,19 +1,17 @@ -

    Your Settings:

    -

    - hint: Use Ctrl/CMD⌘ + F to search for your config key or value. -

    -

    - pro tips: You can creating custom config key and print out your config key value anywhere in your template. -

    -
    <?php echo config('your.key'); ?>
    -
    +

    Your Settings

    +
    +

    hint: Use Ctrl/CMD⌘ + F to search for your config key or value.

    +

    pro tips: You can creating custom config key and print out your config key value anywhere in your template.

    +

    <?php echo config('your.key'); ?>

    +
    - - + +

    +
    - - + + $value) { echo ''; echo ''; - echo ''; + echo ''; echo ''; } ?>
    - +
    diff --git a/system/admin/views/delete-category.html.php b/system/admin/views/delete-category.html.php index b109908..147e90e 100644 --- a/system/admin/views/delete-category.html.php +++ b/system/admin/views/delete-category.html.php @@ -25,6 +25,6 @@ if (isset($destination)) {

    - - ' . i18n('Cancel');?> + + ' . i18n('Cancel');?>
    \ No newline at end of file diff --git a/system/admin/views/delete-page.html.php b/system/admin/views/delete-page.html.php index b109908..147e90e 100644 --- a/system/admin/views/delete-page.html.php +++ b/system/admin/views/delete-page.html.php @@ -25,6 +25,6 @@ if (isset($destination)) {

    - - ' . i18n('Cancel');?> + + ' . i18n('Cancel');?>
    \ No newline at end of file diff --git a/system/admin/views/delete-post.html.php b/system/admin/views/delete-post.html.php index 11507c0..72b3c03 100644 --- a/system/admin/views/delete-post.html.php +++ b/system/admin/views/delete-post.html.php @@ -33,6 +33,6 @@ if (isset($destination)) {

    - - ' . i18n('Cancel');?> + + ' . i18n('Cancel');?>
    \ No newline at end of file diff --git a/system/admin/views/edit-content.html.php b/system/admin/views/edit-content.html.php index 27c73d3..2f4b836 100644 --- a/system/admin/views/edit-content.html.php +++ b/system/admin/views/edit-content.html.php @@ -118,111 +118,128 @@ $( function() {
    -
    -
    - -
    - -

    - -
    - -

    - -
    -

    - -
    - -
    - If the url leave empty we will use the post title. -

    - -
    - -
    - -
    - -

    - -
    - -

    - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - -
    - -
    - -
    - - - - - - - -
    -
    +
    +
    +
    +
    +
    + + +
    + + +
    + + +
    + + + +
    +
    + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    + + + + + +
    + + + + + + +
    + + + + + + +
    + + + + + + +
    + + + + + + +
    + + + + + + + +
    +
    +
    +
    +
    + +
    +
    + + + + + +

    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + + +
    +

    URL

    + +

    Upload

    +
    + +
    +
    - - -
    -

    URL

    - -

    Upload

    -
    - -
    - -
    diff --git a/system/admin/views/edit-page.html.php b/system/admin/views/edit-page.html.php index 61ea563..c7a506c 100644 --- a/system/admin/views/edit-page.html.php +++ b/system/admin/views/edit-page.html.php @@ -77,54 +77,71 @@ if ($type == 'is_frontpage') {
    -
    -
    - -
    -

    - - -
    - -
    - If the url leave empty we will use the page title. -

    - -
    - -

    - - -
    - -
    - - - - - - - - - - -
    -
    - - +
    +
    +
    +
    +
    + + +
    + + +
    + +

    + +
    +
    + + +
    + +
    + +
    +
    + +
    +
    + +
    + +
    + + + + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    + + -
    -

    URL

    - -

    Upload

    -
    - -
    +
    +

    URL

    + +

    Upload

    +
    + +
    +
    -
    \ No newline at end of file diff --git a/system/admin/views/import.html.php b/system/admin/views/import.html.php index cdf4835..be80ae4 100644 --- a/system/admin/views/import.html.php +++ b/system/admin/views/import.html.php @@ -4,12 +4,12 @@

    Import RSS Feed 2.0

    By using this importer you are agree if the feed is yours, or at least you have the authority to publish it.

    - Feed Url *
    *

    + } ?>" name="url"/>
    Add source link (optional)

    - +
    \ No newline at end of file diff --git a/system/admin/views/layout.html.php b/system/admin/views/layout.html.php index 92ffc77..b7dfc45 100644 --- a/system/admin/views/layout.html.php +++ b/system/admin/views/layout.html.php @@ -1,62 +1,280 @@ - + - - <?php echo $title;?> - - - - - - - - - + + + + <?php echo $title;?> + + + + + - -
    - - -
    - -
    -