Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
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/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * Report plugins helper class
-
 
19
 *
-
 
20
 * @package core
-
 
21
 * @subpackage report
-
 
22
 * @copyright 2021 Sujith Haridasan
-
 
23
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
24
 */
-
 
25
 
16
 
-
 
17
namespace core;
26
namespace core;
18
 
27
use context_course;
19
use context_course;
28
use moodle_url;
20
use moodle_url;
Línea 29... Línea 21...
29
use stdClass;
21
use stdClass;
30
 
22
 
31
/**
23
/**
32
 * A helper class with static methods to help report plugins
24
 * A helper class with static methods to help report plugins
-
 
25
 *
33
 *
26
 * @package core
34
 * @package core
27
 * @subpackage report
35
 * @copyright 2021 Sujith Haridasan
28
 * @copyright 2021 Sujith Haridasan
36
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
30
 */
37
 */
31
class report_helper {
38
class report_helper {
32
 
39
    /**
33
    /**
40
     * Print the selector dropdown
34
     * Print the selector dropdown
41
     *
35
     *
42
     * @param string $pluginname The report plugin where the header is modified
36
     * @param string $pluginname The report plugin where the header is modified
43
     * @return void
37
     * @param string $additional Additional content to display aligned with the selector
44
     */
38
     */
Línea 45... Línea 39...
45
    public static function print_report_selector(string $pluginname): void {
39
    public static function print_report_selector(string $pluginname, string $additional = ''): void {
Línea 46... Línea 40...
46
        global $OUTPUT, $PAGE;
40
        global $OUTPUT, $PAGE;
Línea 79... Línea 73...
79
            $selectmenu = new \core\output\select_menu('reporttype', $menuarray, $activeurl);
73
            $selectmenu = new \core\output\select_menu('reporttype', $menuarray, $activeurl);
80
            $selectmenu->set_label(get_string('reporttype'), ['class' => 'sr-only']);
74
            $selectmenu->set_label(get_string('reporttype'), ['class' => 'sr-only']);
81
            $options = \html_writer::tag(
75
            $options = \html_writer::tag(
82
                'div',
76
                'div',
83
                $OUTPUT->render_from_template('core/tertiary_navigation_selector', $selectmenu->export_for_template($OUTPUT)),
77
                $OUTPUT->render_from_template('core/tertiary_navigation_selector', $selectmenu->export_for_template($OUTPUT)),
84
                ['class' => 'row pb-3']
78
                ['class' => 'navitem']
85
            );
79
            );
-
 
80
 
-
 
81
            if ($additional) {
-
 
82
                $options .= \html_writer::div('', 'navitem-divider') .
-
 
83
                    \html_writer::div($additional, 'navitem');
-
 
84
            }
-
 
85
 
86
            echo \html_writer::tag(
86
            echo \html_writer::tag(
87
                'div',
87
                'div',
88
                $options,
88
                $options,
89
                ['class' => 'tertiary-navigation full-width-bottom-border ml-0', 'id' => 'tertiary-navigation']);
89
                ['class' => 'tertiary-navigation full-width-bottom-border ml-0 d-flex', 'id' => 'tertiary-navigation']);
90
        } else {
90
        } else {
91
            echo $OUTPUT->heading($pluginname, 2, 'mb-3');
91
            echo $OUTPUT->heading($pluginname, 2, 'mb-3');
92
        }
92
        }
93
    }
93
    }