Commit Graph

51 Commits

Author SHA1 Message Date
Dylan Wagstaff
5370bc8af6 FIX apply SubsiteID getVar to CMS Preview fetches
A preview link must be loaded on the same domain the CMS is loaded
through, which was previously causing issues when a page (identified
via URLSegment) did not exist on the subsite domain. By _always_
prepending the identifier to the preview link, this should never happen.
2018-07-04 15:21:47 +12:00
Robbie Averill
34b3fbf04d FIX Subsites VirtualPage link to edit main page and TreeDropdownField API implementations 2018-01-30 16:21:45 +13:00
Robbie Averill
95e437d828 FIX Update XHR controller hook selector and refactor getCMSFields to use scaffolding and separate tabs 2017-09-19 14:51:14 +12:00
Will Rossiter
188b02df6b FIX Page type blacklist not matching classes correctly (Fixes 297)
Tidied up the UI, removed custom javascript in favour of core Toggle field.
2017-09-12 09:50:26 +12:00
Ingo Schommer
cf534aad31 BUG Subsites selection on SubsitesVirtualPage (fixes #45 and #47) 2015-11-13 17:31:44 +13:00
Mateusz Uzdowski
66d1e68b85 Use the new loadFragment API.
Only to be merged after the
https://github.com/silverstripe/silverstripe-framework/pull/2352 is
available, and only after Subsites 1.0.0 has been released.
2014-07-09 09:29:40 +12:00
Mateusz Uzdowski
9cf7a1453f BUG Fixes to link rewriting when previewing subsites.
* JS error with href-less links.
* All forms get injected hidden fields, even though the loop attempts to
check for only the ones that submit locally.
* Also check for action-less forms.

Requires
https://github.com/silverstripe/silverstripe-framework/pull/3000 to be
merged for the Framework.
https://github.com/silverstripe-labs/silverstripe-testsession/pull/11
2014-04-02 13:39:01 +13:00
Tom Densham
33e50ffe6f FIX: Ensure that ChangeTrackerOptions doesn't get overriden
From @hafriedlander:
Hi. Sorry, I was going to have a look at this on the back of that issue @chillu raised but you beat me to it. There's a couple of edge cases that aren't obvious that come from ChangeTrackerOptions being an object, and might need an Entwine API extension to fix nicely.

Objects in entwine properties are a bit dangerous, because javascript always passes them by reference instead of cloning them. Entwine also doesn't clone them when using them as default values.

The result is that this patch will repeatedly add that selector to the result every time getChangeTrackerOptions is called, so it'll be there once the first time it's called, twice the second, etc.

The right fix at the moment would look like:
```php
$('.cms-edit-form').entwine({
  getChangeTrackerOptions: function() {
    // Figure out if we're still returning the default value
    var isDefault = (this.entwineData('ChangeTrackerOptions') === undefined);
    // Get the current options
    var opts = this._super();

    if (isDefault) {
      // If it is the default then...
      // clone the object (so we don't modify the original),
      var opts = $.extend({}, opts);
      // modify it,
      opts.ignoreFieldSelector +=', input[name=IsSubsite]';
      // then set the clone as the value on this element
      // (so next call to this method gets this same clone)
      this.setChangeTrackerOptions(opts);
    }

    return opts;
});
```
This is super ugly though, non-obvious, and could maybe be handled better in the entwine layer.

See https://github.com/silverstripe/silverstripe-subsites/pull/125
2013-12-16 09:39:42 +00:00
Mateusz Uzdowski
91cca0c64d BUG Move the SubsiteList PJAX request to a dedicated Controller.
Currently the request cannot be made if one doesn't have access to the
SubsiteAdmin section, which often happens with subsite-specific admins.
2013-10-16 13:20:54 +13:00
Naomi Guyer
37843f447e API: Subsite support for menu of cms (hide admins that don't declare support) (fixes #101 and #89 )
* Hide admins without subsite support from subsites menu
* Add subsite support to default site areas
* Enable reloading of subsites switcher dropdown when navigating the
site, and when editing subsite areas

API Fix parallel pjax menu fetching for subsites.
- thanks Mateusz!

Delint LeftAndMain_Subsites.js
2013-08-22 13:02:46 +12:00
Simon Welsh
9192954596 Use correct jQuery variable 2013-07-11 17:31:59 +12:00
Ingo Schommer
99d242f3ae Fixed JS indentation 2013-07-10 12:30:55 +02:00
Mateusz Uzdowski
0fb49ba502 Change the preview iframe to use injected SubsiteID GET/POST params.
Use the CMS domain for fetching the preview content to avoid SSL
errors and single-origin violations on the iframe.
2013-05-26 13:18:52 +12:00
Ingo Schommer
82f1d980e8 Merge remote-tracking branch 'origin/0.3'
Conflicts:
	code/SubsiteAdmin.php
	code/extensions/LeftAndMainSubsites.php
	code/extensions/SiteTreeSubsites.php
	code/model/Subsite.php
	composer.json
	javascript/SubsitesTreeDropdownField.js
	lang/en_US.php
	tests/SubsiteAdminTest.php
	tests/SubsiteTest.php
	tests/SubsiteTest.yml
	tests/SubsitesVirtualPageTest.php
2013-01-03 21:03:26 +01:00
Ingo Schommer
18bcda48d3 BUG Allow usage of SubsiteTreeDropdownField when SubsiteID is set in PHP, not through CopyContentFromID dropdown 2013-01-03 14:10:30 +01:00
UndefinedOffset
ef4d539a12 BUG: Merged patch from kmayo how ever re-added some of the removed fields since they really should appear on the Main Content tab instead of the Metadata tab.
Fixed a few missed strict errors

Applied patch from kmayo to fix issues with SubsiteAdminTest.php

Fixed issue causing the url segments of subsites created from a template to add -2 to the end

Fixed undefined method TotalItems() on datalist for the SubsiteTest

Fixed failure on SubsiteTest because DataObject::get_one() now returns boolean false instead of null when no result is found

Fixed failure on SubsitesVirtualPageTest caused by Versioned::get_one_by_stage() returning null instead of false

Fixed failure caused by the contact-us page existing on subsite 2

Merged another patch from kmayo

Force main site to be on, for some reason it gets hidden in some cases i.e. refreshing the cms while editing a page
2012-07-16 11:21:54 +12:00
UndefinedOffset
598b0253f5 BUG: Coding convention updates 2012-07-16 11:21:30 +12:00
Ed
2ef72b374c BUG: Modifying the module to work with SS 3.0
Replaced deprecated DataObjectDecorator with DataExtension

Fixed hard crashes in the cms

Updated to support new LeftAndMain template structure

Made the subsites model admin functional

Moved the LeftAndMain_Menu template up a directory so it overrides the core

Fixed some errors caused by changes to the framework

Re-organized the code folder

Fixed permission issue causing to default to first subsite regardless if it is the default or not

Fixed crashes on the subsite virtual page when creating/editing

Removed toDropdownMap() calls replacing with map()

Fixed the URLSegment field on subsites

Fixed error when detecting subsite for a domain

Improved styles on the subsite dropdown

Updated LeftAndMain_Subsites.js to work with jQuery entwine

Started porting the SubsitesTreeDropdownField.js to use jQuery entwine and work with the new TreeDropdownField.js

Fixed issue causing crash when viewing a page who is linked to by a subsite virtual page

Removed unused methods on SubsitesTreeDropdownField.js

Re-added classes that were moved

Fixed hard crash after saving caused by the many_many definition on SiteTreeSubsites

Replaced deprecated DataObjectSet creation with ArrayList

Compatibility fixes with SS 3.0 beta 2

Fixed crash in cms caused by no parameter being passed to the SubsiteReportWrapper constructor

Proper fix for report wrapper

Removed table list field in favor of a basic grid field

Fixed updateCMSFields() for file subsites

Migrated translations to yml

Fixed issue causing the current page to not get cleared when changing subsites in the cms

Fixed virtual page icon

Fixed language files issue
2012-07-16 11:18:38 +12:00
Ingo Schommer
b8015edf75 MINOR Fixing PageTypeBlacklistToggle link behaviour 2011-09-22 18:18:49 +02:00
Ingo Schommer
069c5ada3c BUGFIX Removed ajaxified switch of subsite in the CMS, as it would need to deal with too much UI state like refreshing the "insert link" panel. Refresh the entire window instead. 2011-09-05 17:55:00 +02:00
Ingo Schommer
d956d31ed4 MINOR Removed non-functional "add subsite" link behaviour from LeftAndMain_Subsites.js (was removed way back in 2007, with 8f6db47888) 2011-09-05 17:55:00 +02:00
Ingo Schommer
17dde8ff58 FEATURE Blacklisting of page types by subsite through Subsite->PageTypeBlacklist (AIR-20) 2011-08-30 18:59:21 +02:00
Ingo Schommer
d36a6a3bde MINOR Removed unnecessary console.*() from subsites javascript files 2010-03-28 20:08:10 +00:00
Luke Hudson
9a4d52f754 BUGFIX: Re-enable javascript onchange for subsites selector 2010-03-02 23:28:57 +00:00
Tom Rix
ee11811d02 BUGFIX: Fixed bug with ajax-expansion of subsite tree dropdown. (from r97514) 2010-03-01 22:34:12 +00:00
Tom Rix
7d9b6fa9bf MINOR bring back in line with the TreeDropdownField JS API (from r96462) 2010-03-01 22:34:03 +00:00
Tom Rix
5e5dbff1d4 BUGFIX: Fixed ajax fetching of SubsiteTreeDropdownField (from r90007) (from r96325) 2010-03-01 22:28:36 +00:00
Tom Rix
e7add11e4e BUGFIX: Improved reliability of SubsiteTreeDropdownField (by getvar length shorter) (from r89840) (from r96318) 2010-03-01 22:21:55 +00:00
Tom Rix
60fa55d54f BUGFIX: Fixed ajax refresh of SubsitesTreeDropdownField (see http://mingle.silverstripe.com/projects/air_nz_cms_enhancements/cards/205) (from r88936) (from r96293) 2010-03-01 22:06:15 +00:00
Tom Rix
39421cbb73 BUGFIX: Improve stability of page dropdown on SubsitesVirtualPages (from r86097) (from r96275) 2010-03-01 21:56:55 +00:00
Tom Rix
c45fee8783 MINOR apply a sitetree filter when changing subsites (from r87369) 2010-03-01 21:50:03 +00:00
Tom Rix
10a81655c7 MINOR fixed JS bug around subsites tree dropdown
MINOR improved test coverage considerably (from r86478)
2010-03-01 21:47:31 +00:00
Tom Rix
200a4a31f0 BUGFIX: Fixed bug switching between subsites in security area. (from r94564) 2010-03-01 21:41:17 +00:00
Tom Rix
813087e9fd MINOR update formfield when the subsite is changed (from r91016) 2010-03-01 21:40:48 +00:00
Tom Rix
df1eb95a2a BUGFIX: Fixed ajax fetching of SubsiteTreeDropdownField (from r90007) 2010-03-01 21:39:14 +00:00
Tom Rix
0ba7ee6b17 BUGFIX: Improved reliability of SubsiteTreeDropdownField (by getvar length shorter) (from r89840) 2010-03-01 21:38:32 +00:00
Tom Rix
60cc9f9650 ENHANCEMENT: Groups can now be associated to multiple subsites. (from r89791) 2010-03-01 21:37:56 +00:00
Tom Rix
2012a2b879 BUGFIX: Fixed ajax refresh of SubsitesTreeDropdownField (see http://mingle.silverstripe.com/projects/air_nz_cms_enhancements/cards/205) (from r88936) 2010-03-01 21:26:44 +00:00
Tom Rix
f7dba96157 MERGE subsite treedropdown fix from trunk (from r86329) 2010-03-01 03:05:13 +00:00
Tom Rix
9e63443b97 BUGFIX: Improve stability of page dropdown on SubsitesVirtualPages (from r86097) 2010-03-01 03:04:29 +00:00
Tom Rix
4801838dd0 MINOR JS bug (missing ')')
MINOR check that SiteTree exists before trying to write to it (from r82342)
2010-03-01 02:55:38 +00:00
Tom Rix
b40af7d2e3 BUGFIX missing ( (from r82327) 2010-03-01 02:55:09 +00:00
Saophalkun Ponlu
37f29d46a3 BUFIX: SubsiteTreeDropdownField's ajaxExpansion for tree item didn't work. Kudo to Hamish 2009-08-13 05:23:16 +00:00
Saophalkun Ponlu
5406ab5b60 BUGFIX: Fixed SubsitesVirtualPage operation for the main site, and fixed selection of currently selected value. 2009-07-30 02:11:02 +00:00
Michael Andrewartha
0531c868e1 BUGFIX call SubsiteID rather then ID so Subsites doesn't call a page with same ID incorrectly 2009-05-06 02:41:16 +00:00
Sam Minnee
3993cf6fe4 BUGFIX: Improved support for subsites trunk with 2.2.2
ENHANCEMENT: Got 'Is Default Site' checkbox actually working; if used the main site option is removed from the sites list when editing content.
API CHANGE: Added $subsite->absoluteBaseURL(), as a subsite-specific equivaent of Director::absoluteBaseURL()
2008-12-04 21:36:06 +00:00
Ingo Schommer
e17ecfbdee FEATURE Support for VirtualPage-style linkage between subsites with new SubsiteVirtualPage class
ENHANCEMENT Allowing to select a subsite explicitly through admin-URLs, e.g. /admin/show/22/?SubsiteID=2
2008-12-02 03:50:06 +00:00
Hayden Smith
3307693ad6 2007-10-11 22:15:40 +00:00
Sam Minnee
a140e94000 Added SiteTreeHandlers.controller_url so that subsites module can work 2007-09-04 04:12:30 +00:00
Sam Minnee
1b824bf7ba Added Group subsite behaviour and associated changes to the security model 2007-08-31 00:29:25 +00:00