function block_exabis_eportfolio_print_extern_item($item, $access) { global $CFG; print_heading(format_string($item->name)); $box_content = ''; if ($item->type == 'link') { $link = clean_param($item->url, PARAM_URL); $link_js = str_replace('http://', '', $link); if ($link) { $box_content .= '<p><a href="#" onclick="window.open(\'http://' . addslashes_js($link_js) . '\',\'validate\',\'width=620,height=450,scrollbars=yes,status=yes,resizable=yes,menubar=yes,location=yes\');return true;">' . $link . '</a></p>'; } } elseif ($item->type == 'file') { if ($item->attachment) { $type = mimeinfo("type", $item->attachment); $ffurl = "{$CFG->wwwroot}/blocks/exabis_eportfolio/portfoliofile.php?access=" . $access . "&itemid=" . $item->id; if (in_array($type, array('image/gif', 'image/jpeg', 'image/png'))) { // Image attachments don't get printed as links $box_content .= "<img width=\"100%\" src=\"{$ffurl}\" alt=\"" . format_string($item->name) . "\" /><br/>"; } else { $box_content .= "<p>" . link_to_popup_window("{$ffurl}", 'popup', "{$ffurl}", $height = 400, $width = 500, format_string($item->name), 'none', true) . "</p>"; } } } $box_content .= format_text($item->intro, FORMAT_HTML); print_box($box_content); }
function rejudge_showresult($success = true) { print_header(get_string('notice')); if ($success) { $message = get_string('rejudgesuccess', 'assignment_onlinejudge'); } else { $message = get_string('rejudgefailed', 'assignment_onlinejudge'); } print_box($message, 'generalbox', 'notice'); close_window_button(); print_footer('none'); }
function apply($discussion, $all, $selected, $formdata) { global $COURSE, $USER, $CFG; // Begin with standard text $a = (object) array('name' => fullname($USER, true)); $allhtml = "<head>"; foreach ($CFG->stylesheets as $stylesheet) { $allhtml .= '<link rel="stylesheet" type="text/css" href="' . $stylesheet . '" />' . "\n"; } $allhtml .= "</head>\n<body id='forumng-email'>\n"; $preface = get_string('forward_preface', 'forumng', $a); $allhtml .= $preface; $alltext = format_text_email($preface, FORMAT_HTML); // Include intro if specified if (!preg_match('~^(<br[^>]*>|<p>|</p>|\\s)*$~', $formdata->message)) { $alltext .= "\n" . forum_cron::EMAIL_DIVIDER . "\n"; $allhtml .= '<hr size="1" noshade="noshade" />'; // Add intro $message = trusttext_strip(stripslashes($formdata->message)); $allhtml .= format_text($message, $formdata->format); $alltext .= format_text_email($message, $formdata->format); } // Get list of all post ids in discussion order $alltext .= "\n" . forum_cron::EMAIL_DIVIDER . "\n"; $allhtml .= '<hr size="1" noshade="noshade" />'; $poststext = ''; $postshtml = ''; $discussion->build_selected_posts_email($selected, $poststext, $postshtml); $alltext .= $poststext; $allhtml .= $postshtml . '</body>'; $emails = preg_split('~[; ]+~', $formdata->email); $subject = stripslashes($formdata->subject); foreach ($emails as $email) { $fakeuser = (object) array('email' => $email, 'mailformat' => 1, 'id' => 0); $from = $USER; $from->maildisplay = 999; // Nasty hack required for OU moodle if (!email_to_user($fakeuser, $from, $subject, $alltext, $allhtml)) { print_error('error_forwardemail', 'forumng', $formdata->email); } } // Log that it was sent $discussion->log('forward discussion', $formdata->email); if (!empty($formdata->ccme)) { if (!email_to_user($USER, $from, $subject, $alltext, $allhtml)) { print_error('error_forwardemail', 'forumng', $USER->email); } } $discussion->print_subpage_header($this->get_page_name()); print_box(get_string('forward_done', 'forumng')); print_continue('../../discuss.php?' . $discussion->get_link_params(forum::PARAM_PLAIN)); print_footer($COURSE); }
if (!get_user_preferences('message_usehtmleditor', 0)) { $CFG->htmleditor = ''; } $msgform = new user_message_form('user_bulk_message.php'); if ($msgform->is_cancelled()) { redirect($return); } else { if ($formdata = $msgform->get_data()) { $options = new object(); $options->para = false; $options->newlines = true; $options->smiley = false; $msg = format_text($formdata->messagebody, $formdata->format, $options); $in = implode(',', $SESSION->bulk_users); $userlist = $DB->get_records_select_menu('user', "id IN ({$in})", null, 'fullname', 'id,' . $DB->sql_fullname() . ' AS fullname'); $usernames = implode(', ', $userlist); $optionsyes = array(); $optionsyes['confirm'] = 1; $optionsyes['sesskey'] = sesskey(); $optionsyes['msg'] = $msg; admin_externalpage_print_header(); print_heading(get_string('confirmation', 'admin')); print_box($msg, 'boxwidthnarrow boxaligncenter generalbox', 'preview'); notice_yesno(get_string('confirmmessage', 'bulkusers', $usernames), 'user_bulk_message.php', 'user_bulk.php', $optionsyes, NULL, 'post', 'get'); admin_externalpage_print_footer(); die; } } admin_externalpage_print_header(); $msgform->display(); admin_externalpage_print_footer();
$firstscorm = current($scorms); if (!($course->format == 'scorm' && $firstscorm->id == $scorm->id)) { $navlinks[] = array('name' => $strscorms, 'link' => "index.php?id={$course->id}", 'type' => 'activity'); } } } $pagetitle = strip_tags($course->shortname . ': ' . format_string($scorm->name)); add_to_log($course->id, 'scorm', 'pre-view', 'view.php?id=' . $cm->id, "{$scorm->id}"); if (has_capability('mod/scorm:skipview', get_context_instance(CONTEXT_MODULE, $cm->id)) && scorm_simple_play($scorm, $USER)) { exit; } // // Print the page header // $navlinks = array(); $navlinks[] = array('name' => format_string($scorm->name, true), 'link' => "view.php?id={$cm->id}", 'type' => 'activityinstance'); $navigation = build_navigation($navlinks); print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm)); if (has_capability('mod/scorm:viewreport', $context)) { $trackedusers = scorm_get_count_users($scorm->id, $cm->groupingid); if ($trackedusers > 0) { echo "<div class=\"reportlink\"><a {$CFG->frametarget} href=\"report.php?id={$cm->id}\"> " . get_string('viewalluserreports', 'scorm', $trackedusers) . '</a></div>'; } else { echo '<div class="reportlink">' . get_string('noreports', 'scorm') . '</div>'; } } // Print the main part of the page print_heading(format_string($scorm->name)); print_box(format_text($scorm->summary), 'generalbox', 'intro'); scorm_view_display($USER, $scorm, 'view.php?id=' . $cm->id, $cm); print_footer($course);
} $table->data[] = array($stats->count, number_format($stats->mean * $workshop->gradinggrade / 100, 1), number_format($stats->stddev * $workshop->gradinggrade / 100, 1), number_format($stats->max * $workshop->gradinggrade / 100, 1), number_format($stats->min * $workshop->gradinggrade / 100, 1)); echo '<tr><td>'; print_heading(get_string("gradinggrade", "workshop") . " " . get_string("analysis", "workshop")); print_table($table); echo '</td></tr>'; if ($workshop->showleaguetable and time() > $workshop->assessmentend) { workshop_print_league_table($workshop); if ($workshop->anonymous) { echo "<p>" . get_string("namesnotshowntostudents", "workshop", $course->students) . "</p>\n"; } } echo '</table>'; } elseif ($action == 'showdescription') { workshop_print_assignment_info($workshop); print_box(format_text($workshop->description, $workshop->format), 'generalbox', 'intro'); if (isset($_SERVER["HTTP_REFERER"])) { print_continue(htmlentities($_SERVER["HTTP_REFERER"])); } else { print_continue("{$CFG->wwwroot}/course/view.php?id={$cm->id}"); } } elseif ($action == 'allsubmissions') { require_capability('mod/workshop:manage', $context); if ($submissions = get_records('workshop_submissions', 'workshopid', $workshop->id)) { foreach ($submissions as $submission) { $user = get_record('user', 'id', $submission->userid); print_heading('"' . $submission->title . '" ' . get_string('by', 'workshop') . ' ' . fullname($user)); workshop_print_submission($workshop, $submission); } } } else {
<?php //$Id$ ///This file only manages the installation of 1.6 lang packs. ///in downloads.moodle.org, they are store in separate directory /lang16 ///in local server, they are stored in $CFG->dataroot/lang ///This helps to avoid confusion. require_once '../config.php'; require_once $CFG->libdir . '/adminlib.php'; require_once $CFG->libdir . '/filelib.php'; require_once $CFG->libdir . '/componentlib.class.php'; admin_externalpage_setup('langimport'); if (!empty($CFG->skiplangupgrade)) { admin_externalpage_print_header(); print_box(get_string('langimportdisabled', 'admin')); print_footer(); die; } $mode = optional_param('mode', 0, PARAM_INT); //phase $pack = optional_param('pack', array(), PARAM_FILE); //pack to install $displaylang = $pack; $uninstalllang = optional_param('uninstalllang', '', PARAM_FILE); $confirm = optional_param('confirm', 0, PARAM_BOOL); $sitelang = optional_param('sitelangconfig', '', PARAM_FILE); define('INSTALLATION_OF_SELECTED_LANG', 2); define('DELETION_OF_SELECTED_LANG', 4); define('UPDATE_ALL_LANG', 5); $strlang = get_string('langimport', 'admin'); $strlanguage = get_string('language');
$sql = 'SELECT id, firstname, lastname, email FROM ' . $CFG->prefix . 'user u WHERE deleted = 0 AND confirmed = 1 AND mnethostid = ' . $CFG->mnet_localhost_id . ' ' . $select . 'ORDER BY lastname ASC, firstname ASC'; $availableusers = get_recordset_sql($sql, 0, MAX_USERS_PER_PAGE); /// Print the page /// get language strings $str = get_strings(array('enrolmentplugins', 'configuration', 'users', 'administration')); /// Get some language strings $strpotentialusers = get_string('potentialusers', 'role'); $strexistingusers = get_string('existingusers', 'role'); $straction = get_string('assignroles', 'role'); $strroletoassign = get_string('roletoassign', 'role'); $strcurrentcontext = get_string('currentcontext', 'role'); $strsearch = get_string('search'); $strshowall = get_string('showall'); $strparticipants = get_string('participants'); $strsearchresults = get_string('searchresults'); admin_externalpage_print_header(); print_box('<strong>' . s($mnet_peer->name) . ' : ' . format_string($course->shortname) . ' ' . format_string($course->fullname) . '</strong><br />' . get_string("enrolcourseenrol_desc", "mnet")); echo "<hr />"; include dirname(__FILE__) . '/enr_course_enrol.html'; if (!empty($errors)) { $msg = '<p>'; foreach ($errors as $e) { $msg .= $e . '<br />'; } $msg .= '</p>'; notify($msg); } admin_externalpage_print_footer();
echo ' '; } echo '</p>'; if (!empty($showall)) { forum_print_latest_discussions($course, $forum, 0, 'header', '', -1, -1, -1, 0, $cm); } else { forum_print_latest_discussions($course, $forum, -1, 'header', '', -1, -1, $page, $CFG->forum_manydiscussions, $cm); } break; case 'teacher': if (!empty($showall)) { forum_print_latest_discussions($course, $forum, 0, 'header', '', -1, -1, -1, 0, $cm); } else { forum_print_latest_discussions($course, $forum, -1, 'header', '', -1, -1, $page, $CFG->forum_manydiscussions, $cm); } break; default: if (!empty($forum->intro)) { $options = new stdclass(); $options->para = false; print_box(format_text($forum->intro, FORMAT_MOODLE, $options), 'generalbox', 'intro'); } echo '<br />'; if (!empty($showall)) { forum_print_latest_discussions($course, $forum, 0, 'header', '', -1, -1, -1, 0, $cm); } else { forum_print_latest_discussions($course, $forum, -1, 'header', '', -1, -1, $page, $CFG->forum_manydiscussions, $cm); } break; } print_footer($course);
// Explain print_box(get_string('ssoacldescr', 'mnet')); // Are the needed bits enabled? $warn = ''; if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') { $warn = '<p>' . get_string('mnetdisabled', 'mnet') . '</p>'; } if (!is_enabled_auth('mnet')) { $warn .= '<p>' . get_string('authmnetdisabled', 'mnet') . '</p>'; } if (get_config('auth/mnet', 'auto_add_remote_users') != true) { $warn .= '<p>' . get_string('authmnetautoadddisabled', 'mnet') . '</p>'; } if (!empty($warn)) { $warn = '<p>' . get_string('ssoaclneeds', 'mnet') . '</p>' . $warn; print_box($warn); } // output the ACL table $columns = array("username", "mnet_host_id", "access", "delete"); $headings = array(); $string = array('username' => get_string('username'), 'mnet_host_id' => get_string('remotehost', 'mnet'), 'access' => get_string('accesslevel', 'mnet'), 'delete' => get_string('delete')); foreach ($columns as $column) { if ($sort != $column) { $columnicon = ""; $columndir = "ASC"; } else { $columndir = $dir == "ASC" ? "DESC" : "ASC"; $columnicon = $dir == "ASC" ? "down" : "up"; $columnicon = " <img src=\"{$CFG->pixpath}/t/{$columnicon}.gif\" alt=\"\" />"; } $headings[$column] = "<a href=\"?sort={$column}&dir={$columndir}&\">" . $string[$column] . "</a>{$columnicon}";
$jsdescription = addslashes_js(trim(format_text($groups[$gpid]->description))); if (empty($jsdescription)) { $line[] = $name; } else { $jsstrdescription = addslashes_js($strdescription); $overlib = "return overlib('{$jsdescription}', BORDER, 0, FGCLASS, 'description', " . "CAPTIONFONTCLASS, 'caption', CAPTION, '{$jsstrdescription}');"; $line[] = '<span onmouseover="' . s($overlib) . '" onmouseout="return nd();">' . $name . '</span>'; } $fullnames = array(); foreach ($users as $user) { $fullnames[] = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&course=' . $course->id . '">' . fullname($user, true) . '</a>'; } $line[] = implode(', ', $fullnames); $line[] = count($users); $table->data[] = $line; } if ($groupid and empty($table->data)) { continue; } if (!empty($CFG->enablegroupings)) { if ($gpgid < 0) { print_heading($strnotingrouping, '', 3); } else { print_heading(format_string($groupings[$gpgid]->name), '', 3); print_box(format_text($groupings[$gpgid]->description), 'generalbox boxwidthnarrow boxaligncenter'); } } print_table($table, false); $printed = true; } print_footer($course);
/** * Print a message and exit. * * @uses $CFG * @param string $message ? * @param string $link ? * @todo Finish documenting this function */ function notice($message, $link = '', $course = NULL) { global $CFG, $SITE, $THEME, $COURSE, $PAGE; $message = clean_text($message); // In case nasties are in here if (CLI_SCRIPT) { // notices in cron should be mtrace'd. mtrace($message); die; } if (!$PAGE->headerprinted) { //header not yet printed print_header(get_string('notice')); } else { print_container_end_all(false, $THEME->open_header_containers); } print_box($message, 'generalbox', 'notice'); print_continue($link); if (empty($course)) { print_footer($COURSE); } else { print_footer($course); } exit; }
print_box($stroutofattempts, 'center'); } elseif ($key == $preferences['newemailkey']) { $olduser = clone $user; cancel_email_update($user->id); $user->email = $preferences['newemail']; // Detect duplicate before saving if (get_record('user', 'email', addslashes($user->email))) { $stremailnowexists = get_string('auth_emailnowexists', 'auth'); print_box($stremailnowexists, 'center'); print_continue("{$CFG->wwwroot}/user/view.php?id={$user->id}"); } else { // update user email if (!set_field('user', 'email', addslashes($user->email), 'id', $user->id)) { error('Error updating user record'); } else { $authplugin = get_auth_plugin($user->auth); $authplugin->user_update($olduser, $user); events_trigger('user_updated', $user); $a->email = $user->email; $stremailupdatesuccess = get_string('auth_emailupdatesuccess', 'auth', $a); print_box($stremailupdatesuccess, 'center'); print_continue("{$CFG->wwwroot}/user/view.php?id={$user->id}"); } } } else { $preferences['newemailattemptsleft']--; set_user_preference('newemailattemptsleft', $preferences['newemailattemptsleft'], $user->id); $strinvalidkey = get_string('auth_invalidnewemailkey', 'auth'); print_box($strinvalidkey, 'center'); } print_footer('none');
$head = $gXpLang['add_affiliate']; } else { $head = $gXpLang['account_status'] . ' : '; $head .= '<span style="text-transform: capitalize;">'; switch ($account['approved']) { case 1: $head .= $gXpLang['status_pending']; break; case 2: $head .= $gXpLang['status_approved']; break; default: $head .= $gXpLang['status_disapproved']; } $head .= '</span>'; print_box(0, $head); } // echo $head; ?> <!-- </div>--> <table class="admintable"> <tbody><tr> <td valign="top" width="60%"> <table class="adminform"> <tbody> <tr> <th colspan="2"><?php echo $gXpLang['affiliate_personal_details']; ?> </th>
<br /> <?php print_box($error, $msg); $commission = $gXpAdmin->getCommissionById($_GET['id']); $aff = $gXpAdmin->getAffiliateById($commission['aff_id']); ?> <form action="manage-commission.php<?php echo $user > 0 ? "?user="******""; ?> " method="post" name="adminForm"> <?php if (!$msg) { print_box(0, $user > 0 ? '' : $gXpLang['commission_status_approval']); ?> <table class="admintable"> <tbody><tr> <td valign="top" width="60%"> <fieldset style="width:384px;border:1px solid #e9e9e9;padding:0px 0px 10px 10px;margin:10px 0px 10px 0px;"> <legend style="border:1px solid #e9e9e9;font:bold 12px arial;color:#333;padding:3px;"><?php echo $gXpLang['commission_details']; ?> </legend> <table class="adminform"> <tbody> <tr> <td width="100"><?php
$requireds = get_records('qcreate_required', 'qcreateid', $qcreate->id, 'qtype', 'qtype, no, id'); $modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id); require_login($COURSE->id); require_capability('mod/qcreate:grade', $modulecontext); add_to_log($COURSE->id, "qcreate", "overview", "overview.php?id={$cm->id}", "{$qcreate->id}"); /// Print the page header $strqcreates = get_string("modulenameplural", "qcreate"); $strqcreate = get_string("modulename", "qcreate"); $navlinks = array(); $navlinks[] = array('name' => $strqcreates, 'link' => "index.php?id={$COURSE->id}", 'type' => 'activity'); $navlinks[] = array('name' => format_string($qcreate->name), 'link' => '', 'type' => 'activityinstance'); $navigation = build_navigation($navlinks); print_header_simple(format_string($qcreate->name), "", $navigation, "", "", true, update_module_button($cm->id, $COURSE->id, $strqcreate), navmenu($COURSE, $cm)); $mode = 'overview'; include 'tabs.php'; print_box(format_text($qcreate->intro, $qcreate->introformat), 'generalbox', 'intro'); $qcreatetime = new object(); $qcreatetime->timeopen = userdate($qcreate->timeopen); $qcreatetime->timeclose = userdate($qcreate->timeclose); /* if ($qcreate->timeopen == 0 AND $qcreate->timeclose ==0 ){ $timestring = get_string('timenolimit', 'qcreate'); } else if ($qcreate->timeopen != 0 AND $qcreate->timeclose ==0 ) { $timestring = get_string('timeopen', 'qcreate', $qcreatetime); } else if ($qcreate->timeopen == 0 AND $qcreate->timeclose !=0 ) { $timestring = get_string('timeclose', 'qcreate', $qcreatetime); } else { $timestring = get_string('timeopenclose', 'qcreate', $qcreatetime); }*/ $timestring = qcreate_time_status($qcreate); if ($qcreate->graderatio == 100) {
} //Get html code for RSS link $row[] = rss_get_link($course->id, $userid, "forum", $forum->id, $tooltiptext); } $learningtable->data[] = $row; } } } /// Output the page $navlinks = array(); $navlinks[] = array('name' => $strforums, 'link' => '', 'type' => 'activity'); print_header("{$course->shortname}: {$strforums}", $course->fullname, build_navigation($navlinks), "", "", true, $searchform, navmenu($course)); if (!isguest()) { print_box_start('subscription'); echo '<span class="helplink">'; echo '<a href="index.php?id=' . $course->id . '&subscribe=1">' . get_string('allsubscribe', 'forum') . '</a>'; echo '</span><br /><span class="helplink">'; echo '<a href="index.php?id=' . $course->id . '&subscribe=0">' . get_string('allunsubscribe', 'forum') . '</a>'; echo '</span>'; print_box_end(); print_box(' ', 'clearer'); } if ($generalforums) { print_heading(get_string("generalforums", "forum")); print_table($generaltable); } if ($learningforums) { print_heading(get_string("learningforums", "forum")); print_table($learningtable); } print_footer($course);
$tojoincount = count($questionnamestojoin); if ($tojoincount > 1) { $a = new object(); $a->one = $questionnamestojoin[$tojoincount - 2] . '"</strong>'; $a->two = '<strong>"' . $questionnamestojoin[$tojoincount - 1]; $questionnamestojoin[$tojoincount - 2] = get_string('and', '', $a); unset($questionnamestojoin[$tojoincount - 1]); } $questionsstr->questions = '<strong>"' . join($questionnamestojoin, '"</strong>, <strong>"') . '"</strong>'; if (count($urls)) { $defaults = array(); for ($default_key = 0; $default_key < count($urls); $default_key++) { switch ($tocoursefilesid) { case SITEID: $defaults['urls'][$default_key] = QUESTION_FILEMOVE; break; default: $defaults['urls'][$default_key] = QUESTION_FILECOPY; break; } } $contextmoveform->set_data($defaults); //some parameters for get_string $questionsstr->urlcount = count($urls); $questionsstr->toareaname = $toareaname; print_box(get_string('movingquestionsandfiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox'); } else { print_box(get_string('movingquestionsnofiles', 'question', $questionsstr), 'boxwidthnarrow boxaligncenter generalbox'); } $contextmoveform->display(); print_footer($COURSE);
// echo '<input class="feedback_movehere_button" title="'.get_string('move_here','feedback').'" type="image" src="'.$CFG->pixpath .'/movehere.gif" />'; // echo '<input type="hidden" name="movehere" value="'.$moveposition.'" />'; // feedback_edit_print_default_form_values($id, $do_show); // echo '</fieldset></form>'; echo '</td>'; echo '</tr>'; } else { echo '<tr><td> </td></tr>'; } } echo '</table>'; // print_simple_box_end(); print_box_end(); } else { // print_simple_box(get_string('no_items_available_yet','feedback'),"center"); print_box(get_string('no_items_available_yet', 'feedback'), 'generalbox boxaligncenter'); } } /// Finish the page /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// print_footer($course); function feedback_edit_get_default_query($id, $tab) { global $USER; $query = 'id=' . $id; $query .= '&do_show=' . $tab; //$query .= '&sesskey='.sesskey(); return $query; }
/** * Print lock pre-requisites message * * @param object $page Format page object * @return void **/ public static function print_lock_prerequisites($page) { $lockinfo = self::decode($page->locks); if ($lockinfo['showprereqs']) { $locks = self::get_locks(); $messages = array(); foreach ($lockinfo['locks'] as $lock) { if ($locks[$lock['type']]->locked($lock)) { $messages[] = $locks[$lock['type']]->get_prerequisite($lock); } } $messages = '<ul><li>' . implode('</li><li>', $messages) . '</li></ul>'; $message = get_string('prereqsmessage', 'format_page', $messages); } else { $message = get_string('pageislocked', 'format_page'); } print_box($message, 'generalbox', 'pagelock'); }
/** * Prints the tag search results * * @param string $query text that tag names will be matched against * @param int $page current page * @param int $perpage nr of users displayed per page * @param $return if true return html string */ function tag_print_search_results($query, $page, $perpage, $return = false) { global $CFG, $USER; $query = array_shift(tag_normalize($query, TAG_CASE_ORIGINAL)); $count = sizeof(tag_find_tags($query, false)); $tags = array(); if ($found_tags = tag_find_tags($query, true, $page * $perpage, $perpage)) { $tags = array_values($found_tags); } $baseurl = $CFG->wwwroot . '/tag/search.php?query=' . rawurlencode($query); $output = ''; // link "Add $query to my interests" $addtaglink = ''; if (!tag_record_tagged_with('user', $USER->id, $query)) { $addtaglink = '<a href="' . $CFG->wwwroot . '/tag/user.php?action=addinterest&sesskey=' . sesskey() . '&tag=' . rawurlencode($query) . '">'; $addtaglink .= get_string('addtagtomyinterests', 'tag', htmlspecialchars($query)) . '</a>'; } if (!empty($tags)) { // there are results to display!! $output .= print_heading(get_string('searchresultsfor', 'tag', htmlspecialchars($query)) . " : {$count}", '', 3, 'main', true); //print a link "Add $query to my interests" if (!empty($addtaglink)) { $output .= print_box($addtaglink, 'box', 'tag-management-box', true); } $nr_of_lis_per_ul = 6; $nr_of_uls = ceil(sizeof($tags) / $nr_of_lis_per_ul); $output .= '<ul id="tag-search-results">'; for ($i = 0; $i < $nr_of_uls; $i++) { $output .= '<li>'; foreach (array_slice($tags, $i * $nr_of_lis_per_ul, $nr_of_lis_per_ul) as $tag) { $tag_link = ' <a href="' . $CFG->wwwroot . '/tag/index.php?id=' . $tag->id . '">' . tag_display_name($tag) . '</a>'; $output .= '•' . $tag_link . '<br/>'; } $output .= '</li>'; } $output .= '</ul>'; $output .= '<div> </div>'; // <-- small layout hack in order to look good in Firefox $output .= print_paging_bar($count, $page, $perpage, $baseurl . '&', 'page', false, true); } else { //no results were found!! $output .= print_heading(get_string('noresultsfor', 'tag', htmlspecialchars($query)), '', 3, 'main', true); //print a link "Add $query to my interests" if (!empty($addtaglink)) { $output .= print_box($addtaglink, 'box', 'tag-management-box', true); } } if ($return) { return $output; } else { echo $output; } }
$buttons = array(0 => array('name' => 'create', 'img' => $gXpConfig['xpurl'] . 'admin/images/new_f2.gif', 'text' => $gXpLang['create'])); $admins = $gXpAdmin->getAdmins(); ?> <script type="text/javascript"> $(document).ready(function(){ $(".toggleul_7").slideToggle(); document.getElementById("left_menubutton_7").src = "<?php echo DOCROOT; ?> site-admin/images/minus_but.png"; }); </script> <br /> <?php print_box($error, $msg); ?> <form action="manage-admin.php" method="post" name="adminForm"> <table style="text-align: left; width:100%;float:left;clear:both;"> <fieldset class="field" style="margin-left:10px;"> <legend class="legend">ADMIN MANAGER SETTING</legend> <tr> <th width="20"><input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count($admins); ?> );" /></th> <th class=empty fl ><?php echo $gXpLang['username']; ?>
if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID) { require_once $CFG->libdir . '/adminlib.php'; admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid, 'roleid' => $roleid), $CFG->wwwroot . '/' . $CFG->admin . '/roles/override.php'); admin_externalpage_print_header(); $currenttab = 'override'; include_once 'tabs.php'; } else { $currenttab = 'override'; include_once 'tabs.php'; } } print_heading_with_help($title, 'overrides'); if ($roleid) { /// Show UI for overriding roles. if (!empty($capabilities)) { print_box(get_string('nocapabilitiesincontext', 'role'), 'generalbox boxaligncenter'); } else { // Print the capabilities overrideable in this context print_box_start('generalbox boxwidthwide boxaligncenter'); if ($showadvanced) { $showadvancedlabel = get_string('hideadvanced', 'form'); } else { $showadvancedlabel = get_string('showadvanced', 'form'); } ?> <form id="overrideform" action="<?php echo $baseurl . '&roleid=' . $roleid; ?> " method="post"><div> <input type="hidden" name="sesskey" value="<?php p(sesskey());
/** * Prints lesson summaries on MyMoodle Page * * Prints lesson name, due date and attempt information on * lessons that have a deadline that has not already passed * and it is available for taking. * * @param array $courses An array of course objects to get lesson instances from * @param array $htmlarray Store overview output array( course ID => 'lesson' => HTML output ) */ function lesson_print_overview($courses, &$htmlarray) { global $USER, $CFG; if (!($lessons = get_all_instances_in_courses('lesson', $courses))) { return; } /// Get Necessary Strings $strlesson = get_string('modulename', 'lesson'); $strnotattempted = get_string('nolessonattempts', 'lesson'); $strattempted = get_string('lessonattempted', 'lesson'); $now = time(); foreach ($lessons as $lesson) { if ($lesson->deadline != 0 and $lesson->deadline >= $now and ($lesson->available == 0 or $lesson->available <= $now)) { // And the lesson is available // Lesson name if (!$lesson->visible) { $class = ' class="dimmed"'; } else { $class = ''; } $str = print_box("{$strlesson}: <a{$class} href=\"{$CFG->wwwroot}/mod/lesson/view.php?id={$lesson->coursemodule}\">" . format_string($lesson->name) . '</a>', 'name', '', true); // Deadline $str .= print_box(get_string('lessoncloseson', 'lesson', userdate($lesson->deadline)), 'info', '', true); // Attempt information if (has_capability('mod/lesson:manage', get_context_instance(CONTEXT_MODULE, $lesson->coursemodule))) { // Number of user attempts $attempts = count_records('lesson_attempts', 'lessonid', $lesson->id); $str .= print_box(get_string('xattempts', 'lesson', $attempts), 'info', '', true); } else { // Determine if the user has attempted the lesson or not if (count_records('lesson_attempts', 'lessonid', $lesson->id, 'userid', $USER->id)) { $str .= print_box($strattempted, 'info', '', true); } else { $str .= print_box($strnotattempted, 'info', '', true); } } $str = print_box($str, 'lesson overview', '', true); if (empty($htmlarray[$lesson->course]['lesson'])) { $htmlarray[$lesson->course]['lesson'] = $str; } else { $htmlarray[$lesson->course]['lesson'] .= $str; } } } }
exit; } /// Display the choice and possibly results $navigation = build_navigation('', $cm); print_header_simple(format_string($choice->name), "", $navigation, "", "", true, update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm)); add_to_log($course->id, "choice", "view", "view.php?id={$cm->id}", $choice->id, $cm->id); /// Check to see if groups are being used in this choice $groupmode = groups_get_activity_groupmode($cm); groups_get_activity_group($cm, true); groups_print_activity_menu($cm, 'view.php?id=' . $id); if (has_capability('mod/choice:readresponses', $context)) { choice_show_reportlink($choice, $course->id, $cm, $groupmode); } echo '<div class="clearer"></div>'; if ($choice->text) { print_box(format_text($choice->text, $choice->format), 'generalbox', 'intro'); } //if user has already made a selection, and they are not allowed to update it, show their selected answer. if (!empty($USER->id) && ($current = get_record('choice_answers', 'choiceid', $choice->id, 'userid', $USER->id)) && empty($choice->allowupdate)) { print_simple_box(get_string("yourselection", "choice", userdate($choice->timeopen)) . ": " . format_string(choice_get_option_text($choice, $current->optionid)), "center"); } /// Print the form $timenow = time(); if ($choice->timeclose != 0) { if ($choice->timeopen > $timenow) { print_simple_box(get_string("notopenyet", "choice", userdate($choice->timeopen)), "center"); print_footer($course); exit; } else { if ($timenow > $choice->timeclose) { print_simple_box(get_string("expired", "choice", userdate($choice->timeclose)), "center");
echo '<td class="wikiadminactions">'; wiki_print_administration_actions($wiki, $cm->id, $userid, $groupid, $ewiki_title, $wiki->htmlmode != 2, $course); echo '</td>'; } /// Formatting Rules echo '<td class="howtowiki">'; helpbutton('howtowiki', get_string('howtowiki', 'wiki'), 'wiki'); echo '</td>'; echo '</tr></table>'; } echo '</div> <div id="wiki-view" class="mwiki"> '; if ($wiki_entry && $ewiki_title == $wiki_entry->pagename && !empty($wiki->summary)) { if (trim(strip_tags($wiki->summary))) { print_box(format_text($wiki->summary, FORMAT_MOODLE), 'generalbox', 'intro'); } } // The wiki Contents if (!empty($canedit)) { /// Print tabs with commands for this page $tabs = array('view', 'edit', 'links', 'info'); if ($wiki->ewikiacceptbinary) { $tabs[] = 'attachments'; } $tabrows = array(); $row = array(); $currenttab = ''; foreach ($tabs as $tab) { $tabname = get_string("tab{$tab}", 'wiki'); $row[] = new tabobject($tabname, $ewbase . '&page=' . $tab . '/' . $ewiki_id, $tabname);
add_to_log($course->id, 'role', 'unassign', 'admin/roles/assign.php?contextid=' . $context->id . '&roleid=' . $roleid, $rolename, '', $USER->id); } else { if ($showall) { $searchtext = ''; $previoussearch = 0; } } } } if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID) { print_heading_with_help(get_string('frontpageroles', 'admin'), 'assignroles'); } else { print_heading_with_help(get_string('assignrolesin', 'role', print_context_name($context)), 'assignroles'); } if ($context->contextlevel == CONTEXT_SYSTEM) { print_box(get_string('globalroleswarning', 'role')); } if ($roleid) { /// prints a form to swap roles /// Get all existing participants in this context. // Why is this not done with get_users??? if (!($contextusers = get_role_users($roleid, $context, false, 'u.id, u.firstname, u.lastname, u.email, ra.hidden'))) { $contextusers = array(); } $select = "username <> 'guest' AND deleted = 0 AND confirmed = 1"; $usercount = count_records_select('user', $select) - count($contextusers); $searchtext = trim($searchtext); if ($searchtext !== '') { // Search for a subset of remaining users $LIKE = sql_ilike(); $FULLNAME = sql_fullname();
} $o .= "\n"; } } if (!$first) { $o .= '</pre><hr />'; } } if ($totalcounter->missing > 0) { $totalcounter->missingpercent = sprintf('%02.1f', $totalcounter->missing / $totalcounter->strings * 100); print_heading(get_string('numberofstrings', 'admin', $totalcounter), '', 4); } else { print_heading($strnomissingstrings, '', 4, 'notifysuccess'); } if ($m != '') { print_box($m, 'filenames'); } echo $o; if (!($files = get_directory_list("{$CFG->dirroot}/lang/en_utf8/help", "CVS"))) { error("Could not find English language help files!"); } foreach ($files as $filekey => $file) { // check all the help files. if (!file_exists("{$langdir}/help/{$file}")) { notify(get_string("filemissing", "", "{$langdir}/help/{$file}"), 'notifyproblem'); $somethingfound = true; continue; } } if (!($files = get_directory_list("{$CFG->dirroot}/lang/en_utf8/docs", "CVS"))) { error("Could not find English language docs files!");
print_string("allowsdiscussions", "forum"); } else { echo ' '; } echo '</p>'; if (!empty($showall)) { forum_print_latest_discussions($course, $forum, 0, 'header', '', $currentgroup, $groupmode); } else { forum_print_latest_discussions($course, $forum, $CFG->forum_manydiscussions, 'header', '', $currentgroup, $groupmode, $page); } break; case 'teacher': if (!empty($showall)) { forum_print_latest_discussions($course, $forum, 0, 'header', '', $currentgroup, $groupmode); } else { forum_print_latest_discussions($course, $forum, $CFG->forum_manydiscussions, 'header', '', $currentgroup, $groupmode, $page); } break; default: if (!empty($forum->intro)) { print_box(format_text($forum->intro), 'generalbox', 'intro'); } echo '<br />'; if (!empty($showall)) { forum_print_latest_discussions($course, $forum, 0, 'header', '', $currentgroup, $groupmode); } else { forum_print_latest_discussions($course, $forum, $CFG->forum_manydiscussions, 'header', '', $currentgroup, $groupmode, $page); } break; } print_footer($course);
/** * This method should be overriden if you want to include a special heading or some other * html on a question editing page besides the question editing form. * * @param question_edit_form $mform a child of question_edit_form * @param object $question * @param string $wizardnow is '' for first page. */ function display_question_editing_page(&$mform, $question, $wizardnow) { list($heading, $langmodule) = $this->get_heading(empty($question->id)); print_heading_with_help($heading, $this->name(), $langmodule); $permissionstrs = array(); if (!empty($question->id)) { if ($question->formoptions->canedit) { $permissionstrs[] = get_string('permissionedit', 'question'); } if ($question->formoptions->canmove) { $permissionstrs[] = get_string('permissionmove', 'question'); } if ($question->formoptions->cansaveasnew) { $permissionstrs[] = get_string('permissionsaveasnew', 'question'); } } if (!$question->formoptions->movecontext && count($permissionstrs)) { print_heading(get_string('permissionto', 'question'), 'center', 3); $html = '<ul>'; foreach ($permissionstrs as $permissionstr) { $html .= '<li>' . $permissionstr . '</li>'; } $html .= '</ul>'; print_box($html, 'boxwidthnarrow boxaligncenter generalbox'); } $mform->display(); }