~ubuntu-branches/ubuntu/trusty/moodle/trusty-proposed

« back to all changes in this revision

Viewing changes to mod/url/mod_form.php

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2013-07-19 08:52:46 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130719085246-yebwditc2exoap2r
Tags: 2.5.1-1
* New upstream version: 2.5.1.
  - Fixes security issues:
    CVE-2013-2242 CVE-2013-2243 CVE-2013-2244 CVE-2013-2245
    CVE-2013-2246
* Depend on apache2 instead of obsolete apache2-mpm-prefork.
* Use packaged libphp-phpmailer (closes: #429339), adodb,
  HTMLPurifier, PclZip.
* Update debconf translations, thanks Salvatore Merone, Pietro Tollot,
  Joe Hansen, Yuri Kozlov, Holger Wansing, Américo Monteiro,
  Adriano Rafael Gomes, victory, Michał Kułach.
  (closes: #716972, #716986, #717080, #717108, #717278)

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
            $mform->setType('name', PARAM_CLEANHTML);
46
46
        }
47
47
        $mform->addRule('name', null, 'required', null, 'client');
 
48
        $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
48
49
        $this->add_intro_editor($config->requiremodintro);
49
50
 
50
51
        //-------------------------------------------------------
51
52
        $mform->addElement('header', 'content', get_string('contentheader', 'url'));
52
53
        $mform->addElement('url', 'externalurl', get_string('externalurl', 'url'), array('size'=>'60'), array('usefilepicker'=>true));
 
54
        $mform->setType('externalurl', PARAM_URL);
53
55
        $mform->addRule('externalurl', null, 'required', null, 'client');
 
56
        $mform->setExpanded('content');
 
57
 
54
58
        //-------------------------------------------------------
55
 
        $mform->addElement('header', 'optionssection', get_string('optionsheader', 'url'));
 
59
        $mform->addElement('header', 'optionssection', get_string('appearance'));
56
60
 
57
61
        if ($this->current->instance) {
58
62
            $options = resourcelib_get_displayoptions(explode(',', $config->displayoptions), $this->current->display);
67
71
        } else {
68
72
            $mform->addElement('select', 'display', get_string('displayselect', 'url'), $options);
69
73
            $mform->setDefault('display', $config->display);
70
 
            $mform->setAdvanced('display', $config->display_adv);
71
74
            $mform->addHelpButton('display', 'displayselect', 'url');
72
75
        }
73
76
 
78
81
            }
79
82
            $mform->setType('popupwidth', PARAM_INT);
80
83
            $mform->setDefault('popupwidth', $config->popupwidth);
81
 
            $mform->setAdvanced('popupwidth', $config->popupwidth_adv);
82
84
 
83
85
            $mform->addElement('text', 'popupheight', get_string('popupheight', 'url'), array('size'=>3));
84
86
            if (count($options) > 1) {
86
88
            }
87
89
            $mform->setType('popupheight', PARAM_INT);
88
90
            $mform->setDefault('popupheight', $config->popupheight);
89
 
            $mform->setAdvanced('popupheight', $config->popupheight_adv);
90
91
        }
91
92
 
92
93
        if (array_key_exists(RESOURCELIB_DISPLAY_AUTO, $options) or
97
98
            $mform->disabledIf('printheading', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
98
99
            $mform->disabledIf('printheading', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
99
100
            $mform->setDefault('printheading', $config->printheading);
100
 
            $mform->setAdvanced('printheading', $config->printheading_adv);
101
101
 
102
102
            $mform->addElement('checkbox', 'printintro', get_string('printintro', 'url'));
103
103
            $mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_POPUP);
104
104
            $mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_OPEN);
105
105
            $mform->disabledIf('printintro', 'display', 'eq', RESOURCELIB_DISPLAY_NEW);
106
106
            $mform->setDefault('printintro', $config->printintro);
107
 
            $mform->setAdvanced('printintro', $config->printintro_adv);
108
107
        }
109
108
 
110
109
        //-------------------------------------------------------
111
110
        $mform->addElement('header', 'parameterssection', get_string('parametersheader', 'url'));
112
111
        $mform->addElement('static', 'parametersinfo', '', get_string('parametersheader_help', 'url'));
113
 
        $mform->setAdvanced('parametersinfo');
114
112
 
115
113
        if (empty($this->current->parameters)) {
116
114
            $parcount = 5;
129
127
                $mform->createElement('selectgroups', $variable, '', $options),
130
128
            );
131
129
            $mform->addGroup($group, $pargroup, get_string('parameterinfo', 'url'), ' ', false);
132
 
            $mform->setAdvanced($pargroup);
 
130
            $mform->setType($parameter, PARAM_RAW);
133
131
        }
134
132
 
135
133
        //-------------------------------------------------------