Пример #1
0
/**
 * 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');
}
Пример #2
0
 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);
 }