Initial commit: MeetLet Adobe Connect Bridge Marketplace edition (Moodle plugin).
Single-plugin source tree for mod_meetletacbmarketplace — admin, licensing, and marketplace integration. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* Plugin renderer.
|
||||
*
|
||||
* @package mod_meetletacbmarketplace
|
||||
* @copyright 2026 MeetLet
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_meetletacbmarketplace\output;
|
||||
|
||||
use plugin_renderer_base;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* MeetLet renderer.
|
||||
*/
|
||||
class renderer extends plugin_renderer_base {
|
||||
public function render_view_page(view_page $page): string {
|
||||
return $this->render_from_template('mod_meetletacbmarketplace/view_page', $page->export_for_template($this));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* View page renderable.
|
||||
*
|
||||
* @package mod_meetletacbmarketplace
|
||||
* @copyright 2026 MeetLet
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace mod_meetletacbmarketplace\output;
|
||||
|
||||
use mod_meetletacbmarketplace\local\featureaccess;
|
||||
use mod_meetletacbmarketplace\local\icons;
|
||||
use mod_meetletacbmarketplace\local\instance;
|
||||
use mod_meetletacbmarketplace\local\meetingstatus;
|
||||
use renderable;
|
||||
use renderer_base;
|
||||
use templatable;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Main activity shell with tabs.
|
||||
*/
|
||||
class view_page implements renderable, templatable {
|
||||
/** @var instance */
|
||||
protected $instance;
|
||||
/** @var bool */
|
||||
protected $configured;
|
||||
/** @var array|null */
|
||||
protected $lifecycle;
|
||||
/** @var bool */
|
||||
protected $registrationusable = true;
|
||||
|
||||
public function __construct(
|
||||
instance $instance,
|
||||
bool $configured,
|
||||
?array $lifecycle = null,
|
||||
bool $registrationusable = true
|
||||
) {
|
||||
$this->instance = $instance;
|
||||
$this->configured = $configured;
|
||||
$this->lifecycle = $lifecycle;
|
||||
$this->registrationusable = $registrationusable;
|
||||
}
|
||||
|
||||
public function export_for_template(renderer_base $output): array {
|
||||
global $USER;
|
||||
|
||||
$rec = $this->instance->record;
|
||||
$lifecycle = $this->lifecycle ?? meetingstatus::resolve_local($this->instance, (int)$USER->id);
|
||||
$status = $lifecycle['status'];
|
||||
$statuslabel = $lifecycle['statuslabel'];
|
||||
$startts = (int)$lifecycle['starttime'];
|
||||
$endts = (int)$lifecycle['endtime'];
|
||||
|
||||
$intro = format_module_intro('meetletacbmarketplace', $rec, $this->instance->cm->id);
|
||||
$tabs = [
|
||||
[
|
||||
'id' => 'details',
|
||||
'label' => get_string('tabdetails', 'meetletacbmarketplace'),
|
||||
'icon' => icons::svg('details'),
|
||||
'active' => true,
|
||||
],
|
||||
];
|
||||
if (featureaccess::allowed(featureaccess::RECORDINGS, $this->instance->context, $rec)) {
|
||||
$tabs[] = [
|
||||
'id' => 'recordings',
|
||||
'label' => get_string('tabrecordings', 'meetletacbmarketplace'),
|
||||
'icon' => icons::svg('recordings'),
|
||||
'active' => false,
|
||||
];
|
||||
}
|
||||
if (featureaccess::allowed(featureaccess::CONTENT, $this->instance->context, $rec)) {
|
||||
$tabs[] = [
|
||||
'id' => 'content',
|
||||
'label' => get_string('tabcontent', 'meetletacbmarketplace'),
|
||||
'icon' => icons::svg('content'),
|
||||
'active' => false,
|
||||
];
|
||||
}
|
||||
|
||||
$featurejoin = featureaccess::allowed(featureaccess::JOIN, $this->instance->context, $rec);
|
||||
$joinable = $featurejoin && !empty($lifecycle['joinable']);
|
||||
|
||||
return [
|
||||
'cmid' => (int)$this->instance->cm->id,
|
||||
'groupid' => (int)$this->instance->groupid,
|
||||
'name' => format_string($rec->name),
|
||||
'intro' => $intro,
|
||||
'hasintro' => trim(strip_tags($intro)) !== '',
|
||||
'detailstitle' => get_string('tabdetails', 'meetletacbmarketplace'),
|
||||
'emptydetails' => get_string('emptydetails', 'meetletacbmarketplace'),
|
||||
'configured' => $this->configured,
|
||||
'notconfiguredmsg' => get_string('notconfigured', 'meetletacbmarketplace'),
|
||||
'subtitle' => get_string('subtitle', 'meetletacbmarketplace'),
|
||||
'logourl' => $output->image_url('adobeconnect', 'meetletacbmarketplace')->out(false),
|
||||
'status' => $status,
|
||||
'statuslabel' => $statuslabel,
|
||||
'statusmessage' => (string)$lifecycle['message'],
|
||||
'starttime' => $startts ? userdate($startts) : '',
|
||||
'endtime' => $endts ? userdate($endts) : '',
|
||||
'hasend' => !empty($endts),
|
||||
'tabs' => $tabs,
|
||||
'loading' => get_string('loading', 'meetletacbmarketplace'),
|
||||
'joining' => get_string('joining', 'meetletacbmarketplace'),
|
||||
'joiningtitle' => get_string('joiningtitle', 'meetletacbmarketplace'),
|
||||
'joinlabel' => get_string('joinmeeting', 'meetletacbmarketplace'),
|
||||
'canjoin' => $featurejoin,
|
||||
'joinable' => $joinable,
|
||||
'statuspollseconds' => $this->registrationusable ? 15 : 0,
|
||||
'registrationusable' => $this->registrationusable,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user