diff --git a/db/install.php b/db/install.php index 39f6c8b..a6c5e22 100644 --- a/db/install.php +++ b/db/install.php @@ -23,151 +23,4 @@ function xmldb_adobeconnect_install() { global $DB; - - // The commented out code is waiting for a fix for MDL-25709 - $result = true; - $timenow = time(); - $sysctx = context_system::instance(); - $mrole = new stdClass(); - $levels = array(CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_MODULE); - - $param = array('shortname' => 'coursecreator'); - $coursecreator = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); - if (empty($coursecreator)) { - $param = array('archetype' => 'coursecreator'); - $coursecreator = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); - } - $coursecreatorrid = array_shift($coursecreator); - - $param = array('shortname' =>'editingteacher'); - $editingteacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); - if (empty($editingteacher)) { - $param = array('archetype' => 'editingteacher'); - $editingteacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); - } - $editingteacherrid = array_shift($editingteacher); - - $param = array('shortname' =>'teacher'); - $teacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); - if (empty($teacher)) { - $param = array('archetype' => 'teacher'); - $teacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); - } - $teacherrid = array_shift($teacher); - - // Fully setup the Adobe Connect Presenter role. - $param = array('shortname' => 'adobeconnectpresenter'); - if (!$mrole = $DB->get_record('role', $param)) { - - if ($rid = create_role(get_string('adobeconnectpresenter', 'adobeconnect'), 'adobeconnectpresenter', - get_string('adobeconnectpresenterdescription', 'adobeconnect'), 'adobeconnectpresenter')) { - - $mrole = new stdClass(); - $mrole->id = $rid; - $result = $result && assign_capability('mod/adobeconnect:meetingpresenter', CAP_ALLOW, $mrole->id, $sysctx->id); - - set_role_contextlevels($mrole->id, $levels); - } else { - $result = false; - } - } - - if (isset($coursecreatorrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($coursecreatorrid->id, $mrole->id); - } - } - - if (isset($editingteacherrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($editingteacherrid->id, $mrole->id); - } - } - - if (isset($teacherrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($teacherrid->id, $mrole->id); - } - } - - // Fully setup the Adobe Connect Participant role. - $param = array('shortname' => 'adobeconnectparticipant'); - - if ($result && !($mrole = $DB->get_record('role', $param))) { - - if ($rid = create_role(get_string('adobeconnectparticipant', 'adobeconnect'), 'adobeconnectparticipant', - get_string('adobeconnectparticipantdescription', 'adobeconnect'), 'adobeconnectparticipant')) { - - $mrole = new stdClass(); - $mrole->id = $rid; - $result = $result && assign_capability('mod/adobeconnect:meetingparticipant', CAP_ALLOW, $mrole->id, $sysctx->id); - set_role_contextlevels($mrole->id, $levels); - } else { - $result = false; - } - } - - if (isset($coursecreatorrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($coursecreatorrid->id, $mrole->id); - } - } - - if (isset($editingteacherrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($editingteacherrid->id, $mrole->id); - } - } - - if (isset($teacherrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($teacherrid->id, $mrole->id); - } - } - - - // Fully setup the Adobe Connect Host role. - $param = array('shortname' => 'adobeconnecthost'); - if ($result && !$mrole = $DB->get_record('role', $param)) { - if ($rid = create_role(get_string('adobeconnecthost', 'adobeconnect'), 'adobeconnecthost', - get_string('adobeconnecthostdescription', 'adobeconnect'), 'adobeconnecthost')) { - - $mrole = new stdClass(); - $mrole->id = $rid; - $result = $result && assign_capability('mod/adobeconnect:meetinghost', CAP_ALLOW, $mrole->id, $sysctx->id); - set_role_contextlevels($mrole->id, $levels); - } else { - $result = false; - } - } - - if (isset($coursecreatorrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($coursecreatorrid->id, $mrole->id); - } - } - - if (isset($editingteacherrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($editingteacherrid->id, $mrole->id); - } - } - - if (isset($teacherrid->id)) { - $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id); - if (!$DB->get_record('role_allow_assign', $param)) { - allow_assign($teacherrid->id, $mrole->id); - } - } - - return $result; - } \ No newline at end of file diff --git a/joinrecording.php b/joinrecording.php index bb48f45..473d3f1 100644 --- a/joinrecording.php +++ b/joinrecording.php @@ -150,4 +150,4 @@ $adobesession = $aconnect->get_cookie(); redirect($protocol . $CFG->adobeconnect_meethost . $port - . $recording->url . '?session=' . $aconnect->get_cookie()); + . $recording->url . '?session=' . $aconnect->get_cookie() . '&html-view=true'); diff --git a/lang/en/adobeconnect.php b/lang/en/adobeconnect.php index f953569..ad6236d 100644 --- a/lang/en/adobeconnect.php +++ b/lang/en/adobeconnect.php @@ -167,4 +167,7 @@ $string['event_join_meeting'] = 'User joined a meeting'; $string['event_view_recording'] = 'User viewed a recording'; $string['event_assign_role'] = 'User assigned a Connect Pro role'; -$string['event_unassign_role'] = 'User unassigned a Connect Pro role'; \ No newline at end of file +$string['event_unassign_role'] = 'User unassigned a Connect Pro role'; +$string['startdate'] = 'start'; +$string['enddate'] = 'end'; +$string['duration'] = 'duration'; \ No newline at end of file diff --git a/lang/fa/adobeconnect.php b/lang/fa/adobeconnect.php new file mode 100644 index 0000000..053571c --- /dev/null +++ b/lang/fa/adobeconnect.php @@ -0,0 +1,173 @@ +role role for $a->meetname ($a->groupname)'; +$string['assignroles'] = 'Assign roles'; +$string['availablelist'] = 'Available'; +$string['backtomeeting'] = 'Back to $a meeting'; +$string['cancelchanges'] = 'Cancel'; +$string['duplicatemeetingname'] = 'A duplicate meeting name was found on the server'; +$string['duplicateurl'] = 'A duplicate meeting URL was found on the server'; +$string['editingfor'] = 'Editing for: $a'; +$string['email_login'] = 'Email address login'; +$string['email_login_desc'] = 'Check this option only if your Connect Pro server login is set to use email address. Note that toggling this option on/off during regular usage of this activity module can potentially create duplicaed users on the Connect Pro server'; +$string['endtime'] = 'End time'; +$string['existingusers'] = '$a existing users'; +$string['groupswitch'] = 'Filter by group'; +$string['host'] = 'Host'; +$string['host_desc'] = 'Where REST calls get sent to'; +$string['joinmeeting'] = 'Join Meeting'; +$string['meethost_desc'] = 'Domain where the Adobe server is installed'; +$string['meetinghost'] = 'Meeting domain'; +$string['meetingend'] = 'Meeting end time'; +$string['meetinginfo'] = 'Meeting Info'; +$string['meetingintro'] = 'Meeting Summary'; +$string['meetinggroup'] = 'Meeting group'; +$string['meetingname'] = 'Meeting Name'; +$string['meetingstart'] = 'Meeting start time'; +$string['meetingtype'] = 'Meeting type'; +$string['modulename'] = 'Adobe Connect'; +$string['modulenameplural'] = 'Adobe Connect'; +$string['meettemplates'] = 'Meeting Templates'; +$string['meeturl'] = 'Meeting URL'; +$string['participantbtngrp'] = 'Participant Actions'; +$string['participantsgrp'] = 'Meeting Users'; +$string['particpantslabel'] = 'Participants'; +$string['potentialusers'] = '$a potential users'; +$string['port'] = 'Port'; +$string['port_desc'] = 'Port used to connect to Adobe Connect'; +$string['presenterbtngrp'] = 'Presenter Actions'; +$string['presenterlabel'] = 'Presenter'; +$string['recordinghdr'] = 'Meeting Recordings'; +$string['record_force'] = 'Force Meeting Recordings'; +$string['record_force_desc'] = 'Force all Adobe Connect meetings to be recorded. This is a site wide effect and the Adobe Connect server must be restarted'; +$string['removeparticipant'] = 'Remove'; +$string['removepresenter'] = 'Remove'; +$string['roletoassign'] = 'Role to assign'; +$string['samemeettime'] = 'Invalid Meeting time'; +$string['savechanges'] = 'Save'; +$string['selectparticipants'] = 'Assign roles'; +$string['starttime'] = 'Start time'; +$string['usergrouprequired'] = 'This Meeting requires users to be in a group in order to join'; +$string['testconnection'] = 'Test Connection'; +$string['connectiontesttitle'] = 'Connection test window'; +$string['conntestintro'] = '

A series of tests have been run in order to determine whether the Adobe Connect Pro server has been properly setup for this integration to work and to also determine whether the user credentials provided in the activity global settings has the correct permissions to perform the neccessary tasks required by the activity module. If any of the tests below have failed, this activity module will not function properly.

For further assistance and documentation in how to set up your Adobe Connect Pro server please consult the MoodleDocs help page for this activity module Help page

'; +$string['greaterstarttime'] = 'The start time cannot be greater than the end time'; +$string['invalidadobemeeturl'] = 'Invalid entry for this field. Click the help bubble for valid entries'; + +$string['adobeconnect:meetingpresenter'] = 'Meeting Presenter'; +$string['adobeconnect:meetingparticipant'] = 'Meeting Particpant'; +$string['adobeconnect:meetinghost'] = 'Meeting Host'; +$string['public'] = 'Public'; +$string['private'] = 'Private'; + +// Error codes +$string['emptyxml'] = 'Unable to connect to the Adobe Connect Pro server at this time. Please inform your Moodle administrator.'; +$string['adminemptyxml'] = 'Unable to connect to the Adobe Connect Pro server at this time. Click continue to proceed to the activity settings page and test the connection'; +$string['notsetupproperty'] = 'The activity module is not properly setup. Please contact your Moodle administrator'; +$string['adminnotsetupproperty'] = 'The activity module is not properly setup. Click continue to proceed to the activity settings page and test the connection'; +$string['notparticipant'] = 'You are not a participant for this meeting'; +$string['unableretrdetails'] = 'Unable to retrieve meeting details'; +$string['usernotenrolled'] = 'Only users enrolled and have a role in this course can join this meeting'; +$string['nopresenterrole'] = 'error: error finding adobeconnectpresenter role'; +$string['nomeeting'] = 'No meeting exists on the server'; +$string['noinstances'] = 'There are no instances of adobeconnect'; +$string['error1'] = 'You must be a site administrator to access this page'; +$string['error2'] = 'The property \'{$a}\' is empty, please input a value and save the settings'; +$string['errormeeting'] = 'Error retrieving recording'; +$string['settingblurb'] = '

+

Adobe Systems Inc. and Remote-Learner.net have partnered together to create the first publicly available + and officially sponsored, integration method between Moodle and Adobe Acrobat Connect Pro. This new + integration is designed to simplify the use of synchronous events within Moodle. It provides a + single-sign-on between the two systems with easy creation and management of Adobe Connect Pro + meetings.


+

About Remote-Learner
+ Remote-Learner has been providing educational technologies services since 1982 to its business, + educational and governmental clients. Today, these services include support for best-of-breed + open source programs. Remote-Learner is an official Moodle partner, JasperSoft partner and + Alfresco partner. The company offers SaaS hosting services, IT support contracts, custom + programming, workforce development training, instructional design and strategic consulting + services for organizations planning online learning programs.


+

Visit the Adobe Connect Moodle Plugins Directory for information on Enterprise support.

'; +$string['meeturl_help'] = '

You can customize the URL that is used to connect to the Adobe connect meeting. The Adobe Server domain will always remain the same. + However the last part of the URL can be customized. +

+

For example if the Adobe Connect server domain was located at http://adobe.connect.server/ + when customizing the URL to mymeeting, the URL to connect to the meeting would be http://adobe.connect.server/mymeeting. Leave out the trailing forward slash +

+

Valid URL entries consists of the name with +

+ +Invalid URL entries consist of more than one forward slash: + + +

+

Once the meeting has been saved, you will no longer be able to edit/update this field as the field will be disabled. +If updating the activity settings and if Groups Mode is set to no group then you will see part of the URL in the text field. +Otherwise the text field will remain blank as each course group will have their own meeting URL. +

'; +$string['meetingtype_help'] = '

A public meeting type is one where anyone who has the URL for the meeting can enter the room.

+

A private meeting type is one where only registered users and participants can enter. The login page does not allow +guests to log in. With private meetings the meeting does not actually start until the meeting Presenter or Host joins the meeting.

+ +

+If you are creating a private meeting it is always good practice to assign at +least 1 host or presenter who will be present in the meeting; because users with +the participant role will be unable to join the meeting unless a user with the +host or presenter roles has already joined th meeting. +

+ +

+If the meeting has support for separate groups at least 1 user in each group, who is +to be present in the meeting, should have either the host or presenter role. +

'; +$string['meettemplates_help'] = '

A meeting room template creates meeting with a custom layout for the meeting room.

'; +$string['pluginadministration'] = 'Adobe Connect Administration'; +$string['pluginname'] = 'Adobe Connect'; +$string['modulename'] = 'Adobe Connect'; +$string['recordinghdr'] = 'Recordings'; +$string['https'] = 'HTTPS Connection'; +$string['https_desc'] = 'Connect to the Connect server via HTTPS'; +$string['invalidurl'] = 'The URL needs to start with a letter (a-z)'; +$string['longurl'] = 'That meeting URL is too long. Try shortening it'; +$string['errorrecording'] = 'Unable to find recording session'; +$string['meetinfo'] = 'More Meeting Detail'; +$string['meetinfotxt'] = 'See server meeting details'; +$string['missingexpectedgroups'] = 'There are no groups available.'; +$string['event_view'] = 'Viewed activity'; +$string['event_view_all'] = 'Viewed all instances of the activity'; +$string['event_join_meeting'] = 'User joined a meeting'; +$string['event_view_recording'] = 'User viewed a recording'; +$string['event_assign_role'] = 'User assigned a Connect Pro role'; +$string['event_unassign_role'] = 'User unassigned a Connect Pro role'; +$string['startdate'] = 'شروع'; +$string['enddate'] = 'پایان'; +$string['duration'] = 'مدت زمان'; \ No newline at end of file diff --git a/lang/fa/help/adobeconnect/assignroles.html b/lang/fa/help/adobeconnect/assignroles.html new file mode 100644 index 0000000..f43ab5a --- /dev/null +++ b/lang/fa/help/adobeconnect/assignroles.html @@ -0,0 +1,48 @@ +

Assigning Roles

+ +

+When assigning roles to a private meeting it is always good practice to assign at +least 1 host or presenter who will be present in the meeting; because users with +the participant role will be unable to join the meeting unless a user with the +host or presenter roles has already joined th meeting. +

+ +

+If the meeting has support for separate groups at least 1 user in each group, who is +to be present in the meeting, should have either the host or presenter role. +

+ +

+By assigning a role to a user in a context, you +are granting them the permissions contained +in that role, for the current context and all +"lower" contexts. +

+ +

+Contexts: +

+
    +
  1. System (the entire installation)
  2. +
  3. Front page (the "site course")
  4. +
  5. Course Categories
  6. +
  7. Course Sub-categories
  8. +
  9. Courses
  10. +
  11. Blocks and Activities
  12. +
+ +

+So for example, if you grant a Student role to a +user in a Course, they will have that role for +the course, but also all Blocks and Activities inside +that course. Their actual permissions may depend on +other roles and overrides that have been defined. +

+ +

+See also +Roles, +Contexts, +Permissions and +Overrides. +

diff --git a/lang/fa/help/adobeconnect/index.html b/lang/fa/help/adobeconnect/index.html new file mode 100644 index 0000000..61f3252 --- /dev/null +++ b/lang/fa/help/adobeconnect/index.html @@ -0,0 +1,7 @@ +

Adobe Connect

+ diff --git a/lang/fa/help/adobeconnect/meetingtype.html b/lang/fa/help/adobeconnect/meetingtype.html new file mode 100644 index 0000000..fd381ef --- /dev/null +++ b/lang/fa/help/adobeconnect/meetingtype.html @@ -0,0 +1,19 @@ +

 Meeting Type

+
+

A public meeting type is one where anyone who has the URL for the meeting can enter the room.

+

A private meeting type is one where only registered users and participants can enter. The login page does not allow +guests to log in. With private meetings the meeting does not actually start until the meeting Presenter or Host joins the meeting.

+ +

+If you are creating a private meeting it is always good practice to assign at +least 1 host or presenter who will be present in the meeting; because users with +the participant role will be unable to join the meeting unless a user with the +host or presenter roles has already joined th meeting. +

+ +

+If the meeting has support for separate groups at least 1 user in each group, who is +to be present in the meeting, should have either the host or presenter role. +

+ +
diff --git a/lang/fa/help/adobeconnect/meeturl.html b/lang/fa/help/adobeconnect/meeturl.html new file mode 100644 index 0000000..bd78d75 --- /dev/null +++ b/lang/fa/help/adobeconnect/meeturl.html @@ -0,0 +1,28 @@ +

 Meeting URL

+
+

You can customize the URL that is used to connect to the Adobe connect meeting. The Adobe Server domain will always remain the same. + However the last part of the URL can be customized. +

+

For example if the Adobe Connect server domain was located at http://adobe.connect.server/ + when customizing the URL to mymeeting, the URL to connect to the meeting would be http://adobe.connect.server/mymeeting. Leave out the trailing forward slash +

+

Valid URL entries consists of the name with +

+ +Invalid URL entries consist of more than one forward slash: + + +

+

Once the meeting has been saved, you will no longer be able to edit/update this field as the field will be disabled. +If updating the activity settings and if Groups Mode is set to no group then you will see part of the URL in the text field. +Otherwise the text field will remain blank as each course group will have their own meeting URL. +

+
diff --git a/lang/fa/help/adobeconnect/mods.html b/lang/fa/help/adobeconnect/mods.html new file mode 100644 index 0000000..b0e0a81 --- /dev/null +++ b/lang/fa/help/adobeconnect/mods.html @@ -0,0 +1,12 @@ +

 Adobe Connect

+
+

The Adobe Connect Pro activity module provides the officially sponsored integration +method between Moodle and Adobe Connect Pro. It was developed in conjunction with the Remote-Learner +development team and Adobe Inc. It is designed to simplify the use of synchronous events within Moodle. +It provides a single sign on between the two systems with easy event creation and management.

+ +

+Please see the Adobe Connect Pro Module page for more +details on this project. +

+
diff --git a/lang/fa/help/adobeconnect/templatescoid.html b/lang/fa/help/adobeconnect/templatescoid.html new file mode 100644 index 0000000..d2d39ca --- /dev/null +++ b/lang/fa/help/adobeconnect/templatescoid.html @@ -0,0 +1,4 @@ +

 Meeting Template

+
+

A meeting room template creates meeting with a custom layout for the meeting room.

+
diff --git a/lib.php b/lib.php index 296d49f..bb1b65b 100644 --- a/lib.php +++ b/lib.php @@ -40,8 +40,8 @@ $adobeconnect_EXAMPLE_CONSTANT = 42; -/** Include eventslib.php */ -require_once($CFG->libdir.'/eventslib.php'); +/** Include accesslib.php */ +require_once($CFG->libdir.'/accesslib.php'); /** Include calendar/lib.php */ require_once($CFG->dirroot.'/calendar/lib.php'); diff --git a/locallib.php b/locallib.php index b08bafa..ed14701 100644 --- a/locallib.php +++ b/locallib.php @@ -633,9 +633,11 @@ function aconnect_get_recordings($aconnect, $folderscoid, $sourcescoid) { if (!is_null($domnode)) { $meetingdetail = $innernodelist->item($x); + $recordingvac9 = $innernodelist->item($x)->attributes->getNamedItem('duration'); + $recordingvac8 = $meetingdetail->getElementsByTagName('duration')->item(0); // Check if the SCO item is a recording or uploaded document. We only want to display recordings - if (!is_null($meetingdetail->getElementsByTagName('duration')->item(0))) { + if ((!is_null($recordingvac9) && $recordingvac9->nodeValue !== '') || !is_null($recordingvac8)) { $j = (int) $domnode->nodeValue; $value = (!is_null($meetingdetail->getElementsByTagName('name'))) ? @@ -668,8 +670,8 @@ function aconnect_get_recordings($aconnect, $folderscoid, $sourcescoid) { $recordings[$j]->modified = (string) $value; - $value = (!is_null($meetingdetail->getElementsByTagName('duration'))) ? - $meetingdetail->getElementsByTagName('duration')->item(0)->nodeValue : ''; + $value = (!is_null($recordingvac9) ? + $recordingvac9->nodeValue : $recordingvac8->nodeValue); $recordings[$j]->duration = (string) $value; diff --git a/pix/rl_logo.png b/pix/rl_logo.png index 9baf219..e52a059 100644 Binary files a/pix/rl_logo.png and b/pix/rl_logo.png differ diff --git a/renderer.php b/renderer.php index f21009a..82c9c45 100644 --- a/renderer.php +++ b/renderer.php @@ -252,17 +252,27 @@ function display_meeting_recording($recordings, $cmid, $groupid, $sourcescoid) { $html .= html_writer::tag('h3', get_string('recordinghdr', 'adobeconnect'), $param); - $param = array('class' => 'aconrecording'); - $html .= html_writer::start_tag('div', $param); + $table = new html_table(); + $table->attributes['class'] = 'generaltable mod_index'; + $counter = 0; foreach ($recordings as $key => $recordinggrp) { if (!empty($recordinggrp)) { + $table->head = array( + '#', + get_string('name'), + get_string('startdate', 'adobeconnect'), + get_string('enddate', 'adobeconnect'), + get_string('duration', 'adobeconnect'), + ); foreach($recordinggrp as $recording_scoid => $recording) { if ($recording->sourcesco != $sourcescoid) { continue; } + $counter++; + $html .= html_writer::start_tag('tr'); $param = array('class' => 'aconrecordingrow'); $html .= html_writer::start_tag('div', $param); @@ -272,15 +282,25 @@ function display_meeting_recording($recordings, $cmid, $groupid, $sourcescoid) { $param = array('target' => '_blank'); $name = html_entity_decode($recording->name); + + $link = html_writer::link($url, format_string($name), $param); + $table->data[] = array( + $counter, + $link, + userdate(strtotime($recording->startdate)), + userdate(strtotime($recording->enddate)), + gmdate("H:i:s", $recording->duration ) + ); + $html .= html_writer::link($url, format_string($name), $param); - $html .= html_writer::end_tag('div'); + $html .= html_writer::end_tag('tr'); } } } - $html .= html_writer::end_tag('div'); + $html .= html_writer::table($table); $html .= html_writer::end_tag('div'); diff --git a/settings.php b/settings.php index a04b7ea..ef7ffa1 100644 --- a/settings.php +++ b/settings.php @@ -25,6 +25,156 @@ global $PAGE; +// installation process that can't done in plugin install process moved here from db\install.php file +$param = array('shortname' => 'adobeconnectpresenter'); +$mrole = $DB->get_record('role', $param); + +if (!$mrole){ + // The commented out code is waiting for a fix for MDL-25709 + $result = true; + $timenow = time(); + $sysctx = context_system::instance(); + $mrole = new stdClass(); + $levels = array(CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_MODULE); + + $param = array('shortname' => 'coursecreator'); + $coursecreator = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); + if (empty($coursecreator)) { + $param = array('archetype' => 'coursecreator'); + $coursecreator = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); + } + $coursecreatorrid = array_shift($coursecreator); + + $param = array('shortname' =>'editingteacher'); + $editingteacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); + if (empty($editingteacher)) { + $param = array('archetype' => 'editingteacher'); + $editingteacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); + } + $editingteacherrid = array_shift($editingteacher); + + $param = array('shortname' =>'teacher'); + $teacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); + if (empty($teacher)) { + $param = array('archetype' => 'teacher'); + $teacher = $DB->get_records('role', $param, 'id ASC', 'id', 0, 1); + } + $teacherrid = array_shift($teacher); + + // Fully setup the Adobe Connect Presenter role. + $param = array('shortname' => 'adobeconnectpresenter'); + if (!$mrole = $DB->get_record('role', $param)) { + + if ($rid = create_role(get_string('adobeconnectpresenter', 'adobeconnect'), 'adobeconnectpresenter', + get_string('adobeconnectpresenterdescription', 'adobeconnect'), 'adobeconnectpresenter')) { + + $mrole = new stdClass(); + $mrole->id = $rid; + $result = $result && assign_capability('mod/adobeconnect:meetingpresenter', CAP_ALLOW, $mrole->id, $sysctx->id); + + set_role_contextlevels($mrole->id, $levels); + } else { + $result = false; + } + } + + if (isset($coursecreatorrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id); + } + } + + if (isset($editingteacherrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($editingteacherrid->id, $mrole->id); + } + } + + if (isset($teacherrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($teacherrid->id, $mrole->id); + } + } + + // Fully setup the Adobe Connect Participant role. + $param = array('shortname' => 'adobeconnectparticipant'); + + if ($result && !($mrole = $DB->get_record('role', $param))) { + + if ($rid = create_role(get_string('adobeconnectparticipant', 'adobeconnect'), 'adobeconnectparticipant', + get_string('adobeconnectparticipantdescription', 'adobeconnect'), 'adobeconnectparticipant')) { + + $mrole = new stdClass(); + $mrole->id = $rid; + $result = $result && assign_capability('mod/adobeconnect:meetingparticipant', CAP_ALLOW, $mrole->id, $sysctx->id); + set_role_contextlevels($mrole->id, $levels); + } else { + $result = false; + } + } + + if (isset($coursecreatorrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id); + } + } + + if (isset($editingteacherrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($editingteacherrid->id, $mrole->id); + } + } + + if (isset($teacherrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($teacherrid->id, $mrole->id); + } + } + + + // Fully setup the Adobe Connect Host role. + $param = array('shortname' => 'adobeconnecthost'); + if ($result && !$mrole = $DB->get_record('role', $param)) { + if ($rid = create_role(get_string('adobeconnecthost', 'adobeconnect'), 'adobeconnecthost', + get_string('adobeconnecthostdescription', 'adobeconnect'), 'adobeconnecthost')) { + + $mrole = new stdClass(); + $mrole->id = $rid; + $result = $result && assign_capability('mod/adobeconnect:meetinghost', CAP_ALLOW, $mrole->id, $sysctx->id); + set_role_contextlevels($mrole->id, $levels); + } else { + $result = false; + } + } + + if (isset($coursecreatorrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $coursecreatorrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($coursecreatorrid->id, $mrole->id); + } + } + + if (isset($editingteacherrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $editingteacherrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($editingteacherrid->id, $mrole->id); + } + } + + if (isset($teacherrid->id)) { + $param = array('allowassign' => $mrole->id, 'roleid' => $teacherrid->id); + if (!$DB->get_record('role_allow_assign', $param)) { + core_role_set_assign_allowed($teacherrid->id, $mrole->id); + } + } +} + if ($ADMIN->fulltree) { require_once($CFG->dirroot . '/mod/adobeconnect/locallib.php'); $PAGE->requires->js_init_call('M.mod_adobeconnect.init'); diff --git a/version.php b/version.php index 56c22e1..9f8f020 100644 --- a/version.php +++ b/version.php @@ -21,9 +21,9 @@ * @copyright (C) 2015 Remote Learner.net Inc http://www.remote-learner.net */ -$plugin->version = 2017111300; -$plugin->requires = 2017111300; +$plugin->version = 2020112116; +$plugin->requires = 2020112116; $plugin->cron = 0; $plugin->component = 'mod_adobeconnect'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = '3.4.0.0'; +$plugin->release = '3.9.0.0';