Ignore:
Timestamp:
May 2, 2016, 12:09:23 PM (3 years ago)
Author:
jrpelegrina
Message:

Updated to moodle 3.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moodle/trunk/fuentes/backup/util/ui/renderer.php

    r136 r1331  
    11<?php
    2 
    32// This file is part of Moodle - http://moodle.org/
    43//
     
    1918 * This file contains backup and restore output renderers
    2019 *
    21  * @package   moodlecore
     20 * @package   core_backup
    2221 * @copyright 2010 Sam Hemelryk
    2322 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     
    2928 * Can be retrieved with the following code:
    3029 * <?php
    31  * $renderer = $PAGE->get_renderer('core','backup');
     30 * $renderer = $PAGE->get_renderer('core', 'backup');
    3231 * ?>
    3332 *
     33 * @package   core_backup
    3434 * @copyright 2010 Sam Hemelryk
    3535 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
    3636 */
    3737class core_backup_renderer extends plugin_renderer_base {
    38     /**
    39      * Renderers a progress bar for the backup or restore given the items that
    40      * make it up.
     38
     39    /**
     40     * Renderers a progress bar for the backup or restore given the items that make it up.
     41     *
    4142     * @param array $items An array of items
    4243     * @return string
     
    5455            }
    5556        }
    56         return html_writer::tag('div', join(get_separator(), $items), array('class'=>'backup_progress clearfix'));
     57        return html_writer::tag('div', join(get_separator(), $items), array('class' => 'backup_progress clearfix'));
    5758    }
    5859
     
    7677    /**
    7778     * Prints a dependency notification
     79     *
    7880     * @param string $message
    7981     * @return string
    8082     */
    8183    public function dependency_notification($message) {
    82         return html_writer::tag('div', $message, array('class'=>'notification dependencies_enforced'));
     84        return html_writer::tag('div', $message, array('class' => 'notification dependencies_enforced'));
    8385    }
    8486
     
    9496        $notick = $this->output->pix_icon('i/invalid', get_string('no'));
    9597
    96         $html  = html_writer::start_tag('div', array('class'=>'backup-restore'));
    97 
    98         $html .= html_writer::start_tag('div', array('class'=>'backup-section'));
    99         $html .= $this->output->heading(get_string('backupdetails', 'backup'), 2, array('class'=>'header'));
     98        $html  = html_writer::start_tag('div', array('class' => 'backup-restore'));
     99
     100        $html .= html_writer::start_tag('div', array('class' => 'backup-section'));
     101        $html .= $this->output->heading(get_string('backupdetails', 'backup'), 2, array('class' => 'header'));
    100102        $html .= $this->backup_detail_pair(get_string('backuptype', 'backup'), get_string('backuptype'.$details->type, 'backup'));
    101103        $html .= $this->backup_detail_pair(get_string('backupformat', 'backup'), get_string('backupformat'.$details->format, 'backup'));
     
    103105        $html .= $this->backup_detail_pair(get_string('backupdate', 'backup'), userdate($details->backup_date));
    104106        $html .= $this->backup_detail_pair(get_string('moodleversion', 'backup'),
    105                 html_writer::tag('span', $details->moodle_release, array('class'=>'moodle_release')).
    106                 html_writer::tag('span', '['.$details->moodle_version.']', array('class'=>'moodle_version sub-detail')));
     107                html_writer::tag('span', $details->moodle_release, array('class' => 'moodle_release')).
     108                html_writer::tag('span', '['.$details->moodle_version.']', array('class' => 'moodle_version sub-detail')));
    107109        $html .= $this->backup_detail_pair(get_string('backupversion', 'backup'),
    108                 html_writer::tag('span', $details->backup_release, array('class'=>'moodle_release')).
    109                 html_writer::tag('span', '['.$details->backup_version.']', array('class'=>'moodle_version sub-detail')));
     110                html_writer::tag('span', $details->backup_release, array('class' => 'moodle_release')).
     111                html_writer::tag('span', '['.$details->backup_version.']', array('class' => 'moodle_version sub-detail')));
    110112        $html .= $this->backup_detail_pair(get_string('originalwwwroot', 'backup'),
    111                 html_writer::tag('span', $details->original_wwwroot, array('class'=>'originalwwwroot')).
    112                 html_writer::tag('span', '['.$details->original_site_identifier_hash.']', array('class'=>'sitehash sub-detail')));
     113                html_writer::tag('span', $details->original_wwwroot, array('class' => 'originalwwwroot')).
     114                html_writer::tag('span', '['.$details->original_site_identifier_hash.']', array('class' => 'sitehash sub-detail')));
    113115        if (!empty($details->include_file_references_to_external_content)) {
    114116            $message = '';
     
    123125        $html .= html_writer::end_tag('div');
    124126
    125         $html .= html_writer::start_tag('div', array('class'=>'backup-section settings-section'));
    126         $html .= $this->output->heading(get_string('backupsettings', 'backup'), 2, array('class'=>'header'));
    127         foreach ($details->root_settings as $label=>$value) {
     127        $html .= html_writer::start_tag('div', array('class' => 'backup-section settings-section'));
     128        $html .= $this->output->heading(get_string('backupsettings', 'backup'), 2, array('class' => 'header'));
     129        foreach ($details->root_settings as $label => $value) {
    128130            if ($label == 'filename' or $label == 'user_files') {
    129131                continue;
    130132            }
    131             $html .= $this->backup_detail_pair(get_string('rootsetting'.str_replace('_','',$label), 'backup'), $value?$yestick:$notick);
     133            $html .= $this->backup_detail_pair(get_string('rootsetting'.str_replace('_', '', $label), 'backup'), $value ? $yestick : $notick);
    132134        }
    133135        $html .= html_writer::end_tag('div');
    134136
    135137        if ($details->type === 'course') {
    136             $html .= html_writer::start_tag('div', array('class'=>'backup-section'));
    137             $html .= $this->output->heading(get_string('backupcoursedetails', 'backup'), 2, array('class'=>'header'));
     138            $html .= html_writer::start_tag('div', array('class' => 'backup-section'));
     139            $html .= $this->output->heading(get_string('backupcoursedetails', 'backup'), 2, array('class' => 'header'));
    138140            $html .= $this->backup_detail_pair(get_string('coursetitle', 'backup'), $details->course->title);
    139141            $html .= $this->backup_detail_pair(get_string('courseid', 'backup'), $details->course->courseid);
    140142
    141             $html .= html_writer::start_tag('div', array('class'=>'backup-sub-section'));
    142             $html .= $this->output->heading(get_string('backupcoursesections', 'backup'), 3, array('class'=>'subheader'));
    143             foreach ($details->sections as $key=>$section) {
     143            // Warning users about front page backups.
     144            if ($details->original_course_format === 'site') {
     145                $html .= $this->backup_detail_pair(get_string('type_format', 'plugin'), get_string('sitecourseformatwarning', 'backup'));
     146            }
     147            $html .= html_writer::start_tag('div', array('class' => 'backup-sub-section'));
     148            $html .= $this->output->heading(get_string('backupcoursesections', 'backup'), 3, array('class' => 'subheader'));
     149            foreach ($details->sections as $key => $section) {
    144150                $included = $key.'_included';
    145151                $userinfo = $key.'_userinfo';
    146152                if ($section->settings[$included] && $section->settings[$userinfo]) {
    147                     $value = get_string('sectionincanduser','backup');
     153                    $value = get_string('sectionincanduser', 'backup');
    148154                } else if ($section->settings[$included]) {
    149                     $value = get_string('sectioninc','backup');
     155                    $value = get_string('sectioninc', 'backup');
    150156                } else {
    151157                    continue;
     
    153159                $html .= $this->backup_detail_pair(get_string('backupcoursesection', 'backup', $section->title), $value);
    154160                $table = null;
    155                 foreach ($details->activities as $activitykey=>$activity) {
     161                foreach ($details->activities as $activitykey => $activity) {
    156162                    if ($activity->sectionid != $section->sectionid) {
    157163                        continue;
     
    159165                    if (empty($table)) {
    160166                        $table = new html_table();
    161                         $table->head = array(get_string('module','backup'), get_string('title','backup'), get_string('userinfo','backup'));
     167                        $table->head = array(get_string('module', 'backup'), get_string('title', 'backup'), get_string('userinfo', 'backup'));
    162168                        $table->colclasses = array('modulename', 'moduletitle', 'userinfoincluded');
    163                         $table->align = array('left','left', 'center');
    164                         $table->attributes = array('class'=>'activitytable generaltable');
     169                        $table->align = array('left', 'left', 'center');
     170                        $table->attributes = array('class' => 'activitytable generaltable');
    165171                        $table->data = array();
    166172                    }
     
    170176                        $this->output->render($icon).$name,
    171177                        $activity->title,
    172                         ($activity->settings[$activitykey.'_userinfo'])?$yestick:$notick,
     178                        ($activity->settings[$activitykey.'_userinfo']) ? $yestick : $notick,
    173179                    );
    174180                }
    175181                if (!empty($table)) {
    176                     $html .= $this->backup_detail_pair(get_string('sectionactivities','backup'), html_writer::table($table));
     182                    $html .= $this->backup_detail_pair(get_string('sectionactivities', 'backup'), html_writer::table($table));
    177183                }
    178184
     
    241247     * @return string
    242248     */
    243     public function course_selector(moodle_url $nextstageurl, $wholecourse = true, restore_category_search $categories = null, restore_course_search $courses=null, $currentcourse = null) {
     249    public function course_selector(moodle_url $nextstageurl, $wholecourse = true, restore_category_search $categories = null,
     250                                    restore_course_search $courses = null, $currentcourse = null) {
    244251        global $CFG, $PAGE;
    245252        require_once($CFG->dirroot.'/course/lib.php');
     
    259266        $form = html_writer::start_tag('form', array('method' => 'post', 'action' => $nextstageurl->out_omit_querystring(),
    260267            'class' => 'mform'));
    261         foreach ($nextstageurl->params() as $key=>$value) {
    262             $form .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>$key, 'value'=>$value));
     268        foreach ($nextstageurl->params() as $key => $value) {
     269            $form .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $key, 'value' => $value));
    263270        }
    264271
    265272        $hasrestoreoption = false;
    266273
    267         $html  = html_writer::start_tag('div', array('class'=>'backup-course-selector backup-restore'));
     274        $html  = html_writer::start_tag('div', array('class' => 'backup-course-selector backup-restore'));
    268275        if ($wholecourse && !empty($categories) && ($categories->get_count() > 0 || $categories->get_search())) {
    269             // New course
     276            // New course.
    270277            $hasrestoreoption = true;
    271278            $html .= $form;
    272             $html .= html_writer::start_tag('div', array('class'=>'bcs-new-course backup-section'));
    273             $html .= $this->output->heading(get_string('restoretonewcourse', 'backup'), 2, array('class'=>'header'));
    274             $html .= $this->backup_detail_input(get_string('restoretonewcourse', 'backup'), 'radio', 'target', backup::TARGET_NEW_COURSE, array('checked'=>'checked'));
     279            $html .= html_writer::start_tag('div', array('class' => 'bcs-new-course backup-section'));
     280            $html .= $this->output->heading(get_string('restoretonewcourse', 'backup'), 2, array('class' => 'header'));
     281            $html .= $this->backup_detail_input(get_string('restoretonewcourse', 'backup'), 'radio', 'target',
     282                backup::TARGET_NEW_COURSE, array('checked' => 'checked'));
    275283            $selectacategoryhtml = $this->backup_detail_pair(get_string('selectacategory', 'backup'), $this->render($categories));
    276284            // Display the category selection as required if the form was submitted but this data was not supplied.
     
    283291                $html .= $selectacategoryhtml;
    284292            }
    285             $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue'))));
     293            $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue'))));
    286294            $html .= html_writer::end_tag('div');
    287295            $html .= html_writer::end_tag('form');
     
    289297
    290298        if ($wholecourse && !empty($currentcourse)) {
    291             // Current course
     299            // Current course.
    292300            $hasrestoreoption = true;
    293301            $html .= $form;
    294             $html .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'targetid', 'value'=>$currentcourse));
    295             $html .= html_writer::start_tag('div', array('class'=>'bcs-current-course backup-section'));
    296             $html .= $this->output->heading(get_string('restoretocurrentcourse', 'backup'), 2, array('class'=>'header'));
    297             $html .= $this->backup_detail_input(get_string('restoretocurrentcourseadding', 'backup'), 'radio', 'target', backup::TARGET_CURRENT_ADDING, array('checked'=>'checked'));
    298             $html .= $this->backup_detail_input(get_string('restoretocurrentcoursedeleting', 'backup'), 'radio', 'target', backup::TARGET_CURRENT_DELETING);
    299             $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue'))));
     302            $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'targetid', 'value' => $currentcourse));
     303            $html .= html_writer::start_tag('div', array('class' => 'bcs-current-course backup-section'));
     304            $html .= $this->output->heading(get_string('restoretocurrentcourse', 'backup'), 2, array('class' => 'header'));
     305            $html .= $this->backup_detail_input(get_string('restoretocurrentcourseadding', 'backup'), 'radio', 'target',
     306                backup::TARGET_CURRENT_ADDING, array('checked' => 'checked'));
     307            $html .= $this->backup_detail_input(get_string('restoretocurrentcoursedeleting', 'backup'), 'radio', 'target',
     308                backup::TARGET_CURRENT_DELETING);
     309            $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue'))));
    300310            $html .= html_writer::end_tag('div');
    301311            $html .= html_writer::end_tag('form');
     
    308318        }
    309319        if (!empty($courses) && ($courses->get_count() > 0 || $courses->get_search())) {
    310             // Existing course
     320            // Existing course.
    311321            $hasrestoreoption = true;
    312322            $html .= $form;
    313             $html .= html_writer::start_tag('div', array('class'=>'bcs-existing-course backup-section'));
    314             $html .= $this->output->heading(get_string('restoretoexistingcourse', 'backup'), 2, array('class'=>'header'));
     323            $html .= html_writer::start_tag('div', array('class' => 'bcs-existing-course backup-section'));
     324            $html .= $this->output->heading(get_string('restoretoexistingcourse', 'backup'), 2, array('class' => 'header'));
    315325            if ($wholecourse) {
    316                 $html .= $this->backup_detail_input(get_string('restoretoexistingcourseadding', 'backup'), 'radio', 'target', backup::TARGET_EXISTING_ADDING, array('checked'=>'checked'));
    317                 $html .= $this->backup_detail_input(get_string('restoretoexistingcoursedeleting', 'backup'), 'radio', 'target', backup::TARGET_EXISTING_DELETING);
     326                $html .= $this->backup_detail_input(get_string('restoretoexistingcourseadding', 'backup'), 'radio', 'target',
     327                    backup::TARGET_EXISTING_ADDING, array('checked' => 'checked'));
     328                $html .= $this->backup_detail_input(get_string('restoretoexistingcoursedeleting', 'backup'), 'radio', 'target',
     329                    backup::TARGET_EXISTING_DELETING);
    318330            } else {
    319                 $html .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'target', 'value'=>backup::TARGET_EXISTING_ADDING));
     331                $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'target', 'value' => backup::TARGET_EXISTING_ADDING));
    320332            }
    321333            $selectacoursehtml = $this->backup_detail_pair(get_string('selectacourse', 'backup'), $this->render($courses));
     
    329341                $html .= $selectacoursehtml;
    330342            }
    331             $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue'))));
     343            $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue'))));
    332344            $html .= html_writer::end_tag('div');
    333345            $html .= html_writer::end_tag('form');
     
    335347
    336348        if (!$hasrestoreoption) {
    337             echo $this->output->notification(get_string('norestoreoptions','backup'));
     349            echo $this->output->notification(get_string('norestoreoptions', 'backup'));
    338350        }
    339351
     
    349361     * @return string
    350362     */
    351     public function import_course_selector(moodle_url $nextstageurl, import_course_search $courses=null) {
    352         $html  = html_writer::start_tag('div', array('class'=>'import-course-selector backup-restore'));
    353         $html .= html_writer::start_tag('form', array('method'=>'post', 'action'=>$nextstageurl->out_omit_querystring()));
    354         foreach ($nextstageurl->params() as $key=>$value) {
    355             $html .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>$key, 'value'=>$value));
     363    public function import_course_selector(moodle_url $nextstageurl, import_course_search $courses = null) {
     364        $html  = html_writer::start_tag('div', array('class' => 'import-course-selector backup-restore'));
     365        $html .= html_writer::start_tag('form', array('method' => 'post', 'action' => $nextstageurl->out_omit_querystring()));
     366        foreach ($nextstageurl->params() as $key => $value) {
     367            $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $key, 'value' => $value));
    356368        }
    357369        // We only allow import adding for now. Enforce it here.
    358         $html .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'target', 'value'=>backup::TARGET_CURRENT_ADDING));
    359         $html .= html_writer::start_tag('div', array('class'=>'ics-existing-course backup-section'));
    360         $html .= $this->output->heading(get_string('importdatafrom'), 2, array('class'=>'header'));
     370        $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'target', 'value' => backup::TARGET_CURRENT_ADDING));
     371        $html .= html_writer::start_tag('div', array('class' => 'ics-existing-course backup-section'));
     372        $html .= $this->output->heading(get_string('importdatafrom'), 2, array('class' => 'header'));
    361373        $html .= $this->backup_detail_pair(get_string('selectacourse', 'backup'), $this->render($courses));
    362         $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue'))));
     374        $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue'))));
    363375        $html .= html_writer::end_tag('div');
    364376        $html .= html_writer::end_tag('form');
     
    376388     */
    377389    protected function backup_detail_pair($label, $value) {
    378         static $count= 0;
    379         $count++;
    380         $html  = html_writer::start_tag('div', array('class'=>'detail-pair'));
    381         $html .= html_writer::tag('label', $label, array('class'=>'detail-pair-label', 'for'=>'detail-pair-value-'.$count));
    382         $html .= html_writer::tag('div', $value, array('class'=>'detail-pair-value', 'name'=>'detail-pair-value-'.$count));
     390        static $count = 0;
     391        $count ++;
     392        $html  = html_writer::start_tag('div', array('class' => 'detail-pair'));
     393        $html .= html_writer::tag('label', $label, array('class' => 'detail-pair-label', 'for' => 'detail-pair-value-'.$count));
     394        $html .= html_writer::tag('div', $value, array('class' => 'detail-pair-value', 'name' => 'detail-pair-value-'.$count));
    383395        $html .= html_writer::end_tag('div');
    384396        return $html;
     
    396408     * @return string
    397409     */
    398     protected function backup_detail_input($label, $type, $name, $value, array $attributes=array(), $description=null) {
    399         if (!empty ($description)) {
    400             $description = html_writer::tag('span', $description, array('class'=>'description'));
     410    protected function backup_detail_input($label, $type, $name, $value, array $attributes = array(), $description = null) {
     411        if (!empty($description)) {
     412            $description = html_writer::tag('span', $description, array('class' => 'description'));
    401413        } else {
    402414            $description = '';
    403415        }
    404         return $this->backup_detail_pair($label, html_writer::empty_tag('input', $attributes+array('name'=>$name, 'type'=>$type, 'value'=>$value)).$description);
     416        return $this->backup_detail_pair(
     417            $label,
     418            html_writer::empty_tag('input', $attributes + array('name' => $name, 'type' => $type, 'value' => $value)) . $description
     419        );
    405420    }
    406421
     
    417432     * @return string
    418433     */
    419     protected function backup_detail_select($label, $name, $options, $selected='', $nothing=false, array $attributes=array(), $description=null) {
     434    protected function backup_detail_select($label, $name, $options, $selected = '', $nothing = false, array $attributes = array(), $description = null) {
    420435        if (!empty ($description)) {
    421             $description = html_writer::tag('span', $description, array('class'=>'description'));
     436            $description = html_writer::tag('span', $description, array('class' => 'description'));
    422437        } else {
    423438            $description = '';
     
    433448     */
    434449    public function precheck_notices($results) {
    435         $output = html_writer::start_tag('div', array('class'=>'restore-precheck-notices'));
     450        $output = html_writer::start_tag('div', array('class' => 'restore-precheck-notices'));
    436451        if (array_key_exists('errors', $results)) {
    437452            foreach ($results['errors'] as $error) {
     
    456471        $output  = html_writer::start_tag('div', array('continuebutton'));
    457472        if (!$haserrors) {
    458             $output .= html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('continue')));
    459         }
    460         $output .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'cancel', 'value'=>get_string('cancel')));
     473            $output .= html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('continue')));
     474        }
     475        $output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'cancel', 'value' => get_string('cancel')));
    461476        $output .= html_writer::end_tag('div');
    462477        return $output;
     
    472487    public function role_mappings($rolemappings, $roles) {
    473488        $roles[0] = get_string('none');
    474         $output  = html_writer::start_tag('div', array('class'=>'restore-rolemappings'));
     489        $output  = html_writer::start_tag('div', array('class' => 'restore-rolemappings'));
    475490        $output .= $this->output->heading(get_string('restorerolemappings', 'backup'), 2);
    476         foreach ($rolemappings as $id=>$mapping) {
     491        foreach ($rolemappings as $id => $mapping) {
    477492            $label = $mapping->name;
    478493            $name = 'mapping'.$id;
     
    491506     * @return string
    492507     */
    493     public function continue_button($url, $method='post') {
     508    public function continue_button($url, $method = 'post') {
    494509        if (!($url instanceof moodle_url)) {
    495510            $url = new moodle_url($url);
     
    517532     *
    518533     * @global stdClass $USER
    519      * @param backup_files_viewer $tree
     534     * @param backup_files_viewer $viewer
    520535     * @return string
    521536     */
     
    534549                continue;
    535550            }
    536             $fileurl = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(), $file->get_filearea(), null, $file->get_filepath(), $file->get_filename(), true);
     551            $fileurl = moodle_url::make_pluginfile_url(
     552                $file->get_contextid(),
     553                $file->get_component(),
     554                $file->get_filearea(),
     555                null,
     556                $file->get_filepath(),
     557                $file->get_filename(),
     558                true
     559            );
    537560            $params = array();
    538561            $params['action'] = 'choosebackupfile';
     
    555578
    556579        $html = html_writer::table($table);
    557         $html .= $this->output->single_button(new moodle_url('/backup/backupfilesedit.php', array('currentcontext'=>$viewer->currentcontext->id, 'contextid'=>$viewer->filecontext->id, 'filearea'=>$viewer->filearea, 'component'=>$viewer->component, 'returnurl'=>$this->page->url->out())), get_string('managefiles', 'backup'), 'post');
     580        $html .= $this->output->single_button(
     581            new moodle_url('/backup/backupfilesedit.php', array(
     582                'currentcontext' => $viewer->currentcontext->id,
     583                'contextid' => $viewer->filecontext->id,
     584                'filearea' => $viewer->filearea,
     585                'component' => $viewer->component,
     586                'returnurl' => $this->page->url->out())
     587            ),
     588            get_string('managefiles', 'backup'),
     589            'post'
     590        );
    558591
    559592        return $html;
     
    583616                }
    584617                $row->cells = array(
    585                     html_writer::empty_tag('input', array('type'=>'radio', 'name'=>'targetid', 'value'=>$course->id)),
     618                    html_writer::empty_tag('input', array('type' => 'radio', 'name' => 'targetid', 'value' => $course->id)),
    586619                    format_string($course->shortname, true, array('context' => context_course::instance($course->id))),
    587620                    format_string($course->fullname, true, array('context' => context_course::instance($course->id)))
     
    608641        $output .= html_writer::end_tag('div');
    609642
    610         $output .= html_writer::start_tag('div', array('class'=>'rcs-search'));
    611         $output .= html_writer::empty_tag('input', array('type'=>'text', 'name'=>restore_course_search::$VAR_SEARCH, 'value'=>$component->get_search()));
    612         $output .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'searchcourses', 'value'=>get_string('search')));
     643        $output .= html_writer::start_tag('div', array('class' => 'rcs-search'));
     644        $output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_course_search::$VAR_SEARCH, 'value' => $component->get_search()));
     645        $output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
    613646        $output .= html_writer::end_tag('div');
    614647
     
    630663            $output .= $this->output->notification(get_string('nomatchingcourses', 'backup'));
    631664
    632             $output .= html_writer::start_tag('div', array('class'=>'ics-search'));
    633             $output .= html_writer::empty_tag('input', array('type'=>'text', 'name'=>restore_course_search::$VAR_SEARCH, 'value'=>$component->get_search()));
    634             $output .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'searchcourses', 'value'=>get_string('search')));
     665            $output .= html_writer::start_tag('div', array('class' => 'ics-search'));
     666            $output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_course_search::$VAR_SEARCH, 'value' => $component->get_search()));
     667            $output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
    635668            $output .= html_writer::end_tag('div');
    636669
     
    646679        }
    647680
    648         $output .= html_writer::tag('div', $countstr, array('class'=>'ics-totalresults'));
     681        $output .= html_writer::tag('div', $countstr, array('class' => 'ics-totalresults'));
    649682        $output .= html_writer::start_tag('div', array('class' => 'ics-results'));
    650683
     
    659692            }
    660693            $row->cells = array(
    661                 html_writer::empty_tag('input', array('type'=>'radio', 'name'=>'importid', 'value'=>$course->id)),
     694                html_writer::empty_tag('input', array('type' => 'radio', 'name' => 'importid', 'value' => $course->id)),
    662695                format_string($course->shortname, true, array('context' => context_course::instance($course->id))),
    663696                format_string($course->fullname, true, array('context' => context_course::instance($course->id)))
     
    676709        $output .= html_writer::end_tag('div');
    677710
    678         $output .= html_writer::start_tag('div', array('class'=>'ics-search'));
    679         $output .= html_writer::empty_tag('input', array('type'=>'text', 'name'=>restore_course_search::$VAR_SEARCH, 'value'=>$component->get_search()));
    680         $output .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'searchcourses', 'value'=>get_string('search')));
     711        $output .= html_writer::start_tag('div', array('class' => 'ics-search'));
     712        $output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_course_search::$VAR_SEARCH, 'value' => $component->get_search()));
     713        $output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
    681714        $output .= html_writer::end_tag('div');
    682715
     
    709742                }
    710743                $row->cells = array(
    711                     html_writer::empty_tag('input', array('type'=>'radio', 'name'=>'targetid', 'value'=>$category->id)),
     744                    html_writer::empty_tag('input', array('type' => 'radio', 'name' => 'targetid', 'value' => $category->id)),
    712745                    format_string($category->name, true, array('context' => context_coursecat::instance($category->id))),
    713                     format_text($category->description, $category->descriptionformat, array('overflowdiv'=>true))
     746                    format_text($category->description, $category->descriptionformat, array('overflowdiv' => true))
    714747                );
    715748                $table->data[] = $row;
     
    734767        $output .= html_writer::end_tag('div');
    735768
    736         $output .= html_writer::start_tag('div', array('class'=>'rcs-search'));
    737         $output .= html_writer::empty_tag('input', array('type'=>'text', 'name'=>restore_category_search::$VAR_SEARCH, 'value'=>$component->get_search()));
    738         $output .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'searchcourses', 'value'=>get_string('search')));
     769        $output .= html_writer::start_tag('div', array('class' => 'rcs-search'));
     770        $output .= html_writer::empty_tag('input', array('type' => 'text', 'name' => restore_category_search::$VAR_SEARCH, 'value' => $component->get_search()));
     771        $output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'searchcourses', 'value' => get_string('search')));
    739772        $output .= html_writer::end_tag('div');
    740773
     
    752785 */
    753786class backup_files_viewer implements renderable {
     787
     788    /**
     789     * @var array
     790     */
    754791    public $files;
     792
     793    /**
     794     * @var context
     795     */
    755796    public $filecontext;
     797
     798    /**
     799     * @var string
     800     */
    756801    public $component;
     802
     803    /**
     804     * @var string
     805     */
    757806    public $filearea;
     807
     808    /**
     809     * @var context
     810     */
    758811    public $currentcontext;
    759812
Note: See TracChangeset for help on using the changeset viewer.