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


PHP calendar_preferences_button函数代码示例

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


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

示例1: calendar_get_default_courses

    $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) {
    require_login();
    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 title and header
$navigation = build_navigation($navlinks);
print_header("{$site->shortname}: {$strcalendar}: {$pagetitle}", $strcalendar, $navigation, '', '', true, $prefsbutton, user_login_string($site));
echo calendar_overlib_html();
// Layout the whole page as three big columns.
echo '<table id="calendar" style="height:100%;">';
echo '<tr>';
// START: Main column
echo '<td class="maincalendar">';
echo '<div class="heightcontainer">';
switch ($view) {
    case 'day':
        calendar_show_day($day, $mon, $yr, $courses, $groups, $users, $courseid);
        break;
    case 'month':
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:view.php

示例2: print_error

                // If exception caught, then user should be redirected to page where he/she came from.
                print_error($e->errorcode, $e->module, $PAGE->url);
            }
        } else {
            print_error('nopermissions', 'error', $PAGE->url, get_string('managesubscriptions', 'calendar'));
        }
    }
}
$sql = 'SELECT *
          FROM {event_subscriptions}
         WHERE courseid = :courseid
            OR (courseid = 0 AND userid = :userid)';
$params = array('courseid' => $courseid, 'userid' => $USER->id);
$subscriptions = $DB->get_records_sql($sql, $params);
// Print title and header.
$PAGE->set_title("{$course->shortname}: " . get_string('calendar', 'calendar') . ": " . get_string('subscriptions', 'calendar'));
$PAGE->set_heading($course->fullname);
$PAGE->set_button(calendar_preferences_button($course));
$renderer = $PAGE->get_renderer('core_calendar');
echo $OUTPUT->header();
// Filter subscriptions which user can't edit.
foreach ($subscriptions as $subscription) {
    if (!calendar_can_edit_subscription($subscription)) {
        unset($subscriptions[$subscription->id]);
    }
}
// Display a table of subscriptions.
echo $renderer->subscription_details($courseid, $subscriptions, $importresults);
// Display the add subscription form.
$form->display();
echo $OUTPUT->footer();
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:31,代码来源:managesubscriptions.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


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