Commit 5748d0b1 authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4607 (Fix legacy issues in (mostly) Code Book)

parent 6c2d8ce2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ class lang_html_safe_test_set extends cms_test_case
        $forms = array(
            '#do_lang_tempcode\(\'(.+?)\'(,|\))#ims',
            '#do_lang_tempcode\(\\\\\'(.+?)\\\\\'(,|\))#ims',
            '#get_page_title\(\'(.+?)\'(\,|\))#ims',
            '#get_screen_title\(\'(.+?)\'(\,|\))#ims',
        );
        foreach ($forms as $php) {
            $this->do_dir(get_file_base(), '', $php, 'php');
+43 −40
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ class Module_example
        // Bare essentials of this function only here because I'm keeping this
        // example as short as possible. We would normally expect this function
        // to be properly defined.
        return array('version' => 1,'hack_version' => 1,'hacked_by' => 'Bob');
        return array('author' => 'Bob', 'organisation' => 'Bob Corp', 'version' => 1,'hack_version' => 1,'hacked_by' => 'Bob');
    }

    // This is the function called when the module is loaded up to produce
@@ -593,7 +593,7 @@ class Module_example
    public function screen_a()
    {
        // We normally would use a lang string but this is a short and simple example.
        $title = get_page_title('Example Title',false); // false='not a lang string'
        $title = get_screen_title('Example Title',false); // false='not a lang string'

        // Produce a URL to screen_b of this module ("this module"=same page, same zone)
        $screen_b_url = build_url(array('page' => '_SELF','type' => 'screen_b'),'_SELF');
@@ -608,7 +608,7 @@ class Module_example
    public function screen_b()
    {
        // We normally would use a lang string but this is a short and simple example.
        $title = get_page_title('Example Title 2',false); // false='not a lang string'
        $title = get_screen_title('Example Title 2',false); // false='not a lang string'

        // Read in our 'my_checkbox' POST value. Because it's a checkbox, it will only
        // be present if it was actually ticked (checked). So we need to supply a default of 0
@@ -644,6 +644,9 @@ This parameter gets escaped via '*' because it comes in plain-text
(contains '&' instead of '&amp').
-->
<form action="{SCREEN_B_URL*}" method="post">
	<!-- This catches spam, but most critically it adds the CSRF token which is necessary for POST requests -->
	{$INSERT_SPAMMER_BLACKHOLE}

	<!--
	Put in our checkbox using standard HTML.
	Because Composr is WCAG (accessibility) compliant,
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ The do-next-manager provides a full-screen choice of options, laying out those o
The do-next-browser is called up by passing in an array of lines. Here is an example of a simplified call to one (the [tt]do_lang[/tt] lookups have been removed -- this is hard-coded as English for simplicity):
[code="PHP"]
return do_next_manager(
	get_page_title('Page Title'),
	get_screen_title('Page Title'),
	make_string_tempcode('Text to show on the page'),
	array(
		...