mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
BUGFIX: Deleted old js from BlogHolder
ENHANCEMENT: do not show blog management widget when not logged in (ticket #5561 thanks ericdrex)
This commit is contained in:
parent
c681ba3762
commit
606d526627
@ -183,7 +183,6 @@ class BlogHolder_Controller extends BlogTree_Controller {
|
|||||||
*/
|
*/
|
||||||
function post(){
|
function post(){
|
||||||
if(!Permission::check('BLOGMANAGEMENT')) return Security::permissionFailure();
|
if(!Permission::check('BLOGMANAGEMENT')) return Security::permissionFailure();
|
||||||
|
|
||||||
$page = $this->customise(array(
|
$page = $this->customise(array(
|
||||||
'Content' => false,
|
'Content' => false,
|
||||||
'Form' => $this->BlogEntryForm()
|
'Form' => $this->BlogEntryForm()
|
||||||
@ -195,14 +194,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();
|
||||||
|
|
||||||
Requirements::javascript('jsparty/behaviour.js');
|
|
||||||
Requirements::javascript('jsparty/prototype.js');
|
|
||||||
Requirements::javascript('jsparty/scriptaculous/effects.js');
|
|
||||||
Requirements::javascript('cms/javascript/PageCommentInterface.js');
|
|
||||||
Requirements::javascript('blog/javascript/bbcodehelp.js');
|
|
||||||
|
|
||||||
$id = 0;
|
$id = 0;
|
||||||
if(Director::urlParam('ID')) {
|
if(Director::urlParam('ID')) {
|
||||||
@ -221,7 +215,6 @@ class BlogHolder_Controller extends BlogTree_Controller {
|
|||||||
new LiteralField("BBCodeTags","<div id=\"BBTagsHolder\">".$codeparser->useable_tagsHTML()."</div>")
|
new LiteralField("BBCodeTags","<div id=\"BBTagsHolder\">".$codeparser->useable_tagsHTML()."</div>")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(class_exists('TagField')) {
|
if(class_exists('TagField')) {
|
||||||
$tagfield = new TagField('Tags', null, null, 'BlogEntry');
|
$tagfield = new TagField('Tags', null, null, 'BlogEntry');
|
||||||
$tagfield->setSeparator(', ');
|
$tagfield->setSeparator(', ');
|
||||||
@ -242,7 +235,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 FieldSet($submitAction);
|
$actions = new FieldSet($submitAction);
|
||||||
$validator = new RequiredFields('Title','Content');
|
$validator = new RequiredFields('Title','Content');
|
||||||
|
@ -48,16 +48,19 @@ class BlogManagementWidget extends Widget implements PermissionProvider {
|
|||||||
return array("BLOGMANAGEMENT" => "Blog management");
|
return array("BLOGMANAGEMENT" => "Blog management");
|
||||||
}
|
}
|
||||||
|
|
||||||
function WidgetHolder() {
|
}
|
||||||
if(Permission::check("BLOGMANAGEMENT")) {
|
|
||||||
return $this->renderWith("WidgetHolder");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
class BlogManagementWidget_Controller extends Widget_Controller {
|
||||||
|
|
||||||
|
function WidgetHolder() {
|
||||||
|
if(Permission::check("BLOGMANAGEMENT")) {
|
||||||
|
return $this->renderWith("WidgetHolder");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function PostLink() {
|
function PostLink() {
|
||||||
$container = BlogTree::current();
|
$container = BlogTree::current();
|
||||||
if ($container) return $container->Link('post');
|
if ($container) return $container->Link('post');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user