MDL-30979 output: Changes after peer-review

This commit is contained in:
Sam Hemelryk
2012-02-17 14:53:10 +13:00
parent 76be40ccf9
commit 3d3fae7259
4 changed files with 66 additions and 63 deletions
+31 -30
View File
@@ -31,6 +31,7 @@ defined('MOODLE_INTERNAL') || die();
/**
* Interface marking other classes as suitable for renderer_base::render()
*
* @copyright 2010 Petr Skoda (skodak) [email protected]
* @package core_output
* @category output
@@ -158,13 +159,13 @@ class user_picture implements renderable {
public $size = 35;
/**
* @var boolean Add non-blank alt-text to the image.
* @var bool Add non-blank alt-text to the image.
* Default true, set to false when image alt just duplicates text in screenreaders.
*/
public $alttext = true;
/**
* @var boolean Whether or not to open the link in a popup window.
* @var bool Whether or not to open the link in a popup window.
*/
public $popup = false;
@@ -594,7 +595,7 @@ class single_button implements renderable {
var $class = 'singlebutton';
/**
* @var boolean True if button disabled, false if normal
* @var bool True if button disabled, false if normal
*/
var $disabled = false;
@@ -706,7 +707,7 @@ class single_select implements renderable {
var $class = 'singleselect';
/**
* @var boolean True if button disabled, false if normal
* @var bool True if button disabled, false if normal
*/
var $disabled = false;
@@ -838,7 +839,7 @@ class url_select implements renderable {
var $class = 'urlselect';
/**
* @var boolean True if button disabled, false if normal
* @var bool True if button disabled, false if normal
*/
var $disabled = false;
@@ -1094,8 +1095,8 @@ class html_writer {
*
* @staticvar int $counter
* @staticvar type $uniq
* @param type $base
* @return type
* @param string $base A string fragment that will be included in the random ID.
* @return string A unique ID
*/
public static function random_id($base='random') {
static $counter = 0;
@@ -1112,9 +1113,9 @@ class html_writer {
/**
* Generates a simple html link
*
* @param string|moodle_url $url
* @param string $text link txt
* @param array $attributes extra html attributes
* @param string|moodle_url $url The URL
* @param string $text The text
* @param array $attributes HTML attributes
* @return string HTML fragment
*/
public static function link($url, $text, array $attributes = null) {
@@ -1126,11 +1127,11 @@ class html_writer {
/**
* Generates a simple checkbox with optional label
*
* @param string $name
* @param string $value
* @param bool $checked
* @param string $label
* @param array $attributes
* @param string $name The name of the checkbox
* @param string $value The value of the checkbox
* @param bool $checked Whether the checkbox is checked
* @param string $label The label for the checkbox
* @param array $attributes Any attributes to apply to the checkbox
* @return string html fragment
*/
public static function checkbox($name, $value, $checked = true, $label = '', array $attributes = null) {
@@ -1719,11 +1720,11 @@ class js_writer {
}
/**
* Special function which adds Y as first argument of fucntion call.
* Special function which adds Y as first argument of function call.
*
* @param string $function
* @param array $extraarguments
* @return string
* @param string $function The function to call
* @param array $extraarguments Any arguments to pass to it
* @return string Some JS code
*/
public static function function_call_with_Y($function, array $extraarguments = null) {
if ($extraarguments) {
@@ -1738,12 +1739,12 @@ class js_writer {
/**
* Returns JavaScript code to initialise a new object
*
* @param string $var If it is null then no var is assigned the new object
* @param string $class
* @param array $arguments
* @param array $requirements
* @param int $delay
* @return string
* @param string $var If it is null then no var is assigned the new object.
* @param string $class The class to initialise an object for.
* @param array $arguments An array of args to pass to the init method.
* @param array $requirements Any modules required for this class.
* @param int $delay The delay before initialisation. 0 = no delay.
* @return string Some JS code
*/
public static function object_init($var, $class, array $arguments = null, array $requirements = null, $delay=0) {
if (is_array($arguments)) {
@@ -2069,7 +2070,7 @@ class html_table_cell {
public $scope = null;
/**
* @var boolean Whether or not this cell is a header cell.
* @var bool Whether or not this cell is a header cell.
*/
public $header = null;
@@ -2287,7 +2288,7 @@ class block_contents {
protected static $idcounter = 1;
/**
* @var integer All the blocks (or things that look like blocks) printed on
* @var int All the blocks (or things that look like blocks) printed on
* a page are given a unique number that can be used to construct id="" attributes.
* This is set automatically be the {@link prepare()} method.
* Do not try to set it manually.
@@ -2295,13 +2296,13 @@ class block_contents {
public $skipid;
/**
* @var integer If this is the contents of a real block, this should be set
* @var int If this is the contents of a real block, this should be set
* to the block_instance.id. Otherwise this should be set to 0.
*/
public $blockinstanceid = 0;
/**
* @var integer If this is a real block instance, and there is a corresponding
* @var int If this is a real block instance, and there is a corresponding
* block_position.id for the block on this page, this should be set to that id.
* Otherwise it should be 0.
*/
@@ -2338,7 +2339,7 @@ class block_contents {
public $annotation = '';
/**
* @var integer One of the constants NOT_HIDEABLE, VISIBLE, HIDDEN. Whether
* @var int One of the constants NOT_HIDEABLE, VISIBLE, HIDDEN. Whether
* the user can toggle whether this block is visible.
*/
public $collapsible = self::NOT_HIDEABLE;
+7 -7
View File
@@ -39,7 +39,7 @@ require_once($CFG->libdir.'/outputrequirementslib.php');
*
* This method deletes the phsyical directory that is used to cache the theme
* files used for serving.
* Because it deletes the main theme cache directoy all theme's are reset by
* Because it deletes the main theme cache directoy all themes are reset by
* this function.
*/
function theme_reset_all_caches() {
@@ -85,10 +85,10 @@ function theme_get_revision() {
* This class represents the configuration variables of a Moodle theme.
*
* All the variables with access: public below (with a few exceptions that are marked)
* are the properties you can set in your theme's config.php file.
* are the properties you can set in your themes config.php file.
*
* There are also some methods and protected variables that are part of the inner
* workings of Moodle's themes system. If you are just editing a theme's config.php
* workings of Moodle's themes system. If you are just editing a themes config.php
* file, you can just ignore those, and the following information for developers.
*
* Normally, to create an instance of this class, you should use the
@@ -112,9 +112,9 @@ class theme_config {
/**
* @var array You can base your theme on other themes by linking to the other theme as
* parents. This lets you use the CSS and layouts from the other themes
* (see {@link $layouts}).
* (see {@see theme_config::$layouts}).
* That makes it easy to create a new theme that is similar to another one
* but with a few changes. In this theme's CSS you only need to override
* but with a few changes. In this themes CSS you only need to override
* those rules you want to change.
*/
public $parents;
@@ -814,7 +814,7 @@ class theme_config {
}
/**
* Resolves an exclude setting to the theme's setting is applicable or the
* Resolves an exclude setting to the themes setting is applicable or the
* setting of its closest parent.
*
* @param string $variable The name of the setting the exclude setting to resolve
@@ -859,7 +859,7 @@ class theme_config {
* This method post processes all of the CSS before it is served for this theme.
* This is done so that things such as image URL's can be swapped in and to
* run any specific CSS post process method the theme has requested.
* This allows theme's to use CSS settings.
* This allows themes to use CSS settings.
*
* @param string $css The CSS to process.
* @return string The processed CSS.
+26 -24
View File
@@ -69,7 +69,7 @@ class renderer_base {
/**
* Constructor
*
* The constructor takes two arguments. The first the page that the renderer
* The constructor takes two arguments. The first is the page that the renderer
* has been created to assist with, and the second is the target.
* The target is an additional identifier that can be used to load different
* renderers for different options.
@@ -88,7 +88,7 @@ class renderer_base {
*
* The provided widget needs to be an object that extends the renderable
* interface.
* If will then be renderer by a method based upon the classname for the widget.
* If will then be rendered by a method based upon the classname for the widget.
* For instance a widget of class `crazywidget` will be rendered by a protected
* render_crazywidget method of this renderer.
*
@@ -186,8 +186,9 @@ class renderer_base {
class plugin_renderer_base extends renderer_base {
/**
* @var renderer_base A reference to the current general renderer
* probably {@see core_renderer}
* @var renderer_base|core_renderer A reference to the current renderer.
* The renderer provided here will be determined by the page but will in 90%
* of cases by the {@see core_renderer}
*/
protected $output;
@@ -252,19 +253,19 @@ class core_renderer extends renderer_base {
* Do NOT use, please use <?php echo $OUTPUT->main_content() ?>
* in layout files instead.
* @deprecated
* @var string used in {@link header()}.
* @var string used in {@see core_renderer::header()}.
*/
const MAIN_CONTENT_TOKEN = '[MAIN CONTENT GOES HERE]';
/**
* @var string Used to pass information from {@link doctype()} to
* {@link standard_head_html()}.
* @var string Used to pass information from {@see core_renderer::doctype()} to
* {@see core_renderer::standard_head_html()}.
*/
protected $contenttype;
/**
* @var string Used by {@link redirect_message()} method to communicate
* with {@link header()}.
* @var string Used by {@see core_renderer::redirect_message()} method to communicate
* with {@see core_renderer::header()}.
*/
protected $metarefreshtag = '';
@@ -359,7 +360,7 @@ class core_renderer extends renderer_base {
$output .= '<meta http-equiv="pragma" content="no-cache" />' . "\n";
$output .= '<meta http-equiv="expires" content="0" />' . "\n";
}
// This is only set by the {@link redirect()} method
// This is only set by the {@see redirect()} method
$output .= $this->metarefreshtag;
// Check if a periodic refresh delay has been set and make sure we arn't
@@ -443,9 +444,9 @@ class core_renderer extends renderer_base {
public function standard_footer_html() {
global $CFG, $SCRIPT;
// This function is normally called from a layout.php file in {@link header()}
// This function is normally called from a layout.php file in {@see core_renderer::header()}
// but some of the content won't be known until later, so we return a placeholder
// for now. This will be replaced with the real content in {@link footer()}.
// for now. This will be replaced with the real content in {@see core_renderer::footer()}.
$output = $this->unique_performance_info_token;
if ($this->page->devicetypeinuse == 'legacy') {
// The legacy theme is in use print the notification
@@ -499,9 +500,9 @@ class core_renderer extends renderer_base {
* @return string HTML fragment.
*/
public function standard_end_of_body_html() {
// This function is normally called from a layout.php file in {@link header()}
// This function is normally called from a layout.php file in {@see core_renderer::header()}
// but some of the content won't be known until later, so we return a placeholder
// for now. This will be replaced with the real content in {@link footer()}.
// for now. This will be replaced with the real content in {@see core_renderer::footer()}.
return $this->unique_end_html_token;
}
@@ -686,7 +687,7 @@ class core_renderer extends renderer_base {
* and the start of the <body>.
*
* To control what is printed, you should set properties on $PAGE. If you
* are familiar with the old {@link print_header()} function from Moodle 1.9
* are familiar with the old {@see print_header()} function from Moodle 1.9
* you will find that there are properties on $PAGE that correspond to most
* of the old parameters to could be passed to print_header.
*
@@ -848,7 +849,7 @@ class core_renderer extends renderer_base {
/**
* Output the row of editing icons for a block, as defined by the controls array.
*
* @param array $controls an array like {@link block_contents::$controls}.
* @param array $controls an array like {@see block_contents::$controls}.
* @return string HTML fragment.
*/
public function block_controls($controls) {
@@ -868,7 +869,7 @@ class core_renderer extends renderer_base {
* Prints a nice side block with an optional header.
*
* The content is described
* by a {@link block_contents} object.
* by a {@see core_renderer::block_contents} object.
*
* <div id="inst{$instanceid}" class="block_{$blockname} block">
* <div class="header"></div>
@@ -1695,7 +1696,7 @@ class core_renderer extends renderer_base {
/**
* Implementation of user image rendering.
*
* @param help_icon $helpicon
* @param help_icon $helpicon A help icon instance
* @return string HTML fragment
*/
protected function render_old_help_icon(old_help_icon $helpicon) {
@@ -1758,7 +1759,7 @@ class core_renderer extends renderer_base {
/**
* Implementation of user image rendering.
*
* @param help_icon $helpicon
* @param help_icon $helpicon A help icon instance
* @return string HTML fragment
*/
protected function render_help_icon(help_icon $helpicon) {
@@ -1826,8 +1827,9 @@ class core_renderer extends renderer_base {
/**
* Creates and returns a spacer image with optional line break.
*
* @param array $attributes
* @param bool $br
* @param array $attributes Any HTML attributes to add to the spaced.
* @param bool $br Include a BR after the spacer.... DON'T USE THIS. Don't be
* laxy do it with CSS which is a much better solution.
* @return string HTML fragment
*/
public function spacer(array $attributes = null, $br = false) {
@@ -2131,7 +2133,7 @@ EOD;
/**
* Do not call this function directly.
*
* To terminate the current script with a fatal error, call the {@link print_error}
* To terminate the current script with a fatal error, call the {@see print_error}
* function, or throw an exception. Doing either of those things will then call this
* function to display the error, before terminating the execution.
*
@@ -2339,7 +2341,7 @@ EOD;
}
/**
* Outputs the opening section of a box.\
* Outputs the opening section of a box.
*
* @param string $classes A space-separated list of CSS classes
* @param string $id An optional ID
@@ -2850,7 +2852,7 @@ class core_renderer_ajax extends core_renderer {
/**
* Used to display a redirection message.
* For AJAX redirections should not occur and as such redirection messages
* AJAX redirections should not occur and as such redirection messages
* are discarded.
*/
public function redirect_message($encodedurl, $message, $delay, $debugdisableredirect) {}
+2 -2
View File
@@ -1241,7 +1241,7 @@ class page_requirements_manager {
/**
* Have we already output the code in the <head> tag?
*
* @return boolean
* @return bool
*/
public function is_head_done() {
return $this->headdone;
@@ -1250,7 +1250,7 @@ class page_requirements_manager {
/**
* Have we already output the code at the start of the <body> tag?
*
* @return boolean
* @return bool
*/
public function is_top_of_body_done() {
return $this->topofbodydone;