mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Merge remote-tracking branch 'origin/1.1'
Conflicts: .travis.yml
This commit is contained in:
commit
5e18e8dca3
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
.DS_Store
|
||||
host-map.php
|
||||
|
@ -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:
|
||||
|
@ -4,3 +4,7 @@ After: 'framework/*','cms/*'
|
||||
---
|
||||
AssetAdmin:
|
||||
treats_subsite_0_as_global: true
|
||||
|
||||
Director:
|
||||
rules:
|
||||
'SubsiteXHRController': 'SubsiteXHRController'
|
||||
|
@ -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) {
|
||||
|
@ -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() {
|
||||
|
@ -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;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
15
lang/en.yml
15
lang/en.yml
@ -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
19
lang/id.yml
Normal 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
|
@ -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>»</span></a>
|
||||
<a class="toggle-collapse" href="#"><span>«</span></a>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user