merge changes from upstream/SS3-fixes

This commit is contained in:
morven 2012-07-02 12:16:32 +01:00
commit 31bd2e74d3
11 changed files with 9 additions and 24 deletions

View File

@ -87,7 +87,6 @@ class BlogEntry extends Page {
* Returns the tags added to this blog entry * Returns the tags added to this blog entry
*/ */
function TagsCollection() { function TagsCollection() {
$tags = preg_split(" *, *", trim($this->Tags)); $tags = preg_split(" *, *", trim($this->Tags));
$output = new ArrayList(); $output = new ArrayList();

View File

@ -46,7 +46,6 @@ class BlogHolder extends BlogTree implements PermissionProvider {
/** /**
* Get members who have BLOGMANAGEMENT and ADMIN permission * Get members who have BLOGMANAGEMENT and ADMIN permission
*/ */
function blogOwners($sort = array('FirstName'=>'ASC','Surname'=>'ASC'), $direction = null) { function blogOwners($sort = array('FirstName'=>'ASC','Surname'=>'ASC'), $direction = null) {
$members = Permission::get_members_by_permission(array('ADMIN','BLOGMANAGEMENT')); $members = Permission::get_members_by_permission(array('ADMIN','BLOGMANAGEMENT'));
@ -239,7 +238,6 @@ class BlogHolder_Controller extends BlogTree_Controller {
); );
$submitAction = new FormAction('postblog', _t('BlogHolder.POST', 'Post blog entry')); $submitAction = new FormAction('postblog', _t('BlogHolder.POST', 'Post blog entry'));
$actions = new FieldList($submitAction); $actions = new FieldList($submitAction);
$validator = new RequiredFields('Title','BlogPost'); $validator = new RequiredFields('Title','BlogPost');
@ -250,7 +248,6 @@ class BlogHolder_Controller extends BlogTree_Controller {
if($entry->IsOwner()) { if($entry->IsOwner()) {
$form->loadDataFrom($entry); $form->loadDataFrom($entry);
$form->Fields()->fieldByName('BlogPost')->setValue($entry->Content); $form->Fields()->fieldByName('BlogPost')->setValue($entry->Content);
} }
} else { } else {
$form->loadDataFrom(array("Author" => Cookie::get("BlogHolder_Name"))); $form->loadDataFrom(array("Author" => Cookie::get("BlogHolder_Name")));

View File

@ -95,7 +95,6 @@ class BlogTree extends Page {
function getCMSFields() { function getCMSFields() {
$fields = parent::getCMSFields(); $fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Main", new TextField("Name", "Name of blog")); $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( $fields->addFieldToTab('Root.Main', new DropdownField('LandingPageFreshness', 'When you first open the blog, how many entries should I show', array(
"" => "All entries", "" => "All entries",
@ -113,11 +112,9 @@ class BlogTree extends Page {
"12 MONTH" => "Last year's entries", "12 MONTH" => "Last year's entries",
"INHERIT" => "Take value from parent Blog Tree" "INHERIT" => "Take value from parent Blog Tree"
))); )));
if(class_exists('WidgetArea')) {
$fields->addFieldToTab("Root.Widgets", new CheckboxField("InheritSideBar", 'Inherit Sidebar From Parent')); $fields->addFieldToTab("Root.Widgets", new CheckboxField("InheritSideBar", 'Inherit Sidebar From Parent'));
$fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("SideBar")); $fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("SideBar"));
}
return $fields; return $fields;
} }
@ -347,4 +344,4 @@ class BlogTree_Controller extends Page_Controller {
return date("Y", mktime(0, 0, 0, date('m'), 1, $date)); return date("Y", mktime(0, 0, 0, date('m'), 1, $date));
} }
} }
} }

View File

@ -2,7 +2,6 @@
/** /**
* Add trackback (receive and send) feature blog entry * Add trackback (receive and send) feature blog entry
*/ */
class TrackBackDecorator extends DataExtension { class TrackBackDecorator extends DataExtension {
static $trackback_server_class = 'TrackbackHTTPServer'; static $trackback_server_class = 'TrackbackHTTPServer';
@ -42,7 +41,6 @@ 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."))); // $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() { function onBeforePublish() {
if(!$this->owner->TrackBacksEnabled() && !$this->owner->TrackBackURLs()) return; if(!$this->owner->TrackBacksEnabled() && !$this->owner->TrackBackURLs()) return;

View File

@ -11,7 +11,6 @@ class TrackBackURL extends DataObject {
); );
function getCMSFields_forPopup() { function getCMSFields_forPopup() {
return new FieldList( return new FieldList(
new TextField('URL'), new TextField('URL'),
new ReadonlyField('Pung', 'Pung?') new ReadonlyField('Pung', 'Pung?')
@ -52,4 +51,4 @@ class TrackBackURL extends DataObject {
return false; return false;
} }
} }

View File

@ -32,7 +32,6 @@ class ArchiveWidget extends Widget {
$fields = parent::getCMSFields(); $fields = parent::getCMSFields();
$fields->merge( $fields->merge(
new FieldList( new FieldList(
new OptionsetField( new OptionsetField(
'DisplayMode', 'DisplayMode',

View File

@ -21,7 +21,6 @@ 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."; static $description = "Provide a number of links useful for administering a blog. Only shown if the user is an admin.";
function CommentText() { function CommentText() {
if(!class_exists('Comment')) return false; if(!class_exists('Comment')) return false;
$unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"PageComment\" WHERE \"NeedsModeration\"=1")->value(); $unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"PageComment\" WHERE \"NeedsModeration\"=1")->value();
if($unmoderatedcount == 1) { if($unmoderatedcount == 1) {
@ -34,8 +33,9 @@ class BlogManagementWidget extends Widget implements PermissionProvider {
} }
function CommentLink() { function CommentLink() {
if(!Permission::check('BLOGMANAGEMENT') || !class_exists('Comment')) {
if(!Permission::check('BLOGMANAGEMENT') || !class_exists('Comment')) return false; return false;
}
$unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"PageComment\" WHERE \"NeedsModeration\"=1")->value(); $unmoderatedcount = DB::query("SELECT COUNT(*) FROM \"PageComment\" WHERE \"NeedsModeration\"=1")->value();
if($unmoderatedcount > 0) { if($unmoderatedcount > 0) {

View File

@ -30,7 +30,6 @@ class TagCloudWidget extends Widget {
$fields = parent::getCMSFields(); $fields = parent::getCMSFields();
$fields->merge( $fields->merge(
new FieldList( new FieldList(
new TextField("Title", _t("TagCloudWidget.TILE", "Title")), new TextField("Title", _t("TagCloudWidget.TILE", "Title")),
new TextField("Limit", _t("TagCloudWidget.LIMIT", "Limit number of tags")), new TextField("Limit", _t("TagCloudWidget.LIMIT", "Limit number of tags")),

View File

@ -9,4 +9,3 @@ $.entwine('ss', function($){
}); });
}(jQuery)); }(jQuery));

View File

@ -47,6 +47,5 @@ class BlogHolderFunctionalTest extends FunctionalTest {
$response = $this->post('blog/BlogEntryForm', $data); $response = $this->post('blog/BlogEntryForm', $data);
$this->assertInstanceOf('BlogEntry', DataObject::get_one('BlogEntry', sprintf("\"Title\" = 'Allowed'"))); $this->assertInstanceOf('BlogEntry', DataObject::get_one('BlogEntry', sprintf("\"Title\" = 'Allowed'")));
} }
} }

View File

@ -1527,7 +1527,6 @@
curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_VERBOSE, 1);
} }
curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent); curl_setopt($curl, CURLOPT_USERAGENT, $this->user_agent);
// required for XMLRPC: post the data // required for XMLRPC: post the data
curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POST, 1);
// the data // the data
@ -3774,4 +3773,4 @@ xmlrpc_encode_entitites($this->errstr, $GLOBALS['xmlrpc_internalencoding'], $cha
} }
} }
?> ?>