]> git.mjollnir.org Git - moodle.git/commitdiff
outputlib pagelib MDL-19236 Cleaned up PHPdocs on a couple of functions
authorsamhemelryk <samhemelryk>
Wed, 1 Jul 2009 03:47:52 +0000 (03:47 +0000)
committersamhemelryk <samhemelryk>
Wed, 1 Jul 2009 03:47:52 +0000 (03:47 +0000)
lib/outputlib.php
lib/pagelib.php

index 70d0f8c333817afe5530a45ee11d6d3f1e1f0fd7..9187a8c30177451c59395c896d31f844bb869b56 100644 (file)
@@ -886,13 +886,42 @@ class moodle_core_renderer extends moodle_renderer_base {
         }
     }
 
+    /**
+     * Checks if we are in the body yet or not and returns true if we are in
+     * the body, false if we havn't reached it yet
+     *
+     * @uses moodle_page::STATE_IN_BODY
+     * @return bool True for in body, false if before
+     */
     public function has_started() {
-        if ($this->page->state >= moodle_page::STATE_IN_BODY) {
-            return true;
-        }
-        return false;
+        return ($this->page->state >= moodle_page::STATE_IN_BODY);
     }
 
+    /**
+     * Redirects the user by any means possible given the current state
+     *
+     * This function should not be called directly, it should always be called using
+     * the redirect function in lib/weblib.php
+     *
+     * The redirect function should really only be called before page output has started
+     * however it will allow itself to be called during the state STATE_IN_BODY
+     *
+     * @global object
+     * @uses DEBUG_DEVELOPER
+     * @uses DEBUG_ALL
+     * @uses moodle_page::STATE_BEFORE_HEADER
+     * @uses moodle_page::STATE_PRINTING_HEADER
+     * @uses moodle_page::STATE_IN_BODY
+     * @uses moodle_page::STATE_DONE
+     * @param string $encodedurl The URL to send to encoded if required
+     * @param string $message The message to display to the user if any
+     * @param int $delay The delay before redirecting a user, if $message has been
+     *         set this is a requirement and defaults to 3, set to 0 no delay
+     * @param string $messageclass The css class to put on the message that is
+     *         being displayed to the user
+     * @return string The HTML to display to the user before dying, may contain
+     *         meta refresh, javascript refresh, and may have set header redirects
+     */
     public function redirect($encodedurl, $message, $delay, $messageclass='notifyproblem') {
         global $CFG;
         $url = str_replace('&amp;', '&', $encodedurl);
index 53e551c0682661c728d7b0b38a4d632ed65cb33c..a866db125dbeac25397ba980cde4d473235b30a0 100644 (file)
@@ -45,6 +45,7 @@
  * @property-read string $heading the main heading that should be displayed at the top of the <body>.
  * @property-read string $cacheable defaults to true. Set to false to stop the page being cached at all.
  * @property-read page_requirements_manager $requires Tracks resources (for example required .css and .js files) required by this page.
+ * @property-read int $periodicrefreshdelay Returns the delay in seconds to use in a meta refresh call set this by calling {@link set_periodicrefreshdelay()}
  */
 class moodle_page {
     /**#@+ Tracks the where we are in the generation of the page. */
@@ -395,7 +396,9 @@ class moodle_page {
     }
 
     /**
-     *
+     * Please do not call this method directly use the ->periodicrefreshdelay syntax
+     * {@link __get()}
+     * @return int The periodic refresh delay to use with meta refresh
      */
     public function get_periodicrefreshdelay() {
         return $this->_periodicrefreshdelay;
@@ -405,6 +408,8 @@ class moodle_page {
      * PHP overloading magic to make the $PAGE->course syntax work by redirecting
      * it to the corresponding $PAGE->get_course() method if there is one, and
      * throwing an exception if not.
+     *
+     *
      */
     public function __get($field) {
         $getmethod = 'get_' . $field;