function view_user_gists($username) { $gists = github_user_gists($username); if (is_null($gists)) { http_response_code(400); exit; } view_header(); foreach ($gists as $gist) { view_link("{$gist->id}/", $gist->id); foreach ((array) $gist->files as $filename => $file) { view_break(); view_link("{$gist->id}/{$filename}", $filename); } view_break(); view_break(); } }
echo '<p align="center">' . get_string('viewed', 'certificate') . '<br />' . userdate($certrecord->certdate) . '</p>'; echo '<center>'; $opt = new stdclass(); $opt->id = $cm->id; $opt->action = 'review'; print_single_button('', $opt, $strreviewcertificate, 'get', 'certframe'); //TODO: not sure why this iframe is used - in FF it seems to operate the same as the create certificate below. - might be able to be removed? echo '<iframe name="certframe" id="certframe" frameborder="NO" border="0" style="width:90%;height:500px;border:0px;"></iframe>'; echo '</center>'; print_footer(NULL, $course); exit; } } elseif ($certrecord->certdate == 0) { ///Create certificate if (empty($action)) { view_header($course, $certificate, $cm); if ($certificate->delivery == 0) { echo '<p align="center">' . get_string('openwindow', 'certificate') . '</p>'; } elseif ($certificate->delivery == 1) { echo '<p align="center">' . get_string('opendownload', 'certificate') . '</p>'; } elseif ($certificate->delivery == 2) { echo '<p align="center">' . get_string('openemail', 'certificate') . '</p>'; } $opt = new stdclass(); $opt->id = $cm->id; $opt->action = 'get'; echo '<center>'; print_single_button('view.php', $opt, $strgetcertificate, 'get', '_blank'); echo '</center>'; add_to_log($course->id, 'certificate', 'received', "view.php?id={$cm->id}", $certificate->id, $cm->id); print_footer(NULL, $course);
} function view_header($header, $mailbox, $color) { sqgetGlobalVar('QUERY_STRING', $queryStr, SQ_SERVER); $ret_addr = SM_PATH . 'src/read_body.php?' . $queryStr; displayPageHeader($color, $mailbox); echo '<br />' . '<table width="100%" cellpadding="2" cellspacing="0" border="0" ' . 'align="center">' . "\n" . '<tr><td bgcolor="' . $color[9] . '" width="100%" align="center"><b>' . _("Viewing Full Header") . '</b> - ' . '<a href="'; echo_template_var($ret_addr); echo '">' . _("View message") . "</a></b></td></tr></table>\n"; echo_template_var($header, array('<table width="99%" cellpadding="2" cellspacing="0" border="0" ' . "align=center>\n" . '<tr><td>', '<nobr><tt><b>', '</b>', '</tt></nobr>', '</td></tr></table>' . "\n")); echo '</body></html>'; } /* get global vars */ if (sqgetGlobalVar('passed_id', $temp, SQ_GET)) { $passed_id = (int) $temp; } if (sqgetGlobalVar('mailbox', $temp, SQ_GET)) { $mailbox = $temp; } if (!sqgetGlobalVar('passed_ent_id', $passed_ent_id, SQ_GET)) { $passed_ent_id = ''; } sqgetGlobalVar('key', $key, SQ_COOKIE); sqgetGlobalVar('username', $username, SQ_SESSION); sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $mbx_response = sqimap_mailbox_select($imapConnection, $mailbox, false, false, true); $header = parse_viewheader($imapConnection, $passed_id, $passed_ent_id); view_header($header, $mailbox, $color); sqimap_logout($imapConnection);