Merge branch '0.3' into 0.4

This commit is contained in:
Daniel Hensby 2018-02-20 13:17:23 +00:00
commit dfaa974697
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
3 changed files with 46 additions and 36 deletions

View File

@ -152,6 +152,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',

View File

@ -13,6 +13,13 @@ class BlogTree extends Page {
// 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(
'Name' => 'Varchar', 'Name' => 'Varchar',
'InheritSideBar' => 'Boolean', 'InheritSideBar' => 'Boolean',
@ -152,7 +159,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 = '';
@ -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();
@ -216,7 +221,9 @@ class BlogTree_Controller extends Page_Controller {
function init() { function init() {
parent::init(); parent::init();
if(BlogTree::$include_rss_link) {
$this->IncludeBlogRSS(); $this->IncludeBlogRSS();
}
Requirements::themedCSS("blog"); Requirements::themedCSS("blog");
} }

View File

@ -52,6 +52,8 @@ class ArchiveWidget extends Widget {
$container = BlogTree::current(); $container = BlogTree::current();
$ids = $container->BlogHolderIDs(); $ids = $container->BlogHolderIDs();
if(empty($ids)) return $results;
$stage = Versioned::current_stage(); $stage = Versioned::current_stage();
$suffix = (!$stage || $stage == 'Stage') ? "" : "_$stage"; $suffix = (!$stage || $stage == 'Stage') ? "" : "_$stage";