Skip to content

Commit

Permalink
fixed default permissions for authenticated user and a code tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
justinhunt committed Jul 18, 2019
1 parent ba8b746 commit ea862ad
Show file tree
Hide file tree
Showing 13 changed files with 1,970 additions and 1,901 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
@@ -1,5 +1,9 @@
Change List
=========
Version 3.1.2(Build 2019071300)
-Fixed default permission for authenticated user


Version 3.1.1(Build 2018090300)
-Added support for Cloud Poodll API token

Expand Down
136 changes: 71 additions & 65 deletions db/access.php
Expand Up @@ -26,72 +26,78 @@

$capabilities = array(

'atto/poodll:visible' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'atto/poodll:allowaudiomp3' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'atto/poodll:visible' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW,
'user' => CAP_ALLOW
)
),
'atto/poodll:allowaudiomp3' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW,
'user' => CAP_ALLOW
)
),

'atto/poodll:allowvideo' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'atto/poodll:allowwhiteboard' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'atto/poodll:allowsnapshot' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'atto/poodll:allowwidgets' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW
'atto/poodll:allowvideo' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW,
'user' => CAP_ALLOW
)
),
'atto/poodll:allowwhiteboard' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW,
'user' => CAP_ALLOW
)
),
'atto/poodll:allowsnapshot' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW,
'user' => CAP_ALLOW
)
),
'atto/poodll:allowwidgets' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
'manager' => CAP_ALLOW,
'user' => CAP_ALLOW
)
)
)
);

93 changes: 66 additions & 27 deletions dialog/poodll.css
@@ -1,34 +1,73 @@
.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
.mceActionPanel {margin-top:7px;}
.panel_wrapper div.current {height:320px;}
#classlist, #title, #href {width:280px;}
#popupurl, #popupname {width:200px;}
#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
#events_panel input {width:200px;}
.pagelayout-embedded #content {padding-top: 0px;}
#content {width:0px;height:0px;}
#page {top:0px;margin-top:0px;padding-top:0px;}
#tinymce_poodll_container{
position: fixed;
left: 0px;
top: 0px;
margin: 5px;
.mceLinkList, .mceAnchorList, #targetlist {
width: 280px;
}

.mceActionPanel {
margin-top: 7px;
}

.panel_wrapper div.current {
height: 320px;
}

#classlist, #title, #href {
width: 280px;
}

#popupurl, #popupname {
width: 200px;
}

#popupwidth, #popupheight, #popupleft, #popuptop {
width: 30px;
vertical-align: middle;
text-align: center;
}

#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {
width: 200px;
}

#events_panel input {
width: 200px;
}

.pagelayout-embedded #content {
padding-top: 0px;
}

#content {
width: 0px;
height: 0px;
}

#page {
top: 0px;
margin-top: 0px;
padding-top: 0px;
}

#tinymce_poodll_container {
position: fixed;
left: 0px;
top: 0px;
margin: 5px;
}

.atto_poodll_iframe_container {
padding: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
padding: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}

.atto_poodll_iframe_container iframe,
.atto_poodll_iframe_container object,
.atto_poodll_iframe_container embed{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.atto_poodll_iframe_container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
78 changes: 43 additions & 35 deletions dialog/poodll.php
Expand Up @@ -55,43 +55,51 @@
$modulecontextid = optional_param('modulecontextid', 0, PARAM_INT);

//contextid
$usercontextid=context_user::instance($USER->id)->id;
$usercontextid = context_user::instance($USER->id)->id;
$callbackjs = '';//'atto_poodll_button.updatefilename';
$hints= Array('size'=>'small');
if($coursecontextid){
$hints['coursecontextid']=$coursecontextid;
$hints = Array('size' => 'small');
if ($coursecontextid) {
$hints['coursecontextid'] = $coursecontextid;
}
if($modulecontextid){
$hints['modulecontextid']=$modulecontextid;
if ($modulecontextid) {
$hints['modulecontextid'] = $modulecontextid;
}

// Load the recorder.
switch($recorder){
case 'video':
$recorderhtml = \filter_poodll\poodlltools::fetchVideoRecorderForSubmission('auto', 'none', $updatecontrol, $usercontextid,'user','draft',$itemid,0,$callbackjs,$hints);
$instruction = get_string('recordtheninsert', 'atto_poodll');
break;
case 'snapshot':
$recorderhtml = \filter_poodll\poodlltools::fetchHTML5SnapshotCamera($updatecontrol,350,400,$usercontextid,'user','draft',$itemid,$callbackjs,$hints);
$instruction = get_string('snaptheninsert', 'atto_poodll');
break;
case 'whiteboard':
$recorderhtml = \filter_poodll\poodlltools::fetchWhiteboardForSubmission($updatecontrol, $usercontextid,'user','draft',$itemid,400,350,"",$usewhiteboard,$callbackjs);
$recorderhtml = "<div class='jswhiteboard'>" . $recorderhtml . "</div>";
$instruction = get_string('drawtheninsert', 'atto_poodll');
break;
case 'audiored5':
case 'audiomp3':
default:
$hints['size'] ='auto';
$recorderhtml = \filter_poodll\poodlltools::fetchMP3RecorderForSubmission($updatecontrol, $usercontextid ,'user','draft',$itemid,0,$callbackjs,$hints);
$instruction = get_string('recordtheninsert', 'atto_poodll');
switch ($recorder) {
case 'video':
$recorderhtml =
\filter_poodll\poodlltools::fetchVideoRecorderForSubmission('auto', 'none', $updatecontrol, $usercontextid, 'user',
'draft', $itemid, 0, $callbackjs, $hints);
$instruction = get_string('recordtheninsert', 'atto_poodll');
break;
case 'snapshot':
$recorderhtml =
\filter_poodll\poodlltools::fetchHTML5SnapshotCamera($updatecontrol, 350, 400, $usercontextid, 'user', 'draft',
$itemid, $callbackjs, $hints);
$instruction = get_string('snaptheninsert', 'atto_poodll');
break;
case 'whiteboard':
$recorderhtml =
\filter_poodll\poodlltools::fetchWhiteboardForSubmission($updatecontrol, $usercontextid, 'user', 'draft', $itemid,
400, 350, "", $usewhiteboard, $callbackjs);
$recorderhtml = "<div class='jswhiteboard'>" . $recorderhtml . "</div>";
$instruction = get_string('drawtheninsert', 'atto_poodll');
break;
case 'audiored5':
case 'audiomp3':
default:
$hints['size'] = 'auto';
$recorderhtml =
\filter_poodll\poodlltools::fetchMP3RecorderForSubmission($updatecontrol, $usercontextid, 'user', 'draft', $itemid,
0, $callbackjs, $hints);
$instruction = get_string('recordtheninsert', 'atto_poodll');
}

$PAGE->set_pagelayout('embedded');
$PAGE->set_title(get_string('dialogtitle', 'atto_poodll'));
$PAGE->requires->css(new moodle_url($CFG->wwwroot . '/lib/editor/atto/plugins/poodll/dialog/poodll.css'));
$PAGE->requires->js(new moodle_url($CFG->wwwroot. '/filter/poodll/module.js'),true);
$PAGE->requires->js(new moodle_url($CFG->wwwroot . '/filter/poodll/module.js'), true);
$PAGE->requires->jquery();

//load our resize script
Expand All @@ -100,13 +108,13 @@

echo $OUTPUT->header();
?>
<div id="atto_poodll_container">
<div style="text-align: center;">
<p id="messageAlert"><?php echo $instruction; ?></p>
<?php
echo $recorderhtml;
?>
</div>
</div>
<div id="atto_poodll_container">
<div style="text-align: center;">
<p id="messageAlert"><?php echo $instruction; ?></p>
<?php
echo $recorderhtml;
?>
</div>
</div>
<?php
echo $OUTPUT->footer();
1 change: 0 additions & 1 deletion lang/en/atto_poodll.php
Expand Up @@ -30,7 +30,6 @@
$string['settings'] = 'PoodLL Anywhere(Atto)';
$string['unpoodll'] = 'Unpoodll';


$string['browse'] = 'Browse';
$string['visible'] = 'Visible';
$string['audiomp3_desc'] = 'Record Audio';
Expand Down

0 comments on commit ea862ad

Please sign in to comment.