Merge branch '3.0' of github.com:silverstripe/silverstripe-cms into 3.0

This commit is contained in:
Sean Harvey 2012-09-27 10:49:03 +12:00
commit cb8c10a473
4 changed files with 16 additions and 14 deletions

View File

@ -1764,9 +1764,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$parentPage = $linkedPage->Parent;
if($parentPage) {
if($parentPage->ID) {
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">{$parentPage->Title}</a>";
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/pages/edit/show/$linkedPage->ID\">{$parentPage->Title}</a>";
} else {
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/show/$linkedPage->ID\">" .
$parentPageLinks[] = "<a class=\"cmsEditlink\" href=\"admin/pages/edit/show/$linkedPage->ID\">" .
_t('SiteTree.TOPLEVEL', 'Site Content (Top Level)') .
"</a>";
}
@ -1814,7 +1814,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
);
$dependentTable->getConfig()->getComponentByType('GridFieldDataColumns')
->setFieldFormatting(array(
'Title' => '<a href=\"admin/show/$ID\">$Title</a>',
'Title' => '<a href=\"admin/pages/edit/show/$ID\">$Title</a>',
'AbsoluteLink' => '<a href=\"$value\">$value</a>',
));
}
@ -2754,4 +2754,4 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
self::$cache_permissions = array();
}
}
}

View File

@ -1,4 +1,4 @@
public function windowName(suffix) {
function windowName(suffix) {
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
return base + suffix;
}

View File

@ -102,7 +102,7 @@ in the other stage:<br />
)
);
$label = sprintf(
'<a href="admin/show/%d">%s</a> <small>(#%d, Last Modified Date: %s, Last Modifier: %s, %s)</small>',
'<a href="admin/pages/edit/show/%d">%s</a> <small>(#%d, Last Modified Date: %s, Last Modifier: %s, %s)</small>',
$orphan->ID,
$orphan->Title,
$orphan->ID,

View File

@ -53,16 +53,18 @@ class SiteTreeHtmlEditorFieldTest extends FunctionalTest {
$editor->setValue('<img src="assets/example.jpg" />');
$editor->saveInto($sitetree);
$xml = new SimpleXMLElement($sitetree->Content);
$this->assertNotNull($xml['alt'], 'Alt tags are added by default.');
$this->assertNotNull($xml['title'], 'Title tags are added by default.');
$parser = new CSSContentParser($sitetree->Content);
$xml = $parser->getByXpath('//img');
$this->assertEquals('', $xml[0]['alt'], 'Alt tags are added by default.');
$this->assertEquals('', $xml[0]['title'], 'Title tags are added by default.');
$editor->setValue('<img src="assets/example.jpg" alt="foo" title="bar" />');
$editor->saveInto($sitetree);
$editor->setValue('<img src="assets/example.jpg" alt="foo" title="bar" />');
$editor->saveInto($sitetree);
$xml = new SimpleXMLElement($sitetree->Content);
$this->assertNotNull('foo', $xml['alt'], 'Alt tags are preserved.');
$this->assertNotNull('bar', $xml['title'], 'Title tags are preserved.');
$parser = new CSSContentParser($sitetree->Content);
$xml = $parser->getByXpath('//img');
$this->assertEquals('foo', $xml[0]['alt'], 'Alt tags are preserved.');
$this->assertEquals('bar', $xml[0]['title'], 'Title tags are preserved.');
}
public function testImageTracking() {