diff --git a/classes/Pin/class.xlvoPin.php b/classes/Pin/class.xlvoPin.php index 049c528e..f82311c9 100644 --- a/classes/Pin/class.xlvoPin.php +++ b/classes/Pin/class.xlvoPin.php @@ -32,6 +32,20 @@ class xlvoPin { protected $pin_length = 4; + /** + * @param $obj_id + * @return int + */ + public static function lookupPin($obj_id) { + /** + * @var $xlvoVotingConfig xlvoVotingConfig + */ + $xlvoVotingConfig = xlvoVotingConfig::findOrGetInstance($obj_id); + + return $xlvoVotingConfig->getPin(); + } + + /** * @param $pin * @return int diff --git a/classes/class.ilObjLiveVotingListGUI.php b/classes/class.ilObjLiveVotingListGUI.php index 2e13ba1e..54ab3383 100644 --- a/classes/class.ilObjLiveVotingListGUI.php +++ b/classes/class.ilObjLiveVotingListGUI.php @@ -21,8 +21,11 @@ +-----------------------------------------------------------------------------+ */ -include_once "./Services/Repository/classes/class.ilObjectPluginListGUI.php"; +require_once('./Services/Repository/classes/class.ilObjectPluginListGUI.php'); require_once('./Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting/classes/QuestionTypes/class.xlvoQuestionTypes.php'); +require_once('./Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting/classes/Pin/class.xlvoPin.php'); +require_once('./Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting/classes/Voter/class.xlvoVoter.php'); +require_once('./Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting/classes/Player/class.xlvoPlayer.php'); /** * ListGUI implementation for LiveVoting object plugin. This one @@ -38,16 +41,27 @@ class ilObjLiveVotingListGUI extends ilObjectPluginListGUI { /** * Init type */ - function initType() { + public function initType() { $this->setType("xlvo"); - $this->copy_enabled = true; + $this->copy_enabled = false; + } + + + /** + * @param $a_status + * @return bool + */ + public function enableCopy($a_status) { + $this->copy_enabled = false; + + return false; } /** * Get name of gui class handling the commands */ - function getGuiClass() { + public function getGuiClass() { return "ilObjLiveVotingGUI"; } @@ -55,7 +69,7 @@ function getGuiClass() { /** * Get commands */ - function initCommands() { + public function initCommands() { return array( array( "permission" => "read", @@ -93,10 +107,22 @@ public function getCommandFrame($a_cmd) { * "property" (string) => property name * "value" (string) => property value */ - function getProperties() { + public function getProperties() { $props = array(); - $this->plugin->includeClass("class.ilObjLiveVotingAccess.php"); + // $props[] = array( + // "alert" => false, + // "property" => 'Online', + // "value" => xlvoVoter::count(xlvoPlayer::getInstanceForObjId($this->obj_id)), + // ); + // + // $props[] = array( + // "alert" => false, + // "property" => 'PIN', + // "value" => xlvoPin::lookupPin($this->obj_id), + // ); + + require_once('./Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting/classes/class.ilObjLiveVotingAccess.php'); if (!ilObjLiveVotingAccess::checkOnline($this->obj_id)) { $props[] = array( "alert" => true, diff --git a/js/Player/xlvoPlayer.js b/js/Player/xlvoPlayer.js index b1dbed0a..f9fd6902 100644 --- a/js/Player/xlvoPlayer.js +++ b/js/Player/xlvoPlayer.js @@ -191,6 +191,10 @@ var xlvoPlayer = { xlvoPlayer.counter++; if ((xlvoPlayer.counter > xlvoPlayer.forced_update_interval) || (data.player.last_update != xlvoPlayer.player.last_update) || (data.player.show_results != xlvoPlayer.player.show_results) || (data.player.status != xlvoPlayer.player.status) || (data.player.active_voting_id != xlvoPlayer.player.active_voting_id)) { $('#xlvo-display-player').html(data.player_html); + + // var player = document.getElementById('xlvo-display-player'); + // player.innerHTML = (data.player_html); + xlvoPlayer.counter = 0; } diff --git a/plugin.php b/plugin.php index a8e8f2f7..728cbc75 100644 --- a/plugin.php +++ b/plugin.php @@ -1,6 +1,6 @@