本文整理汇总了PHP中close_window_button函数的典型用法代码示例。如果您正苦于以下问题:PHP close_window_button函数的具体用法?PHP close_window_button怎么用?PHP close_window_button使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了close_window_button函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: notice_okcancel
/**
* Print a message along with "Ok" link for the user to continue and "Cancel" link to close window.
*
* @param string $message The text to display
* @param string $linkok The link to take the user to if they choose "Ok"
* TODO Document remaining arguments
*/
function notice_okcancel($message, $linkok, $optionsok = NULL, $methodok = 'post')
{
global $CFG;
$message = clean_text($message);
$linkok = clean_text($linkok);
print_box_start('generalbox', 'notice');
echo '<p>' . $message . '</p>';
echo '<div class="buttons">';
print_single_button($linkok, $optionsok, get_string('ok'), $methodok, $CFG->framename);
close_window_button('cancel');
echo '</div>';
print_box_end();
}
示例2: iplookup_display
function iplookup_display($ip, $user = 0)
{
print_header();
if ($user) {
if ($user = get_record('user', 'id', $user)) {
print_heading(fullname($user) . ", {$user->city}, {$user->country}", 'center', '4');
}
}
echo 'Search results: <iframe src="http://www.hostip.info/api/get.html?ip=' . $ip . '" height="60" width="300"></iframe>';
echo '<object data="http://www.hostip.info/map/frame.html?ip=' . $ip . '" ' . 'type="text/html" border="0" width="610" height="330"></object>';
close_window_button();
print_footer('none');
}
示例3: display
//.........这里部分代码省略.........
}
$relativeurl = str_replace('\\', '/', $relativeurl);
$relativeurl = str_replace(' ', '%20', $relativeurl);
$fullurl = 'file:///' . htmlentities($relativeurl);
$localpath = true;
} else {
// Normal uploaded file
if ($CFG->slasharguments) {
$relativeurl = "/file.php/{$course->id}/{$resource->reference}";
if ($querystring) {
$relativeurl .= '?' . $querystring;
}
} else {
$relativeurl = "/file.php?file=/{$course->id}/{$resource->reference}";
if ($querystring) {
$relativeurl .= '&' . $querystring;
}
}
$fullurl = "{$CFG->wwwroot}{$relativeurl}";
}
}
/// Print a notice and redirect if we are trying to access a file on a local file system
/// and the config setting has been disabled
if (!$CFG->resource_allowlocalfiles and strpos($resource->reference, RESOURCE_LOCALPATH) === 0) {
if ($inpopup) {
print_header($pagetitle, $course->fullname);
} else {
$this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
$this->navigation = build_navigation($this->navlinks);
print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
}
notify(get_string('notallowedlocalfileaccess', 'resource', ''));
if ($inpopup) {
close_window_button();
}
print_footer('none');
die;
}
/// Check whether this is supposed to be a popup, but was called directly
if ($resource->popup and !$inpopup) {
/// Make a page and a pop-up window
$this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
$this->navigation = build_navigation($this->navlinks);
print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
echo "\n<script type=\"text/javascript\">";
echo "\n<!--\n";
echo "openpopup('/mod/resource/view.php?inpopup=true&id={$cm->id}','resource{$resource->id}','{$resource->popup}');\n";
echo "\n-->\n";
echo '</script>';
if (trim(strip_tags($resource->summary))) {
print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions), "center");
}
$link = "<a href=\"{$CFG->wwwroot}/mod/resource/view.php?inpopup=true&id={$cm->id}\" " . "onclick=\"this.target='resource{$resource->id}'; return openpopup('/mod/resource/view.php?inpopup=true&id={$cm->id}', " . "'resource{$resource->id}','{$resource->popup}');\">" . format_string($resource->name, true) . "</a>";
echo '<div class="popupnotice">';
print_string('popupresource', 'resource');
echo '<br />';
print_string('popupresourcelink', 'resource', $link);
echo '</div>';
print_footer($course);
exit;
}
/// Now check whether we need to display a frameset
$frameset = optional_param('frameset', '', PARAM_ALPHA);
if (empty($frameset) and !$embedded and !$inpopup and $resource->options == "frame" and empty($USER->screenreader)) {
@header('Content-Type: text/html; charset=utf-8');
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
示例4: install_print_help_page
function install_print_help_page($help)
{
global $CFG;
@header('Content-Type: text/html; charset=UTF-8');
@header('Cache-Control: no-store, no-cache, must-revalidate');
@header('Cache-Control: post-check=0, pre-check=0', false);
@header('Pragma: no-cache');
@header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');
@header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html dir="' . (right_to_left() ? 'rtl' : 'ltr') . '">
<head>
<link rel="shortcut icon" href="theme/standard/favicon.ico" />
<link rel="stylesheet" type="text/css" href="' . $CFG->wwwroot . '/install.php?css=1" />
<title>' . get_string('installation', 'install') . '</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="0" />';
echo '</head><body>';
switch ($help) {
case 'phpversionhelp':
print_string($help, 'install', phpversion());
break;
case 'memorylimithelp':
print_string($help, 'install', get_memory_limit());
break;
default:
print_string($help, 'install');
}
close_window_button();
echo '</body></html>';
die;
}
示例5: display
/**
* Display the repository resource
*
* Displays a repository resource embedded, in a frame, or in a popup.
* Output depends on type of file resource.
*
* @param CFG global object
*/
function display()
{
global $CFG, $THEME, $SESSION;
/// Set up generic stuff first, including checking for access
parent::display();
/// Set up some shorthand variables
$cm = $this->cm;
$course = $this->course;
$resource = $this->resource;
$this->set_parameters();
// set the parameters array
///////////////////////////////////////////////
/// Possible display modes are:
/// File displayed in a frame in a normal window
/// File displayed embedded in a normal page
/// File displayed in a popup window
/// File displayed emebedded in a popup window
/// First, find out what sort of file we are dealing with.
require_once $CFG->libdir . '/filelib.php';
$querystring = '';
$resourcetype = '';
$embedded = false;
$mimetype = mimeinfo("type", $resource->reference);
$pagetitle = strip_tags($course->shortname . ': ' . format_string($resource->name));
$formatoptions = new object();
$formatoptions->noclean = true;
if ($resource->options != "frame") {
if (in_array($mimetype, array('image/gif', 'image/jpeg', 'image/png'))) {
// It's an image
$resourcetype = "image";
$embedded = true;
} else {
if ($mimetype == "audio/mp3") {
// It's an MP3 audio file
$resourcetype = "mp3";
$embedded = true;
} else {
if (substr($mimetype, 0, 10) == "video/x-ms") {
// It's a Media Player file
$resourcetype = "mediaplayer";
$embedded = true;
} else {
if ($mimetype == "video/quicktime") {
// It's a Quicktime file
$resourcetype = "quicktime";
$embedded = true;
} else {
if ($mimetype == "text/html") {
// It's a web page
$resourcetype = "html";
}
}
}
}
}
}
$navigation = build_navigation($this->navlinks, $cm);
/// Form the parse string
if (!empty($resource->alltext)) {
$querys = array();
$parray = explode(',', $resource->alltext);
foreach ($parray as $fieldstring) {
$field = explode('=', $fieldstring);
$querys[] = urlencode($field[1]) . '=' . urlencode($this->parameters[$field[0]]['value']);
}
$querystring = implode('&', $querys);
}
/// Set up some variables
$inpopup = optional_param('inpopup', 0, PARAM_BOOL);
$fullurl = $resource->reference . '&HIVE_SESSION=' . $SESSION->HIVE_SESSION;
if (!empty($querystring)) {
$urlpieces = parse_url($resource->reference);
if (empty($urlpieces['query'])) {
$fullurl .= '?' . $querystring;
} else {
$fullurl .= '&' . $querystring;
}
}
/// MW check that the HIVE_SESSION is there
if (empty($SESSION->HIVE_SESSION)) {
if ($inpopup) {
print_header($pagetitle, $course->fullname);
} else {
print_header($pagetitle, $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
}
notify('You do not have access to HarvestRoad Hive. This resource is unavailable.');
if ($inpopup) {
close_window_button();
}
print_footer('none');
die;
}
//.........这里部分代码省略.........
示例6: get_string
echo '<center>';
echo '<input type="submit" name="reset" value="' . get_string('resetcategories', 'repository_alfresco') . '" /><br />' . get_string('resetcategoriesdesc', 'repository_alfresco') . '<br /><br />';
if ($categories = $repo->category_get_children(0)) {
echo '<input type="button" value="' . get_string('selectall') . '" onclick="checkall();" />';
echo ' <input type="button" value="' . get_string('deselectall') . '" onclick="checknone();" /><br />';
echo '<input type="submit" value="' . get_string('savechanges') . '" />';
echo '</center><br />';
if ($nodes = repository_alfresco_make_category_select_tree_choose($categories, $catfilter)) {
$menu = new HTML_TreeMenu();
for ($i = 0; $i < count($nodes); $i++) {
$menu->addItem($nodes[$i]);
}
$treemenu =& new HTML_TreeMenu_DHTML($menu, array('images' => $CFG->wwwroot . '/lib/HTML_TreeMenu-1.2.0/images'));
echo '<script language="JavaScript" type="text/javascript">';
echo "<!--\n";
include $CFG->libdir . '/HTML_TreeMenu-1.2.0/TreeMenu.js';
echo "\n// -->";
echo '</script>';
$treemenu->printMenu();
}
echo '<center><br />';
echo '<input type="button" value="' . get_string('selectall') . '" onclick="checkall();" />';
echo ' <input type="button" value="' . get_string('deselectall') . '" onclick="checknone();" /><br />';
echo '<input type="submit" value="' . get_string('savechanges') . '" /> ' . close_window_button('closewindow', true);
} else {
print_heading(get_string('nocategoriesfound', 'repository_alfresco'));
}
echo '</center>';
echo '</form>';
print_simple_box_end();
print_footer('empty');
示例7: print_heading
echo '<div id="netpublish-rights' . $count . '" style="display: ' . $display . ';">';
if (count($chunks) != 1) {
// only show heading with multiple pages
print_heading(get_string('page', 'netpublish') . " {$countplus}", 'center', 4);
}
print_table($table);
echo '</div>';
$display = "none";
$count++;
}
echo '<div style="padding:10px;" align="center">';
if (count($chunks) != 1) {
// only show links on multiple pages
echo implode(', ', $links);
}
echo '<p>' . close_window_button() . '</p></div>';
// close window
// this is where we generate hidden fields to keep track of students that
// have been checked, but not already printed out
foreach ($read as $readhidden) {
echo '<input type="hidden" id="read" name="read[]" value="' . $readhidden . '" />';
}
foreach ($write as $writehidden) {
echo '<input type="hidden" id="write" name="write[]" value="' . $writehidden . '" />';
}
echo '</form>';
} else {
echo '<div align="center">';
print_string('nostudentsfound', 'netpublish');
echo '</div>';
}
示例8: questionnaire_preview
function questionnaire_preview($questionnaire)
{
global $CFG;
/// Print the page header
/// Templates may not have questionnaires yet...
$tempsid = $questionnaire->survey->id;
// this is needed for Preview cases later on
if (!isset($questionnaire->name)) {
$name = get_field('questionnaire_survey', 'name', 'id', $tempsid);
$questionnaire->sid = $tempsid;
$questionnaire->add_questions($tempsid);
} else {
$name = $questionnaire->name;
}
$qp = get_string('preview_questionnaire', 'questionnaire');
$pq = get_string('previewing', 'questionnaire');
$currentcss = '';
if (!empty($questionnaire->survey->theme)) {
$currentcss = '<link rel="stylesheet" type="text/css" href="' . $CFG->wwwroot . '/mod/questionnaire/css/' . $questionnaire->survey->theme . '" />';
} else {
$currentcss = '<link rel="stylesheet" type="text/css" href="' . $CFG->wwwroot . '/mod/questionnaire/css/default.css" />';
}
$course = $questionnaire->course;
print_header($course->shortname . $qp, $course->fullname . $pq . $name, '', '', $currentcss, false);
/// Print the main part of the page
$SESSION->questionnaire_survey_id = $tempsid;
if (isset($formdata->sid) && $formdata->sid != 0) {
$sid = $SESSION->questionnaire_survey_id = $formdata->sid;
} else {
$sid = $SESSION->questionnaire_survey_id;
}
$questionnaire->survey = get_record('questionnaire_survey', 'id', $sid);
$n = count_records('questionnaire_question', 'survey_id', $sid, 'type_id', '99', 'deleted', 'n');
for ($i = 1; $i < $n + 2; $i++) {
$questionnaire->survey_render($i, '', $formdata);
}
close_window_button();
echo '</div></div></body></html>';
break;
}
示例9: set_value
?>
<script type="text/javascript">
//<![CDATA[
function set_value(txt) {
opener.document.getElementById('<?php
echo $chooseparts[0];
?>
').value = txt;
window.close();
}
//]]>
</script>
<?php
}
$icon = 'folder.gif';
$eicon = 'folder-expanded.gif';
$menu = new HTML_TreeMenu();
if ($nodes = $repo->make_root_folder_select_tree()) {
for ($i = 0; $i < count($nodes); $i++) {
$menu->addItem($nodes[$i]);
}
}
$treemenu =& new HTML_TreeMenu_DHTML($menu, array('images' => $CFG->wwwroot . '/lib/HTML_TreeMenu-1.2.0/images'));
require_js($CFG->wwwroot . '/lib/HTML_TreeMenu-1.2.0/TreeMenu.js');
print_simple_box_start('center', '75%');
print_heading(get_string('chooserootfolder', 'repository_alfresco') . ':', 'center', '3');
$treemenu->printMenu();
print_simple_box_end();
echo '<br /><br /><center>' . close_window_button('closewindow', true) . '</center>';
print_footer('empty');
示例10: displayPage
/**
* Displays the browsing page
*
* @param int category course category id
* @param int selected course id of previously selected course
*/
function displayPage($category = 0, $selected = 0)
{
global $CFG;
require_js($CFG->wwwroot . '/curriculum/js/moodlecourseurl.js');
if (!($site = get_site())) {
error('Site isn\'t defined!');
}
$strcourses = get_string('courses');
$strcategories = get_string('categories');
$navigation = array('newnav' => 1, 'navlinks' => '');
// Build root breadcrumb
$navigation['navlinks'] = '<li class="first"><a onclick="this.target=\'_top\'" href="' . $CFG->wwwroot . '/curriculum/coursetemplatepage.php?class=' . $this->_templateType . '&selected=' . $selected . '">Root</a></li><li class="first"> ';
// Build breadcrumb of course subcategories
$navigation['navlinks'] .= $this->buildNavLinks($category, '');
print_header_simple($site->fullname, $site->shortname, $navigation, '', '', true, '', false, '', true);
$categories = $this->getSubCategories($category);
echo '<form name="moodlecourseurl">' . "\n";
foreach ($categories as $key => $category) {
echo $this->printCategories($category, true, $selected);
$courses = $this->getCourses($category->id);
$courses = !empty($courses) ? $courses : array();
foreach ($courses as $key2 => $course) {
echo $this->printCourses($course);
}
if (empty($courses)) {
echo get_string('no_courses', 'block_curr_admin');
}
}
// Add call to highlight previously selected course
echo '<script language=javascript >';
echo 'selectedCourse(' . $selected . ', \'old\');';
echo '</script>';
echo $this->addCss();
echo '</form>' . "\n";
echo '<br />';
close_window_button();
}