From: toyomoyo Date: Thu, 16 Mar 2006 06:16:54 +0000 (+0000) Subject: more cleaning X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3daaa618110752195861a4e7da634b61542cf4da;p=moodle.git more cleaning --- diff --git a/blog/blogpage.php b/blog/blogpage.php index c52f6bb728..cb08d9e8f0 100644 --- a/blog/blogpage.php +++ b/blog/blogpage.php @@ -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 +?> diff --git a/blog/class.BlogFilter.php b/blog/class.BlogFilter.php index cce776228b..2dfff0b4ce 100755 --- a/blog/class.BlogFilter.php +++ b/blog/class.BlogFilter.php @@ -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; diff --git a/blog/class.BlogInfo.php b/blog/class.BlogInfo.php index 54c3ba2cd2..6083ef501c 100755 --- a/blog/class.BlogInfo.php +++ b/blog/class.BlogInfo.php @@ -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 /////////////// diff --git a/blog/lib.php b/blog/lib.php index c39a5e83f8..cdbbb3a5ed 100755 --- a/blog/lib.php +++ b/blog/lib.php @@ -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 .= ''. stripslashes_safe($record->title) .'
'; - } - 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 .'&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('id .'"'; - if ( ($record->id == $blogFilter->userid) && ($blogFilter->userid != 0) ) { - $returnstring .= ' selected'; - } - $returnstring .= '>'. stripslashes_safe($record->title) .''; - } - $returnstring .= ''; - 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');