mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge branch '0.6' into 1.0
This commit is contained in:
commit
bdea98a875
@ -64,7 +64,6 @@ class BlogHolder extends BlogTree implements PermissionProvider {
|
|||||||
/**
|
/**
|
||||||
* 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'));
|
||||||
@ -308,6 +307,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());
|
||||||
|
@ -162,7 +162,6 @@ class BlogTree extends Page {
|
|||||||
* @return PaginatedList The list of entries in a paginated list
|
* @return PaginatedList The list of entries in a paginated list
|
||||||
*/
|
*/
|
||||||
public function Entries($limit = '', $tag = '', $date = '', $retrieveCallback = null, $filter = '') {
|
public function Entries($limit = '', $tag = '', $date = '', $retrieveCallback = null, $filter = '') {
|
||||||
|
|
||||||
$tagCheck = '';
|
$tagCheck = '';
|
||||||
$dateCheck = '';
|
$dateCheck = '';
|
||||||
|
|
||||||
@ -203,7 +202,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();
|
||||||
|
|
||||||
@ -263,7 +261,7 @@ class BlogTree_Controller extends Page_Controller {
|
|||||||
// 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'";
|
||||||
@ -387,7 +385,6 @@ class BlogTree_Controller extends Page_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function SelectedNiceDate(){
|
public function SelectedNiceDate(){
|
||||||
|
@ -86,6 +86,7 @@ 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';
|
||||||
|
|
||||||
|
@ -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');
|
||||||
|
Loading…
Reference in New Issue
Block a user