From 9d32dd4026cc522cd817823c1f6cdd2498b765d8 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 3 Feb 2009 03:26:44 +0000 Subject: [PATCH] Merged from branches/2.3 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@71267 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/sitefeatures/PageComment.php | 9 ++++- code/sitefeatures/PageCommentInterface.php | 9 ++++- css/cms_left.css | 45 +++++++++++++++++++--- css/cms_right.css | 9 ++++- css/layout.css | 19 ++++++--- javascript/LeftAndMain.js | 2 +- javascript/LeftAndMain_right.js | 4 +- javascript/PageCommentInterface.js | 16 +------- templates/Includes/CMSMain_left.ss | 31 +++++++++------ 9 files changed, 97 insertions(+), 47 deletions(-) diff --git a/code/sitefeatures/PageComment.php b/code/sitefeatures/PageComment.php index 94be12bf..78c55444 100755 --- a/code/sitefeatures/PageComment.php +++ b/code/sitefeatures/PageComment.php @@ -5,6 +5,7 @@ * @subpackage comments */ class PageComment extends DataObject { + static $db = array( "Name" => "Varchar(200)", "Comment" => "Text", @@ -18,6 +19,12 @@ class PageComment extends DataObject { "Author" => "Member" // Only set when the user is logged in when posting ); + static $has_many = array(); + + static $many_many = array(); + + static $defaults = array(); + static $casting = array( "RSSTitle" => "Varchar", ); @@ -28,7 +35,7 @@ class PageComment extends DataObject { static $moderate = false; static $bbcode = false; - + /** * Return a link to this comment * @return string link to this comment. diff --git a/code/sitefeatures/PageCommentInterface.php b/code/sitefeatures/PageCommentInterface.php index 8eb69547..feae3dd2 100755 --- a/code/sitefeatures/PageCommentInterface.php +++ b/code/sitefeatures/PageCommentInterface.php @@ -137,6 +137,8 @@ class PageCommentInterface extends RequestHandler { $form->loadDataFrom(array( "Name" => Cookie::get("PageCommentInterface_Name"), + "Comment" => Cookie::get("PageCommentInterface_Comment"), + "URL" => Cookie::get("PageCommentInterface_CommenterURL") )); return $form; @@ -175,6 +177,10 @@ class PageCommentInterface extends RequestHandler { class PageCommentInterface_Form extends Form { function postcomment($data) { // Spam filtering + Cookie::set("PageCommentInterface_Name", $data['Name']); + Cookie::set("PageCommentInterface_CommenterURL", $data['CommenterURL']); + Cookie::set("PageCommentInterface_Comment", $data['Comment']); + if(SSAkismet::isEnabled()) { try { $akismet = new SSAkismet(); @@ -210,7 +216,6 @@ class PageCommentInterface_Form extends Form { return "spamprotectionfailed"; //used by javascript for checking if the spam question was wrong } } - Cookie::set("PageCommentInterface_Name", $data['Name']); // If commenting can only be done by logged in users, make sure the user is logged in $member = Member::currentUser(); @@ -226,7 +231,7 @@ class PageCommentInterface_Form extends Form { $comment->IsSpam = false; $comment->NeedsModeration = PageComment::moderationEnabled(); $comment->write(); - + Cookie::set("PageCommentInterface_Comment", ''); if(Director::is_ajax()) { if($comment->NeedsModeration){ echo _t('PageCommentInterface_Form.AWAITINGMODERATION', "Your comment has been submitted and is now awaiting moderation."); diff --git a/css/cms_left.css b/css/cms_left.css index 46133fc7..31d7eb92 100644 --- a/css/cms_left.css +++ b/css/cms_left.css @@ -1,7 +1,9 @@ #left form.actionparams { background: #eee; - padding: 0 0 5px 0; + padding: 0 5px 5px 5px; + _padding-left: 5px; float: left; + width: 100%; } #left form#search_options { padding-bottom: 8px; @@ -65,6 +67,9 @@ #left div.field select { width: 100%; } +#TreeTools select { + margin-left: 2px; +} #left .SelectionGroup li.selected label.selector { font-weight: bold; } @@ -267,6 +272,7 @@ ul.tree span.a span.modified, background-color: #aaa; color: #fff; border-bottom: 2px #ccc solid; + padding: 0 3px; } #treepanes table tbody tr { @@ -275,10 +281,10 @@ ul.tree span.a span.modified, #treepanes table tbody td { font-size: 11px; - padding:0 2px; + padding: 1px 3px; } -#treepanes table tbody tr.odd td { +#treepanes table tbody tr.even td { background-color: #EEE; } #treepanes table tbody tr.over td { @@ -289,7 +295,6 @@ ul.tree span.a span.modified, background-color: #BBBBFF; } - #treepanes #Versions tbody tr.internal { color: #777; } @@ -297,6 +302,10 @@ ul.tree span.a span.modified, color: black; } +.SideReport_RecentlyEdited li a:hover { + background-color: #FFFFBB; +} + /** * Change the styling of the root tree node */ @@ -406,20 +415,44 @@ ul.tree span.untranslated a:visited { float: left; margin: 0 3px 0 0; } - + +#versions_actions { + float: left; + width: 100%; + border-bottom:1px solid #CCC; +} #versions_actions .versionChoice { float: left; display: block; margin: 0 0 5px 0; } + .versionChoice label { + display: block; + float: left; + margin-top: 3px; + _margin-top: 4px; + } + #versions_actions input, #Remember input { float: left; display: block; - padding-top: 2px; margin: 0 3px 0 0; } +#ReportSelector_holder { + background: #EEE; + margin: 0 !important; + padding: 3px 3px 7px; + border-bottom: 1px solid #CCC; +} +#versions_actions { + background: #EEE; + overflow: hidden; + margin: 0 !important; + padding: 4px 7px; +} + /** * i18n diff --git a/css/cms_right.css b/css/cms_right.css index ee17e049..ccf4771c 100644 --- a/css/cms_right.css +++ b/css/cms_right.css @@ -6,7 +6,7 @@ margin: 7px 0; } #right .optionset li { - margin: 4px 0; + margin: 8px 0; } /** @@ -142,6 +142,11 @@ .right form .htmleditor select, .right form input.action { width: auto; + margin-right: 4px; +} + +.right form #Root_Access input { + float: left; } .right form ul.optionset { @@ -428,7 +433,7 @@ div.originallang_holder.field.CompositeField.nolabel { overflow-x: scroll; } #contentPanel ul.tree a { - padding-left: 15px; + padding-left: 20px; } #contentPanel h2 img { float: right; diff --git a/css/layout.css b/css/layout.css index ce1b6aa3..34b18ac1 100644 --- a/css/layout.css +++ b/css/layout.css @@ -333,19 +333,28 @@ body.stillLoading select { #sitetree_holder #TreeTools { float: left; width: inherit; + background: #EEE; } #SearchBox { float: left; width: 100%; - margin-bottom: 5px; + margin: 0 0 5px 0; + padding-left: 5px; } #SearchBox #SiteTreeSearchTerm { padding: 1px 0 2px 0; } - #sitetree_ul { + #addCriteria { + float: left; + width: 100%; + } + #sitetree_ul, ul#sitetree { padding: 3px 0 0 3px; clear: left; } + #sitetree_ul ul#sitetree { + padding: 0; + } #sitetree { width: 500px; /* IE's chocking right now */ } @@ -361,7 +370,7 @@ body.stillLoading select { } #left #SortItems { border-bottom: 1px solid #CCC; - margin-bottom: 5px; + margin-bottom: 2px; } #TreeTools label { display: block; @@ -370,8 +379,7 @@ body.stillLoading select { } #TreeTools #batchactionsforms { - padding: 0 0 7px 1px; - float: left; + padding: 0 5px 7px 5px; } #TreeTools div p, #ShowChanged { @@ -389,7 +397,6 @@ body.stillLoading select { padding: 2px 1px; float: left; } - div.spacer, li.spacer { diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index 8e88cf24..f7316f86 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -115,7 +115,7 @@ Behaviour.register({ '#EditMemberProfile': { onclick: function(e) { var el = Event.element(e); - GB_show('Edit Profile', el.attributes.href.value, 390, 560); + GB_show('Edit Profile', el.attributes.href.value, 290, 500); Event.stop(e); } } diff --git a/javascript/LeftAndMain_right.js b/javascript/LeftAndMain_right.js index 6d7d931c..fecd8112 100755 --- a/javascript/LeftAndMain_right.js +++ b/javascript/LeftAndMain_right.js @@ -163,7 +163,7 @@ CMSForm.prototype = { var __callAfter = callAfter; var __form = this; - if(__form.notify) __form.notify('BeforeSave', __form.elements.ID.value); + if(__form.notify && __form.elements.ID != undefined) __form.notify('BeforeSave', __form.elements.ID.value); // validate if required if(this.validate && !this.validate()) { @@ -179,7 +179,7 @@ CMSForm.prototype = { Ajax.Evaluator(response); __form.resetElements(); if(__callAfter) __callAfter(); - if(__form.notify) __form.notify('PageSaved', __form.elements.ID.value); + if(__form.notify && __form.elements.ID != undefined) __form.notify('PageSaved', __form.elements.ID.value); if($('Form_EditForm_action_save') && $('Form_EditForm_action_save').stopLoading) $('Form_EditForm_action_save').stopLoading(); _AJAX_LOADING = false; } diff --git a/javascript/PageCommentInterface.js b/javascript/PageCommentInterface.js index 1109b0a8..99503249 100755 --- a/javascript/PageCommentInterface.js +++ b/javascript/PageCommentInterface.js @@ -96,24 +96,10 @@ PageCommentInterface.prototype = { onFailure : function(response) { alert(response.responseText); } - - - }); - - - - // Clear the fields - - // form.elements.Name.value = ""; - form.elements.Comment.value = ""; - - - } else { message.style.display = ''; - message.innerHTML = "Please enter your name and a comment to be posted to the site."; - + message.innerHTML = "Please enter your name and a comment to be posted to the site."; } return false; diff --git a/templates/Includes/CMSMain_left.ss b/templates/Includes/CMSMain_left.ss index dbdc77a2..f77f4800 100755 --- a/templates/Includes/CMSMain_left.ss +++ b/templates/Includes/CMSMain_left.ss @@ -37,7 +37,7 @@ <% end_control %>