From fef943738d59bf9784b606f8aa4c255ff1d6aaba Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 9 Oct 2014 18:45:32 +0800 Subject: [PATCH] MDL-46481 backup: Ensure one-click backup is not displayed on restore --- backup/util/ui/base_moodleform.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup/util/ui/base_moodleform.class.php b/backup/util/ui/base_moodleform.class.php index d149cf0716b..6f03ee4317f 100644 --- a/backup/util/ui/base_moodleform.class.php +++ b/backup/util/ui/base_moodleform.class.php @@ -123,7 +123,8 @@ abstract class base_moodleform extends moodleform { $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()) { $buttonarray[] = $this->_form->createElement('submit', 'previous', get_string('previousstage','backup')); - } else { + } else if ($this->uistage instanceof backup_ui_stage) { + // Only display the button on the first stage of backup, they only place where it has an effect. $buttonarray[] = $this->_form->createElement('submit', 'oneclickbackup', get_string('jumptofinalstep', 'backup'), array('class' => 'oneclickbackup')); }