function definition() { global $CFG, $DB,$PAGE; $mform = $this->_form; $config = get_config('opencast'); //$PAGE->requires->yui_module('moodle-mod_opencast-events_select', 'M.mod_opencast.init_events_select', array(array('formid' => $mform->getAttribute('id')))); //------------------------------------------------------- $mform->addElement('header', 'general', get_string('general', 'form')); $mform->addElement('text', 'name', get_string('name'), array('size'=>'48')); if (!empty($CFG->formatstringstriptags)) { $mform->setType('name', PARAM_TEXT); } else { $mform->setType('name', PARAM_CLEANHTML); } $mform->addRule('name', null, 'required', null, 'client'); $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $events = get_eventslist(); $mform->addElement('select', 'eventid', get_string('events', 'opencast'), $events); //$mform->addElement('advcheckbox','iframedisplay',get_string('displayoption', 'opencast'), null,null,array(0, 1)); //------------------------------------------------------- $this->standard_coursemodule_elements(); //------------------------------------------------------- $this->add_action_buttons(); //------------------------------------------------------- $mform->addElement('hidden', 'revision'); $mform->setType('revision', PARAM_INT); $mform->setDefault('revision', 1); }
<?php ini_set('display_errors','on'); error_reporting(E_ALL); require_once('../../../config.php'); global $CFG; require_once $CFG->dirroot.'/mod/opencast/locallib.php'; require_once($CFG->dirroot.'/mod/opencast/opencast-client/client.php'); $options = get_eventslist(); print_object($options); // $opencast_client = new opencast_client("http://mh.moodlemenu.net:8080","matterhorn_system_account","opencast"); //$url = 'http://103.241.136.206:8080/users/users.json'; ////echo $opencast_client->prepAndSend($url); // //echo $events_response = $opencast_client->prepAndSend("http://103.241.136.206:8080/admin-ng/event/events.json"); //$events = json_decode($events_response); // //foreach($events->results as $event){ // $media_response = $opencast_client->prepAndSend("http://103.241.136.206:8080/admin-ng/event/$event->id/media.json"); // $media_list = json_decode($media_response); // echo $event->title.'<br />'; // foreach($media_list as $media){ // echo "<video width='320' height='240' controls> // <source src=$media->url type=$media->mimetype> // Your browser does not support the video tag. // </video><br />"; // } //} // //$reqBody = json_encode(array('username'=>'restuser','password'=>'opencast'));