本文整理汇总了PHP中qualified_me函数的典型用法代码示例。如果您正苦于以下问题:PHP qualified_me函数的具体用法?PHP qualified_me怎么用?PHP qualified_me使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qualified_me函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: standard_footer_html
/**
* The standard tags (typically performance information and validation links,
* if we are in developer debug mode) that should be output in the footer area
* of the page. Designed to be called in theme layout.php files.
* @return string HTML fragment.
*/
public function standard_footer_html() {
global $CFG;
// This function is normally called from a layout.php file in {@link header()}
// but some of the content won't be known until later, so we return a placeholder
// for now. This will be replaced with the real content in {@link footer()}.
$output = self::PERFORMANCE_INFO_TOKEN;
// Moodle 2.1 uses a magic accessor for $this->page->devicetypeinuse so we need to
// check for the existence of the function that uses as
// isset($this->page->devicetypeinuse) returns false
if (function_exists('get_user_device_type')?($this->page->devicetypeinuse=='legacy'):$this->page->legacythemeinuse) {
// The legacy theme is in use print the notification
$output .= html_writer::tag('div', get_string('legacythemeinuse'), array('class'=>'legacythemeinuse'));
}
// if (!empty($CFG->debugpageinfo)) {
// $output .= '<div class="performanceinfo">This page is: ' . $this->page->debug_summary() . '</div>';
// }
if (debugging(null, DEBUG_DEVELOPER)) { // Only in developer mode
$output .= '<div class="purgecaches"><a href="'.$CFG->wwwroot.'/admin/purgecaches.php?confirm=1&sesskey='.sesskey().'">'.get_string('purgecaches', 'admin').'</a></div>';
}
if (!empty($CFG->debugvalidators)) {
$output .= '<div class="validators"><ul>
<li><a href="http://validator.w3.org/check?verbose=1&ss=1&uri=' . urlencode(qualified_me()) . '">Validate HTML</a></li>
<li><a href="http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=-1&url1=' . urlencode(qualified_me()) . '">Section 508 Check</a></li>
<li><a href="http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=0&warnp2n3e=1&url1=' . urlencode(qualified_me()) . '">WCAG 1 (2,3) Check</a></li>
</ul></div>';
}
return $output;
}
示例2: __construct
/**
* Overriding the normal constructor in order to use
* our extended version of MoodleQuickForm, which
* will enable this form to use slides
* @param string $action Form destination
* @param array $customdata Custom data for pre-populating form fields
* @param string $method Method of form submission - GET or POST
* @param string $target Form's target
* @param array $attributes HTML form attributes
* @param boolean $editable Whether the form can be edited
* @version 2013050801
* @since 2011101901
*/
public function __construct($action = null, array $customdata = array(), $method = 'post', $target = '', array $attributes = array(), $editable = true)
{
if (empty($action)) {
$action = strip_querystring(qualified_me());
}
$this->_formname = get_class($this);
// '_form' suffix kept in order to prevent collisions of form id and other element
$this->_customdata = $customdata;
$this->_form = new MoodleQuickFormWithSlides($this->_formname, $method, $action, $target, $attributes);
if (!$editable) {
$this->_form->hardFreeze();
}
$this->definition();
$this->_form->addElement('hidden', 'sesskey', null);
// automatic sesskey protection
$this->_form->setType('sesskey', PARAM_RAW);
$this->_form->setDefault('sesskey', sesskey());
$this->_form->addElement('hidden', '_qf__' . $this->_formname, null);
// form submission marker
$this->_form->setType('_qf__' . $this->_formname, PARAM_RAW);
$this->_form->setDefault('_qf__' . $this->_formname, 1);
$this->_form->_setDefaultRuleMessages();
// Moodle 2.5 and above have auto-collapsing forms. Not appropriate here!
// (Using method_exists() so that 2.0-2.4 and 2.5+ can share the same code base)
if (method_exists($this->_form, 'setDisableShortforms')) {
$this->_form->setDisableShortforms(true);
}
// we have to know all input types before processing submission ;-)
$this->_process_submission($method);
}
示例3: ilp_moodleform
/**
* This is identical to the overridden function except that it calls ilp_MoodleQuickForm instead
* of MoodleQuickForm
* @param <type> $action
* @param <type> $customdata
* @param <type> $method
* @param <type> $target
* @param <type> $attributes
* @param <type> $editable
*/
function ilp_moodleform($action = null, $customdata = null, $method = 'post', $target = '', $attributes = null, $editable = true)
{
if (empty($action)) {
$action = strip_querystring(qualified_me());
}
$this->_formname = get_class($this);
// '_form' suffix kept in order to prevent collisions of form id and other element
$this->_customdata = $customdata;
$this->_form =& new ilp_MoodleQuickForm($this->_formname, $method, $action, $target, $attributes);
if (!$editable) {
$this->_form->hardFreeze();
}
//TODO find a way to emulate moodle 2 functionality in 1.9 and check if file manager
//$this->set_upload_manager(new upload_manager());
$this->definition();
$this->_form->addElement('hidden', 'sesskey', null);
// automatic sesskey protection
$this->_form->setType('sesskey', PARAM_RAW);
$this->_form->setDefault('sesskey', sesskey());
$this->_form->addElement('hidden', '_qf__' . $this->_formname, null);
// form submission marker
$this->_form->setType('_qf__' . $this->_formname, PARAM_RAW);
$this->_form->setDefault('_qf__' . $this->_formname, 1);
$this->_form->_setDefaultRuleMessages();
// we have to know all input types before processing submission ;-)
$this->_process_submission($method);
}
示例4: construct_unassigned_table
/**
* Construct the unassigned datatable.
*
* @param string $uniqid A unique ID to assign to the datatable object.
* @return deepsight_datatable The datatable object.
*/
protected function construct_unassigned_table($uniqid = null)
{
global $DB;
$classid = $this->required_param('id', PARAM_INT);
$endpoint = qualified_me() . '&action=deepsight_response&tabletype=unassigned&id=' . $classid;
$table = new deepsight_datatable_enrolments($DB, 'unassigned', $endpoint, $uniqid, $classid);
return $table;
}
示例5: memorization_print_new_verse_box
function memorization_print_new_verse_box()
{
global $CFG, $USER;
print_box_start('add-verse-box generalbox box');
print_heading(get_string('newverse', 'memorization'));
$biblebooks = biblebooks_array();
// create the book selector
$biblebookoptions = '';
foreach ($biblebooks as $booknumber => $bookofbible) {
if ($booknumber == 0) {
continue;
}
$biblebookoptions .= '<option value="' . $booknumber . '">' . $bookofbible . '</option>';
}
$startbookid = '<select name="startbookid">' . $biblebookoptions . '</select>';
$endbookid = '<select name="endbookid">' . $biblebookoptions . '</select>';
// create the chapter inputs
$startchapter = '<input type="text" name="startchapter" size="5" />';
$endchapter = '<input type="text" name="endchapter" size="5"/>';
// create the verse inputs
$startverse = '<input type="text" name="startverse" size="5"/>';
$endverse = '<input type="text" name="endverse" size="5"/>';
// create the version chooser
$versions = get_records('memorization_version');
if (!empty($versions)) {
$versionselect = '<select name="versionid">';
$lastversionid = get_field_sql("SELECT versionid FROM {$CFG->prefix}memorization_verse WHERE userid={$USER->id} ORDER BY id DESC");
foreach ($versions as $versionid => $version) {
$selected = $versionid == $lastversionid ? ' SELECTED="selected" ' : '';
$versionselect .= '<option ' . $selected . ' value="' . $versionid . '">' . $version->value . '</option>';
}
$versionselect .= '</select>';
}
$currenturl = new moodle_url(qualified_me());
echo '<form method="POST" action="addverse.php?' . $currenturl->get_query_string() . '">
<input type="hidden" name="sesskey" value="' . sesskey() . '">
<table>
<tr>
<td>' . get_string('fromverse', 'memorization') . '</td>
<td>' . $startbookid . ' ' . $startchapter . ':' . $startverse . '</td>
</tr>
<tr>
<td>' . get_string('toverse', 'memorization') . '</td>
<td>' . $endbookid . ' ' . $endchapter . ':' . $endverse . '</td>
</tr>
<tr>
<td>' . get_string('version', 'memorization') . '</td>
<td>' . $versionselect . '</td>
</tr>
</table>
<input type="submit">
</form>';
print_box_end();
}
示例6: print_grade_page_head_local
/**
* Prints the page headers, breadcrumb trail, page heading, (optional) dropdown navigation menu and
* (optional) navigation tabs for any gradebook page. All gradebook pages MUST use these functions
* in favour of the usual print_header(), print_header_simple(), print_heading() etc.
* !IMPORTANT! Use of tabs.php file in gradebook pages is forbidden unless tabs are switched off at
* the site level for the gradebook ($CFG->grade_navmethod = GRADE_NAVMETHOD_DROPDOWN).
*
* @param int $courseid
* @param string $active_type The type of the current page (report, settings, import, export, scales, outcomes, letters)
* @param string $active_plugin The plugin of the current page (grader, fullview etc...)
* @param string $heading The heading of the page. Tries to guess if none is given
* @param boolean $return Whether to return (true) or echo (false) the HTML generated by this function
* @param string $bodytags Additional attributes that will be added to the <body> tag
* @param string $buttons Additional buttons to display on the page
*
* @return string HTML code or nothing if $return == false
*/
function print_grade_page_head_local($courseid, $active_type, $active_plugin = null, $heading = false, $return = false, $bodytags = '', $buttons = false, $extracss = array())
{
global $CFG, $COURSE;
$strgrades = get_string('grades');
$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
// Determine the string of the active plugin
$stractive_plugin = $active_plugin ? $plugin_info['strings']['active_plugin_str'] : $heading;
$stractive_type = $plugin_info['strings'][$active_type];
$navlinks = array();
$first_link = '';
if ($active_type == 'settings' && $active_plugin != 'coursesettings') {
$first_link = $plugin_info['report'][$active_plugin]['link'];
} elseif ($active_type != 'report') {
$first_link = $CFG->wwwroot . '/grade/index.php?id=' . $COURSE->id;
}
if ($active_type == 'preferences') {
$CFG->stylesheets[] = $CFG->wwwroot . '/grade/report/styles.css';
}
foreach ($extracss as $css_url) {
$CFG->stylesheets[] = $css_url;
}
$navlinks[] = array('name' => $strgrades, 'link' => $first_link, 'type' => 'misc');
$active_type_link = '';
if (!empty($plugin_info[$active_type]['link']) && $plugin_info[$active_type]['link'] != qualified_me()) {
$active_type_link = $plugin_info[$active_type]['link'];
}
if (!empty($plugin_info[$active_type]['parent']['link'])) {
$active_type_link = $plugin_info[$active_type]['parent']['link'];
$navlinks[] = array('name' => $stractive_type, 'link' => $active_type_link, 'type' => 'misc');
}
if (empty($plugin_info[$active_type]['id'])) {
$navlinks[] = array('name' => $stractive_type, 'link' => $active_type_link, 'type' => 'misc');
}
$navlinks[] = array('name' => $stractive_plugin, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
$title = ': ' . $stractive_plugin;
if (empty($plugin_info[$active_type]['id']) || !empty($plugin_info[$active_type]['parent'])) {
$title = ': ' . $stractive_type . ': ' . $stractive_plugin;
}
$returnval = print_header_simple($strgrades . ': ' . $stractive_type, $title, $navigation, '', $bodytags, true, $buttons, navmenu($COURSE), false, '', $return);
// Guess heading if not given explicitly
if (!$heading) {
$heading = $stractive_plugin;
}
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN) {
$returnval .= print_grade_plugin_selector($plugin_info, $return);
}
$returnval .= print_heading($heading);
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_TABS) {
$returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return);
}
if ($return) {
return $returnval;
}
}
示例7: instance_config_print
function instance_config_print()
{
global $CFG;
/// set up the numberoftags select field
$numberoftags = array();
for ($i = 1; $i <= 200; $i++) {
$numberoftags[$i] = $i;
}
if (is_file($CFG->dirroot . '/blocks/' . $this->name() . '/config_instance.html')) {
print_simple_box_start('center', '', '', 5, 'blockconfigglobal');
include $CFG->dirroot . '/blocks/' . $this->name() . '/config_instance.html';
print_simple_box_end();
} else {
notice(get_string('blockconfigbad'), str_replace('blockaction=', 'dummy=', qualified_me()));
}
}
示例8: print_badge_table_actions
public function print_badge_table_actions($badge, $context)
{
$actions = "";
if (has_capability('moodle/badges:configuredetails', $context)) {
// Activate/deactivate badge.
if ($badge->status == BADGE_STATUS_INACTIVE || $badge->status == BADGE_STATUS_INACTIVE_LOCKED) {
$url = new moodle_url(qualified_me());
$url->param('activate', $badge->id);
$url->param('sesskey', sesskey());
$actions .= $this->output->action_icon($url, new pix_icon('t/show', get_string('activate', 'badges'))) . " ";
} else {
$url = new moodle_url(qualified_me());
$url->param('lock', $badge->id);
$url->param('sesskey', sesskey());
$actions .= $this->output->action_icon($url, new pix_icon('t/hide', get_string('deactivate', 'badges'))) . " ";
}
}
// Award badge manually.
if ($badge->has_manual_award_criteria() && has_capability('moodle/badges:awardbadge', $context) && $badge->is_active()) {
$url = new moodle_url('/badges/award.php', array('id' => $badge->id));
$actions .= $this->output->action_icon($url, new pix_icon('t/award', get_string('award', 'badges'))) . " ";
}
// Edit badge.
if (has_capability('moodle/badges:configuredetails', $context)) {
$url = new moodle_url('/badges/edit.php', array('id' => $badge->id, 'action' => 'details'));
$actions .= $this->output->action_icon($url, new pix_icon('t/edit', get_string('edit'))) . " ";
}
// Duplicate badge.
if (has_capability('moodle/badges:createbadge', $context)) {
$url = new moodle_url('/badges/action.php', array('copy' => '1', 'id' => $badge->id, 'sesskey' => sesskey()));
$actions .= $this->output->action_icon($url, new pix_icon('t/copy', get_string('copy'))) . " ";
}
// Delete badge.
if (has_capability('moodle/badges:deletebadge', $context)) {
$url = new moodle_url(qualified_me());
$url->param('delete', $badge->id);
$actions .= $this->output->action_icon($url, new pix_icon('t/delete', get_string('delete'))) . " ";
}
return $actions;
}
示例9: test_qualified_me
public function test_qualified_me()
{
global $PAGE, $FULLME, $CFG;
$this->resetAfterTest();
$PAGE = new moodle_page();
$FULLME = $CFG->wwwroot . '/course/view.php?id=1&xx=yy';
$this->assertSame($FULLME, qualified_me());
$PAGE->set_url('/course/view.php', array('id' => 1));
$this->assertSame($CFG->wwwroot . '/course/view.php?id=1', qualified_me());
}
示例10: moodleform
/**
* The constructor function calls the abstract function definition() and it will then
* process and clean and attempt to validate incoming data.
*
* It will call your custom validate method to validate data and will also check any rules
* you have specified in definition using addRule
*
* The name of the form (id attribute of the form) is automatically generated depending on
* the name you gave the class extending moodleform. You should call your class something
* like
*
* @param mixed $action the action attribute for the form. If empty defaults to auto detect the
* current url. If a moodle_url object then outputs params as hidden variables.
* @param array $customdata if your form defintion method needs access to data such as $course
* $cm, etc. to construct the form definition then pass it in this array. You can
* use globals for somethings.
* @param string $method if you set this to anything other than 'post' then _GET and _POST will
* be merged and used as incoming data to the form.
* @param string $target target frame for form submission. You will rarely use this. Don't use
* it if you don't need to as the target attribute is deprecated in xhtml
* strict.
* @param mixed $attributes you can pass a string of html attributes here or an array.
* @param bool $editable
* @return object moodleform
*/
function moodleform($action = null, $customdata = null, $method = 'post', $target = '', $attributes = null, $editable = true)
{
if (empty($action)) {
$action = strip_querystring(qualified_me());
}
// Assign custom data first, so that get_form_identifier can use it.
$this->_customdata = $customdata;
$this->_formname = $this->get_form_identifier();
$this->_form = new MoodleQuickForm($this->_formname, $method, $action, $target, $attributes);
if (!$editable) {
$this->_form->hardFreeze();
}
$this->definition();
$this->_form->addElement('hidden', 'sesskey', null);
// automatic sesskey protection
$this->_form->setType('sesskey', PARAM_RAW);
$this->_form->setDefault('sesskey', sesskey());
$this->_form->addElement('hidden', '_qf__' . $this->_formname, null);
// form submission marker
$this->_form->setType('_qf__' . $this->_formname, PARAM_RAW);
$this->_form->setDefault('_qf__' . $this->_formname, 1);
$this->_form->_setDefaultRuleMessages();
// we have to know all input types before processing submission ;-)
$this->_process_submission($method);
}
示例11: config_form
/**
* Shows config form & errors
*
* @param object $frm
* @access public
*/
function config_form($frm)
{
global $CFG;
$mconfig = get_config('enrol/authorize');
if (!check_openssl_loaded()) {
notify('PHP must be compiled with SSL support (--with-openssl)');
}
if (empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') {
$a = new stdClass();
$a->url = "{$CFG->wwwroot}/{$CFG->admin}/settings.php?section=httpsecurity";
notify(get_string('adminconfighttps', 'enrol_authorize', $a));
return;
// notice breaks the form and xhtml later
} elseif (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 443) {
// MDL-9836
$wwwsroot = qualified_me();
$wwwsroot = str_replace('http:', 'https:', $wwwsroot);
$a = new stdClass();
$a->url = $wwwsroot;
notify(get_string('adminconfighttpsgo', 'enrol_authorize', $a));
return;
// notice breaks the form and xhtml later
}
if (!empty($frm->an_review)) {
$captureday = intval($frm->an_capture_day);
$emailexpired = intval($frm->an_emailexpired);
if ($captureday > 0 || $emailexpired > 0) {
$lastcron = get_field_sql('SELECT max(lastcron) FROM ' . $CFG->prefix . 'modules');
if (time() - intval($lastcron) > 3600 * 24) {
notify(get_string('admincronsetup', 'enrol_authorize'));
}
}
}
if ($count = count_records('enrol_authorize', 'status', AN_STATUS_AUTH)) {
$a = new stdClass();
$a->count = $count;
$a->url = $CFG->wwwroot . "/enrol/authorize/index.php?status=" . AN_STATUS_AUTH;
notify(get_string('adminpendingorders', 'enrol_authorize', $a));
}
if (data_submitted()) {
if (empty($mconfig->an_login)) {
notify("an_login required");
}
if (empty($mconfig->an_tran_key) && empty($mconfig->an_password)) {
notify("an_tran_key or an_password required");
}
}
include $CFG->dirroot . '/enrol/authorize/config_form.php';
}
示例12: _paintPassFail
/**
* Private method. Used by printPass/Fail/Skip/Error.
*/
function _paintPassFail($passorfail, $message, $stacktrace = null, $debuginfo = null)
{
global $CFG, $OUTPUT;
echo $OUTPUT->box_start($passorfail . ' generalbox ');
$url = $this->_htmlEntities($this->_stripParameterFromUrl(qualified_me(), 'path'));
echo '<b class="', $passorfail, '">', $this->get_string($passorfail), '</b>: ';
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
$file = array_shift($breadcrumb);
$pathbits = preg_split('/\\/|\\\\/', substr($file, strlen($CFG->dirroot) + 1));
$file = array_pop($pathbits);
$folder = '';
foreach ($pathbits as $pathbit) {
$folder .= $pathbit . '/';
echo "<a href=\"{$url}path={$folder}\" title=\"{$this->strrunonlyfolder}\">{$pathbit}</a>/";
}
echo "<a href=\"{$url}path={$folder}{$file}\" title=\"{$this->strrunonlyfile}\">{$file}</a>";
echo $this->strseparator, implode($this->strseparator, $breadcrumb);
echo '<br />', $this->_htmlEntities($message), "\n\n";
if (!empty($debuginfo)) {
print_object('Debug info:');
print_object($debuginfo);
}
if ($stacktrace) {
$dotsadded = false;
$interestinglines = 0;
$filteredstacktrace = array();
foreach ($stacktrace as $frame) {
if (empty($frame['file']) || strpos($frame['file'], 'simpletestlib') === false && strpos($frame['file'], 'simpletestcoveragelib') === false && strpos($frame['file'], 'tool/unittest') === false) {
$filteredstacktrace[] = $frame;
$interestinglines += 1;
$dotsadded = false;
} else {
if (!$dotsadded) {
$filteredstacktrace[] = array('line' => '...', 'file' => '...');
$dotsadded = true;
}
}
}
if ($interestinglines > 1 || $passorfail == 'exception' && $interestinglines > 0) {
echo '<div class="notifytiny">' . format_backtrace($filteredstacktrace) . "</div>\n\n";
}
}
echo $OUTPUT->box_end();
flush();
}
示例13: loginpage_hook
/**
* Will get called before the login page is shownr. Ff NTLM SSO
* is enabled, and the user is in the right network, we'll redirect
* to the magic NTLM page for SSO...
*
*/
function loginpage_hook()
{
global $CFG, $SESSION;
// HTTPS is potentially required
//httpsrequired(); - this must be used before setting the URL, it is already done on the login/index.php
if (($_SERVER['REQUEST_METHOD'] === 'GET' || $_SERVER['REQUEST_METHOD'] === 'POST' && get_local_referer() != strip_querystring(qualified_me())) && !empty($this->config->ntlmsso_enabled) && !empty($this->config->ntlmsso_subnet) && empty($_GET['authldap_skipntlmsso']) && (isguestuser() || !isloggedin()) && address_in_subnet(getremoteaddr(), $this->config->ntlmsso_subnet)) {
// First, let's remember where we were trying to get to before we got here
if (empty($SESSION->wantsurl)) {
$SESSION->wantsurl = null;
$referer = get_local_referer(false);
if ($referer && $referer != $CFG->wwwroot && $referer != $CFG->wwwroot . '/' && $referer != $CFG->httpswwwroot . '/login/' && $referer != $CFG->httpswwwroot . '/login/index.php') {
$SESSION->wantsurl = $referer;
}
}
// Now start the whole NTLM machinery.
if ($this->config->ntlmsso_ie_fastpath == AUTH_NTLM_FASTPATH_YESATTEMPT || $this->config->ntlmsso_ie_fastpath == AUTH_NTLM_FASTPATH_YESFORM) {
if (core_useragent::is_ie()) {
$sesskey = sesskey();
redirect($CFG->wwwroot . '/auth/ldap/ntlmsso_magic.php?sesskey=' . $sesskey);
} else {
if ($this->config->ntlmsso_ie_fastpath == AUTH_NTLM_FASTPATH_YESFORM) {
redirect($CFG->httpswwwroot . '/login/index.php?authldap_skipntlmsso=1');
}
}
}
redirect($CFG->wwwroot . '/auth/ldap/ntlmsso_attempt.php');
}
// No NTLM SSO, Use the normal login page instead.
// If $SESSION->wantsurl is empty and we have a 'Referer:' header, the login
// page insists on redirecting us to that page after user validation. If
// we clicked on the redirect link at the ntlmsso_finish.php page (instead
// of waiting for the redirection to happen) then we have a 'Referer:' header
// we don't want to use at all. As we can't get rid of it, just point
// $SESSION->wantsurl to $CFG->wwwroot (after all, we came from there).
if (empty($SESSION->wantsurl) && get_local_referer() == $CFG->httpswwwroot . '/auth/ldap/ntlmsso_finish.php') {
$SESSION->wantsurl = $CFG->wwwroot;
}
}
示例14: get_baseurl
public function get_baseurl()
{
$getcopy = $_GET;
unset($getcopy['blogpage']);
if (!empty($getcopy)) {
$first = false;
$querystring = '';
foreach ($getcopy as $var => $val) {
if (!$first) {
$first = true;
$querystring .= "?{$var}={$val}";
} else {
$querystring .= '&' . $var . '=' . $val;
$hasparam = true;
}
}
} else {
$querystring = '?';
}
return strip_querystring(qualified_me()) . $querystring;
}
示例15: instance_config_print
function instance_config_print()
{
global $CFG, $DB;
if (!isset($this->config)) {
// ... teacher has not yet configured the block, let's put some default values here to explain things
$this->config->title = get_string('blockname', 'block_glossary_random');
$this->config->refresh = 0;
$this->config->showconcept = 1;
$this->config->cache = get_string('notyetconfigured', 'block_glossary_random');
$this->config->addentry = get_string('addentry', 'block_glossary_random');
$this->config->viewglossary = get_string('viewglossary', 'block_glossary_random');
$this->config->invisible = get_string('invisible', 'block_glossary_random');
}
// select glossaries to put in dropdown box ...
$glossaries = $DB->get_records_menu('glossary', array('course' => $this->course->id), 'name', 'id,name');
//format menu texts to avoid html and to filter multilang values
if (!empty($glossaries)) {
foreach ($glossaries as $key => $value) {
$glossaries[$key] = strip_tags(format_string($value, true));
}
}
// and select quotetypes to put in dropdown box
$type[0] = get_string('random', 'block_glossary_random');
$type[1] = get_string('lastmodified', 'block_glossary_random');
$type[2] = get_string('nextone', 'block_glossary_random');
$this->config->nexttime = usergetmidnight(time()) + DAYSECS * $this->config->refresh;
// display the form
if (is_file($CFG->dirroot . '/blocks/' . $this->name() . '/config_instance.html')) {
print_simple_box_start('center', '', '', 5, 'blockconfigglobal');
include $CFG->dirroot . '/blocks/' . $this->name() . '/config_instance.html';
print_simple_box_end();
} else {
notice(get_string('blockconfigbad'), str_replace('blockaction=', 'dummy=', qualified_me()));
}
return true;
}