Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
namespace tool_courserating;
18
 
19
/**
20
 * Plugin constants
21
 *
22
 * @package    tool_courserating
23
 * @copyright  2022 Marina Glancy <marina.glancy@gmail.com>
24
 * @license    https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
26
class constants {
27
    /** @var int */
28
    const REVIEWS_PER_PAGE = 10;
29
 
30
    /** @var string */
31
    const CFIELD_RATING = 'tool_courserating';
32
    /** @var string */
33
    const CFIELD_RATINGMODE = 'tool_courserating_mode';
34
 
35
    /** @var int */
36
    const RATEBY_NOONE = 1;
37
    /** @var int */
38
    const RATEBY_ANYTIME = 2;
39
    /** @var int */
40
    const RATEBY_COMPLETED = 3;
41
 
42
    /** @var string */
43
    const SETTING_RATINGMODE = 'ratingmode';
44
    /** @var string */
45
    const SETTING_PERCOURSE = 'percourse';
46
    /** @var string */
47
    const SETTING_STARCOLOR = 'starcolor';
48
    /** @var string */
49
    const SETTING_RATINGCOLOR = 'ratingcolor';
50
    /** @var string */
51
    const SETTING_DISPLAYEMPTY = 'displayempty';
52
    /** @var string */
53
    const SETTING_USEHTML = 'usehtml';
54
    /** @var string */
55
    const SETTING_PARENTCSS = 'parentcss';
56
 
57
    /** @var string */
58
    const SETTING_STARCOLOR_DEFAULT = '#e59819';
59
    /** @var string */
60
    const SETTING_RATINGCOLOR_DEFAULT = '#b4690e';
61
 
62
    /** @var string */
63
    const COLOR_GRAY = '#a0a0a0';
64
 
65
    /**
66
     * List of options for the 'ratingmode' selector
67
     *
68
     * @return \lang_string[]
69
     */
70
    public static function rated_courses_options() {
71
        return [
72
            self::RATEBY_NOONE => new \lang_string('ratebynoone', 'tool_courserating'),
73
            self::RATEBY_ANYTIME => new \lang_string('ratebyanybody', 'tool_courserating'),
74
            self::RATEBY_COMPLETED => new \lang_string('ratebycompleted', 'tool_courserating'),
75
        ];
76
    }
77
}