Plugin: H5P: Cleanup and rewrite - refs #2667
@ -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/ |
||||
|
Before Width: | Height: | Size: 295 B |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 767 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 526 B |
|
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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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> ".$plugin->get_lang('Use')." </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,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 |
|
Before Width: | Height: | Size: 2.7 KiB |
|
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 |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 699 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 708 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
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 |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
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 +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(); |
||||