Merge branch '0.5' into 0.6

This commit is contained in:
Daniel Hensby 2018-02-20 13:24:43 +00:00
commit e2cf6421c6
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
4 changed files with 134 additions and 119 deletions

View File

@ -15,15 +15,15 @@ class BlogHolder extends BlogTree implements PermissionProvider {
static $icon = "blog/images/blogholder-file.png"; static $icon = "blog/images/blogholder-file.png";
static $description = "Displays listings of blog entries"; static $description = "Displays listings of blog entries";
static $singular_name = 'Blog Holder Page'; static $singular_name = 'Blog Holder Page';
static $plural_name = 'Blog Holder Pages'; static $plural_name = 'Blog Holder Pages';
static $db = array( static $db = array(
'TrackBacksEnabled' => 'Boolean', 'TrackBacksEnabled' => 'Boolean',
'AllowCustomAuthors' => 'Boolean', 'AllowCustomAuthors' => 'Boolean',
'ShowFullEntry' => 'Boolean', 'ShowFullEntry' => 'Boolean',
); );
static $has_one = array( static $has_one = array(
@ -35,14 +35,14 @@ class BlogHolder extends BlogTree implements PermissionProvider {
); );
function getCMSFields() { function getCMSFields() {
$blogOwners = $this->blogOwners(); $blogOwners = $this->blogOwners();
SiteTree::disableCMSFieldsExtensions(); SiteTree::disableCMSFieldsExtensions();
$fields = parent::getCMSFields(); $fields = parent::getCMSFields();
SiteTree::enableCMSFieldsExtensions(); SiteTree::enableCMSFieldsExtensions();
$fields->addFieldToTab( $fields->addFieldToTab(
'Root.Main', 'Root.Main',
DropdownField::create('OwnerID', 'Blog owner', $blogOwners->map('ID', 'Name')->toArray()) DropdownField::create('OwnerID', 'Blog owner', $blogOwners->map('ID', 'Name')->toArray())
->setEmptyString('(None)') ->setEmptyString('(None)')
->setHasEmptyDefault(true), ->setHasEmptyDefault(true),
@ -51,9 +51,9 @@ class BlogHolder extends BlogTree implements PermissionProvider {
$fields->addFieldToTab('Root.Main', new CheckboxField('TrackBacksEnabled', 'Enable TrackBacks'), "Content"); $fields->addFieldToTab('Root.Main', new CheckboxField('TrackBacksEnabled', 'Enable TrackBacks'), "Content");
$fields->addFieldToTab('Root.Main', new CheckboxField('AllowCustomAuthors', 'Allow non-admins to have a custom author field'), "Content"); $fields->addFieldToTab('Root.Main', new CheckboxField('AllowCustomAuthors', 'Allow non-admins to have a custom author field'), "Content");
$fields->addFieldToTab( $fields->addFieldToTab(
"Root.Main", "Root.Main",
CheckboxField::create("ShowFullEntry", "Show Full Entry") CheckboxField::create("ShowFullEntry", "Show Full Entry")
->setDescription('Show full content in overviews rather than summary'), ->setDescription('Show full content in overviews rather than summary'),
"Content" "Content"
); );
@ -61,18 +61,17 @@ class BlogHolder extends BlogTree implements PermissionProvider {
return $fields; return $fields;
} }
/** /**
* Get members who have BLOGMANAGEMENT and ADMIN permission * Get members who have BLOGMANAGEMENT and ADMIN permission
*/ */
function blogOwners($sort = array('FirstName'=>'ASC','Surname'=>'ASC'), $direction = null) { function blogOwners($sort = array('FirstName'=>'ASC','Surname'=>'ASC'), $direction = null) {
$members = Permission::get_members_by_permission(array('ADMIN','BLOGMANAGEMENT')); $members = Permission::get_members_by_permission(array('ADMIN','BLOGMANAGEMENT'));
$members->sort($sort); $members->sort($sort);
$this->extend('extendBlogOwners', $members); $this->extend('extendBlogOwners', $members);
return $members; return $members;
} }
@ -156,7 +155,7 @@ class BlogHolder extends BlogTree implements PermissionProvider {
$archivewidget->ParentID = $widgetarea->ID; $archivewidget->ParentID = $widgetarea->ID;
$archivewidget->write(); $archivewidget->write();
$widgetarea->write(); $widgetarea->write();
break; // only apply to one break; // only apply to one
} }
@ -183,6 +182,7 @@ class BlogHolder extends BlogTree implements PermissionProvider {
} }
class BlogHolder_Controller extends BlogTree_Controller { class BlogHolder_Controller extends BlogTree_Controller {
static $allowed_actions = array( static $allowed_actions = array(
'index', 'index',
'tag', 'tag',
@ -192,7 +192,7 @@ class BlogHolder_Controller extends BlogTree_Controller {
'post', 'post',
'BlogEntryForm' => 'BLOGMANAGEMENT', 'BlogEntryForm' => 'BLOGMANAGEMENT',
); );
function init() { function init() {
parent::init(); parent::init();
Requirements::themedCSS("bbcodehelp"); Requirements::themedCSS("bbcodehelp");
@ -221,9 +221,9 @@ class BlogHolder_Controller extends BlogTree_Controller {
/** /**
* A simple form for creating blog entries * A simple form for creating blog entries
*/ */
function BlogEntryForm() { function BlogEntryForm() {
if(!Permission::check('BLOGMANAGEMENT')) return Security::permissionFailure(); if(!Permission::check('BLOGMANAGEMENT')) return Security::permissionFailure();
$id = 0; $id = 0;
if($this->request->latestParam('ID')) { if($this->request->latestParam('ID')) {
@ -250,7 +250,7 @@ class BlogHolder_Controller extends BlogTree_Controller {
} else { } else {
$tagfield = new TextField('Tags'); $tagfield = new TextField('Tags');
} }
$field = 'TextField'; $field = 'TextField';
if(!$this->AllowCustomAuthors && !Permission::check('ADMIN')) { if(!$this->AllowCustomAuthors && !Permission::check('ADMIN')) {
$field = 'ReadonlyField'; $field = 'ReadonlyField';
@ -264,7 +264,7 @@ class BlogHolder_Controller extends BlogTree_Controller {
new LiteralField("Tagsnote"," <label id='tagsnote'>"._t('BlogHolder.TE', "For example: sport, personal, science fiction")."<br/>" . new LiteralField("Tagsnote"," <label id='tagsnote'>"._t('BlogHolder.TE', "For example: sport, personal, science fiction")."<br/>" .
_t('BlogHolder.SPUC', "Please separate tags using commas.")."</label>") _t('BlogHolder.SPUC', "Please separate tags using commas.")."</label>")
); );
$submitAction = new FormAction('postblog', _t('BlogHolder.POST', 'Post blog entry')); $submitAction = new FormAction('postblog', _t('BlogHolder.POST', 'Post blog entry'));
$actions = new FieldList($submitAction); $actions = new FieldList($submitAction);
@ -304,6 +304,7 @@ class BlogHolder_Controller extends BlogTree_Controller {
} }
$form->saveInto($blogentry); $form->saveInto($blogentry);
$blogentry->ParentID = $this->ID; $blogentry->ParentID = $this->ID;
$blogentry->Content = str_replace("\r\n", "\n", $form->Fields()->fieldByName('BlogPost')->dataValue()); $blogentry->Content = str_replace("\r\n", "\n", $form->Fields()->fieldByName('BlogPost')->dataValue());

View File

@ -5,7 +5,7 @@
*/ */
/** /**
* Blog tree is a way to group Blogs. It allows a tree of "Blog Holders". * Blog tree is a way to group Blogs. It allows a tree of "Blog Holders".
* Viewing branch nodes shows all blog entries from all blog holder children * Viewing branch nodes shows all blog entries from all blog holder children
*/ */
@ -14,18 +14,25 @@ class BlogTree extends Page {
static $icon = "blog/images/blogtree-file.png"; static $icon = "blog/images/blogtree-file.png";
static $description = "A grouping of blogs"; static $description = "A grouping of blogs";
static $singular_name = 'Blog Tree Page'; static $singular_name = 'Blog Tree Page';
static $plural_name = 'Blog Tree Pages'; static $plural_name = 'Blog Tree Pages';
// Default number of blog entries to show // Default number of blog entries to show
static $default_entries_limit = 10; static $default_entries_limit = 10;
/**
* @var bool Include an automatic link to the rss feed for
* the browser. Disabling this will allow you to include your
* own feedburner link
*/
static $include_rss_link = true;
static $db = array( static $db = array(
'LandingPageFreshness' => 'Varchar', 'LandingPageFreshness' => 'Varchar',
); );
static $allowed_children = array( static $allowed_children = array(
'BlogTree', 'BlogHolder' 'BlogTree', 'BlogHolder'
); );
@ -40,7 +47,7 @@ class BlogTree extends Page {
* uses current * uses current
*/ */
static function current($page = null) { static function current($page = null) {
if (!$page) { if (!$page) {
$controller = Controller::curr(); $controller = Controller::curr();
if($controller) $page = $controller->data(); if($controller) $page = $controller->data();
@ -78,35 +85,35 @@ class BlogTree extends Page {
if ($freshness == "INHERIT") $freshness = ''; if ($freshness == "INHERIT") $freshness = '';
return $freshness; return $freshness;
} }
/* ----------- CMS CONTROL -------------- */ /* ----------- CMS CONTROL -------------- */
function getSettingsFields() { function getSettingsFields() {
$fields = parent::getSettingsFields(); $fields = parent::getSettingsFields();
$fields->addFieldToTab( $fields->addFieldToTab(
'Root.Settings', 'Root.Settings',
new DropdownField( new DropdownField(
'LandingPageFreshness', 'LandingPageFreshness',
'When you first open the blog, how many entries should I show', 'When you first open the blog, how many entries should I show',
array( array(
"" => "All entries", "" => "All entries",
"1" => "Last month's entries", "1" => "Last month's entries",
"2" => "Last 2 months' entries", "2" => "Last 2 months' entries",
"3" => "Last 3 months' entries", "3" => "Last 3 months' entries",
"4" => "Last 4 months' entries", "4" => "Last 4 months' entries",
"5" => "Last 5 months' entries", "5" => "Last 5 months' entries",
"6" => "Last 6 months' entries", "6" => "Last 6 months' entries",
"7" => "Last 7 months' entries", "7" => "Last 7 months' entries",
"8" => "Last 8 months' entries", "8" => "Last 8 months' entries",
"9" => "Last 9 months' entries", "9" => "Last 9 months' entries",
"10" => "Last 10 months' entries", "10" => "Last 10 months' entries",
"11" => "Last 11 months' entries", "11" => "Last 11 months' entries",
"12" => "Last year's entries", "12" => "Last year's entries",
"INHERIT" => "Take value from parent Blog Tree" "INHERIT" => "Take value from parent Blog Tree"
) )
) )
); );
return $fields; return $fields;
} }
@ -144,7 +151,6 @@ class BlogTree extends Page {
* @return DataObjectSet * @return DataObjectSet
*/ */
public function Entries($limit = '', $tag = '', $date = '', $retrieveCallback = null, $filter = '') { public function Entries($limit = '', $tag = '', $date = '', $retrieveCallback = null, $filter = '') {
$tagCheck = ''; $tagCheck = '';
$dateCheck = ''; $dateCheck = '';
@ -157,12 +163,12 @@ class BlogTree extends Page {
// Some systems still use the / seperator for date presentation // Some systems still use the / seperator for date presentation
if( strpos($date, '-') ) $seperator = '-'; if( strpos($date, '-') ) $seperator = '-';
elseif( strpos($date, '/') ) $seperator = '/'; elseif( strpos($date, '/') ) $seperator = '/';
if(isset($seperator) && !empty($seperator)) { if(isset($seperator) && !empty($seperator)) {
// The 2 in the explode argument will tell it to only create 2 elements // The 2 in the explode argument will tell it to only create 2 elements
// i.e. in this instance the $year and $month fields respectively // i.e. in this instance the $year and $month fields respectively
list($year,$month) = explode( $seperator, $date, 2); list($year,$month) = explode( $seperator, $date, 2);
$year = (int)$year; $year = (int)$year;
$month = (int)$month; $month = (int)$month;
@ -185,7 +191,6 @@ class BlogTree extends Page {
} }
} }
} }
// Build a list of all IDs for BlogHolders that are children of us // Build a list of all IDs for BlogHolders that are children of us
$holderIDs = $this->BlogHolderIDs(); $holderIDs = $this->BlogHolderIDs();
@ -210,7 +215,7 @@ class BlogTree extends Page {
} }
class BlogTree_Controller extends Page_Controller { class BlogTree_Controller extends Page_Controller {
static $allowed_actions = array( static $allowed_actions = array(
'index', 'index',
'rss', 'rss',
@ -221,22 +226,24 @@ class BlogTree_Controller extends Page_Controller {
function init() { function init() {
parent::init(); parent::init();
$this->IncludeBlogRSS(); if(BlogTree::$include_rss_link) {
$this->IncludeBlogRSS();
}
Requirements::themedCSS("blog","blog"); Requirements::themedCSS("blog","blog");
} }
function BlogEntries($limit = null) { function BlogEntries($limit = null) {
require_once('Zend/Date.php'); require_once('Zend/Date.php');
if($limit === null) $limit = BlogTree::$default_entries_limit; if($limit === null) $limit = BlogTree::$default_entries_limit;
// only use freshness if no action is present (might be displaying tags or rss) // only use freshness if no action is present (might be displaying tags or rss)
if ($this->LandingPageFreshness && !$this->request->param('Action')) { if ($this->LandingPageFreshness && !$this->request->param('Action')) {
$d = new Zend_Date(SS_Datetime::now()->getValue()); $d = new Zend_Date(SS_Datetime::now()->getValue());
$d->sub($this->LandingPageFreshness, Zend_Date::MONTH); $d->sub(intval($this->LandingPageFreshness, Zend_Date::MONTH), Zend_Date::MONTH);
$date = $d->toString('YYYY-MM-dd'); $date = $d->toString('YYYY-MM-dd');
$filter = "\"BlogEntry\".\"Date\" > '$date'"; $filter = "\"BlogEntry\".\"Date\" > '$date'";
} else { } else {
$filter = ''; $filter = '';
@ -246,7 +253,7 @@ class BlogTree_Controller extends Page_Controller {
if(isset($_GET['author']) && isset($_GET['authorID'])) { if(isset($_GET['author']) && isset($_GET['authorID'])) {
$author = Convert::raw2sql($_GET['author']); $author = Convert::raw2sql($_GET['author']);
$id = Convert::raw2sql($_GET['authorID']); $id = Convert::raw2sql($_GET['authorID']);
$filter .= " \"BlogEntry\".\"Author\" LIKE '". $author . "' OR \"BlogEntry\".\"AuthorID\" = '". $id ."'"; $filter .= " \"BlogEntry\".\"Author\" LIKE '". $author . "' OR \"BlogEntry\".\"AuthorID\" = '". $id ."'";
} }
else if(isset($_GET['author'])) { else if(isset($_GET['author'])) {
@ -257,7 +264,7 @@ class BlogTree_Controller extends Page_Controller {
} }
$date = $this->SelectedDate(); $date = $this->SelectedDate();
return $this->Entries($limit, $this->SelectedTag(), ($date) ? $date : '', null, $filter); return $this->Entries($limit, $this->SelectedTag(), ($date) ? $date : '', null, $filter);
} }
@ -267,7 +274,7 @@ class BlogTree_Controller extends Page_Controller {
function IncludeBlogRSS() { function IncludeBlogRSS() {
RSSFeed::linkToFeed($this->Link('rss'), _t('BlogHolder.RSSFEED',"RSS feed of these blogs")); RSSFeed::linkToFeed($this->Link('rss'), _t('BlogHolder.RSSFEED',"RSS feed of these blogs"));
} }
/** /**
* Get the rss feed for this blog holder's entries * Get the rss feed for this blog holder's entries
*/ */
@ -284,7 +291,7 @@ class BlogTree_Controller extends Page_Controller {
return $rss->outputToBrowser(); return $rss->outputToBrowser();
} }
} }
/** /**
* Protection against infinite loops when an RSS widget pointing to this page is added to this page * Protection against infinite loops when an RSS widget pointing to this page is added to this page
*/ */
@ -293,16 +300,16 @@ class BlogTree_Controller extends Page_Controller {
return parent::defaultAction($action); return parent::defaultAction($action);
} }
/** /**
* Return the currently viewing tag used in the template as $Tag * Return the currently viewing tag used in the template as $Tag
* *
* @return String * @return String
*/ */
function SelectedTag() { function SelectedTag() {
return ($this->request->latestParam('Action') == 'tag') ? Convert::raw2xml($this->request->latestParam('ID')) : ''; return ($this->request->latestParam('Action') == 'tag') ? Convert::raw2xml($this->request->latestParam('ID')) : '';
} }
/** /**
* Return the selected date from the blog tree * Return the selected date from the blog tree
* *
@ -312,18 +319,18 @@ class BlogTree_Controller extends Page_Controller {
if($this->request->latestParam('Action') == 'date') { if($this->request->latestParam('Action') == 'date') {
$year = $this->request->latestParam('ID'); $year = $this->request->latestParam('ID');
$month = $this->request->latestParam('OtherID'); $month = $this->request->latestParam('OtherID');
if(is_numeric($year) && is_numeric($month) && $month < 13) { if(is_numeric($year) && is_numeric($month) && $month < 13) {
$date = $year .'-'. $month; $date = $year .'-'. $month;
return $date; return $date;
} else { } else {
if(is_numeric($year)) return $year; if(is_numeric($year)) return $year;
} }
} }
return false; return false;
} }
@ -350,14 +357,14 @@ class BlogTree_Controller extends Page_Controller {
} }
} }
} }
function SelectedNiceDate(){ function SelectedNiceDate(){
$date = $this->SelectedDate(); $date = $this->SelectedDate();
if(strpos($date, '-')) { if(strpos($date, '-')) {
$date = explode("-",$date); $date = explode("-",$date);
return date("F", mktime(0, 0, 0, $date[1], 1, date('Y'))). " " .date("Y", mktime(0, 0, 0, date('m'), 1, $date[0])); return date("F", mktime(0, 0, 0, $date[1], 1, date('Y'))). " " .date("Y", mktime(0, 0, 0, date('m'), 1, $date[0]));
} else { } else {
return date("Y", mktime(0, 0, 0, date('m'), 1, $date)); return date("Y", mktime(0, 0, 0, date('m'), 1, $date));
} }

View File

@ -3,67 +3,66 @@ if(class_exists('Widget')) {
/** /**
* Shows a widget with viewing blog entries * Shows a widget with viewing blog entries
* by months or years. * by months or years.
* *
* @package blog * @package blog
*/ */
class ArchiveWidget extends Widget { class ArchiveWidget extends Widget {
static $db = array( static $db = array(
'DisplayMode' => 'Varchar' 'DisplayMode' => 'Varchar'
); );
static $has_one = array(); static $has_one = array();
static $has_many = array(); static $has_many = array();
static $many_many = array(); static $many_many = array();
static $belongs_many_many = array(); static $belongs_many_many = array();
static $defaults = array( static $defaults = array(
'DisplayMode' => 'month' 'DisplayMode' => 'month'
); );
static $title = 'Browse by Date'; static $title = 'Browse by Date';
static $cmsTitle = 'Blog Archive'; static $cmsTitle = 'Blog Archive';
static $description = 'Show a list of months or years in which there are blog posts, and provide links to them.';
function getCMSFields() {
$fields = parent::getCMSFields();
static $description = 'Show a list of months or years in which there are blog posts, and provide links to them.'; $fields->merge(
new FieldList(
function getCMSFields() { new OptionsetField(
$fields = parent::getCMSFields(); 'DisplayMode',
_t('ArchiveWidget.DispBY', 'Display by'),
$fields->merge( array(
'month' => _t('ArchiveWidget.MONTH', 'month'),
new FieldList( 'year' => _t('ArchiveWidget.YEAR', 'year')
new OptionsetField(
'DisplayMode',
_t('ArchiveWidget.DispBY', 'Display by'),
array(
'month' => _t('ArchiveWidget.MONTH', 'month'),
'year' => _t('ArchiveWidget.YEAR', 'year')
)
) )
) )
); )
);
$this->extend('updateCMSFields', $fields);
$this->extend('updateCMSFields', $fields);
return $fields;
} return $fields;
}
function getDates() {
Requirements::themedCSS('archivewidget'); function getDates() {
Requirements::themedCSS('archivewidget');
$results = new ArrayList();
$container = BlogTree::current(); $results = new ArrayList();
$ids = $container->BlogHolderIDs(); $container = BlogTree::current();
$ids = $container->BlogHolderIDs();
$stage = Versioned::current_stage();
$suffix = (!$stage || $stage == 'Stage') ? "" : "_$stage"; if(empty($ids)) return $results;$stage = Versioned::current_stage();
$suffix = (!$stage || $stage == 'Stage') ? "" : "_$stage";
$monthclause = method_exists(DB::getConn(), 'formattedDatetimeClause') ? DB::getConn()->formattedDatetimeClause('"Date"', '%m') : 'MONTH("Date")'; $monthclause = method_exists(DB::getConn(), 'formattedDatetimeClause') ? DB::getConn()->formattedDatetimeClause('"Date"', '%m') : 'MONTH("Date")';
$yearclause = method_exists(DB::getConn(), 'formattedDatetimeClause') ? DB::getConn()->formattedDatetimeClause('"Date"', '%Y') : 'YEAR("Date")'; $yearclause = method_exists(DB::getConn(), 'formattedDatetimeClause') ? DB::getConn()->formattedDatetimeClause('"Date"', '%Y') : 'YEAR("Date")';
if($this->DisplayMode == 'month') { if($this->DisplayMode == 'month') {
$sqlResults = DB::query(" $sqlResults = DB::query("
SELECT DISTINCT CAST($monthclause AS " . DB::getConn()->dbDataType('unsigned integer') . ") AS \"Month\", $yearclause AS \"Year\" SELECT DISTINCT CAST($monthclause AS " . DB::getConn()->dbDataType('unsigned integer') . ") AS \"Month\", $yearclause AS \"Year\"
@ -79,34 +78,34 @@ if(class_exists('Widget')) {
ORDER BY \"Year\" DESC" ORDER BY \"Year\" DESC"
); );
} }
if($sqlResults) foreach($sqlResults as $sqlResult) { if($sqlResults) foreach($sqlResults as $sqlResult) {
$isMonthDisplay = $this->DisplayMode == 'month'; $isMonthDisplay = $this->DisplayMode == 'month';
$monthVal = (isset($sqlResult['Month'])) ? (int) $sqlResult['Month'] : 1; $monthVal = (isset($sqlResult['Month'])) ? (int) $sqlResult['Month'] : 1;
$month = ($isMonthDisplay) ? $monthVal : 1; $month = ($isMonthDisplay) ? $monthVal : 1;
$year = ($sqlResult['Year']) ? (int) $sqlResult['Year'] : date('Y'); $year = ($sqlResult['Year']) ? (int) $sqlResult['Year'] : date('Y');
$date = DBField::create_field('Date', array( $date = DBField::create_field('Date', array(
'Day' => 1, 'Day' => 1,
'Month' => $month, 'Month' => $month,
'Year' => $year 'Year' => $year
)); ));
if($isMonthDisplay) { if($isMonthDisplay) {
$link = $container->Link('date') . '/' . $sqlResult['Year'] . '/' . sprintf("%'02d", $monthVal); $link = $container->Link('date') . '/' . $sqlResult['Year'] . '/' . sprintf("%'02d", $monthVal);
} else { } else {
$link = $container->Link('date') . '/' . $sqlResult['Year']; $link = $container->Link('date') . '/' . $sqlResult['Year'];
} }
$results->push(new ArrayData(array( $results->push(new ArrayData(array(
'Date' => $date, 'Date' => $date,
'Link' => $link 'Link' => $link
))); )));
} }
return $results; return $results;
} }
} }
} }

View File

@ -6,9 +6,12 @@
class BlogHolderFunctionalTest extends FunctionalTest { class BlogHolderFunctionalTest extends FunctionalTest {
static $fixture_file = 'blog/tests/BlogHolderFunctionalTest.yml'; static $fixture_file = 'blog/tests/BlogHolderFunctionalTest.yml';
static $origlThemes;
function setUp() { function setUp() {
parent::setUp(); parent::setUp();
self::$origlThemes = SSViewer::current_theme();
SSViewer::set_theme(null);
$blogHolder = $this->objFromFixture('BlogHolder', 'blogholder'); $blogHolder = $this->objFromFixture('BlogHolder', 'blogholder');
$blogHolder->publish('Stage', 'Live'); $blogHolder->publish('Stage', 'Live');
@ -16,6 +19,11 @@ class BlogHolderFunctionalTest extends FunctionalTest {
$blogEntry->publish('Stage', 'Live'); $blogEntry->publish('Stage', 'Live');
} }
function tearDown(){
SSViewer::set_theme(self::$origlThemes);
parent::tearDown();
}
function testFrontendBlogPostRequiresPermission() { function testFrontendBlogPostRequiresPermission() {
// get valid SecurityID (from comments form, would usually be copy/pasted) // get valid SecurityID (from comments form, would usually be copy/pasted)
$blogEntry = $this->objFromFixture('BlogEntry', 'entry1'); $blogEntry = $this->objFromFixture('BlogEntry', 'entry1');