protected function initialise_javascript($search) {
        global $USER, $PAGE, $OUTPUT;
        $output = '';

        // Put the options into the session, to allow search.php to respond to the ajax requests.
        $options = $this->get_options();
        $hash = md5(serialize($options));
        $USER->userselectors[$hash] = $options;

        // Initialise the selector.
        $PAGE->requires->js_init_call(
            'M.core_user.init_user_selector',
            array($this->name, $hash, $this->extrafields, $search),
            false,
            self::$jsmodule
        );
        return $output;
    }
protected function initialise_javascript($search) {
        global $USER, $PAGE, $OUTPUT;
        $output = '';

        // Put the options into the session, to allow search.php to respond to the ajax requests.
        $options = $this->get_options();
        $hash = md5(serialize($options));
        $USER->userselectors[$hash] = $options;

        // Initialise the selector.
        $PAGE->requires->js_init_call(
            'M.core_user.init_user_selector',
            array($this->name, $hash, $this->extrafields, $search),
            false,
            self::$jsmodule
        );
        return $output;
    }
protected function initialise_javascript ( $ search ) { global $ USER , $ PAGE , $ OUTPUT ; $ output = '' ; // Put the options into the session, to allow search.php to respond to the ajax requests. $ options = $ this -> get_options ( ) ; $ hash = md5 ( serialize ( $ options ) ) ; $ USER -> userselectors [ $ hash ] = $ options ; // Initialise the selector. $ PAGE -> requires -> js_init_call ( 'M.core_user.init_user_selector' , array ( $ this -> name , $ hash , $ this -> extrafields , $ search ) , false , self :: $ jsmodule ) ; return $ output ; }
Initialises JS for this control.

@param string $search
@return string any HTML needed here.
Initialises JS for this control .