/** * Return the js params required for this module. * @return array of additional params to pass to javascript init function. */ function atto_binumi_params_for_js() { global $COURSE; //NOTE: the params used for the tinymce editor plugin and // the atto editor plugin are the same $client = new binumi_client(); $params = $client->get_texteditor_params(); return array('url' => $params['binumi_chooser_url'], 'mode' => 'popup'); }
protected function update_init_params(array &$params, context $context, array $options = null) { // 'binumi' is the key used in Moodle >= 2.5 $filters = filter_get_active_in_context($context); $enabled = array_key_exists('binumi', $filters); // If binumi filter is disabled, do not add button. if (!$enabled) { return; } $binumi_client = new binumi_client(); $params = $params + $binumi_client->get_texteditor_params(); $numrows = $this->count_button_rows($params); $this->add_button_after($params, $numrows, '|,binumi'); // Add JS file, which uses default name. $this->add_js_plugin($params); }
* * Binumi's block plugin * * @package block * @subpackage binumi * @copyright 2011 - 2015 Binumi Agency Hong Kong Limited. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * */ require_once "../../config.php"; require_once $CFG->dirroot . '/local/binumi/lib.php'; require_once 'binumi_client.class.php'; global $CFG, $DB; require_login(); $cid = required_param('cid', PARAM_INT); /** Navigation Bar **/ $PAGE->navbar->ignore_active(); $course = $DB->get_record('course', array('id' => $cid), '*', $strictness = IGNORE_MISSING); $PAGE->navbar->add($course->shortname, new moodle_url($CFG->wwwroot . '/course/view.php?id=' . $cid)); $PAGE->navbar->add(get_string('binumiportal', 'block_binumi')); $PAGE->set_url('/blocks/binumi/portal.php'); $PAGE->set_context(context_course::instance($cid)); $PAGE->set_heading(get_string('binumiportal', 'block_binumi')); $PAGE->set_title(get_string('binumiportal', 'block_binumi')); $client = new binumi_client(); $url = $client->get_siteurl() . '/lti/portal'; $src = $client->get_signed_url($url, $cid, $client->get_lti_params($course)); $outputhtml = '<iframe src="' . $src . '" frameborder=0 style="width:100%;height: 800px;border: none;"></iframe>'; echo $OUTPUT->header(); echo $outputhtml; echo $OUTPUT->footer();