]> git.bts.cx Git - cx.git/commitdiff
Fixes for pages
authorBen Sherratt <redacted>
Fri, 3 Jul 2026 18:02:15 +0000 (19:02 +0100)
committerBen Sherratt <redacted>
Fri, 3 Jul 2026 18:02:15 +0000 (19:02 +0100)
cx/cx.php
cx/lib/posts.php

index d54b3d4f12133e19af14f2169a948d4e8171b959..35b2722d4c400e145697a0ff683ed5e4830f02c4 100644 (file)
--- a/cx/cx.php
+++ b/cx/cx.php
@@ -126,15 +126,15 @@ function cx_route($path) {
                                        if (isset($slug) == false) $slug = null;
                                        $date = cx_form_input_sanitized_date_time('post_date');
                                        if (isset($date) == false) $date = null;
-                                       $page = cx_form_input_sanitized('post_is_page') == 'page';
-                                       $draft = cx_form_input_sanitized('post_is_draft') == 'draft';
+                                       $is_page = cx_form_input_sanitized('post_is_page') == 'page';
+                                       $is_draft = cx_form_input_sanitized('post_is_draft') == 'draft';
                                        $data = cx_form_input_sanitized_allowing_html('post_data');
                                        
                                        if (isset($_GET['id']) == false or $_GET['id'] == 0) {
-                                               cx_posts_add_post(1, $title, $slug, $date, $page, $draft, $data);
+                                               cx_posts_add_post(1, $title, $slug, $date, $is_page, $is_draft, $data);
                                        } else {
                                                $id = $_GET['id'];
-                                               cx_posts_update_post($id, $title, $slug, $date, $page, $draft, $data);
+                                               cx_posts_update_post($id, $title, $slug, $date, $is_page, $is_draft, $data);
                                        }
                                        
                                        cx_http_redirect(cx_url_admin('/'));
index 64374333e6636212486f084cd7c838c6016a2b96..f056c8834797ada3b96a028e07c61a5f6c283b80 100644 (file)
@@ -19,6 +19,7 @@ class Post {
        public $title;
        public $slug;
        public $date;
+       public $is_page;
        public $is_draft;
        public $data;
        public $html_content;
@@ -29,6 +30,7 @@ class Post {
                $this->title = $dict['post_title'];
                $this->slug = $dict['post_slug'];
                $this->date = $dict['post_date'];
+               $this->is_page = $dict['post_is_page'];
                $this->is_draft = $dict['post_is_draft'];
                $this->data = $dict['post_data'];
                $this->html_content = cx_markdown_generate_html($this->data);