| 1 | 
           efrain | 
           1 | 
           <?php
  | 
        
        
            | 
            | 
           2 | 
           // This file is part of Moodle - http://moodle.org/
  | 
        
        
            | 
            | 
           3 | 
           //
  | 
        
        
            | 
            | 
           4 | 
           // Moodle is free software: you can redistribute it and/or modify
  | 
        
        
            | 
            | 
           5 | 
           // it under the terms of the GNU General Public License as published by
  | 
        
        
            | 
            | 
           6 | 
           // the Free Software Foundation, either version 3 of the License, or
  | 
        
        
            | 
            | 
           7 | 
           // (at your option) any later version.
  | 
        
        
            | 
            | 
           8 | 
           //
  | 
        
        
            | 
            | 
           9 | 
           // Moodle is distributed in the hope that it will be useful,
  | 
        
        
            | 
            | 
           10 | 
           // but WITHOUT ANY WARRANTY; without even the implied warranty of
  | 
        
        
            | 
            | 
           11 | 
           // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  | 
        
        
            | 
            | 
           12 | 
           // GNU General Public License for more details.
  | 
        
        
            | 
            | 
           13 | 
           //
  | 
        
        
            | 
            | 
           14 | 
           // You should have received a copy of the GNU General Public License
  | 
        
        
            | 
            | 
           15 | 
           // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  | 
        
        
            | 
            | 
           16 | 
              | 
        
        
            | 
            | 
           17 | 
           /**
  | 
        
        
            | 
            | 
           18 | 
            * Completion Progress block settings
  | 
        
        
            | 
            | 
           19 | 
            *
  | 
        
        
            | 
            | 
           20 | 
            * @package   block_completion_progress
  | 
        
        
            | 
            | 
           21 | 
            * @copyright 2016 Michael de Raadt
  | 
        
        
            | 
            | 
           22 | 
            * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  | 
        
        
            | 
            | 
           23 | 
            */
  | 
        
        
            | 
            | 
           24 | 
              | 
        
        
            | 
            | 
           25 | 
           defined('MOODLE_INTERNAL') || die;
  | 
        
        
            | 
            | 
           26 | 
              | 
        
        
            | 
            | 
           27 | 
           use block_completion_progress\defaults;
  | 
        
        
            | 
            | 
           28 | 
              | 
        
        
            | 
            | 
           29 | 
           if ($ADMIN->fulltree) {
  | 
        
        
            | 
            | 
           30 | 
              | 
        
        
            | 
            | 
           31 | 
               $options = array(10 => 10, 12 => 12, 14 => 14, 16 => 16, 18 => 18, 20 => 20);
  | 
        
        
            | 
            | 
           32 | 
               $settings->add(new admin_setting_configselect('block_completion_progress/wrapafter',
  | 
        
        
            | 
            | 
           33 | 
                   get_string('wrapafter', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           34 | 
                   '',
  | 
        
        
            | 
            | 
           35 | 
                   defaults::WRAPAFTER,
  | 
        
        
            | 
            | 
           36 | 
                   $options)
  | 
        
        
            | 
            | 
           37 | 
               );
  | 
        
        
            | 
            | 
           38 | 
              | 
        
        
            | 
            | 
           39 | 
               $options = array(
  | 
        
        
            | 
            | 
           40 | 
                   'squeeze' => get_string('config_squeeze', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           41 | 
                   'scroll' => get_string('config_scroll', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           42 | 
                   'wrap' => get_string('config_wrap', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           43 | 
               );
  | 
        
        
            | 
            | 
           44 | 
               $settings->add(new admin_setting_configselect('block_completion_progress/defaultlongbars',
  | 
        
        
            | 
            | 
           45 | 
                   get_string('defaultlongbars', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           46 | 
                   '',
  | 
        
        
            | 
            | 
           47 | 
                   defaults::LONGBARS,
  | 
        
        
            | 
            | 
           48 | 
                   $options)
  | 
        
        
            | 
            | 
           49 | 
               );
  | 
        
        
            | 
            | 
           50 | 
              | 
        
        
            | 
            | 
           51 | 
               $options = array(
  | 
        
        
            | 
            | 
           52 | 
                   'shortname' => get_string('shortname', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           53 | 
                   'fullname' => get_string('fullname', 'block_completion_progress')
  | 
        
        
            | 
            | 
           54 | 
               );
  | 
        
        
            | 
            | 
           55 | 
               $settings->add(new admin_setting_configselect('block_completion_progress/coursenametoshow',
  | 
        
        
            | 
            | 
           56 | 
                   get_string('coursenametoshow', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           57 | 
                   '',
  | 
        
        
            | 
            | 
           58 | 
                   defaults::COURSENAMETOSHOW,
  | 
        
        
            | 
            | 
           59 | 
                   $options)
  | 
        
        
            | 
            | 
           60 | 
               );
  | 
        
        
            | 
            | 
           61 | 
              | 
        
        
            | 
            | 
           62 | 
               $coloursetting = new admin_setting_configcolourpicker('block_completion_progress/completed_colour',
  | 
        
        
            | 
            | 
           63 | 
                   get_string('completed_colour_title', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           64 | 
                   get_string('completed_colour_descr', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           65 | 
                   get_string('completed_colour', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           66 | 
                   null );
  | 
        
        
            | 
            | 
           67 | 
               $coloursetting->set_updatedcallback('block_completion_progress::increment_cache_value');
  | 
        
        
            | 
            | 
           68 | 
               $settings->add($coloursetting);
  | 
        
        
            | 
            | 
           69 | 
              | 
        
        
            | 
            | 
           70 | 
               $coloursetting = new admin_setting_configcolourpicker('block_completion_progress/submittednotcomplete_colour',
  | 
        
        
            | 
            | 
           71 | 
                   get_string('submittednotcomplete_colour_title', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           72 | 
                   get_string('submittednotcomplete_colour_descr', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           73 | 
                   get_string('submittednotcomplete_colour', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           74 | 
                   null );
  | 
        
        
            | 
            | 
           75 | 
               $coloursetting->set_updatedcallback('block_completion_progress::increment_cache_value');
  | 
        
        
            | 
            | 
           76 | 
               $settings->add($coloursetting);
  | 
        
        
            | 
            | 
           77 | 
              | 
        
        
            | 
            | 
           78 | 
               $coloursetting = new admin_setting_configcolourpicker('block_completion_progress/notCompleted_colour',
  | 
        
        
            | 
            | 
           79 | 
                   get_string('notCompleted_colour_title', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           80 | 
                   get_string('notCompleted_colour_descr', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           81 | 
                   get_string('notCompleted_colour', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           82 | 
                   null );
  | 
        
        
            | 
            | 
           83 | 
               $coloursetting->set_updatedcallback('block_completion_progress::increment_cache_value');
  | 
        
        
            | 
            | 
           84 | 
               $settings->add($coloursetting);
  | 
        
        
            | 
            | 
           85 | 
              | 
        
        
            | 
            | 
           86 | 
               $coloursetting = new admin_setting_configcolourpicker('block_completion_progress/futureNotCompleted_colour',
  | 
        
        
            | 
            | 
           87 | 
                   get_string('futureNotCompleted_colour_title', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           88 | 
                   get_string('futureNotCompleted_colour_descr', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           89 | 
                   get_string('futureNotCompleted_colour', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           90 | 
                   null );
  | 
        
        
            | 
            | 
           91 | 
               $coloursetting->set_updatedcallback('block_completion_progress::increment_cache_value');
  | 
        
        
            | 
            | 
           92 | 
               $settings->add($coloursetting);
  | 
        
        
            | 
            | 
           93 | 
              | 
        
        
            | 
            | 
           94 | 
               $settings->add(new admin_setting_configcheckbox('block_completion_progress/showinactive',
  | 
        
        
            | 
            | 
           95 | 
                   get_string('showinactive', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           96 | 
                   '',
  | 
        
        
            | 
            | 
           97 | 
                   defaults::SHOWINACTIVE)
  | 
        
        
            | 
            | 
           98 | 
               );
  | 
        
        
            | 
            | 
           99 | 
               $settings->add(new admin_setting_configcheckbox('block_completion_progress/showlastincourse',
  | 
        
        
            | 
            | 
           100 | 
                   get_string('showlastincourse', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           101 | 
                   '',
  | 
        
        
            | 
            | 
           102 | 
                   defaults::SHOWLASTINCOURSE)
  | 
        
        
            | 
            | 
           103 | 
               );
  | 
        
        
            | 
            | 
           104 | 
               $settings->add(new admin_setting_configcheckbox('block_completion_progress/forceiconsinbar',
  | 
        
        
            | 
            | 
           105 | 
                   get_string('forceiconsinbar', 'block_completion_progress'),
  | 
        
        
            | 
            | 
           106 | 
                   '',
  | 
        
        
            | 
            | 
           107 | 
                   defaults::FORCEICONSINBAR)
  | 
        
        
            | 
            | 
           108 | 
               );
  | 
        
        
            | 
            | 
           109 | 
           }
  |