Files
meetletacbfree/classes/local/privacy_policy.php
T

84 lines
3.4 KiB
PHP

<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Admin HTML for the in-plugin privacy policy tab (Marketplace edition).
*
* @package mod_meetletacbfree
* @copyright 2026 MeetLet
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_meetletacbfree\local;
defined('MOODLE_INTERNAL') || die();
/**
* Renders the Privacy admin settings tab.
*/
class privacy_policy {
/**
* Build privacy policy HTML (safe for admin settings heading).
*/
public static function render(): string {
$plugin = 'meetletacbfree';
$sections = [
self::section('scope', 'privacy_tab_scope_title', 'privacy_tab_scope_body'),
self::section('registration', 'privacy_tab_registration_title', 'privacy_tab_registration_body'),
self::section('purpose', 'privacy_tab_purpose_title', 'privacy_tab_purpose_body'),
self::section('service', 'privacy_tab_service_title', 'privacy_tab_service_body'),
self::section('adobe', 'privacy_tab_adobe_title', 'privacy_tab_adobe_body'),
self::section('local', 'privacy_tab_local_title', 'privacy_tab_local_body'),
self::section('retention', 'privacy_tab_retention_title', 'privacy_tab_retention_body'),
self::section('sharing', 'privacy_tab_sharing_title', 'privacy_tab_sharing_body'),
self::section('control', 'privacy_tab_control_title', 'privacy_tab_control_body'),
self::section('contact', 'privacy_tab_contact_title', 'privacy_tab_contact_body'),
];
return \html_writer::div(
\html_writer::tag('h3', get_string('privacy_tab_heading', $plugin), ['class' => 'meetlet-guide__heading']) .
\html_writer::tag('p', get_string('privacy_tab_intro', $plugin), ['class' => 'meetlet-guide__intro']) .
\html_writer::tag('p', get_string('privacy_tab_effective', $plugin), [
'class' => 'meetlet-guide__intro text-muted',
]) .
implode('', $sections),
'meetlet-guide meetlet-settings-card meetlet-privacy'
);
}
/**
* @param string $id Section id for anchoring.
* @param string $titlekey Lang string key for section title.
* @param string $bodykey Lang string key or pre-formatted body HTML.
*/
protected static function section(string $id, string $titlekey, string $bodykey): string {
$plugin = 'meetletacbfree';
$title = get_string($titlekey, $plugin);
$body = strpos($bodykey, '<') !== false
? $bodykey
: get_string($bodykey, $plugin);
return \html_writer::div(
\html_writer::tag('h4', $title) .
\html_writer::div($body, 'meetlet-guide__body'),
'meetlet-guide__section',
['id' => 'meetlet-privacy-' . $id]
);
}
}