public function print_login() {
        $client = $this->get_user_oauth_client();
        $url = $client->get_login_url();

        if ($this->options['ajax']) {
            $popup = new stdClass();
            $popup->type = 'popup';
            $popup->url = $url->out(false);
            return array('login' => array($popup));
        } else {
            echo '<a target="_blank" href="'.$url->out(false).'">'.get_string('login', 'repository').'</a>';
        }
    }
public function print_login() {
        $client = $this->get_user_oauth_client();
        $url = $client->get_login_url();

        if ($this->options['ajax']) {
            $popup = new stdClass();
            $popup->type = 'popup';
            $popup->url = $url->out(false);
            return array('login' => array($popup));
        } else {
            echo '<a target="_blank" href="'.$url->out(false).'">'.get_string('login', 'repository').'</a>';
        }
    }
public function print_login ( ) { $ client = $ this -> get_user_oauth_client ( ) ; $ url = $ client -> get_login_url ( ) ; if ( $ this -> options [ 'ajax' ] ) { $ popup = new stdClass ( ) ; $ popup -> type = 'popup' ; $ popup -> url = $ url -> out ( false ) ; return array ( 'login' => array ( $ popup ) ) ; } else { echo '<a target="_blank" href="' . $ url -> out ( false ) . '">' . get_string ( 'login' , 'repository' ) . '</a>' ; } }
Print or return the login form.

@return void|array for ajax.
Print or return the login form .