mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
NEW Making widgets dependency optional
This commit is contained in:
parent
966d168119
commit
ee532292d2
@ -14,7 +14,7 @@ The blog module allows you to post blogs on your SilverStripe. It includes the a
|
|||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* Silverstripe 3.0
|
* Silverstripe 3.0
|
||||||
* silverstripe-widgets module
|
* (Optional) silverstripe-widgets module
|
||||||
|
|
||||||
## Feature Overview
|
## Feature Overview
|
||||||
|
|
||||||
@ -76,10 +76,6 @@ or: mysite/blog/2007 would show blog entries for 2007
|
|||||||
|
|
||||||
See [:pagecomment](/pagecomment) for creating Askimet-protected comments for every page.
|
See [:pagecomment](/pagecomment) for creating Askimet-protected comments for every page.
|
||||||
|
|
||||||
## Widgets
|
|
||||||
|
|
||||||
See [widgets](/widgets)
|
|
||||||
|
|
||||||
|
|
||||||
## Working with the theme
|
## Working with the theme
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
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.
|
||||||
@ -108,4 +109,4 @@ class ArchiveWidget extends Widget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
}
|
@ -1,9 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
if(class_exists('Widget')) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blog Management Widget
|
* Blog Management Widget
|
||||||
* @package blog
|
* @package blog
|
||||||
*/
|
*/
|
||||||
class BlogManagementWidget extends Widget implements PermissionProvider {
|
class BlogManagementWidget extends Widget {
|
||||||
static $db = array();
|
static $db = array();
|
||||||
|
|
||||||
static $has_one = array();
|
static $has_one = array();
|
||||||
@ -45,10 +47,6 @@ class BlogManagementWidget extends Widget implements PermissionProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function providePermissions() {
|
|
||||||
return array("BLOGMANAGEMENT" => "Blog management");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class BlogManagementWidget_Controller extends Widget_Controller {
|
class BlogManagementWidget_Controller extends Widget_Controller {
|
||||||
@ -64,4 +62,5 @@ class BlogManagementWidget_Controller extends Widget_Controller {
|
|||||||
return ($container && $container->ClassName != "BlogTree") ? $container->Link('post') : false;
|
return ($container && $container->ClassName != "BlogTree") ? $container->Link('post') : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
if(class_exists('Widget')) {
|
||||||
class RSSWidget extends Widget {
|
class RSSWidget extends Widget {
|
||||||
static $db = array(
|
static $db = array(
|
||||||
"RSSTitle" => "Text",
|
"RSSTitle" => "Text",
|
||||||
@ -93,4 +93,4 @@ class RSSWidget extends Widget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
}
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
if(class_exists('Widget')) {
|
||||||
/**
|
/**
|
||||||
* A simple widget that just shows a link
|
* A simple widget that just shows a link
|
||||||
* to this website's blog RSS, with an RSS
|
* to this website's blog RSS, with an RSS
|
||||||
@ -28,4 +28,4 @@ class SubscribeRSSWidget extends Widget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
}
|
@ -14,9 +14,10 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
"require":
|
"require": {
|
||||||
{
|
"silverstripe/cms": "3.0.*"
|
||||||
"silverstripe/cms": "3.0.*",
|
},
|
||||||
|
"suggests": {
|
||||||
"silverstripe/widgets": "0.1.*"
|
"silverstripe/widgets": "0.1.*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user