Skip to content

Commit

Permalink
Fix the order of the AdministrationPage's XMLElements being appended …
Browse files Browse the repository at this point in the history
…to the Body so that the AdminPrePageGenerate delegate works again. Thanks kanduvisla for spotting this.
  • Loading branch information
Brendan Abbott committed Feb 15, 2011
1 parent 817f982 commit ac2888e
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions symphony/lib/toolkit/class.administrationpage.php
Expand Up @@ -16,7 +16,7 @@
require_once(TOOLKIT . '/class.alert.php');

Class AdministrationPage extends HTMLPage{

/**
* An instance of the Administration class
* @var Administration
Expand All @@ -30,27 +30,27 @@
* @var Alert
*/
public $Alert = null;

/**
* As the name suggests, a `<div>` that holds the following `$Header`,
* `$Contents` and `$Footer`.
* @var XMLElement
*/
public $Wrapper = null;

/**
* A `<div>` that contains the header of a Symphony backend page, which
* typically contains the Site title and the navigation.
* @var XMLElement
*/
public $Header = null;

/**
* A `<div>` that contains the content of a Symphony backend page.
* @var XMLElement
*/
public $Contents = null;

/**
* A `<div>` that contains the Symphony footer, typically the version and
* the current Author's details.
Expand Down Expand Up @@ -275,12 +275,6 @@ public function build(Array $context = array()){
$this->appendFooter();
$this->appendAlert();

$this->Wrapper->appendChild($this->Header);
$this->Wrapper->appendChild($this->Contents);
$this->Wrapper->appendChild($this->Footer);

$this->Body->appendChild($this->Wrapper);

Administration::instance()->Profiler->sample('Page content created', PROFILE_LAP);
}

Expand Down Expand Up @@ -338,13 +332,21 @@ public function canAccessPage(){
}

/**
* Appends the ID and class attributes for the `<body>` element
* before calling the parent's generate function which will convert
* the XMLElements into strings ready for output
* Appends the `$this->Header`, `$this->Contents` and `$this->Footer`
* to `$this->Wrapper` before adding the ID and class attributes for
* the `<body>` element. After this has completed the parent's generate
* function is called which will convert the `XMLElement`'s into strings
* ready for output
*
* @return string
*/
public function generate() {
$this->Wrapper->appendChild($this->Header);
$this->Wrapper->appendChild($this->Contents);
$this->Wrapper->appendChild($this->Footer);

$this->Body->appendChild($this->Wrapper);

$this->__appendBodyId();
$this->__appendBodyClass($this->_context);
return parent::generate();
Expand Down

0 comments on commit ac2888e

Please sign in to comment.