MINOR Added phpDoc to Requirements::customCSS() and Requirements_Backend::customCSS() to be clear about what should be included

MINOR Code formatting cleanup

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@67676 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-12-08 00:59:02 +00:00 committed by Sam Minnee
parent f588403bbd
commit b9e1fc0692

View File

@ -54,16 +54,17 @@ class Requirements {
} }
/** /**
* Add the CSS styling to the header of the page * Include custom CSS styling to the header of the page.
* *
* See {@link Requirements_Backend::customCSS()} * See {@link Requirements_Backend::customCSS()}
*
* @param string $script CSS selectors as a string (without <style> tag enclosing selectors).
* @param int $uniquenessID
*/ */
static function customCSS($script, $uniquenessID = null) { static function customCSS($script, $uniquenessID = null) {
self::backend()->custom($script, $uniquenessID); self::backend()->custom($script, $uniquenessID);
} }
/** /**
* Add the following custom code to the <head> section of the page. * Add the following custom code to the <head> section of the page.
* See {@link Requirements_Backend::insertHeadTags()} * See {@link Requirements_Backend::insertHeadTags()}
@ -390,7 +391,12 @@ class Requirements_Backend {
$script .= "\n"; $script .= "\n";
} }
/**
* Include custom CSS styling to the header of the page.
*
* @param string $script CSS selectors as a string (without <style> tag enclosing selectors).
* @param int $uniquenessID
*/
function customCSS($script, $uniquenessID = null) { function customCSS($script, $uniquenessID = null) {
if($uniquenessID) if($uniquenessID)
$this->customCSS[$uniquenessID] = $script; $this->customCSS[$uniquenessID] = $script;
@ -559,7 +565,7 @@ class Requirements_Backend {
$requirements .= "<link rel=\"stylesheet\" type=\"text/css\"{$media} href=\"$path\" />\n"; $requirements .= "<link rel=\"stylesheet\" type=\"text/css\"{$media} href=\"$path\" />\n";
} }
} }
foreach(array_diff_key($this->customCSS,$this->blocked) as $css) { foreach(array_diff_key($this->customCSS, $this->blocked) as $css) {
$requirements .= "<style type=\"text/css\">\n$css\n</style>\n"; $requirements .= "<style type=\"text/css\">\n$css\n</style>\n";
} }