Browse files

Merge branch 'MDL-34707_23' of git://github.com/timhunt/moodle into M…

…OODLE_23_STABLE
  • Loading branch information...
2 parents cf162f9 + 7d45268 commit 6faa04b5229a2fa1b1cc01de4e64e8f3bb4c226c @danpoltawski danpoltawski committed Aug 6, 2012
Showing with 12 additions and 8 deletions.
  1. +12 −8 backup/util/ui/base_moodleform.class.php
View
20 backup/util/ui/base_moodleform.class.php
@@ -96,7 +96,6 @@ function definition() {
* @global moodle_page $PAGE
*/
function definition_after_data() {
- global $PAGE;
$buttonarray=array();
$buttonarray[] = $this->_form->createElement('submit', 'submitbutton', get_string($this->uistage->get_ui()->get_name().'stage'.$this->uistage->get_stage().'action', 'backup'), array('class'=>'proceedbutton'));
if (!$this->uistage->is_first_stage()) {
@@ -106,13 +105,9 @@ function definition_after_data() {
$this->_form->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$this->_form->closeHeaderBefore('buttonar');
- $config = new stdClass;
- $config->title = get_string('confirmcancel', 'backup');
- $config->question = get_string('confirmcancelquestion', 'backup');
- $config->yesLabel = get_string('confirmcancelyes', 'backup');
- $config->noLabel = get_string('confirmcancelno', 'backup');
- $PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.watch_cancel_buttons', array($config));
+ $this->_definition_finalized = true;
}
+
/**
* Closes any open divs
*/
@@ -318,7 +313,17 @@ public function get_element($elementname) {
* Displays the form
*/
public function display() {
+ global $PAGE;
+
$this->require_definition_after_data();
+
+ $config = new stdClass;
+ $config->title = get_string('confirmcancel', 'backup');
+ $config->question = get_string('confirmcancelquestion', 'backup');
+ $config->yesLabel = get_string('confirmcancelyes', 'backup');
+ $config->noLabel = get_string('confirmcancelno', 'backup');
+ $PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.watch_cancel_buttons', array($config));
+
parent::display();
}
@@ -327,7 +332,6 @@ public function display() {
*/
public function require_definition_after_data() {
if (!$this->_definition_finalized) {
- $this->_definition_finalized = true;
$this->definition_after_data();
}
}

0 comments on commit 6faa04b

Please sign in to comment.