diff --git a/code/BlogEntry.php b/code/BlogEntry.php index 31571c7..96dd00a 100644 --- a/code/BlogEntry.php +++ b/code/BlogEntry.php @@ -87,11 +87,11 @@ class BlogEntry extends Page { * Returns the tags added to this blog entry */ function TagsCollection() { + $tags = preg_split(" *, *", trim($this->Tags)); $output = new ArrayList(); $link = $this->getParent() ? $this->getParent()->Link('tag') : ''; - foreach($tags as $tag) { $output->push(new ArrayData(array( 'Tag' => $tag, diff --git a/code/BlogHolder.php b/code/BlogHolder.php index 859e500..528d91b 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -46,6 +46,7 @@ class BlogHolder extends BlogTree implements PermissionProvider { /** * Get members who have BLOGMANAGEMENT and ADMIN permission */ + function blogOwners($sort = array('FirstName'=>'ASC','Surname'=>'ASC'), $direction = null) { $members = Permission::get_members_by_permission(array('ADMIN','BLOGMANAGEMENT')); @@ -232,6 +233,7 @@ class BlogHolder_Controller extends BlogTree_Controller { ); $submitAction = new FormAction('postblog', _t('BlogHolder.POST', 'Post blog entry')); + $actions = new FieldList($submitAction); $validator = new RequiredFields('Title','BlogPost'); @@ -242,6 +244,7 @@ class BlogHolder_Controller extends BlogTree_Controller { if($entry->IsOwner()) { $form->loadDataFrom($entry); $form->Fields()->fieldByName('BlogPost')->setValue($entry->Content); + } } else { $form->loadDataFrom(array("Author" => Cookie::get("BlogHolder_Name"))); diff --git a/code/BlogTree.php b/code/BlogTree.php index 40655fc..9b559c3 100644 --- a/code/BlogTree.php +++ b/code/BlogTree.php @@ -95,6 +95,7 @@ class BlogTree extends Page { function getCMSFields() { $fields = parent::getCMSFields(); + $fields->addFieldToTab("Root.Main", new TextField("Name", "Name of blog")); $fields->addFieldToTab('Root.Main', new DropdownField('LandingPageFreshness', 'When you first open the blog, how many entries should I show', array( "" => "All entries", diff --git a/code/TrackBackDecorator.php b/code/TrackBackDecorator.php index 5d9e05c..e463be6 100644 --- a/code/TrackBackDecorator.php +++ b/code/TrackBackDecorator.php @@ -2,6 +2,7 @@ /** * Add trackback (receive and send) feature blog entry */ + class TrackBackDecorator extends DataExtension { static $trackback_server_class = 'TrackbackHTTPServer'; @@ -41,6 +42,7 @@ class TrackBackDecorator extends DataExtension { // $fields->addFieldToTab("Root.Content.Main", new ReadonlyField("TrackBackURLsReadOnly", _t("BlogEntry.TrackbackURLs", "Trackback URLs"), _t("BlogEntry.TrackbackURLs_DISABLED", "To use this feature, please check 'Enable TrackBacks' check box on the blog holder."))); // } // } + function onBeforePublish() { if(!$this->owner->TrackBacksEnabled() && !$this->owner->TrackBackURLs()) return; diff --git a/code/TrackBackURL.php b/code/TrackBackURL.php index 951ae78..2d3c775 100644 --- a/code/TrackBackURL.php +++ b/code/TrackBackURL.php @@ -11,6 +11,7 @@ class TrackBackURL extends DataObject { ); function getCMSFields_forPopup() { + return new FieldList( new TextField('URL'), new ReadonlyField('Pung', 'Pung?') diff --git a/code/widgets/ArchiveWidget.php b/code/widgets/ArchiveWidget.php index c98a177..06148b0 100644 --- a/code/widgets/ArchiveWidget.php +++ b/code/widgets/ArchiveWidget.php @@ -32,6 +32,7 @@ class ArchiveWidget extends Widget { $fields = parent::getCMSFields(); $fields->merge( + new FieldList( new OptionsetField( 'DisplayMode', diff --git a/code/widgets/BlogManagementWidget.php b/code/widgets/BlogManagementWidget.php index da31435..ec8a383 100644 --- a/code/widgets/BlogManagementWidget.php +++ b/code/widgets/BlogManagementWidget.php @@ -21,6 +21,7 @@ class BlogManagementWidget extends Widget implements PermissionProvider { static $description = "Provide a number of links useful for administering a blog. Only shown if the user is an admin."; function CommentText() { + if(!class_exists('Comment')) return false; $unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"PageComment\" WHERE \"NeedsModeration\"=1")->value(); if($unmoderatedcount == 1) { @@ -33,9 +34,8 @@ class BlogManagementWidget extends Widget implements PermissionProvider { } function CommentLink() { - if(!Permission::check('BLOGMANAGEMENT') || !class_exists('Comment')) { - return false; - } + + if(!Permission::check('BLOGMANAGEMENT') || !class_exists('Comment')) return false; $unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"PageComment\" WHERE \"NeedsModeration\"=1")->value(); if($unmoderatedcount > 0) { diff --git a/code/widgets/TagCloudWidget.php b/code/widgets/TagCloudWidget.php index 4832b1f..a677f85 100644 --- a/code/widgets/TagCloudWidget.php +++ b/code/widgets/TagCloudWidget.php @@ -30,6 +30,7 @@ class TagCloudWidget extends Widget { $fields = parent::getCMSFields(); $fields->merge( + new FieldList( new TextField("Title", _t("TagCloudWidget.TILE", "Title")), new TextField("Limit", _t("TagCloudWidget.LIMIT", "Limit number of tags")), diff --git a/javascript/bbcodehelp.js b/javascript/bbcodehelp.js index 7945dcf..a3a952a 100644 --- a/javascript/bbcodehelp.js +++ b/javascript/bbcodehelp.js @@ -8,4 +8,5 @@ $.entwine('ss', function($){ }); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); + diff --git a/tests/BlogHolderFunctionalTest.php b/tests/BlogHolderFunctionalTest.php index e4a7f1d..c536c71 100644 --- a/tests/BlogHolderFunctionalTest.php +++ b/tests/BlogHolderFunctionalTest.php @@ -47,5 +47,6 @@ class BlogHolderFunctionalTest extends FunctionalTest { $response = $this->post('blog/BlogEntryForm', $data); $this->assertInstanceOf('BlogEntry', DataObject::get_one('BlogEntry', sprintf("\"Title\" = 'Allowed'"))); + } } diff --git a/thirdparty/xmlrpc/xmlrpc.php b/thirdparty/xmlrpc/xmlrpc.php index b3658f0..8eb8d79 100644 --- a/thirdparty/xmlrpc/xmlrpc.php +++ b/thirdparty/xmlrpc/xmlrpc.php @@ -1527,6 +1527,7 @@ curl_setopt($curl, CURLOPT_VERBOSE, 1); } curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent); + // required for XMLRPC: post the data curl_setopt($curl, CURLOPT_POST, 1); // the data