Compare commits

..

No commits in common. "2" and "2.1.0" have entirely different histories.
2 ... 2.1.0

93 changed files with 474 additions and 2548 deletions

View File

@ -13,7 +13,7 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,feature}]
[*.yml]
indent_size = 2
[{.travis.yml,package.json,composer.json}]

View File

@ -1,11 +0,0 @@
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
ci:
name: CI
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1

View File

@ -1,16 +0,0 @@
name: Deploy Userhelp Docs
on:
push:
branches:
- '3'
- '2'
- '1.1'
paths:
- 'docs/en/userguide/**'
jobs:
deploy:
name: deploy-userhelp-docs
runs-on: ubuntu-latest
steps:
- name: Run build hook
run: curl -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.NETLIFY_BUILD_HOOK }}

View File

@ -1,16 +0,0 @@
name: Dispatch CI
on:
# At 11:30 AM UTC, only on Saturday and Sunday
schedule:
- cron: '30 11 * * 6,0'
jobs:
dispatch-ci:
name: Dispatch CI
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Dispatch CI
uses: silverstripe/gha-dispatch-ci@v1

View File

@ -1,17 +0,0 @@
name: Keepalive
on:
workflow_dispatch:
# The 4th of every month at 10:50am UTC
schedule:
- cron: '50 10 4 * *'
jobs:
keepalive:
name: Keepalive
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Keepalive
uses: silverstripe/gha-keepalive@v1

13
.scrutinizer.yml Normal file
View File

@ -0,0 +1,13 @@
inherit: true
checks:
php: true
build:
nodes:
analysis:
tests:
override: [php-scrutinizer-run]
filter:
paths: [src/*, tests/*]

62
.travis.yml Normal file
View File

@ -0,0 +1,62 @@
language: php
dist: trusty
before_install:
- sudo apt-get update
- sudo apt-get install chromium-chromedriver
env:
global:
- COMPOSER_ROOT_VERSION="2.0.x-dev"
- DISPLAY=":99"
- XVFBARGS=":99 -ac -screen 0 1024x768x16"
- SS_BASE_URL="http://localhost:8080/"
- SS_ENVIRONMENT_TYPE="dev"
matrix:
include:
- php: 5.6
env: DB=MYSQL INSTALLER_VERSION=4.0.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
env: DB=PGSQL INSTALLER_VERSION=4.1.x-dev PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL INSTALLER_VERSION=4.1.x-dev BEHAT_TEST=1
- php: 7.2
env: DB=MYSQL INSTALLER_VERSION=4.2.x-dev PHPUNIT_COVERAGE_TEST=1
- php: 7.2
env: DB=MYSQL INSTALLER_VERSION=4.x-dev BEHAT_TEST=1
before_script:
# Extra $PATH
- export PATH=/usr/lib/chromium-browser/:$PATH
# Init PHP
- phpenv rehash
- phpenv config-rm xdebug.ini
- echo 'memory_limit=3G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Install composer
- composer validate
- composer require silverstripe/installer:"$INSTALLER_VERSION" silverstripe/recipe-testing:^1 --no-update
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.0.x-dev; fi
- composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
# Behat bootstrapping
- if [[ $BEHAT_TEST ]]; then mkdir artifacts; fi
- if [[ $BEHAT_TEST ]]; then cp composer.lock artifacts/; fi
- if [[ $BEHAT_TEST ]]; then sh -e /etc/init.d/xvfb start; sleep 3; fi
- if [[ $BEHAT_TEST ]]; then (chromedriver > artifacts/chromedriver.log 2>&1 &); fi
- if [[ $BEHAT_TEST ]]; then (vendor/bin/serve --bootstrap-file vendor/silverstripe/cms/tests/behat/serve-bootstrap.php &> artifacts/serve.log &); fi
script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src tests *.php --ignore=host-map.php; fi
- if [[ $BEHAT_TEST ]]; then vendor/bin/behat @subsites; fi
after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
after_failure:
- if [[ $BEHAT_TEST ]]; then php ./vendor/silverstripe/framework/tests/behat/travis-upload-artifacts.php --if-env BEHAT_TEST,ARTIFACTS_BUCKET,ARTIFACTS_KEY,ARTIFACTS_SECRET --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/ --artifacts-path ./artifacts/; fi

View File

@ -1,9 +1,8 @@
[main]
host = https://www.transifex.com
[o:silverstripe:p:silverstripe-subsites:r:master]
[silverstripe-subsites.master]
file_filter = lang/<lang>.yml
source_file = lang/en.yml
source_lang = en
type = YML
type = YML

View File

@ -1,7 +1,7 @@
# Subsites Module
[![CI](https://github.com/silverstripe/silverstripe-subsites/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-subsites/actions/workflows/ci.yml)
[![Silverstripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)
[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-subsites.png?branch=master)](http://travis-ci.org/silverstripe/silverstripe-subsites) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/silverstripe/silverstripe-subsites/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-subsites/?branch=master) [![codecov](https://codecov.io/gh/silverstripe/silverstripe-subsites/branch/master/graph/badge.svg)](https://codecov.io/gh/silverstripe/silverstripe-subsites)
[![SilverStripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)
## Introduction
@ -9,7 +9,7 @@ The subsites module provides a convenient way of running multiple websites from
sharing users, content, and assets between them - the sites will be managed from a single CMS.
A useful way to think of its use is where you have a business with a global headquarters and four branches in various
countries. The subsites module allows the five offices to use a single Silverstripe installation, and have information
countries. The subsites module allows the five offices to use a single SilverStripe installation, and have information
from the headquarters flow down into the branches. The branches can hold information that is individual and the website
templates can also be different.
@ -40,11 +40,6 @@ For user documentation please see:
### Limitations:
* Subsites are usually accessed via their own separate domains.
In order to allow efficient cross-subsite CMS editing,
they can also be accessed via URL parameters rather than domain maps.
This can weaken domain-specific security controls in your environment
such as domain-specific IP whitelists, firewall rules or business logic.
* Each subsite domain name has to be set up on the server first, and DNS records need to be updated as appropriate.
* A subsite cannot use a different codebase as the main site, they are intrinsically tied
* However, you can remove page types from a subsite when creating the subsite - [see the setup documentation for further details](docs/en/userguide/set_up.md)
@ -59,7 +54,7 @@ If more isolation of code, security, or performance is needed, then consider run
## Requirements
* Silverstripe 4.x
* SilverStripe 4.x
## Installation
@ -69,7 +64,7 @@ If more isolation of code, security, or performance is needed, then consider run
* Once you've created a subsite, you'll see a "Create Subsite Domain" button, hit that button to enter a domain or subdomain for your subsite. This will determine the URL of your website. For example, if your site is running on `http://localhost/mysite`, and you set the subdomain to "subsite", then your subsite will be accessible on `http://subsite.localhost/mysite`
* Go to the "Pages" section of the CMS. In the top-left above the menu, you'll see a dropdown listing the two subsites - "Main site" is the original site that you had before you installed the subsites module. Select your new subsite, and the site content tree will be changed. It should be empty at this stage.
* Add a page - change its title to "Home", and its URL Segment will be changed to "home". Save the page.
* Update your DNS and, if necessary, your webserver configuration, so that your subdomain will point to the Silverstripe installation on your webserver. Visit this new subdomain. You should see the new subsite homepage.
* Update your DNS and, if necessary, your webserver configuration, so that your subdomain will point to the SilverStripe installation on your webserver. Visit this new subdomain. You should see the new subsite homepage.
## Usage
@ -101,55 +96,7 @@ In some Browsers the SubsiteID is visible if you hover over the "Edit" link in t
### Subsite-specific themes
Download a second theme from http://www.silverstripe.com/themes/ and put it in your themes folder. Open
admin/subsites?flush=1 and select one of your subsites from the menu on the bottom-left. You should see a
Theme dropdown in the subsite details, and it should list both your original theme and the new theme. Select the new
theme in the dropdown. Now, this subsite will use a different theme from the main site.
#### Cascading themes
In Silverstripe 4 themes will resolve theme files by looking through a list of themes (see the documentation on
[creating your own theme](https://docs.silverstripe.org/en/4/developer_guides/templates/themes/#developing-your-own-theme)).
Subsites will inherit this configuration for the order of themes. Choosing a theme for a Subsite will set the list of
themes to that chosen theme, and all themes that are defined below the chosen theme in priority. For example, with a
theme configuration as follows:
```yaml
SilverStripe\View\SSViewer:
themes:
- '$public'
- 'my-theme'
- 'watea'
- 'starter'
- '$default'
```
Choosing `watea` in your Subsite will create a cascading config as follows:
```yaml
themes:
- 'watea'
- '$public'
- 'starter'
- '$default'
```
You may also completely define your own cascading theme lists for CMS users to choose as theme options for their
subsite:
```yaml
SilverStripe\Subsites\Service\ThemeResolver:
theme_options:
normal:
- '$public'
- 'watea'
- 'starter'
- '$default'
special:
- 'my-theme'
- 'starter'
- '$default'
```
Download a second theme from http://www.silverstripe.com/themes/ and put it in your themes folder. Open admin/subsites?flush=1 and select one of your subsites from the menu on the bottom-left. You should see a Theme dropdown in the subsite details, and it should list both your original theme and the new theme. Select the new theme in the dropdown. Now, this subsite will use a different theme from the main site.
### Limit available themes for a subsite
@ -177,8 +124,8 @@ Include the current SubsiteID as a hidden field on getCMSFields, or updateCMSFie
:::php
public function getCMSFields() {
$fields = parent::getCMSFields();
if(class_exists(Subsite::class)){
$fields->push(new HiddenField('SubsiteID','SubsiteID', SubsiteState::singleton()->getSubsiteId()));
if(class_exists('Subsite')){
$fields->push(new HiddenField('SubsiteID','SubsiteID', Subsite::currentSubsiteID()));
}
return $fields;
}
@ -192,8 +139,8 @@ To limit your admin gridfields to the current Subsite records, you can do someth
$form = parent::getEditForm($id, $fields);
$gridField = $form->Fields()->fieldByName($this->sanitiseClassName($this->modelClass));
if(class_exists(Subsite::class)){
$list = $gridField->getList()->filter(['SubsiteID'=>SubsiteState::singleton()->getSubsiteId()]);
if(class_exists('Subsite')){
$list = $gridField->getList()->filter(array('SubsiteID'=>Subsite::currentSubsiteID()));
$gridField->setList($list);
}
@ -218,14 +165,6 @@ or by defining the subsiteCMSShowInMenu function in your admin:
return true;
}
### Using Subsites in combination with Fluent
When using Subsites in combination with Fluent module, the Subsites module sets the i18n locale to the language defined in the current Subsite. When this behaviour is not desired and you need to use the locale in FluentState use the following setting in your yml config file:
```yaml
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
ignore_subsite_locale: true
```
### Public display of a subsite

5
_config.php Normal file
View File

@ -0,0 +1,5 @@
<?php
use SilverStripe\Dev\Deprecation;
Deprecation::notification_version('2.0', 'subsites');

View File

@ -50,7 +50,6 @@ SilverStripe\Admin\SecurityAdmin:
SilverStripe\CMS\Controllers\CMSMain:
extensions:
- SilverStripe\Subsites\Extensions\HintsCacheKeyExtension
- SilverStripe\Subsites\Extensions\SubsiteMenuExtension
SilverStripe\CMS\Controllers\CMSPagesController:
@ -64,12 +63,3 @@ SilverStripe\Subsites\Admin\SubsiteAdmin:
SilverStripe\SiteConfig\SiteConfigLeftAndMain:
extensions:
- SilverStripe\Subsites\Extensions\SubsiteMenuExtension
---
Name: subsite-preview-elemental
Only:
classexists: DNADesign\Elemental\Models\BaseElement
---
DNADesign\Elemental\Models\BaseElement:
extensions:
- SilverStripe\Subsites\Extensions\BaseElementSubsites

View File

@ -7,6 +7,4 @@ SilverStripe\Core\Injector\Injector:
SilverStripe\Control\Director:
properties:
Middlewares:
SubsitesStateMiddleware: '%$SilverStripe\Subsites\Middleware\InitStateMiddleware'
SilverStripe\Dev\Tasks\MigrateFileTask:
class: SilverStripe\Subsites\Tasks\SubsiteMigrateFileTask
SubsitesStateMiddleware: %$SilverStripe\Subsites\Middleware\InitStateMiddleware

View File

@ -2,7 +2,7 @@ default:
suites:
subsites:
paths:
- '%paths.modules.subsites%/tests/behat/features'
- %paths.modules.subsites%/tests/behat/features
contexts:
- SilverStripe\Framework\Tests\Behaviour\FeatureContext
- SilverStripe\Framework\Tests\Behaviour\CmsFormsContext
@ -11,10 +11,9 @@ default:
- SilverStripe\BehatExtension\Context\EmailContext
- SilverStripe\CMS\Tests\Behaviour\LoginContext
- SilverStripe\CMS\Tests\Behaviour\ThemeContext
# Using asset-admin for fixture context to get iAttachTheFileToDropzone()
- SilverStripe\AssetAdmin\Tests\Behat\Context\FixtureContext:
- SilverStripe\CMS\Tests\Behaviour\FixtureContext:
# Note: double indent for args is intentional
- '%paths.modules.subsites%/tests/behat/files/'
- %paths.modules.subsites%/tests/behat/features/files/
extensions:
SilverStripe\BehatExtension\MinkExtension:
@ -26,5 +25,5 @@ default:
browser_name: chrome
SilverStripe\BehatExtension\Extension:
screenshot_path: '%paths.base%/artifacts/screenshots'
screenshot_path: %paths.base%/artifacts/screenshots
bootstrap_file: "vendor/silverstripe/cms/tests/behat/serve-bootstrap.php"

View File

@ -15,16 +15,15 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"silverstripe/framework": "^4.10",
"silverstripe/cms": "^4.4@dev",
"silverstripe/admin": "^1.4@dev",
"silverstripe/asset-admin": "^1.4@dev",
"silverstripe/errorpage": "^1.4@dev",
"silverstripe/versioned": "^1.4@dev"
"silverstripe/framework": "^4",
"silverstripe/cms": "^4",
"silverstripe/admin": "^1",
"silverstripe/asset-admin": "^1",
"silverstripe/errorpage": "^1",
"silverstripe/versioned": "^1"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {
@ -35,10 +34,10 @@
},
"extra": {
"expose": [
"client/javascript",
"client/css"
"javascript",
"css"
]
},
"minimum-stability": "dev",
"prefer-stable": true
}
}

View File

@ -48,14 +48,3 @@ to speak to your website administrator or hosting provider to facilitate this.
You can simulate subsite access without setting up virtual hosts by appending ?SubsiteID=<ID> to the request.
### How do Subsite domains work with Fluent domains?
The Subsites module and Fluent translation module both provide the concept of defining "domains" and let you
configure the host name for it. This functionality is essentially performing the same duty in both modules.
In the "URL segment" field for CMS pages, both Subsites and Fluent will add their context to the value. If you
have a Subsite domain configured but no Fluent domain, Fluent will respect the existing domain and add its
locale context to the value. If you have a Subsite domain configured and a Fluent domain configured, Fluent will
use its own domain host name value, and the Subsite domain value will be lost. For this reason, you will need
to ensure that you use the same host name in both Subsite and Fluent domain entries.

View File

@ -28,5 +28,5 @@ This method is called when a pages are being copied between the main site or ano
### alternateAbsoluteLink
This method modifies the absolute link to contain the valid subsite domain
### updatePreviewLink
### alternatePreviewLink
This method modifies the preview link for the CMS.

View File

@ -1,7 +1,5 @@
---
title: Working with multiple websites
summary: Setting up and editing multiple websites using SilverStripe
---
# Working with multiple sites
@ -47,4 +45,4 @@ Subsites can be used for various different reasons here are some of the common o
## Documentation
* [Set up](set_up.md)
* [Working with subsites](working_with.md)
* [Working with subsites](working_with.md)

View File

@ -1,6 +1,3 @@
---
title: Setting up
---
# Setting up
## Creating subsites
@ -105,4 +102,4 @@ For example, say a subsite user publishes a new Company Page before it was forbi
A theme is group of templates, images and CSS for the look of a website. When you are using Subsites you may have different themes installed for your site so you could apply different themes for each subsite.
## Assets
Assets are files that have been uploaded via the CMS. It is suggested to use a naming convention for files designated to be used on a particular subsite or to create folders for each subsite to help organise them.
Assets are files that have been uploaded via the CMS. It is suggested to use a naming convention for files designated to be used on a particular subsite or to create folders for each subsite to help organise them.

View File

@ -1,6 +1,3 @@
---
title: Working with subsites
---
# Working with subsites
## Managing content across subsites
@ -28,4 +25,4 @@ If you have an existing page on the main site that you would like to copy to a s
![Subsites copy page from main site](_images/copy-page-to-subsite.jpg)
You will now be directed to the chosen subsite where the page will now be duplicated in the site tree
You will now be directed to the chosen subsite where the page will now be duplicated in the site tree

View File

@ -101,7 +101,7 @@
/**
* Update links and forms with GET/POST SubsiteID param, so we remaing on the current subsite.
* The initial link for the iframe comes from SiteTreeSubsites::updatePreviewLink.
* The initial link for the iframe comes from SiteTreeSubsites::alternatePreviewLink.
*
* This is done so we can use the CMS domain for displaying previews so we prevent single-origin
* violations and SSL cert problems that come up when iframing content from a different URL.

View File

@ -1,65 +1,4 @@
ar:
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'انقر هنا لتحرير المحتوى'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: 'المواقع الفرعية'
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: 'الموقع الفرعي'
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'كافة المواقع'
SUBSITENOTICE: 'يمكن الوصول إلى المجلدات والملفات التي تم إنشاؤها في الموقع الرئيسي من طرف كل المواقع الفرعية.'
SubsiteFieldLabel: 'الموقع الفرعي'
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'كل المواقع الفرعية'
ACCESSONLY: 'فقط هذه المواقع الفرعية'
ACCESSRADIOTITLE: 'امنح هذه المجموعة تصريح الولوج إلى'
GlobalGroup: 'المجموعة العامة'
MANAGE_SUBSITES: 'إدارة مواقع فرعية للمجموعات'
MANAGE_SUBSITES_HELP: 'القدرة على الحد من أذونات مجموعة ما على موقع فرعي واحدة أو أكثر.'
SECURITYTABTITLE: 'المواقع الفرعية'
many_many_Subsites: 'المواقع الفرعية'
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
Saved: 'تمّ الحفظ، يرجى تحديث الصفحات ذات الصلة.'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: 'الموقع الفرعي'
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: نسخ
CopyToSubsite: 'نسخ الصفحة في موقع فرعي'
has_one_Subsite: 'الموقع الفرعي'
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: المواصفات
CopyMessage: 'إنشاء نسخة من {title}'
CustomExtraMeta: 'تخصيص Meta Tags'
CustomMetaDescription: الوصف
CustomMetaKeywords: 'كلمات البحث'
CustomMetaTitle: عنوان
PLURALNAME: 'المواقع الفرعية'
PageTypeBlacklistField: 'عدم السماح بأصناف الصفحات؟'
SINGULARNAME: 'الموقع الفرعي'
SiteConfigSubtitle: 'هنا سطر الوصف الخاص بك'
SiteConfigTitle: 'اسم موقعك'
ValidateTitle: 'الرجاء إضافة "عنوان"'
belongs_many_many_Groups: المجموعات
db_DefaultSite: 'الموقع الافتراضي'
db_Language: لغة
db_RedirectURL: 'إعادة توجيه عنوان موقع الويب'
db_Theme: المحور
db_Title: عنوان
has_many_Domains: النطاقات
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: النطاق
PLURALNAME: 'نطاقات موقع فرعي'
SINGULARNAME: 'نطاق موقع فرعي'
db_Domain: النطاق
has_one_Subsite: 'الموقع الفرعي'
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'يعرض محتوى صفحة على موقع فرعي آخر'
PLURALNAME: 'قاعدة الصفحات'
SINGULARNAME: 'الصفحة الإفتراضية للمواقع الفرعية'
SubsiteField: 'الموقع الفرعي'
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: المواقع
ReportDropdownSubsite: 'الموقع الفرعي'
Subsite:
COPYSTRUCTURE: 'نسخ الهيكل من:'
NOTEMPLATE: 'بدون قالب'

View File

@ -2,36 +2,6 @@ cs:
LeftAndMain_Menu:
Hello: Ahoj
LOGOUT: 'Odhlásit se'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Subsites
SilverStripe\Subsites\Extensions\GroupSubsites:
SECURITYTABTITLE: Subsites
many_many_Subsites: Subsites
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Kopírovat
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Konfigurace
CustomExtraMeta: 'Vlastní meta tagy'
CustomMetaDescription: Popis
CustomMetaKeywords: 'Klíčová slova'
CustomMetaTitle: Název
PLURALNAME: Subsites
SiteConfigSubtitle: 'Slogan Vašeho webu'
SiteConfigTitle: 'Název Vašeho webu'
ValidateTitle: 'Prosím vložte "Název"'
belongs_many_many_Groups: Skupiny
db_DefaultSite: 'Výchozí web'
db_Language: Jazyk
db_Theme: Téma
db_Title: Název
has_many_Domains: Domény
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Doména
PLURALNAME: 'Domény webů'
SINGULARNAME: 'Doména webu'
db_Domain: Doména
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Weby
SiteTreeSubsites:
CopyAction: Kopírovat
Subsite:

View File

@ -1,89 +1,6 @@
de:
DomainNameField:
INVALID_DOMAIN: 'Ungültige Domain'
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'Klicken Sie hier, um den Inhalt zu bearbeiten'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Subsites
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Subseite
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Alle Seiten'
SUBSITENOTICE: 'Auf Ordner und Dateien der Hauptseite kann von allen Subsites zugegriffen werden.'
SubsiteFieldLabel: Subseite
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'Alle Subsites'
ACCESSONLY: 'Nur diese Subsites'
ACCESSRADIOTITLE: 'Dieser Gruppe Zugriff geben auf'
GlobalGroup: 'globale Gruppe'
MANAGE_SUBSITES: 'Subseiten für jede Gruppe bearbeiten'
MANAGE_SUBSITES_HELP: 'Möglichkeit, die Berechtigungen einer Gruppe auf bestimmte Subsites zu beschränken.'
SECURITYTABTITLE: Subsites
many_many_Subsites: Subsites
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
SITECONTENTLEFT: 'Seiten Inhalt'
Saved: 'Gespeichert, bitte aktualisieren Sie verknüpfte Seiten'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Subseite
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Kopieren
CopyToSubsite: 'Seite auf Subseite Kopieren'
CopyToSubsiteWithChildren: 'Samt Unterseiten?'
SubsiteOperations: 'Subseiten Operationen'
has_one_Subsite: Subseite
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Einstellungen
CopyMessage: 'Kopie von {title} erstellt'
CustomExtraMeta: 'Benutzerdefinierte Meta-Tags'
CustomMetaDescription: Beschreibung
CustomMetaKeywords: Schlüsselwörter
CustomMetaTitle: Titel
PLURALNAME: Subsites
PLURALS:
one: 'Eine Subseite'
other: '{count} Subsites'
PageTypeBlacklistField: 'Seitentypen verbieten?'
SINGULARNAME: Subseite
SiteConfigSubtitle: 'Ihr Websiteslogan'
SiteConfigTitle: 'Name Ihrer Website'
ThemeFieldEmptyString: '-'
ValidateTitle: 'Bitte geben Sie einen Titel an'
belongs_many_many_Groups: Gruppe
db_DefaultSite: 'Standard Seite'
db_Language: Sprache
db_RedirectURL: Weierleitungs-URL
db_Theme: Theme
db_Title: Titel
has_many_Domains: Domains
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Domäne
DOMAIN_DESCRIPTION: 'Hostname dieser Subsite (ohne Protokol). Joker (*) ist erlaubt.'
IS_PRIMARY: 'Ist Hauptdomäne?'
PLURALNAME: 'Domänen der Subseite'
PLURALS:
one: 'Eine Domäne der Subseite'
other: '{count} Domainen der Subseite'
PROTOCOL_AUTOMATIC: Automatisch
PROTOCOL_DESCRIPTION: 'DIes ist die Standarddomäne für diese Subseite'
PROTOCOL_HTTP: 'http://'
PROTOCOL_HTTPS: 'https://'
Protocol: Protokoll
SINGULARNAME: 'Domäne der Subseite'
db_Domain: Domäne
db_Protocol: Protokoll
has_one_Subsite: Subseite
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Zeigt den Inhalt einer anderen Seite von einer anderen Subseite an'
OverrideNote: 'Überschreibt den geerbten Wert der Quelle'
PLURALNAME: 'Subsites Virtuelle Seiten'
PLURALS:
one: 'Eine Subsites Virtuelle Seite'
other: '{count} Subsites Virtuelle Seiten'
SINGULARNAME: 'Subsites Virtuelle Seite'
SubsiteField: Subseite
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Seiten
ReportDropdownSubsite: Subseite
Subsite:
COPYSTRUCTURE: 'Struktur kopieren von:'
NOTEMPLATE: 'Kein Template'
@ -92,9 +9,9 @@ de:
DomainFieldLabel: Domäne
IsPublicFieldLabel: 'Öffentlich zugänglich'
LanguageFieldLabel: Sprache
MainSiteTitle: Hauptsite
MainSiteTitle: 'Hauptsite'
PageTypeBlacklistFieldLabel: 'Ausgeschlossene Seitentypen'
PrimaryDomainFieldLabel: 'Primäre Domain'
RedirectURLFieldLabel: Weierleitungs-URL
RedirectURLFieldLabel: 'Weierleitungs-URL'
ThemeFieldLabel: Theme
TitleFieldLabel: 'Name der Subsite'

View File

@ -7,8 +7,6 @@ en:
MENUTITLE: Subsites
SilverStripe\Subsites\Controller\SubsiteXHRController:
MENUTITLE: SilverStripe\Subsites\Controller\SubsiteXHRController
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Subsite
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'All sites'
SUBSITENOTICE: 'Folders and files created in the main site are accessible by all subsites.'
@ -21,20 +19,14 @@ en:
MANAGE_SUBSITES: 'Manage subsites for groups'
MANAGE_SUBSITES_HELP: 'Ability to limit the permissions for a group to one or more subsites.'
SECURITYTABTITLE: Subsites
db_AccessAllSubsites: 'Access all subsites'
many_many_Subsites: Subsites
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
SITECONTENTLEFT: 'Site Content'
Saved: 'Saved, please update related pages.'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Subsite
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Copy
CopyToSubsite: 'Copy page to subsite'
CopyToSubsiteWithChildren: 'Include children pages?'
SubsiteOperations: 'Subsite Operations'
has_one_Subsite: Subsite
many_many_CrossSubsiteLinkTracking: 'Cross subsite link tracking'
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Configuration
CopyMessage: 'Created a copy of {title}'
@ -52,34 +44,20 @@ en:
SiteConfigTitle: 'Your Site Name'
ThemeFieldEmptyString: '-'
ValidateTitle: 'Please add a "Title"'
belongs_many_many_Groups: Groups
db_DefaultSite: 'Default site'
db_IsPublic: 'Is public'
db_Language: Language
db_PageTypeBlacklist: 'Page type blacklist'
db_RedirectURL: 'Redirect URL'
db_Theme: Theme
db_Title: Title
has_many_Domains: Domains
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Domain
DOMAIN_DESCRIPTION: 'Hostname of this subsite (exclude protocol). Allows wildcards (*).'
ISPRIMARY_DESCRIPTION: 'Mark this as the default domain for this subsite'
IS_PRIMARY: 'Is Primary Domain?'
PLURALNAME: 'Subsite Domains'
PLURALS:
one: 'A Subsite Domain'
other: '{count} Subsite Domains'
PROTOCOL_AUTOMATIC: Automatic
PROTOCOL_DESCRIPTION: 'When generating links to this subsite, use the selected protocol. <br />Selecting ''Automatic'' means subsite links will default to the current protocol.'
PROTOCOL_DESCRIPTION: 'Mark this as the default domain for this subsite'
PROTOCOL_HTTP: 'http://'
PROTOCOL_HTTPS: 'https://'
Protocol: Protocol
SINGULARNAME: 'Subsite Domain'
db_Domain: Domain
db_IsPrimary: 'Is primary'
db_Protocol: Protocol
has_one_Subsite: Subsite
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Displays the content of a page on another subsite'
OverrideNote: 'Overrides inherited value from the source'
@ -89,14 +67,8 @@ en:
other: '{count} Subsites Virtual Pages'
SINGULARNAME: 'Subsites Virtual Page'
SubsiteField: Subsite
db_CustomExtraMeta: 'Custom extra meta'
db_CustomMetaDescription: 'Custom meta description'
db_CustomMetaKeywords: 'Custom meta keywords'
db_CustomMetaTitle: 'Custom meta title'
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Sites
ReportDropdownAll: All
ReportDropdownSubsite: Subsite
Subsite:
COPYSTRUCTURE: 'Copy structure from:'
NOTEMPLATE: 'No template'

View File

@ -7,8 +7,6 @@ eo:
MENUTITLE: Subretejoj
SilverStripe\Subsites\Controller\SubsiteXHRController:
MENUTITLE: SilverStripe\Subretejoj\Reganto\SubretejaXHRReganto
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Subretejo
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Ĉiuj retejoj'
SUBSITENOTICE: 'Dosierujoj kaj dosieroj kreitaj en la ĉefa retejo estas alireblaj de ĉiuj retejoj'
@ -21,20 +19,14 @@ eo:
MANAGE_SUBSITES: 'Administri subretejojn por grupoj'
MANAGE_SUBSITES_HELP: 'Eblo limigi la permesojn por grupo al unu aŭ pluaj subretejoj.'
SECURITYTABTITLE: Subretejoj
db_AccessAllSubsites: 'Aliri ĉiujn subretejojn'
many_many_Subsites: Subretejoj
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
SITECONTENTLEFT: 'Enhavo de retejo'
Saved: 'Konservita, bonvole ĝisdatigi rilatajn paĝojn.'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Subretejo
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Kopio
CopyToSubsite: 'Kopii paĝon al subretejo'
CopyToSubsiteWithChildren: 'Ĉu inkluzivi paĝidojn?'
SubsiteOperations: 'Subretejaj operacioj'
has_one_Subsite: Subretejo
many_many_CrossSubsiteLinkTracking: 'Trans-subreteja ligspurado'
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Agordaro
CopyMessage: 'Kreis kopion de {title}'
@ -52,34 +44,20 @@ eo:
SiteConfigTitle: 'Nomo de via retejo'
ThemeFieldEmptyString: '-'
ValidateTitle: 'Bonvole aldoni "Titolon"'
belongs_many_many_Groups: Grupoj
db_DefaultSite: 'Apriora retejo'
db_IsPublic: 'Estas publika'
db_Language: Lingvo
db_PageTypeBlacklist: 'Paĝtipa nigra listo'
db_RedirectURL: 'Redirekti je URL'
db_Theme: Etoso
db_Title: Titolo
has_many_Domains: Domajnoj
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Domajno
DOMAIN_DESCRIPTION: 'Gastiga nomo de ĉi tiu subretejo (ellasu protokolon). Permesas ĵokerojn (*).'
ISPRIMARY_DESCRIPTION: 'Marki ĉi tion kiel la aprioran domajnon por ĉi tiu subretejo'
IS_PRIMARY: 'Ĉu unuaranga domajno?'
PLURALNAME: 'Subretejaj domajnoj'
PLURALS:
one: 'Unu subreteja domajno'
other: '{count} subretejaj domajnoj'
PROTOCOL_AUTOMATIC: Aŭtomata
PROTOCOL_DESCRIPTION: 'Kiam generante ligilojn al ĉi tiu subretejo, uzu la elektitan protokolon.'
PROTOCOL_DESCRIPTION: 'Marki ĉi tion kiel la aprioran domajnon por ĉi tiu subretejo'
PROTOCOL_HTTP: 'http://'
PROTOCOL_HTTPS: 'https://'
Protocol: Protokolo
SINGULARNAME: 'Subreteja domajno'
db_Domain: Domajno
db_IsPrimary: 'Estas unuaranga'
db_Protocol: Protokolo
has_one_Subsite: Subretejo
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Vidigas la enhavon de paĝo en alia subretejo'
OverrideNote: 'Anstataŭigas hereditan valoron el la fonto'
@ -89,14 +67,8 @@ eo:
other: '{count} virtualaj paĝoj de subretejoj'
SINGULARNAME: 'Virtuala paĝo de subretejoj'
SubsiteField: Subretejo
db_CustomExtraMeta: 'Propra kroma meta'
db_CustomMetaDescription: 'Propra metapriskribo'
db_CustomMetaKeywords: 'Propraj meta-ŝlosilvortoj '
db_CustomMetaTitle: 'Propraj meta-titolo'
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Retejoj
ReportDropdownAll: Ĉiuj
ReportDropdownSubsite: Subretejo
Subsite:
COPYSTRUCTURE: 'Kopii strukturon de:'
NOTEMPLATE: 'Mankas ŝablono'

View File

@ -1,13 +0,0 @@
es:
SilverStripe\Subsites\Model\Subsite:
CustomExtraMeta: 'Meta Tags Personalizadas'
CustomMetaDescription: Descripción
CustomMetaTitle: Título
SiteConfigTitle: 'Nombre de tu Sitio'
belongs_many_many_Groups: Grupos
db_Language: Lenguaje
db_Theme: Tema
db_Title: Título
Subsites:
LanguageFieldLabel: Lenguaje
ThemeFieldLabel: Tema

View File

@ -1,13 +0,0 @@
et_EE:
SilverStripe\Subsites\Model\Subsite:
CustomExtraMeta: 'Kohandatud metamärgendid'
CustomMetaDescription: Kirjeldus
CustomMetaTitle: Pealkiri
SiteConfigTitle: 'Teie saidi nimi'
belongs_many_many_Groups: Grupid
db_Language: Keel
db_Theme: Kujundus
db_Title: Pealkiri
Subsites:
LanguageFieldLabel: Keel
ThemeFieldLabel: Kujundus

View File

@ -1,53 +1,6 @@
fa_IR:
DomainNameField:
INVALID_DOMAIN: 'نام دامنه نامعتبر'
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'برای ویرایش محتوا اینجا را کلیک کنید'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: 'زیر سایت ها'
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: 'زیر سایت'
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'تمامی سایت ها'
SubsiteFieldLabel: 'زیر سایت'
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'تمامی زیر سایت ها'
ACCESSONLY: 'فقط این زیر سایت ها'
SECURITYTABTITLE: 'زیر سایت ها'
many_many_Subsites: 'زیر سایت ها'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: 'زیر سایت'
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
has_one_Subsite: 'زیر سایت'
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: پیکربندی
CustomExtraMeta: 'متا تگ‌های اختصاصی'
CustomMetaDescription: توضحیات
CustomMetaKeywords: 'کلید واژه ها'
CustomMetaTitle: عنوان
PLURALNAME: 'زیر سایت ها'
SINGULARNAME: 'زیر سایت'
SiteConfigTitle: 'نام سایت شما'
belongs_many_many_Groups: گروه‌ها
db_DefaultSite: 'سایت پیش فرض'
db_Language: زبان
db_Theme: پوسته
db_Title: عنوان
has_many_Domains: 'دامنه ها'
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: دامنه
PLURALNAME: 'دامنه های زیر سایت'
PROTOCOL_AUTOMATIC: 'به صورت خودکار'
Protocol: پروتکل
SINGULARNAME: 'دمنه زیرسایت'
db_Domain: دامنه
db_Protocol: پروتکل
has_one_Subsite: 'زیر سایت'
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
SubsiteField: 'زیر سایت'
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: 'سایت ها'
ReportDropdownSubsite: 'زیر سایت'
Subsite:
NOTEMPLATE: 'بدون قالب'
Subsites:

View File

@ -1,92 +1,17 @@
fi:
DomainNameField:
INVALID_DOMAIN: 'Virheellinen domain-nimi'
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'Napsauta tässä muokataksesi sisältöä'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Alasivustot
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Alasivusto
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Kaikki sivustot'
SUBSITENOTICE: 'Kansiot ja tiedostot, jotka on luotu pääsivustolla, ovat käytettävissä kaikissa alisivustoissa.'
SubsiteFieldLabel: Alasivusto
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'Kaikki alasivustot'
ACCESSONLY: 'Vain nämä alasivustot'
ACCESSRADIOTITLE: 'Anna ryhmän oikeudet »'
GlobalGroup: Globaaliryhmä
MANAGE_SUBSITES: 'Hallinnoi ryhmien alasivustoja'
MANAGE_SUBSITES_HELP: 'Mahdollisuus rajoittaa ryhmän oikeuksia yhdelle tai useammalle alisivustolle.'
SECURITYTABTITLE: Alasivustot
many_many_Subsites: Alasivut
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
SITECONTENTLEFT: 'Sivuston sisältö'
Saved: 'Tallennettu, ole hyvä ja päivitä liittyvät sivut.'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Alasivusto
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Kopioi
CopyToSubsite: 'Kopioi sivu alasivustolle'
CopyToSubsiteWithChildren: 'Sisällytä alasivut?'
SubsiteOperations: 'Alasivuston toiminnot'
has_one_Subsite: Alasivusto
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Asetukset
CopyMessage: 'Luotiin kopio lähteestä {title}'
CustomExtraMeta: 'Omat meta-tagit'
CustomMetaDescription: Kuvaus
CustomMetaKeywords: Avainsanat
CustomMetaTitle: Otsikko
PLURALNAME: Alasivut
PLURALS:
one: Alasivu
other: '{count} alasivua'
PageTypeBlacklistField: 'Kiellä sivutyyppien käyttö?'
SINGULARNAME: Alasivusto
SiteConfigSubtitle: 'Tähän sloganisi'
SiteConfigTitle: 'Sivuston nimi'
ValidateTitle: 'Lisää "Otsikko"'
belongs_many_many_Groups: Ryhmät
db_DefaultSite: Oletussivusto
db_Language: Kieli
db_RedirectURL: 'Edelleenohjaus URL'
db_Theme: Teema
db_Title: Otsikko
has_many_Domains: Domainit
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Verkkotunnus
DOMAIN_DESCRIPTION: 'Tämä alisivuston isäntänimi (ilman protokollaa). Sallii wildcard-merkit (*).'
ISPRIMARY_DESCRIPTION: 'Merkitse tämä oletusdomainiksi tälle alisivustolle'
IS_PRIMARY: 'On päädomain?'
PLURALNAME: 'Alisivuston domain-osoitteet'
PROTOCOL_AUTOMATIC: Automaattinen
PROTOCOL_HTTP: 'http://'
PROTOCOL_HTTPS: 'https://'
Protocol: Protokolla
SINGULARNAME: 'Alisivuston domain-osoite'
db_Domain: Verkkotunnus
db_Protocol: Protokolla
has_one_Subsite: Alasivusto
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Näyttää sisällön toisen alisivuston sivulta'
PLURALNAME: 'Alisivustojen virtuaaliset sivut'
SINGULARNAME: 'Alisivuston Virtuaalisivu'
SubsiteField: Alasivusto
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Sivustot
ReportDropdownSubsite: Alasivusto
Subsite:
COPYSTRUCTURE: 'Kopioi rakenne kohteesta:'
NOTEMPLATE: 'Ei sivupohjaa'
Subsites:
DefaultSiteFieldLabel: Oletussivusto
DefaultSiteFieldLabel: 'Oletussivusto'
DomainFieldLabel: Domain
IsPublicFieldLabel: 'Aktivoi julkinen pääsy'
LanguageFieldLabel: Kieli
MainSiteTitle: Pääsivusto
MainSiteTitle: 'Pääsivusto'
PageTypeBlacklistFieldLabel: 'Sivutyyppien mustalista'
PrimaryDomainFieldLabel: Oletusdomain
PrimaryDomainFieldLabel: 'Oletusdomain'
RedirectURLFieldLabel: 'Edelleenohjaus URL'
ThemeFieldLabel: Teema
TitleFieldLabel: 'Alisivuston nimi'

View File

@ -1,14 +0,0 @@
fr:
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Configuration
CustomExtraMeta: 'Balises Méta personnalisées'
CustomMetaDescription: Description
CustomMetaTitle: Titre
SiteConfigTitle: 'Nom du site'
belongs_many_many_Groups: Groupes
db_Language: Langue
db_Theme: Thème
db_Title: Titre
Subsites:
LanguageFieldLabel: Langue
ThemeFieldLabel: Thème

View File

@ -1,76 +1,6 @@
hr:
DomainNameField:
INVALID_DOMAIN: 'Netočan naziv domene'
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'Klikni ovdje za uređivanje sadržaja'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Podsajtovi
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Podsajt
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Svi sajtovi'
SUBSITENOTICE: 'Direktoriji i datoteke kreirane u glavnom sajtu su dostupne svim podsajtovima.'
SubsiteFieldLabel: Podsajt
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'Svi podsajtovi'
ACCESSONLY: 'Samo ovi podsajtovi'
ACCESSRADIOTITLE: 'Dodijeli ovoj grupi pristup za'
GlobalGroup: 'globalna grupa'
MANAGE_SUBSITES: 'Upravljaj podsajtove za grupe'
MANAGE_SUBSITES_HELP: 'Mogućnost limitiranja prava za grupu za jedan ili više podsajtova.'
SECURITYTABTITLE: Podsajtovi
many_many_Subsites: Podsajtovi
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
Saved: 'Spremljeno, molimo osvježite povezane stranice.'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Podsajt
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Kopiraj
CopyToSubsite: 'Kopiraj stranicu u podsajt'
CopyToSubsiteWithChildren: 'Uključi podstranice?'
SubsiteOperations: 'Operacije podređenog prostora'
has_one_Subsite: Podsajt
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Konfiguracija
CopyMessage: 'Kreirana kopija od {title}'
CustomExtraMeta: 'Prilagođeni Meta tagovi'
CustomMetaDescription: Opis
CustomMetaKeywords: 'Ključne riječi'
CustomMetaTitle: Naslov
PLURALNAME: Podsajtovi
PageTypeBlacklistField: 'Ne dopuštaj tipove stranica?'
SINGULARNAME: Podsajt
SiteConfigSubtitle: 'vaš slogan ovdje'
SiteConfigTitle: 'Naziv vašeg weba'
ValidateTitle: 'Molimo dodajte "Naslov"'
belongs_many_many_Groups: Grupe
db_DefaultSite: 'Zadani sajt'
db_Language: Jezik
db_RedirectURL: 'Link preusmjeravanja'
db_Theme: Tema
db_Title: Naslov
has_many_Domains: Domene
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Domena
DOMAIN_DESCRIPTION: 'Hostname ovog podsajta (bez protokola). Omogućava wildcard (*).'
ISPRIMARY_DESCRIPTION: 'Označi kao zadanu domenu za ovu podstranicu'
IS_PRIMARY: 'Da li je glavna domena?'
PLURALNAME: 'Domene podsajtova'
PROTOCOL_AUTOMATIC: Automatsko
PROTOCOL_HTTP: 'http://'
PROTOCOL_HTTPS: 'https://'
Protocol: Protokol
SINGULARNAME: 'Domena podsajta'
db_Domain: Domena
db_Protocol: Protokol
has_one_Subsite: Podsajt
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Prikazuje sadržaj stranice na drugom podsajtu'
SINGULARNAME: 'Virtualna stranica podsajta'
SubsiteField: Podsajt
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Sajtovi
ReportDropdownSubsite: Podsajt
Subsite:
COPYSTRUCTURE: 'Kopiraj strukturu od:'
NOTEMPLATE: 'Nema predloška'

View File

@ -3,38 +3,6 @@ id:
SubsiteFieldLabel: Subsitus
GroupSubsites:
SECURITYTABTITLE: Subsitus
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Subsitus
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Subsitus
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
SubsiteFieldLabel: Subsitus
SilverStripe\Subsites\Extensions\GroupSubsites:
SECURITYTABTITLE: Subsitus
many_many_Subsites: Subsitus
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Subsitus
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
has_one_Subsite: Subsitus
SilverStripe\Subsites\Model\Subsite:
CustomExtraMeta: 'Penanda Meta'
CustomMetaDescription: Deskripsi
CustomMetaKeywords: 'Kata kunci'
CustomMetaTitle: Judul
PLURALNAME: Subsitus
SINGULARNAME: Subsitus
SiteConfigTitle: 'Nama Situs'
belongs_many_many_Groups: Kelompok
db_Language: Bahasa
db_Theme: Tema
db_Title: Judul
SilverStripe\Subsites\Model\SubsiteDomain:
has_one_Subsite: Subsitus
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
SubsiteField: Subsitus
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Situs
ReportDropdownSubsite: Subsitus
Subsite:
CustomMetaDescription: Deskripsi
CustomMetaKeywords: 'Kata kunci'
@ -47,6 +15,5 @@ id:
ReportDropdown: Situs
Subsites:
LanguageFieldLabel: Bahasa
ThemeFieldLabel: Tema
SubsitesVirtualPage:
SubsiteField: Subsitus

View File

@ -1,76 +1,6 @@
it:
DomainNameField:
INVALID_DOMAIN: 'Nome a dominio non valido'
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'Clicca qui per editare il contenuto'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Sottositi
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Sottosito
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Tutti i siti'
SUBSITENOTICE: 'Le cartelle e i files creati nel sito principale sono accessibili da tutti i sottositi.'
SubsiteFieldLabel: Sottosito
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'Tutti i sottositi'
ACCESSONLY: 'Solo questi sottositi'
ACCESSRADIOTITLE: 'Dai a questo gruppo accesso a'
GlobalGroup: 'Gruppo globale'
MANAGE_SUBSITES: 'Gestisci sottositi per gruppi'
MANAGE_SUBSITES_HELP: 'Abilità di limitare i permessi per un gruppo di uno o più sottositi.'
SECURITYTABTITLE: Sottositi
many_many_Subsites: Sottositi
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
Saved: 'Salvato, si prega di aggiornare le pagine relative.'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Sottosito
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Copia
CopyToSubsite: 'Copia pagina in sottosito'
CopyToSubsiteWithChildren: 'Includi pagine figlie?'
SubsiteOperations: 'Operazioni sui sottositi'
has_one_Subsite: Sottosito
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Configurazione
CopyMessage: 'Creata una copia di {title}'
CustomExtraMeta: 'Meta Tags personalizzati'
CustomMetaDescription: Descrizione
CustomMetaKeywords: Keywords
CustomMetaTitle: Titolo
PLURALNAME: Sottositi
PageTypeBlacklistField: 'Disabilita tipi di pagina?'
SINGULARNAME: Sottosito
SiteConfigSubtitle: 'Lo slogan qui'
SiteConfigTitle: 'Nome del sito'
ValidateTitle: 'Prego aggiungere il "Titolo"'
belongs_many_many_Groups: Gruppi
db_DefaultSite: 'Sito di default'
db_Language: Lingua
db_RedirectURL: 'URL di reindirizzamento'
db_Theme: Tema
db_Title: Titolo
has_many_Domains: Domini
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Dominio
DOMAIN_DESCRIPTION: 'Nome host di questo sottosito (escluso il protocollo). Permette caratteri wildcard (*).'
ISPRIMARY_DESCRIPTION: 'Segna questo come il dominio di default per questo sottosito'
IS_PRIMARY: 'È il dominio primario?'
PLURALNAME: 'Domini del sottosito'
PROTOCOL_AUTOMATIC: Automatico
PROTOCOL_HTTP: 'http://'
PROTOCOL_HTTPS: 'https://'
Protocol: Protocollo
SINGULARNAME: 'Dominio del sottosito'
db_Domain: Dominio
db_Protocol: Protocollo
has_one_Subsite: Sottosito
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Mostra il contenuto di una pagina appartenente ad un altro sottosito'
SINGULARNAME: 'Pagina virtuale dei sottositi'
SubsiteField: Sottosito
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Siti
ReportDropdownSubsite: Sottosito
Subsite:
COPYSTRUCTURE: 'Copia struttura da:'
NOTEMPLATE: 'Nessuno schema'

View File

@ -6,55 +6,11 @@ ja:
ACCESSONLY: これらのサブサイトのみ
ACCESSRADIOTITLE: このグループに選択先へのアクセス権を与える
SECURITYTABTITLE: サブサイト
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: ここをクリックしてコンテンツを編集
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: サブサイト
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: サブサイト
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
SubsiteFieldLabel: サブサイト
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 全てのサブサイト
ACCESSONLY: これらのサブサイトのみ
ACCESSRADIOTITLE: このグループに選択先へのアクセス権を与える
SECURITYTABTITLE: サブサイト
many_many_Subsites: サブサイト
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: サブサイト
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
has_one_Subsite: サブサイト
SilverStripe\Subsites\Model\Subsite:
CustomExtraMeta: メタタグをカスタム
CustomMetaDescription: 説明文
CustomMetaTitle: タイトル
PLURALNAME: サブサイト
SINGULARNAME: サブサイト
SiteConfigTitle: サイト名
belongs_many_many_Groups: グループ
db_Language: 言語
db_Theme: テーマ
db_Title: タイトル
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: ドメイン
PLURALNAME: サブサイトのドメイン
SINGULARNAME: サブサイトのドメイン
db_Domain: ドメイン
has_one_Subsite: サブサイト
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
SINGULARNAME: サブサイトの仮想ページ
SubsiteField: サブサイト
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdownSubsite: サブサイト
SubsiteAdmin:
MENUTITLE: サブサイト
SubsiteDomain:
DOMAIN: ドメイン
PLURALNAME: サブサイトのドメイン
SINGULARNAME: サブサイトのドメイン
Subsites:
DomainFieldLabel: ドメイン
LanguageFieldLabel: 言語
ThemeFieldLabel: テーマ
SubsitesVirtualPage:
SINGULARNAME: サブサイトの仮想ページ

View File

@ -1,34 +1,4 @@
lt:
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Visos svetainės'
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
Saved: 'Išsaugota, prašome atnaujinti susijusius puslapius'
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Kopijuoti
CopyToSubsite: 'Kopijuoti puslapį į kitą svetainę'
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Nustatymai
CopyMessage: 'Sukurta {title} kopija'
CustomExtraMeta: 'Kitos meta žymės'
CustomMetaDescription: Aprašymas
CustomMetaKeywords: Raktažodžiai
CustomMetaTitle: Pavadinimas
PageTypeBlacklistField: 'Neleidžiami puslapių tipai'
SiteConfigSubtitle: 'Jūsų svetainės šūkis'
SiteConfigTitle: 'Jūsų svetainės pavadinimas'
ValidateTitle: 'Prašome įvesti "Pavadinimą"'
belongs_many_many_Groups: Grupės
db_DefaultSite: 'Pagrindinė svetainė'
db_Language: Kalba
db_RedirectURL: 'Nukreipimo nuoroda'
db_Theme: Tema
db_Title: Pavadinimas
has_many_Domains: Domenai
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Domenas
db_Domain: Domenas
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Svetainės
Subsite:
COPYSTRUCTURE: 'Kopijuoti struktūrą iš:'
NOTEMPLATE: 'Nėra šablono'

View File

@ -1,65 +1,4 @@
mi:
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'Pāwhiri ki konei hei whakatika i ngā ihirangi'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: 'Ngā pae iti'
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: 'Pae iti'
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Ngā pae katoa'
SUBSITENOTICE: 'Ka taea ngā kōpaki me ngā kōnae kua hangaia i te pae matua te uru mā ngā pae iti katoa.'
SubsiteFieldLabel: 'Pae iti'
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'Ngā pae iti katoa'
ACCESSONLY: 'Ko ēnei pae iti anake'
ACCESSRADIOTITLE: 'Tukuna tēnei rōpū kia uru ki'
GlobalGroup: 'Rōpū Hurinoa'
MANAGE_SUBSITES: 'Whakahaere pae iti mō ngā rōpū'
MANAGE_SUBSITES_HELP: 'Te āheinga ki te whakawhāiti whakaaetanga mō tētahi rōpū ki tētahi neke atu rānei o ngā pae iti.'
SECURITYTABTITLE: 'Ngā pae iti'
many_many_Subsites: 'Ngā pae iti'
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
Saved: 'Kua tiakina, whakahoutia ngā whārangi pāhono.'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: 'Pae iti'
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Tārua
CopyToSubsite: 'Tāruatia te whārangi ki te pae iti'
has_one_Subsite: 'Pae iti'
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Whirihoranga
CopyMessage: 'I hangaia he tārua o {title}'
CustomExtraMeta: 'Ngā Tūtohu Meta Ritenga'
CustomMetaDescription: Whakaahuatanga
CustomMetaKeywords: 'Ngā kupumatua'
CustomMetaTitle: Taitara
PLURALNAME: 'Ngā pae iti'
PageTypeBlacklistField: 'Me whakakāhore ngā momo whārangi?'
SINGULARNAME: 'Pae iti'
SiteConfigSubtitle: 'Tō rārangi tautuhinga ki konei'
SiteConfigTitle: 'Tō Ingoa Pae'
ValidateTitle: 'Tāurua he "Taitara"'
belongs_many_many_Groups: 'Ngā Rōpū'
db_DefaultSite: 'Pae taunoa'
db_Language: Reo
db_RedirectURL: 'Tukua anō te URL'
db_Theme: Kaupapa
db_Title: Taitara
has_many_Domains: 'Ngā Rohe'
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Rohe
PLURALNAME: 'Ngā Rohe Pae Iti'
SINGULARNAME: 'Rohe Pae Iti'
db_Domain: Rohe
has_one_Subsite: 'Pae iti'
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Ka whakaatu i ngā ihirangi o tētahi whārangi ki tētahi atu pae iti'
PLURALNAME: 'Ngā Whārangi Taketake'
SINGULARNAME: 'Whārangi Mariko Pae Iti'
SubsiteField: 'Pae iti'
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: 'Ngā Pae'
ReportDropdownSubsite: 'Pae iti'
Subsite:
COPYSTRUCTURE: 'Tāurutia te hanganga mai i:'
NOTEMPLATE: 'Kāore he tātauira'

View File

@ -6,46 +6,11 @@ nb_NO:
ACCESSONLY: 'Only these subsites'
ACCESSRADIOTITLE: 'Give this group access to'
SECURITYTABTITLE: subdomener
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'klikk her for å endre dette innholdet'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: subdomener
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Subdomene
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
SubsiteFieldLabel: Subdomene
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'All subsites'
ACCESSONLY: 'Only these subsites'
ACCESSRADIOTITLE: 'Give this group access to'
SECURITYTABTITLE: subdomener
many_many_Subsites: subdomener
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Subdomene
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
has_one_Subsite: Subdomene
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Konfigurasjon
PLURALNAME: subdomener
SINGULARNAME: Subdomene
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Domain
PLURALNAME: 'Subsite Domains'
SINGULARNAME: 'Subsite Domain'
db_Domain: Domain
has_one_Subsite: Subdomene
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
SINGULARNAME: 'Subdomeners Virtuelle Side'
SubsiteField: Subdomene
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdownSubsite: Subdomene
SubsiteAdmin:
MENUTITLE: Underdomener
SubsiteDomain:
DOMAIN: Domain
PLURALNAME: 'Subsite Domains'
SINGULARNAME: 'Subsite Domain'
Subsites:
DomainFieldLabel: Domain
SubsitesVirtualPage:
SINGULARNAME: 'Subdomeners Virtuelle Side'

View File

@ -1,103 +1,32 @@
nl:
DomainNameField:
INVALID_DOMAIN: 'Ongeldige domein naam'
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'Klik hier om inhoud aan te passen'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Subsites
SilverStripe\Subsites\Controller\SubsiteXHRController:
MENUTITLE: Subsites
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Subsite
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Alle sites'
SUBSITENOTICE: 'Mappen en bestanden van de Hoofdsite zijn toegankelijk voor alle subsites.'
FileSubsites:
SubsiteFieldLabel: Subsite
SilverStripe\Subsites\Extensions\GroupSubsites:
GridFieldAddFromTemplateButton:
AddFromTemplate: 'Nieuwe toevegen vanaf template'
GroupSubsites:
ACCESSALL: 'Alle subsites'
ACCESSONLY: 'Alleen deze subsites'
ACCESSRADIOTITLE: 'Geef deze groep rechten aan'
GlobalGroup: 'globale groep'
MANAGE_SUBSITES: 'Beheer subsites voor groepen'
MANAGE_SUBSITES_HELP: 'Bepaal de toegangsrechten voor groepen per subsite'
SECURITYTABTITLE: Subsites
db_AccessAllSubsites: 'Toegang tot alle subsites'
many_many_Subsites: Subsites
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
SITECONTENTLEFT: 'Site inhoud'
Saved: 'Opgeslagen, pas onderliggende pagina''s aan.'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Subsite
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Kopieer
CopyToSubsite: 'Kopieer pagina''s naar subsite'
CopyToSubsiteWithChildren: 'Inclusief onderliggende pagina''s?'
SubsiteOperations: 'Subsite Acties'
has_one_Subsite: Subsite
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Configuratie
CopyMessage: 'Kopie gemaakt van {title}'
CustomExtraMeta: 'Andere meta tags'
Subsite:
CustomMetaDescription: Omschrijving
CustomMetaKeywords: Sleutelwoorden
CustomMetaTitle: Titel
PLURALNAME: Subsites
PLURALS:
one: 'Een Subsite'
other: '{count} Subsites'
PageTypeBlacklistField: 'Niet toegestane paginatypes?'
SINGULARNAME: Subsite
SiteConfigSubtitle: 'Jouw slagzin hier'
SiteConfigTitle: 'Jouw Site Naam'
ThemeFieldEmptyString: '-'
ValidateTitle: 'Voeg een "Titel" toe'
belongs_many_many_Groups: Groepen
db_DefaultSite: 'Standaard Site'
db_Language: Taal
db_RedirectURL: 'Redirect URL'
db_Theme: Thema
db_Title: Titel
SilverStripe\Subsites\Model\SubsiteDomain:
TabTitleConfig: Configuratie
SubsiteAdmin:
MENUTITLE: Subsites
SubsiteDomain:
DOMAIN: Domein
DOMAIN_DESCRIPTION: 'Domeinnaam van deze subsite (zonder http), wildcards zijn toegestaan (*).'
ISPRIMARY_DESCRIPTION: 'Dit is de standaard domeinnaam voor deze subsite'
IS_PRIMARY: 'Is Primaire domein'
PLURALNAME: 'Subsite Domeinen'
PLURALS:
one: 'Een subsite domein'
other: '{count} subsite domeinen'
PROTOCOL_AUTOMATIC: Automatisch
PROTOCOL_DESCRIPTION: 'Wordt gebruikt bij het genereren van links naar deze subsite. <br />''Automatisch'' houdt in dat het huidige protocol gebruikt zal worden.'
PROTOCOL_HTTP: 'http://'
PROTOCOL_HTTPS: 'https://'
Protocol: Protocol
SINGULARNAME: 'Subsite Domein'
db_Domain: Domein
db_Protocol: Protocol
has_one_Subsite: Subsite
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Toon de inhoud van een pagina op een andere subsite'
OverrideNote: 'Overschrijft de overgenomen tekst van de gelinkte pagina'
PLURALNAME: 'Subsites Virtuele paginas'
PLURALS:
one: 'Subsites Virtuele pagina'
other: '{count} Subsites Virtuele paginas'
SINGULARNAME: 'Subsites Virtuele pagina'
SubsiteField: Subsite
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Sites
ReportDropdownSubsite: Subsite
Subsite:
COPYSTRUCTURE: 'Kopieer structuur vanaf:'
NOTEMPLATE: 'Geen template'
Subsites:
DefaultSiteFieldLabel: 'Standaard Site'
DomainFieldLabel: Domein
IsPublicFieldLabel: 'Publiek toegankelijk'
LanguageFieldLabel: Taal
MainSiteTitle: 'Hoofd site'
PageTypeBlacklistFieldLabel: 'Paginatypes blacklist'
PrimaryDomainFieldLabel: 'Primaire domein'
RedirectURLFieldLabel: 'Redirect URL'
ThemeFieldLabel: Thema
TitleFieldLabel: 'Subsite naam'
SubsitesVirtualPage:
SINGULARNAME: 'Subsites Virtuele pagina'
SubsiteField: Subsite

View File

@ -1,13 +0,0 @@
pl:
SilverStripe\Subsites\Model\Subsite:
CustomExtraMeta: 'Własne meta tagi'
CustomMetaDescription: Opis
CustomMetaTitle: Tytuł
SiteConfigTitle: 'Nazwa twojego serwisu'
belongs_many_many_Groups: Grupy
db_Language: Język
db_Theme: Szablon
db_Title: Tytuł
Subsites:
LanguageFieldLabel: Język
ThemeFieldLabel: Szablon

View File

@ -6,51 +6,11 @@ pl_PL:
ACCESSONLY: 'Tylko te podwitryny'
ACCESSRADIOTITLE: 'Daj tej grupie dostęp do'
SECURITYTABTITLE: Podwitryny
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'Kliknij tutaj aby edytować zawartość'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Podwitryny
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Podwitryna
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
SubsiteFieldLabel: Podwitryna
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'Wszystkie podwitryny'
ACCESSONLY: 'Tylko te podwitryny'
ACCESSRADIOTITLE: 'Daj tej grupie dostęp do'
SECURITYTABTITLE: Podwitryny
many_many_Subsites: Podwitryny
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Podwitryna
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
has_one_Subsite: Podwitryna
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Konfiguracja
CustomExtraMeta: 'Własne meta tagi'
CustomMetaTitle: Tytuł
PLURALNAME: Podwitryny
SINGULARNAME: Podwitryna
db_Language: Język
db_Title: Tytuł
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Domena
PLURALNAME: 'Domeny podwitryny'
SINGULARNAME: 'Domena podwitryny'
db_Domain: Domena
has_one_Subsite: Podwitryna
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
SINGULARNAME: 'Wirtualna strona dla podwitryn'
SubsiteField: Podwitryna
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdownSubsite: Podwitryna
SubsiteAdmin:
MENUTITLE: Podwitryny
SubsiteDomain:
DOMAIN: Domena
PLURALNAME: 'Domeny podwitryny'
SINGULARNAME: 'Domena podwitryny'
Subsites:
DomainFieldLabel: Domena
LanguageFieldLabel: Język
SubsitesVirtualPage:
SINGULARNAME: 'Wirtualna strona dla podwitryn'

View File

@ -1,76 +1,6 @@
ru:
DomainNameField:
INVALID_DOMAIN: 'Неверный домен'
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'Нажмите для изменения содержимого'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Подсайты
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Подсайт
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 'Все сайты'
SUBSITENOTICE: 'Папки и файлы созданные на основном сайте так же доступны для под-сайтов.'
SubsiteFieldLabel: Подсайт
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'Все подсайты'
ACCESSONLY: 'Только эти подсайты'
ACCESSRADIOTITLE: 'Разрешить этой группе доступ к'
GlobalGroup: 'глобальная группа'
MANAGE_SUBSITES: 'Управление подсайтами для групп'
MANAGE_SUBSITES_HELP: 'Возможность ограничить права доступа для группы к одному и более подсайтам'
SECURITYTABTITLE: Подсайты
many_many_Subsites: Подсайты
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
Saved: 'Сохранено, пожалуйста обновите связанные группы'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Подсайт
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: Копировать
CopyToSubsite: 'Копировать страницу на подсайт'
CopyToSubsiteWithChildren: 'Включая под-страницы?'
SubsiteOperations: 'Операции над подсайтами'
has_one_Subsite: Подсайт
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Конфигурация
CopyMessage: 'Создана копия {title}'
CustomExtraMeta: 'Пользовательские мета-тэги'
CustomMetaDescription: Описание
CustomMetaKeywords: 'Ключевые слова'
CustomMetaTitle: Заголовок
PLURALNAME: Подсайты
PageTypeBlacklistField: 'Запретить данные типы страниц?'
SINGULARNAME: Подсайт
SiteConfigSubtitle: 'ваш слоган здесь'
SiteConfigTitle: 'Название сайта'
ValidateTitle: 'Пожалуйста, добавьте "Заголовок"'
belongs_many_many_Groups: Группы
db_DefaultSite: 'Основной сайт'
db_Language: Язык
db_RedirectURL: 'Ссылка для перенаправления'
db_Theme: Оформление
db_Title: Заголовок
has_many_Domains: Домены
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Домен
DOMAIN_DESCRIPTION: 'Домен подсайта (без указания протоколов: http:// и https://). Разрешены (*) для обозначения поддоменов.'
ISPRIMARY_DESCRIPTION: 'Отметить как основной домен для данного подсайта'
IS_PRIMARY: 'Это основной домен?'
PLURALNAME: 'Домены подсайтов'
PROTOCOL_AUTOMATIC: Автоматически
PROTOCOL_HTTP: 'http://'
PROTOCOL_HTTPS: 'https://'
Protocol: Протокол
SINGULARNAME: 'Домен подсайта'
db_Domain: Домен
db_Protocol: Протокол
has_one_Subsite: Подсайт
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 'Отображает содержимое выбранной страницы на другом подсайте'
SINGULARNAME: 'Виртуальная страница подсайта'
SubsiteField: Подсайт
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: Сайты
ReportDropdownSubsite: Подсайт
Subsite:
COPYSTRUCTURE: 'Скопировать структуры из:'
NOTEMPLATE: 'Нет шаблона'

View File

@ -1,37 +0,0 @@
sk:
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Podstránky
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Podstránka
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
SubsiteFieldLabel: Podstránka
SilverStripe\Subsites\Extensions\GroupSubsites:
SECURITYTABTITLE: Podstránky
db_AccessAllSubsites: 'Prístup na všetky podstránky'
many_many_Subsites: Podstránky
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Podstránka
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
has_one_Subsite: Podstránka
many_many_CrossSubsiteLinkTracking: 'Sledovanie odkazov naprieč podstránkami'
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Konfigurácia
CustomExtraMeta: 'Vlastné Meta Tagy'
CustomMetaDescription: Popis
CustomMetaTitle: Názov
PLURALNAME: Podstránky
SINGULARNAME: Podstránka
SiteConfigTitle: 'Názov vášho webu'
belongs_many_many_Groups: Skupiny
db_Language: Jazyk
db_Theme: Téma
db_Title: Názov
SilverStripe\Subsites\Model\SubsiteDomain:
has_one_Subsite: Podstránka
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
SubsiteField: Podstránka
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdownSubsite: Podstránka
Subsites:
LanguageFieldLabel: Jazyk
ThemeFieldLabel: Téma

View File

@ -1,35 +0,0 @@
sl:
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: Podspletišča
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: Podspletišče
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
SubsiteFieldLabel: Podspletišče
SilverStripe\Subsites\Extensions\GroupSubsites:
SECURITYTABTITLE: Podspletišča
db_AccessAllSubsites: 'Dostop do vseh podspletišč'
many_many_Subsites: Podspletišča
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: Podspletišče
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
has_one_Subsite: Podspletišče
many_many_CrossSubsiteLinkTracking: 'Spremljanje povezav med podspletišči'
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Nastavitve
CustomExtraMeta: 'Meta tagi po meri'
CustomMetaDescription: Opis
CustomMetaTitle: Naziv
PLURALNAME: Podspletišča
SINGULARNAME: Podspletišče
SiteConfigTitle: 'Naziv vašega spletnega mesta'
belongs_many_many_Groups: Skupine
db_Theme: Tema
db_Title: Naziv
SilverStripe\Subsites\Model\SubsiteDomain:
has_one_Subsite: Podspletišče
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
SubsiteField: Podspletišče
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdownSubsite: Podspletišče
Subsites:
ThemeFieldLabel: Tema

View File

@ -1,13 +0,0 @@
sr_RS@latin:
SilverStripe\Subsites\Model\Subsite:
CustomExtraMeta: 'Prilagođene meta oznake'
CustomMetaDescription: Opis
CustomMetaTitle: Naslov
SiteConfigTitle: 'Naziv sajta'
belongs_many_many_Groups: Grupe
db_Language: Jezik
db_Theme: Tema
db_Title: Naslov
Subsites:
LanguageFieldLabel: Jezik
ThemeFieldLabel: Tema

View File

@ -1,14 +0,0 @@
sv:
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: Konfiguration
CustomExtraMeta: 'Egna metataggar'
CustomMetaDescription: Beskrivning
CustomMetaTitle: Titel
SiteConfigTitle: 'Din Sajts Namn'
belongs_many_many_Groups: Grupper
db_Language: Språk
db_Theme: Tema
db_Title: Titel
Subsites:
LanguageFieldLabel: Språk
ThemeFieldLabel: Tema

View File

@ -1,13 +0,0 @@
tr:
SilverStripe\Subsites\Model\Subsite:
CustomExtraMeta: 'Kişisel Meta Etiketleri'
CustomMetaDescription: ıklama
CustomMetaTitle: Başlık
SiteConfigTitle: 'Site Adınız'
belongs_many_many_Groups: Gruplar
db_Language: Dil
db_Theme: Tema
db_Title: Başlık
Subsites:
LanguageFieldLabel: Dil
ThemeFieldLabel: Tema

View File

@ -6,45 +6,11 @@ tr_TR:
ACCESSONLY: 'Only these subsites'
ACCESSRADIOTITLE: 'Give this group access to'
SECURITYTABTITLE: 'Alt Siteler'
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 'İçeriği düzenlemek için tıklayınız'
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: 'Alt Siteler'
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: 'Alt Site'
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
SubsiteFieldLabel: 'Alt Site'
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 'All subsites'
ACCESSONLY: 'Only these subsites'
ACCESSRADIOTITLE: 'Give this group access to'
SECURITYTABTITLE: 'Alt Siteler'
many_many_Subsites: 'Alt Siteler'
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: 'Alt Site'
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
has_one_Subsite: 'Alt Site'
SilverStripe\Subsites\Model\Subsite:
PLURALNAME: 'Alt Siteler'
SINGULARNAME: 'Alt Site'
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: Domain
PLURALNAME: 'Subsite Domains'
SINGULARNAME: 'Subsite Domain'
db_Domain: Domain
has_one_Subsite: 'Alt Site'
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
SINGULARNAME: 'Alt Site Sanal Sayfa'
SubsiteField: 'Alt Site'
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdownSubsite: 'Alt Site'
SubsiteAdmin:
MENUTITLE: 'Alt Siteler'
SubsiteDomain:
DOMAIN: Domain
PLURALNAME: 'Subsite Domains'
SINGULARNAME: 'Subsite Domain'
Subsites:
DomainFieldLabel: Domain
SubsitesVirtualPage:
SINGULARNAME: 'Alt Site Sanal Sayfa'

View File

@ -1,76 +1,15 @@
zh:
SilverStripe\CMS\Model\VirtualPage:
EDITCONTENT: 点击这里来编辑内容
SilverStripe\Subsites\Admin\SubsiteAdmin:
MENUTITLE: 多个子网站
SilverStripe\Subsites\Extensions\FileSubsites:
has_one_Subsite: 子网站
SilverStripe\Subsites\Extensions\FolderFormFactoryExtension:
AllSitesDropdownOpt: 所有网站
SUBSITENOTICE: 主网站上创建的文件夹和文件可以被所有子网站访问。
SubsiteFieldLabel: 子网站
SilverStripe\Subsites\Extensions\GroupSubsites:
ACCESSALL: 所有子网站
ACCESSONLY: 仅这些子网站
ACCESSRADIOTITLE: 准许该群进入
GlobalGroup: 全局小组
MANAGE_SUBSITES: 管理小组的子网站
MANAGE_SUBSITES_HELP: 能够将权限限制在一个小组、一个或多个子网站。
SECURITYTABTITLE: 多个子网站
many_many_Subsites: 多个子网站
SilverStripe\Subsites\Extensions\LeftAndMainSubsites:
Saved: 已保存,请更新相关的页面。
SilverStripe\Subsites\Extensions\SiteConfigSubsites:
has_one_Subsite: 子网站
SilverStripe\Subsites\Extensions\SiteTreeSubsites:
CopyAction: 复制
CopyToSubsite: 将页面复制到子网站
has_one_Subsite: 子网站
SilverStripe\Subsites\Model\Subsite:
ConfigurationTab: 配置
CopyMessage: '已创建一个 {title} 的副本'
CustomExtraMeta: 自定义Meta标签
CustomMetaDescription: 描述
CustomMetaKeywords: 关键词
CustomMetaTitle: 题目
PLURALNAME: 多个子网站
PageTypeBlacklistField: 禁止页面类型?
SINGULARNAME: 子网站
SiteConfigSubtitle: 您的标语在这里
SiteConfigTitle: 您的网站名称
ValidateTitle: 请添加一个“标题”
belongs_many_many_Groups: 群组
db_DefaultSite: 默认网站
db_Language: 语言
db_RedirectURL: '重定向 URL'
db_Theme: 主题
db_Title: 题目
has_many_Domains: 域名
SilverStripe\Subsites\Model\SubsiteDomain:
DOMAIN: 域名
PLURALNAME: 多个子网站域名
SINGULARNAME: 子网站域名
db_Domain: 域名
has_one_Subsite: 子网站
SilverStripe\Subsites\Pages\SubsitesVirtualPage:
DESCRIPTION: 显示另一个子网站上一个页面的内容
PLURALNAME: 基本页面
SINGULARNAME: 子网站虚拟页面
SubsiteField: 子网站
SilverStripe\Subsites\Reports\SubsiteReportWrapper:
ReportDropdown: 网站
ReportDropdownSubsite: 子网站
Subsite:
COPYSTRUCTURE: 复制结构来自:
NOTEMPLATE: 没有模板
COPYSTRUCTURE: '复制结构来自:'
NOTEMPLATE: '没有模板'
Subsites:
DefaultSiteFieldLabel: 默认网站
DefaultSiteFieldLabel: '默认网站'
DomainFieldLabel: 域名
IsPublicFieldLabel: 启用公共访问权
IsPublicFieldLabel: '启用公共访问权'
LanguageFieldLabel: 语言
MainSiteTitle: 主网站
PageTypeBlacklistFieldLabel: 页面类型黑名单
PrimaryDomainFieldLabel: 主域名
MainSiteTitle: '主网站'
PageTypeBlacklistFieldLabel: '页面类型黑名单'
PrimaryDomainFieldLabel: '主域名'
RedirectURLFieldLabel: '重定向 URL'
ThemeFieldLabel: 主题
TitleFieldLabel: 子网站名称
TitleFieldLabel: '子网站名称'

View File

@ -2,9 +2,6 @@
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
<file>src</file>
<file>tests</file>
<!-- base rules are PSR-2 -->
<rule ref="PSR2" >
<!-- Current exclusions -->

View File

@ -1,10 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
<testsuites>
<testsuite name="Default">
<directory>tests/php</directory>
</testsuite>
</testsuites>
<testsuite name="Default">
<directory>tests/php</directory>
</testsuite>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">

View File

@ -1,33 +0,0 @@
<?php
namespace SilverStripe\Subsites\Extensions;
use SilverStripe\Control\HTTP;
use SilverStripe\ORM\DataExtension;
/**
* Extension for the BaseElement object to add subsites support for CMS previews
*/
class BaseElementSubsites extends DataExtension
{
/**
* Set SubsiteID to avoid errors when a page doesn't exist on the CMS domain.
*
* @param string &$link
* @param string|null $action
* @return string
*/
public function updatePreviewLink(&$link)
{
// Get subsite ID from the element or from its page. Defaults to 0 automatically.
$subsiteID = $this->owner->SubsiteID;
if (is_null($subsiteID)) {
$page = $this->owner->getPage();
if ($page) {
$subsiteID = $page->SubsiteID;
}
}
$link = HTTP::setGetVar('SubsiteID', intval($subsiteID), $link);
}
}

View File

@ -52,9 +52,6 @@ class FileSubsites extends DataExtension
if (Subsite::$disable_subsite_filter) {
return;
}
if ($dataQuery && $dataQuery->getQueryParam('Subsite.filter') === false) {
return;
}
// If you're querying by ID, ignore the sub-site - this is a bit ugly... (but it was WAYYYYYYYYY worse)
// @TODO I don't think excluding if SiteTree_ImageTracking is a good idea however because of the SS 3.0 api and
@ -77,8 +74,8 @@ class FileSubsites extends DataExtension
break;
}
$sect = array_values($query->getSelect() ?? []);
$isCounting = strpos($sect[0] ?? '', 'COUNT') !== false;
$sect = array_values($query->getSelect());
$isCounting = strpos($sect[0], 'COUNT') !== false;
// Ordering when deleting or counting doesn't apply
if (!$isCounting) {
@ -116,9 +113,9 @@ class FileSubsites extends DataExtension
}
// Check the CMS_ACCESS_SecurityAdmin privileges on the subsite that owns this group
$currentSubsiteID = SubsiteState::singleton()->getSubsiteId();
if ($currentSubsiteID && $currentSubsiteID !== $this->owner->SubsiteID) {
return false;
$subsiteID = SubsiteState::singleton()->getSubsiteId();
if ($subsiteID && $subsiteID == $this->owner->SubsiteID) {
return true;
}
return SubsiteState::singleton()->withState(function (SubsiteState $newState) use ($member) {

View File

@ -35,7 +35,7 @@ class FolderFormFactoryExtension extends Extension
$fields->push($dropdown);
$fields->push(LiteralField::create(
'Message',
'<p class="alert alert-info">' .
'<p class="message notice">' .
_t(
__CLASS__ . '.SUBSITENOTICE',
'Folders and files created in the main site are accessible by all subsites.'

View File

@ -47,7 +47,7 @@ class GroupSubsites extends DataExtension implements PermissionProvider
}
// Migration for Group.SubsiteID data from when Groups only had a single subsite
$schema = DataObject::getSchema();
$groupTable = Convert::raw2sql($schema->tableName(Group::class));
$groupTable = $schema->tableName(Group::class);
$groupFields = DB::field_list($groupTable);
// Detection of SubsiteID field is the trigger for old-style-subsiteID migration
@ -106,7 +106,7 @@ class GroupSubsites extends DataExtension implements PermissionProvider
$subsiteMap
));
} else {
if (sizeof($subsiteMap ?? []) <= 1) {
if (sizeof($subsiteMap) <= 1) {
$fields->addFieldToTab('Root.Subsites', new ReadonlyField(
'SubsitesHuman',
_t(__CLASS__ . '.ACCESSRADIOTITLE', 'Give this group access to'),
@ -133,10 +133,10 @@ class GroupSubsites extends DataExtension implements PermissionProvider
{
if ($this->owner->AccessAllSubsites) {
$title = _t(__CLASS__ . '.GlobalGroup', 'global group');
$title = htmlspecialchars($this->owner->Title ?? '', ENT_QUOTES) . ' <i>(' . $title . ')</i>';
$title = htmlspecialchars($this->owner->Title, ENT_QUOTES) . ' <i>(' . $title . ')</i>';
} else {
$subsites = Convert::raw2xml(implode(', ', $this->owner->Subsites()->column('Title')));
$title = htmlspecialchars($this->owner->Title ?? '') . " <i>($subsites)</i>";
$title = htmlspecialchars($this->owner->Title) . " <i>($subsites)</i>";
}
}
@ -153,9 +153,6 @@ class GroupSubsites extends DataExtension implements PermissionProvider
if (Cookie::get('noSubsiteFilter') == 'true') {
return;
}
if ($dataQuery && $dataQuery->getQueryParam('Subsite.filter') === false) {
return;
}
// If you're querying by ID, ignore the sub-site - this is a bit ugly...
if (!$query->filtersOnID()) {
@ -168,10 +165,10 @@ class GroupSubsites extends DataExtension implements PermissionProvider
$hasGroupSubsites = false;
foreach ($query->getFrom() as $item) {
if ((is_array($item) && strpos(
$item['table'] ?? '',
$item['table'],
'Group_Subsites'
) !== false) || (!is_array($item) && strpos(
$item ?? '',
$item,
'Group_Subsites'
) !== false)
) {
@ -227,7 +224,7 @@ class GroupSubsites extends DataExtension implements PermissionProvider
// We are allowed to access this site if at we have CMS_ACCESS_SecurityAdmin permission on
// at least one of the sites
return (bool)array_intersect($accessibleSites ?? [], $linkedSites);
return (bool)array_intersect($accessibleSites, $linkedSites);
}
public function providePermissions()

View File

@ -1,22 +0,0 @@
<?php
namespace SilverStripe\Subsites\Extensions;
use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\Core\Extension;
use SilverStripe\Subsites\State\SubsiteState;
/**
* This extension adds the current Subsite ID as an additional factor to the Hints Cßache Key, which is used to cache
* the Site Tree Hints (which include allowed pagetypes).
*
* @package SilverStripe\Subsites\Extensions
* @see CMSMain::generateHintsCacheKey()
*/
class HintsCacheKeyExtension extends Extension
{
public function updateHintsCacheKey(&$baseKey)
{
$baseKey .= '_Subsite:' . SubsiteState::singleton()->getSubsiteId();
}
}

View File

@ -41,9 +41,9 @@ class LeftAndMainSubsites extends LeftAndMainExtension
public function init()
{
Requirements::css('silverstripe/subsites:client/css/LeftAndMain_Subsites.css');
Requirements::javascript('silverstripe/subsites:client/javascript/LeftAndMain_Subsites.js');
Requirements::javascript('silverstripe/subsites:client/javascript/VirtualPage_Subsites.js');
Requirements::css('silverstripe/subsites:css/LeftAndMain_Subsites.css');
Requirements::javascript('silverstripe/subsites:javascript/LeftAndMain_Subsites.js');
Requirements::javascript('silverstripe/subsites:javascript/VirtualPage_Subsites.js');
}
/**
@ -118,7 +118,7 @@ class LeftAndMainSubsites extends LeftAndMainExtension
// Find sites that satisfy all codes conjuncitvely.
$accessibleSites = new ArrayList();
foreach ($codesPerSite as $siteID => $siteCodes) {
if (count($siteCodes ?? []) == count($codes ?? [])) {
if (count($siteCodes) == count($codes)) {
$accessibleSites->push($sitesArray[$siteID]);
}
}
@ -150,7 +150,7 @@ class LeftAndMainSubsites extends LeftAndMainExtension
return false;
}
Requirements::javascript('silverstripe/subsites:client/javascript/LeftAndMain_Subsites.js');
Requirements::javascript('silverstripe/subsites:javascript/LeftAndMain_Subsites.js');
$output = ArrayList::create();
@ -160,7 +160,7 @@ class LeftAndMainSubsites extends LeftAndMainExtension
$output->push(ArrayData::create([
'CurrentState' => $currentState,
'ID' => $subsite->ID,
'Title' => $subsite->Title,
'Title' => Convert::raw2xml($subsite->Title)
]));
}
@ -169,7 +169,7 @@ class LeftAndMainSubsites extends LeftAndMainExtension
public function alternateMenuDisplayCheck($controllerName)
{
if (!class_exists($controllerName ?? '')) {
if (!class_exists($controllerName)) {
return false;
}
@ -215,22 +215,15 @@ class LeftAndMainSubsites extends LeftAndMainExtension
/**
* Check if the current controller is accessible for this user on this subsite.
*
* @param Member $member
*/
public function canAccess(Member $member = null)
public function canAccess()
{
if (!$member) {
$member = Security::getCurrentUser();
}
// Admin can access everything, no point in checking.
$member = Security::getCurrentUser();
if ($member
&& (Permission::checkMember($member, [
'ADMIN', // Full administrative rights
'CMS_ACCESS_LeftAndMain', // Access to all CMS sections
'CMS_ACCESS_CMSMain', // Access to CMS controllers
]))
&& (Permission::checkMember($member, 'ADMIN') // 'Full administrative rights'
|| Permission::checkMember($member, 'CMS_ACCESS_LeftAndMain') // 'Access to all CMS sections'
)
) {
return true;
}
@ -243,12 +236,10 @@ class LeftAndMainSubsites extends LeftAndMainExtension
/**
* Prevent accessing disallowed resources. This happens after onBeforeInit has executed,
* so all redirections should've already taken place.
*
* @param Member $member
*/
public function alternateAccessCheck(Member $member = null)
public function alternateAccessCheck()
{
return $this->owner->canAccess($member);
return $this->owner->canAccess();
}
/**
@ -369,7 +360,7 @@ class LeftAndMainSubsites extends LeftAndMainExtension
}
// We have not found any accessible section or subsite. User should be denied access.
// This is handled already by LeftAndMain thanks to alternateAccessCheck
return Security::permissionFailure($this->owner);
}
// Current site is accessible. Allow through.
@ -387,7 +378,7 @@ class LeftAndMainSubsites extends LeftAndMainExtension
if ($record->hasMethod('NormalRelated') && ($record->NormalRelated() || $record->ReverseRelated())) {
$this->owner->response->addHeader(
'X-Status',
rawurlencode(_t(__CLASS__ . '.Saved', 'Saved, please update related pages.') ?? '')
rawurlencode(_t(__CLASS__ . '.Saved', 'Saved, please update related pages.'))
);
}
}

View File

@ -37,7 +37,7 @@ class SiteConfigSubsites extends DataExtension
}
$regexp = '/^(.*\.)?("|`)?SubsiteID("|`)?\s?=/';
foreach ($query->getWhereParameterised($parameters) as $predicate) {
if (preg_match($regexp ?? '', $predicate ?? '')) {
if (preg_match($regexp, $predicate)) {
return;
}
}
@ -48,7 +48,7 @@ class SiteConfigSubsites extends DataExtension
}
$froms = $query->getFrom();
$froms = array_keys($froms ?? []);
$froms = array_keys($froms);
$tableName = array_shift($froms);
if ($tableName !== SiteConfig::getSchema()->tableName(SiteConfig::class)) {
return;

View File

@ -2,9 +2,7 @@
namespace SilverStripe\Subsites\Extensions;
use SilverStripe\Dev\Deprecation;
use Page;
use SilverStripe\CMS\Forms\SiteTreeURLSegmentField;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Director;
@ -27,10 +25,8 @@ use SilverStripe\Security\Member;
use SilverStripe\Security\Security;
use SilverStripe\SiteConfig\SiteConfig;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\Subsites\Service\ThemeResolver;
use SilverStripe\Subsites\State\SubsiteState;
use SilverStripe\View\SSViewer;
use SilverStripe\VersionedAdmin\Controllers\HistoryViewerController;
/**
* Extension for the SiteTree object to add subsites support
@ -92,7 +88,7 @@ class SiteTreeSubsites extends DataExtension
foreach ($query->getFrom() as $tableName => $info) {
// The tableName should be SiteTree or SiteTree_Live...
$siteTreeTableName = SiteTree::getSchema()->tableName(SiteTree::class);
if (strpos($tableName ?? '', $siteTreeTableName ?? '') === false) {
if (strpos($tableName, $siteTreeTableName) === false) {
break;
}
$query->addWhere("\"$tableName\".\"SubsiteID\" IN ($subsiteID)");
@ -119,12 +115,10 @@ class SiteTreeSubsites extends DataExtension
$subsitesMap = new Map(ArrayList::create());
}
$viewingPageHistory = Controller::has_curr() && Controller::curr() instanceof HistoryViewerController;
// Master page edit field (only allowed from default subsite to avoid inconsistent relationships)
$isDefaultSubsite = $this->owner->SubsiteID == 0 || $this->owner->Subsite()->DefaultSite;
if ($isDefaultSubsite && $subsitesMap->count() && !$viewingPageHistory) {
if ($isDefaultSubsite && $subsitesMap->count()) {
$fields->addFieldToTab(
'Root.Main',
ToggleCompositeField::create(
@ -156,7 +150,6 @@ class SiteTreeSubsites extends DataExtension
// replace readonly link prefix
$subsite = $this->owner->Subsite();
$nested_urls_enabled = Config::inst()->get(SiteTree::class, 'nested_urls');
/** @var Subsite $subsite */
if ($subsite && $subsite->exists()) {
// Use baseurl from domain
$baseLink = $subsite->absoluteBaseURL();
@ -170,97 +163,64 @@ class SiteTreeSubsites extends DataExtension
}
$urlsegment = $fields->dataFieldByName('URLSegment');
if ($urlsegment && $urlsegment instanceof SiteTreeURLSegmentField) {
if ($urlsegment) {
$urlsegment->setURLPrefix($baseLink);
}
}
}
/**
* Does the basic duplication, but doesn't write anything this means we can subclass this easier and do more
* complex relation duplication.
*
* Note that when duplicating including children, everything is written.
*
* @param Subsite|int $subsiteID
* @param bool $includeChildren
* @return SiteTree
* Does the basic duplication, but doesn't write anything
* this means we can subclass this easier and do more complex
* relation duplication.
*/
public function duplicateToSubsitePrep($subsiteID, $includeChildren)
public function duplicateToSubsitePrep($subsiteID)
{
if (is_object($subsiteID)) {
$subsiteID = $subsiteID->ID;
}
return SubsiteState::singleton()
->withState(function (SubsiteState $newState) use ($subsiteID, $includeChildren) {
$newState->setSubsiteId($subsiteID);
/** @var SiteTree $page */
$page = $this->owner;
try {
// We have no idea what the ParentID should be, but it shouldn't be the same as it was since
// we're now in a different subsite. As a workaround use the url-segment and subsite ID.
if ($page->Parent()) {
$parentSeg = $page->Parent()->URLSegment;
$newParentPage = Page::get()->filter('URLSegment', $parentSeg)->first();
$originalParentID = $page->ParentID;
if ($newParentPage) {
$page->ParentID = (int) $newParentPage->ID;
} else {
// reset it to the top level, so the user can decide where to put it
$page->ParentID = 0;
}
}
// Disable query filtering by subsite during actual duplication
$originalFilter = Subsite::$disable_subsite_filter;
Subsite::disable_subsite_filter(true);
return $includeChildren ? $page->duplicateWithChildren() : $page->duplicate(false);
} finally {
Subsite::disable_subsite_filter($originalFilter);
// Re-set the original parent ID for the current page
$page->ParentID = $originalParentID;
}
});
}
/**
* When duplicating a page, assign the current subsite ID from the state
*/
public function onBeforeDuplicate()
{
$subsiteId = SubsiteState::singleton()->getSubsiteId();
if ($subsiteId !== null) {
$this->owner->SubsiteID = $subsiteId;
$oldSubsite = SubsiteState::singleton()->getSubsiteId();
if ($subsiteID) {
Subsite::changeSubsite($subsiteID);
} else {
$subsiteID = $oldSubsite;
}
// doesn't write as we need to reset the SubsiteID, ParentID etc
$clone = $this->owner->duplicate(false);
$clone->CheckedPublicationDifferences = $clone->AddedToStage = true;
$subsiteID = ($subsiteID ? $subsiteID : $oldSubsite);
$clone->SubsiteID = $subsiteID;
// We have no idea what the parentID should be, so as a workaround use the url-segment and subsite ID
if ($this->owner->Parent()) {
$parentSeg = $this->owner->Parent()->URLSegment;
$newParentPage = Page::get()->filter('URLSegment', $parentSeg)->first();
if ($newParentPage) {
$clone->ParentID = $newParentPage->ID;
} else {
// reset it to the top level, so the user can decide where to put it
$clone->ParentID = 0;
}
}
// MasterPageID is here for legacy purposes, to satisfy the subsites_relatedpages module
$clone->MasterPageID = $this->owner->ID;
return $clone;
}
/**
* Create a duplicate of this page and save it to another subsite
*
* @param Subsite|int $subsiteID The Subsite to copy to, or its ID
* @param boolean $includeChildren Whether to duplicate child pages too
* @return SiteTree The duplicated page
* @param $subsiteID int|Subsite The Subsite to copy to, or its ID
*/
public function duplicateToSubsite($subsiteID = null, $includeChildren = false)
public function duplicateToSubsite($subsiteID = null)
{
/** @var SiteTree|SiteTreeSubsites */
$clone = $this->owner->duplicateToSubsitePrep($subsiteID, $includeChildren);
$clone = $this->owner->duplicateToSubsitePrep($subsiteID);
$clone->invokeWithExtensions('onBeforeDuplicateToSubsite', $this->owner);
if (!$includeChildren) {
// Write the new page if "include children" is false, because it is written by default when it's true.
$clone->write();
}
// Deprecated: manually duplicate any configured relationships
$clone->write();
$clone->duplicateSubsiteRelations($this->owner);
// new extension hooks which happens after write,
// onAfterDuplicate isn't reliable due to
// https://github.com/silverstripe/silverstripe-cms/issues/1253
$clone->invokeWithExtensions('onAfterDuplicateToSubsite', $this->owner);
return $clone;
}
@ -271,10 +231,6 @@ class SiteTreeSubsites extends DataExtension
* It may be that some relations are not diostinct to sub site so can stay
* whereas others may need to be duplicated
*
* This was originally deprecated - Use the "cascade_duplicates" config API instead
* Ideally this would be re-deprecated
*
* @param SiteTree $originalPage
*/
public function duplicateSubsiteRelations($originalPage)
{
@ -317,10 +273,8 @@ class SiteTreeSubsites extends DataExtension
* - Is in a group which has access to the subsite this page belongs to
* - Is in a group with edit permissions on the "main site"
*
* If there are no subsites configured yet, this logic is skipped.
*
* @param Member|null $member
* @return bool|null
* @param null $member
* @return bool
*/
public function canEdit($member = null)
{
@ -328,11 +282,6 @@ class SiteTreeSubsites extends DataExtension
$member = Security::getCurrentUser();
}
// Do not provide any input if there are no subsites configured
if (!Subsite::get()->exists()) {
return null;
}
// Find the sites that this user has access to
$goodSites = Subsite::accessible_sites('CMS_ACCESS_CMSMain', true, 'all', $member)->column('ID');
@ -348,7 +297,7 @@ class SiteTreeSubsites extends DataExtension
}
// Return true if they have access to this object's site
if (!(in_array(0, $goodSites ?? []) || in_array($subsiteID, $goodSites ?? []))) {
if (!(in_array(0, $goodSites) || in_array($subsiteID, $goodSites))) {
return false;
}
}
@ -380,8 +329,8 @@ class SiteTreeSubsites extends DataExtension
}
/**
* @param Member|null $member
* @return bool|null
* @param null $member
* @return bool
*/
public function canPublish($member = null)
{
@ -398,20 +347,13 @@ class SiteTreeSubsites extends DataExtension
*/
public static function contentcontrollerInit($controller)
{
/** @var Subsite $subsite */
$subsite = Subsite::currentSubsite();
if ($subsite && $subsite->Theme) {
SSViewer::set_themes(ThemeResolver::singleton()->getThemeList($subsite));
SSViewer::add_themes([$subsite->Theme]);
}
$ignore_subsite_locale = Config::inst()->get(self::class, 'ignore_subsite_locale');
if (!$ignore_subsite_locale
&& $subsite
&& $subsite->Language
&& i18n::getData()->validate($subsite->Language)
) {
if ($subsite && i18n::getData()->validate($subsite->Language)) {
i18n::set_locale($subsite->Language);
}
}
@ -426,41 +368,24 @@ class SiteTreeSubsites extends DataExtension
// This helps deal with Link() returning an absolute URL.
$url = Director::absoluteURL($this->owner->Link($action));
if ($this->owner->SubsiteID) {
$url = preg_replace('/\/\/[^\/]+\//', '//' . $this->owner->Subsite()->domain() . '/', $url ?? '');
$url = preg_replace('/\/\/[^\/]+\//', '//' . $this->owner->Subsite()->domain() . '/', $url);
}
return $url;
}
/**
* Use the CMS domain for iframed CMS previews to prevent single-origin violations
* and SSL cert problems. Always set SubsiteID to avoid errors because a page doesn't
* exist on the CMS domain.
*
* @param string &$link
* @param string|null $action
* @return string
*/
public function updatePreviewLink(&$link, $action = null)
{
$url = Director::absoluteURL($this->owner->Link($action));
$link = HTTP::setGetVar('SubsiteID', $this->owner->SubsiteID, $url);
return $link;
}
/**
* This function is marked as deprecated for removal in 5.0.0 in silverstripe/cms
* so now simply passes execution to where the functionality exists for backwards compatiblity.
* CMS 4.0.0 SiteTree already throws a SilverStripe deprecation error before calling this function.
* @deprecated 2.2.0 Use updatePreviewLink() instead
*
* @param string|null $action
* and SSL cert problems.
* @param null $action
* @return string
*/
public function alternatePreviewLink($action = null)
{
Deprecation::notice('2.2.0', 'Use updatePreviewLink() instead');
$link = '';
return $this->updatePreviewLink($link, $action);
$url = Director::absoluteURL($this->owner->Link());
if ($this->owner->SubsiteID) {
$url = HTTP::setGetVar('SubsiteID', $this->owner->SubsiteID, $url);
}
return $url;
}
/**
@ -485,13 +410,11 @@ class SiteTreeSubsites extends DataExtension
if ($links) {
foreach ($links as $link) {
if (substr($link ?? '', 0, strlen('http://')) == 'http://') {
$withoutHttp = substr($link ?? '', strlen('http://'));
if (strpos($withoutHttp ?? '', '/') &&
strpos($withoutHttp ?? '', '/') < strlen($withoutHttp ?? '')
) {
$domain = substr($withoutHttp ?? '', 0, strpos($withoutHttp ?? '', '/'));
$rest = substr($withoutHttp ?? '', strpos($withoutHttp ?? '', '/') + 1);
if (substr($link, 0, strlen('http://')) == 'http://') {
$withoutHttp = substr($link, strlen('http://'));
if (strpos($withoutHttp, '/') && strpos($withoutHttp, '/') < strlen($withoutHttp)) {
$domain = substr($withoutHttp, 0, strpos($withoutHttp, '/'));
$rest = substr($withoutHttp, strpos($withoutHttp, '/') + 1);
$subsiteID = Subsite::getSubsiteIDForDomain($domain);
if ($subsiteID == 0) {
@ -500,10 +423,14 @@ class SiteTreeSubsites extends DataExtension
$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
Subsite::disable_subsite_filter(true);
$candidatePage = SiteTree::get()->filter([
'URLSegment' => urldecode($rest),
'SubsiteID' => $subsiteID,
])->first();
$candidatePage = DataObject::get_one(
SiteTree::class,
"\"URLSegment\" = '"
. Convert::raw2sql(urldecode($rest))
. "' AND \"SubsiteID\" = "
. $subsiteID,
false
);
Subsite::disable_subsite_filter($origDisableSubsiteFilter);
if ($candidatePage) {
@ -564,9 +491,9 @@ class SiteTreeSubsites extends DataExtension
$subsite = Subsite::currentSubsite();
if ($subsite && $subsite->exists() && $subsite->PageTypeBlacklist) {
// SS 4.1: JSON encoded. SS 4.0, comma delimited
$blacklist = json_decode($subsite->PageTypeBlacklist ?? '', true);
$blacklist = Convert::json2array($subsite->PageTypeBlacklist);
if ($blacklist === false) {
$blacklist = explode(',', $subsite->PageTypeBlacklist ?? '');
$blacklist = explode(',', $subsite->PageTypeBlacklist);
}
if (in_array(get_class($this->owner), (array) $blacklist)) {

View File

@ -42,7 +42,7 @@ class GridFieldSubsiteDetailFormItemRequest extends GridFieldDetailForm_ItemRequ
$templateArray
);
$templateDropdown->setEmptyString('(' . _t('Subsite.NOTEMPLATE', 'No template') . ')');
$form->Fields()->addFieldToTab('Root.Main', $templateDropdown);
$form->Fields()->addFieldToTab('Root.Configuration', $templateDropdown);
}
return $form;

View File

@ -38,7 +38,7 @@ class SubsitesTreeDropdownField extends TreeDropdownField
{
$html = parent::Field($properties);
Requirements::javascript('silverstripe/subsites:client/javascript/SubsitesTreeDropdownField.js');
Requirements::javascript('silverstripe/subsites:javascript/SubsitesTreeDropdownField.js');
return $html;
}

View File

@ -36,7 +36,7 @@ class WildcardDomainField extends TextField
*/
public function checkHostname($hostname)
{
return (bool)preg_match('/^([a-z0-9\*]+[\-\.\:])*([a-z0-9\*]+)$/', $hostname ?? '');
return (bool)preg_match('/^([a-z0-9\*]+[\-\.\:])*([a-z0-9\*]+)$/', $hostname);
}
public function Type()

View File

@ -43,14 +43,8 @@ class InitStateMiddleware implements HTTPMiddleware
return $delegate($request);
} catch (DatabaseException $ex) {
$message = $ex->getMessage();
if (strpos($message, 'No database selected') !== false
|| preg_match('/\s*(table|relation) .* does(n\'t| not) exist/i', $message)
) {
// Database is not ready, ignore and continue. Either it doesn't exist or it has no tables
return $delegate($request);
}
throw $ex;
// Database is not ready
return $delegate($request);
} finally {
// Persist to the session if using the CMS
if ($state->getUseSessions()) {
@ -68,10 +62,10 @@ class InitStateMiddleware implements HTTPMiddleware
public function getIsAdmin(HTTPRequest $request)
{
$adminPaths = static::config()->get('admin_url_paths');
$adminPaths[] = AdminRootController::admin_url();
$currentPath = rtrim($request->getURL() ?? '', '/') . '/';
$adminPaths[] = AdminRootController::config()->get('url_base') . '/';
$currentPath = rtrim($request->getURL(), '/') . '/';
foreach ($adminPaths as $adminPath) {
if (substr($currentPath ?? '', 0, strlen($adminPath ?? '')) === $adminPath) {
if (substr($currentPath, 0, strlen($adminPath)) === $adminPath) {
return true;
}
}
@ -94,7 +88,7 @@ class InitStateMiddleware implements HTTPMiddleware
return (int) $request->getSession()->get('SubsiteID');
}
$subsiteIdFromDomain = Subsite::getSubsiteIDForDomain($request->getHost());
$subsiteIdFromDomain = Subsite::getSubsiteIDForDomain();
if ($subsiteIdFromDomain !== null) {
return (int) $subsiteIdFromDomain;
}

View File

@ -28,7 +28,6 @@ use SilverStripe\Security\Group;
use SilverStripe\Security\Member;
use SilverStripe\Security\Permission;
use SilverStripe\Security\Security;
use SilverStripe\Subsites\Service\ThemeResolver;
use SilverStripe\Subsites\State\SubsiteState;
use SilverStripe\Versioned\Versioned;
use UnexpectedValueException;
@ -56,7 +55,7 @@ class Subsite extends DataObject
* Allows you to force a specific subsite ID, or comma separated list of IDs.
* Only works for reading. An object cannot be written to more than 1 subsite.
*
* @deprecated 2.0.0 Use SubsiteState::singleton()->withState() instead.
* @deprecated 2.0.0..3.0.0 Use SubsiteState::singleton()->withState() instead.
*/
public static $force_subsite = null;
@ -109,13 +108,12 @@ class Subsite extends DataObject
*/
private static $check_is_public = true;
/**
* @var array
/*** @return array
*/
private static $summary_fields = [
'Title',
'PrimaryDomain',
'IsPublic.Nice'
'IsPublic'
];
/**
@ -184,6 +182,7 @@ class Subsite extends DataObject
/**
* Gets the subsite currently set in the session.
*
* @uses ControllerSubsites->controllerAugmentInit()
* @return DataObject The current Subsite
*/
public static function currentSubsite()
@ -201,11 +200,11 @@ class Subsite extends DataObject
*
* @return int ID of the current subsite instance
*
* @deprecated 2.0.0 Use SubsiteState::singleton()->getSubsiteId() instead
* @deprecated 2.0..3.0 Use SubsiteState::singleton()->getSubsiteId() instead
*/
public static function currentSubsiteID()
{
Deprecation::notice('2.0.0', 'Use SubsiteState::singleton()->getSubsiteId() instead');
Deprecation::notice('3.0', 'Use SubsiteState::singleton()->getSubsiteId() instead');
return SubsiteState::singleton()->getSubsiteId();
}
@ -258,15 +257,11 @@ class Subsite extends DataObject
$host = $_SERVER['HTTP_HOST'];
}
// Remove ports, we aren't concerned with them in terms of detecting subsites via domains
$hostParts = explode(':', $host ?? '', 2);
$host = reset($hostParts);
$matchingDomains = null;
$cacheKey = null;
if ($host) {
if (!static::config()->get('strict_subdomain_matching')) {
$host = preg_replace('/^www\./', '', $host ?? '');
$host = preg_replace('/^www\./', '', $host);
}
$currentUserId = Security::getCurrentUser() ? Security::getCurrentUser()->ID : 0;
@ -281,8 +276,7 @@ class Subsite extends DataObject
/** @skipUpgrade */
$domainTableName = $schema->tableName(SubsiteDomain::class);
if (!DB::get_schema()->hasTable($domainTableName)) {
if (!in_array($domainTableName, DB::table_list())) {
// Table hasn't been created yet. Might be a dev/build, skip.
return 0;
}
@ -301,9 +295,9 @@ class Subsite extends DataObject
}
if ($matchingDomains && $matchingDomains->count()) {
$subsiteIDs = array_unique($matchingDomains->column('SubsiteID') ?? []);
$subsiteDomains = array_unique($matchingDomains->column('Domain') ?? []);
if (sizeof($subsiteIDs ?? []) > 1) {
$subsiteIDs = array_unique($matchingDomains->column('SubsiteID'));
$subsiteDomains = array_unique($matchingDomains->column('Domain'));
if (sizeof($subsiteIDs) > 1) {
throw new UnexpectedValueException(sprintf(
"Multiple subsites match on '%s': %s",
$host,
@ -313,7 +307,7 @@ class Subsite extends DataObject
$subsiteID = $subsiteIDs[0];
} else {
if ($default = Subsite::get()->filter('DefaultSite', 1)->setQueriedColumns(['ID'])->first()) {
if ($default = DataObject::get_one(Subsite::class, '"DefaultSite" = 1')) {
// Check for a 'default' subsite
$subsiteID = $default->ID;
} else {
@ -448,7 +442,7 @@ class Subsite extends DataObject
// Rationalise member arguments
if (!$member) {
$member = Security::getCurrentUser();
$member = Member::currentUser();
}
if (!$member) {
return new ArrayList();
@ -577,7 +571,7 @@ class Subsite extends DataObject
foreach ($domains as $domain) {
$domainStr = $domain->Domain;
if (!static::config()->get('strict_subdomain_matching')) {
$domainStr = preg_replace('/^www\./', '', $domainStr ?? '');
$domainStr = preg_replace('/^www\./', '', $domainStr);
}
$hostmap[$domainStr] = $subsite->domain();
}
@ -592,8 +586,8 @@ class Subsite extends DataObject
$data .= "// Generated by Subsite::writeHostMap() on " . date('d/M/y') . "\n";
$data .= '$subsiteHostmap = ' . var_export($hostmap, true) . ';';
if (is_writable(dirname($file ?? '')) || is_writable($file ?? '')) {
file_put_contents($file ?? '', $data);
if (is_writable(dirname($file)) || is_writable($file)) {
file_put_contents($file, $data);
}
}
@ -624,7 +618,7 @@ class Subsite extends DataObject
return false;
}
if (!in_array('ADMIN', $permissionCodes ?? [])) {
if (!in_array('ADMIN', $permissionCodes)) {
$permissionCodes[] = 'ADMIN';
}
@ -774,7 +768,7 @@ class Subsite extends DataObject
$labels['DefaultSite'] = _t('Subsites.DefaultSiteFieldLabel', 'Default site');
$labels['Theme'] = _t('Subsites.ThemeFieldLabel', 'Theme');
$labels['Language'] = _t('Subsites.LanguageFieldLabel', 'Language');
$labels['IsPublic.Nice'] = _t('Subsites.IsPublicFieldLabel', 'Enable public access');
$labels['IsPublic'] = _t('Subsites.IsPublicFieldLabel', 'Enable public access');
$labels['PageTypeBlacklist'] = _t('Subsites.PageTypeBlacklistFieldLabel', 'Page Type Blacklist');
$labels['Domains.Domain'] = _t('Subsites.DomainFieldLabel', 'Domain');
$labels['PrimaryDomain'] = _t('Subsites.PrimaryDomainFieldLabel', 'Primary Domain');
@ -789,7 +783,7 @@ class Subsite extends DataObject
*/
public function allowedThemes()
{
if (($themes = self::$allowed_themes) || ($themes = ThemeResolver::singleton()->getCustomThemeOptions())) {
if ($themes = self::$allowed_themes) {
return ArrayLib::valuekey($themes);
}
@ -799,7 +793,7 @@ class Subsite extends DataObject
if ($theme[0] == '.') {
continue;
}
$theme = strtok($theme ?? '', '_');
$theme = strtok($theme, '_');
$themes[$theme] = $theme;
}
ksort($themes);
@ -876,7 +870,7 @@ class Subsite extends DataObject
}
// If there are no objects, default to the current hostname
return Director::host();
return $_SERVER['HTTP_HOST'];
}
/**
@ -989,7 +983,7 @@ JS;
* when a page, etc, is duplicated
*/
$stack = [[0, 0]];
while (count($stack ?? []) > 0) {
while (count($stack) > 0) {
list($sourceParentID, $destParentID) = array_pop($stack);
$children = Versioned::get_by_stage('Page', 'Live', "\"ParentID\" = $sourceParentID", '');

View File

@ -111,14 +111,13 @@ class SubsiteDomain extends DataObject
self::PROTOCOL_HTTPS => _t(__CLASS__ . '.PROTOCOL_HTTPS', 'https://'),
self::PROTOCOL_AUTOMATIC => _t(__CLASS__ . '.PROTOCOL_AUTOMATIC', 'Automatic')
];
$fields = FieldList::create(
$fields = new FieldList(
WildcardDomainField::create('Domain', $this->fieldLabel('Domain'), null, 255)
->setDescription(_t(
__CLASS__ . '.DOMAIN_DESCRIPTION',
'Hostname of this subsite (exclude protocol). Allows wildcards (*).'
)),
OptionsetField::create('Protocol', $this->fieldLabel('Protocol'), $protocols)
->setValue($this->Protocol ?: self::PROTOCOL_AUTOMATIC)
->setDescription(_t(
__CLASS__ . '.PROTOCOL_DESCRIPTION',
'When generating links to this subsite, use the selected protocol. <br />' .
@ -126,7 +125,7 @@ class SubsiteDomain extends DataObject
)),
CheckboxField::create('IsPrimary', $this->fieldLabel('IsPrimary'))
->setDescription(_t(
__CLASS__ . '.ISPRIMARY_DESCRIPTION',
__CLASS__ . '.PROTOCOL_DESCRIPTION',
'Mark this as the default domain for this subsite'
))
);
@ -186,18 +185,18 @@ class SubsiteDomain extends DataObject
*/
public function getSubstitutedDomain()
{
$currentHost = Director::host();
$currentHost = $_SERVER['HTTP_HOST'];
// If there are wildcards in the primary domain (not recommended), make some
// educated guesses about what to replace them with:
$domain = preg_replace('/\.\*$/', ".{$currentHost}", $this->Domain ?? '');
$domain = preg_replace('/\.\*$/', ".{$currentHost}", $this->Domain);
// Default to "subsite." prefix for first wildcard
// TODO Whats the significance of "subsite" in this context?!
$domain = preg_replace('/^\*\./', "subsite.", $domain ?? '');
$domain = preg_replace('/^\*\./', "subsite.", $domain);
// *Only* removes "intermediate" subdomains, so 'subdomain.www.domain.com' becomes 'subdomain.domain.com'
$domain = str_replace('.www.', '.', $domain ?? '');
$domain = str_replace('.www.', '.', $domain);
return $domain;
}

View File

@ -8,6 +8,7 @@ use SilverStripe\CMS\Model\VirtualPage;
use SilverStripe\Control\Controller;
use SilverStripe\Core\Config\Config;
use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\LabelField;
use SilverStripe\Forms\LiteralField;
use SilverStripe\Forms\TextareaField;
use SilverStripe\Forms\TextField;
@ -112,7 +113,7 @@ class SubsitesVirtualPage extends VirtualPage
'Root.Main',
TextareaField::create(
'CustomMetaKeywords',
$this->fieldLabel('CustomMetaKeywords')
$this->fieldLabel('CustomMetaTitle')
)->setDescription(_t(__CLASS__ . '.OverrideNote', 'Overrides inherited value from the source')),
'MetaKeywords'
);
@ -120,7 +121,7 @@ class SubsitesVirtualPage extends VirtualPage
'Root.Main',
TextareaField::create(
'CustomMetaDescription',
$this->fieldLabel('CustomMetaDescription')
$this->fieldLabel('CustomMetaTitle')
)->setDescription(_t(__CLASS__ . '.OverrideNote', 'Overrides inherited value from the source')),
'MetaDescription'
);
@ -128,7 +129,7 @@ class SubsitesVirtualPage extends VirtualPage
'Root.Main',
TextField::create(
'CustomExtraMeta',
$this->fieldLabel('CustomExtraMeta')
$this->fieldLabel('CustomMetaTitle')
)->setDescription(_t(__CLASS__ . '.OverrideNote', 'Overrides inherited value from the source')),
'ExtraMeta'
);
@ -174,7 +175,7 @@ class SubsitesVirtualPage extends VirtualPage
}
foreach (self::$db as $field => $type) {
if (in_array($field, $fields ?? [])) {
if (in_array($field, $fields)) {
unset($fields[array_search($field, $fields)]);
}
}
@ -225,20 +226,30 @@ class SubsitesVirtualPage extends VirtualPage
// Veto the validation rules if its false. In this case, some logic
// needs to be duplicated from parent to find out the exact reason the validation failed.
if (!$isValid) {
$filters = [
'URLSegment' => $this->URLSegment,
'ID:not' => $this->ID,
];
$IDFilter = $this->ID ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null;
$parentFilter = null;
if (Config::inst()->get(SiteTree::class, 'nested_urls')) {
$filters['ParentID'] = $this->ParentID ?: 0;
if ($this->ParentID) {
$parentFilter = " AND \"SiteTree\".\"ParentID\" = $this->ParentID";
} else {
$parentFilter = ' AND "SiteTree"."ParentID" = 0';
}
}
$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
Subsite::disable_subsite_filter();
$existingPage = SiteTree::get()->filter($filters)->first();
Subsite::disable_subsite_filter($origDisableSubsiteFilter);
$existingPageInSubsite = SiteTree::get()->filter($filters)->first();
Subsite::$disable_subsite_filter = true;
$existingPage = DataObject::get_one(
SiteTree::class,
"\"URLSegment\" = '$this->URLSegment' $IDFilter $parentFilter",
false // disable cache, it doesn't include subsite status in the key
);
Subsite::$disable_subsite_filter = $origDisableSubsiteFilter;
$existingPageInSubsite = DataObject::get_one(
SiteTree::class,
"\"URLSegment\" = '$this->URLSegment' $IDFilter $parentFilter",
false // disable cache, it doesn't include subsite status in the key
);
// If URL has been vetoed because of an existing page,
// be more specific and allow same URLSegments in different subsites

View File

@ -27,10 +27,10 @@ class SubsiteReportWrapper extends ReportWrapper
_t(__CLASS__ . '.ReportDropdown', 'Sites'),
$options
);
$subsiteField->setValue(array_keys($options ?? []));
$subsiteField->setValue(array_keys($options));
// We don't need to make the field editable if only one subsite is available
if (sizeof($options ?? []) <= 1) {
if (sizeof($options) <= 1) {
$subsiteField = $subsiteField->performReadonlyTransformation();
}
@ -70,7 +70,7 @@ class SubsiteReportWrapper extends ReportWrapper
} else {
$subsites = Subsite::accessible_sites('CMS_ACCESS_CMSMain');
$options = $subsites->toDropdownMap('ID', 'Title');
Subsite::$force_subsite = join(',', array_keys($options ?? []));
Subsite::$force_subsite = join(',', array_keys($options));
}
}

View File

@ -1,99 +0,0 @@
<?php
namespace SilverStripe\Subsites\Service;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\View\SSViewer;
class ThemeResolver
{
use Injectable;
use Configurable;
/**
* Cascading definitions for themes, keyed by the name they should appear under in the CMS. For example:
*
* [
* 'theme-1' => [
* '$public',
* 'starter',
* '$default',
* ],
* 'theme-2' => [
* 'custom',
* 'watea',
* 'starter',
* '$public',
* '$default',
* ]
* ]
*
* @config
* @var null|array[]
*/
private static $theme_options;
/**
* Get the list of themes for the given sub site that can be given to SSViewer::set_themes
*
* @param Subsite $site
* @return array
*/
public function getThemeList(Subsite $site)
{
$themes = array_values(SSViewer::get_themes() ?? []);
$siteTheme = $site->Theme;
if (!$siteTheme) {
return $themes;
}
$customOptions = $this->config()->get('theme_options');
if ($customOptions && isset($customOptions[$siteTheme])) {
return $customOptions[$siteTheme];
}
// Ensure themes don't cascade "up" the list
$index = array_search($siteTheme, $themes ?? []);
if ($index > 0) {
// 4.0 didn't have support for themes in the public webroot
$constant = SSViewer::class . '::PUBLIC_THEME';
$publicConstantDefined = defined($constant ?? '');
// Check if the default is public themes
$publicDefault = $publicConstantDefined && $themes[0] === SSViewer::PUBLIC_THEME;
// Take only those that appear after theme chosen (non-inclusive)
$themes = array_slice($themes ?? [], $index + 1);
// Add back in public
if ($publicDefault) {
array_unshift($themes, SSViewer::PUBLIC_THEME);
}
}
// Add our theme
array_unshift($themes, $siteTheme);
return $themes;
}
/**
* Get a list of custom cascading theme definitions if available
*
* @return null|array
*/
public function getCustomThemeOptions()
{
$config = $this->config()->get('theme_options');
if (!$config) {
return null;
}
return array_keys($config ?? []);
}
}

View File

@ -5,7 +5,6 @@ namespace SilverStripe\Subsites\State;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Core\Resettable;
use SilverStripe\Dev\Deprecation;
/**
* SubsiteState provides static access to the current state for subsite related data during a request
@ -49,9 +48,6 @@ class SubsiteState implements Resettable
*/
public function setSubsiteId($id)
{
if (!ctype_digit((string) $id) && !is_null($id)) {
Deprecation::notice('2.8.0', 'Passing multiple IDs is deprecated, only pass a single ID instead.');
}
if (is_null($this->originalSubsiteId)) {
$this->originalSubsiteId = (int) $id;
}

View File

@ -56,7 +56,7 @@ class SubsiteCopyPagesTask extends BuildTask
// issues with having to check whether or not the new parents have been added to the site tree
// when a page, etc, is duplicated
$stack = [[0, 0]];
while (count($stack ?? []) > 0) {
while (count($stack) > 0) {
list($sourceParentID, $destParentID) = array_pop($stack);
$children = Versioned::get_by_stage(SiteTree::class, 'Live', "\"ParentID\" = $sourceParentID", '');

View File

@ -1,35 +0,0 @@
<?php
namespace SilverStripe\Subsites\Tasks;
use SilverStripe\Dev\Tasks\MigrateFileTask;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\Dev\Deprecation;
/**
* @deprecated 2.8.0 Will be removed without equivalent functionality to replace it
*/
class SubsiteMigrateFileTask extends MigrateFileTask
{
public function __construct()
{
Deprecation::withNoReplacement(function () {
Deprecation::notice(
'2.8.0',
'Will be removed without equivalent functionality to replace it',
Deprecation::SCOPE_CLASS
);
});
parent::__construct();
}
public function run($request)
{
$origDisableSubsiteFilter = Subsite::$disable_subsite_filter;
Subsite::disable_subsite_filter(true);
parent::run($request);
Subsite::disable_subsite_filter($origDisableSubsiteFilter);
}
}

View File

@ -1,29 +0,0 @@
# See https://github.com/silverstripe/silverstripe-subsites/issues/357
Feature: Insert an internal link into content
As a CMS user
I can insert internal links into my content
So that I can direct users to different parts of my website
Background:
Given a "subsite" "Subsite B"
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content"
And a "page" "Another page" with "URLSegment"="another-page", "Content"="My other page content"
And I am logged in with "CMS_ACCESS_CMSMain" permissions
Then I go to "admin/pages"
And I click on "My page" in the tree
@javascript
Scenario: I can insert an internal link
# See "insert-a-link.feature" from silverstripe/cms
When I select "My page" in the "Content" HTML field
And I press the "Insert link" HTML field button
And I click "Page on this site" in the ".mce-menu" element
Then I should see an "form#Form_editorInternalLink" element
When I click "(Search or choose Page)" in the ".Select-multi-value-wrapper" element
And I click "Another page" in the ".treedropdownfield__menu" element
And I fill in "my desc" for "Link description"
And I press the "Insert" button
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link"
And the "Content" HTML field should contain "My page</a>"
# Required to avoid "unsaved changes" browser dialog
Then I press the "Save" button

View File

@ -1,81 +0,0 @@
@javascript
Feature: Create and select a subsite
As a CMS user
I want to be able to select a subsite
So that I can edit content for a specific subsite
Background:
# There's a bug where you need CMS_ACCESS_CMSMain rather than CMS_ACCESS_LeftAndMain permissions to
# use subsites as expected
Given the "group" "EDITOR" has permissions "CMS_ACCESS_CMSMain" and "CMS_ACCESS_AssetAdmin" and "FILE_EDIT_ALL"
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content"
And an "image" "file1.jpg"
And an "image" "file2.jpg"
Scenario: I can operate subsites
# Create subsite as Admin
Given I am logged in with "ADMIN" permissions
Then I go to "admin/subsites"
# Add subsites button is not a regular button, so click using css selector
And I click on the ".btn-toolbar .btn__title" element
And I fill in "Subsite Name" with "My subsite"
And I press "Create"
# Add a file to the main site
When I go to "admin/assets"
And I press the "Add folder" button
And I select "Main site" from "SubsitesSelect"
# Using a short folder name so that it doesn't get truncated on the frontend
And I fill in "Folder name" with "mfol"
And I press the "Create" button
When I go to "admin/assets"
And I click on the file named "mfol" in the gallery
And I attach the file "file1.jpg" to dropzone "gallery-container"
# Change to Editor user
When I go to "/Security/login"
And I press the "Log in as someone else" button
When I am logged in as a member of "EDITOR" group
And I go to "admin/pages"
# Can see main site page on main site
When I go to "admin/pages"
Then I should see "My page" in the tree
# Cannot see main site page on subsite
When I select "My subsite" from "SubsitesSelect"
And I go to "admin/pages"
Then I should not see "My page" in the tree
# Create a page on the subsite
When I press the "Add new" button
And I select the "Page" radio button
And I press the "Create" button
When I fill in "Page name" with "My subsite page"
And I press the "Publish" button
Then I should see "My subsite page"
# Can see main site folders/files from subsite
When I go to "admin/assets"
Then I should see "mfol"
When I click on the file named "mfol" in the gallery
Then I should see "file1"
# Add a file to the subsite
When I go to "admin/assets"
And I select "My subsite" from "SubsitesSelect"
And I press the "Add folder" button
And I fill in "Folder name" with "sfol"
And I press the "Create" button
When I go to "admin/assets"
And I click on the file named "sfol" in the gallery
And I attach the file "file2.jpg" to dropzone "gallery-container"
# Change back to main subsite - cannot see subsite folders/files
When I go to "admin/assets"
And I select "Main site" from "SubsitesSelect"
Then I should see "mfol"
Then I should not see "My subsite page"

View File

@ -1,29 +1,25 @@
Feature: Preview navigation
As a CMS user
I can navigate a subsite in the preview pane
In order to preview my content
As a CMS user
I can navigate a subsite in the preview pane
In order to preview my content
Background:
Given a "subsite" "MySubsite"
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content <a name='aname'>aname</a> <a href='[sitetree_link,id=5]'>ahref</a>" and "SubsiteID"="1"
And a "page" "Other page" with "URLSegment"="other-page", "Content"="Other page content <a href='[sitetree_link,id=4]'>Goto my page</a>" and "SubsiteID"="1"
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Subsites' section"
And I am logged in as a member of "EDITOR" group
Background:
Given a "subsite" "My subsite"
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content <a name='aname'>aname</a><a href='other-page'>ahref</a>" and "Subsite"="=>SilverStripe\Subsites\Model\Subsite.My subsite"
And a "page" "Other page" with "URLSegment"="other-page", "Content"="Other page content <a href='my-page'>Goto my page></a>" and "Subsite"="=>SilverStripe\Subsites\Model\Subsite.My subsite"
Given a "member" "Joe" belonging to "Admin Group" with "Email"="joe@test.com" and "Password"="Password1"
And the "group" "Admin Group" has permissions "Full administrative rights"
And I log in with "joe@test.com" and "Password1"
@javascript
Scenario: I can navigate the subsite preview
When I go to "/admin/pages"
And I select "MySubsite" from "SubsitesSelect"
And I click on "My page" in the tree
And I press the "Publish" button
And I click on "Other page" in the tree
And I press the "Publish" button
And I click on "My page" in the tree
And I set the CMS mode to "Preview mode"
And I follow "ahref" in preview
And I wait for 1 second
Then the preview contains "Other page content"
# We are already on the second page, follow a link to return to first one.
And I follow "Goto my page" in preview
And I wait for 1 second
Then the preview contains "My page content"
@javascript
Scenario: I can navigate the subsite preview
When I go to "admin"
And I select "My subsite" from "SubsitesSelect"
And I go to "admin/pages"
And I click on "My page" in the tree
And I set the CMS mode to "Preview mode"
And I follow "ahref" in preview
Then the preview contains "Other page content"
# We are already on the second page, follow a link to return to first one.
And I follow "Goto my page" in preview
Then the preview contains "My page content"

View File

@ -1,26 +0,0 @@
Feature: Publish a page
As a CMS user
I can author pages in a new subsite
So that I can separate my website content by site
Background:
Given a "subsite" "Subsite B"
And a "page" "My page" with "URLSegment"="my-page", "Content"="My page content"
And the "group" "EDITOR" has permissions "Access to 'Pages' section" and "Access to 'Subsites' section"
And I am logged in as a member of "EDITOR" group
Then I go to "admin/pages"
@javascript
Scenario: I can publish a new page
Given I select "Subsite B" from "SubsitesSelect"
When I press the "Add new" button
And I press the "Create" button
And I set the CMS mode to "Edit mode"
And I fill in the "Content" HTML field with "<p>Some test content</p>"
Then I should see a "Publish" button
And I should not see a "Published" button
When I press the "Publish" button
And I wait for 3 seconds
Then I should see a "Published" button
And I should see a "Saved" button

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -9,7 +9,7 @@ use SilverStripe\Subsites\State\SubsiteState;
class BaseSubsiteTest extends SapphireTest
{
protected function setUp(): void
protected function setUp()
{
parent::setUp();

View File

@ -24,8 +24,8 @@ class FolderFormFactoryExtensionTest extends SapphireTest
'Record' => $folder
]);
$source = array_values($folderForm->Fields()->fieldByName('SubsiteID')->getSource() ?? []);
$result = array_values($source ?? []);
$source = array_values($folderForm->Fields()->fieldByName('SubsiteID')->getSource());
$result = array_values($source);
$this->assertContains('Main site', $result);
$this->assertContains('Subsite A', $result);

View File

@ -8,7 +8,6 @@ use SilverStripe\Core\Config\Config;
use SilverStripe\Forms\FieldList;
use SilverStripe\Subsites\Extensions\FileSubsites;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\Security\Member;
class FileSubsitesTest extends BaseSubsiteTest
{
@ -66,64 +65,4 @@ class FileSubsitesTest extends BaseSubsiteTest
$file->onAfterUpload();
$this->assertEquals($folder->SubsiteID, $file->SubsiteID);
}
/**
* @dataProvider provideTestCanEdit
*/
public function testCanEdit(
string $fileKey,
string $memberKey,
string $currentSubsiteKey,
bool $expected
): void {
$file = $this->objFromFixture(File::class, $fileKey);
$subsiteID = ($currentSubsiteKey === 'mainsite')
? 0 : $this->objFromFixture(Subsite::class, $currentSubsiteKey)->ID;
$member = $this->objFromFixture(Member::class, $memberKey);
Subsite::changeSubsite($subsiteID);
$this->assertSame($expected, $file->canEdit($member));
}
public function provideTestCanEdit(): array
{
$ret = [];
$data = [
// file
'subsite1file' => [
// member - has permissions to edit the file
'filetestyes' => [
// current subite => expected canEdit()
'subsite1' => true,
'subsite2' => false,
'mainsite' => true
],
// member - does not have permissions to edit the file
'filetestno' => [
'subsite1' => false,
'subsite2' => false,
'mainsite' => false
],
],
'mainsitefile' => [
'filetestyes' => [
'subsite1' => true,
'subsite2' => true,
'mainsite' => true
],
'filetestno' => [
'subsite1' => false,
'subsite2' => false,
'mainsite' => false
],
]
];
foreach (array_keys($data) as $fileKey) {
foreach (array_keys($data[$fileKey]) as $memberKey) {
foreach ($data[$fileKey][$memberKey] as $currentSubsiteKey => $expected) {
$ret[] = [$fileKey, $memberKey, $currentSubsiteKey, $expected];
}
}
}
return $ret;
}
}

View File

@ -15,8 +15,8 @@ class GroupSubsitesTest extends BaseSubsiteTest
public function testTrivialFeatures()
{
$this->assertIsArray(singleton(GroupSubsites::class)->extraStatics());
$this->assertIsArray(singleton(GroupSubsites::class)->providePermissions());
$this->assertInternalType('array', singleton(GroupSubsites::class)->extraStatics());
$this->assertInternalType('array', singleton(GroupSubsites::class)->providePermissions());
$this->assertInstanceOf(FieldList::class, singleton(Group::class)->getCMSFields());
}

View File

@ -1,80 +0,0 @@
<?php
namespace SilverStripe\Subsites\Tests;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Subsites\Middleware\InitStateMiddleware;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\Subsites\State\SubsiteState;
class InitStateMiddlewareTest extends BaseSubsiteTest
{
protected static $fixture_file = 'SubsiteTest.yml';
/**
* Original value of $_REQUEST
*
* @var array
*/
protected $origServer = [];
protected function setUp(): void
{
parent::setUp();
$this->origServer = $_SERVER;
}
protected function tearDown(): void
{
$_SERVER = $this->origServer;
parent::tearDown();
}
public function testDomainDetectionViaServerHeaders()
{
$_SERVER['HTTP_HOST'] = 'one.example.org';
$this->getMiddleware()->process($this->getRequest(), $this->getCallback());
$expectedSubsite = $this->objFromFixture(Subsite::class, 'domaintest1');
$this->assertEquals($expectedSubsite->ID, $this->getState()->getSubsiteId());
}
public function testDomainDetectionViaRequestOverridesServerHeaders()
{
$_SERVER['HTTP_HOST'] = 'one.example.org';
$this->getMiddleware()->process($this->getRequest('two.mysite.com'), $this->getCallback());
$expectedSubsite = $this->objFromFixture(Subsite::class, 'domaintest2');
$this->assertEquals($expectedSubsite->ID, $this->getState()->getSubsiteId());
}
protected function getMiddleware()
{
return new InitStateMiddleware();
}
protected function getRequest($domain = null)
{
$request = new HTTPRequest('GET', '/test/url');
if ($domain) {
$request->addHeader('host', $domain);
}
return $request;
}
protected function getCallback()
{
return function () {
};
}
protected function getState()
{
return Injector::inst()->get(SubsiteState::class);
}
}

View File

@ -9,7 +9,6 @@ use SilverStripe\CMS\Controllers\CMSPageEditController;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\FunctionalTest;
use SilverStripe\Security\Member;
use SilverStripe\Subsites\Extensions\LeftAndMainSubsites;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\Subsites\State\SubsiteState;
@ -38,19 +37,19 @@ class LeftAndMainSubsitesTest extends FunctionalTest
$cmsmain = singleton(CMSMain::class);
$subsites = $cmsmain->sectionSites(true, 'Main site', $member);
$this->assertListEquals([
$this->assertDOSEquals([
['Title' => 'Subsite1 Template']
], $subsites, 'Lists member-accessible sites for the accessible controller.');
$assetadmin = singleton(AssetAdmin::class);
$subsites = $assetadmin->sectionSites(true, 'Main site', $member);
$this->assertListEquals([], $subsites, 'Does not list any sites for forbidden controller.');
$this->assertDOSEquals([], $subsites, 'Does not list any sites for forbidden controller.');
$member = $this->objFromFixture(Member::class, 'editor');
$cmsmain = singleton(CMSMain::class);
$subsites = $cmsmain->sectionSites(true, 'Main site', $member);
$this->assertListContains([
$this->assertDOSContains([
['Title' => 'Main site']
], $subsites, 'Includes the main site for members who can access all sites.');
}
@ -101,14 +100,4 @@ class LeftAndMainSubsitesTest extends FunctionalTest
$this->assertTrue($l->shouldChangeSubsite(CMSPageEditController::class, 1, 5));
$this->assertFalse($l->shouldChangeSubsite(CMSPageEditController::class, 1, 1));
}
public function testCanAccessWithPassedMember()
{
$memberID = $this->logInWithPermission('ADMIN');
$member = Member::get()->byID($memberID);
/** @var LeftAndMain&LeftAndMainSubsites $leftAndMain */
$leftAndMain = new LeftAndMain();
$this->assertTrue($leftAndMain->canAccess($member));
}
}

View File

@ -1,143 +0,0 @@
<?php
namespace SilverStripe\Subsites\Tests\Service;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\Subsites\Service\ThemeResolver;
use SilverStripe\View\SSViewer;
class ThemeResolverTest extends SapphireTest
{
protected $themeList = [
'$public',
'custom',
'main',
'backup',
SSViewer::DEFAULT_THEME,
];
protected function setUp(): void
{
parent::setUp();
// Setup known theme config
Config::modify()->set(SSViewer::class, 'themes', $this->themeList);
}
public function testSubsiteWithoutThemeReturnsDefaultThemeList()
{
$subsite = new Subsite();
$resolver = new ThemeResolver();
$this->assertSame($this->themeList, $resolver->getThemeList($subsite));
}
public function testSubsiteWithCustomThemePrependsToList()
{
$subsite = new Subsite();
$subsite->Theme = 'subsite';
$resolver = new ThemeResolver();
$expected = array_merge(['subsite'], $this->themeList);
$this->assertSame($expected, $resolver->getThemeList($subsite));
}
public function testSubsiteWithCustomThemeDoesNotCascadeUpTheList()
{
$subsite = new Subsite();
$subsite->Theme = 'main';
$resolver = new ThemeResolver();
$expected = [
'main', // 'main' is moved to the top
'$public', // $public is preserved
// Anything above 'main' is removed
'backup',
SSViewer::DEFAULT_THEME,
];
$this->assertSame($expected, $resolver->getThemeList($subsite));
}
/**
* @dataProvider customThemeDefinitionsAreRespectedProvider
*/
public function testCustomThemeDefinitionsAreRespected($themeOptions, $siteTheme, $expected)
{
Config::modify()->set(ThemeResolver::class, 'theme_options', $themeOptions);
$subsite = new Subsite();
$subsite->Theme = $siteTheme;
$resolver = new ThemeResolver();
$this->assertSame($expected, $resolver->getThemeList($subsite));
}
public function customThemeDefinitionsAreRespectedProvider()
{
return [
// Simple
[
['test' => $expected = [
'subsite',
'backup',
'$public',
SSViewer::DEFAULT_THEME,
]],
'test',
$expected
],
// Many options
[
[
'aye' => [
'aye',
'thing',
SSViewer::DEFAULT_THEME,
],
'bee' => $expected = [
'subsite',
'backup',
'$public',
SSViewer::DEFAULT_THEME,
],
'sea' => [
'mer',
'ocean',
SSViewer::DEFAULT_THEME,
],
],
'bee',
$expected
],
// Conflicting with root definitions
[
['main' => $expected = [
'subsite',
'backup',
'$public',
SSViewer::DEFAULT_THEME,
]],
'main',
$expected
],
// Declaring a theme specifically should still work
[
['test' => [
'subsite',
'backup',
'$public',
SSViewer::DEFAULT_THEME,
]],
'other',
array_merge(['other'], $this->themeList)
],
];
}
}

View File

@ -5,27 +5,22 @@ namespace SilverStripe\Subsites\Tests;
use Page;
use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\CMS\Controllers\ModelAsController;
use SilverStripe\CMS\Forms\SiteTreeURLSegmentField;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Director;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Convert;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\ErrorPage\ErrorPage;
use SilverStripe\Forms\FieldList;
use SilverStripe\i18n\i18n;
use SilverStripe\Security\Member;
use SilverStripe\SiteConfig\SiteConfig;
use SilverStripe\Subsites\Extensions\SiteTreeSubsites;
use SilverStripe\Subsites\Model\Subsite;
use SilverStripe\Subsites\Pages\SubsitesVirtualPage;
use SilverStripe\Subsites\Service\ThemeResolver;
use SilverStripe\Subsites\Tests\SiteTreeSubsitesTest\TestClassA;
use SilverStripe\Subsites\Tests\SiteTreeSubsitesTest\TestClassB;
use SilverStripe\Subsites\Tests\SiteTreeSubsitesTest\TestErrorPage;
use SilverStripe\Versioned\Versioned;
use SilverStripe\View\SSViewer;
use TractorCow\Fluent\Extension\FluentSiteTreeExtension;
class SiteTreeSubsitesTest extends BaseSubsiteTest
{
@ -38,12 +33,10 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
];
protected static $illegal_extensions = [
SiteTree::class => [
FluentSiteTreeExtension::class,
],
SiteTree::class => ['Translatable'] // @todo implement Translatable namespace
];
protected function setUp(): void
protected function setUp()
{
// We have our own home page fixtures, prevent the default one being created in this test suite.
Config::modify()->set(SiteTree::class, 'create_default_pages', false);
@ -192,22 +185,6 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
$this->assertEquals($p2->ID, SiteTree::get_by_link('test-page')->ID);
}
public function testIgnoreSubsiteLocale()
{
$ignore_subsite_locale = Config::inst()->set(SiteTreeSubsites::class, 'ignore_subsite_locale', true);
$subsitePage = $this->objFromFixture(Page::class, 'subsite_locale_about');
Subsite::changeSubsite($subsitePage->SubsiteID);
$controller = ModelAsController::controller_for($subsitePage);
$i18n_locale_before = i18n::get_locale();
SiteTree::singleton()->extend('contentcontrollerInit', $controller);
$i18n_locale_after = i18n::get_locale();
$this->assertEquals($i18n_locale_before, $i18n_locale_after);
}
public function testPageTypesBlacklistInClassDropdown()
{
$this->logInAs('editor');
@ -291,7 +268,7 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
Subsite::changeSubsite($s1);
$cmsmain = CMSMain::create();
$hints = json_decode($cmsmain->SiteTreeHints() ?? '', true);
$hints = Convert::json2array($cmsmain->SiteTreeHints());
$classes = $hints['Root']['disallowedChildren'];
$this->assertContains(ErrorPage::class, $classes);
$this->assertContains(TestClassA::class, $classes);
@ -302,7 +279,7 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
if ($cmsmain->hasMethod('getHintsCache')) {
$cmsmain->getHintsCache()->clear();
}
$hints = json_decode($cmsmain->SiteTreeHints() ?? '', true);
$hints = Convert::json2array($cmsmain->SiteTreeHints());
$classes = $hints['Root']['disallowedChildren'];
$this->assertNotContains(ErrorPage::class, $classes);
@ -382,62 +359,65 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
$this->assertEquals('important-page', $mainSubsiteImportantPage->URLSegment);
}
/**
* @param bool $withChildren
* @param int $expectedChildren
* @dataProvider duplicateToSubsiteProvider
*/
public function testDuplicateToSubsite($withChildren, $expectedChildren)
public function testCopySubsiteWithChildren()
{
/** @var SiteTree $page */
$page = $this->objFromFixture(Page::class, 'about');
/** @var Subsite $newSubsite */
$page = $this->objFromFixture('Page', 'about');
$newSubsite = $this->objFromFixture(Subsite::class, 'subsite1');
/** @var SiteTree $duplicatedPage */
$duplicatedPage = $page->duplicateToSubsite($newSubsite->ID, $withChildren);
$this->assertInstanceOf(SiteTree::class, $duplicatedPage, 'A new page is returned');
$this->assertEquals($newSubsite->ID, $duplicatedPage->SubsiteID, 'Ensure returned records are on new subsite');
$this->assertCount(1, $page->AllChildren());
$this->assertCount(
$expectedChildren,
$duplicatedPage->AllChildren(),
'Duplicated page also duplicates children'
$moved = $page->duplicateToSubsite($newSubsite->ID, true);
$this->assertEquals($moved->SubsiteID, $newSubsite->ID, 'Ensure returned records are on new subsite');
$this->assertEquals(
$moved->AllChildren()->count(),
$page->AllChildren()->count(),
'All pages are copied across'
);
}
/**
* @return array[]
*/
public function duplicateToSubsiteProvider()
public function testCopySubsiteWithoutChildren()
{
return [
[true, 1],
[false, 0],
];
$page = $this->objFromFixture('Page', 'about');
$newSubsite = $this->objFromFixture(Subsite::class, 'subsite2');
$moved = $page->duplicateToSubsite($newSubsite->ID, false);
$this->assertEquals($moved->SubsiteID, $newSubsite->ID, 'Ensure returned records are on new subsite');
$this->assertEquals($moved->AllChildren()->count(), 0, 'All pages are copied across');
}
public function testThemeResolverIsUsedForSettingThemeList()
public function testIfSubsiteThemeIsSetToThemeList()
{
$firstResolver = $this->createMock(ThemeResolver::class);
$firstResolver->expects($this->never())->method('getThemeList');
Injector::inst()->registerService($firstResolver, ThemeResolver::class);
$defaultThemes = ['default'];
SSViewer::set_themes($defaultThemes);
$subsitePage = $this->objFromFixture(Page::class, 'home');
Subsite::changeSubsite($subsitePage->SubsiteID);
$controller = ModelAsController::controller_for($subsitePage);
SiteTree::singleton()->extend('contentcontrollerInit', $controller);
$secondResolver = $this->createMock(ThemeResolver::class);
$secondResolver->expects($this->once())->method('getThemeList');
Injector::inst()->registerService($secondResolver, ThemeResolver::class);
$this->assertEquals(
SSViewer::get_themes(),
$defaultThemes,
'Themes should not be modified when Subsite has no theme defined'
);
$subsitePage = $this->objFromFixture(Page::class, 'subsite1_home');
Subsite::changeSubsite($subsitePage->SubsiteID);
$controller = ModelAsController::controller_for($subsitePage);
$pageWithTheme = $this->objFromFixture(Page::class, 'subsite1_home');
Subsite::changeSubsite($pageWithTheme->SubsiteID);
$controller = ModelAsController::controller_for($pageWithTheme);
SiteTree::singleton()->extend('contentcontrollerInit', $controller);
$subsiteTheme = $pageWithTheme->Subsite()->Theme;
$allThemes = SSViewer::get_themes();
$this->assertContains(
$subsiteTheme,
$allThemes,
'Themes should be modified when Subsite has theme defined'
);
$this->assertEquals(
$subsiteTheme,
array_shift($allThemes),
'Subsite theme should be prepeded to theme list'
);
}
public function provideAlternateAbsoluteLink()
@ -456,7 +436,7 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
/**
* @dataProvider provideAlternateAbsoluteLink
* @param string $pageFixtureName
* @param name $pageFixtureName
* @param string|null $action
* @param string $expectedAbsoluteLink
*/
@ -472,23 +452,4 @@ class SiteTreeSubsitesTest extends BaseSubsiteTest
$this->assertEquals($expectedAbsoluteLink, $result);
}
public function testURLSegmentBaseIsSetToSubsiteBaseURL()
{
// This subsite has a domain with 'one.example.org' as the primary domain
/** @var Subsite $subsite */
$subsite = $this->objFromFixture(Subsite::class, 'domaintest1');
Subsite::changeSubsite($subsite);
$page = new SiteTree();
$page->SubsiteID = $subsite->ID;
$page->write();
$fields = $page->getCMSFields();
/** @var SiteTreeURLSegmentField $urlSegmentField */
$urlSegmentField = $fields->dataFieldByName('URLSegment');
$this->assertInstanceOf(SiteTreeURLSegmentField::class, $urlSegmentField);
$this->assertSame('http://one.example.org/', $urlSegmentField->getURLPrefix());
}
}

View File

@ -14,7 +14,7 @@ class SubsiteAdminFunctionalTest extends FunctionalTest
protected $autoFollowRedirection = false;
protected function setUp(): void
protected function setUp()
{
parent::setUp();
// Ensure all pages are published
@ -48,18 +48,14 @@ class SubsiteAdminFunctionalTest extends FunctionalTest
$this->logOut();
$response = $this->getAndFollowAll('admin/pages/?SubsiteID=0');
$this->assertStringContainsString('Security/login', $this->mainSession->lastUrl(), 'Admin is disallowed');
$this->assertContains('Security/login', $this->mainSession->lastUrl(), 'Admin is disallowed');
$subsite1 = $this->objFromFixture(Subsite::class, 'subsite1');
$response = $this->getAndFollowAll("admin/pages/?SubsiteID={$subsite1->ID}");
$this->assertStringContainsString('Security/login', $this->mainSession->lastUrl(), 'Admin is disallowed');
$this->assertContains('Security/login', $this->mainSession->lastUrl(), 'Admin is disallowed');
$response = $this->getAndFollowAll('admin/subsite_xhr');
$this->assertStringContainsString(
'Security/login',
$this->mainSession->lastUrl(),
'SubsiteXHRController is disallowed'
);
$this->assertContains('Security/login', $this->mainSession->lastUrl(), 'SubsiteXHRController is disallowed');
}
/**
@ -71,21 +67,17 @@ class SubsiteAdminFunctionalTest extends FunctionalTest
$this->getAndFollowAll('admin/pages/?SubsiteID=0');
$this->assertEquals(0, $this->session()->get('SubsiteID'), 'Can access main site.');
$this->assertStringContainsString('admin/pages', $this->mainSession->lastUrl(), 'Lands on the correct section');
$this->assertContains('admin/pages', $this->mainSession->lastUrl(), 'Lands on the correct section');
$subsite1 = $this->objFromFixture(Subsite::class, 'subsite1');
$this->getAndFollowAll("admin/pages/?SubsiteID={$subsite1->ID}");
// Check the session manually, since the state is unique to the request, not this test
$this->assertEquals($subsite1->ID, $this->session()->get('SubsiteID'), 'Can access other subsite.');
$this->assertStringContainsString('admin/pages', $this->mainSession->lastUrl(), 'Lands on the correct section');
$this->assertContains('admin/pages', $this->mainSession->lastUrl(), 'Lands on the correct section');
$response = $this->getAndFollowAll('admin/subsite_xhr');
$this->assertStringNotContainsString(
'Security/login',
$this->mainSession->lastUrl(),
'SubsiteXHRController is reachable'
);
$this->assertNotContains('Security/login', $this->mainSession->lastUrl(), 'SubsiteXHRController is reachable');
}
public function testAdminIsRedirectedToObjectsSubsite()
@ -100,7 +92,7 @@ class SubsiteAdminFunctionalTest extends FunctionalTest
$response = $this->get("admin/pages/edit/show/$subsite1Home->ID");
$this->assertEquals(302, $response->getStatusCode());
$this->assertStringContainsString(
$this->assertContains(
'admin/pages/edit/show/' . $subsite1Home->ID . '?SubsiteID=' . $subsite1Home->SubsiteID,
$response->getHeader('Location')
);
@ -110,7 +102,7 @@ class SubsiteAdminFunctionalTest extends FunctionalTest
$response = $this->get("admin/pages/edit/show/$subsite1Home->ID");
$this->assertEquals(302, $response->getStatusCode());
$this->assertStringContainsString(
$this->assertContains(
'admin/pages/edit/show/' . $subsite1Home->ID . '?SubsiteID=' . $subsite1Home->SubsiteID,
$response->getHeader('Location')
);
@ -130,19 +122,15 @@ class SubsiteAdminFunctionalTest extends FunctionalTest
$this->get('admin/pages/?SubsiteID=0');
$this->assertEquals(0, $this->session()->get('SubsiteID'), 'Can access main site.');
$this->assertStringContainsString('admin/pages', $this->mainSession->lastUrl(), 'Lands on the correct section');
$this->assertContains('admin/pages', $this->mainSession->lastUrl(), 'Lands on the correct section');
$subsite1 = $this->objFromFixture(Subsite::class, 'subsite1');
$this->get("admin/pages/?SubsiteID={$subsite1->ID}");
$this->assertEquals($subsite1->ID, $this->session()->get('SubsiteID'), 'Can access other subsite.');
$this->assertStringContainsString('admin/pages', $this->mainSession->lastUrl(), 'Lands on the correct section');
$this->assertContains('admin/pages', $this->mainSession->lastUrl(), 'Lands on the correct section');
$response = $this->get('admin/subsite_xhr');
$this->assertStringNotContainsString(
'Security/login',
$this->mainSession->lastUrl(),
'SubsiteXHRController is reachable'
);
$this->assertNotContains('Security/login', $this->mainSession->lastUrl(), 'SubsiteXHRController is reachable');
}
/**
@ -158,11 +146,7 @@ class SubsiteAdminFunctionalTest extends FunctionalTest
// Check allowed URL.
$this->getAndFollowAll("admin/pages/?SubsiteID={$subsite1->ID}");
$this->assertEquals($subsite1->ID, $this->session()->get('SubsiteID'), 'Can access own subsite.');
$this->assertStringContainsString(
'admin/pages',
$this->mainSession->lastUrl(),
'Can access permitted section.'
);
$this->assertContains('admin/pages', $this->mainSession->lastUrl(), 'Can access permitted section.');
// Check forbidden section in allowed subsite.
$this->getAndFollowAll("admin/assets/?SubsiteID={$subsite1->ID}");
@ -188,14 +172,10 @@ class SubsiteAdminFunctionalTest extends FunctionalTest
$subsite1->ID,
'Is redirected to first permitted subsite.'
);
$this->assertStringNotContainsString('Security/login', $this->mainSession->lastUrl(), 'Is not denied access');
$this->assertNotContains('Security/login', $this->mainSession->lastUrl(), 'Is not denied access');
// Check the standalone XHR controller.
$response = $this->getAndFollowAll('admin/subsite_xhr');
$this->assertStringNotContainsString(
'Security/login',
$this->mainSession->lastUrl(),
'SubsiteXHRController is reachable'
);
$this->assertNotContains('Security/login', $this->mainSession->lastUrl(), 'SubsiteXHRController is reachable');
}
}

View File

@ -3,21 +3,30 @@
namespace SilverStripe\Subsites\Tests;
use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\Control\Director;
use SilverStripe\Control\Session;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\FunctionalTest;
use SilverStripe\Security\Member;
use SilverStripe\Subsites\Model\Subsite;
class SubsiteAdminTest extends FunctionalTest
class SubsiteAdminTest extends BaseSubsiteTest
{
protected static $fixture_file = 'SubsiteTest.yml';
protected function setUp(): void
protected function setUp()
{
parent::setUp();
Config::modify()->set(Subsite::class, 'write_hostmap', false);
}
protected function adminLoggedInSession()
{
return new Session([
'loggedInAs' => $this->idFromFixture(Member::class, 'admin')
]);
}
/**
* Test generation of the view
*/
@ -25,20 +34,24 @@ class SubsiteAdminTest extends FunctionalTest
{
$subsite1ID = $this->objFromFixture(Subsite::class, 'domaintest1')->ID;
$this->logInAs('admin');
// Open the admin area logged in as admin
$response1 = Director::test('admin/subsites/', null, $this->adminLoggedInSession());
// Confirm that this URL gets you the entire page, with the edit form loaded
$response = $this->get(
$response2 = Director::test(
"admin/subsites/SilverStripe-Subsites-Model-Subsite/EditForm/field/"
."SilverStripe-Subsites-Model-Subsite/item/$subsite1ID/edit"
."SilverStripe-Subsites-Model-Subsite/item/$subsite1ID/edit",
null,
$this->adminLoggedInSession()
);
$this->assertTrue(
strpos($response->getBody() ?? '', 'id="Form_ItemEditForm_ID"') !== false,
strpos($response2->getBody(), 'id="Form_ItemEditForm_ID"') !== false,
'Testing Form_ItemEditForm_ID exists'
);
$this->assertTrue(strpos($response->getBody() ?? '', '<head') !== false, 'Testing <head> exists');
$this->assertTrue(strpos($response2->getBody(), '<head') !== false, 'Testing <head> exists');
}
/**
* Test that the main-site user with ADMIN permissions can access all subsites, regardless
* of whether he is in a subsite-specific group or not.

View File

@ -17,8 +17,6 @@ class SubsiteTest extends BaseSubsiteTest
{
protected static $fixture_file = 'SubsiteTest.yml';
protected $usesTransactions = false;
/**
* Original value of $_REQUEST
*
@ -26,7 +24,7 @@ class SubsiteTest extends BaseSubsiteTest
*/
protected $origServer = [];
protected function setUp(): void
protected function setUp()
{
parent::setUp();
@ -38,7 +36,7 @@ class SubsiteTest extends BaseSubsiteTest
$this->origServer = $_SERVER;
}
protected function tearDown(): void
protected function tearDown()
{
$_SERVER = $this->origServer;
@ -193,23 +191,12 @@ class SubsiteTest extends BaseSubsiteTest
Subsite::getSubsiteIDForDomain('example.org'),
'Exact matches without strict checking when not using www prefix'
);
$this->assertEquals(
$subsite1->ID,
Subsite::getSubsiteIDForDomain('example.org:1123'),
'Exact matches without strict checking when not using www prefix and ignores port'
);
$this->assertEquals(
$subsite1->ID,
Subsite::getSubsiteIDForDomain('www.example.org'),
'Matches without strict checking when using www prefix, '
.'still matching first domain regardless of www prefix (falling back to subsite primary key ordering)'
);
$this->assertEquals(
$subsite1->ID,
Subsite::getSubsiteIDForDomain('www.example.org:9923'),
'Matches without strict checking when using www prefix, '
.'still matching first domain without prefix (falling back to primary key ordering and ignoring port)'
);
$this->assertEquals(
$subsite1->ID,
Subsite::getSubsiteIDForDomain('www.example.com'),
@ -228,11 +215,6 @@ class SubsiteTest extends BaseSubsiteTest
Subsite::getSubsiteIDForDomain('example.org'),
'Matches with strict checking when not using www prefix'
);
$this->assertEquals(
$subsite1->ID,
Subsite::getSubsiteIDForDomain('example.org:123'),
'Matches with strict checking when not using www prefix and ignores port'
);
$this->assertEquals(
$subsite2->ID, // not 1
Subsite::getSubsiteIDForDomain('www.example.org'),
@ -309,48 +291,52 @@ class SubsiteTest extends BaseSubsiteTest
/**
* Tests that Subsite and SubsiteDomain both respect http protocol correctly
*
* @param string $class Fixture class name
* @param string $identifier Fixture identifier
* @param bool $currentIsSecure Whether the current base URL should be secure
* @param string $expected The expected base URL for the subsite or subsite domain
* @dataProvider domainProtocolProvider
*/
public function testDomainProtocol($class, $identifier, $currentIsSecure, $expected)
public function testDomainProtocol()
{
/** @var Subsite|SubsiteDomain $model */
$model = $this->objFromFixture($class, $identifier);
$protocol = $currentIsSecure ? 'https' : 'http';
Config::modify()->set(Director::class, 'alternate_base_url', $protocol . '://www.mysite.com');
$this->assertSame($expected, $model->absoluteBaseURL());
}
// domaintest2 has 'protocol'
$subsite2 = $this->objFromFixture(Subsite::class, 'domaintest2');
$domain2a = $this->objFromFixture(SubsiteDomain::class, 'dt2a');
$domain2b = $this->objFromFixture(SubsiteDomain::class, 'dt2b');
public function domainProtocolProvider()
{
return [
[Subsite::class, 'domaintest2', false, 'http://two.mysite.com/'],
[SubsiteDomain::class, 'dt2a', false, 'http://two.mysite.com/'],
[SubsiteDomain::class, 'dt2b', false, 'http://subsite.mysite.com/'],
[Subsite::class, 'domaintest4', false, 'https://www.primary.com/'],
[SubsiteDomain::class, 'dt4a', false, 'https://www.primary.com/'],
[SubsiteDomain::class, 'dt4b', false, 'http://www.secondary.com/'],
[Subsite::class, 'domaintest5', false, 'http://www.tertiary.com/'],
[SubsiteDomain::class, 'dt5', false, 'http://www.tertiary.com/'],
[Subsite::class, 'domaintest2', true, 'https://two.mysite.com/'],
[SubsiteDomain::class, 'dt2a', true, 'https://two.mysite.com/'],
[SubsiteDomain::class, 'dt2b', true, 'https://subsite.mysite.com/'],
[Subsite::class, 'domaintest4', true, 'https://www.primary.com/'],
[SubsiteDomain::class, 'dt4a', true, 'https://www.primary.com/'],
[SubsiteDomain::class, 'dt4b', true, 'http://www.secondary.com/'],
[Subsite::class, 'domaintest5', true, 'http://www.tertiary.com/'],
[SubsiteDomain::class, 'dt5', true, 'http://www.tertiary.com/'],
];
// domaintest4 is 'https' (primary only)
$subsite4 = $this->objFromFixture(Subsite::class, 'domaintest4');
$domain4a = $this->objFromFixture(SubsiteDomain::class, 'dt4a');
$domain4b = $this->objFromFixture(SubsiteDomain::class, 'dt4b'); // secondary domain is http only though
// domaintest5 is 'http'
$subsite5 = $this->objFromFixture(Subsite::class, 'domaintest5');
$domain5a = $this->objFromFixture(SubsiteDomain::class, 'dt5');
// Check protocol when current protocol is http://
Config::modify()->set(Director::class, 'alternate_base_url', 'http://www.mysite.com');
$this->assertEquals('http://two.mysite.com/', $subsite2->absoluteBaseURL());
$this->assertEquals('http://two.mysite.com/', $domain2a->absoluteBaseURL());
$this->assertEquals('http://subsite.mysite.com/', $domain2b->absoluteBaseURL());
$this->assertEquals('https://www.primary.com/', $subsite4->absoluteBaseURL());
$this->assertEquals('https://www.primary.com/', $domain4a->absoluteBaseURL());
$this->assertEquals('http://www.secondary.com/', $domain4b->absoluteBaseURL());
$this->assertEquals('http://www.tertiary.com/', $subsite5->absoluteBaseURL());
$this->assertEquals('http://www.tertiary.com/', $domain5a->absoluteBaseURL());
// Check protocol when current protocol is https://
Config::modify()->set(Director::class, 'alternate_base_url', 'https://www.mysite.com');
$this->assertEquals('https://two.mysite.com/', $subsite2->absoluteBaseURL());
$this->assertEquals('https://two.mysite.com/', $domain2a->absoluteBaseURL());
$this->assertEquals('https://subsite.mysite.com/', $domain2b->absoluteBaseURL());
$this->assertEquals('https://www.primary.com/', $subsite4->absoluteBaseURL());
$this->assertEquals('https://www.primary.com/', $domain4a->absoluteBaseURL());
$this->assertEquals('http://www.secondary.com/', $domain4b->absoluteBaseURL());
$this->assertEquals('http://www.tertiary.com/', $subsite5->absoluteBaseURL());
$this->assertEquals('http://www.tertiary.com/', $domain5a->absoluteBaseURL());
}
public function testAllSites()
{
$subsites = Subsite::all_sites();
$this->assertListEquals([
$this->assertDOSEquals([
['Title' => 'Main site'],
['Title' => 'Template'],
['Title' => 'Subsite1 Template'],
@ -360,8 +346,7 @@ class SubsiteTest extends BaseSubsiteTest
['Title' => 'Test 3'],
['Title' => 'Test Non-SSL'],
['Title' => 'Test SSL'],
['Title' => 'Test Vagrant VM on port 8080'],
['Title' => 'Locale subsite'],
['Title' => 'Test Vagrant VM on port 8080']
], $subsites, 'Lists all subsites');
}
@ -370,7 +355,7 @@ class SubsiteTest extends BaseSubsiteTest
$member = $this->objFromFixture(Member::class, 'subsite1member');
$subsites = Subsite::all_accessible_sites(true, 'Main site', $member);
$this->assertListEquals([
$this->assertDOSEquals([
['Title' => 'Subsite1 Template']
], $subsites, 'Lists member-accessible sites.');
}
@ -399,7 +384,6 @@ class SubsiteTest extends BaseSubsiteTest
$adminSiteTitles = $adminSites->column('Title');
sort($adminSiteTitles);
$this->assertEquals([
'Locale subsite',
'Subsite1 Template',
'Subsite2 Template',
'Template',
@ -409,7 +393,7 @@ class SubsiteTest extends BaseSubsiteTest
'Test Non-SSL',
'Test SSL',
'Test Vagrant VM on port 8080'
], array_values($adminSiteTitles ?? []));
], array_values($adminSiteTitles));
$member2Sites = Subsite::accessible_sites(
'CMS_ACCESS_CMSMain',
@ -419,7 +403,7 @@ class SubsiteTest extends BaseSubsiteTest
);
$member2SiteTitles = $member2Sites->column('Title');
sort($member2SiteTitles);
$this->assertEquals('Subsite1 Template', $member2SiteTitles[1], 'Member can get to subsite via a group role');
$this->assertEquals('Subsite1 Template', $member2SiteTitles[0], 'Member can get to subsite via a group role');
}
public function testhasMainSitePermission()
@ -471,7 +455,7 @@ class SubsiteTest extends BaseSubsiteTest
$page1 = new Page();
$page1->Title = 'MyAwesomePage';
$page1->write();
$page1->publishRecursive();
$page1->doPublish();
$this->assertEquals($page1->SubsiteID, $subsite1->ID);
// duplicate
@ -481,7 +465,7 @@ class SubsiteTest extends BaseSubsiteTest
$page2 = DataObject::get_one('Page', "\"Title\" = 'MyAwesomePage'");
$page2->Title = 'MyNewAwesomePage';
$page2->write();
$page2->publishRecursive();
$page2->doPublish();
// check change & check change has not affected subiste1
$subsite1->activate();

View File

@ -18,10 +18,6 @@ SilverStripe\Subsites\Model\Subsite:
Title: 'Test Non-SSL'
domaintestVagrant:
Title: 'Test Vagrant VM on port 8080'
subsitelocale:
Title: 'Locale subsite'
Language: 'nl_NL'
SilverStripe\Subsites\Model\SubsiteDomain:
subsite1:
SubsiteID: =>SilverStripe\Subsites\Model\Subsite.subsite1
@ -31,11 +27,6 @@ SilverStripe\Subsites\Model\SubsiteDomain:
SubsiteID: =>SilverStripe\Subsites\Model\Subsite.subsite2
Domain: subsite2.*
Protocol: automatic
subsitelocale:
SubsiteID: =>SilverStripe\Subsites\Model\Subsite.subsitelocale
Domain: subsitelocale.*
Protocol: automatic
IsPrimary: 1
dt1a:
SubsiteID: =>SilverStripe\Subsites\Model\Subsite.domaintest1
Domain: one.example.org
@ -127,10 +118,6 @@ Page:
Title: 'Contact Us (Subsite 2)'
SubsiteID: =>SilverStripe\Subsites\Model\Subsite.subsite2
URLSegment: contact-us
subsite_locale_about:
Title: 'About Locale'
SubsiteID: =>SilverStripe\Subsites\Model\Subsite.subsitelocale
URLSegment: about
SilverStripe\Security\PermissionRoleCode:
roleCode1:
@ -172,10 +159,6 @@ SilverStripe\Security\Group:
Code: subsite1_group_via_role
AccessAllSubsites: 1
Roles: =>SilverStripe\Security\PermissionRole.role1
filetest:
Title: filetest
Code: filetest
AccessAllSubsites: 1
SilverStripe\Security\Permission:
admin:
Code: ADMIN
@ -210,9 +193,6 @@ SilverStripe\Security\Permission:
adminsubsite1:
Code: ADMIN
GroupID: =>SilverStripe\Security\Group.subsite1admins
filetest:
Code: CMS_ACCESS_CMSMain
GroupID: =>SilverStripe\Security\Group.filetest
SilverStripe\Security\Member:
admin:
@ -242,26 +222,7 @@ SilverStripe\Security\Member:
subsite1member2:
Email: subsite1member2@test.com
Groups: =>SilverStripe\Security\Group.subsite1_group_via_role
filetestyes:
Email: filetestyes@test.com
Groups: =>SilverStripe\Security\Group.filetest
filetestno:
Email: filetestno@test.com
SilverStripe\SiteConfig\SiteConfig:
config:
CanCreateTopLevelType: LoggedInUsers
SilverStripe\Assets\File:
subsite1file:
Name: subsitefile.pdf
Title: subsitefile
SubsiteID: =>SilverStripe\Subsites\Model\Subsite.subsite1
CanEditType: OnlyTheseUsers
EditorGroups: =>SilverStripe\Security\Group.filetest
mainsitefile:
Name: mainsitefile.pdf
Title: mainsitefile
SubsiteID: 0
CanEditType: OnlyTheseUsers
EditorGroups: =>SilverStripe\Security\Group.filetest

View File

@ -35,13 +35,12 @@ class SubsiteXHRControllerTest extends FunctionalTest
]);
$this->assertEquals(200, $result->getStatusCode());
// SilverStripe 4.0-4.2: text/json. >=4.3: application/json
$this->assertStringContainsString('json', $result->getHeader('Content-Type'));
$this->assertEquals('text/json', $result->getHeader('Content-Type'));
$body = $result->getBody();
$this->assertStringContainsString('Main site', $body);
$this->assertStringContainsString('Test 1', $body);
$this->assertStringContainsString('Test 2', $body);
$this->assertStringContainsString('Test 3', $body);
$this->assertContains('Main site', $body);
$this->assertContains('Test 1', $body);
$this->assertContains('Test 2', $body);
$this->assertContains('Test 3', $body);
}
}

View File

@ -21,7 +21,7 @@ class SubsitesVirtualPageTest extends BaseSubsiteTest
'SubsitesVirtualPageTest.yml',
];
protected function setUp(): void
protected function setUp()
{
parent::setUp();
@ -35,15 +35,15 @@ class SubsitesVirtualPageTest extends BaseSubsiteTest
$page = $this->objFromFixture(SiteTree::class, 'page1');
$fromPath = __DIR__ . '/testscript-test-file.pdf';
$destPath = TestAssetStore::getLocalPath($file);
Filesystem::makeFolder(dirname($destPath ?? ''));
copy($fromPath ?? '', $destPath ?? '');
Filesystem::makeFolder(dirname($destPath));
copy($fromPath, $destPath);
// Hack in site link tracking after the fact
$page->Content = '<p><img src="' . $file->getURL() . '" data-fileid="' . $file->ID . '" /></p>';
$page->write();
}
protected function tearDown(): void
public function tearDown()
{
TestAssetStore::reset();
parent::tearDown();
@ -311,41 +311,4 @@ class SubsitesVirtualPageTest extends BaseSubsiteTest
Versioned::prepopulate_versionnumber_cache(SiteTree::class, 'Live', [$p->ID]);
}
}
public function testValidURLSegmentWithUniquePageAndNestedURLs()
{
SiteTree::config()->set('nested_urls', true);
$newPage = new SubsitesVirtualPage();
$newPage->Title = 'My new page';
$newPage->URLSegment = 'my-new-page';
$this->assertTrue($newPage->validURLSegment());
}
public function testValidURLSegmentWithExistingPageInSubsite()
{
$subsite1 = $this->objFromFixture(Subsite::class, 'subsite1');
Subsite::changeSubsite($subsite1->ID);
SiteTree::config()->set('nested_urls', false);
$similarContactUsPage = new SubsitesVirtualPage();
$similarContactUsPage->Title = 'Similar to Contact Us in Subsite 1';
$similarContactUsPage->URLSegment = 'contact-us';
$this->assertFalse($similarContactUsPage->validURLSegment());
}
public function testValidURLSegmentWithExistingPageInAnotherSubsite()
{
$subsite1 = $this->objFromFixture(Subsite::class, 'subsite1');
Subsite::changeSubsite($subsite1->ID);
$similarStaffPage = new SubsitesVirtualPage();
$similarStaffPage->Title = 'Similar to Staff page in main site';
$similarStaffPage->URLSegment = 'staff';
$this->assertFalse($similarStaffPage->validURLSegment());
}
}