Plugin: H5P: Cleanup and rewrite - refs #2667

pull/3388/head
Yannick Warnier 6 years ago
parent 910ad1e996
commit 2eaf91ecd7
  1. 10
      plugin/h5p/README.md
  2. 14
      plugin/h5p/h5p_plugin.class.php
  3. BIN
      plugin/h5p/img/bloctext.png
  4. BIN
      plugin/h5p/img/chamilo-h5p.jpg
  5. BIN
      plugin/h5p/img/dialogcard.jpg
  6. BIN
      plugin/h5p/img/eyes.png
  7. BIN
      plugin/h5p/img/h5p.png
  8. BIN
      plugin/h5p/img/memory - Copie.png
  9. BIN
      plugin/h5p/img/shop.png
  10. BIN
      plugin/h5p/img/sumin.png
  11. 75
      plugin/h5p/inc/action.switch.php
  12. 98
      plugin/h5p/inc/edit.form.php
  13. 104
      plugin/h5p/inc/form-h5p.php
  14. 73
      plugin/h5p/inc/switchaction-h5p.php
  15. 32
      plugin/h5p/inc/trad-h5p.php
  16. 34
      plugin/h5p/inc/translate.php
  17. 38
      plugin/h5p/index.php
  18. 140
      plugin/h5p/list.php
  19. 143
      plugin/h5p/node_list.php
  20. 495
      plugin/h5p/node_process.php
  21. 55
      plugin/h5p/page-descri.php
  22. 61
      plugin/h5p/resources/ajax/getnodes.php
  23. 0
      plugin/h5p/resources/img/dialogcard.png
  24. BIN
      plugin/h5p/resources/img/docx.png
  25. BIN
      plugin/h5p/resources/img/download.png
  26. 0
      plugin/h5p/resources/img/dragthewords.png
  27. 0
      plugin/h5p/resources/img/edit.png
  28. BIN
      plugin/h5p/resources/img/file-docx.png
  29. BIN
      plugin/h5p/resources/img/file-none.png
  30. BIN
      plugin/h5p/resources/img/file-pdf.png
  31. BIN
      plugin/h5p/resources/img/forum_listview.png
  32. BIN
      plugin/h5p/resources/img/g91884.png
  33. 0
      plugin/h5p/resources/img/guesstheanswer.png
  34. BIN
      plugin/h5p/resources/img/h5p-chamilo - Copie.png
  35. BIN
      plugin/h5p/resources/img/lock.png
  36. 0
      plugin/h5p/resources/img/markthewords.png
  37. 0
      plugin/h5p/resources/img/memory.png
  38. BIN
      plugin/h5p/resources/img/pdf.png
  39. BIN
      plugin/h5p/resources/img/reading-comprehension_na.png
  40. BIN
      plugin/h5p/resources/img/statistics.png
  41. BIN
      plugin/h5p/resources/img/stats.png
  42. BIN
      plugin/h5p/resources/img/survey_reporting_overall.png
  43. 0
      plugin/h5p/resources/img/wordsmatch.png
  44. 72
      plugin/h5p/resources/js/demo.js
  45. 45
      plugin/h5p/resources/js/h5p_extras.js
  46. 1044
      plugin/h5p/resources/js/interface.js
  47. 4
      plugin/h5p/resources/js/jquery1.8.2.min.js
  48. 6
      plugin/h5p/template.tpl
  49. 42
      plugin/h5p/update-v.php
  50. 34
      plugin/h5p/update.php
  51. 8
      plugin/h5p/view/list.tpl
  52. 0
      plugin/h5p/view/update.tpl
  53. 0
      plugin/h5p/view/view.tpl

@ -1,11 +1,7 @@
H5P
===
This plugin is compatible for chamilo-1-11-10 and > only
For tools on document editor plaese select region pre_footer
H5P plugin
===
This plugin is only compatible with Chamilo version 1.11.10 and above
To enable tools in the document editor, please enable it in region pre_footer.
Other docs :
https://www.ludiscape.com/ressources/resources-elearning-en/integration-of-h5p-into-our-lms-chamilo/

@ -3,6 +3,8 @@
class H5PPlugin extends Plugin
{
public $table = 'plugin_mindmap';
protected function __construct()
{
parent::__construct(
@ -22,6 +24,9 @@ class H5PPlugin extends Plugin
return $result ? $result : $result = new self();
}
/**
* Install the structure necessary for the plugin
*/
public function install()
{
$sql = "CREATE TABLE IF NOT EXISTS plugin_h5p(
@ -31,7 +36,7 @@ class H5PPlugin extends Plugin
url_id INT,
title VARCHAR(255) NOT NULL,
descript VARCHAR(255) NOT NULL,
date_create VARCHAR(12) NOT NULL,
creation_date VARCHAR(12) NOT NULL,
terms_a VARCHAR(512) NOT NULL,
terms_b VARCHAR(512) NOT NULL,
terms_c VARCHAR(512) NOT NULL,
@ -46,9 +51,12 @@ class H5PPlugin extends Plugin
}
/**
* Uninstall the plugin structure
*/
public function uninstall()
{
//$sql = "DROP TABLE IF EXISTS plugin_h5p";
//Database::query($sql);
$sql = "DROP TABLE IF EXISTS plugin_h5p";
Database::query($sql);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 672 B

@ -0,0 +1,75 @@
<?php
/* For license terms, see /license.txt */
$varString = api_get_self();
$varUrlList = str_replace("node_process.php", "list.php", $varString);
$varUrlProcess = str_replace("list.php", "node_process.php", $varString);
switch ($action) {
case 'add':
if ($form->validate()) {
$values = $form->getSubmitValues();
$date = new DateTime();
$year = $date->format("Y");
$month = $date->format('m');
$day = $date->format('j');
$dateStr = $day.'/'.$month.'/'.$year;
$params = [
'title' => $values['title'],
'creation_date' => $dateStr,
'user_id' => $userId,
'node_type' => $values['node_type'],
'terms_a' => $values['terms_a'],
'terms_b' => $values['terms_b'],
'terms_c' => $values['terms_c'],
'terms_d' => $values['terms_d'],
'terms_e' => $values['terms_e'],
'terms_f' => $values['terms_f'],
'descript' => $values['descript'],
'url_id' => $urlId
];
$result = Database::insert($table, $params);
$objectId = 0;
if (!$result) {
} else {
Display::addFlash(Display::return_message(get_lang('Added')));
$objectId = Database::insert_id();
}
$varUrlProcess = $varUrlProcess.'?id='.$objectId.'&action=add';
header('Location: '.$varUrlProcess);
exit;
}
break;
case 'edit':
$form->setDefaults($term);
if ($form->validate()) {
$values = $form->getSubmitValues();
$params = [
'title' => $values['title'],
'terms_a' => $values['terms_a'],
'terms_b' => $values['terms_b'],
'terms_c' => $values['terms_c'],
'terms_d' => $values['terms_d'],
'terms_e' => $values['terms_e'],
'terms_f' => $values['terms_f'],
'descript' => $values['descript']
];
Database::update($table, $params, ['id = ?' => $id]);
Display::addFlash(Display::return_message(get_lang('Updated')));
$varUrlProcess = $varUrlProcess.'?id='.$id.'&action=edit';
header('Location: '.$varUrlProcess);
exit;
}
break;
case 'delete':
if (!empty($term)) {
Database::delete($table, ['id = ?' => $id]);
Display::addFlash(Display::return_message(get_lang('Deleted')));
header('Location: '.$varUrlList);
exit;
}
break;
}

@ -0,0 +1,98 @@
<?php
/* For license terms, see /license.txt */
$form = new FormValidator('dictionary', 'post', api_get_self().'?action='.$action.'&id='.$id);
$tableOfnodes = '';
if ($nodeType == '') {
$tableOfnodes = "<table id='nodeselection' class='styleOfPages' ";
$tableOfnodes .= " style='max-width:840px;width:98%;";
$tableOfnodes .= "margin-left:auto;margin-right:auto;margin-bottom:2%;' >";
$tableOfnodes .= "<tr><td colspan=6 style='text-align:center;padding-bottom:10px;padding-top:10px;border:solid 1px gray;' colspan=3 >";
$tableOfnodes .= $plugin->get_lang('TypeContent')."</td></tr>";
$tableOfnodes .= "<tr style='width:98%;background-color:#D8D8D8;padding-top:10px;border-bottom:solid 2px white;' >";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='resources/img/wordsmatch.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;width:20%;' >Find the words</td>";
$tableOfnodes .= "<td style='text-align:center;width:20%;'>";
$tableOfnodes .= "<a href='list.php?node_type=wordsmatch' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='resources/img/dragthewords.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;width:20%;' >Drag the words</td>";
$tableOfnodes .= "<td style='text-align:center;width:20%;'>";
$tableOfnodes .= "<a href='list.php?node_type=dragthewords' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "</tr>";
$tableOfnodes .= "<tr style='width:98%;background-color:#D8D8D8;padding-top:10px;border-bottom:solid 2px white;' >";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='resources/img/dialogcard.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;' >Dialog card</td>";
$tableOfnodes .= "<td style='text-align:center;' >";
$tableOfnodes .= "<a href='list.php?node_type=dialogcard' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='resources/img/memory.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;' >%emory</td>";
$tableOfnodes .= "<td style='text-align:center;' >";
$tableOfnodes .= "<a href='list.php?node_type=memory' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "</tr>";
$tableOfnodes .= "<tr style='width:98%;background-color:#D8D8D8;";
$tableOfnodes .= "padding-top:10px;border-bottom:solid 2px white;' >";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='resources/img/markthewords.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;' >Mark the words</td>";
$tableOfnodes .= "<td style='text-align:center;' >";
$tableOfnodes .= "<a href='list.php?node_type=markthewords' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='resources/img/guesstheanswer.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;' >Guess the answer</td>";
$tableOfnodes .= "<td style='text-align:center;' >";
$tableOfnodes .= "<a href='list.php?node_type=guesstheanswer' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "</tr>";
$tableOfnodes .= "</table>";
}
// Use $tds defined in translate.php
$html = $translations.'<link href="resources/css/H5P.css" rel="stylesheet" type="text/css" />';
$form->addText('title', get_lang('Title'), false);
$form->addText('descript', get_lang('Description'), false);
$nodeTypeForm = $form->addText('node_type', 'node_type', false);
$nodeTypeForm->setValue($nodeType);
$form->addText('terms_a', 'terms_a', false);
$form->addText('terms_b', 'terms_b', false);
$form->addText('terms_c', 'terms_c', false);
$form->addText('terms_d', 'terms_d', false);
$form->addText('terms_e', 'terms_e', false);
$form->addText('terms_f', 'terms_f', false);
$form->addElement('static', '', '', $html);
$form->addButtonSave(get_lang('Save'));

@ -1,104 +0,0 @@
<?php
$form = new FormValidator('dictionary', 'post', api_get_self().'?action='.$action.'&id='.$id);
$tableOfnodes = '';
if($nodeType==''){
$tableOfnodes = "<table id='nodeselection' class='styleOfPages' ";
$tableOfnodes .= " style='max-width:840px;width:98%;";
$tableOfnodes .= "margin-left:auto;margin-right:auto;margin-bottom:2%;' >";
$tableOfnodes .= "<tr><td colspan=6 style='text-align:center;padding-bottom:10px;padding-top:10px;border:solid 1px gray;' colspan=3 >";
$tableOfnodes .= $plugin->get_lang('TypeContent')."</td></tr>";
$tableOfnodes .= "<tr style='width:98%;background-color:#D8D8D8;padding-top:10px;border-bottom:solid 2px white;' >";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='img/wordsmatch.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;width:20%;' >Finds The words</td>";
$tableOfnodes .= "<td style='text-align:center;width:20%;'>";
$tableOfnodes .= "<a href='node_list.php?node_type=wordsmatch' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='img/dragthewords.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;width:20%;' >Drag the words</td>";
$tableOfnodes .= "<td style='text-align:center;width:20%;'>";
$tableOfnodes .= "<a href='node_list.php?node_type=dragthewords' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "</tr>";
$tableOfnodes .= "<tr style='width:98%;background-color:#D8D8D8;padding-top:10px;border-bottom:solid 2px white;' >";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='img/dialogcard.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;' >dialogcard</td>";
$tableOfnodes .= "<td style='text-align:center;' >";
$tableOfnodes .= "<a href='node_list.php?node_type=dialogcard' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='img/memory.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;' >memory</td>";
$tableOfnodes .= "<td style='text-align:center;' >";
$tableOfnodes .= "<a href='node_list.php?node_type=memory' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "</tr>";
/* */
$tableOfnodes .= "<tr style='width:98%;background-color:#D8D8D8;";
$tableOfnodes .= "padding-top:10px;border-bottom:solid 2px white;' >";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='img/markthewords.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;' >markthewords</td>";
$tableOfnodes .= "<td style='text-align:center;' >";
$tableOfnodes .= "<a href='node_list.php?node_type=markthewords' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "<td style='text-align:center;padding:5px;' >";
$tableOfnodes .= "<img class=toolimage src='img/guesstheanswer.png' /></td>";
$tableOfnodes .= "<td style='text-align:center;' >guesstheanswer</td>";
$tableOfnodes .= "<td style='text-align:center;' >";
$tableOfnodes .= "<a href='node_list.php?node_type=guesstheanswer' class='btn btn-primary' >";
$tableOfnodes .= "<em class='fa'></em>&nbsp;".$plugin->get_lang('Use')."&nbsp;</a>";
$tableOfnodes .= "</td>";
$tableOfnodes .= "</tr>";
$tableOfnodes .= "</table>";
}
$h = $tds.'<link href="resources/css/H5P.css" rel="stylesheet" type="text/css" />';
$form->addText('title',get_lang('Title'),false);
$form->addText('descript',get_lang('Description'),false);
$nodeTypeForm = $form->addText('node_type','node_type',false);
$nodeTypeForm->setValue($nodeType);
$form->addText('terms_a','terms_a',false);
$form->addText('terms_b','terms_b',false);
$form->addText('terms_c','terms_c',false);
$form->addText('terms_d','terms_d',false);
$form->addText('terms_e','terms_e',false);
$form->addText('terms_f','terms_f',false);
$form->addElement('static','','',$h);
$form->addButtonSave(get_lang('Save'));

@ -1,73 +0,0 @@
<?php
$varString = api_get_self();
$varUrlList = str_replace("node_process.php","node_list.php",$varString);
$varUrlProcess = str_replace("node_list.php","node_process.php",$varString);
switch($action){
case 'add':
if($form->validate()){
$values = $form->getSubmitValues();
$date = new DateTime();
$year = $date->format("Y");
$month = $date->format('m');
$day = $date->format('j');
$dateStr = $day.'/'.$month.'/'.$year;
$params = [
'title' => $values['title'],
'date_create' => $dateStr,
'user_id' => $userId,
'node_type' => $values['node_type'],
'terms_a' => $values['terms_a'],
'terms_b' => $values['terms_b'],
'terms_c' => $values['terms_c'],
'terms_d' => $values['terms_d'],
'terms_e' => $values['terms_e'],
'terms_f' => $values['terms_f'],
'descript' => $values['descript'],
'url_id' => $idurl
];
$result = Database::insert($table, $params);
$objectId = 0;
if(!$result){
}else{
Display::addFlash(Display::return_message(get_lang('Added')));
$objectId = Database::insert_id();
}
$varUrlProcess = $varUrlProcess.'?id='.$objectId.'&action=add';
header('Location: '.$varUrlProcess);
exit;
}
break;
case 'edit':
$form->setDefaults($term);
if($form->validate()) {
$values = $form->getSubmitValues();
$params = [
'title' => $values['title'],
'terms_a' => $values['terms_a'],
'terms_b' => $values['terms_b'],
'terms_c' => $values['terms_c'],
'terms_d' => $values['terms_d'],
'terms_e' => $values['terms_e'],
'terms_f' => $values['terms_f'],
'descript' => $values['descript']
];
Database::update($table, $params, ['id = ?' => $id]);
Display::addFlash(Display::return_message(get_lang('Updated')));
$varUrlProcess = $varUrlProcess.'?id='.$id.'&action=edit';
header('Location: '.$varUrlProcess);
exit;
}
break;
case 'delete':
if(!empty($term)){
Database::delete($table, ['id = ?' => $id]);
Display::addFlash(Display::return_message(get_lang('Deleted')));
header('Location: '.$varUrlList);
exit;
}
break;
}

@ -1,32 +0,0 @@
<?php
$tds = '<div id="h5p_title_help" style="display:none;" >'.$plugin->get_lang('h5p_title_help').'</div>';
$tds .= '<div id="h5p_descr_help" style="display:none;" >'.$plugin->get_lang('h5p_descr_help').'</div>';
$tds .= '<div id="h5p_cancel" style="display:none;" >'.get_lang('Cancel').'</div>';
$tds .= '<div id="h5p_wordsmatch_help" style="display:none;" >'.$plugin->get_lang('h5p_wordsmatch_help').'</div>';
$tds .= '<div id="h5p_wordsmatch_load" style="display:none;" >'.$plugin->get_lang('h5p_wordsmatch_load').'</div>';
$tds .= '<div id="h5p_wordsmatch_tutor" style="display:none;" >'.$plugin->get_lang('h5p_wordsmatch_tutor').'</div>';
$tds .= '<div id="h5p_wordsmatch_term_a" style="display:none;" >'.$plugin->get_lang('h5p_wordsmatch_term_a').'</div>';
$tds .= '<div id="h5p_dragthewords_help" style="display:none;" >'.$plugin->get_lang('h5p_dragthewords_help').'</div>';
$tds .= '<div id="h5p_dragthewords_load" style="display:none;" >'.$plugin->get_lang('h5p_dragthewords_load').'</div>';
$tds .= '<div id="h5p_dragthewords_tutor" style="display:none;" >'.$plugin->get_lang('h5p_dragthewords_tutor').'</div>';
$tds .= '<div id="h5p_dragthewords_term_a" style="display:none;" >'.$plugin->get_lang('h5p_dragthewords_term_a').'</div>';
$tds .= '<div id="h5p_dialogcard_help" style="display:none;" >'.$plugin->get_lang('h5p_dialogcard_help').'</div>';
$tds .= '<div id="h5p_dialogcard_load" style="display:none;" >'.$plugin->get_lang('h5p_dialogcard_load').'</div>';
$tds .= '<div id="h5p_dialogcard_tutor" style="display:none;" >'.$plugin->get_lang('h5p_dialogcard_tutor').'</div>';
$tds .= '<div id="h5p_dialogcard_term_a" style="display:none;" >'.$plugin->get_lang('h5p_dialogcard_term_a').'</div>';
$tds .= '<div id="h5p_markthewords_help" style="display:none;" >'.$plugin->get_lang('h5p_markthewords_help').'</div>';
$tds .= '<div id="h5p_markthewords_load" style="display:none;" >'.$plugin->get_lang('h5p_markthewords_load').'</div>';
$tds .= '<div id="h5p_markthewords_tutor" style="display:none;" >'.$plugin->get_lang('h5p_markthewords_tutor').'</div>';
$tds .= '<div id="h5p_markthewords_term_a" style="display:none;" >'.$plugin->get_lang('h5p_markthewords_term_a').'</div>';
$tds .= '<div id="h5p_guesstheanswer_help" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_help').'</div>';
$tds .= '<div id="h5p_guesstheanswer_load" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_load').'</div>';
$tds .= '<div id="h5p_guesstheanswer_tutor" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_tutor').'</div>';
$tds .= '<div id="h5p_guesstheanswer_term_a" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_term_a').'</div>';
$tds .= '<div id="h5p_guesstheanswer_term_b" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_term_b').'</div>';
$tds .= '<div id="h5p_guesstheanswer_term_c" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_term_c').'</div>';

@ -0,0 +1,34 @@
<?php
/* For licensing terms, see /license.txt */
$translations = '<div id="h5p_title_help" style="display:none;" >'.$plugin->get_lang('h5p_title_help').'</div>';
$translations .= '<div id="h5p_descr_help" style="display:none;" >'.$plugin->get_lang('h5p_descr_help').'</div>';
$translations .= '<div id="h5p_cancel" style="display:none;" >'.get_lang('Cancel').'</div>';
$translations .= '<div id="h5p_wordsmatch_help" style="display:none;" >'.$plugin->get_lang('h5p_wordsmatch_help').'</div>';
$translations .= '<div id="h5p_wordsmatch_load" style="display:none;" >'.$plugin->get_lang('h5p_wordsmatch_load').'</div>';
$translations .= '<div id="h5p_wordsmatch_tutor" style="display:none;" >'.$plugin->get_lang('h5p_wordsmatch_tutor').'</div>';
$translations .= '<div id="h5p_wordsmatch_term_a" style="display:none;" >'.$plugin->get_lang('h5p_wordsmatch_term_a').'</div>';
$translations .= '<div id="h5p_dragthewords_help" style="display:none;" >'.$plugin->get_lang('h5p_dragthewords_help').'</div>';
$translations .= '<div id="h5p_dragthewords_load" style="display:none;" >'.$plugin->get_lang('h5p_dragthewords_load').'</div>';
$translations .= '<div id="h5p_dragthewords_tutor" style="display:none;" >'.$plugin->get_lang('h5p_dragthewords_tutor').'</div>';
$translations .= '<div id="h5p_dragthewords_term_a" style="display:none;" >'.$plugin->get_lang('h5p_dragthewords_term_a').'</div>';
$translations .= '<div id="h5p_dialogcard_help" style="display:none;" >'.$plugin->get_lang('h5p_dialogcard_help').'</div>';
$translations .= '<div id="h5p_dialogcard_load" style="display:none;" >'.$plugin->get_lang('h5p_dialogcard_load').'</div>';
$translations .= '<div id="h5p_dialogcard_tutor" style="display:none;" >'.$plugin->get_lang('h5p_dialogcard_tutor').'</div>';
$translations .= '<div id="h5p_dialogcard_term_a" style="display:none;" >'.$plugin->get_lang('h5p_dialogcard_term_a').'</div>';
$translations .= '<div id="h5p_markthewords_help" style="display:none;" >'.$plugin->get_lang('h5p_markthewords_help').'</div>';
$translations .= '<div id="h5p_markthewords_load" style="display:none;" >'.$plugin->get_lang('h5p_markthewords_load').'</div>';
$translations .= '<div id="h5p_markthewords_tutor" style="display:none;" >'.$plugin->get_lang('h5p_markthewords_tutor').'</div>';
$translations .= '<div id="h5p_markthewords_term_a" style="display:none;" >'.$plugin->get_lang('h5p_markthewords_term_a').'</div>';
$translations .= '<div id="h5p_guesstheanswer_help" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_help').'</div>';
$translations .= '<div id="h5p_guesstheanswer_load" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_load').'</div>';
$translations .= '<div id="h5p_guesstheanswer_tutor" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_tutor').'</div>';
$translations .= '<div id="h5p_guesstheanswer_term_a" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_term_a').'</div>';
$translations .= '<div id="h5p_guesstheanswer_term_b" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_term_b').'</div>';
$translations .= '<div id="h5p_guesstheanswer_term_c" style="display:none;" >'.$plugin->get_lang('h5p_guesstheanswer_term_c').'</div>';

@ -1,38 +1,28 @@
<?php
/* For license terms, see /license.txt */
if(file_exists(__DIR__."/chamilo_boost_h5p.php")){
require_once(__DIR__."/chamilo_boost_h5p.php");
$plugin_info = chamilo_boost_h5p::create()->get_info();
}
/* For license terms, see /license.txt */
$parsedUrl = parse_url($_SERVER['REQUEST_URI']);
$parsedUrlpathCtr = $parsedUrl['path'];
$posCtr = strrpos($parsedUrlpathCtr,"lp_controller.php");
$posCtr = strrpos($parsedUrlpathCtr, "lp_controller.php");
$fh = '';
if($posCtr===false){
echo '';
}else{
if ($posCtr === false) {
echo '';
} else {
$ctrAction = isset($_GET['action']) ? (string) $_GET['action'] : '';
$ctrAction = isset($_GET['action']) ? (string) $_GET['action']:'';
$version = '?v=09';
$version = '?v=09';
$loginAccepted = isset($_SESSION['h5p']) ? $_SESSION['h5p_accepted'] : null;
$pwp = api_get_path(WEB_PLUGIN_PATH);
if($ctrAction=='edit_item'||$ctrAction=='add_item'){
$fh .= '<script src="'.$pwp.'h5p/resources/js/h5p_extras.js'.$version.'" type="text/javascript" ></script>';
$fh .= '<script type="text/javascript" src="'.api_get_path(WEB_PATH).'web/assets/jquery-ui/jquery-ui.min.js"></script>';
$fh .= '<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_PATH).'web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css">';
$fh .= '<link rel="stylesheet" type="text/css" href="'.$pwp.'h5p/resources/css/window-h5p.css">';
$pluginPath = api_get_path(WEB_PLUGIN_PATH);
$webPath = api_get_path(WEB_PATH);
if ($ctrAction == 'edit_item' || $ctrAction == 'add_item') {
$fh .= '<script src="'.$pluginPath.'h5p/resources/js/h5p_extras.js'.$version.'" type="text/javascript" ></script>';
$fh .= '<script type="text/javascript" src="'.$webPath.'web/assets/jquery-ui/jquery-ui.min.js"></script>';
$fh .= '<link rel="stylesheet" type="text/css" href="'.$webPath.'web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css">';
$fh .= '<link rel="stylesheet" type="text/css" href="'.$pluginPath.'h5p/resources/css/window-h5p.css">';
}
}
echo $fh;

@ -0,0 +1,140 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once __DIR__.'/h5p_plugin.class.php';
$language = 'en';
$platformLanguage = api_get_interface_language();
$iso = api_get_language_isocode($platformLanguage);
$awp = api_get_path(WEB_PATH);
if (api_is_anonymous()) {
header('Location: '.$awp.'index.php');
exit;
} else {
$user = api_get_user_info();
if (!api_is_platform_admin(true, true)) {
// Prevent non-admins to see this
header('Location: '.$awp.'index.php');
exit;
}
}
if (!$plugin->isEnabled(true)) {
api_not_allowed(true);
exit;
}
//Update 1.5 comment after first update
$sqlUpdate = "SELECT COUNT(*) as nb FROM information_schema.COLUMNS WHERE COLUMN_NAME = 'terms_d' and TABLE_NAME LIKE 'plugin_h5p'";
$resultUpdate = Database::query($sqlUpdate);
$rowUpdate = Database::fetch_array($resultUpdate);
$intUpdate = (int) $rowUpdate['nb'];
if ($intUpdate == 0) {
header('Location: '.api_get_path(WEB_PLUGIN_PATH).'h5p/update.php?version=1-5');
exit;
}
//Update 1.5
$userId = $user['id'];
$vers = 6;
$plugin = H5PPlugin::create();
//wordsmatch
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$nodeType = isset($_GET['node_type']) ? Security::remove_XSS($_GET['node_type']) : '';
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'add';
$table = 'plugin_h5p';
$urlId = api_get_current_access_url_id();
$UrlWhere = "";
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
$UrlWhere = " AND url_id = $urlId ";
}
$sql = "SELECT * FROM $table WHERE user_id = $userId $UrlWhere ORDER BY title";
if (isset($_GET['id'])) {
$sql = "SELECT * FROM $table WHERE id <> $id AND user_id = $userId $UrlWhere LIMIT 2";
}
$result = Database::query($sql);
$terms = Database::store_result($result, 'ASSOC');
$countData = count($terms);
$term = null;
if ($id > 0) {
if (!empty($id)) {
$sql = "SELECT * FROM $table WHERE id = $id AND user_id = $userId ";
$result = Database::query($sql);
$term = Database::fetch_array($result, 'ASSOC');
if (empty($term)) {
api_not_allowed(true);
}
}
}
include __DIR__.'/inc/translate.php';
include __DIR__.'/inc/edit.form.php';
$htmlHeadXtra[] = '<script type="text/javascript" src="'.$awp.'vendor/studio-42/elfinder/js/elfinder.full.js"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.$awp.'vendor/studio-42/elfinder/css/elfinder.full.css">';
$htmlHeadXtra[] = '<script type="text/javascript" src="'.$awp.'web/assets/jquery-ui/jquery-ui.min.js"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.$awp.'web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css">';
$htmlHeadXtra[] = '<link href="resources/js/pell.min.css?v='.$vers.'" rel="stylesheet" type="text/css" />';
$htmlHeadXtra[] = '<script src="resources/js/pell.js?v='.$vers.'" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="resources/js/interface.js?v='.$vers.'" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="resources/js/jquery.dataTables.min.js?v='.$vers.'" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = "<script>
$(document).ready(function(){
$('.data_table').DataTable({
'iDisplayLength': 50
});
});
var GlobalTypeNode = '".$nodeType."';
</script>";
if ($nodeType != '') {
$htmlHeadXtra[] = "<script>
$(document).ready(function(){interface$nodeType();});
</script>";
}
$htmlHeadXtra[] = "<style>
.previous{
margin-right:10px;
cursor:pointer;
}
.next{
cursor:pointer;
}
input[type='radio'] {
-ms-transform: scale(1.5);
-webkit-transform: scale(1.5);
transform: scale(1.5);
}
</style>";
include 'inc/action.switch.php';
$tpl = new Template('H5P');
if ($nodeType == '') {
$tpl->assign('terms', $terms);
}
$tpl->assign('tables', $tableOfnodes);
$tpl->assign('form', $form->returnForm());
$content = $tpl->fetch('h5p/view/list.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -1,143 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once __DIR__.'/h5p_plugin.class.php';
$language = 'en';
$platformLanguage = api_get_interface_language();
$iso = api_get_language_isocode($platformLanguage);
if(!api_is_anonymous()){
$user = api_get_user_info();
if(isset($user['status'])){
if($user['status']==SESSIONADMIN
||$user['status']==COURSEMANAGER
||$user['status']==PLATFORM_ADMIN){
}else{
echo "<script>location.href = '../../index.php';</script>";
exit;
}
}
}else{
echo "<script>location.href = '../../index.php';</script>";
exit;
}
//Update 1.5 comment after first update
$sqlMaj = "SELECT COUNT(*) as nb FROM information_schema.COLUMNS WHERE COLUMN_NAME = 'terms_d' and TABLE_NAME LIKE '%h5p%'";
$rsMaj = Database::query($sqlMaj);
$rowMaj = Database::fetch_array($rsMaj);
$intMaj = intVal($rowMaj['nb']);
if($intMaj==0){
echo "<script>location.href = 'update-v.php?version=1-5';</script>";
exit;
}
//Update 1.5
$userId = $user['id'];
$vers = 6;
$plugin = H5PPlugin::create();
//wordsmatch
$id = isset($_GET['id']) ? (int) $_GET['id']:0;
$nodeType = isset($_GET['node_type']) ? Security::remove_XSS($_GET['node_type']) : '';
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']):'add';
$table = 'plugin_h5p';
$idurl = api_get_current_access_url_id();
$UrlWhere = "";
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
$UrlWhere = " AND url_id = $idurl ";
}
$sql = "SELECT * FROM $table WHERE user_id = $userId $UrlWhere ORDER BY title";
if(isset($_GET['id'])){
$sql = "SELECT * FROM $table WHERE id <> $id AND user_id = $userId $UrlWhere LIMIT 2";
}
$result = Database::query($sql);
$terms = Database::store_result($result,'ASSOC');
$countData = count($terms);
$term = null;
if($id>0){
if(!empty($id)){
$sql = "SELECT * FROM $table WHERE id = $id AND user_id = $userId ";
$result = Database::query($sql);
$term = Database::fetch_array($result, 'ASSOC');
if(empty($term)){
api_not_allowed(true);
}
}
}
include("inc/trad-h5p.php");
include("inc/form-h5p.php");
$awp = api_get_path(WEB_PATH);
$htmlHeadXtra[] = '<script type="text/javascript" src="'.$awp.'vendor/studio-42/elfinder/js/elfinder.full.js"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.$awp.'vendor/studio-42/elfinder/css/elfinder.full.css">';
$htmlHeadXtra[] = '<script type="text/javascript" src="'.$awp.'web/assets/jquery-ui/jquery-ui.min.js"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.$awp.'web/assets/jquery-ui/themes/smoothness/jquery-ui.min.css">';
$htmlHeadXtra[] = '<link href="resources/js/pell.min.css?v='.$vers.'" rel="stylesheet" type="text/css" />';
$htmlHeadXtra[] = '<script src="resources/js/pell.js?v='.$vers.'" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="resources/js/interface.js?v='.$vers.'" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<script src="resources/js/jquery.dataTables.min.js?v='.$vers.'" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = "<script>
$(document).ready(function(){
$('.data_table').DataTable({
'iDisplayLength': 50
});
});
var GlobalTypeNode = '".$nodeType."';
</script>";
if($nodeType!=''){
$htmlHeadXtra[] = "<script>
$(document).ready(function(){interface$nodeType();});
</script>";
}
$htmlHeadXtra[] = "<style>
.previous{
margin-right:10px;
cursor:pointer;
}
.next{
cursor:pointer;
}
input[type='radio'] {
-ms-transform: scale(1.5);
-webkit-transform: scale(1.5);
transform: scale(1.5);
}
</style>";
include("inc/switchaction-h5p.php");
$tpl = new Template("H5P");
if($nodeType==''){
$tpl->assign('terms', $terms);
}
$tpl->assign('tables', $tableOfnodes);
$tpl->assign('form', $form->returnForm());
$content = $tpl->fetch('/h5p/view/node_list-v13.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -1,225 +1,229 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once __DIR__.'/h5p_plugin.class.php';
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once __DIR__.'/h5p_plugin.class.php';
if(api_is_anonymous()){
echo "<script>setTimeout(function(){location.href = '../../index.php';},1000);</script>";
exit;
}
$awp = api_get_path(WEB_PATH);
$pathPlugH5P = api_get_path(WEB_PLUGIN_PATH).'h5p/';
$vers = 6;
$htmlHeadXtra[] = '<script src="resources/js/interface.js?v='.$vers.'" type="text/javascript" language="javascript"></script>';
$id = isset($_GET['id']) ? (int) $_GET['id']:0;
$nodeType = isset($_GET['node_type']) ? Security::remove_XSS($_GET['node_type']) : '';
$terma = "";
$termb = "";
$termc = "";
$termd = "";
$terme = "";
$termf = "";
if (api_is_anonymous()) {
header('Location: '.$awp.'index.php');
exit;
}
$opt1 = "";
$opt2 = "";
$opt3 = "";
$version = 6;
$description = "";
$htmlHeadXtra[] = '<script src="resources/js/interface.js?v='.$version.'" type="text/javascript" language="javascript"></script>';
$term = null;
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$nodeType = isset($_GET['node_type']) ? Security::remove_XSS($_GET['node_type']) : '';
$contentForm = '<p>Error</p>';
$termA = '';
$termB = '';
$termC = '';
$termD = '';
$termE = '';
$termF = '';
if($id>0){
$option1 = '';
$option2 = '';
$option3 = '';
$sql = "SELECT * FROM plugin_h5p WHERE id = $id ";
$result = Database::query($sql);
$description = '';
while($rowP=Database::fetch_array($result)){
$nodeType = $rowP['node_type'];
$term = null;
$terma = $rowP['terms_a'];
$termb = $rowP['terms_b'];
$termc = $rowP['terms_c'];
$contentForm = '<p>Error</p>';
$termd = $rowP['terms_d'];
$terme = $rowP['terms_e'];
$termf = $rowP['terms_f'];
if ($id > 0) {
$opt1 = $rowP['opt_1'];
$opt2 = $rowP['opt_2'];
$opt3 = $rowP['opt_3'];
$sql = "SELECT * FROM plugin_h5p WHERE id = $id ";
$result = Database::query($sql);
$description = $rowP['descript'];
}
//copyr($source, $dest, $exclude = [], $copied_files = [])
$fld_id = 'source-'.$id;
$src_h5p ='cache-h5p/launch/source-'.$nodeType;
$dest_h5p ='cache-h5p/launch/'.$fld_id;
//mkdir($dest_h5p);
recurse_copy($src_h5p, $dest_h5p);
$content_src ='cache-h5p/launch/'.$fld_id.'/content/content.json';
$content_flx = file_get_contents($content_src);
if($nodeType=='dialogcard'||$nodeType=='memory'){
if(controlSourceCards($terma)){
$base_flx = getSourceCards($terma,$nodeType);
}
if(controlSourceCards($termb)){
$base_flx .= ',';
$base_flx .= getSourceCards($termb,$nodeType);
}
if(controlSourceCards($termc)){
$base_flx .= ',';
$base_flx .= getSourceCards($termc,$nodeType);
}
if(controlSourceCards($termd)){
$base_flx .= ',';
$base_flx .= getSourceCards($termd,$nodeType);
}
if(controlSourceCards($terme)){
$base_flx .= ',';
$base_flx .= getSourceCards($terme,$nodeType);
}
if(controlSourceCards($termf)){
$base_flx .= ',';
$base_flx .= getSourceCards($termf,$nodeType);
}
$content_flx = str_replace("\"@base_cards@\"",$base_flx,$content_flx);
}
if($nodeType=='guesstheanswer'){
$extractImgData = "images/dialogcard.jpg";
$path_parts = pathinfo($termb);
$fileN = $path_parts['filename'];
$fileE = $path_parts['extension'];
if($fileN!=''){
$fileN = $fileN.'.'.$fileE;
$p1 = $termb;
if($p1!=''&&$p1!='dialogcard.jpg'&&$p1!='img/dialogcard.jpg'&&$p1!='images/dialogcard.jpg'){
$p2 = api_get_path(SYS_PATH).'plugin/h5p/cache-h5p/launch/img/'.$fileN;
copy($p1,$p2);
$extractImgData = "../../img/".$fileN;
}else{
$extractImgData = api_get_path(WEB_PATH).'plugin/h5p/cache-h5p/launch/img/dialogcard.jpg';
}
}
$content_flx = str_replace("@image_b@",json_encode($extractImgData),$content_flx);
}
$content_flx = str_replace("@terms_a@",$terma,$content_flx);
$content_flx = str_replace("@terms_b@",$termb,$content_flx);
$content_flx = str_replace("@terms_c@",$termc,$content_flx);
$content_flx = str_replace("@descript@",$description,$content_flx);
$langUi = getLangUi();
if($langUi=='fr'||$langUi=='french'){
$content_flx = str_replace("\"solution label\"","\"Voir la solution\"",$content_flx);
$content_flx = str_replace("\"Turn\"","\"Tourner\"",$content_flx);
$content_flx = str_replace("\"Check\"","\"Vérifier\"",$content_flx);
$content_flx = str_replace("\"Retry\"","\"Recommencer\"",$content_flx);
$content_flx = str_replace("\"Correct!\"","\"Bravo!\"",$content_flx);
$content_flx = str_replace("\"Incorrect!\"","\"Réponse incorrecte!\"",$content_flx);
$content_flx = str_replace("\"Answer not found!\"","\"Réponse non trouvé!\"",$content_flx);
$content_flx = str_replace("\"You got :num out of :total points\"","\"Votre score :num out sur :total points\"",$content_flx);
$content_flx = str_replace("\"Show solution\"","\"Voir la solution\"",$content_flx);
}
$fp = fopen($content_src,'w');
fwrite($fp,$content_flx);
fclose($fp);
$tar_htm ='cache-h5p/launch/'.$fld_id.'.html';
$src_h5p = file_get_contents('cache-h5p/launch/source-h.html');
$src_h5p = str_replace("{folder}",$fld_id,$src_h5p);
//{folder}
$fp = fopen($tar_htm,'w');
fwrite($fp,$src_h5p);
fclose($fp);
$pathPlugH5P = api_get_path(WEB_PLUGIN_PATH).'h5p/';
$contentForm = '<iframe frameborder=0 width="100%" height="600px" ';
$contentForm .= ' style="width:100%;height:600px;" ';
$contentForm .= ' src="'.$pathPlugH5P.$tar_htm.'" >';
$contentForm .= '</iframe>';
}
$contentForm .= '<h3 style="text-align:center;" >Code embeded</h3>';
$contentForm .= '<textarea rows=5 style="margin-left:10%;width:80%;margin-right:10%;" >';
$contentForm .= $contentForm;
$contentForm .= '</textarea>';
$contentForm .= '<p style="text-align:center;" >';
$contentForm .= '<a href="node_list.php" class="btn btn-primary">';
$contentForm .= '<em class="fa"></em>'.get_lang('Close').'</a>';
$contentForm .= '</p>';
$tpl = new Template("H5P");
$tpl->assign('form', $contentForm);
$content = $tpl->fetch('/h5p/view/node_view.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();
//echo "<script>setTimeout(function(){location.href = 'node_list.php';},1000);</script>";
function recurse_copy($src,$dst) {
$dir = opendir($src);
@mkdir($dst);
while(false !== ( $file = readdir($dir)) ) {
if (( $file != '.' ) && ( $file != '..' )) {
if ( is_dir($src . '/' . $file) ) {
recurse_copy($src . '/' . $file,$dst . '/' . $file);
}
else {
copy($src . '/' . $file,$dst . '/' . $file);
}
}
}
closedir($dir);
}
function controlSourceCards($termData){
if($termData==''){
return false;
}
$partTerm = explode("|", $termData);
$txtWarp = $partTerm[0];
$txtWarp = strip_tags($txtWarp);
if($txtWarp!=''){
return true;
}else{
return false;
}
}
function getSourceCards($termData,$nodeType){
$base_flx = '{"tips":{},
while ($rowP = Database::fetch_array($result)) {
$nodeType = $rowP['node_type'];
$termA = $rowP['terms_a'];
$termB = $rowP['terms_b'];
$termC = $rowP['terms_c'];
$termD = $rowP['terms_d'];
$termE = $rowP['terms_e'];
$termF = $rowP['terms_f'];
$option1 = $rowP['opt_1'];
$option2 = $rowP['opt_2'];
$option3 = $rowP['opt_3'];
$description = $rowP['descript'];
}
$fieldId = 'source-'.$id;
$h5pSource = 'cache-h5p/launch/source-'.$nodeType;
$h5pDestination = 'cache-h5p/launch/'.$fieldId;
//mkdir($dest_h5p);
copyr($h5pSource, $h5pDestination);
$contentSource = 'cache-h5p/launch/'.$fieldId.'/content/content.json';
$contentFlx = file_get_contents($contentSource);
if ($nodeType == 'dialogcard' || $nodeType == 'memory') {
if (controlSourceCards($termA)) {
$baseFlx = getSourceCards($termA, $nodeType);
}
if (controlSourceCards($termB)) {
$baseFlx .= ',';
$baseFlx .= getSourceCards($termB, $nodeType);
}
if (controlSourceCards($termC)) {
$baseFlx .= ',';
$baseFlx .= getSourceCards($termC, $nodeType);
}
if (controlSourceCards($termD)) {
$baseFlx .= ',';
$baseFlx .= getSourceCards($termD, $nodeType);
}
if (controlSourceCards($termE)) {
$baseFlx .= ',';
$baseFlx .= getSourceCards($termE, $nodeType);
}
if (controlSourceCards($termF)) {
$baseFlx .= ',';
$baseFlx .= getSourceCards($termF, $nodeType);
}
$contentFlx = str_replace("\"@base_cards@\"", $baseFlx, $contentFlx);
}
if ($nodeType == 'guesstheanswer') {
$extractImgData = "images/dialogcard.jpg";
$pathParts = pathinfo($termB);
$fileN = $pathParts['filename'];
$fileE = $pathParts['extension'];
if ($fileN != '') {
$fileN = $fileN.'.'.$fileE;
$p1 = $termB;
if ($p1 != '' && $p1 != 'dialogcard.jpg' && $p1 != 'img/dialogcard.jpg' && $p1 != 'images/dialogcard.jpg') {
$p2 = api_get_path(SYS_PLUGIN_PATH).'h5p/cache-h5p/launch/img/'.$fileN;
copy($p1, $p2);
$extractImgData = "../../img/".$fileN;
} else {
$extractImgData = $pathPlugH5P.'cache-h5p/launch/img/dialogcard.jpg';
}
}
$contentFlx = str_replace("@image_b@", json_encode($extractImgData), $contentFlx);
}
$contentFlx = str_replace("@terms_a@", $termA, $contentFlx);
$contentFlx = str_replace("@terms_b@", $termB, $contentFlx);
$contentFlx = str_replace("@terms_c@", $termC, $contentFlx);
$contentFlx = str_replace("@descript@", $description, $contentFlx);
$interfaceLanguage = api_get_language_isocode();
// @TODO support translations in a better way (only en/fr now)
if ($interfaceLanguage == 'fr' || $interfaceLanguage == 'french') {
$contentFlx = str_replace("\"solution label\"", "\"Voir la solution\"", $contentFlx);
$contentFlx = str_replace("\"Turn\"", "\"Tourner\"", $contentFlx);
$contentFlx = str_replace("\"Check\"", "\"Vérifier\"", $contentFlx);
$contentFlx = str_replace("\"Retry\"", "\"Recommencer\"", $contentFlx);
$contentFlx = str_replace("\"Correct!\"", "\"Bravo!\"", $contentFlx);
$contentFlx = str_replace("\"Incorrect!\"", "\"Réponse incorrecte!\"", $contentFlx);
$contentFlx = str_replace("\"Answer not found!\"", "\"Réponse non trouvée!\"", $contentFlx);
$contentFlx = str_replace("\"You got :num out of :total points\"",
"\"Votre score :num out sur :total points\"", $contentFlx);
$contentFlx = str_replace("\"Show solution\"", "\"Voir la solution\"", $contentFlx);
} elseif ($interfaceLanguage == 'es') {
$contentFlx = str_replace("\"solution label\"", "\"Ver la solución\"", $contentFlx);
$contentFlx = str_replace("\"Turn\"", "\"Girar\"", $contentFlx);
$contentFlx = str_replace("\"Check\"", "\"Verificar\"", $contentFlx);
$contentFlx = str_replace("\"Retry\"", "\"Volver a intentar\"", $contentFlx);
$contentFlx = str_replace("\"Correct!\"", "\"¡Bravo!\"", $contentFlx);
$contentFlx = str_replace("\"Incorrect!\"", "\"¡Respuesta incorrecta!\"", $contentFlx);
$contentFlx = str_replace("\"Answer not found!\"", "\"¡Respuesta no encontrada!\"", $contentFlx);
$contentFlx = str_replace("\"You got :num out of :total points\"",
"\"Su nota es de :num sobre :total puntos\"", $contentFlx);
$contentFlx = str_replace("\"Show solution\"", "\"Ver la solución\"", $contentFlx);
}
$fp = fopen($contentSource, 'w');
fwrite($fp, $contentFlx);
fclose($fp);
$htmlFile = 'cache-h5p/launch/'.$fieldId.'.html';
$h5pSource = file_get_contents('cache-h5p/launch/source-h.html');
$h5pSource = str_replace("{folder}", $fieldId, $h5pSource);
//{folder}
$fp = fopen($htmlFile, 'w');
fwrite($fp, $h5pSource);
fclose($fp);
$contentForm = '<iframe frameborder="0" width="100%" height="600px" ';
$contentForm .= ' style="width:100%;height:600px;" ';
$contentForm .= ' src="'.$pathPlugH5P.$htmlFile.'" >';
$contentForm .= '</iframe>';
}
$contentForm .= '<h3 style="text-align:center;" >Embedded code</h3>';
$contentForm .= '<textarea rows=5 style="margin-left:10%;width:80%;margin-right:10%;" >';
$contentForm .= $contentForm;
$contentForm .= '</textarea>';
$contentForm .= '<p style="text-align:center;" >';
$contentForm .= '<a href="list.php" class="btn btn-primary">';
$contentForm .= '<em class="fa"></em>'.get_lang('Close').'</a>';
$contentForm .= '</p>';
$tpl = new Template("H5P");
$tpl->assign('form', $contentForm);
$content = $tpl->fetch('/h5p/view/view.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();
/**
* Check if a source card is not empty.
* @param string $termData A string from which we extract the first part
* @return bool False on empty, true otherwise
*/
function controlSourceCards($termData)
{
if ($termData == '') {
return false;
}
$partTerm = explode("|", $termData);
$txtWarp = $partTerm[0];
$txtWarp = strip_tags($txtWarp);
if ($txtWarp != '') {
return true;
}
return false;
}
/**
* Parse and reformat base image tags with the given terms string.
* @param string $termData A string from which we only take the first elements (we split it on | )
* @param string $nodeType The type of node ('memory', 'cards', etc)
* @return string|string[]
*/
function getSourceCards($termData, $nodeType)
{
$baseFlx = '{"tips":{},
"text": @text_a@ ,
"answer": @answer_a@ ,
"image":{"path":@image_a@,
@ -229,56 +233,37 @@
"height":100
}}';
if($nodeType=='memory'){
$base_flx = '{"image":{"path":@image_a@,
if ($nodeType == 'memory') {
$baseFlx = '{"image":{"path":@image_a@,
"mime":"image\/jpeg",
"copyright":{"license":"U"},
"width":100,"height":100},
"description":@text_a@,"matchAlt":@text_a@,"imageAlt":@text_a@}';
}
$partTerm = explode("|", $termData);
$base_flx = str_replace("@text_a@",json_encode($partTerm[0]),$base_flx);
$base_flx = str_replace("@answer_a@",json_encode($partTerm[1]),$base_flx);
$extractImg = "images/dialogcard.jpg";
$path_parts = pathinfo($partTerm[2]);
$fileN = $path_parts['filename'];
$fileE = $path_parts['extension'];
if($fileN!=''){
$fileN = $fileN.'.'.$fileE;
$p1 = $partTerm[2];
if($p1!=''&&$p1!='dialogcard.jpg'&&$p1!='img/dialogcard.jpg'&&$p1!='images/dialogcard.jpg'){
$p2 = api_get_path(SYS_PATH).'plugin/h5p/cache-h5p/launch/img/'.$fileN;
copy($p1,$p2);
$extractImg = "../../img/".$fileN;
}else{
$extractImg = api_get_path(WEB_PATH).'plugin/h5p/cache-h5p/launch/img/dialogcard.jpg';
}
}
$base_flx = str_replace("@image_a@",json_encode($extractImg),$base_flx);
return $base_flx;
}
function getLangUi()
{
$language = 'en';
global $language_interface;
if(!empty($language_interface)){
$language = $language_interface;
}
return $language;
}
}
$partTerm = explode("|", $termData);
$baseFlx = str_replace("@text_a@", json_encode($partTerm[0]), $baseFlx);
$baseFlx = str_replace("@answer_a@", json_encode($partTerm[1]), $baseFlx);
$extractImg = "images/dialogcard.jpg";
$pathParts = pathinfo($partTerm[2]);
$fileN = $pathParts['filename'];
$fileE = $pathParts['extension'];
if ($fileN != '') {
$fileN = $fileN.'.'.$fileE;
$p1 = $partTerm[2];
if ($p1 != '' && $p1 != 'dialogcard.jpg' && $p1 != 'img/dialogcard.jpg' && $p1 != 'images/dialogcard.jpg') {
$p2 = api_get_path(SYS_PLUGIN_PATH).'h5p/cache-h5p/launch/img/'.$fileN;
copy($p1, $p2);
$extractImg = '../../img/'.$fileN;
} else {
$extractImg = api_get_path(WEB_PLUGIN_PATH).'h5p/cache-h5p/launch/img/dialogcard.jpg';
}
}
$baseFlx = str_replace("@image_a@", json_encode($extractImg), $baseFlx);
return $baseFlx;
}

@ -1,55 +0,0 @@
<?php
require_once __DIR__.'/../../main/inc/global.inc.php';
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(E_ALL);
$user = api_get_user_info();
$userId = $user['id'];
$idurl = api_get_current_access_url_id();
$UrlWhere = "";
if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) {
$UrlWhere = " AND url_id = $idurl ";
}
if(isset($_GET['id'])){
$id = (int) $_GET['id'];
$table = 'plugin_h5p';
$sql = "SELECT * FROM $table WHERE id = $id AND user_id = $userId $UrlWhere";
$result = Database::query($sql);
while($Part=Database::fetch_array($result)){
$pageFinale = __DIR__.'/cache_page/page-show-'.$id.'.html';
echo $pageFinale;
if(file_exists($pageFinale)){
$base_html = file_get_contents($pageFinale);
$base_html = str_replace( ' src="img/' , ' src="'.api_get_path(WEB_PLUGIN_PATH).'h5p/editor/img/', $base_html );
$pageCustom = __DIR__.'/../../custompages/landchami-'.$id.'.html';
$fp = fopen($pageCustom,'w');
fwrite($fp,$base_html);
fclose($fp);
if(file_exists($pageCustom)){
echo '<script>';
echo 'location.href="'.api_get_path(WEB_PATH).'custompages/landchami-'.$id.'.html";';
echo '</script>';
}else{
echo ' the page ('.api_get_path(WEB_PATH).'custompages/landchami-'.$id.'.html) no exist !"';
}
}
}
}else{
echo ' No ID !"';
}

@ -1,32 +1,33 @@
<?php
require_once __DIR__.'/../../../../main/inc/global.inc.php';
if(api_is_anonymous()){
echo "<script>location.href = '../../index.php';</script>";
exit;
}
$id = isset($_GET['id']) ? (int) $_GET['id']:0;
$idurl = api_get_current_access_url_id();
$UrlWhere = "";
if(api_get_multiple_access_url()){
$UrlWhere = " WHERE url_id = $idurl ";
}
$sql = "SELECT id,title,node_type FROM plugin_chamilo_h5p $UrlWhere ORDER BY title";
$resultset = Database::query($sql);
$h = '';
while ($row = Database::fetch_array($resultset)){
$id = $row['id'];
$title = $row['title'];
$nodeType = $row['node_type'];
$h .= '<div class="bloch5pLine bloch5pLine'.$id.'" onClick="selectH5Pbase(\''.$id.'\',\''.$nodeType.'\');" >'.$title.'</div>';
}
echo $h;
/* For license terms, see /license.txt */
/**
* Return HTML list for AJAX request
*/
require_once __DIR__.'/../../../../main/inc/global.inc.php';
if (api_is_anonymous()) {
header('Location: '.api_get_path(WEB_PATH).'index.php');
exit;
}
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$urlId = api_get_current_access_url_id();
$UrlWhere = "";
if (api_get_multiple_access_url()) {
$UrlWhere = " WHERE url_id = $urlId ";
}
$sql = "SELECT id,title,node_type FROM plugin_h5p $UrlWhere ORDER BY title";
$resultSet = Database::query($sql);
$html = '';
while ($row = Database::fetch_array($resultSet)) {
$id = $row['id'];
$title = $row['title'];
$nodeType = $row['node_type'];
$html .= '<div class="bloch5pLine bloch5pLine'.$id.'" onClick="selectH5Pbase(\''.$id.'\',\''.$nodeType.'\');" >'.$title.'</div>';
}
echo $html;

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 755 B

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Before

Width:  |  Height:  |  Size: 591 B

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 890 B

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -1,72 +0,0 @@
function getbyelem(n){
if(document.getElementById(n)){
var tagName = document.getElementById(n).tagName;
if(tagName=='SELECT'){
var get_id = document.getElementById(n);
var resultselect = get_id.options[get_id.selectedIndex].value;
//console.log(resultselect);
return resultselect;
}
if(tagName=='INPUT'){
return document.getElementById(n).value;
}
if(tagName=='TEXTAREA'){
var ct = document.getElementById(n).value;
ct = ct.replace('\n','<br />');
return ct;
}
}else{
return "-"
}
}
setTimeout(function(){ applikSelectDemo(); }, 500);
function applikSelectDemo(){
var textIconImg = getbyelem('dictionary_iconimg');
var textTitle = getbyelem('dictionary_title');
$("#icodemo").removeClass();
$("#icodemo").addClass(textIconImg);
$("#icodemo").addClass('document-vignette');
$("#titledemo").html(textTitle);
setTimeout(function(){ applikSelectDemo(); }, 500);
}
$(document).ready(function(){
var u = window.top.location.href;
if(u.indexOf('action=edit')==-1){
$("#dictionary").css("display","none");
var btn = '<a id="addElement" href="#" onClick="showEditFormulaire();" class="btn btn-success">';
btn += 'Créer un espace client</a><br><br>';
$("#dictionary").parent().prepend(btn);
}
$("#dictionary_listOfUsers").parent().parent().css("display","none");
});
function showEditFormulaire(){
$("#dictionary").css("display","");
$("#addElement").css("display","none");
}

@ -1,6 +1,9 @@
/* For licensing terms, see /license.txt */
console.log('h5p extras is active');
console.log('chamilo_h5p extras is active');
/**
* Find CKEditor's instance and add an H5P button to it
*/
function installInTinyH5p(){
if (window.jQuery) {
@ -15,7 +18,7 @@ function installInTinyH5p(){
gi += ' title="H5P insert" tabindex="-1" hidefocus="true" ';
gi += ' role="button" aria-labelledby="cke_50_label" ';
gi += ' aria-describedby="cke_50_description" aria-haspopup="false" >';
gi += '<span class="cke_button_icon" style="background-image:url(\''+ _p['web_plugin'] +'chamilo_h5p/resources/img/h5pchami.png\');">&nbsp;&nbsp;</span>';
gi += '<span class="cke_button_icon" style="background-image:url(\''+ _p['web_plugin'] +'h5p/resources/img/h5pchami.png\');">&nbsp;&nbsp;</span>';
gi += '<span id="cke_50_label" class="cke_button_label cke_button__source_label" aria-hidden="false"></span>';
gi += '<span id="cke_50_description" class="cke_button_label" aria-hidden="false"></span></a>';
$(".cke_button__source").after(gi);
@ -42,12 +45,18 @@ setTimeout(function(){installInTinyH5p();},600);
//#H5P:1#
/**
* Load H5P objects through CKEditor
*/
function loadExtrasObjectsH5p(){
insertExtrasObjectsH5p();
$(".cke_dialog_background_cover").css('display','block');
$("#extrasobjectH5p").css('display','block');
}
/**
* Insert H5P objects in the body of the area edited through CKEditor
*/
function insertExtrasObjectsH5p(){
if($(".cke_dialog_background_cover").length==0){
@ -61,6 +70,10 @@ function insertExtrasObjectsH5p(){
}
/**
* Generate the HTML to insert H5P objects in an HTML document
* @returns {string}
*/
function inExtrasObjectsH5p(){
var h = '';
@ -74,12 +87,18 @@ function inExtrasObjectsH5p(){
}
/**
* Visually remove H5P objects from CKEditor
*/
function closeExtrasH5p(){
$("#extrasobjectH5p").css('display','none');
$(".cke_dialog_background_cover").css('display','none');
}
/**
* Show the H5P options
*/
function showEditH5pLoad(){
$(".cke_dialog_background_cover").css('z-index','97');
@ -108,17 +127,20 @@ function showEditH5pLoad(){
}
/**
* Load (AJAX) the H5P node types
*/
function loadDataH5Pbase(){
$('.bloch5pGrid').html('<p style="text-align:center;" ><img src="' + _p['web_plugin'] + 'chamilo_h5p/resources/img/loadtable.gif" /></p>');
$('.bloch5pGrid').html('<p style="text-align:center;" ><img src="' + _p['web_plugin'] + 'h5p/resources/img/loadtable.gif" /></p>');
var urlpath = _p['web_plugin'] +'chamilo_h5p/resources/ajax/getnodes.php';
var urlpath = _p['web_plugin'] +'h5p/resources/ajax/getnodes.php';
$.ajax({
url : urlpath,cache : false
}).done(function(codeHtml){
var urlH5p = _p['web_plugin'] +'chamilo_h5p/node_list.php';
var urlH5p = _p['web_plugin'] +'h5p/list.php';
codeHtml += '<a target="_blank" href="'+urlH5p+'" onClick="closeExtrasH5p()" class="bloch5pAdd" >&nbsp;</a>';
@ -134,16 +156,24 @@ function loadDataH5Pbase(){
}
/**
* Select a type of node for the base element of an H5P object
* @param id
* @param node_type
*/
function selectH5Pbase(id,node_type){
$(".bloch5pLine").css("background-color","white").css("color","black");
$(".bloch5pLine" + id).css("background-color","#2575be").css("color","white");
var pgid = "chamilo_h5p/cache-h5p/launch/source-" + id + ".html?tn=" + node_type;
var pgid = "h5p/cache-h5p/launch/source-" + id + ".html?tn=" + node_type;
$("#inputSelH5PUrl").val(pgid);
}
/**
* Add an H5P object in CKEditor
*/
function addObjectH5PInCKEDITORByBase(){
var pg = $("#inputSelH5PUrl").val();
@ -172,4 +202,3 @@ function addObjectH5PInCKEDITORByBase(){
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -1,6 +0,0 @@
<div class="span12">
<div class="row">
{{h5p.form_option1 }}
</div>
</div>

@ -1,42 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
// http://localhost/chamilo-1.11.10/plugin/h5p
require_once __DIR__.'/../../main/inc/global.inc.php';
if(api_is_anonymous()){
header('Location: '.api_get_path(WEB_PATH));
}
$version = isset($_GET['version']) ? Security::remove_XSS($_GET['version']) : '';
$out = '<p>Chamilo H5P is Update : ';
if($version=='1-5'){
$inSql = "ALTER TABLE `plugin_chamilo_h5p` ADD `terms_d` VARCHAR(512) NOT NULL AFTER `terms_c`;";
Database::query($inSql);
$inSql = "ALTER TABLE `plugin_chamilo_h5p` ADD `terms_e` VARCHAR(512) NOT NULL AFTER `terms_d`;";
Database::query($inSql);
$inSql = "ALTER TABLE `plugin_chamilo_h5p` ADD `terms_f` VARCHAR(512) NOT NULL AFTER `terms_e`;";
Database::query($inSql);
$out .= ' version 1-5';
}
$out .= '</p>';
$out .= '<p><a class="btn btn-success" href="node_list.php" >View list of node</a></p>';
$tpl = new Template('Update H5P');
$tpl->assign('form', $out);
$content = $tpl->fetch('/chamilo_h5p/view/update-h5p.tpl');
$tpl->assign('content',$content);
$tpl->display_one_col_template();

@ -0,0 +1,34 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/../../main/inc/global.inc.php';
if (api_is_anonymous()) {
header('Location: '.api_get_path(WEB_PATH));
}
$version = isset($_GET['version']) ? Security::remove_XSS($_GET['version']) : '';
$out = '<p>Chamilo H5P is up to date: ';
if ($version == '1-5') {
$inSql = "ALTER TABLE plugin_h5p ADD terms_d VARCHAR(512) NOT NULL AFTER terms_c;";
Database::query($inSql);
$inSql = "ALTER TABLE plugin_h5p ADD terms_e VARCHAR(512) NOT NULL AFTER terms_d;";
Database::query($inSql);
$inSql = "ALTER TABLE plugin_h5p ADD terms_f VARCHAR(512) NOT NULL AFTER terms_e;";
Database::query($inSql);
$out .= ' version 1-5';
}
$out .= '</p>';
$out .= '<p><a class="btn btn-success" href="list.php" >View list of nodes</a></p>';
$tpl = new Template('Update H5P');
$tpl->assign('form', $out);
$content = $tpl->fetch('/h5p/view/update.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -23,23 +23,23 @@
{{ term.title }}
</td>
<td style="width:25%" >
{{ term.date_create }}
{{ term.creation_date }}
</td>
<td style="width:15%" >
<a href="{{ _p.web_plugin }}chamilo_h5p/node_process.php?action=edit&{{ {'id': term.id}|url_encode() }}&{{ {'node_type': term.node_type}|url_encode() }}"
<a href="{{ _p.web_plugin }}h5p/node_process.php?action=edit&{{ {'id': term.id}|url_encode() }}&{{ {'node_type': term.node_type}|url_encode() }}"
style="border:solid 1px #086A87;background:#086A87!important;color:white!important;" class="btn">
<span class="fa fa-eye fa-fw" aria-hidden="true"></span></a>
</td>
<td style="width:15%" >
<a href="{{ _p.web_plugin }}chamilo_h5p/node_list.php?action=edit&{{ {'id': term.id}|url_encode() }}&{{ {'node_type': term.node_type}|url_encode() }}"
<a href="{{ _p.web_plugin }}h5p/node_list.php?action=edit&{{ {'id': term.id}|url_encode() }}&{{ {'node_type': term.node_type}|url_encode() }}"
class="btn btn-success">
<span class="fa fa-edit fa-fw" aria-hidden="true"></span></a>
<a onclick="return confirm('Etes-vous sur ?')"
href="{{ _p.web_plugin }}chamilo_h5p/node_list.php?action=delete&{{ {'id': term.id}|url_encode() }}"
href="{{ _p.web_plugin }}h5p/node_list.php?action=delete&{{ {'id': term.id}|url_encode() }}"
class="btn btn-danger">
<span class="fa fa-times fa-fw" aria-hidden="true"></span></a>
Loading…
Cancel
Save