]> git.mjollnir.org Git - moodle.git/commitdiff
more cleaning
authortoyomoyo <toyomoyo>
Thu, 16 Mar 2006 06:16:54 +0000 (06:16 +0000)
committertoyomoyo <toyomoyo>
Thu, 16 Mar 2006 06:16:54 +0000 (06:16 +0000)
blog/blogpage.php
blog/class.BlogFilter.php
blog/class.BlogInfo.php
blog/lib.php

index c52f6bb728664e8dd77ff88440389cf8aee38924..cb08d9e8f0205ca6488f6091232029875879c667 100644 (file)
@@ -142,7 +142,7 @@ class page_blog extends page_base {
             $blocknames = $CFG->{'defaultblocks_'. $this->get_type()};
         } else {
             /// Failsafe - in case nothing was defined.
-            $blocknames = 'admin,calendar_month,blog_member_list:login,online_users,blog_menu,blog_categories,blog_recent_entries,blog_news_feeds';
+            $blocknames = 'admin,calendar_month,online_users,blog_menu';
         }
         
         return $blocknames;
@@ -176,4 +176,4 @@ class page_blog extends page_base {
         return $editformstring;        
     }    
 }
-?>
\ No newline at end of file
+?>
index cce776228bfafb204f5095b438dcf3a1500dbde7..2dfff0b4cefa056041bcff2a67852af8c35228d6 100755 (executable)
@@ -51,7 +51,7 @@ class BlogFilter {
      * @param  int $courseid = if needed the entries can be restricted to those associated with a given course.
      * @param  int $postid = a specific blog entry that is being sought
      */
-    function BlogFilter($userid='', $postid='', $fetchlimit='', $fetchstart='', $filtertype='', $filterselect='', $tagid='', $tag ='', $sort='lastmodified DESC') {
+    function BlogFilter($userid='', $postid='', $fetchlimit=10, $fetchstart='', $filtertype='', $filterselect='', $tagid='', $tag ='', $sort='lastmodified DESC') {
 
         global $CFG;    //filter settings to be pass in for baseurl
 
@@ -73,12 +73,8 @@ class BlogFilter {
         } else {
             $this->fetchstart = $fetchstart;
         }
-        
-        if (!is_numeric($fetchlimit) ) {
-            $this->fetchlimit = $CFG->blog_default_fetch_num_entries;
-        } else {
-            $this->fetchlimit = $fetchlimit;
-        }
+
+        $this->fetchlimit = $fetchlimit;
         
         $this->postid = $postid;
 
index 54c3ba2cd28fcf2e30692697f89f74edd2374941..6083ef501cf73c2b10874df1ef269f437b41e192 100755 (executable)
@@ -81,13 +81,7 @@ class BlogInfo {
         
         $this->blogEntries = array();
         $this->userid = $userid;
-        $this->blogtitle = stripslashes_safe(get_user_preferences('blogtitle', $CFG->blog_default_title, $userid));
-        $this->blogtagline = stripslashes_safe(get_user_preferences('blogtagline', '', $userid));
-        $this->bloguseextendedbody = get_user_preferences('bloguseextendedbody', false, $userid);
-        $this->blogtheme = get_user_preferences('blogtheme', 0, $userid); //Daryl Hawes note: investigate blogtheme usage again
-/*        if ($this->userid == 0) { 
-            $this->userid = 1;
-        }*/
+
     }
 
 ////////// getters and setters ///////////////
index c39a5e83f8a343fc56ef79522b5014660167c50e..cdbbb3a5ed935d79b2fd4fc3f4a8870d53f00687 100755 (executable)
@@ -33,45 +33,6 @@ $BLOG_YES_NO_MODES = array ( '0'  => get_string('no'),
 if (empty($SESSION->blog_editing_enabled)) {
     $SESSION->blog_editing_enabled = false;
 }
-if (!(isset($CFG->blog_enable_trackback_in) )) {
-    $CFG->blog_enable_trackback_in = 0; //default is 0 == do not allow for site
-}
-if (!(isset($CFG->blog_enable_moderation) )) {
-    $CFG->blog_enable_moderation = 0; //default is 0 == do not enable blog moderation on this site
-}
-if (!(isset($CFG->blog_enable_pingback_in) )) {
-    $CFG->blog_enable_pingback_in = 0; //default is 0 == do not allow for site
-}
-if (!(isset($CFG->blog_enable_trackback_out) )) {
-    $CFG->blog_enable_trackback_out = 0; //default is 0 == do not allow for site
-}
-if (!(isset($CFG->blog_enable_pingback_out) )) {
-    $CFG->blog_enable_pingback_out = 0; //default is 0 == do not allow for site
-}
-if (!(isset($CFG->blog_enable_moderation) )) {
-    $CFG->blog_enable_moderation = 0; //default is 0 == do not turn on moderation for site
-}
-if (!(isset($CFG->blog_useweblog_rpc) )) {
-    $CFG->blog_useweblog_rpc = 0;//default is 0 == do not publish to weblogs.com
-}
-if (empty($CFG->blog_ratename) ) {
-    $CFG->blog_ratename = 'Rating'; //default name for entry ratings
-}
-if (empty($CFG->blog_default_title) ) {
-    $CFG->blog_default_title = 'Moodle Blog'; //default blog title
-}
-if (empty($CFG->blog_blogurl) ) {
-    $CFG->blog_blogurl = $CFG->wwwroot.'/blog/index.php';
-}
-if (!(isset($CFG->blog_enable_trackback) )) {
-    $CFG->blog_enable_trackback = 0;
-}
-if (!(isset($CFG->blog_enable_pingback) )) {
-    $CFG->blog_enable_pingback = 0;
-}
-if (empty($CFG->blog_default_fetch_num_entries) ) {
-    $CFG->blog_default_fetch_num_entries = 8;
-}
 
 /**
  * Verify that a user is logged in based on the session
@@ -176,83 +137,6 @@ function blog_user_bloginfo($userid='') {
     return $thisbloginfo;
 }
 
-/**
- * build and return list of all member blogs
- *
- * @param stdObject $memberrecords An object of record entries as output from the get_member_list() function in BlogFilter (->id, ->title are the required variables).
- * @param int $format - 0, 1 or 2; 0 = hyperlinked list of members, 1 = select element, 2 = select element wrapped in entire form
- * @param bool $return  indicates whether the function should return the text 
- *   as a string or echo it directly to the page being rendered
- * @param BlogFilter $blogFilter - a BlogFilter object with the details of the members listed in $memberrecords.
- * @param string $hyperlink This is the target link to be used - there is a sensible default for each format.
- */
-function blog_member_list(&$blogFilter, &$memberrecords, $format=1, $return=true, $hyperlink='') {
-    global $CFG, $USER;
-    
-//echo "userid = $blogFilter->userid"; //debug
-//print_object($memberrecords); //debug
-    $returnstring = '';
-    if (!empty($memberrecords)) {
-        switch($format) {
-            case '0':
-                foreach($memberrecords as $record) {
-                    if (empty($hyperlink)) {
-                        $CFG->wwwroot .'/blog/index.php?userid='. $record->id; 
-                    }
-                    $returnstring .= '<a href="'. $hyperlink . $record->id .'">'. stripslashes_safe($record->title) .'</a><br />';     
-                }
-                break;
-            case '2':
-                $selected = '';
-                $options = array('' => 'All Member Blogs');
-                $formlink = $hyperlink; //TESTING
-                if (empty($hyperlink)) {
-                    $getvars = $blogFilter->get_getvars('userid');
-                    $self = basename($_SERVER['PHP_SELF']); 
-                    $formlink = $self . $getvars .'&amp;userid=';
-                }                    
-                foreach($memberrecords as $record) {
-                    $id = $record->id;
-                    if (blog_isLoggedIn() && $id == $USER->id ) {
-                        $optiontitle = 'My Blog';
-                    } else {
-                        $optiontitle = stripslashes_safe($record->title);
-                    }
-                    $options[$id] = $optiontitle; //TESTING
-                    if ( ($blogFilter->userid == $record->id) && ($blogFilter->userid != 0) ) {
-                        $selected = $id;
-                    }
-                }
-                
-                //attach a random number to the popup function's form name
-                //becuase there may be multiple instances of this form on each page
-                $returnstring = popup_form($formlink,
-                       $options, 'blog_member_list'. mt_rand(), $selected, '', '', '', true);
-                $returnstring = str_replace('<form', '<form style="display: inline;"', $returnstring);
-                break;
-            
-            case '1':
-            default:
-                $returnstring = '<select name="userid">';
-                foreach($memberrecords as $record) {            
-                    $returnstring .= '<option value="'. $record->id .'"';
-                    if ( ($record->id == $blogFilter->userid) && ($blogFilter->userid != 0) ) {
-                        $returnstring .= ' selected';
-                    }
-                    $returnstring .= '>'. stripslashes_safe($record->title) .'</option>';
-                }
-                $returnstring .= '</select>';
-                break;
-        }
-    
-    }
-    if ($return) {
-        return $returnstring;
-    }
-    print $returnstring;
-    return;
-}
-
 /**
  *  This function is in lib and not in BlogInfo because entries being searched
  *   might be found in any number of blogs rather than just one.
@@ -480,7 +364,7 @@ function blog_applicable_publish_states($courseid='') {
         }
     }
 
-    if (!$CFG->blog_enable_moderation || isadmin() || (is_numeric($courseid) && isteacher($courseid)) ) {
+    if (isadmin() || (is_numeric($courseid) && isteacher($courseid)) ) {
         // only admins and teachers can see site and public options when moderation is enabled
         $options['site'] = get_string('publishtosite', 'blog');
         $options['public'] = get_string('publishtoworld', 'blog');