Merge remote-tracking branch 'origin/1.1'

Conflicts:
	.travis.yml
This commit is contained in:
Damian Mooyman 2015-11-13 19:06:09 +13:00
commit 5e18e8dca3
9 changed files with 76 additions and 36 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.DS_Store .DS_Store
host-map.php

View File

@ -5,7 +5,7 @@ language: php
sudo: false sudo: false
php: php:
- 5.4 - 5.5
env: env:
global: global:
@ -16,9 +16,7 @@ env:
matrix: matrix:
include: include:
- php: 5.3 - php: 5.5
env: DB=MYSQL
- php: 5.4
env: DB=MYSQL BEHAT_TEST=1 env: DB=MYSQL BEHAT_TEST=1
before_script: before_script:

View File

@ -4,3 +4,7 @@ After: 'framework/*','cms/*'
--- ---
AssetAdmin: AssetAdmin:
treats_subsite_0_as_global: true treats_subsite_0_as_global: true
Director:
rules:
'SubsiteXHRController': 'SubsiteXHRController'

View File

@ -22,15 +22,13 @@ class SubsitesVirtualPage extends VirtualPage {
$subsites->push(new ArrayData(array('Title' => 'Main site', 'ID' => 0))); $subsites->push(new ArrayData(array('Title' => 'Main site', 'ID' => 0)));
$subsiteSelectionField = new DropdownField(
"CopyContentFromID_SubsiteID",
_t('SubsitesVirtualPage.SubsiteField',"Subsite"),
$subsites->map('ID', 'Title'),
($this->CopyContentFromID) ? $this->CopyContentFrom()->SubsiteID : Session::get('SubsiteID')
);
$fields->addFieldToTab( $fields->addFieldToTab(
'Root.Main', 'Root.Main',
$subsiteSelectionField, DropdownField::create(
"CopyContentFromID_SubsiteID",
_t('SubsitesVirtualPage.SubsiteField',"Subsite"),
$subsites->map('ID', 'Title')
)->addExtraClass('subsitestreedropdownfield-chooser no-change-track'),
'CopyContentFromID' 'CopyContentFromID'
); );
@ -44,7 +42,7 @@ class SubsitesVirtualPage extends VirtualPage {
); );
if(Controller::has_curr() && Controller::curr()->getRequest()) { if(Controller::has_curr() && Controller::curr()->getRequest()) {
$subsiteID = Controller::curr()->getRequest()->postVar('CopyContentFromID_SubsiteID'); $subsiteID = Controller::curr()->getRequest()->requestVar('CopyContentFromID_SubsiteID');
$pageSelectionField->setSubsiteID($subsiteID); $pageSelectionField->setSubsiteID($subsiteID);
} }
$fields->replaceField('CopyContentFromID', $pageSelectionField); $fields->replaceField('CopyContentFromID', $pageSelectionField);
@ -111,6 +109,10 @@ class SubsitesVirtualPage extends VirtualPage {
return $labels; return $labels;
} }
public function getCopyContentFromID_SubsiteID() {
return ($this->CopyContentFromID) ? (int)$this->CopyContentFrom()->SubsiteID : (int)Session::get('SubsiteID');
}
public function getVirtualFields() { public function getVirtualFields() {
$fields = parent::getVirtualFields(); $fields = parent::getVirtualFields();

View File

@ -205,7 +205,10 @@ class SiteTreeSubsites extends DataExtension {
*/ */
static function contentcontrollerInit($controller) { static function contentcontrollerInit($controller) {
$subsite = Subsite::currentSubsite(); $subsite = Subsite::currentSubsite();
if($subsite && $subsite->Theme) SSViewer::set_theme(Subsite::currentSubsite()->Theme);
if($subsite && $subsite->Theme){
Config::inst()->update('SSViewer', 'theme', Subsite::currentSubsite()->Theme);
}
} }
function alternateAbsoluteLink() { function alternateAbsoluteLink() {

View File

@ -1,24 +1,30 @@
(function($) { (function($) {
$.entwine('ss', function($) { $.entwine('ss', function($) {
$('.TreeDropdownField').entwine({ /**
subsiteID: function() { * Choose a subsite from which to select pages.
var subsiteSel = $('#CopyContentFromID_SubsiteID select')[0]; * Needs to clear tree dropdowns in case selection is changed.
if(!subsiteSel) return; */
$('.subsitestreedropdownfield-chooser').entwine({
subsiteSel.onchange = (function() { onchange: function() {
this.createTreeNode(true); // TODO Data binding between two fields
this.ajaxGetTree((function(response) { // TODO create resetField method on API instead
this.newTreeReady(response, true); var fields = $('.SubsitesTreeDropdownField');
this.updateTreeLabel(); fields.setValue(null);
}).bind(this)); fields.setTitle(null);
}).bind(this); fields.find('.tree-holder').empty();
return subsiteSel.options[subsiteSel.selectedIndex].value; }
}, });
/**
* Add selected subsite from separate dropdown to the request parameters
* before asking for the tree.
*/
$('.TreeDropdownField.SubsitesTreeDropdownField').entwine({
getRequestParams: function() { getRequestParams: function() {
var name = this.find(':input:hidden').attr('name'), obj = {}; var name = this.find(':input[type=hidden]:first').attr('name') + '_SubsiteID',
obj[name + '_SubsiteID'] = parseInt(this.subsiteID()); source = $('[name=' + name + ']'), params = {};
return obj; params[name] = source.length ? source.val() : null;
return params;
} }
}); });
}); });

View File

@ -1,8 +1,4 @@
en: en:
SubsiteAdmin:
MENUTITLE: Subsites
SubsiteXHRController:
MENUTITLE: SubsiteXHRController
ASSETADMIN: ASSETADMIN:
SUBSITENOTICE: 'Folders and files created in the main site are accessible by all subsites.' SUBSITENOTICE: 'Folders and files created in the main site are accessible by all subsites.'
FileSubsites: FileSubsites:
@ -20,6 +16,9 @@ en:
SECURITYTABTITLE: Subsites SECURITYTABTITLE: Subsites
LeftAndMainSubsites: LeftAndMainSubsites:
Saved: 'Saved, please update related pages.' Saved: 'Saved, please update related pages.'
LeftAndMain_Menu:
Hello: Hi
LOGOUT: 'Log out'
SiteTreeSubsites: SiteTreeSubsites:
CopyAction: Copy CopyAction: Copy
CopyToSubsite: 'Copy page to subsite' CopyToSubsite: 'Copy page to subsite'
@ -42,6 +41,8 @@ en:
SiteConfigTitle: 'Your Site Name' SiteConfigTitle: 'Your Site Name'
TabTitleConfig: Configuration TabTitleConfig: Configuration
ValidateTitle: 'Please add a "Title"' ValidateTitle: 'Please add a "Title"'
SubsiteAdmin:
MENUTITLE: Subsites
SubsiteDomain: SubsiteDomain:
DOMAIN: Domain DOMAIN: Domain
IS_PRIMARY: 'Is Primary Domain' IS_PRIMARY: 'Is Primary Domain'
@ -49,6 +50,8 @@ en:
SINGULARNAME: 'Subsite Domain' SINGULARNAME: 'Subsite Domain'
SubsiteReportWrapper: SubsiteReportWrapper:
ReportDropdown: Sites ReportDropdown: Sites
SubsiteXHRController:
MENUTITLE: SubsiteXHRController
Subsites: Subsites:
DefaultSiteFieldLabel: 'Default site' DefaultSiteFieldLabel: 'Default site'
DomainFieldLabel: Domain DomainFieldLabel: Domain
@ -62,6 +65,8 @@ en:
TitleFieldLabel: 'Subsite Name' TitleFieldLabel: 'Subsite Name'
SubsitesVirtualPage: SubsitesVirtualPage:
DESCRIPTION: 'Displays the content of a page on another subsite' DESCRIPTION: 'Displays the content of a page on another subsite'
PLURALNAME: 'Subsites Virtual Pages' PLURALNAME: 'Base Pages'
SINGULARNAME: 'Subsites Virtual Page' SINGULARNAME: 'Subsites Virtual Page'
SubsiteField: Subsite SubsiteField: Subsite
VirtualPage:
EDITCONTENT: 'Click here to edit the content'

19
lang/id.yml Normal file
View File

@ -0,0 +1,19 @@
id:
SubsiteAdmin:
MENUTITLE: Subsitus
FileSubsites:
SubsiteFieldLabel: Subsitus
GroupSubsites:
SECURITYTABTITLE: Subsitus
Subsite:
CustomMetaDescription: Deskripsi
CustomMetaKeywords: Kata kunci
CustomMetaTitle: Judul
PLURALNAME: Subsitus
SINGULARNAME: Subsitus
SubsiteReportWrapper:
ReportDropdown: Situs
Subsites:
LanguageFieldLabel: Bahasa
SubsitesVirtualPage:
SubsiteField: Subsitus

View File

@ -37,6 +37,8 @@
</div> </div>
<div class="cms-panel-toggle south"> <div class="cms-panel-toggle south">
<button class="sticky-toggle" type="button" title="Sticky nav">Sticky nav</button>
<span class="sticky-status-indicator">auto</span>
<a class="toggle-expand" href="#"><span>&raquo;</span></a> <a class="toggle-expand" href="#"><span>&raquo;</span></a>
<a class="toggle-collapse" href="#"><span>&laquo;</span></a> <a class="toggle-collapse" href="#"><span>&laquo;</span></a>
</div> </div>