From d8d114f9de803704a5d18fc7011daae80c8dc1d2 Mon Sep 17 00:00:00 2001 From: danpros Date: Mon, 1 Jan 2024 18:39:11 +0700 Subject: [PATCH] Rename function Far more easier to remember --- system/admin/admin.php | 8 ++++---- system/admin/views/edit-page.html.php | 2 +- system/admin/views/static-pages.html.php | 4 ++-- system/admin/views/user-draft.html.php | 4 ++-- system/htmly.php | 32 ++++++++++++++++---------------- system/includes/functions.php | 6 +++--- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/system/admin/admin.php b/system/admin/admin.php index 4661c2b..18cb423 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -1214,8 +1214,8 @@ function rename_category_folder($new_name, $old_file) } -// Return static page. -function find_draft_pages($static = null) +// Return draft static page. +function find_draft_page($static = null) { $posts = get_draft_pages(); @@ -1264,8 +1264,8 @@ function find_draft_pages($static = null) return $tmp; } -// Return static page. -function find_draft_subpages($static = null, $sub_static = null) +// Return draft static subpage. +function find_draft_subpage($static = null, $sub_static = null) { $posts = get_draft_subpages(); diff --git a/system/admin/views/edit-page.html.php b/system/admin/views/edit-page.html.php index 6c3da74..e0f0e26 100644 --- a/system/admin/views/edit-page.html.php +++ b/system/admin/views/edit-page.html.php @@ -118,7 +118,7 @@ $images = get_gallery(); - + diff --git a/system/admin/views/static-pages.html.php b/system/admin/views/static-pages.html.php index 567b4c8..c2aaef7 100644 --- a/system/admin/views/static-pages.html.php +++ b/system/admin/views/static-pages.html.php @@ -4,7 +4,7 @@

- @@ -25,7 +25,7 @@
- md); + md); foreach ($subPages as $sp):?>
diff --git a/system/admin/views/user-draft.html.php b/system/admin/views/user-draft.html.php index 41a76db..37aefea 100644 --- a/system/admin/views/user-draft.html.php +++ b/system/admin/views/user-draft.html.php @@ -55,7 +55,7 @@
- md)); ?> + md)); ?> @@ -77,7 +77,7 @@ - parent);?> + parent);?> diff --git a/system/htmly.php b/system/htmly.php index 47a092d..94e2857 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -938,9 +938,9 @@ get('/admin/draft', function () { $posts = get_draft($name, $page, $perpage); - $draftPages = find_draft_pages(); + $draftPages = find_draft_page(); - $draftSubpages = find_draft_subpages(); + $draftSubpages = find_draft_subpage(); $total = get_draftcount($name); @@ -2864,7 +2864,7 @@ get('/:static', function ($static) { } } - $post = get_static_post($static); + $post = find_page($static); if (array_key_exists('prev', $post)) { $prev = $post['prev']; @@ -2933,7 +2933,7 @@ get('/:static/add', function ($static) { config('views.root', 'system/admin/views'); - $post = get_static_post($static); + $post = find_page($static); if (!$post) { not_found(); @@ -3007,10 +3007,10 @@ get('/:static/edit', function ($static) { if (login()) { config('views.root', 'system/admin/views'); - $post = get_static_post($static); + $post = find_page($static); if (!$post) { - $post = find_draft_pages($static); + $post = find_draft_page($static); if (!$post) { not_found(); } else { @@ -3096,10 +3096,10 @@ get('/:static/delete', function ($static) { if (login()) { config('views.root', 'system/admin/views'); - $post = get_static_post($static); + $post = find_page($static); if (!$post) { - $post = find_draft_pages($static); + $post = find_draft_page($static); if (!$post) { not_found(); } else { @@ -3151,11 +3151,11 @@ get('/:static/:sub', function ($static, $sub) { header("location: $redir", TRUE, 301); } - $parent_post = get_static_post($static); + $parent_post = find_page($static); if (!$parent_post) { not_found(); } - $post = get_static_sub_post($static, $sub); + $post = find_subpage($static, $sub); if (array_key_exists('prev', $post)) { $prev = $post['prev']; @@ -3228,7 +3228,7 @@ get('/:static/:sub/edit', function ($static, $sub) { if (login()) { config('views.root', 'system/admin/views'); - $post = get_static_post($static); + $post = find_page($static); if (!$post) { not_found(); @@ -3236,10 +3236,10 @@ get('/:static/:sub/edit', function ($static, $sub) { $post = $post['current']; - $page = get_static_sub_post($static, $sub); + $page = find_subpage($static, $sub); if (!$page) { - $page = find_draft_subpages($static, $sub); + $page = find_draft_subpage($static, $sub); if (!$page) { not_found(); } else { @@ -3330,7 +3330,7 @@ get('/:static/:sub/delete', function ($static, $sub) { if (login()) { config('views.root', 'system/admin/views'); - $post = get_static_post($static); + $post = find_page($static); if (!$post) { not_found(); @@ -3338,10 +3338,10 @@ get('/:static/:sub/delete', function ($static, $sub) { $post = $post['current']; - $page = get_static_sub_post($static, $sub); + $page = find_subpage($static, $sub); if (!$page) { - $page = find_draft_subpages($static, $sub); + $page = find_draft_subpage($static, $sub); if (!$page) { not_found(); } else { diff --git a/system/includes/functions.php b/system/includes/functions.php index da0f077..ed823b3 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -1083,7 +1083,7 @@ function default_profile($name) } // Return static page. -function get_static_post($static = null) +function find_page($static = null) { $pages = get_static_pages(); @@ -1165,8 +1165,8 @@ function get_static_post($static = null) return $tmp; } -// Return static page. -function get_static_sub_post($static, $sub_static = null) +// Return static subpage. +function find_subpage($static, $sub_static = null) { $sub_pages = array_values(get_static_subpages($static));
title ?> lastMod) ?>
title ?> lastMod) ?>