Refactored non-standard extension of cmsfields (should use updateCMSFields instead). originally committed in r40265 and r36951

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44568 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-11-10 05:19:24 +00:00
parent 97a44ce0be
commit c43712bd82
2 changed files with 7 additions and 31 deletions

View File

@ -871,27 +871,6 @@ class SiteTree extends DataObject {
}
}
//------------------------------------------------------------------------------------//
/**
* Holds callback functions to be called when getCMSFields() is called
*
* @var array
*/
static $cms_additions = array();
/**
* Allows modules to extend the cms editing form for all pages in the site
*
* @param mixed $function the name of your function, either as a string,
* or in the form array('class','function)
*/
static function ExtendCMS($function)
{
self::$cms_additions[] = $function;
}
/**
* The default value of the priority field depends on the depth of the page in
* the site tree, so it must be calculated dynamically.
@ -1042,9 +1021,12 @@ class SiteTree extends DataObject {
new LiteralField(
"",
"<p>" .
_t(
'SiteTree.METANOTEPRIORITY',
"Manually specify a Priority for this page"
sprintf(
_t(
'SiteTree.METANOTEPRIORITY',
"Manually specify a Google Sitemaps priority for this page (%s)"
),
'<a href="https://www.google.com/webmasters/tools/docs/en/protocol.html#prioritydef">?</a>'
) .
"</p>"
),
@ -1117,11 +1099,6 @@ class SiteTree extends DataObject {
$tabAccess->setTitle(_t('SiteTree.TABACCESS', "Access"));
$tabBacklinks->setTitle(_t('SiteTree.TABBACKLINKS', "BackLinks"));
foreach(self::$cms_additions as $extension)
{
$fields = call_user_func($extension,$fields);
}
$this->extend('updateCMSFields', $fields);
return $fields;

View File

@ -62,8 +62,7 @@ $lang['en_US']['SiteTree']['METADESC'] = 'Description';
$lang['en_US']['SiteTree']['METAKEYWORDS'] = 'Keywords';
$lang['en_US']['SiteTree']['METAADVANCEDHEADER'] = 'Advanced Options...';
$lang['en_US']['SiteTree']['METAEXTRA'] = 'Custom Meta Tags';
$lang['en_US']['SiteTree']['METANOTEPRIORITY'] = 'Manually specify a Priority for this page:
(valid values are from 0 to 1, a zero will remove this page from the index)';
$lang['en_US']['SiteTree']['METANOTEPRIORITY'] = 'Manually specify a Google Sitemaps priority for this page (%s)';
$lang['en_US']['SiteTree']['METAPAGEPRIO'] = 'Page Priority';
$lang['en_US']['SiteTree']['PAGETYPE'] = array(
'Page type',