From 113673814b93650579747ff104e781f61d2e54b1 Mon Sep 17 00:00:00 2001 From: Michalis Kamburelis Date: Tue, 29 Oct 2024 02:27:41 +0100 Subject: [PATCH] Simplify pretty_heading, subheading_text --- .../kambi_common.php | 20 ++++--------------- htdocs/castle_engine_functions.php | 6 +----- htdocs/castle_script.php | 3 +-- htdocs/creating_data_intro.php | 4 +--- htdocs/creating_data_xml.php | 4 +--- htdocs/engine_doc.php | 5 +++-- htdocs/mountains_of_fire.php | 2 +- 7 files changed, 12 insertions(+), 32 deletions(-) diff --git a/htdocs/castle-engine-website-base/kambi_common.php b/htdocs/castle-engine-website-base/kambi_common.php index 34360cc94b..751e944e21 100644 --- a/htdocs/castle-engine-website-base/kambi_common.php +++ b/htdocs/castle-engine-website-base/kambi_common.php @@ -128,23 +128,11 @@ /* functions ======================================================= */ /* Return HTML heading (

). - Given $heading_text, $version_number, $subheading_text will be sanitized for HTML display - (so you cannot use there HTML tags). - - You may supply $version_number, this is intended for pages - that document functionality of some program. - - You may supply $subheading_text, this will be printed in newline - and with smaller font below heading text. */ -function pretty_heading($heading_text, $version_number = NULL, $subheading_text = '') + Given $heading_text will be sanitized for HTML display + (so you cannot use there HTML tags). */ +function pretty_heading($heading_text) { - $result = '

' . htmlspecialchars($heading_text); - if (!is_null($version_number)) - $result .= ' ' . htmlspecialchars($version_number) . ''; - if (!empty($subheading_text)) - $result .= '
' . htmlspecialchars($subheading_text) . ''; - $result .= '

'; - + $result = '

' . htmlspecialchars($heading_text) .'

'; return $result; } diff --git a/htdocs/castle_engine_functions.php b/htdocs/castle_engine_functions.php index fa662aa989..3133c45175 100644 --- a/htdocs/castle_engine_functions.php +++ b/htdocs/castle_engine_functions.php @@ -1027,9 +1027,6 @@ function echo_header_bonus () name of image to be used as Facebook share image (og:image); relative to in images/original_size/ , unless it's an absolute URL, with a protocol like http[s] etc.) - - 'subheading_text' (string, - will be shown in page content, within pretty_heading. - Only relevant when page is part of some book.) */ function castle_header($a_page_title, array $parameters = array()) { @@ -1087,8 +1084,7 @@ function castle_header($a_page_title, array $parameters = array()) // output extra header HTML, in case we're part of book if ($castle_current_book != NULL) { echo book_bar($castle_current_book); - $subheading_text = isset($parameters['subheading_text']) ? $parameters['subheading_text'] : ''; - echo pretty_heading($a_page_title_without_book, NULL, $subheading_text); + echo pretty_heading($a_page_title_without_book); } } diff --git a/htdocs/castle_script.php b/htdocs/castle_script.php index 36de60fc94..0d68dd91fb 100644 --- a/htdocs/castle_script.php +++ b/htdocs/castle_script.php @@ -14,8 +14,7 @@ function func($name, $title) } ?> - + 'for games using Castle Game Engine' -)); +castle_header('Creating Game Data'); ?>

This guide discusses various aspects of preparing game data for use diff --git a/htdocs/creating_data_xml.php b/htdocs/creating_data_xml.php index 5974023e2f..c86299f993 100644 --- a/htdocs/creating_data_xml.php +++ b/htdocs/creating_data_xml.php @@ -1,8 +1,6 @@ '(level.xml, resource.xml and others)' -)); +castle_header('XML files describing game data (level.xml, resource.xml and others)'); ?>

In this documentation we show a sample of XML files useful to define diff --git a/htdocs/engine_doc.php b/htdocs/engine_doc.php index 3a1b9aca51..a642b99c2d 100644 --- a/htdocs/engine_doc.php +++ b/htdocs/engine_doc.php @@ -7,13 +7,14 @@ )); ?> - +

Most of this documentation was originally written as my master's thesis, passed in September 2006. Although I was occasionally updating and adding content to this document later.

+

This is an outdated overview of the Castle Game Engine and VRML 1.0. +

Warning: This document isn't a good introduction to the Castle Game Engine (anymore)!