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
|
||||
|
||||
* Silverstripe 3.0
|
||||
* silverstripe-widgets module
|
||||
* (Optional) silverstripe-widgets module
|
||||
|
||||
## 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.
|
||||
|
||||
## Widgets
|
||||
|
||||
See [widgets](/widgets)
|
||||
|
||||
|
||||
## Working with the theme
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
if(class_exists('Widget')) {
|
||||
/**
|
||||
* Shows a widget with viewing blog entries
|
||||
* by months or years.
|
||||
|
@ -108,4 +109,4 @@ class ArchiveWidget extends Widget {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
<?php
|
||||
if(class_exists('Widget')) {
|
||||
|
||||
/**
|
||||
* Blog Management Widget
|
||||
* @package blog
|
||||
*/
|
||||
class BlogManagementWidget extends Widget implements PermissionProvider {
|
||||
class BlogManagementWidget extends Widget {
|
||||
static $db = 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 {
|
||||
|
@ -64,4 +62,5 @@ class BlogManagementWidget_Controller extends Widget_Controller {
|
|||
return ($container && $container->ClassName != "BlogTree") ? $container->Link('post') : false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
if(class_exists('Widget')) {
|
||||
class RSSWidget extends Widget {
|
||||
static $db = array(
|
||||
"RSSTitle" => "Text",
|
||||
|
@ -93,4 +93,4 @@ class RSSWidget extends Widget {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
if(class_exists('Widget')) {
|
||||
/**
|
||||
* A simple widget that just shows a link
|
||||
* to this website's blog RSS, with an RSS
|
||||
|
@ -28,4 +28,4 @@ class SubscribeRSSWidget extends Widget {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
|
@ -14,9 +14,10 @@
|
|||
}
|
||||
],
|
||||
|
||||
"require":
|
||||
{
|
||||
"silverstripe/cms": "3.0.*",
|
||||
"require": {
|
||||
"silverstripe/cms": "3.0.*"
|
||||
},
|
||||
"suggests": {
|
||||
"silverstripe/widgets": "0.1.*"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue