当前位置: 首页>>代码示例>>PHP>>正文


PHP calendar_overlib_html函数代码示例

本文整理汇总了PHP中calendar_overlib_html函数的典型用法代码示例。如果您正苦于以下问题:PHP calendar_overlib_html函数的具体用法?PHP calendar_overlib_html怎么用?PHP calendar_overlib_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了calendar_overlib_html函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_content

 function get_content()
 {
     global $USER, $CFG, $SESSION, $COURSE;
     $cal_m = optional_param('cal_m', 0, PARAM_INT);
     $cal_y = optional_param('cal_y', 0, PARAM_INT);
     require_once $CFG->dirroot . '/calendar/lib.php';
     if ($this->content !== NULL) {
         return $this->content;
     }
     // Reset the session variables
     calendar_session_vars($COURSE);
     $this->content = new stdClass();
     $this->content->text = '';
     $this->content->footer = '';
     // [pj] To me it looks like this if would never be needed, but Penny added it
     // when committing the /my/ stuff. Reminder to discuss and learn what it's about.
     // It definitely needs SOME comment here!
     $courseshown = $COURSE->id;
     if ($courseshown == SITEID) {
         // Being displayed at site level. This will cause the filter to fall back to auto-detecting
         // the list of courses it will be grabbing events from.
         $filtercourse = NULL;
         $groupeventsfrom = NULL;
         $SESSION->cal_courses_shown = calendar_get_default_courses(true);
         calendar_set_referring_course(0);
     } else {
         // Forcibly filter events to include only those from the particular course we are in.
         $filtercourse = array($courseshown => $COURSE);
         $groupeventsfrom = array($courseshown => 1);
     }
     // We 'll need this later
     calendar_set_referring_course($courseshown);
     // MDL-9059, set to show this course when admins go into a course, then unset it.
     if ($COURSE->id != SITEID && !isset($SESSION->cal_courses_shown[$COURSE->id]) && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_SYSTEM))) {
         $courseset = true;
         $SESSION->cal_courses_shown[$COURSE->id] = $COURSE;
     }
     // Be VERY careful with the format for default courses arguments!
     // Correct formatting is [courseid] => 1 to be concise with moodlelib.php functions.
     calendar_set_filters($courses, $group, $user, $filtercourse, $groupeventsfrom, false);
     if ($courseshown == SITEID) {
         // For the front page
         $this->content->text .= calendar_overlib_html();
         $this->content->text .= calendar_top_controls('frontpage', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y));
         $this->content->text .= calendar_get_mini($courses, $group, $user, $cal_m, $cal_y);
         // No filters for now
     } else {
         // For any other course
         $this->content->text .= calendar_overlib_html();
         $this->content->text .= calendar_top_controls('course', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y));
         $this->content->text .= calendar_get_mini($courses, $group, $user, $cal_m, $cal_y);
         $this->content->text .= '<h3 class="eventskey">' . get_string('eventskey', 'calendar') . '</h3>';
         $this->content->text .= '<div class="filters">' . calendar_filter_controls('course', '', $COURSE) . '</div>';
     }
     // MDL-9059, unset this so that it doesn't stay in session
     if (!empty($courseset)) {
         unset($SESSION->cal_courses_shown[$COURSE->id]);
     }
     return $this->content;
 }
开发者ID:r007,项目名称:PMoodle,代码行数:60,代码来源:block_calendar_month.php

示例2: stripslashes_recursive

        $title = '';
        break;
}
$form = stripslashes_recursive($form);
if (!empty($SESSION->cal_course_referer)) {
    // TODO: This is part of the Great $course Hack in Moodle. Replace it at some point.
    $course = get_record('course', 'id', $SESSION->cal_course_referer);
} else {
    $course = $site;
}
require_login($course, false);
$navlinks[] = $calendar_navlink;
$navlinks[] = array('name' => $title, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header($site->shortname . ': ' . $strcalendar . ': ' . $title, $strcalendar, $navigation, 'eventform.name', '', true, '', user_login_string($site));
echo calendar_overlib_html();
echo '<table id="calendar">';
echo '<tr><td class="maincalendar">';
switch ($action) {
    case 'delete':
        $confirm = optional_param('confirm', 0, PARAM_INT);
        $repeats = optional_param('repeats', 0, PARAM_INT);
        if ($confirm and confirm_sesskey()) {
            // Kill it and redirect to day view
            if (($event = get_record('event', 'id', $eventid)) !== false) {
                if ($event->repeatid && $repeats) {
                    delete_records('event', 'repeatid', $event->repeatid);
                    add_to_log($event->courseid, 'calendar', 'delete all', '', $event->name);
                } else {
                    delete_records('event', 'id', $eventid);
                    add_to_log($event->courseid, 'calendar', 'delete', '', $event->name);
开发者ID:NextEinstein,项目名称:riverhills,代码行数:31,代码来源:event.php

示例3: startCalendar

function startCalendar($course)
{
    $view = optional_param('view', 'upcoming', PARAM_ALPHA);
    $day = optional_param('cal_d', 0, PARAM_INT);
    $mon = optional_param('cal_m', 0, PARAM_INT);
    $yr = optional_param('cal_y', 0, PARAM_INT);
    // Initialize the session variables
    calendar_session_vars();
    //add_to_log($course->id, "course", "view", "view.php?id=$course->id", "$course->id");
    $now = usergetdate(time());
    $pagetitle = '';
    $nav = calendar_get_link_tag(get_string('calendar', 'calendar'), CALENDAR_URL . 'view.php?view=upcoming&amp;course=' . $course->id . '&amp;', $now['mday'], $now['mon'], $now['year']);
    if (!checkdate($mon, $day, $yr)) {
        $day = intval($now['mday']);
        $mon = intval($now['mon']);
        $yr = intval($now['year']);
    }
    $time = make_timestamp($yr, $mon, $day);
    switch ($view) {
        case 'day':
            $nav .= ' -> ' . userdate($time, get_string('strftimedate'));
            $pagetitle = get_string('dayview', 'calendar');
            break;
        case 'month':
            $nav .= ' -> ' . userdate($time, get_string('strftimemonthyear'));
            $pagetitle = get_string('detailedmonthview', 'calendar');
            break;
        case 'upcoming':
            $pagetitle = get_string('upcomingevents', 'calendar');
            break;
    }
    // If a course has been supplied in the URL, change the filters to show that one
    if (!empty($course->id)) {
        if ($course = get_record('course', 'id', $course->id)) {
            if ($course->id == SITEID) {
                // If coming from the home page, show all courses
                $SESSION->cal_courses_shown = calendar_get_default_courses(true);
                calendar_set_referring_course(0);
            } else {
                // Otherwise show just this one
                $SESSION->cal_courses_shown = $course->id;
                calendar_set_referring_course($SESSION->cal_courses_shown);
            }
        }
    } else {
        $course = null;
    }
    if (empty($USER->id) or isguest()) {
        $defaultcourses = calendar_get_default_courses();
        calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses);
    } else {
        calendar_set_filters($courses, $groups, $users);
    }
    // Let's see if we are supposed to provide a referring course link
    // but NOT for the "main page" course
    if ($SESSION->cal_course_referer != SITEID && ($shortname = get_field('course', 'shortname', 'id', $SESSION->cal_course_referer)) !== false) {
        // If we know about the referring course, show a return link and ALSO require login!
        require_login();
        $nav = '<a href="' . $CFG->wwwroot . '/course/view.php?id=' . $SESSION->cal_course_referer . '">' . $shortname . '</a> -> ' . $nav;
        if (empty($course)) {
            $course = get_record('course', 'id', $SESSION->cal_course_referer);
            // Useful to have around
        }
    }
    $strcalendar = get_string('calendar', 'calendar');
    $prefsbutton = calendar_preferences_button();
    /// Print the page header
    if ($course->category) {
        $navigation = "<a href=\"../../course/view.php?id={$course->id}\">{$course->shortname}</a> ->";
    } else {
        $navigation = '';
    }
    echo calendar_overlib_html();
    // Layout the whole page as three big columns.
    echo '<table id="calendar" style="height:100%;">';
    echo '<tr>';
    // START: Main column
    /// Print the main part of the pageecho $user;
    echo '<td class="maincalendar">';
    echo '<div class="heightcontainer">';
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:81,代码来源:calendarLib.php

示例4: setlocale

    $courseset = true;
    $SESSION->cal_courses_shown[$COURSE->id] = $COURSE;
}
if (current_language() == 'he_utf8') {
    // nadavkav
    setlocale(LC_TIME, 'he_IL.utf8');
}
if (current_language() == 'en_utf8') {
    setlocale(LC_TIME, 'en_US');
}
// Be VERY careful with the format for default courses arguments!
// Correct formatting is [courseid] => 1 to be concise with moodlelib.php functions.
calendar_set_filters($courses, $group, $user, $filtercourse, $groupeventsfrom, false);
if ($courseshown == SITEID) {
    // For the front page
    $calendar .= calendar_overlib_html();
    $calendar .= calendar_top_controls('frontpage', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y));
    $calendar .= calendar_get_mini($courses, $group, $user, $cal_m, $cal_y);
    // No filters for now
} else {
    // For any other course
    //echo '<div id="topcalendar"><div id="calendarview">'.calendar_overlib_html();
    //echo calendar_top_controls('course', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y));
    // Layout the whole page as three big columns.
    echo '<table id="calendartable" style="height:100%;">';
    echo '<tr>';
    // START: Main column
    echo '<td class="maincalendar">';
    //$calendar .= calendar_get_mini($courses, $group, $user, $cal_m, $cal_y).'</div>';
    echo calendar_show_month_detailed($cal_m, $cal_y, $courses, $group, $user, $courseshown);
    //$calendar .= '<div id="calendarfilters"><h3 class="eventskey">'.get_string('eventskey', 'calendar').'</h3>';
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:format.php


注:本文中的calendar_overlib_html函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。