public function user_rss_token_box($token) {
        global $OUTPUT, $CFG;

        // Display strings.
        $stroperation = get_string('operation', 'webservice');
        $strtoken = get_string('key', 'webservice');

        $return = $OUTPUT->heading(get_string('rss', 'rss'), 3, 'main', true);
        $return .= $OUTPUT->box_start('generalbox webservicestokenui');

        $return .= get_string('rsskeyshelp');

        $table = new html_table();
        $table->head  = array($strtoken, $stroperation);
        $table->align = array('left', 'center');
        $table->width = '100%';
        $table->data  = array();

        if (!empty($token)) {
            $reset = "<a href=\"".$CFG->wwwroot."/user/managetoken.php?sesskey=".sesskey().
                    "&amp;action=resetrsstoken\">".get_string('reset')."</a>";

            $table->data[] = array($token, $reset);

            $return .= html_writer::table($table);
        } else {
            $return .= get_string('notoken', 'webservice');
        }

        $return .= $OUTPUT->box_end();
        return $return;
    }
public function user_rss_token_box($token) {
        global $OUTPUT, $CFG;

        // Display strings.
        $stroperation = get_string('operation', 'webservice');
        $strtoken = get_string('key', 'webservice');

        $return = $OUTPUT->heading(get_string('rss', 'rss'), 3, 'main', true);
        $return .= $OUTPUT->box_start('generalbox webservicestokenui');

        $return .= get_string('rsskeyshelp');

        $table = new html_table();
        $table->head  = array($strtoken, $stroperation);
        $table->align = array('left', 'center');
        $table->width = '100%';
        $table->data  = array();

        if (!empty($token)) {
            $reset = "<a href=\"".$CFG->wwwroot."/user/managetoken.php?sesskey=".sesskey().
                    "&amp;action=resetrsstoken\">".get_string('reset')."</a>";

            $table->data[] = array($token, $reset);

            $return .= html_writer::table($table);
        } else {
            $return .= get_string('notoken', 'webservice');
        }

        $return .= $OUTPUT->box_end();
        return $return;
    }
public function user_rss_token_box ( $ token ) { global $ OUTPUT , $ CFG ; // Display strings. $ stroperation = get_string ( 'operation' , 'webservice' ) ; $ strtoken = get_string ( 'key' , 'webservice' ) ; $ return = $ OUTPUT -> heading ( get_string ( 'rss' , 'rss' ) , 3 , 'main' , true ) ; $ return .= $ OUTPUT -> box_start ( 'generalbox webservicestokenui' ) ; $ return .= get_string ( 'rsskeyshelp' ) ; $ table = new html_table ( ) ; $ table -> head = array ( $ strtoken , $ stroperation ) ; $ table -> align = array ( 'left' , 'center' ) ; $ table -> width = '100%' ; $ table -> data = array ( ) ; if ( ! empty ( $ token ) ) { $ reset = "<a href=\"" . $ CFG -> wwwroot . "/user/managetoken.php?sesskey=" . sesskey ( ) . "&amp;action=resetrsstoken\">" . get_string ( 'reset' ) . "</a>" ; $ table -> data [ ] = array ( $ token , $ reset ) ; $ return .= html_writer :: table ( $ table ) ; } else { $ return .= get_string ( 'notoken' , 'webservice' ) ; } $ return .= $ OUTPUT -> box_end ( ) ; return $ return ; }
Display a user token with buttons to reset it
@param string $token The token to be displayed
@return string html code
Display a user token with buttons to reset it