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


PHP calendar_filter_controls函数代码示例

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


在下文中一共展示了calendar_filter_controls函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: get_content

 /**
  * Return the content of this block.
  *
  * @return stdClass the content
  */
 public function get_content()
 {
     global $CFG;
     $calm = optional_param('cal_m', 0, PARAM_INT);
     $caly = optional_param('cal_y', 0, PARAM_INT);
     $time = optional_param('time', 0, PARAM_INT);
     require_once $CFG->dirroot . '/calendar/lib.php';
     if ($this->content !== null) {
         return $this->content;
     }
     // If a day, month and year were passed then convert it to a timestamp. If these were passed then we can assume
     // the day, month and year are passed as Gregorian, as no where in core should we be passing these values rather
     // than the time. This is done for BC.
     if (!empty($calm) && !empty($caly)) {
         $time = make_timestamp($caly, $calm, 1);
     } else {
         if (empty($time)) {
             $time = time();
         }
     }
     $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!
     $courseid = $this->page->course->id;
     $issite = $courseid == SITEID;
     if ($issite) {
         // 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 = calendar_get_default_courses();
     } else {
         // Forcibly filter events to include only those from the particular course we are in.
         $filtercourse = array($courseid => $this->page->course);
     }
     list($courses, $group, $user) = calendar_set_filters($filtercourse);
     if ($issite) {
         // For the front page.
         $this->content->text .= calendar_get_mini($courses, $group, $user, false, false, 'frontpage', $courseid, $time);
         // No filters for now.
     } else {
         // For any other course.
         $this->content->text .= calendar_get_mini($courses, $group, $user, false, false, 'course', $courseid, $time);
         $this->content->text .= '<h3 class="eventskey">' . get_string('eventskey', 'calendar') . '</h3>';
         $this->content->text .= '<div class="filters calendar_filters">' . calendar_filter_controls($this->page->url) . '</div>';
     }
     return $this->content;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:54,代码来源:block_calendar_month.php

示例3: get_content

 function get_content()
 {
     global $USER, $CFG, $SESSION;
     $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;
     }
     $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!
     $courseid = $this->page->course->id;
     $issite = $courseid == SITEID;
     if ($issite) {
         // 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 = calendar_get_default_courses();
     } else {
         // Forcibly filter events to include only those from the particular course we are in.
         $filtercourse = array($courseid => $this->page->course);
     }
     list($courses, $group, $user) = calendar_set_filters($filtercourse);
     if ($issite) {
         // For the front page
         $this->content->text .= calendar_top_controls('frontpage', array('id' => $courseid, '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_top_controls('course', array('id' => $courseid, '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($this->page->url) . '</div>';
     }
     return $this->content;
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:40,代码来源:block_calendar_month.php

示例4: fake_block_filters

 /**
  * Produces the content for the filters block (pretend block)
  *
  * @param int $courseid
  * @param int $day
  * @param int $month
  * @param int $year
  * @param int $view
  * @param int $courses
  * @return string
  */
 public function fake_block_filters($courseid, $day, $month, $year, $view, $courses)
 {
     $returnurl = $this->page->url;
     $returnurl->param('course', $courseid);
     return html_writer::tag('div', calendar_filter_controls($returnurl), array('class' => 'calendar_filters filters'));
 }
开发者ID:abhilash1994,项目名称:moodle,代码行数:17,代码来源:renderer.php

示例5: calendar_get_default_courses

        break;
}
echo '</td>';
// START: Last column (3-month display)
$defaultcourses = calendar_get_default_courses();
//calendar_set_filters($courses, $groups, $users, $defaultcourses, $defaultcourses);
// when adding an event you can not be a guest, so I think it's reasonalbe to ignore defaultcourses
// MDL-10353
calendar_set_filters($courses, $groups, $users);
list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
echo '<td class="sidecalendar">';
echo '<div class="sideblock">';
echo '<div class="header"><h2>' . get_string('eventskey', 'calendar') . '</h2></div>';
echo '<div class="filters">';
echo calendar_filter_controls('event', 'action=' . $action . '&amp;type=' . $eventtype . '&amp;id=' . $eventid);
echo '</div>';
echo '</div>';
echo '<div class="sideblock">';
echo '<div class="header"><h2>' . get_string('monthlyview', 'calendar') . '</h2></div>';
echo '<div class="minicalendarblock minicalendartop">';
echo calendar_top_controls('display', array('id' => $urlcourse, 'm' => $prevmon, 'y' => $prevyr));
echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $urlcourse, 'm' => $mon, 'y' => $yr));
echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $urlcourse, 'm' => $nextmon, 'y' => $nextyr));
echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
echo '</div>';
echo '</div>';
开发者ID:NextEinstein,项目名称:riverhills,代码行数:31,代码来源:event.php

示例6: list

    }
}
echo '</div>';
echo '</div>';
echo '</td>';
// END: Main column
// START: Last column (3-month display)
echo '<td class="sidecalendar">';
list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
$getvars = 'id=' . $courseid . '&amp;cal_d=' . $day . '&amp;cal_m=' . $mon . '&amp;cal_y=' . $yr;
// For filtering
echo '<div class="sideblock">';
echo '<div class="header"><h2>' . get_string('eventskey', 'calendar') . '</h2></div>';
echo '<div class="filters">';
echo calendar_filter_controls($view, $getvars, NULL, $courses);
echo '</div>';
echo '</div>';
echo '<div class="sideblock">';
echo '<div class="header"><h2>' . get_string('monthlyview', 'calendar') . '</h2></div>';
echo '<div class="minicalendarblock minicalendartop">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $prevmon, 'y' => $prevyr));
echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $mon, 'y' => $yr));
echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $nextmon, 'y' => $nextyr));
echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
echo '</div>';
echo '</div>';
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:view.php

示例7: get_string

// print_footer($course);
?>

<?php 
echo '</div>';
echo '</td>';
// END: Main column
// START: Last column (3-month display)
echo '<td class="sidecalendar">';
echo '<div class="header">' . get_string('monthlyview', 'calendar') . '</div>';
list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
$getvars = 'id=' . $course->id . '&amp;cal_d=' . $day . '&amp;cal_m=' . $mon . '&amp;cal_y=' . $yr;
// For filtering
echo '<div class="filters">';
echo calendar_filter_controls($view, $getvars);
echo '</div>';
echo '<div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $prevmon, 'y' => $prevyr));
echo calendar_get_mini($courses, $groups, $users, $prevmon, $prevyr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $mon, 'y' => $yr));
echo calendar_get_mini($courses, $groups, $users, $mon, $yr);
echo '</div><div class="minicalendarblock">';
echo calendar_top_controls('display', array('id' => $courseid, 'm' => $nextmon, 'y' => $nextyr));
echo calendar_get_mini($courses, $groups, $users, $nextmon, $nextyr);
echo '</div>';
echo '</td>';
echo '</tr></table>';
/// Finish the page
print_footer($course);
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:edit_webclass.php

示例8: fake_block_filters

 /**
  * Produces the content for the filters block (pretend block)
  *
  * @param int $courseid
  * @param int $day
  * @param int $month
  * @param int $year
  * @param int $view
  * @param int $courses
  * @return string
  */
 public function fake_block_filters($courseid, $day, $month, $year, $view, $courses)
 {
     $getvars = 'id=' . $courseid . '&amp;cal_d=' . $day . '&amp;cal_m=' . $month . '&amp;cal_y=' . $year;
     return html_writer::tag('div', calendar_filter_controls($view, $getvars, NULL, $courses), array('class' => 'calendar_filters filters'));
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:16,代码来源:renderer.php


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