|
@@ -2,25 +2,26 @@
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Form to manager ilm installed into iAssign.
|
|
* Form to manager ilm installed into iAssign.
|
|
|
|
|
+ * This uses 'locallib.php:view_files_ilm($iassign_ilm_class, $extension)' to construct HTML/JavaScript to manage iLM content files.
|
|
|
*
|
|
*
|
|
|
* Release Notes:
|
|
* Release Notes:
|
|
|
* - v 1.7 2013/10/24
|
|
* - v 1.7 2013/10/24
|
|
|
- * + View extension when iassign view is active.
|
|
|
|
|
|
|
+ * + View extension when iassign view is active.
|
|
|
* - v 1.6 2013/08/22
|
|
* - v 1.6 2013/08/22
|
|
|
- * + Merge for import zip files and iassign files.
|
|
|
|
|
|
|
+ * + Merge for import zip files and iassign files.
|
|
|
* - v 1.5 2013/08/21
|
|
* - v 1.5 2013/08/21
|
|
|
- * + Insert functions for import files.
|
|
|
|
|
|
|
+ * + Insert functions for import files.
|
|
|
* - v 1.4 2013/07/23
|
|
* - v 1.4 2013/07/23
|
|
|
- * + Fix filter iLM from select of iLMs only iassign mode and not block mode..
|
|
|
|
|
- * + Fix change form message with function 'disable_form_change_checker()'.
|
|
|
|
|
|
|
+ * + Fix filter iLM from select of iLMs only iassign mode and not block mode..
|
|
|
|
|
+ * + Fix change form message with function 'disable_form_change_checker()'.
|
|
|
* - v 1.3 2013/07/12
|
|
* - v 1.3 2013/07/12
|
|
|
- * + Fix filter iLM from select of iLMs.
|
|
|
|
|
- * + Fix error messages of 'setType' in debug mode for hidden fields.
|
|
|
|
|
|
|
+ * + Fix filter iLM from select of iLMs.
|
|
|
|
|
+ * + Fix error messages of 'setType' in debug mode for hidden fields.
|
|
|
* - v 1.1 2013/06/26
|
|
* - v 1.1 2013/06/26
|
|
|
- * + Remove the button of choose iLM (ID of iLM send of parent page).
|
|
|
|
|
|
|
+ * + Remove the button of choose iLM (ID of iLM send of parent page).
|
|
|
*
|
|
*
|
|
|
* @author Patricia Alves Rodrigues
|
|
* @author Patricia Alves Rodrigues
|
|
|
- * @author Leônidas O. Brandão
|
|
|
|
|
|
|
+ * @author Leo^nidas de Oliveira Branda~o
|
|
|
* @version v 1.7 2013/10/24
|
|
* @version v 1.7 2013/10/24
|
|
|
* @package mod_iassign_ilm
|
|
* @package mod_iassign_ilm
|
|
|
* @since 2010/09/27
|
|
* @since 2010/09/27
|
|
@@ -51,16 +52,36 @@ class ilm_manager_form extends moodleform {
|
|
|
$mform = & $this->_form;
|
|
$mform = & $this->_form;
|
|
|
//TODO Javascript code: verify alternatives...
|
|
//TODO Javascript code: verify alternatives...
|
|
|
$code_javascript_open_online_ilm = "
|
|
$code_javascript_open_online_ilm = "
|
|
|
- <script type='text/javascript'>
|
|
|
|
|
- //<![CDATA[
|
|
|
|
|
- function open_online_ilm(ilmid) {
|
|
|
|
|
- if (ilmid == null || ilmid == '')
|
|
|
|
|
- ilmid = document.getElementById('id_iassign_ilmid').value;
|
|
|
|
|
- dirid = document.forms[0].dirid.value;
|
|
|
|
|
- window.location='$CFG->wwwroot/mod/iassign/ilm_manager.php?from=" . $from . "&id=" . $id . "&action=new&ilmid='+ilmid+'&dirid='+dirid;
|
|
|
|
|
- }
|
|
|
|
|
- //]]>
|
|
|
|
|
- </script>\n";
|
|
|
|
|
|
|
+<script type='text/javascript'>
|
|
|
|
|
+//<![CDATA[
|
|
|
|
|
+function clear_action (action) { // Auxiliary to identify correct iAssign form 'http://.../moodle/mod/iassign/ilm_manager.php'
|
|
|
|
|
+ if (action) {
|
|
|
|
|
+ var items = action.split('/');
|
|
|
|
|
+ var sizeI = items.length;
|
|
|
|
|
+ return items[sizeI-1];
|
|
|
|
|
+ }
|
|
|
|
|
+ return '';
|
|
|
|
|
+ }
|
|
|
|
|
+function open_online_ilm (ilmid) {
|
|
|
|
|
+ var dirid, ilmid;
|
|
|
|
|
+ if (ilmid == null || ilmid == '')
|
|
|
|
|
+ ilmid = document.getElementById('id_iassign_ilmid').value;
|
|
|
|
|
+ var document_forms = document.getElementsByTagName('form'); // instead of document.forms
|
|
|
|
|
+ //TOODO: Nowadays, there are lots of 'form' in view of Moodle! Use: id='mform1_k2DTt9FBTfCoWkC'
|
|
|
|
|
+ console.log('ilm_manager_form.php: open_online_ilm(.): #document_forms = ' + document_forms.length);
|
|
|
|
|
+ for (var i=0; i<document_forms.length; i++) {
|
|
|
|
|
+ var strAction = clear_action(document_forms[i].action);
|
|
|
|
|
+ if (strAction == 'ilm_manager.php') {
|
|
|
|
|
+ dirid = document_forms[i].dirid.value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('ilm_manager_form.php: open_online_ilm(.): dirid=' + dirid);
|
|
|
|
|
+ // change window content with iLM online editor
|
|
|
|
|
+ window.location='" . $CFG->wwwroot . "/mod/iassign/ilm_manager.php?from=" . $from . "&id=" . $id . "&action=new&ilmid='+ilmid+'&dirid='+dirid;
|
|
|
|
|
+ }
|
|
|
|
|
+//]]>
|
|
|
|
|
+</script>\n";
|
|
|
|
|
|
|
|
/// Adding new iLM
|
|
/// Adding new iLM
|
|
|
$mform->addElement('header', 'new_ilm', get_string('new_ilm', 'iassign'));
|
|
$mform->addElement('header', 'new_ilm', get_string('new_ilm', 'iassign'));
|
|
@@ -109,4 +130,4 @@ class ilm_manager_form extends moodleform {
|
|
|
$mform->disable_form_change_checker();
|
|
$mform->disable_form_change_checker();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- } // class ilm_manager_form extends moodleform
|
|
|
|
|
|
|
+ } // class ilm_manager_form extends moodleform
|