Merge remote-tracking branch 'origin/master' into translation-staging

This commit is contained in:
Ingo Schommer 2012-08-27 09:27:27 +02:00
commit 0dbbe04a4b
8 changed files with 32 additions and 22 deletions

View File

@ -206,7 +206,7 @@ JS
'<a class="ss-ui-button ss-ui-action ui-button-text-icon-primary ss-ui-button-ajax" data-icon="arrow-circle-double" title="%s" href="%s">%s</a>',
_t('AssetAdmin.FILESYSTEMSYNCTITLE', 'Update the CMS database entries of files on the filesystem. Useful when new files have been uploaded outside of the CMS, e.g. through FTP.'),
$this->Link('doSync'),
_t('FILESYSTEMSYNC','Sync files')
_t('AssetAdmin.FILESYSTEMSYNC','Sync files')
)
);
} else {

View File

@ -202,9 +202,10 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
return $link;
}
function LinkPageAdd() {
function LinkPageAdd($extraArguments = null) {
$link = singleton("CMSPageAddController")->Link();
$this->extend('updateLinkPageAdd', $link);
if($extraArguments) $link = Controller::join_links ($link, $extraArguments);
return $link;
}
@ -467,8 +468,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$addAction = $instance->i18n_singular_name();
// Get description
$description = _t($class . '.DESCRIPTION');
// Get description (convert 'Page' to 'SiteTree' for correct localization lookups)
$description = _t((($class == 'Page') ? 'SiteTree' : $class) . '.DESCRIPTION');
if(!$description) {
$description = $instance->uninherited('description');
@ -483,7 +484,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
'AddAction' => $addAction,
'Description' => $description,
// TODO Sprite support
'IconURL' => $instance->stat('icon')
'IconURL' => $instance->stat('icon'),
'Title' => singleton($class)->i18n_singular_name(),
)));
}
@ -719,9 +721,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$num = $item ? $item->numChildren() : null;
if($num) {
return sprintf(
'<a class="cms-panel-link list-children-link" data-pjax-target="ListViewForm,Breadcrumbs" href="%s?ParentID=%d&view=list">%s</a>',
$controller->Link(),
$item->ID,
'<a class="cms-panel-link list-children-link" data-pjax-target="ListViewForm,Breadcrumbs" href="%s">%s</a>',
Controller::join_links($controller->Link(), "?ParentID={$item->ID}&view=list"),
$num
);
}
@ -845,8 +846,11 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$id = $id . $suffix;
}
$newItem->Title = _t('CMSMain.NEW',"New ",'"New " followed by a className').$className;
$newItem->URLSegment = "new-" . strtolower($className);
$newItem->Title = _t(
'CMSMain.NEWPAGE',
"New {pagetype}",'followed by a page type title',
array('pagetype' => singleton($className)->i18n_singular_name())
);
$newItem->ClassName = $className;
$newItem->ParentID = $parentID;

View File

@ -21,7 +21,7 @@ class CMSPageAddController extends CMSPageEditController {
$pageTypes = array();
foreach($this->PageTypes() as $type) {
$html = sprintf('<span class="page-icon class-%s"></span><strong class="title">%s</strong><span class="description">%s</span>',
$type->getField('ClassName'),
$type->getField('Title'),
$type->getField('AddAction'),
$type->getField('Description')
);

View File

@ -163,7 +163,7 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider {
$gridField = new GridField('Reports',false, $this->Reports(), $gridFieldConfig);
$columns = $gridField->getConfig()->getComponentByType('GridFieldDataColumns');
$columns->setDisplayFields(array(
'title' => 'Title',
'title' => _t('ReportAdmin.ReportTitle', 'Title'),
));
$columns->setFieldFormatting(array(
'title' => '<a href=\"$Link\" class=\"cms-panel-link\">$value</a>'

View File

@ -2699,7 +2699,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* @return String
*/
function i18n_singular_name() {
return _t($this->class.'.SINGULARNAME', $this->singular_name());
// Convert 'Page' to 'SiteTree' for correct localization lookups
$class = ($this->class == 'Page') ? 'SiteTree' : $this->class;
return _t($class.'.SINGULARNAME', $this->singular_name());
}
/**
@ -2709,14 +2711,17 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
function provideI18nEntities() {
$entities = parent::provideI18nEntities();
if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = FRAMEWORK_DIR;
if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = FRAMEWORK_DIR;
if(isset($entities['Page.SINGULARNAME'])) $entities['Page.SINGULARNAME'][3] = CMS_DIR;
if(isset($entities['Page.PLURALNAME'])) $entities['Page.PLURALNAME'][3] = CMS_DIR;
$entities[$this->class . '.DESCRIPTION'] = array(
$this->stat('description'),
'Description of the page type (shown in the "add page" dialog)'
);
$entities['SiteTree.SINGULARNAME'][0] = 'Page';
$entities['SiteTree.PLURALNAME'][0] = 'Pages';
return $entities;
}

View File

@ -13,6 +13,7 @@ en:
CurrentFolderOnly: 'Limit to current folder?'
DetailsView: Details
FILES: Files
FILESYSTEMSYNC: 'Sync files'
FILESYSTEMSYNCTITLE: 'Update the CMS database entries of files on the filesystem. Useful when new files have been uploaded outside of the CMS, e.g. through FTP.'
FROMTHEINTERNET: 'From the internet'
FROMYOURCOMPUTER: 'From your computer'
@ -82,7 +83,7 @@ en:
EMAIL: Email
EditTree: 'Edit Tree'
ListFiltered: 'Filtered list.'
NEW: 'New '
NEWPAGE: 'New {pagetype}'
PAGENOTEXISTS: 'This page doesn''t exist'
PAGES: Pages
PAGETYPEANYOPT: Any
@ -236,6 +237,8 @@ en:
REDIRECTTOPAGE: 'A page on your website'
SINGULARNAME: 'Redirector Page'
YOURPAGE: 'Page on your website'
ReportAdmin:
ReportTitle: Title
ReportAdminForm:
FILTERBY: 'Filter by'
SearchForm:
@ -333,7 +336,7 @@ en:
PARENTTYPE_SUBPAGE: 'Sub-page underneath a parent page'
PERMISSION_GRANTACCESS_DESCRIPTION: 'Manage access rights for content'
PERMISSION_GRANTACCESS_HELP: 'Allow setting of page-specific access restrictions in the "Pages" section.'
PLURALNAME: 'Site Tres'
PLURALNAME: Pages
PageTypNotAllowedOnRoot: 'Page type "{type}" is not allowed on the root level'
PageTypeNotAllowed: 'Page type "{type}" not allowed as child of this parent page'
REMOVEDFROMDRAFTHELP: 'Page is published, but has been deleted from draft'
@ -343,7 +346,7 @@ en:
REORGANISE_HELP: 'Rearrange pages in the site tree through drag&drop.'
SHOWINMENUS: 'Show in menus?'
SHOWINSEARCH: 'Show in search?'
SINGULARNAME: 'Site Tree'
SINGULARNAME: Page
TABBEHAVIOUR: Behavior
TABCONTENT: 'Main Content'
TABDEPENDENT: 'Dependent pages'
@ -394,8 +397,6 @@ en:
PLURALNAME: 'Virtual Pags'
PageTypNotAllowedOnRoot: 'Original page type "{type}" is not allowed on the root level for this virtual page'
SINGULARNAME: 'Virtual Page'
cms:
FILESYSTEMSYNC: 'Sync files'
CMSFileAddController:
MENUTITLE: Files
CMSPageEditController:

View File

@ -22,7 +22,7 @@ $ExtraTreeTools
</div>
<% end_if %>
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd}AddForm/?action_doAdd=1&amp;ParentID=%s&amp;PageType=%s&amp;SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-hints="$SiteTreeHints">
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd('AddForm/?action_doAdd=1')}&amp;ParentID=%s&amp;PageType=%s&amp;SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-hints="$SiteTreeHints">
$SiteTreeAsUL
</div>
</div>

View File

@ -1,5 +1,5 @@
<div class="cms-actions-row">
<a class="cms-page-add-button ss-ui-button ss-ui-action-constructive" data-icon="add" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd}?ParentID=%s"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
<a class="cms-page-add-button ss-ui-button ss-ui-action-constructive" data-icon="add" href="$LinkPageAdd" data-url-addpage="{$LinkPageAdd('?ParentID=%s')}"><% _t('CMSMain.AddNewButton', 'Add new') %></a>
</div>
<div class="cms-content-batchactions">