more cleaning
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
* @package blog
|
||||
******************************************************************/
|
||||
|
||||
global $CFG;
|
||||
include_once($CFG->dirroot .'/blog/lib.php');
|
||||
|
||||
/**
|
||||
@@ -30,7 +29,6 @@ include_once($CFG->dirroot .'/blog/lib.php');
|
||||
make sure that both the ->save and ->update function operate properly on an entry that does not yet exist!
|
||||
this way one could:
|
||||
$newEntry = new BlogEntry();
|
||||
$newEntry->set_title('a title');
|
||||
$newEntry->set_body('a post here');
|
||||
$newEntry->set_userid(2);
|
||||
$newEntry->save();
|
||||
@@ -181,43 +179,6 @@ class BlogEntry {
|
||||
return $this->entryBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_formatted_entry_extended_body
|
||||
* getter for ->entryExtendedBody
|
||||
*
|
||||
* @uses $CFG
|
||||
* @return string Entry extended body/content run through moodle's format_text formatter and
|
||||
* with slashes stripped from database entry
|
||||
*/
|
||||
function get_formatted_entry_extended_body() {
|
||||
global $CFG;
|
||||
include_once($CFG->libdir .'/weblib.php');
|
||||
if ( isset($this->entryFormat) ) {
|
||||
return format_text($this->entryExtendedBody, $this->entryFormat);
|
||||
}
|
||||
return stripslashes_safe($this->entryExtendedBody);
|
||||
}
|
||||
|
||||
/**
|
||||
* get_unformatted_entry_extended_body
|
||||
* getter for ->entryExtendedBody
|
||||
*
|
||||
* @return string Entry extended body/content - raw string from database
|
||||
*/
|
||||
function get_unformatted_entry_extended_body() {
|
||||
return $this->entryExtendedBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* BlogEntry setters do not save to the database.
|
||||
* To save changes call the BlogEntry->save() function when ready.
|
||||
*
|
||||
* @param string $title New entry subject
|
||||
*/
|
||||
function set_title($title) {
|
||||
$this->entryTitle = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* BlogEntry setters do not save to the database.
|
||||
* To save changes call the BlogEntry->save() function when ready.
|
||||
@@ -228,16 +189,6 @@ class BlogEntry {
|
||||
$this->entryBody = $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* BlogEntry setters do not save to the database.
|
||||
* To save changes call the BlogEntry->save() function when ready.
|
||||
*
|
||||
* @param string $extendedbody New entry content
|
||||
*/
|
||||
function set_extendedbody($extendedbody) {
|
||||
$this->entryExtendedBody = $extendedbody;
|
||||
}
|
||||
|
||||
/**
|
||||
* BlogEntry setters do not save to the database.
|
||||
* To save changes call the BlogEntry->save() function when ready.
|
||||
@@ -247,16 +198,6 @@ class BlogEntry {
|
||||
function set_format($format) {
|
||||
$this->entryFormat = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_entryurl() {
|
||||
global $CFG;
|
||||
return $CFG->wwwroot .'/blog/archive.php?userid='. $this->entryuserid .'&postid='. $this->entryId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* BlogEntry setters do not save to the database.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php //$Id$
|
||||
|
||||
global $CFG, $USER;
|
||||
|
||||
require_once($CFG->dirroot .'/blog/lib.php');
|
||||
require_once($CFG->libdir .'/pagelib.php');
|
||||
require_once($CFG->dirroot .'/blog/blogpage.php');
|
||||
|
||||
Reference in New Issue
Block a user