forked from DatabayAG/InteractiveVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,961 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
<?php | ||
require_once './Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php'; | ||
/** | ||
* Class ilInteractiveVideoTimePicker | ||
*/ | ||
class ilInteractiveVideoTimePicker extends ilSubEnabledFormPropertyGUI | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $value; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $title; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $info; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* ilInteractiveVideoTimePicker constructor. | ||
* @param string $a_title | ||
* @param string $a_id | ||
*/ | ||
public function __construct($a_title = "", $a_id = "") | ||
{ | ||
parent::__construct($a_title, $a_id); | ||
$this->setTitle($a_title); | ||
$this->setId($a_id); | ||
$this->setType("interactive_video_time_picker"); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function checkInput() | ||
{ | ||
if(!is_array($_POST[$this->getPostVar()])) | ||
{ | ||
$_POST[$this->getPostVar()] = $this->getSecondsFromString(ilUtil::stripSlashes($_POST[$this->getPostVar()])); | ||
} | ||
return $this->checkSubItemsInput(); | ||
} | ||
|
||
/** | ||
* @param $a_value | ||
*/ | ||
public function setValue($a_value) | ||
{ | ||
$this->value = $a_value; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @param string $id | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
|
||
protected function appendJavascriptAndHTML() | ||
{ | ||
/** | ||
* @var ilTemplate $tpl | ||
*/ | ||
global $tpl; | ||
|
||
$tpl->addCss('Customizing/global/plugins/Services/Repository/RepositoryObject/InteractiveVideo/libs/bootstrap-timepicker/css/bootstrap-timepicker.css'); | ||
$tpl->addJavaScript('Customizing/global/plugins/Services/Repository/RepositoryObject/InteractiveVideo/libs/bootstrap-timepicker/js/bootstrap-timepicker.min.js'); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function render() | ||
{ | ||
$this->appendJavascriptAndHTML(); | ||
$my_tpl = new ilTemplate('tpl.time_picker.html', true, true, 'Customizing/global/plugins/Services/Repository/RepositoryObject/InteractiveVideo/'); | ||
$value = $this->getValue(); | ||
$my_tpl->setVariable("VALUE", $this->getTimeStringFromSeconds($value)); | ||
$my_tpl->setVariable("ID", $this->getId()); | ||
|
||
return $my_tpl->get(); | ||
} | ||
|
||
/** | ||
* @param ilTemplate $a_tpl | ||
*/ | ||
public function insert($a_tpl) | ||
{ | ||
$a_tpl->setCurrentBlock("prop_generic"); | ||
$a_tpl->setVariable("PROP_GENERIC", $this->render()); | ||
$a_tpl->parseCurrentBlock(); | ||
} | ||
|
||
/** | ||
* @param $a_values | ||
*/ | ||
public function setValueByArray($a_values) | ||
{ | ||
if ($this->getPostVar() && isset($a_values[$this->getPostVar()])) | ||
{ | ||
$this->setValue($a_values[$this->getPostVar()]); | ||
} | ||
foreach($this->getSubItems() as $item) | ||
{ | ||
$item->setValueByArray($a_values); | ||
} | ||
} | ||
|
||
/** | ||
* @param string $comment_time | ||
* @return int | ||
*/ | ||
public static function getSecondsFromString($comment_time) | ||
{ | ||
$seconds = 0; | ||
$comment_time = preg_split('/:/', $comment_time); | ||
if(sizeof($comment_time) == 3) | ||
{ | ||
$seconds = ((int)$comment_time[0] * 3600) + ((int)$comment_time[1] * 60) + (int)$comment_time[2]; | ||
} | ||
return $seconds; | ||
} | ||
|
||
/** | ||
* @param $seconds | ||
* @return false|string | ||
*/ | ||
public static function getTimeStringFromSeconds($seconds) | ||
{ | ||
return gmdate('H:i:s', $seconds); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* @author Michael Jansen <[email protected]> | ||
* @ilCtrl_Calls ilInteractiveVideoLearningProgressGUI: ilLearningProgressGUI, ilInteractiveVideoLPSummaryTableGUI, ilInteractiveVideoLPUsersTableGUI | ||
*/ | ||
class ilInteractiveVideoLearningProgressGUI | ||
class ilInteractiveVideoLearningProgressGUI extends ilLearningProgressBaseGUI | ||
{ | ||
//TODO: PRECONDITON HANDLING | ||
/** | ||
|
@@ -217,7 +217,7 @@ public function showLPUsers() | |
|
||
$this->gui->getPluginInstance()->includeClass('class.ilInteractiveVideoLPUsersTableGUI.php'); | ||
$table = new ilInteractiveVideoLPUsersTableGUI($this, 'showLPUsers', $this->object->getId(), $this->object->getRefId(), false); | ||
$this->tpl->setContent(implode('<br />', array($table->getHTML(), ilLearningProgressBaseGUI::__getLegendHTML()))); | ||
$this->tpl->setContent(implode('<br />', array($table->getHTML(), $this->__getLegendHTML()))); | ||
} | ||
|
||
/** | ||
|
@@ -237,7 +237,7 @@ public function showLPSummary() | |
|
||
$this->gui->getPluginInstance()->includeClass('class.ilInteractiveVideoLPSummaryTableGUI.php'); | ||
$table = new ilInteractiveVideoLPSummaryTableGUI($this, 'showLPSummary', $this->object->getRefId(), $this->gui->getPluginInstance()); | ||
$this->tpl->setContent(implode('<br />', array($table->getHTML(), ilLearningProgressBaseGUI::__getLegendHTML()))); | ||
$this->tpl->setContent(implode('<br />', array($table->getHTML(), $this->__getLegendHTML()))); | ||
} | ||
|
||
public function showLPUserDetails() | ||
|
@@ -279,7 +279,7 @@ public function showLPUserDetails() | |
$info->addProperty($this->lng->txt('trac_comment'),$comment); | ||
} | ||
|
||
$this->tpl->setContent(implode('<br />', array($info->getHTML(), ilLearningProgressBaseGUI::__getLegendHTML()))); | ||
$this->tpl->setContent(implode('<br />', array($info->getHTML(), $this->__getLegendHTML()))); | ||
} | ||
|
||
/** | ||
|
Oops, something went wrong.