MDL-32627 enable ajax by default in new user form
[moodle.git] / blocks / section_links / config_instance.html
blobefc2fbc4238f519d067b9499e281311f038c21ea
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.
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/>.
18 /**
19 * Section links block
21 * @package moodlecore
22 * @Author Jason Hardin
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 $numberofsections = array();
27 for ($i = 1; $i < 53; $i++){
28 $numberofsections[$i] = $i;
31 $increments = array();
33 for ($i = 1; $i < 11; $i++){
34 $increments[$i] = $i;
37 if(isset($this->config)){
38 $config = $this->config;
39 } else{
40 $config = get_config('blocks/section_links');
43 $selected = array();
44 if (!empty($config->numsections1)) {
45 if (empty($config->incby1)) {
46 $config->incby1 = 2;
48 $selected[1] = array($config->numsections1, $config->incby1);
49 } else {
50 $selected[1] = array(22, 2);
53 if (!empty($config->numsections2)) {
54 if (empty($config->incby1)) {
55 $config->incby1 = 5;
57 $selected[2] = array($config->numsections2, $config->incby2);
58 } else {
59 $selected[2] = array(40, 5);
63 <table cellpadding="9" cellspacing="0">
64 <?php
65 for($i = 1; $i < 3; $i++){
67 <tr valign="top">
68 <td align="right">
69 <?php print_string('numsections'.$i, 'block_section_links'); ?>:
70 </td>
71 <td>
72 <?php choose_from_menu($numberofsections, 'numsections'.$i, $selected[$i][0]); ?>
73 </td>
74 <td>
75 <?php print_string('numsectionsdesc'.$i, 'block_section_links'); ?>
76 </td>
77 </tr>
78 <tr valign="top">
79 <td align="right">
80 <?php print_string('incby'.$i, 'block_section_links'); ?>:
81 </td>
82 <td>
83 <?php choose_from_menu($increments, 'incby'.$i, $selected[$i][1]); ?>
84 </td>
85 <td>
86 <?php print_string('incbydesc'.$i, 'block_section_links'); ?>
87 </td>
88 </tr>
89 <?php }
91 <tr>
92 <td colspan="3" align="center">
93 <input type="hidden" name="sesskey" value="<?php echo sesskey();?>">
94 <input type="submit" value="<?php print_string('savechanges') ?>" />
95 </td>
96 </tr>
97 </table>