[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/blog/ -> preferences.php (source)

   1  <?php  // $Id: preferences.php,v 1.18.2.1 2008/04/30 04:45:22 dongsheng Exp $
   2         // preferences.php - user prefs for blog modeled on calendar
   3  
   4      require_once ('../config.php');
   5      require_once($CFG->dirroot.'/blog/lib.php');
   6  
   7      $courseid = optional_param('courseid', SITEID, PARAM_INT);
   8  
   9      if ($courseid == SITEID) {
  10          require_login();
  11          $context = get_context_instance(CONTEXT_SYSTEM);
  12      } else {
  13          require_login($courseid);
  14          $context = get_context_instance(CONTEXT_COURSE, $courseid);
  15      }
  16  
  17      if (empty($CFG->bloglevel)) {
  18          error('Blogging is disabled!');
  19      }
  20  
  21      require_capability('moodle/blog:view', $context);
  22  
  23  /// If data submitted, then process and store.
  24  
  25      if (data_submitted()) {
  26          $pagesize = required_param('pagesize', PARAM_INT);
  27  
  28          if ($pagesize < 1) {
  29              error('invalid page size');
  30          }
  31          set_user_preference('blogpagesize', $pagesize);
  32  
  33          // now try to guess where to go from here ;-)
  34          if ($courseid == SITEID) {
  35              redirect($CFG->wwwroot.'/blog/index.php');
  36          } else {
  37              redirect($CFG->wwwroot.'/blog/index.php?filtertype=course&amp;filterselect='.$courseid);
  38          }
  39      }
  40  
  41      $site = get_site();
  42  
  43      $strpreferences = get_string('preferences');
  44      $strblogs       = get_string('blogs', 'blog');
  45      $navlinks = array(array('name' => $strblogs, 'link' => "$CFG->wwwroot/blog/", 'type' => 'misc'));
  46      $navlinks[] = array('name' => $strpreferences, 'link' => null, 'type' => 'misc');
  47      $navigation = build_navigation($navlinks);
  48  
  49      print_header("$site->shortname: $strblogs : $strpreferences", $strblogs, $navigation);
  50      print_heading($strpreferences);
  51  
  52      print_simple_box_start('center', '', '');
  53      require ('./preferences.html');
  54      print_simple_box_end();
  55  
  56      print_footer();
  57  ?>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7