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
host-map.php

View File

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

View File

@ -4,3 +4,7 @@ After: 'framework/*','cms/*'
---
AssetAdmin:
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)));
$subsiteSelectionField = new DropdownField(
"CopyContentFromID_SubsiteID",
_t('SubsitesVirtualPage.SubsiteField',"Subsite"),
$subsites->map('ID', 'Title'),
($this->CopyContentFromID) ? $this->CopyContentFrom()->SubsiteID : Session::get('SubsiteID')
);
$fields->addFieldToTab(
'Root.Main',
$subsiteSelectionField,
DropdownField::create(
"CopyContentFromID_SubsiteID",
_t('SubsitesVirtualPage.SubsiteField',"Subsite"),
$subsites->map('ID', 'Title')
)->addExtraClass('subsitestreedropdownfield-chooser no-change-track'),
'CopyContentFromID'
);
@ -44,7 +42,7 @@ class SubsitesVirtualPage extends VirtualPage {
);
if(Controller::has_curr() && Controller::curr()->getRequest()) {
$subsiteID = Controller::curr()->getRequest()->postVar('CopyContentFromID_SubsiteID');
$subsiteID = Controller::curr()->getRequest()->requestVar('CopyContentFromID_SubsiteID');
$pageSelectionField->setSubsiteID($subsiteID);
}
$fields->replaceField('CopyContentFromID', $pageSelectionField);
@ -112,6 +110,10 @@ class SubsitesVirtualPage extends VirtualPage {
return $labels;
}
public function getCopyContentFromID_SubsiteID() {
return ($this->CopyContentFromID) ? (int)$this->CopyContentFrom()->SubsiteID : (int)Session::get('SubsiteID');
}
public function getVirtualFields() {
$fields = parent::getVirtualFields();
foreach($fields as $k => $v) {

View File

@ -205,7 +205,10 @@ class SiteTreeSubsites extends DataExtension {
*/
static function contentcontrollerInit($controller) {
$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() {

View File

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

View File

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