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:
Carlos Barberis 2010-05-27 21:38:24 +00:00
parent c681ba3762
commit 606d526627
2 changed files with 12 additions and 16 deletions

View File

@ -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()
@ -198,11 +197,6 @@ class BlogHolder_Controller extends BlogTree_Controller {
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(', ');

View File

@ -48,6 +48,10 @@ class BlogManagementWidget extends Widget implements PermissionProvider {
return array("BLOGMANAGEMENT" => "Blog management"); return array("BLOGMANAGEMENT" => "Blog management");
} }
}
class BlogManagementWidget_Controller extends Widget_Controller {
function WidgetHolder() { function WidgetHolder() {
if(Permission::check("BLOGMANAGEMENT")) { if(Permission::check("BLOGMANAGEMENT")) {
return $this->renderWith("WidgetHolder"); return $this->renderWith("WidgetHolder");
@ -58,6 +62,5 @@ class BlogManagementWidget extends Widget implements PermissionProvider {
$container = BlogTree::current(); $container = BlogTree::current();
if ($container) return $container->Link('post'); if ($container) return $container->Link('post');
} }
} }
?> ?>