mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge 3 into master
# Conflicts: # code/controllers/CMSPageAddController.php # code/model/ErrorPage.php # composer.json # css/screen.css # tests/behat/features/insert-a-link.feature
This commit is contained in:
commit
d7d6fd8758
@ -36,6 +36,7 @@ matrix:
|
||||
before_script:
|
||||
- composer self-update || true
|
||||
- phpenv rehash
|
||||
- phpenv config-rm xdebug.ini
|
||||
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
|
||||
- "if [ \"$BEHAT_TEST\" = \"\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss; fi"
|
||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require 'silverstripe/behat-extension:~2.0-dev'; fi"
|
||||
|
20
README.md
20
README.md
@ -27,23 +27,3 @@ If you would like to make changes to the SilverStripe core codebase, we have an
|
||||
* [Bugtracker: Installer](https://github.com/silverstripe/silverstripe-installer/issues)
|
||||
* [Forums](http://silverstripe.org/forums)
|
||||
* [Developer Mailinglist](https://groups.google.com/forum/#!forum/silverstripe-dev)
|
||||
|
||||
## License ##
|
||||
|
||||
Copyright (c) 2006-2014, SilverStripe Limited - www.silverstripe.com
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of SilverStripe nor the names of its contributors may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
|
@ -48,7 +48,7 @@
|
||||
text-shadow: white 0 1px 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Root_TreeView {
|
||||
.cms-tree ul .class-Folder a span.text span.jstree-foldericon {
|
||||
@ -71,16 +71,6 @@
|
||||
padding:0.7em;
|
||||
}
|
||||
}
|
||||
tr[data-class=Folder] {
|
||||
td.col-StripThumbnail {
|
||||
background: transparent url(../images/treeicons/blue-folder-horizontal.png) no-repeat center;
|
||||
}
|
||||
}
|
||||
tr[data-class=File] {
|
||||
td.col-StripThumbnail {
|
||||
background: transparent url(../images/treeicons/blue-document.png) no-repeat center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,9 +160,7 @@ class CMSPageAddController extends CMSPageEditController {
|
||||
}
|
||||
|
||||
$record = $this->getNewItem("new-$className-$parentID".$suffix, false);
|
||||
if(class_exists('Translatable') && $record->hasExtension('Translatable') && isset($data['Locale'])) {
|
||||
$record->Locale = $data['Locale'];
|
||||
}
|
||||
$this->extend('updateDoAdd', $record, $form);
|
||||
|
||||
try {
|
||||
$record->write();
|
||||
|
@ -133,4 +133,27 @@ class SiteTreeURLSegmentField extends TextField {
|
||||
return Controller::join_links($this->getURLPrefix(), $this->Value(), $this->getURLSuffix());
|
||||
}
|
||||
|
||||
public function performReadonlyTransformation() {
|
||||
$newInst = parent::performReadonlyTransformation();
|
||||
$newInst->helpText = $this->helpText;
|
||||
$newInst->urlPrefix = $this->urlPrefix;
|
||||
$newInst->urlSuffix = $this->urlSuffix;
|
||||
$newInst->defaultUrl = $this->defaultUrl;
|
||||
return $newInst;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Readonly version of a site tree URL segment field
|
||||
*
|
||||
* @package forms
|
||||
* @subpackage fields-basic
|
||||
*/
|
||||
class SiteTreeURLSegmentField_Readonly extends SiteTreeURLSegmentField {
|
||||
protected $readonly = true;
|
||||
|
||||
public function performReadonlyTransformation() {
|
||||
return clone $this;
|
||||
}
|
||||
}
|
||||
|
@ -1434,7 +1434,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
$fieldsIgnoredByVersioning = array('HasBrokenLink', 'Status', 'HasBrokenFile', 'ToDo', 'VersionID', 'SaveCount');
|
||||
$changedFields = array_keys($this->getChangedFields(true, 2));
|
||||
|
||||
// This more rigorous check is inline with the test that write() does to dedcide whether or not to write to the
|
||||
// This more rigorous check is inline with the test that write() does to decide whether or not to write to the
|
||||
// DB. We use that to avoid cluttering the system with a migrateVersion() call that doesn't get used
|
||||
$oneChangedFields = array_keys($this->getChangedFields(true, 1));
|
||||
|
||||
|
@ -306,12 +306,13 @@ class SiteTreeLinkTracking_Parser {
|
||||
// Local anchor.
|
||||
$matches = array();
|
||||
if(preg_match('/^#(.*)/i', $href, $matches)) {
|
||||
$anchor = preg_quote($matches[1], '#');
|
||||
$results[] = array(
|
||||
'Type' => 'localanchor',
|
||||
'Target' => null,
|
||||
'Anchor' => $matches[1],
|
||||
'DOMReference' => $link,
|
||||
'Broken' => !preg_match("#(name|id)=\"{$matches[1]}\"#", $htmlValue->getContent())
|
||||
'Broken' => !preg_match("#(name|id)=\"{$anchor}\"#", $htmlValue->getContent())
|
||||
);
|
||||
|
||||
continue;
|
||||
|
@ -112,7 +112,7 @@ class BrokenLinksReport extends SS_Report {
|
||||
$stageLink = $item->AbsoluteLink();
|
||||
return sprintf('%s <a href="%s">%s</a>',
|
||||
$stageLink,
|
||||
$liveLink ? $liveLink : $stageLink . '?stage=Stage',
|
||||
$liveLink ? $liveLink : Controller::join_links($stageLink, '?stage=Stage'),
|
||||
$liveLink ? '(live)' : '(draft)'
|
||||
);
|
||||
}
|
||||
@ -128,8 +128,8 @@ class BrokenLinksReport extends SS_Report {
|
||||
'Draft' => _t('BrokenLinksReport.CheckSiteDropdownDraft', 'Draft Site')
|
||||
)),
|
||||
new DropdownField(
|
||||
'Reason',
|
||||
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
|
||||
'Reason',
|
||||
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
|
||||
array(
|
||||
'' => _t('BrokenLinksReport.Any', 'Any'),
|
||||
'BROKENFILE' => _t('BrokenLinksReport.ReasonDropdownBROKENFILE', 'Broken file'),
|
||||
|
@ -19,7 +19,7 @@
|
||||
"php": ">=5.5.0",
|
||||
"composer/installers": "*",
|
||||
"silverstripe/framework": "^4.0",
|
||||
"silverstripe/reports": "*",
|
||||
"silverstripe/reports": "^4.0",
|
||||
"silverstripe/siteconfig": "^4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
27
license.md
Normal file
27
license.md
Normal file
@ -0,0 +1,27 @@
|
||||
Copyright (c) 2016, SilverStripe Ltd.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of silverstripe-cms nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@ -2,9 +2,11 @@
|
||||
<a class="preview" href="$URL" target="_blank">
|
||||
$URL
|
||||
</a>
|
||||
<button type="button" class="ss-ui-button ss-ui-button-small edit">
|
||||
<% _t('URLSegmentField.Edit', 'Edit') %>
|
||||
</button>
|
||||
<% if not $IsReadonly %>
|
||||
<button type="button" class="ss-ui-button ss-ui-button-small edit">
|
||||
<% _t('URLSegmentField.Edit', 'Edit') %>
|
||||
</button>
|
||||
<% end_if %>
|
||||
</div>
|
||||
<div class="edit-holder">
|
||||
<input $AttributesHTML />
|
||||
|
@ -20,6 +20,7 @@ class SiteTreeLinkTrackingTest extends SapphireTest {
|
||||
|
||||
$this->assertFalse($this->isBroken('<a name="anchor">anchor</a>'));
|
||||
$this->assertFalse($this->isBroken('<a id="anchor">anchor</a>'));
|
||||
$this->assertTrue($this->isBroken('<a href="##anchor">anchor</a>'));
|
||||
|
||||
$page = new Page();
|
||||
$page->Content = '<a name="yes-name-anchor">name</a><a id="yes-id-anchor">id</a>';
|
||||
|
Loading…
Reference in New Issue
Block a user