From 3d4630a2c8860be3b6a25880287c3c33e8cf170e Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 3 Feb 2009 02:50:25 +0000 Subject: [PATCH] Merged from branches/2.3 git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@71259 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/AssetAdmin.php | 8 +- code/CMSMain.php | 198 ++++++++++---------------- code/CMSMenu.php | 2 +- code/CommentAdmin.php | 4 - code/LeftAndMain.php | 29 ++-- code/ReportAdmin.php | 4 - code/SecurityAdmin.php | 42 +++--- javascript/AssetAdmin.js | 43 +++--- javascript/CMSMain_left.js | 20 +-- javascript/CMSMain_right.js | 28 +--- javascript/CommentList.js | 13 -- javascript/LeftAndMain.js | 2 +- javascript/LeftAndMain_left.js | 2 +- javascript/LeftAndMain_right.js | 69 --------- javascript/PageCommentInterface.js | 4 + javascript/TaskList.js | 21 --- templates/CommentList.ss | 14 -- templates/Includes/AssetTableField.ss | 59 ++++---- templates/Includes/CMSMain_right.ss | 20 --- templates/LeftAndMain.ss | 48 ++++--- templates/WaitingOn.ss | 10 -- tests/CMSMenuTest.php | 2 - 22 files changed, 207 insertions(+), 435 deletions(-) delete mode 100755 javascript/CommentList.js delete mode 100755 javascript/TaskList.js delete mode 100755 templates/CommentList.ss delete mode 100755 templates/WaitingOn.ss diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index a6dc080a..f5d6b68f 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -45,10 +45,6 @@ class AssetAdmin extends LeftAndMain { 'UploadForm', 'deleteUnusedThumbnails' => 'ADMIN' ); - - public function getMenuTitle() { - return _t('LeftAndMain.FILESIMAGES', 'Files & Images', PR_HIGH, 'Menu title'); - } /** * Return fake-ID "root" if no ID is found (needed to upload files into the root-folder) @@ -304,8 +300,8 @@ HTML; * Called and returns in same way as 'save' function */ public function movemarked($urlParams, $form) { - if($_REQUEST['DestFolderID'] && is_numeric($_REQUEST['DestFolderID'])) { - $destFolderID = $_REQUEST['DestFolderID']; + if($_REQUEST['DestFolderID'] && (is_numeric($_REQUEST['DestFolderID']) || ($_REQUEST['DestFolderID']) == 'root')) { + $destFolderID = ($_REQUEST['DestFolderID'] == 'root') ? 0 : $_REQUEST['DestFolderID']; $fileList = "'" . ereg_replace(' *, *',"','",trim(addslashes($_REQUEST['FileIDs']))) . "'"; $numFiles = 0; diff --git a/code/CMSMain.php b/code/CMSMain.php index 66e89abc..638bab5c 100644 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -42,7 +42,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr 'duplicatewithchildren', 'filtersitetree', 'getpagecount', - 'getpagemembers', 'getversion', 'publishall', 'publishitems', @@ -125,10 +124,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr Requirements::javascript(CMS_DIR . '/javascript/CMSMain_right.js'); } - public function getMenuTitle() { - return _t('LeftAndMain.SITECONTENT', 'Site Content', PR_HIGH, 'Menu title'); - } - /** * If this is set to true, the "switchView" context in the * template is shown, with links to the staging and publish site. @@ -166,6 +161,10 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $this->generateDataTreeHints(); $this->generateTreeStylingJS(); + // Pre-cache sitetree version numbers for querying efficiency + Versioned::prepopulate_versionnumber_cache("SiteTree", "Stage"); + Versioned::prepopulate_versionnumber_cache("SiteTree", "Live"); + return $this->getSiteTreeFor("SiteTree"); } @@ -192,6 +191,10 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr * Returns a filtered Site Tree */ public function filtersitetree() { + // Pre-cache sitetree version numbers for querying efficiency + Versioned::prepopulate_versionnumber_cache("SiteTree", "Stage"); + Versioned::prepopulate_versionnumber_cache("SiteTree", "Live"); + $className = 'SiteTree'; $rootID = null; $obj = $rootID ? $this->getRecord($rootID) : singleton($className); @@ -655,123 +658,7 @@ JS; } } - //------------------------------------------------------------------------------------------// - // Workflow handlers - - /** - * Send this page on to another user for review - */ - function submit() { - $page = DataObject::get_by_id("SiteTree", $_REQUEST['ID']); - $recipient = DataObject::get_by_id("Member", $_REQUEST['RecipientID']); - if(!$recipient) user_error("CMSMain::submit() Can't find recipient #$_REQUEST[RecipientID]", E_USER_ERROR); - - $comment = new WorkflowPageComment(); - $comment->Comment = $_REQUEST['Message']; - $comment->PageID = $page->ID; - $comment->AuthorID = Member::currentUserID(); - $comment->Recipient = $recipient; - $comment->Action = $_REQUEST['Status']; - $comment->write(); - - $emailData = $page->customise(array( - "Message" => $_REQUEST['Message'], - "Recipient" => $recipient, - "Sender" => Member::currentUser(), - "ApproveLink" => "admin/approve/$page->ID", - "EditLink" => "admin/show/$page->ID", - "StageLink" => "$page->URLSegment/?stage=Stage", - )); - - $email = new Page_WorkflowSubmitEmail(); - $email->populateTemplate($emailData); - $email->send(); - - $page->AssignedToID = $recipient->ID; - $page->RequestedByID = Member::currentUserID(); - $page->Status = $_REQUEST['Status']; - $page->writeWithoutVersion(); - - FormResponse::status_message(sprintf(_t('CMSMain.SENTTO',"Sent to %s %s for approval.",PR_LOW,"First param is first name, and second is surname"), - $recipient->FirstName, $recipient->Surname), "good"); - - return FormResponse::respond(); - } - - function getpagemembers() { - $relationName = $_REQUEST['SecurityLevel']; - $pageID = $this->urlParams['ID']; - $page = DataObject::get_by_id('SiteTree',$pageID); - if($page) { - foreach($page->$relationName() as $editorGroup) $groupIDs[] = $editorGroup->ID; - if($groupIDs) { - $groupList = implode(", ", $groupIDs); - $members = DataObject::get("Member","","", - "INNER JOIN \"Group_Members\" ON \"Group_Members\".\"MemberID\" = \"Member\".\"ID\" AND \"Group_Members\".\"GroupID\" IN ($groupList)"); - } - - if($members) { - - if( $page->RequestedByID ) - $members->shift( $page->RequestedBy() ); - - foreach($members as $editor) { - $options .= ""; - } - } else { - $options = ""; - } - - return <<Send to - -HTML; - } else { - user_error("CMSMain::getpagemembers() Cannot find page #$pageID", E_USER_ERROR); - } - } - - function tasklist() { - $tasks = DataObject::get("Page", "\"AssignedToID\" = " . Member::currentUserID(), "\"Created\" DESC"); - if($tasks) { - $data = new ArrayData(array( - "Tasks" => $tasks, - "Message" => sprintf(_t('CMSMain.WORKTODO',"You have work to do on these %d pages."),$tasks->Count()), - )); - } else { - $data = new ArrayData(array( - "Message" => _t('CMSMain.NOTHINGASSIGNED',"You have nothing assigned to you."), - )); - } - return $data->renderWith("TaskList"); - } - - function waitingon() { - $tasks = DataObject::get("Page", "\"RequestedByID\" = " . Member::currentUserID(), "\"Created\" DESC"); - if($tasks) { - $data = new ArrayData(array( - "Tasks" => $tasks, - "Message" => sprintf(_t('CMSMain.WAITINGON',"You are waiting on other people to work on these %d pages."),$tasks->Count()), - )); - } else { - $data = new ArrayData(array( - "Message" => _t('CMSMain.NOWAITINGON','You aren\'t waiting on anybody.'), - )); - } - return $data->renderWith("WaitingOn"); - } - - function comments() { - if($this->urlParams['ID']) { - $comments = DataObject::get("WorkflowPageComment", "\"PageID\" = " . $this->urlParams['ID'], "\"Created\" DESC"); - $data = new ArrayData(array( - "Comments" => $comments, - )); - return $data->renderWith("CommentList"); - } - } - - /** + /* * Return a dropdown for selecting reports */ function ReportSelector() { @@ -1427,6 +1314,73 @@ HTML; } } + /** + * Switch the cms language and reload the site tree + * + */ + function switchlanguage($lang, $donotcreate = null) { + //is it's a clean switch (to an existing language deselect the current page) + if (is_string($lang)) $dontunloadPage = true; + $lang = (is_string($lang) ? $lang : urldecode($this->urlParams['ID'])); + if ($lang != Translatable::default_lang()) { + Translatable::set_reading_lang(Translatable::default_lang()); + $tree_class = $this->stat('tree_class'); + $obj = new $tree_class; + $allIDs = $obj->getDescendantIDList(); + $allChildren = $obj->AllChildren(); + $classesMap = $allChildren->map('ID','ClassName'); + $titlesMap = $allChildren->map(); + Translatable::set_reading_lang($lang); + $obj = new $tree_class; + $languageIDs = $obj->getDescendantIDList(); + $notcreatedlist = array_diff($allIDs,$languageIDs); + FormResponse::add("$('addpage').getElementsByTagName('button')[0].disabled=true;"); + //FormResponse::add("$('Form_AddPageOptionsForm').getElementsByTagName('div')[1].getElementsByTagName('input')[0].disabled=true;"); + FormResponse::add("$('Translating_Message').innerHTML = 'Translating mode - ".i18n::get_language_name($lang)."';"); + FormResponse::add("Element.removeClassName('Translating_Message','nonTranslating');"); + } else { + Translatable::set_reading_lang($lang); + FormResponse::add("$('addpage').getElementsByTagName('button')[0].disabled=false;"); + //FormResponse::add("$('Form_AddPageOptionsForm').getElementsByTagName('div')[1].getElementsByTagName('input')[0].disabled=false;"); + FormResponse::add("Element.addClassName('Translating_Message','nonTranslating');"); + } + $obj = singleton($this->stat('tree_class')); + $obj->markPartialTree(); + $siteTree = $obj->getChildrenAsUL("", ' + "
  • ID\" class=\"" . $child->CMSTreeClasses($extraArg) . "\">" . + "Link(),0,-1), "show", $child->ID) . "\" " . (($child->canEdit() || $child->canAddChildren()) ? "" : "class=\"disabled\"") . " title=\"' . _t('LeftAndMain.PAGETYPE') . '".$child->class."\" >" . + (Convert::raw2js($child->TreeTitle())) . + "" +' + ,$this, true); + + $rootLink = $this->Link() . '0'; + $siteTree = "
  • " . + _t('LeftAndMain.SITECONTENT') . "" + . $siteTree . "
  • "; + FormResponse::add("$('sitetree').innerHTML ='". ereg_replace("[\n]","\\\n",$siteTree) ."';"); + FormResponse::add("SiteTree.applyTo('#sitetree');"); + if (isset($notcreatedlist)) { + foreach ($notcreatedlist as $notcreated) { + if ($notcreated == $donotcreate) continue; + $id = "new-{$classesMap[$notcreated]}-0-$notcreated"; + Session::set($id . '_originalLangID',$notcreated); + $treeTitle = Convert::raw2js($titlesMap[$notcreated]); + $response = <<getLastFormIn($this->renderWith('CommentAdmin_right')); } diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 82d6b9a1..7e87dba4 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -306,15 +306,6 @@ class LeftAndMain extends Controller { ); } - /** - * Override {@link getMenuTitle} in child classes to make the menu title translatable for that class. - * Uses {@link $menu_title} if present, otherwise falls back to the classname without the "Admin" suffix. - * - * @return string - */ - public function getMenuTitle() { - return ($this->stat('menu_title')) ? $this->stat('menu_title') : preg_replace('/Admin$/', '', $this->class); - } /** * Returns the menu title for the given LeftAndMain subclass. @@ -411,7 +402,7 @@ class LeftAndMain extends Controller { // already set in CMSMenu::populate_menu(), but from a static pre-controller // context, so doesn't respect the current user locale in _t() calls - as a workaround, - // we simply call getMenuTitle() again if we're dealing with a controller + // we simply call LeftAndMain::menu_title_for_class() again if we're dealing with a controller if($menuItem->controller) { $defaultTitle = LeftAndMain::menu_title_for_class($menuItem->controller); $title = _t("{$menuItem->controller}.MENUTITLE", $defaultTitle); @@ -434,6 +425,10 @@ class LeftAndMain extends Controller { } + public function CMSTopMenu() { + return $this->renderWith(array('CMSTopMenu_alternative','CMSTopMenu')); + } + /** * Return a list of appropriate templates for this class, with the given suffix */ @@ -461,7 +456,7 @@ class LeftAndMain extends Controller { function getSiteTreeFor($className, $rootID = null) { $obj = $rootID ? $this->getRecord($rootID) : singleton($className); - $obj->markPartialTree(null, $this); + $obj->markPartialTree(30, $this); if($p = $this->currentPage()) $obj->markToExpose($p); // getChildrenAsUL is a flexible and complex way of traversing the tree @@ -927,7 +922,11 @@ JS; } /** - * Return the version number of this application + * Return the version number of this application. + * Uses the subversion path information in /silverstripe_version + * (automacially replaced $URL$ placeholder). + * + * @return string */ public function CMSVersion() { $sapphireVersionFile = file_get_contents('../sapphire/silverstripe_version'); @@ -938,21 +937,21 @@ JS; $sapphireVersion = "trunk"; } else { preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches); - $sapphireVersion = $matches[1]; + $sapphireVersion = ($matches) ? $matches[1] : null; } if(strstr($jspartyVersionFile, "/jsparty/trunk")) { $jspartyVersion = "trunk"; } else { preg_match("/jsparty\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $jspartyVersionFile, $matches); - $jspartyVersion = $matches[1]; + $jspartyVersion = ($matches) ? $matches[1] : null; } if(strstr($cmsVersionFile, "/cms/trunk")) { $cmsVersion = "trunk"; } else { preg_match("/cms\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $cmsVersionFile, $matches); - $cmsVersion = $matches[1]; + $cmsVersion = ($matches) ? $matches[1] : null; } if($sapphireVersion == $jspartyVersion && $jspartyVersion == $cmsVersion) { diff --git a/code/ReportAdmin.php b/code/ReportAdmin.php index d59375b3..c512b3d8 100755 --- a/code/ReportAdmin.php +++ b/code/ReportAdmin.php @@ -43,10 +43,6 @@ class ReportAdmin extends LeftAndMain { Requirements::block(SAPPHIRE_DIR . '/javascript/HtmlEditorField.js'); } - public function getMenuTitle() { - return _t('LeftAndMain.REPORTS', 'Reports', PR_HIGH, 'Menu title'); - } - /** * Does the parent permission checks, but also * makes sure that instantiatable subclasses of diff --git a/code/SecurityAdmin.php b/code/SecurityAdmin.php index 51531cb3..90c4b380 100644 --- a/code/SecurityAdmin.php +++ b/code/SecurityAdmin.php @@ -65,7 +65,6 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { return $form; } - public function AddRecordForm() { $m = Object::create('MemberTableField', $this, @@ -103,29 +102,29 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { public function MemberForm() { $id = $_REQUEST['ID'] ? $_REQUEST['ID'] : Session::get('currentMember'); - if($id) - return $this->getMemberForm($id); + if($id) return $this->getMemberForm($id); } public function getMemberForm($id) { - if($id && $id != 'new') $record = DataObject::get_by_id("Member",$id); + if($id && $id != 'new') $record = DataObject::get_by_id('Member', (int) $id); if($record || $id == 'new') { $fields = new FieldSet( new HiddenField('MemberListBaseGroup', '', $this->currentPageID() ) ); - if( $extraFields = $record->getCMSFields() ) - foreach( $extraFields as $extra ) + if($extraFields = $record->getCMSFields()) { + foreach($extraFields as $extra) { $fields->push( $extra ); + } + } - $fields->push($idField = new HiddenField("ID")); - $fields->push($groupIDField = new HiddenField("GroupID")); - + $fields->push($idField = new HiddenField('ID')); + $fields->push($groupIDField = new HiddenField('GroupID')); $actions = new FieldSet(); - $actions->push(new FormAction('savemember',_t('SecurityAdmin.SAVE'))); + $actions->push(new FormAction('savemember', _t('SecurityAdmin.SAVE'))); - $form = new Form($this, "MemberForm", $fields, $actions); + $form = new Form($this, 'MemberForm', $fields, $actions); if($record) $form->loadDataFrom($record); $idField->setValue($id); @@ -137,7 +136,6 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { function savemember() { $data = $_REQUEST; - $className = $this->stat('subitem_class'); $id = $_REQUEST['ID']; @@ -155,7 +153,6 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { $record->Groups()->add($data['GroupID']); - FormResponse::add("reloadMemberTableField();"); return FormResponse::respond(); @@ -164,14 +161,14 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { function addmember($className=null) { $data = $_REQUEST; unset($data['ID']); - if($className == null) - $className = $this->stat('subitem_class'); + if($className == null) $className = $this->stat('subitem_class'); + $record = new $className(); $record->update($data); $record->write(); - if($data['GroupID']) - $record->Groups()->add($data['GroupID']); + + if($data['GroupID']) $record->Groups()->add($data['GroupID']); FormResponse::add("reloadMemberTableField();"); @@ -182,10 +179,9 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { $groupID = $this->urlParams['ID']; $memberID = $this->urlParams['OtherID']; if(is_numeric($groupID) && is_numeric($memberID)) { - $member = DataObject::get_by_id('Member', $memberID); + $member = DataObject::get_by_id('Member', (int) $memberID); $member->Groups()->remove($groupID); FormResponse::add("reloadMemberTableField();"); - } else { user_error("SecurityAdmin::removememberfromgroup: Bad parameters: Group=$groupID, Member=$memberID", E_USER_ERROR); } @@ -213,7 +209,6 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { ""; return $siteTree; - } public function addgroup() { @@ -227,14 +222,9 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { } public function EditedMember() { - if(Session::get('currentMember')) - return DataObject::get_by_id("Member", Session::get('currentMember')); + if(Session::get('currentMember')) return DataObject::get_by_id('Member', (int) Session::get('currentMember')); } - public function getMenuTitle() { - return _t('LeftAndMain.SECURITY', 'Security', PR_HIGH, 'Menu title'); - } - function providePermissions() { return array( 'EDIT_PERMISSIONS' => _t('SecurityAdmin.EDITPERMISSIONS', 'Edit permissions and IP addresses on each group'), diff --git a/javascript/AssetAdmin.js b/javascript/AssetAdmin.js index c04ca8ed..67afd5de 100755 --- a/javascript/AssetAdmin.js +++ b/javascript/AssetAdmin.js @@ -228,7 +228,7 @@ DragFileItem.prototype = { this.draggable = null; } } -DragFileItem.applyTo('#Form_EditForm_Files tr .dragfile'); +DragFileItem.applyTo('#Form_EditForm_Files tr td .dragfile'); // Set up folder drop target DropFileItem = Class.create(); @@ -238,30 +238,27 @@ DropFileItem.prototype = { // eg:
  • would give a recordID of 6 if(this.id && this.id.match(/-([^-]+)$/)) this.recordID = RegExp.$1; - // Do not allow files to be dropped to the root - if (this.recordID != 'root') { - this.droppable = Droppables.add(this.id, {accept:'dragfile', hoverclass:'filefolderhover', - onDrop:function(droppedElement) { - // Get this.recordID from the last "-" separated chunk of the id HTML attribute - // eg:
  • would give a recordID of 6 - if(this.element.id && this.element.id.match(/-([^-]+)$/)) - this.recordID = RegExp.$1; - $('Form_EditForm').elements['DestFolderID'].value = this.recordID; + this.droppable = Droppables.add(this.id, {accept:'dragfile', hoverclass:'filefolderhover', + onDrop:function(droppedElement) { + // Get this.recordID from the last "-" separated chunk of the id HTML attribute + // eg:
  • would give a recordID of 6 + if(this.element.id && this.element.id.match(/-([^-]+)$/)) + this.recordID = RegExp.$1; + $('Form_EditForm').elements['DestFolderID'].value = this.recordID; - // Add the dropped file to the list of files to move - var list = droppedElement.getElementsByTagName('img')[0].id.replace('drag-img-Files-',''); - var i, checkboxes = $('Form_EditForm').elements['Files[]']; - if(!checkboxes) checkboxes = []; - if(!checkboxes.length) checkboxes = [ checkboxes ]; - // Add each checked file to the list of ones to move - for(i=0;i -
      - <% control Comments %> -
    • - $Comment -
      $Action $Created.Ago - $Author.FirstName $Author.Surname.Initial
      -
    • - <% end_control %> -
    -<% else %> -

    <% _t('NOCOM','There are no comments on this page.') %>

    -

    <% _t('CREATEDW',"Comments are created whenever one of the 'workflow actions' - are undertaken - Publish, Reject, Submit.") %>

    -<% end_if %> \ No newline at end of file diff --git a/templates/Includes/AssetTableField.ss b/templates/Includes/AssetTableField.ss index 4ffcd150..9b7fd7b2 100755 --- a/templates/Includes/AssetTableField.ss +++ b/templates/Includes/AssetTableField.ss @@ -16,32 +16,43 @@ - <% control Items %> - - - Drag - - <% if Markable %>$MarkingCheckbox<% end_if %> - <% control Fields %> - $Value - <% end_control %> - <% if Can(show) %> - - <% _t('SHOW', 'Show asset') %> - - <% end_if %> - <% if Can(edit) %> + <% if Items %> + <% control Items %> + + + Drag + + <% if Markable %>$MarkingCheckbox<% end_if %> + <% control Fields %> + $Value + <% end_control %> + <% if Can(show) %> - <% _t('EDIT', 'Edit asset') %> + <% _t('SHOW', 'Show asset') %> - <% end_if %> - <% if Can(delete) %> - - <% _t('DELFILE', 'Delete this file') %> - - <% end_if %> - - <% end_control %> + <% end_if %> + <% if Can(edit) %> + + <% _t('EDIT', 'Edit asset') %> + + <% end_if %> + <% if Can(delete) %> + + <% _t('DELFILE', 'Delete this file') %> + + <% end_if %> + + <% end_control %> + <% else %> + +   + <% if Markable %> <% end_if %> + No $NamePlural found + <% if Can(show) %> <% end_if %> + <% if Can(edit) %> <% end_if %> + <% if Can(delete) %> <% end_if %> + + <% end_if %> \ No newline at end of file diff --git a/templates/Includes/CMSMain_right.ss b/templates/Includes/CMSMain_right.ss index 42a1f577..e69d843e 100755 --- a/templates/Includes/CMSMain_right.ss +++ b/templates/Includes/CMSMain_right.ss @@ -1,26 +1,6 @@
    - <% if EditForm %> $EditForm <% else %> diff --git a/templates/LeftAndMain.ss b/templates/LeftAndMain.ss index f3b8a7f8..ad2dea4b 100644 --- a/templates/LeftAndMain.ss +++ b/templates/LeftAndMain.ss @@ -10,16 +10,19 @@
    <% _t('LOADING','Loading...',PR_HIGH) %>
    - -
    - <% include CMSTopMenu %> -
    - $Left +
    + $CMSTopMenu
    + +
    + $Left +
    +
     
    + @@ -34,25 +37,24 @@
    -
    - $ApplicationName -  - $ApplicationName <% _t('APPVERSIONTEXT2',"version that you are currently running, technically it's the CVS branch") %>">$CMSVersion       - <% control CurrentMember %> - <% _t('LOGGEDINAS','Logged in as') %> <% if FirstName && Surname %>$FirstName $Surname<% else_if FirstName %>$FirstName<% else %>$Email<% end_if %> | <% _t('EDITPROFILE','Profile') %> | <% _t('LOGOUT','log out') %> - <% end_control %> -
    +
    + $ApplicationName -  + $ApplicationName <% _t('APPVERSIONTEXT2',"version that you are currently running, technically it's the CVS branch") %>">$CMSVersion       + <% control CurrentMember %> + <% _t('LOGGEDINAS','Logged in as') %> <% if FirstName && Surname %>$FirstName $Surname<% else_if FirstName %>$FirstName<% else %>$Email<% end_if %> | <% _t('EDITPROFILE','Profile') %> | <% _t('LOGOUT','log out') %> + <% end_control %> +
    -
    - <% if ShowSwitchView %> -
    <% _t('VIEWPAGEIN','Page view:') %>
    - <% _t('EDIT','Edit') %> - | <% _t('DRAFTS','Draft Site') %> - | <% _t('PUBLIS','Published Site') %> - - <% end_if %> -
    - +
    + <% if ShowSwitchView %> +
    <% _t('VIEWPAGEIN','Page view:') %>
    + <% _t('EDIT','Edit') %> + | <% _t('DRAFTS','Draft Site') %> + | <% _t('PUBLIS','Published Site') %> + + <% end_if %> +
    - + \ No newline at end of file diff --git a/templates/WaitingOn.ss b/templates/WaitingOn.ss deleted file mode 100755 index 636970a8..00000000 --- a/templates/WaitingOn.ss +++ /dev/null @@ -1,10 +0,0 @@ -

    $Message

    - -
      - <% control Tasks %> -
    • - $Title -
      <% _t('ATO','assigned to') %> $AssignedTo.FirstName $AssignedTo.Surname.Initial $LastEdited.Ago
      -
    • - <% end_control %> -
    \ No newline at end of file diff --git a/tests/CMSMenuTest.php b/tests/CMSMenuTest.php index fb85d4f4..ef3387e9 100644 --- a/tests/CMSMenuTest.php +++ b/tests/CMSMenuTest.php @@ -17,7 +17,6 @@ class CMSMenuTest extends SapphireTest implements TestOnly { $menuItems = CMSMenu::get_menu_items(); $menuItem = $menuItems['CMSMain']; $this->assertType('CMSMenuItem', $menuItem, 'Controller menu item is of class CMSMenuItem'); - $this->assertEquals($menuItem->title, singleton('CMSMain')->getMenuTitle(), 'Controller menu item has the correct title'); $this->assertEquals($menuItem->url, singleton('CMSMain')->Link(), 'Controller menu item has the correct link'); $this->assertEquals($menuItem->controller, 'CMSMain', 'Controller menu item has the correct controller class'); $this->assertEquals($menuItem->priority, singleton('CMSMain')->stat('menu_priority'), 'Controller menu item has the correct priority'); @@ -55,7 +54,6 @@ class CMSMenuTest extends SapphireTest implements TestOnly { CMSMenu::populate_menu(); $menuItem = CMSMenu::get_menu_item('CMSMain'); $this->assertType('CMSMenuItem', $menuItem, 'CMSMain menu item exists'); - $this->assertEquals($menuItem->title, singleton('CMSMain')->getMenuTitle(), 'Menu item has the correct title'); $this->assertEquals($menuItem->url, singleton('CMSMain')->Link(), 'Menu item has the correct link'); $this->assertEquals($menuItem->controller, 'CMSMain', 'Menu item has the correct controller class'); $this->assertEquals(