本文整理匯總了PHP中print_spacer函數的典型用法代碼示例。如果您正苦於以下問題:PHP print_spacer函數的具體用法?PHP print_spacer怎麽用?PHP print_spacer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了print_spacer函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: print_section_dblistview
function print_section_dblistview($course, $section, $mods, $modnamesused, $absolute = false, $width = "100%")
{
/// Prints a section full of activity modules
global $CFG, $USER;
static $initialised;
static $groupbuttons;
static $groupbuttonslink;
static $isediting;
static $ismoving;
static $strmovehere;
static $strmovefull;
static $strunreadpostsone;
static $usetracking;
static $groupings;
if (!isset($initialised)) {
$groupbuttons = ($course->groupmode or !$course->groupmodeforce);
$groupbuttonslink = !$course->groupmodeforce;
$isediting = isediting($course->id);
$ismoving = $isediting && ismoving($course->id);
if ($ismoving) {
$strmovehere = get_string("movehere");
$strmovefull = strip_tags(get_string("movefull", "", "'{$USER->activitycopyname}'"));
}
include_once $CFG->dirroot . '/mod/forum/lib.php';
if ($usetracking = forum_tp_can_track_forums()) {
$strunreadpostsone = get_string('unreadpostsone', 'forum');
}
$initialised = true;
}
$labelformatoptions = new object();
$labelformatoptions->noclean = true;
/// Casting $course->modinfo to string prevents one notice when the field is null
$modinfo = get_fast_modinfo($course);
//Acccessibility: replace table with list <ul>, but don't output empty list.
if (!empty($section->sequence)) {
// Fix bug #5027, don't want style=\"width:$width\".
echo "<ul class=\"section img-text\">\n";
$sectionmods = explode(",", $section->sequence);
foreach ($sectionmods as $modnumber) {
if (empty($mods[$modnumber])) {
continue;
}
$mod = $mods[$modnumber];
if ($ismoving and $mod->id == $USER->activitycopy) {
// do not display moving mod
continue;
}
if (isset($modinfo->cms[$modnumber])) {
if (!$modinfo->cms[$modnumber]->uservisible) {
// visibility shortcut
continue;
}
} else {
if (!file_exists("{$CFG->dirroot}/mod/{$mod->modname}/lib.php")) {
// module not installed
continue;
}
if (!coursemodule_visible_for_user($mod)) {
// full visibility check
continue;
}
}
// The magic! ... if indent == 1 then ... hide module
// if ($mod->indent == 1) {
// $hiddemodule = 'hidden';
// } else {
// $hiddemodule = '';
// }
echo '<li class="activity ' . $mod->modname . ' ' . $hiddemodule . '" id="module-' . $modnumber . '">';
// Unique ID
if ($ismoving) {
echo '<a title="' . $strmovefull . '"' . ' href="' . $CFG->wwwroot . '/course/mod.php?moveto=' . $mod->id . '&sesskey=' . $USER->sesskey . '">' . '<img class="movetarget" src="' . $CFG->pixpath . '/movehere.gif" ' . ' alt="' . $strmovehere . '" /></a><br />
';
}
if ($mod->indent) {
print_spacer(12, 20 * $mod->indent, false);
}
$extra = '';
if (!empty($modinfo->cms[$modnumber]->extra)) {
$extra = $modinfo->cms[$modnumber]->extra;
}
if ($mod->modname == "label") {
echo "<span class=\"";
if (!$mod->visible) {
echo 'dimmed_text';
} else {
echo 'label';
}
echo '">';
echo format_text($extra, FORMAT_HTML, $labelformatoptions);
echo "</span>";
if (!empty($CFG->enablegroupings) && !empty($mod->groupingid) && has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
if (!isset($groupings)) {
$groupings = groups_get_all_groupings($course->id);
}
echo " <span class=\"groupinglabel\">(" . format_string($groupings[$mod->groupingid]->name) . ')</span>';
}
} else {
// Normal activity
$instancename = format_string($modinfo->cms[$modnumber]->name, true, $course->id);
//.........這裏部分代碼省略.........
示例2: display
//.........這裏部分代碼省略.........
echo '<object type="video/mpeg" data="' . $fullurl . '">';
echo '<param name="controller" value="true" />';
echo '<param name="autostart" value="true" />';
echo "<param name=\"src\" value=\"{$fullurl}\" />";
echo "<a href=\"{$fullurl}\">{$fullurl}</a>";
echo '<!--<![endif]-->';
echo '<a href="' . $fullurl . '">' . $fullurl . '</a>';
echo '<!--[if !IE]>-->';
echo '</object>';
echo '<!--<![endif]-->';
echo '</object>';
echo '</div>';
} else {
if ($resourcetype == "quicktime") {
echo '<style type="text/css">';
echo '/* class to hide nested objects in IE */';
echo '/* hides the second object from all versions of IE */';
echo '* html object.hiddenObjectForIE { display: none; }';
echo '/* display the second object only for IE5 Mac */';
echo '/* IE Mac \\*//*/';
echo '* html object.hiddenObjectForIE { display: inline; }';
echo '/**/';
echo '</style>';
echo '<div class="resourcecontent resourceqt">';
echo '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"';
echo ' codebase="http://www.apple.com/qtactivex/qtplugin.cab">';
echo "<param name=\"src\" value=\"{$fullurl}\" />";
echo '<param name="autoplay" value="true" />';
echo '<param name="loop" value="true" />';
echo '<param name="controller" value="true" />';
echo '<param name="scale" value="aspect" />';
echo "<object class=\"hiddenObjectForIE\" type=\"video/quicktime\" data=\"{$fullurl}\">";
echo '<param name="controller" value="true" />';
echo '<param name="autoplay" value="true" />';
echo '<param name="loop" value="true" />';
echo '<param name="scale" value="aspect" />';
echo '</object>';
echo '<a href="' . $fullurl . '">' . $fullurl . '</a>';
echo '</object>';
echo '</div>';
} else {
if ($resourcetype == "flash") {
echo '<div class="resourcecontent resourceswf">';
echo '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">';
echo "<param name=\"movie\" value=\"{$fullurl}\" />";
echo '<param name="autoplay" value="true" />';
echo '<param name="loop" value="true" />';
echo '<param name="controller" value="true" />';
echo '<param name="scale" value="aspect" />';
echo '<!--[if !IE]>-->';
echo "<object type=\"application/x-shockwave-flash\" data=\"{$fullurl}\">";
echo '<param name="controller" value="true" />';
echo '<param name="autoplay" value="true" />';
echo '<param name="loop" value="true" />';
echo '<param name="scale" value="aspect" />';
echo '<!--<![endif]-->';
echo '<a href="' . $fullurl . '">' . $fullurl . '</a>';
echo '<!--[if !IE]>-->';
echo '</object>';
echo '<!--<![endif]-->';
echo '</object>';
echo '</div>';
} elseif ($resourcetype == 'zip') {
echo '<div class="resourcepdf">';
echo get_string('clicktoopen', 'resource') . '<a href="' . $fullurl . '">' . format_string($resource->name) . '</a>';
echo '</div>';
} elseif ($resourcetype == 'pdf') {
echo '<div class="resourcepdf">';
echo '<object data="' . $fullurl . '" type="application/pdf">';
echo get_string('clicktoopen', 'resource') . '<a href="' . $fullurl . '">' . format_string($resource->name) . '</a>';
echo '</object>';
echo '</div>';
}
}
}
}
}
}
}
if (trim($resource->summary)) {
print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center");
}
if ($inpopup) {
echo "<div class=\"popupnotice\">(<a href=\"{$fullurl}\">{$strdirectlink}</a>)</div>";
} else {
print_spacer(20, 20);
print_footer($course);
}
} else {
// Display the resource on it's own
if (!empty($localpath)) {
// Show a link to help work around browser security
echo '<div align="right" class="helplink">';
link_to_popup_window('/mod/resource/type/file/localpath.php', get_string('localfile', 'resource'), get_string('localfilehelp', 'resource'), 400, 500, get_string('localfilehelp', 'resource'));
echo '</div>';
echo "<div class=\"popupnotice\">(<a href=\"{$fullurl}\">{$fullurl}</a>)</div>";
}
redirect($fullurl);
}
}
示例3: print_category_info
function print_category_info($category, $depth, $showcourses = false)
{
/// Prints the category info in indented fashion
/// This function is only used by print_whole_category_list() above
global $CFG;
static $strallowguests, $strrequireskey, $strsummary;
if (empty($strsummary)) {
$strallowguests = get_string('allowguests');
$strrequireskey = get_string('requireskey');
$strsummary = get_string('summary');
}
$catlinkcss = $category->visible ? '' : ' class="dimmed" ';
$coursecount = count_records('course') <= FRONTPAGECOURSELIMIT;
if ($showcourses and $coursecount) {
$catimage = '<img src="' . $CFG->pixpath . '/i/course.gif" alt="" />';
} else {
$catimage = " ";
}
echo "\n\n" . '<table class="categorylist">';
$courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.guest,c.cost,c.currency');
if ($showcourses and $coursecount) {
echo '<tr>';
if ($depth) {
$indent = $depth * 30;
$rows = count($courses) + 1;
echo '<td class="category indentation" rowspan="' . $rows . '" valign="top">';
print_spacer(10, $indent);
echo '</td>';
}
echo '<td valign="top" class="category image">' . $catimage . '</td>';
echo '<td valign="top" class="category name">';
echo '<a ' . $catlinkcss . ' href="' . $CFG->wwwroot . '/course/category.php?id=' . $category->id . '">' . format_string($category->name) . '</a>';
echo '</td>';
echo '<td class="category info"> </td>';
echo '</tr>';
// does the depth exceed maxcategorydepth
// maxcategorydepth == 0 or unset meant no limit
$limit = !(isset($CFG->maxcategorydepth) && $depth >= $CFG->maxcategorydepth - 1);
if ($courses && ($limit || $CFG->maxcategorydepth == 0)) {
foreach ($courses as $course) {
$linkcss = $course->visible ? '' : ' class="dimmed" ';
echo '<tr><td valign="top"> ';
echo '</td><td valign="top" class="course name">';
echo '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/course/view.php?id=' . $course->id . '">' . format_string($course->fullname) . '</a>';
echo '</td><td align="right" valign="top" class="course info">';
if ($course->guest) {
echo '<a title="' . $strallowguests . '" href="' . $CFG->wwwroot . '/course/view.php?id=' . $course->id . '">';
echo '<img alt="' . $strallowguests . '" src="' . $CFG->pixpath . '/i/guest.gif" /></a>';
} else {
echo '<img alt="" style="width:18px;height:16px;" src="' . $CFG->pixpath . '/spacer.gif" />';
}
if ($course->password) {
echo '<a title="' . $strrequireskey . '" href="' . $CFG->wwwroot . '/course/view.php?id=' . $course->id . '">';
echo '<img alt="' . $strrequireskey . '" src="' . $CFG->pixpath . '/i/key.gif" /></a>';
} else {
echo '<img alt="" style="width:18px;height:16px;" src="' . $CFG->pixpath . '/spacer.gif" />';
}
if ($course->summary) {
link_to_popup_window('/course/info.php?id=' . $course->id, 'courseinfo', '<img alt="' . $strsummary . '" src="' . $CFG->pixpath . '/i/info.gif" />', 400, 500, $strsummary);
} else {
echo '<img alt="" style="width:18px;height:16px;" src="' . $CFG->pixpath . '/spacer.gif" />';
}
echo '</td></tr>';
}
}
} else {
echo '<tr>';
if ($depth) {
$indent = $depth * 20;
echo '<td class="category indentation" valign="top">';
print_spacer(10, $indent);
echo '</td>';
}
echo '<td valign="top" class="category name">';
echo '<a ' . $catlinkcss . ' href="' . $CFG->wwwroot . '/course/category.php?id=' . $category->id . '">' . format_string($category->name) . '</a>';
echo '</td>';
echo '<td valign="top" class="category number">';
if (count($courses)) {
echo count($courses);
}
echo '</td></tr>';
}
echo '</table>';
}
示例4: html_image
$spacer = new html_image();
$spacer->height = 20;
echo $OUTPUT->spacer(clone $spacer) . '<br />';
echo $OUTPUT->heading($solutionsstr);
unset($admin_table->data);
if (isset($errors['dir'])) {
$admin_table->data[] = array($checkdirstr, $checkdiradvicestr);
}
if (isset($errors['db'])) {
$admin_table->data[] = array($checkdbstr, $checkdbadvicestr);
}
$admin_table->data[] = array($runindexerteststr, '<a href="tests/index.php" target="_blank">tests/index.php</a>');
$admin_table->data[] = array($runindexerstr, '<a href="indexersplash.php" target="_blank">indexersplash.php</a>');
echo $OUTPUT->table($admin_table);
echo $OUTPUT->spacer($spacer) . '<br />';
print_spacer(20);
}
/// this is the standard summary table for normal users, shows document counts
$table = new html_table();
$table->tablealign = 'center';
$table->align = array('right', 'left');
$table->wrap = array('nowrap', 'nowrap');
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '500';
$table->data[] = array("<strong>{$databasestr}</strong>", "<em><strong>{$CFG->prefix}" . SEARCH_DATABASE_TABLE . '</strong></em>');
/// add extra fields if we're admin
if (has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
//don't want to confuse users if the two totals don't match (hint: they should)
$table->data[] = array($documentsinindexstr, $indexinfo->indexcount);
//*cough* they should match if deletions were actually removed from the index,
示例5: get_content
function get_content()
{
global $USER, $CFG, $COURSE;
// It need update?
if (email_must_update($this->version)) {
$this->content = get_string('mustupdate', 'block_email_list');
}
// Get course id
if (!empty($COURSE)) {
$this->courseid = $COURSE->id;
}
// If block have content, skip.
if ($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass();
$this->content->items = array();
$this->content->icons = array();
if ($CFG->email_enable_ssl) {
$wwwroot = str_replace('http:', 'https:', $CFG->wwwroot);
} else {
$wwwroot = $CFG->wwwroot;
}
// Get context
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
$emailicon = '<img src="' . $CFG->wwwroot . '/blocks/email_list/email/images/sobre.png" height="11" width="15" alt="' . get_string("course") . '" />';
$composeicon = '<img src="' . $CFG->pixpath . '/i/edit.gif" alt="" />';
// Only show all course in principal course, others, show it
if ($this->instance->pageid == 1) {
//Get the courses of the user
$mycourses = get_my_courses($USER->id);
$this->content->footer = '<br />' . $emailicon . print_spacer(1, 4, false, true) . '<a href="' . $CFG->wwwroot . '/blocks/email_list/email/">' . get_string('view_all', 'block_email_list') . '</a>';
} else {
if (!empty($CFG->mymoodleredirect) and $COURSE->id == 1) {
//Get the courses of the user
$mycourses = get_my_courses($USER->id);
$this->content->footer = '<br />' . $emailicon . print_spacer(1, 4, false, true) . '<a href="' . $CFG->wwwroot . '/blocks/email_list/email/">' . get_string('view_all', 'block_email_list') . '</a>';
} else {
// Get this course
$course = get_record('course', 'id', $this->instance->pageid);
$mycourses[] = $course;
$this->content->footer = '<br />' . $emailicon . print_spacer(1, 4, false, true) . '<a href="' . $CFG->wwwroot . '/blocks/email_list/email/index.php?id=' . $course->id . '">' . get_string('view_inbox', 'block_email_list') . '</a>';
$this->content->footer .= '<br />' . $composeicon . print_spacer(1, 4, false, true) . '<a href="' . $wwwroot . '/blocks/email_list/email/sendmail.php?course=' . $course->id . '&folderid=0&filterid=0&folderoldid=0&action=newmail">' . get_string('compose', 'block_email_list') . '</a>';
}
}
// Count my courses
$countmycourses = count($mycourses);
//Configure item and icon for this account
$icon = '<img src="' . $CFG->wwwroot . '/blocks/email_list/email/images/openicon.gif" height="16" width="16" alt="' . get_string("course") . '" />';
$number = 0;
foreach ($mycourses as $mycourse) {
++$number;
// increment for first course
if ($number > $CFG->email_max_number_courses && !empty($CFG->email_max_number_courses)) {
continue;
}
//Get the number of unread mails
$numberunreadmails = email_count_unreaded_mails($USER->id, $mycourse->id);
// Only show if has unreaded mails
if ($numberunreadmails > 0) {
$unreadmails = '<b>(' . $numberunreadmails . ')</b>';
$this->content->items[] = '<a href="' . $CFG->wwwroot . '/blocks/email_list/email/index.php?id=' . $mycourse->id . '">' . $mycourse->fullname . ' ' . $unreadmails . '</a>';
$this->content->icons[] = $icon;
}
}
if (count($this->content->items) == 0) {
$this->content->items[] = '<div align="center">' . get_string('emptymailbox', 'block_email_list') . '</div>';
}
return $this->content;
}
示例6: print_paging_bar
print_paging_bar($totalcount, $page, $perpage, "search.php?search={$encodedsearch}&perpage={$perpage}&", 'page', $perpage == 99999);
if ($perpage != 99999 && $totalcount > $perpage) {
echo "<center><p>";
echo "<a href=\"search.php?search={$encodedsearch}&perpage=99999\">" . get_string("showall", "", $totalcount) . "</a>";
echo "</p></center>";
}
if (!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
foreach ($courses as $course) {
$course->fullname = highlight("{$search}", $course->fullname);
$course->summary = highlight("{$search}", $course->summary);
$course->summary .= "<br /><p class=\"category\">";
$course->summary .= "{$strcategory}: <a href=\"category.php?id={$course->category}\">";
$course->summary .= $displaylist[$course->category];
$course->summary .= "</a></p>";
print_course($course);
print_spacer(5, 5);
}
} else {
// slightly more sophisticated
echo "<form id=\"movecourses\" action=\"search.php\" method=\"post\">\n";
echo "<div><input type=\"hidden\" name=\"sesskey\" value=\"{$USER->sesskey}\" />\n";
echo "<input type=\"hidden\" name=\"search\" value=\"" . s($search, true) . "\" />\n";
echo "<input type=\"hidden\" name=\"page\" value=\"{$page}\" />\n";
echo "<input type=\"hidden\" name=\"perpage\" value=\"{$perpage}\" /></div>\n";
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"4\" class=\"generalbox boxaligncenter\">\n<tr>\n";
echo "<th scope=\"col\">{$strcourses}</th>\n";
echo "<th scope=\"col\">{$strcategory}</th>\n";
echo "<th scope=\"col\">{$strselect}</th>\n";
echo "<th scope=\"col\">{$stredit}</th></tr>\n";
foreach ($courses as $course) {
if (isset($course->context)) {
示例7: display
//.........這裏部分代碼省略.........
if ($embedded) {
// Display resource embedded in page
$strdirectlink = get_string("directlink", "resource");
if ($inpopup) {
print_header($pagetitle);
} else {
print_header($pagetitle, $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self"));
}
if ($resourcetype == "image") {
echo "<center><p>";
echo "<img title=\"" . strip_tags(format_string($resource->name, true)) . "\" class=\"resourceimage\" src=\"{$fullurl}\" alt=\"\" />";
echo "</p></center>";
} else {
if ($resourcetype == "mp3") {
if (!empty($THEME->resource_mp3player_colors)) {
$c = $THEME->resource_mp3player_colors;
// You can set this up in your theme/xxx/config.php
} else {
$c = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&' . 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&' . 'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes';
}
$c .= '&volText=' . get_string('vol', 'resource') . '&panText=' . get_string('pan', 'resource');
$c = htmlentities($c);
echo '<div class="mp3player" align="center">';
echo '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
echo ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
echo ' width="600" height="70" id="mp3player" align="">';
echo '<param name="movie" value="' . $CFG->wwwroot . '/lib/mp3player/mp3player.swf?src=' . $fullurl . '">';
echo '<param name="quality" value="high">';
echo '<param name="bgcolor" value="#333333">';
echo '<param name="flashvars" value="' . $c . '&" />';
echo '<embed src="' . $CFG->wwwroot . '/lib/mp3player/mp3player.swf?src=' . $fullurl . '" ';
echo ' quality="high" bgcolor="#333333" width="600" height="70" name="mp3player" ';
echo ' type="application/x-shockwave-flash" ';
echo ' flashvars="' . $c . '&" ';
echo ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
echo '</embed>';
echo '</object>';
echo '</div>';
} else {
if ($resourcetype == "mediaplayer") {
echo "<center><p>";
echo '<object classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"';
echo ' codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ';
echo ' standby="Loading Microsoft� Windows� Media Player components..." ';
echo ' id="msplayer" align="" type="application/x-oleobject">';
echo "<param name=\"Filename\" value=\"{$fullurl}\">";
echo '<param name="ShowControls" value="true" />';
echo '<param name="AutoRewind" value="true" />';
echo '<param name="AutoStart" value="true" />';
echo '<param name="Autosize" value="true" />';
echo '<param name="EnableContextMenu" value="true" />';
echo '<param name="TransparentAtStart" value="false" />';
echo '<param name="AnimationAtStart" value="false" />';
echo '<param name="ShowGotoBar" value="false" />';
echo '<param name="EnableFullScreenControls" value="true" />';
echo "\n<embed src=\"{$fullurl}\" name=\"msplayer\" type=\"{$mimetype}\" ";
echo ' ShowControls="1" AutoRewind="1" AutoStart="1" Autosize="0" EnableContextMenu="1"';
echo ' TransparentAtStart="0" AnimationAtStart="0" ShowGotoBar="0" EnableFullScreenControls="1"';
echo ' pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/">';
echo '</embed>';
echo '</object>';
echo "</p></center>";
} else {
if ($resourcetype == "quicktime") {
echo "<center><p>";
echo '<object classid="CLSID:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"';
echo ' codebase="http://www.apple.com/qtactivex/qtplugin.cab" ';
echo ' height="450" width="600"';
echo ' id="quicktime" align="" type="application/x-oleobject">';
echo "<param name=\"src\" value=\"{$fullurl}\" />";
echo '<param name="autoplay" value="true" />';
echo '<param name="loop" value="true" />';
echo '<param name="controller" value="true" />';
echo '<param name="scale" value="aspect" />';
echo "\n<embed src=\"{$fullurl}\" name=\"quicktime\" type=\"{$mimetype}\" ";
echo ' height="450" width="600" scale="aspect"';
echo ' autoplay="true" controller="true" loop="true" ';
echo ' pluginspage="http://quicktime.apple.com/">';
echo '</embed>';
echo '</object>';
echo "</p></center>";
}
}
}
}
if (trim($resource->summary)) {
$formatoptions->noclean = true;
print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center");
}
if ($inpopup) {
echo "<center><p>(<a href=\"{$fullurl}\">{$strdirectlink}</a>)</p></center>";
} else {
print_spacer(20, 20);
print_footer($course);
}
} else {
// Display the resource on it's own
redirect($fullurl);
}
}
示例8: page_print_position
/**
* Prints blocks for a given position
*
* @param array $pageblocks An array of blocks organized by position
* @param char $position Position that we are currently printing
* @return void
**/
function page_print_position($pageblocks, $position, $width)
{
global $PAGE, $THEME;
$editing = $PAGE->user_is_editing();
if ($editing || blocks_have_content($pageblocks, $position)) {
/// Figure out an appropriate ID
switch ($position) {
case BLOCK_POS_LEFT:
$id = 'left';
break;
case BLOCK_POS_RIGHT:
$id = 'right';
break;
case BLOCK_POS_CENTER:
$id = 'middle';
break;
default:
$id = $position;
break;
}
/// Figure out the width - more for routine than being functional. May want to impose a minimum width though
$width = bounded_number($width, blocks_preferred_width($pageblocks[$position]), $width);
/// Print it
if (is_numeric($width)) {
// default to px MR-263
$tdwidth = $width . 'px';
} else {
$tdwidth = $width;
}
echo "<td style=\"width: {$tdwidth}\" id=\"{$id}-column\">";
if (is_numeric($width) or strpos($width, 'px')) {
print_spacer(1, $width, false);
}
print_container_start();
if ($position == BLOCK_POS_CENTER) {
echo skip_main_destination();
page_frontpage_settings();
}
page_blocks_print_group($pageblocks, $position);
print_container_end();
echo '</td>';
} else {
// Empty column - no class, style or width
/// Figure out an appropriate ID
switch ($position) {
case BLOCK_POS_LEFT:
$id = 'left';
break;
case BLOCK_POS_RIGHT:
$id = 'right';
break;
case BLOCK_POS_CENTER:
$id = 'middle';
break;
default:
$id = $position;
break;
}
// we still want to preserve values unles
if ($width != '0') {
if (is_numeric($width)) {
// default to px MR-263
$tdwidth = $width . 'px';
} else {
$tdwidth = $width;
}
echo '<td style="width:' . $tdwidth . '" id="' . $id . '-column" > ';
if ($width != '0' and is_numeric($width) or strpos($width, 'px')) {
print_spacer(1, $width, false);
}
echo "</td>";
} else {
echo '<td></td>';
// 0 means no column anyway
}
}
}
示例9: access_ensure_check_action
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
# --------------------------------------------------------
# $Id: note_preview_page.php,v 1.12 2002/10/06 15:23:36 vboctor Exp $
# --------------------------------------------------------
require_once 'core' . DIRECTORY_SEPARATOR . 'api.php';
access_ensure_check_action(ACTION_NOTES_SUBMIT);
print_html_top();
print_head_top();
print_title($g_window_title);
print_css($g_css_inc_file);
theme_head();
print_head_bottom();
print_body_top();
print_header($g_page_title);
print_spacer();
$f_note_id = gpc_get_int('f_note_id');
$f_page_id = gpc_get_int('f_page_id');
$f_email = gpc_get_string('f_email');
$f_note = gpc_get_string('f_note');
$t_page_info = page_get_info(page_where_id_equals($f_page_id));
if (false === $t_page_info) {
echo "page not found";
exit;
}
$t_note['id'] = '0';
$t_note['email'] = string_prepare_note_for_viewing($f_email);
$t_note['date'] = time();
$t_note['note'] = string_prepare_note_for_viewing($f_note);
$t_page_data = array();
$t_page_data['id'] = 0;
示例10: render_diro
private static function render_diro(&$text, $depth, $name, $id, $path)
{
global $CFG;
$text[] = str_repeat("\t", $depth + 1) . '<li class="r0">';
$text[] = '<div title="' . htmlspecialchars(implode('/', $path)) . '" style="cursor:pointer;"' . ' onclick="return sharing_cart.toggle(this, ' . $id . ');">';
$text[] = '<div class="column c0">';
if ($depth) {
$text[] = print_spacer(10, $depth * 10, false, true);
}
$text[] = '<img id="sharing_cart_' . $id . '_icon" src="' . $CFG->pixpath . '/i/open.gif" alt="" />' . '</div>';
$text[] = '<div class="column c1">' . htmlspecialchars($name) . '</div>';
$text[] = '</div>';
$text[] = '<ul id="sharing_cart_' . $id . '_item" class="list">' . "\n";
}
示例11: print_materials_selector
function print_materials_selector($title, $variable1, $variable2)
{
print_title($title);
?>
<ul>
<li ng-repeat="<?php
echo $variable1;
?>
in dataModel.<?php
echo $variable1;
?>
">
<?php
print_spacer();
?>
<span style="display:inline-block;width:6em;"><input type="checkbox" ng-model="<?php
echo $variable1;
?>
.value" ng-change="change()">{{<?php
echo $variable1;
?>
.text}}</input></span>
<input type="checkbox" ng-model="<?php
echo $variable1;
?>
.surface" ng-change="change()">painting surface</input><br />
</li>
</ul>
<?php
print_spacer();
?>
Other:
<ul>
<li ng-repeat="<?php
echo $variable2;
?>
in dataModel.<?php
echo $variable2;
?>
">
<?php
print_remove($variable2);
?>
<input type="text" ng-model="<?php
echo $variable2;
?>
.text"
typeahead="label as label.display for label in suggestWikidata($viewValue, $index)"
typeahead-min-length="1" typeahead-on-select="onSelectLine('<?php
echo $variable2;
?>
', $item)" size="65" />
<input type="checkbox" ng-model="<?php
echo $variable2;
?>
.surface" ng-change="change()">painting surface</input><br ng-if="<?php
echo $variable2;
?>
.wikidata" />
<small><span class="separator" style="width:30px;"> </span><span ng-if="<?php
echo $variable2;
?>
.wikidata">{{<?php
echo $variable2;
?>
.description}}</span><span ng-if="<?php
echo $variable2;
?>
.wikidata"> ·
<a href="https://www.wikidata.org/wiki/{{<?php
echo $variable2;
?>
.wikidata}}">{{<?php
echo $variable2;
?>
.wikidata}}</a></span></small>
</li>
</ul>
<?php
print_add_line($variable2);
}
示例12: setup_elements
function setup_elements(&$mform)
{
global $CFG;
require_once $CFG->libdir . '/biblelib.php';
//remove these so we have ui control of where name goes later
$mform->removeElement('general');
$mform->removeElement('name');
/// sermon date
$mform->addElement('html', '<table id="sermondetails-table" border="0" width="100%">
<tr><td>');
$mform->addElement('static', null, null, '<span class="sermon-delivery-title">' . get_string('sermonddeliverydate', 'resource') . '</span>');
$mform->addElement('html', '<div id="datedelivered-picker"></div>' . '<script type="text/javascript">
jQuery(document).ready(function () {
jQuery("#datedelivered-picker").datepicker({ dateFormat: "@",
onSelect: function(dateText, inst){jQuery(".datedelivered").val(dateText)},
defaultDate: jQuery(".datedelivered").val()
});
})
</script>' . print_spacer(0, 250, false, true) . '
</td><td>');
$mform->addElement('hidden', 'datedelivered', 'testing', array('class' => 'datedelivered'));
/// sermon info
mform_partition_start($mform);
$mform->addElement('text', 'name', get_string('name'), array('size' => '48'));
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$previousseries = get_recordset_sql("SELECT DISTINCT seriesname FROM {$CFG->prefix}resource_sermon ORDER BY seriesname DESC");
$seriesoptions = array(0 => get_string('selectpreviousseries', 'resource'));
while (($series = rs_fetch_next_record($previousseries)) !== false) {
$seriesoptions[$series->seriesname] = $series->seriesname;
}
$mform->addElement('select', 'seriesname', get_string('series', 'resource'), $seriesoptions);
mform_spacer($mform, null, get_string('or', 'resource'));
$newseries = array();
$newseries[] =& MoodleQuickForm::createelement('text', 'newseriesname', get_string('newseriesname', 'resource'));
$newseries[] =& MoodleQuickForm::createelement('checkbox', 'newseries', get_string('newseries', 'resource'));
$mform->addGroup($newseries, null, get_string('newseriesname', 'resource'));
$mform->disabledIf('newseriesname', 'newseries', 'notchecked');
$mform->disabledIf('seriesname', 'newseries', 'checked');
mform_partition_end($mform);
mform_partition_start($mform);
/// link to sermon mp3
$mform->addElement('html', '<span class="nowrap">');
$mform->addElement('choosecoursefile', 'reference', get_string('sermonmp3', 'resource'), null, array('maxlength' => 255, 'size' => 18));
$mform->addGroupRule('reference', array('value' => array(array(get_string('maximumchars', '', 255), 'maxlength', 255, 'server'))));
$mform->addRule('reference', null, 'required', null, 'client');
$mform->addElement('html', '</span>');
/// link to sermon pdf
$mform->addElement('html', '<span class="nowrap">');
$mform->addElement('choosecoursefile', 'referencesermontext', get_string('sermontext', 'resource'), null, array('maxlength' => 255, 'size' => 18));
$mform->addGroupRule('referencesermontext', array('value' => array(array(get_string('maximumchars', '', 255), 'maxlength', 255, 'client'))));
$mform->addElement('html', '</span>');
/// link to reference lesson
$mform->addElement('html', '<span class="nowrap">');
$mform->addElement('choosecoursefile', 'referencelesson', get_string('sermonlesson', 'resource'), null, array('maxlength' => 255, 'size' => 18));
$mform->addGroupRule('referencelesson', array('value' => array(array(get_string('maximumchars', '', 255), 'maxlength', 255, 'client'))));
$mform->addElement('html', '</span>');
mform_partition_end($mform);
/// add the bible place fields
mform_partition_start($mform);
$mform->addElement('html', '<span class="nowrap">');
$biblebooks = array_merge(array('' => get_string('choosebook', 'resource')), biblebooks_array());
$bibleplace = array();
$bibleplace[] =& MoodleQuickForm::createElement('select', 'book', get_string('biblebook', 'resource'), $biblebooks);
$bibleplace[] =& MoodleQuickForm::createElement('text', 'beginchapter', get_string('beginchapter', 'resource'), 'size="5"');
$mform->addGroup($bibleplace, null, get_string('biblebook', 'resource'), get_string('biblechapter', 'resource'));
$mform->addElement('html', '</span>');
mform_partition_end($mform);
/// speaker fields
mform_partition_start($mform);
//these are a list of members with the ones who have given sermons in the past at the top of the list
$potentialspeakers = get_recordset_sql("SELECT DISTINCT u.* FROM {$CFG->prefix}user u \n LEFT JOIN {$CFG->prefix}resource_sermon rs ON u.id = rs.speakerid\n LEFT JOIN {$CFG->prefix}user u2 ON u2.id = rs.speakerid\n WHERE u.username != 'guest'\n ORDER BY u2.lastname ASC, u.lastname ASC");
$speakeroptions = array(0 => get_string('selectfromexistinguser', 'resource'));
while (($potentialspeaker = rs_fetch_next_record($potentialspeakers)) !== false) {
$speakeroptions[$potentialspeaker->id] = $potentialspeaker->lastname . ', ' . $potentialspeaker->firstname;
}
$mform->addElement('select', 'speakerid', get_string('speakerbyid', 'resource'), $speakeroptions);
mform_spacer($mform, null, get_string('or', 'resource'));
$guestspeakergroup = array();
$guestspeakergroup[] =& MoodleQuickForm::createElement('text', 'guestspeakername', get_string('guestspeakername', 'resource'));
$guestspeakergroup[] =& MoodleQuickForm::createElement('checkbox', 'guestspeaker', null);
$mform->addGroup($guestspeakergroup, null, get_string('guestspeakername', 'resource'));
$mform->disabledIf('guestspeakername', 'guestspeaker', 'notchecked');
$mform->disabledIf('speakerid', 'guestspeaker', 'checked');
mform_partition_end($mform);
/// searchable sermon text
$mform->addElement('static', 'label', '<span class="searchsermontxt">' . get_string('searchablesermontext', 'resource') . '</span>');
$mform->addElement('textarea', 'searchablesermontext', null, array('rows' => 10, 'cols' => 70));
$mform->setType('searchablesermontext', PARAM_TEXT);
$mform->addElement('html', '</td></tr></table>');
// no need for description
$mform->removeElement('summary');
}
示例13: blocks_print_group
</td>
</tr>
</table>
</td>
<?php
print '<!-- End page content -->' . "\n";
// The right column
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
echo '<td style="vertical-align: top; width: ' . $preferred_width_right . 'px;" id="right-column">';
echo '<!-- Begin right side blocks -->' . "\n";
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
print_spacer(1, 120, true);
echo '<!-- End right side blocks -->' . "\n";
echo '</td>';
}
?>
</tr>
</table>
<?php
print_footer($course);
示例14: fn_print_mandatory_section
function fn_print_mandatory_section(&$course, &$mods, &$modnamesused, &$sections)
{
global $CFG, $USER, $THEME;
$labeltext = '';
$activitytext = '';
/// Determine order using all sections.
$orderedmods = array();
foreach ($sections as $section) {
$modseq = explode(",", $section->sequence);
if (!empty($modseq)) {
foreach ($modseq as $modnum) {
if (!empty($mods[$modnum]) && $mods[$modnum]->mandatory && $mods[$modnum]->visible) {
$orderedmods[] = $mods[$modnum];
}
}
}
}
$modinfo = unserialize($course->modinfo);
foreach ($orderedmods as $mod) {
if ($mod->mandatory && $mod->visible) {
$instancename = urldecode($modinfo[$mod->id]->name);
if (!empty($CFG->filterall)) {
$instancename = filter_text("<nolink>{$instancename}</nolink>", $course->id);
}
if (!empty($modinfo[$mod->id]->extra)) {
$extra = urldecode($modinfo[$mod->id]->extra);
} else {
$extra = "";
}
if (!empty($modinfo[$mod->id]->icon)) {
$icon = "{$CFG->pixpath}/" . urldecode($modinfo[$mod->id]->icon);
} else {
$icon = "{$CFG->modpixpath}/{$mod->modname}/icon.gif";
}
if ($mod->indent) {
print_spacer(12, 20 * $mod->indent, false);
}
if ($mod->modname == "label") {
if (!$mod->visible) {
$labeltext .= "<span class=\"dimmed_text\">";
}
$labeltext .= format_text($extra, FORMAT_HTML);
if (!$mod->visible) {
$labeltext .= "</span>";
}
$labeltext .= '<br />';
} else {
if ($mod->modname == "resource") {
$linkcss = $mod->visible ? "" : " class=\"dimmed\" ";
$alttext = isset($link_title[$mod->modname]) ? $link_title[$mod->modname] : $mod->modfullname;
$labeltext .= "<img src=\"{$icon}\"" . " height=16 width=16 alt=\"{$alttext}\">" . " <font size=2><a title=\"{$alttext}\" {$linkcss} {$extra}" . " href=\"{$CFG->wwwroot}/mod/{$mod->modname}/view.php?id={$mod->id}\">{$instancename}</a></font><br />";
} else {
// Normal activity
$act_compl = is_activity_complete($mod, $USER->id);
if ($act_compl === false) {
$linkcss = $mod->visible ? "" : " class=\"dimmed\" ";
$alttext = isset($link_title[$mod->modname]) ? $link_title[$mod->modname] : $mod->modfullname;
$activitytext .= "<img src=\"{$icon}\"" . " height=16 width=16 alt=\"{$alttext}\">" . " <font size=2><a title=\"{$alttext}\" {$linkcss} {$extra}" . " href=\"{$CFG->wwwroot}/mod/{$mod->modname}/view.php?id={$mod->id}\">{$instancename}</a></font><br />";
}
}
}
}
}
print_simple_box('<div align="right">' . $labeltext . '</div>', 'center', '100%');
// print_simple_box('<div align="left">'.$activitytext.'</div>', 'center', '100%');
}
示例15: email_convert_tree_to_html
function email_convert_tree_to_html($tree, $row = 0)
{
$str = "\n" . '<ul class="tabrow' . $row . '">' . "\n";
$first = true;
$count = count($tree);
foreach ($tree as $tab) {
$count--;
// countdown to zero
$liclass = '';
if ($first && $count == 0) {
// Just one in the row
$liclass = 'first last';
$first = false;
} else {
if ($first) {
$liclass = 'first';
$first = false;
} else {
if ($count == 0) {
$liclass = 'last';
}
}
}
if (empty($tab->subtree) && !empty($tab->selected)) {
$liclass .= empty($liclass) ? 'onerow' : ' onerow';
}
if ($tab->inactive || $tab->active || $tab->selected && !$tab->linkedwhenselected) {
if ($tab->selected) {
$liclass .= empty($liclass) ? 'here selected' : ' here selected';
} else {
if ($tab->active) {
$liclass .= empty($liclass) ? 'here active' : ' here active';
}
}
}
$str .= !empty($liclass) ? '<li class="' . $liclass . '">' : '<li>';
if ($tab->inactive || $tab->active || $tab->selected && !$tab->linkedwhenselected) {
$str .= '<a href="#" title="' . $tab->title . '"><span>' . $tab->text . print_spacer(1, 4, false, true) . $tab->img . '</span></a>';
} else {
$str .= '<a href="' . $tab->link . '" title="' . $tab->title . '"><span>' . $tab->text . print_spacer(1, 4, false, true) . $tab->img . '</span></a>';
}
if (!empty($tab->subtree)) {
$str .= convert_tree_to_html($tab->subtree, $row + 1);
} else {
if ($tab->selected) {
$str .= '<div class="tabrow' . ($row + 1) . ' empty"> </div>' . "\n";
}
}
$str .= ' </li>' . "\n";
}
$str .= '</ul>' . "\n";
return $str;
}