diff --git a/code/CMSMain.php b/code/CMSMain.php index 0cd0e77f..d9f22866 100644 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -820,8 +820,11 @@ JS; // encode the message to appear in the body of the email $archiveURL = Director::absoluteBaseURL() . $record->URLSegment . '?archiveDate=' . $record->obj('LastEdited')->URLDatetime(); + + // Ensure that source file comments are disabled + SSViewer::set_source_file_comments(false); + $archiveEmailMessage = urlencode( $this->customise( array( 'ArchiveDate' => $record->obj('LastEdited'), 'ArchiveURL' => $archiveURL ) )->renderWith( 'ViewArchivedEmail' ) ); - $archiveEmailMessage = preg_replace( '/\+/', '%20', $archiveEmailMessage ); $fields->push( new HiddenField( 'ArchiveEmailMessage', '', $archiveEmailMessage ) ); diff --git a/code/ModelAdmin.php b/code/ModelAdmin.php index 2b16320a..19595fe2 100644 --- a/code/ModelAdmin.php +++ b/code/ModelAdmin.php @@ -37,7 +37,7 @@ abstract class ModelAdmin extends LeftAndMain { * * @var array|string */ - protected static $managed_models = null; + public static $managed_models = null; /** * More actions are dynamically added in {@link defineMethods()} below. @@ -56,12 +56,12 @@ abstract class ModelAdmin extends LeftAndMain { /** * @param string $collection_controller_class Override for controller class */ - protected static $collection_controller_class = "ModelAdmin_CollectionController"; + public static $collection_controller_class = "ModelAdmin_CollectionController"; /** * @param string $collection_controller_class Override for controller class */ - protected static $record_controller_class = "ModelAdmin_RecordController"; + public static $record_controller_class = "ModelAdmin_RecordController"; /** * Forward control to the default action handler @@ -88,14 +88,14 @@ abstract class ModelAdmin extends LeftAndMain { * * @var array */ - protected static $model_importers = null; + public static $model_importers = null; /** * Amount of results showing on a single page. * * @var int */ - protected static $page_length = 30; + public static $page_length = 30; /** * Class name of the form field used for the results list. Overloading this in subclasses @@ -628,6 +628,7 @@ class ModelAdmin_CollectionController extends Controller { $this->modelClass, $summaryFields ); + $tf->setCustomQuery($this->getSearchQuery($searchCriteria)); $tf->setPageSize($this->parentController->stat('page_length')); $tf->setShowPagination(true); diff --git a/css/ModelAdmin.css b/css/ModelAdmin.css index 56ea7ef9..3d7360a1 100644 --- a/css/ModelAdmin.css +++ b/css/ModelAdmin.css @@ -67,7 +67,7 @@ body.ModelAdmin #ResultTable_holder { } body.ModelAdmin #right{ - overflow:auto; + overflow:auto !important; } body.ModelAdmin #right #ModelAdminPanel { diff --git a/javascript/tinymce.template.js b/javascript/tinymce.template.js index 9645478e..ffef4da9 100755 --- a/javascript/tinymce.template.js +++ b/javascript/tinymce.template.js @@ -43,7 +43,7 @@ if((typeof tinyMCE != 'undefined')) { verify_html : true, use_native_selects : true, // fancy selects are bug as of SS 2.3.0 valid_elements : "+a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align],-ol[class],-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],-td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-div[id|dir|class|align|style],-span[class|align],-pre[class|align],address[class|align],-h1[id|dir|class|align],-h2[id|dir|class|align],-h3[id|dir|class|align],-h4[id|dir|class|align],-h5[id|dir|class|align],-h6[id|dir|class|align],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir]", - extended_valid_elements : "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value]" + extended_valid_elements : "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]" }); } diff --git a/templates/Includes/ModelAdmin_right.ss b/templates/Includes/ModelAdmin_right.ss index 709c51b2..9ce29808 100755 --- a/templates/Includes/ModelAdmin_right.ss +++ b/templates/Includes/ModelAdmin_right.ss @@ -1,5 +1,5 @@ -
+
<% if EditForm %> $EditForm diff --git a/tests/LeftAndMainTest.php b/tests/LeftAndMainTest.php index 4997d731..d5b3a527 100644 --- a/tests/LeftAndMainTest.php +++ b/tests/LeftAndMainTest.php @@ -11,6 +11,7 @@ class LeftAndMainTest extends FunctionalTest { // @todo fix controller stack problems and re-activate //$this->autoFollowRedirection = false; + CMSMenu::populate_menu(); } /** diff --git a/tests/ModelAdminTest.php b/tests/ModelAdminTest.php new file mode 100644 index 00000000..91990bc3 --- /dev/null +++ b/tests/ModelAdminTest.php @@ -0,0 +1,27 @@ +autoFollowRedirection = false; + $this->logInAs('admin'); + $this->assertTrue((bool)Permission::check("ADMIN")); + $this->assertEquals(200, $this->get('ModelAdminTest_Admin')->getStatusCode()); + } +} + +class ModelAdminTest_Admin extends ModelAdmin { + static $url_segment = 'testadmin'; + + public static $managed_models = array( + 'ModelAdminTest_Contact', + ); +} + +class ModelAdminTest_Contact extends DataObject { + static $db = array( + "Name" => "Varchar", + "Phone" => "Varchar", + ); +} \ No newline at end of file diff --git a/tests/ModelAdminTest.yml b/tests/ModelAdminTest.yml new file mode 100644 index 00000000..1a1758b5 --- /dev/null +++ b/tests/ModelAdminTest.yml @@ -0,0 +1,19 @@ +ModelAdminTest_Contact: + sam: + Name: Sam + Phone: 021 123 456 + ingo: + Name: ingo + Phone: 04 987 6543 + +Member: + admin: + FirstName: admin +Group: + admin: + Title: Admin + Members: =>Member.admin +Permission: + admin: + Code: ADMIN + Group: =>Group.admin \ No newline at end of file