settings.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <?php
  2. /**
  3. * This php script contains all the stuff to interactive Learning Module (iLM).
  4. *
  5. * Release Notes:
  6. * - v 1.9 2013/12/12
  7. * + Allow use the language in iLM description.
  8. * - v 1.8 2013/10/31
  9. * + Insert support of export iLM in zip packages.
  10. * - v 1.7 2013/10/24
  11. * + Insert support of iLM upgrade.
  12. * - v 1.6 2013/09/11
  13. * + Insert support of iLM params.
  14. * - v 1.5 2013/08/01
  15. * + Fix bug for block change visibility in iLM wiht statement.
  16. * - v 1.4 2013/07/12
  17. * + Insert action config for accept versions of iLM.
  18. * + Insert new informations in iLMs table: created date, modified date, author, version, modified date of JAR.
  19. * + Now view separate only iLMs for filter versions.
  20. *
  21. * @author Patricia Alves Rodrigues
  22. * @author Leônidas O. Brandão
  23. * @contributor Luciano Oliveira Borges
  24. * @version v 1.9 2013/12/12
  25. * @package mod_iassign_settings
  26. * @since 2010/09/27
  27. * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
  28. *
  29. * <b>License</b>
  30. * - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  31. */
  32. /**
  33. * Moodle core defines constant MOODLE_INTERNAL which shall be used to make sure that the script is included and not called directly.
  34. */
  35. defined('MOODLE_INTERNAL') || die();
  36. global $OUTPUT, $CFG, $DB;
  37. require_once ($CFG->dirroot . '/mod/iassign/lib.php');
  38. require_once ($CFG->dirroot . '/mod/iassign/locallib.php');
  39. $action = optional_param('action', 'view', PARAM_TEXT);
  40. $ilm_id = optional_param('ilm_id', 0, PARAM_INT);
  41. $ilm_param_id = optional_param('ilm_param_id', 0, PARAM_INT);
  42. $ilm_id_parent = optional_param('ilm_id_parent', 0, PARAM_INT);
  43. $status = optional_param('status', 0, PARAM_INT);
  44. if ($action == 'visible') {
  45. ilm_settings::visible_ilm($ilm_id, $status);
  46. $action = 'config';
  47. $ilm_id = $ilm_id_parent;
  48. }
  49. if ($action == 'visible_param') {
  50. ilm_settings::visible_param($ilm_param_id, $status);
  51. $action = 'config';
  52. }
  53. if ($action == 'export') {
  54. ilm_settings::export_ilm($ilm_id);
  55. $action = 'config';
  56. }
  57. $str = '';
  58. if (!file_exists($CFG->dirroot . '/filter/iassign_filter/version.php')) {
  59. $str .= $OUTPUT->box_start();
  60. $str .= '<center>' . $OUTPUT->error_text(get_string('error_check_iassign_filter', 'iassign')) . '</center>';
  61. $str .= $OUTPUT->box_end();
  62. }
  63. if (!file_exists($CFG->dirroot . '/blocks/iassign_block/version.php')) {
  64. $str .= $OUTPUT->box_start();
  65. $str .= '<center>' . $OUTPUT->error_text(get_string('error_check_iassign_block', 'iassign')) . '</center>';
  66. $str .= $OUTPUT->box_end();
  67. }
  68. if (!file_exists($CFG->dirroot . '/lib/editor/tinymce/plugins/iassign/version.php')) {
  69. $str .= $OUTPUT->box_start();
  70. $str .= '<center>' . $OUTPUT->error_text(get_string('error_check_iassign_tinymce', 'iassign')) . '</center>';
  71. $str .= $OUTPUT->box_end();
  72. }
  73. if ($action == 'view') {
  74. $url_add = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'add'));
  75. $action_add = new popup_action('click', $url_add, 'popup', array('width' => 900, 'height' => 650));
  76. $link_add = $OUTPUT->action_link($url_add, get_string('add_ilm_iassign', 'iassign'), $action_add) . $OUTPUT->help_icon('add_ilm_iassign', 'iassign');
  77. $url_import = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'import'));
  78. $action_import = new popup_action('click', $url_import, 'popup', array('width' => 900, 'height' => 650));
  79. $link_import = $OUTPUT->action_link($url_import, get_string('import_ilm', 'iassign'), $action_import) . $OUTPUT->help_icon('import_ilm', 'iassign');
  80. $iassign_ilms = $DB->get_records('iassign_ilm', array('parent' => 0));
  81. $str .= '<table id="outlinetable" class="generaltable boxaligncenter" cellpadding="5" width="100%">' . chr(13);
  82. $str .= '<tr><td colspan=2 align=left>' . $link_add . '</td>';
  83. $str .= '<td colspan=2 align=right>' . $link_import . '</td></tr>';
  84. if ($iassign_ilms) {
  85. foreach ($iassign_ilms as $ilm) {
  86. $url_config = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'config', 'ilm_id' => $ilm->id));
  87. $link_config = $OUTPUT->action_link($url_config, iassign_icons::insert('config_ilm'));
  88. $ilm_count = 1;
  89. $ilm_version = 0;
  90. $iassign_ilm = $DB->get_records('iassign_ilm', array('parent' => $ilm->id));
  91. if ($iassign_ilm) {
  92. foreach ($iassign_ilm as $ilm_parent) {
  93. $ilm_count++;
  94. if (floatval(preg_replace('/[^0-9]+/', '', $ilm_parent->version)) > $ilm_version)
  95. $ilm_version = floatval(preg_replace('/[^0-9]+/', '', $ilm_parent->version));
  96. }
  97. }
  98. $iassign_count = 0;
  99. $iassign_statement = $DB->get_records('iassign_statement', array('iassign_ilmid' => $ilm->id));
  100. if ($iassign_statement)
  101. $iassign_count = count($iassign_statement);
  102. $iassign_ilm_parent = $DB->get_records('iassign_ilm', array('parent' => $ilm->id));
  103. foreach ($iassign_ilm_parent as $ilm_parent) {
  104. $iassign_statement = $DB->get_records('iassign_statement', array('iassign_ilmid' => $ilm_parent->id));
  105. if ($iassign_statement)
  106. $iassign_count += count($iassign_statement);
  107. }
  108. $link_upgrade = "";
  109. $upgrade_file = $ilm->url . 'ilm-upgrade_' . strtolower($ilm->name) . '.xml';
  110. if ($upgrade_xml = @simplexml_load_file($upgrade_file, null, LIBXML_NOCDATA)) {
  111. $upgrade_version = floatval(preg_replace('/[^0-9]+/', '', $upgrade_xml->version));
  112. if ($ilm_version < $upgrade_version) {
  113. $url_upgrade = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'confirm_upgrade', 'ilm_id' => $ilm->id));
  114. $link_upgrade = $OUTPUT->action_link($url_upgrade, iassign_icons::insert('upgrade_ilm', $upgrade_xml->version));
  115. }
  116. }
  117. $str .= '<tr>';
  118. $str .= '<td class="header c1" width=75%><strong>' . $ilm->name . '<br>' . iassign_language::get_description_lang(current_language(), $ilm->description) . '</strong></td>' . chr(13);
  119. $str .= '<td class="header c1" width=10% ><strong>' . get_string('versions_ilm', 'iassign') . ':</strong>&nbsp;' . $ilm_count . '</td>' . chr(13);
  120. $str .= '<td class="header c1" width=10% ><strong>' . get_string('activities', 'iassign') . ':</strong>&nbsp;' . $iassign_count . '</td>' . chr(13);
  121. $str .= '<td class="header c1" width=5% align=center valign=bottom>' . $link_upgrade . '&nbsp;&nbsp;' . $link_config . '</td>' . chr(13);
  122. $str .= '</tr>';
  123. }
  124. }
  125. $str .= '</table>';
  126. $settings->add(new admin_setting_heading('iassign', get_string('config_ilm', 'iassign') . $OUTPUT->help_icon('modulename', 'iassign'), $str));
  127. } else if ($action == 'confirm_upgrade') {
  128. $ilm = $DB->get_record('iassign_ilm', array('id' => $ilm_id));
  129. $upgrade_file = $ilm->url . 'ilm-upgrade_' . strtolower($ilm->name) . '.xml';
  130. $upgrade_xml = @simplexml_load_file($upgrade_file, null, LIBXML_NOCDATA);
  131. $lang = current_language();
  132. if (array_key_exists($lang, $upgrade_xml->description))
  133. $description = $upgrade_xml->description->$lang;
  134. else
  135. $description = $upgrade_xml->description->en;
  136. $str .= '<table id="outlinetable" class="generaltable boxaligncenter" width="100%">' . chr(13);
  137. $str .= '<tr><td>' . $description;
  138. $str .= '</td></tr></table>';
  139. $optionsno = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'view'));
  140. $optionsyes = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'upgrade', 'ilm_id' => $ilm_id));
  141. $str .= "<center>" . $OUTPUT->heading(get_string('confirm_upgrade_ilm', 'iassign'), 3, 'helptitle', 'uniqueid');
  142. $url_yes = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'upgrade', 'ilm_id' => $ilm_id));
  143. $link_yes = $OUTPUT->action_link($url_yes, "<font color='green'><b>" . get_string('yes', 'iassign') . "</b></font>");
  144. $url_no = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'view'));
  145. $link_no = $OUTPUT->action_link($url_no, "<b>" . get_string('no', 'iassign') . "</b>");
  146. $str .= $link_no . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $link_yes . "</center>";
  147. $settings->add(new admin_setting_heading('iassign', get_string('upgrade_ilm_title', 'iassign'), $str));
  148. } else if ($action == 'config') {
  149. $url_return = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign'));
  150. $link_return = $OUTPUT->action_link($url_return, get_string('return', 'iassign'));
  151. $url_new_version = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'new_version', 'ilm_id' => $ilm_id));
  152. $action_new_version = new popup_action('click', $url_new_version, 'popup', array('width' => 900, 'height' => 650));
  153. $link_new_version = $OUTPUT->action_link($url_new_version, get_string('new_version_ilm', 'iassign'), $action_new_version);
  154. $str .= '<table id="outlinetable" class="generaltable boxaligncenter" cellpadding="5" width="100%">' . chr(13);
  155. $str .= '<tr><td colspan=2 align=left>' . $link_return . '</td><td colspan=1 align=right>' . $link_new_version . '</td></tr>';
  156. $ilm = $DB->get_record('iassign_ilm', array('id' => $ilm_id));
  157. $iassign_ilm_parent = $DB->get_records_sql('SELECT s.* FROM {iassign_ilm} s
  158. WHERE s.parent = :parent
  159. ORDER BY s.version DESC', array('parent' => $ilm->id));
  160. array_unshift($iassign_ilm_parent, $ilm);
  161. if ($iassign_ilm_parent) {
  162. foreach ($iassign_ilm_parent as $ilm_parent) {
  163. $url_default = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'confirm_default_ilm', 'ilm_id' => $ilm_parent->id, 'ilm_parent' => $ilm->id));
  164. if (count($iassign_ilm_parent) == 1)
  165. $link_default = "";
  166. else if ($ilm_parent->parent == 0) {
  167. $link_default = iassign_icons::insert('default_ilm');
  168. $ilm_parent->enable = -1;
  169. } else
  170. $link_default = $OUTPUT->action_link($url_default, iassign_icons::insert('default_ilm_disabled'));
  171. //if ($ilm_parent->file_jar != $ilm_parent->id) {
  172. $url_view = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'view', 'ilm_id' => $ilm_parent->id, 'from' => 'admin'));
  173. $action_view = new popup_action('click', $url_view, 'iplookup', array('title' => get_string('view_ilm', 'iassign'), 'width' => 1200, 'height' => 650));
  174. $link_view = $OUTPUT->action_link($url_view, iassign_icons::insert('view_ilm'), $action_view);
  175. //} else {
  176. //$link_view = '';
  177. //}
  178. $url_edit = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'edit', 'ilm_id' => $ilm_parent->id));
  179. $action_edit = new popup_action('click', $url_edit, 'iplookup', array('title' => get_string('edit_ilm', 'iassign'), 'width' => 900, 'height' => 650));
  180. $link_edit = $OUTPUT->action_link($url_edit, iassign_icons::insert('edit_ilm'), $action_edit);
  181. $url_visible = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'visible', 'ilm_id' => $ilm_parent->id, 'status' => $ilm_parent->enable, 'ilm_id_parent' => $ilm->id));
  182. $iassign_statement = $DB->get_records('iassign_statement', array('iassign_ilmid' => $ilm_parent->id));
  183. $total = 0;
  184. if ($iassign_statement)
  185. $total = count($iassign_statement);
  186. if ($ilm_parent->enable == 0 && $total == 0) {
  187. $link_visible = $OUTPUT->action_link($url_visible, iassign_icons::insert('show_ilm'));
  188. } elseif ($ilm_parent->enable == 1 && $total == 0) {
  189. $link_visible = $OUTPUT->action_link($url_visible, iassign_icons::insert('hide_ilm'));
  190. } else {
  191. $link_visible = '&nbsp;' . iassign_icons::insert('unlock');
  192. }
  193. $url_copy = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'copy', 'ilm_id' => $ilm_parent->id));
  194. $action_copy = new popup_action('click', $url_copy, 'iplookup', array('title' => get_string('copy_ilm', 'iassign'), 'width' => 900, 'height' => 650));
  195. $link_copy = $OUTPUT->action_link($url_copy, iassign_icons::insert('copy_ilm'), $action_copy);
  196. if ($total == 0 && ($ilm_parent->parent != 0 || count($iassign_ilm_parent) == 1) && !ilm_settings::applet_default($ilm_parent->file_jar)) {
  197. $url_delete = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'confirm_delete_ilm', 'ilm_id' => $ilm_parent->id, 'ilm_parent' => $ilm->id));
  198. $link_delete = $OUTPUT->action_link($url_delete, iassign_icons::insert('delete_ilm'));
  199. } else if (ilm_settings::applet_default($ilm_parent->file_jar)) {
  200. $link_delete = "";
  201. } else
  202. $link_delete = iassign_icons::insert('delete_ilm_disable');
  203. if (strtolower($ilm_parent->type) == 'html5') {
  204. $url_delete = new moodle_url('/mod/iassign/settings_ilm.php', array('action' => 'confirm_delete_ilm', 'ilm_id' => $ilm_parent->id, 'ilm_parent' => $ilm->id));
  205. $link_delete = $OUTPUT->action_link($url_delete, iassign_icons::insert('delete_ilm'));
  206. }
  207. $url_export = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'export', 'ilm_id' => $ilm_parent->id, 'ilm_id_parent' => $ilm->id));
  208. $link_export = $OUTPUT->action_link($url_export, iassign_icons::insert('export_ilm'));
  209. $str .= '<tr><td colspan=3>';
  210. $str .= '<table width="100%">';
  211. if (!empty($ilm_parent->url))
  212. $url_ilm = display_url_ilm($ilm_parent->url);
  213. else
  214. $url_ilm = $ilm_parent->url;
  215. if ($ilm_parent->file_jar == $ilm_parent->id) {
  216. $ilm_parent->file_jar = "";
  217. }
  218. $str .= '<tr>' . chr(13);
  219. $str .= '<td width="50%"><strong>' . get_string('version_ilm', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->version . '</td>' . chr(13);
  220. $str .= '<td width="50%" align="right" valign=bottom>';
  221. $str .= $link_default . '&nbsp;&nbsp;';
  222. $str .= $link_edit . '&nbsp;&nbsp;';
  223. $str .= $link_copy . '&nbsp;&nbsp;';
  224. $str .= $link_visible . '&nbsp;&nbsp;';
  225. $str .= $link_view . '&nbsp;&nbsp;';
  226. $str .= $link_export . '&nbsp;&nbsp;';
  227. $str .= $link_delete;
  228. $str .= '</td>' . chr(13) . '</tr>' . chr(13);
  229. $str .= '<tr>' . chr(13);
  230. $str .= '<td width="50%"><strong>' . get_string('description', 'iassign') . ':</strong>&nbsp;' . iassign_language::get_description_lang(current_language(), $ilm_parent->description) . '</td>';
  231. $str .= '<td width="50%"><strong>' . get_string('activities', 'iassign') . ':</strong>&nbsp;' . $total . '</td>' . chr(13);
  232. $str .= '</tr>' . chr(13);
  233. $langs_str = iassign_language::get_all_lang($ilm_parent->description);
  234. $str .= '<tr>';
  235. if ($langs_str != "")
  236. $str .= '<td><strong>' . get_string('language_label', 'iassign') . ':</strong>&nbsp;' . $langs_str . '</td>';
  237. $str .= '<td><strong>' . get_string('type_ilm', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->type . '</td>';
  238. $str .= '</tr>';
  239. if (strtolower($ilm_parent->type) == 'java') {
  240. $ilm_parent->file_jar = ilm_settings::applet_filetime($ilm_parent->file_jar);
  241. }
  242. $str .= '<tr><td colspan=3><strong>' . get_string('url_ilm', 'iassign') . ':</strong>&nbsp;<a href="' . $url_ilm . '" target="_blank">' . $url_ilm . '</a></td></tr>';
  243. $str .= '<tr><td width="50%"><strong>' . get_string('file_jar', 'iassign') . '</strong>&nbsp;' . $ilm_parent->file_jar . '</td>';
  244. $str .= '<td width="50%"><strong>' . get_string('file_class', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->file_class . '</td></tr>';
  245. $str .= '<tr><td width="50%"><strong>' . get_string('extension', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->extension . '</td>';
  246. $str .= '<td width="50%"><strong>' . get_string('width', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->width;
  247. $str .= '&nbsp;&nbsp;<strong>' . get_string('height', 'iassign') . ':</strong>&nbsp;' . $ilm_parent->height . '</td></tr>';
  248. if ($ilm_parent->evaluate == 1)
  249. $evaluate = get_string('yes', 'iassign');
  250. else
  251. $evaluate = get_string('no', 'iassign');
  252. $str .= '<tr><td width="50%"><strong>' . get_string('evaluate', 'iassign') . ':</strong>&nbsp;' . $evaluate . '</td>';
  253. if ($ilm_parent->enable == 1 || $ilm_parent->enable == -1)
  254. $enable = get_string('yes', 'iassign');
  255. else
  256. $enable = get_string('no', 'iassign');
  257. $str .= '<td width="50%"><strong>' . get_string('enable', 'iassign') . ':</strong>&nbsp;' . $enable . '</td></tr>';
  258. $str .= '<tr>' . chr(13);
  259. $str .= '<td width="50%"><strong>' . get_string('file_created', 'iassign') . ':</strong>&nbsp;' . userdate($ilm_parent->timecreated) . '</td>';
  260. $str .= '<td width="50%"><strong>' . get_string('file_modified', 'iassign') . ':</strong>&nbsp;' . userdate($ilm_parent->timemodified) . '</td>' . chr(13);
  261. $str .= '</tr>' . chr(13);
  262. $user_ilm = $DB->get_record('user', array('id' => $ilm_parent->author));
  263. if ($user_ilm) {
  264. $str .= '<tr>' . chr(13);
  265. $str .= '<td colspan=2><strong>' . get_string('author', 'iassign') . ':</strong>&nbsp;' . $user_ilm->firstname . '&nbsp;' . $user_ilm->lastname . '</td>';
  266. $str .= '</tr>' . chr(13);
  267. }
  268. $str .= '<tr>' . chr(13);
  269. $str .= '<td colspan=2><center>';
  270. $url_add_param = new moodle_url('/mod/iassign/settings_params.php', array('action' => 'add', 'ilm_id' => $ilm_id));
  271. $action_add_param = new popup_action('click', $url_add_param, 'popup', array('width' => 900, 'height' => 650));
  272. $link_add_param = $OUTPUT->action_link($url_add_param, iassign_icons::insert('add_param'), $action_add_param);
  273. $str .= '<table width="100%">' . chr(13);
  274. $str .= '<tr>' . chr(13);
  275. $str .= '<th colspan=3><center><strong>' . get_string('config_param', 'iassign') . $OUTPUT->help_icon('config_param', 'iassign') . '</strong></center></th>';
  276. $str .= '<th>' . $link_add_param . '</th>';
  277. $str .= '</tr>' . chr(13);
  278. $str .= '<tr>' . chr(13);
  279. $str .= '<td><strong>' . get_string('config_param_name', 'iassign') . '</strong></td>';
  280. $str .= '<td><strong>' . get_string('config_param_value', 'iassign') . '</strong></td>';
  281. $str .= '<td><strong>' . get_string('config_param_description', 'iassign') . '</strong></td>';
  282. $str .= '<td width="10%"><center><strong>' . get_string('config_param_actions', 'iassign') . '</strong></center></td>';
  283. $str .= '</tr>' . chr(13);
  284. $iassign_ilm_config = $DB->get_records('iassign_ilm_config', array('iassign_ilmid' => $ilm_parent->id));
  285. foreach ($iassign_ilm_config as $ilm_config) {
  286. $url_edit_param = new moodle_url('/mod/iassign/settings_params.php', array('action' => 'edit', 'ilm_param_id' => $ilm_config->id));
  287. $action_edit_param = new popup_action('click', $url_edit_param, 'iplookup', array('title' => get_string('edit_param', 'iassign'), 'width' => 900, 'height' => 650));
  288. $link_edit_param = $OUTPUT->action_link($url_edit_param, iassign_icons::insert('edit_param'), $action_edit_param);
  289. $url_visible_param = new moodle_url('/admin/settings.php', array('section' => 'modsettingiassign', 'action' => 'visible_param', 'ilm_id' => $ilm_parent->id, 'status' => $ilm_config->visible, 'ilm_param_id' => $ilm_config->id));
  290. if ($ilm_config->visible == 0) {
  291. $link_visible_param = $OUTPUT->action_link($url_visible_param, iassign_icons::insert('show_param'));
  292. } elseif ($ilm_config->visible == 1) {
  293. $link_visible_param = $OUTPUT->action_link($url_visible_param, iassign_icons::insert('hide_param'));
  294. }
  295. $url_copy_param = new moodle_url('/mod/iassign/settings_params.php', array('action' => 'copy', 'ilm_param_id' => $ilm_config->id));
  296. $action_copy_param = new popup_action('click', $url_copy_param, 'iplookup', array('title' => get_string('copy_param', 'iassign'), 'width' => 900, 'height' => 650));
  297. $link_copy_param = $OUTPUT->action_link($url_copy_param, iassign_icons::insert('copy_param'), $action_copy_param);
  298. $url_delete_param = new moodle_url('/mod/iassign/settings_params.php', array('action' => 'delete', 'ilm_param_id' => $ilm_config->id, 'ilm_id' => $ilm_parent->id));
  299. $link_delete_param = $OUTPUT->action_link($url_delete_param, iassign_icons::insert('delete_param'));
  300. $str .= '<tr>' . chr(13);
  301. $str .= '<td>' . $ilm_config->param_name . '</td>';
  302. $str .= '<td>' . $ilm_config->param_value . '</td>';
  303. $str .= '<td width="50%">' . $ilm_config->description . '</td>';
  304. $str .= '<td width="10%"><center>';
  305. $str .= $link_edit_param . '&nbsp;&nbsp;';
  306. $str .= $link_copy_param . '&nbsp;&nbsp;';
  307. $str .= $link_visible_param . '&nbsp;&nbsp;';
  308. $str .= $link_delete_param;
  309. $str .= '</center></td>';
  310. $str .= '</tr>' . chr(13);
  311. }
  312. $str .= '</table>' . chr(13);
  313. $str .= '</center></td>';
  314. $str .= '</tr>' . chr(13);
  315. $str .= '</table>';
  316. $str .= '</td></tr>';
  317. $str .= '</tr><td colspan="3"></td></tr>';
  318. }
  319. }
  320. $str .= '</table>';
  321. $settings->add(new admin_setting_heading('iassign', $ilm->name . '&nbsp;', $str));
  322. }