Merge remote-tracking branch 'origin/3.1'

This commit is contained in:
Ingo Schommer 2013-10-10 12:11:50 +02:00
commit 8727d1b1eb
15 changed files with 220 additions and 34 deletions

View File

@ -28,9 +28,16 @@ class CMSForm extends Form {
protected function getValidationErrorResponse() { protected function getValidationErrorResponse() {
$request = $this->getRequest(); $request = $this->getRequest();
$negotiator = $this->getResponseNegotiator(); $negotiator = $this->getResponseNegotiator();
if($request->isAjax() && $negotiator) { if($request->isAjax() && $negotiator) {
$negotiator->setResponse(new SS_HTTPResponse($this)); $this->setupFormErrors();
return $negotiator->respond($request); $result = $this->forTemplate();
return $negotiator->respond($request, array(
'CurrentForm' => function() use($result) {
return $result;
}
));
} else { } else {
return parent::getValidationErrorResponse(); return parent::getValidationErrorResponse();
} }

View File

@ -325,11 +325,11 @@ class LeftAndMain extends Controller implements PermissionProvider {
FRAMEWORK_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.jquery.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/chosen/chosen/chosen.jquery.js',
FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-hoverIntent/jquery.hoverIntent.js', FRAMEWORK_ADMIN_DIR . '/thirdparty/jquery-hoverIntent/jquery.hoverIntent.js',
FRAMEWORK_ADMIN_DIR . '/javascript/jquery-changetracker/lib/jquery.changetracker.js', FRAMEWORK_ADMIN_DIR . '/javascript/jquery-changetracker/lib/jquery.changetracker.js',
FRAMEWORK_DIR . '/javascript/i18n.js',
FRAMEWORK_DIR . '/javascript/TreeDropdownField.js', FRAMEWORK_DIR . '/javascript/TreeDropdownField.js',
FRAMEWORK_DIR . '/javascript/DateField.js', FRAMEWORK_DIR . '/javascript/DateField.js',
FRAMEWORK_DIR . '/javascript/HtmlEditorField.js', FRAMEWORK_DIR . '/javascript/HtmlEditorField.js',
FRAMEWORK_DIR . '/javascript/TabSet.js', FRAMEWORK_DIR . '/javascript/TabSet.js',
FRAMEWORK_DIR . '/javascript/i18n.js',
FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js', FRAMEWORK_ADMIN_DIR . '/javascript/ssui.core.js',
FRAMEWORK_DIR . '/javascript/GridField.js', FRAMEWORK_DIR . '/javascript/GridField.js',
) )

View File

@ -93,7 +93,7 @@
var firstTabWithErrors = this.find('.message.validation:first').closest('.tab'); var firstTabWithErrors = this.find('.message.validation:first').closest('.tab');
$('.cms-container').clearCurrentTabState(); // clear state to avoid override later on $('.cms-container').clearCurrentTabState(); // clear state to avoid override later on
this.redraw(); this.redraw();
firstTabWithErrors.closest('.cms-tabset').tabs('select', firstTabWithErrors.attr('id')); firstTabWithErrors.closest('.ss-tabset').tabs('select', firstTabWithErrors.attr('id'));
} }
this._super(); this._super();

View File

@ -0,0 +1,44 @@
<?php
/**
* @package framework
* @subpackage tests
*/
class CMSMenuItemTest extends SapphireTest {
public function testAttributes() {
$menuItem = new CMSMenuItem('Foo', 'foo');
$exampleAttributes = array('title' => 'foo bar', 'disabled' => true, 'data-foo' => '<something>');
$this->assertEquals(
'title="foo bar" disabled="disabled" data-foo="&lt;something&gt;"',
$menuItem->getAttributesHTML($exampleAttributes),
'Attributes appear correctly when passed as an argument'
);
$emptyAttributes = array('empty' => '');
$this->assertEquals(
'',
$menuItem->getAttributesHTML($emptyAttributes),
'No attributes are output when argument values are empty'
);
$this->assertEquals(
'',
$menuItem->getAttributesHTML('some string'),
'getAttributesHTML() ignores a string argument'
);
// Set attributes as class property
$menuItem->setAttributes($exampleAttributes);
$this->assertEquals(
'title="foo bar" disabled="disabled" data-foo="&lt;something&gt;"',
$menuItem->getAttributesHTML(),
'Attributes appear correctly when using setAttributes()'
);
$this->assertEquals(
'title="foo bar" disabled="disabled" data-foo="&lt;something&gt;"',
$menuItem->getAttributesHTML('foo bar'),
'getAttributesHTML() ignores a string argument and falls back to class property'
);
}
}

View File

@ -205,11 +205,16 @@ class Debug {
* @param $message string to output * @param $message string to output
*/ */
public static function log($message) { public static function log($message) {
$file = dirname(__FILE__).'/../../debug.log'; if (defined('BASE_PATH')) {
$path = BASE_PATH;
}
else {
$path = dirname(__FILE__) . '/../..';
}
$file = $path . '/debug.log';
$now = date('r'); $now = date('r');
$oldcontent = (file_exists($file)) ? file_get_contents($file) : ''; $content = "\n\n== $now ==\n$message\n";
$content = $oldcontent . "\n\n== $now ==\n$message\n"; file_put_contents($file, $content, FILE_APPEND);
file_put_contents($file, $content);
} }
/** /**

View File

@ -64,6 +64,9 @@ These parameters are passed to the callback:
will not have been parsed, and can optionally be fed back into the parser. will not have been parsed, and can optionally be fed back into the parser.
- The ShortcodeParser instance used to parse the content. - The ShortcodeParser instance used to parse the content.
- The shortcode tag name that was matched within the parsed content. - The shortcode tag name that was matched within the parsed content.
- An associative array of extra information about the shortcode being parsed. For example, if the shortcode is
is inside an attribute, the `element` key contains a reference to the parent `DOMElement`, and the `node`
key the attribute's `DOMNode`.
## Example: Google Maps Iframe by Address ## Example: Google Maps Iframe by Address

View File

@ -136,7 +136,7 @@
}); });
// Covers both tabular delete button, and the button on the detail form // Covers both tabular delete button, and the button on the detail form
$('.ss-gridfield .Actions .action.gridfield-button-delete, .cms-edit-form .Actions button.action.action-delete').entwine({ $('.ss-gridfield .col-buttons .action.gridfield-button-delete, .cms-edit-form .Actions button.action.action-delete').entwine({
onclick: function(e){ onclick: function(e){
if(!confirm(ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE'))) { if(!confirm(ss.i18n._t('TABLEFIELD.DELETECONFIRMMESSAGE'))) {
e.preventDefault(); e.preventDefault();

View File

@ -23,9 +23,9 @@
}); });
var strings = { var strings = {
'openlink': 'Open', 'openlink': ss.i18n._t('TreeDropdownField.OpenLink'),
'fieldTitle': '(Choose)', 'fieldTitle': '(' + ss.i18n._t('TreeDropdownField.FieldTitle') + ')',
'searchFieldTitle': '(Choose or Search)' 'searchFieldTitle': '(' + ss.i18n._t('TreeDropdownField.SearchFieldTitle') + ')'
}; };
var _clickTestFn = function(e) { var _clickTestFn = function(e) {
@ -298,11 +298,7 @@
$('.TreeDropdownField.searchable').entwine({ $('.TreeDropdownField.searchable').entwine({
onadd: function() { onadd: function() {
this._super(); this._super();
var title = ss.i18n._t( var title = ss.i18n._t('TreeDropdownField.ENTERTOSEARCH');
'DropdownField.ENTERTOSEARCH',
'Press enter to search'
);
this.find('.treedropdownfield-panel').prepend( this.find('.treedropdownfield-panel').prepend(
$('<input type="text" class="search treedropdownfield-search" data-skip-autofocus="true" placeholder="' + title + '" value="" />') $('<input type="text" class="search treedropdownfield-search" data-skip-autofocus="true" placeholder="' + title + '" value="" />')
); );

View File

@ -36,6 +36,10 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
'UploadField.LOADING': 'Loading ...', 'UploadField.LOADING': 'Loading ...',
'UploadField.Editing': 'Editing ...', 'UploadField.Editing': 'Editing ...',
'UploadField.Uploaded': 'Uploaded', 'UploadField.Uploaded': 'Uploaded',
'UploadField.OVERWRITEWARNING': 'File with the same name already exists' 'UploadField.OVERWRITEWARNING': 'File with the same name already exists',
'TreeDropdownField.ENTERTOSEARCH': 'Press enter to search',
'TreeDropdownField.OpenLink': 'Open',
'TreeDropdownField.FieldTitle': 'Choose',
'TreeDropdownField.SearchFieldTitle': 'Choose or Search'
}); });
} }

View File

@ -13,14 +13,14 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
'UPDATEURL.CONFIRM': 'Kei te hiahia koe kia huri au i te PRO ki:\n\n%s/\n\nPāwhiri Āe kia hurihia te PRO, pāwhiri Whakakore kia waiho:\n\n%s', 'UPDATEURL.CONFIRM': 'Kei te hiahia koe kia huri au i te PRO ki:\n\n%s/\n\nPāwhiri Āe kia hurihia te PRO, pāwhiri Whakakore kia waiho:\n\n%s',
'UPDATEURL.CONFIRMURLCHANGED':'Kua hurihia te PRO ki \n"%s"', 'UPDATEURL.CONFIRMURLCHANGED':'Kua hurihia te PRO ki \n"%s"',
'FILEIFRAMEFIELD.DELETEFILE': 'Muku Kōnae', 'FILEIFRAMEFIELD.DELETEFILE': 'Muku Kōnae',
'FILEIFRAMEFIELD.UNATTACHFILE': 'Wehe Kōnae', 'FILEIFRAMEFIELD.UNATTACHFILE': 'Wehetāpiri Kōnae',
'FILEIFRAMEFIELD.DELETEIMAGE': 'Muku Atahanga', 'FILEIFRAMEFIELD.DELETEIMAGE': 'Muku Atahanga',
'FILEIFRAMEFIELD.CONFIRMDELETE': 'Kei te tino hiahia muku i tēnei kōnae?', 'FILEIFRAMEFIELD.CONFIRMDELETE': 'Kei te tino hiahia muku i tēnei kōnae?',
'LeftAndMain.IncompatBrowserWarning': 'Kāore tō pūtirotiro i te hototahi ki te atanga CMS. Whakamahia Internet Explorer 7+, Google Chrome 10+, Mozilla Firefox 3.5+ rānei.', 'LeftAndMain.IncompatBrowserWarning': 'Kāore tō pūtirotiro i te hototahi ki te atanga CMS. Whakamahia Internet Explorer 7+, Google Chrome 10+, Mozilla Firefox 3.5+ rānei.',
'GRIDFIELD.ERRORINTRANSACTION': 'Kua puta mai he hapa i te tiki raraunga mai i te tūmau\n Ngāna anō ā muri atu.', 'GRIDFIELD.ERRORINTRANSACTION': 'Kua puta mai he hapa i te tiki raraunga mai i te tūmau\n Ngāna anō ā muri atu.',
'UploadField.ConfirmDelete': 'He tika tonu kia tangohia tēnei kōnae i te pūnahakōnae tūmau?', 'UploadField.ConfirmDelete': 'He tika tonu kia tangohia tēnei kōnae i te pūnahakōnae tūmau?',
'UploadField.PHP_MAXFILESIZE': 'Kua hipa te mōrahi_rahikōnae_tukuatu i te kōnae (whakaritenga php.ini)', 'UploadField.PHP_MAXFILESIZE': 'Kua hipa te mōrahi_rahikōnae_tukuatu i te kōnae (whakaritenga php.ini)',
'UploadField.HTML_MAXFILESIZE': 'Kua hipa te MŌRAHI_RAHI_KŌNAE i te kōnae (whakaritenga puka HTML)', 'UploadField.HTML_MAXFILESIZE': 'Kua hipa te mōrahi_rahi_kōnae i te kōnae (whakaritenga puka HTML)',
'UploadField.ONLYPARTIALUPLOADED': 'Kua tukuna atu he wāhanga anake o te kōnae', 'UploadField.ONLYPARTIALUPLOADED': 'Kua tukuna atu he wāhanga anake o te kōnae',
'UploadField.NOFILEUPLOADED': 'Kāore he Kōnae i tukuna atu', 'UploadField.NOFILEUPLOADED': 'Kāore he Kōnae i tukuna atu',
'UploadField.NOTMPFOLDER': 'Kua ngaro tētahi kōpaki rangitahi', 'UploadField.NOTMPFOLDER': 'Kua ngaro tētahi kōpaki rangitahi',
@ -34,6 +34,11 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
'UploadField.EMPTYRESULT': 'Otinga tukuatu kōnae piako', 'UploadField.EMPTYRESULT': 'Otinga tukuatu kōnae piako',
'UploadField.LOADING': 'Uta ana...', 'UploadField.LOADING': 'Uta ana...',
'UploadField.Editing': 'Whakatika ana ...', 'UploadField.Editing': 'Whakatika ana ...',
'UploadField.Uploaded': 'Kua tukuna atu' 'UploadField.Uploaded': 'Kua tukuna atu',
'UploadField.OVERWRITEWARNING': 'Kei te tīari kē tētahi kōnae me te ingoa ōrite',
'TreeDropdownField.ENTERTOSEARCH': 'Pēhi tāuru hei rapu',
'TreeDropdownField.OpenLink': 'Whakatuwhera',
'TreeDropdownField.FieldTitle': 'Kōwhiri',
'TreeDropdownField.SearchFieldTitle': 'Kōwhiri ka Rapu rānei'
}); });
} }

View File

@ -2,6 +2,7 @@ mi:
AssetAdmin: AssetAdmin:
ALLOWEDEXTS: 'Ngā toronga ka whakaaetia' ALLOWEDEXTS: 'Ngā toronga ka whakaaetia'
NEWFOLDER: KōpakiHōu NEWFOLDER: KōpakiHōu
SHOWALLOWEDEXTS: 'Whakaaturia mai ngā toronga e whakaaetia ana'
AssetTableField: AssetTableField:
CREATED: 'Tukuatu tuatahi' CREATED: 'Tukuatu tuatahi'
DIM: Ngā Rahinga DIM: Ngā Rahinga
@ -68,6 +69,8 @@ mi:
ACCESSALLINTERFACES: 'Uru ki ngā wāhanga CMS katoa' ACCESSALLINTERFACES: 'Uru ki ngā wāhanga CMS katoa'
ACCESSALLINTERFACESHELP: 'Ka takahi i ngā tautuhinga uru tauwhāiti ake' ACCESSALLINTERFACESHELP: 'Ka takahi i ngā tautuhinga uru tauwhāiti ake'
SAVE: Tiaki SAVE: Tiaki
CMSProfileController:
MENUTITLE: 'Taku Kōtaha'
ChangePasswordEmail_ss: ChangePasswordEmail_ss:
CHANGEPASSWORDTEXT1: 'Kua hurihia tō kupuhipa mō' CHANGEPASSWORDTEXT1: 'Kua hurihia tō kupuhipa mō'
CHANGEPASSWORDTEXT2: 'Ka taea te whakamahi i ēnei taipitopito tuakiri ināianei hei takiuru:' CHANGEPASSWORDTEXT2: 'Ka taea te whakamahi i ēnei taipitopito tuakiri ināianei hei takiuru:'
@ -96,13 +99,30 @@ mi:
FOURTH: tuawhā FOURTH: tuawhā
SECOND: tuarua SECOND: tuarua
THIRD: tuatoru THIRD: tuatoru
CurrencyField:
CURRENCYSYMBOL: $
DataObject: DataObject:
PLURALNAME: 'Ngā Ahanoa Raraunga' PLURALNAME: 'Ngā Ahanoa Raraunga'
SINGULARNAME: 'Ahanoa Raraunga' SINGULARNAME: 'Ahanoa Raraunga'
Date: Date:
DAY:
DAYS: ngā rā
HOUR: haora
HOURS: ngā haora
MIN: meneti
MINS: ngā meneti
MONTH: marama
MONTHS: ngā marama
SEC: hēkona
SECS: ngā hēkona
TIMEDIFFAGO: '{difference} i mua' TIMEDIFFAGO: '{difference} i mua'
TIMEDIFFIN: 'i roto i te {difference}' TIMEDIFFIN: 'i roto i te {difference}'
YEAR: tau
YEARS: ngā tau
LessThanMinuteAgo: 'iti iho i te meneti kotahi'
DateField: DateField:
NOTSET: 'kāore i tautuhia'
TODAY: tēnei rā
VALIDDATEFORMAT2: 'Tāurua he hōputu rā tika ({format})' VALIDDATEFORMAT2: 'Tāurua he hōputu rā tika ({format})'
VALIDDATEMAXDATE: 'Me tawhito ake tō rā, kia ōrite rānei ki te rā mōrahi ({date}) kua whakaaetia' VALIDDATEMAXDATE: 'Me tawhito ake tō rā, kia ōrite rānei ki te rā mōrahi ({date}) kua whakaaetia'
VALIDDATEMINDATE: 'Me hōu ake tō rā, kia ōrite rānei ki te rā moroiti ({date}) kua whakaaetia' VALIDDATEMINDATE: 'Me hōu ake tō rā, kia ōrite rānei ki te rā moroiti ({date}) kua whakaaetia'
@ -120,18 +140,37 @@ mi:
Enum: Enum:
ANY: Ko tētahi ANY: Ko tētahi
File: File:
AviType: 'kōnae ataata AVI'
Content: Ngā Ihirangi Content: Ngā Ihirangi
CssType: 'kōnae CSS'
DmgType: 'atahanga kōpae Apple'
DocType: 'tuhinga Word'
Filename: Ingoa Kōnae Filename: Ingoa Kōnae
GifType: 'atahanga GIF - he pai mō ngā hoahoa'
GzType: 'kōnae kōpeke GZIP'
HtlType: 'kōnae HTML'
HtmlType: 'kōnae HTML'
INVALIDEXTENSION: 'Kāore e whakaaetia te toronga (valid: {extensions})' INVALIDEXTENSION: 'Kāore e whakaaetia te toronga (valid: {extensions})'
INVALIDEXTENSIONSHORT: 'Kāore e whakaaetia te toronga' INVALIDEXTENSIONSHORT: 'Kāore e whakaaetia te toronga'
IcoType: 'atahanga Ata'
JpgType: 'atahanga JPEG - he pai mō ngā whakaahua'
JsType: 'kōnae Javascript'
Mp3Type: 'kōnae ororongo MP3'
MpgType: 'kōnae ataata MPEG'
NOFILESIZE: 'He kore ngā paita kei te kōnae' NOFILESIZE: 'He kore ngā paita kei te kōnae'
NOVALIDUPLOAD: 'Ehara te kōnae i te tukuatu pono' NOVALIDUPLOAD: 'Ehara te kōnae i te tukuatu pono'
Name: Ingoa Name: Ingoa
PLURALNAME: Ngā Kōnae PLURALNAME: Ngā Kōnae
PdfType: 'kōnae Adobe Acrobat PDF'
PngType: 'atahanga PNG - he hōputu pai hei whakamahi whānui noa'
SINGULARNAME: Kōnae SINGULARNAME: Kōnae
TOOLARGE: 'He rahi rawa te rahi kōnae, he {size} te rahi mōrahi ka taea' TOOLARGE: 'He rahi rawa te rahi kōnae, he {size} te rahi mōrahi ka taea'
TOOLARGESHORT: 'Ka hipa te {size} i te rahi kōnae' TOOLARGESHORT: 'Ka hipa te {size} i te rahi kōnae'
TiffType: 'Hōputu atatahanga tūtohu '
Title: Taitara Title: Taitara
WavType: 'kōnae ororongo WAV'
XlsType: 'ripakaute Excel'
ZipType: 'kōnae kōpeke ZIP'
FileIFrameField: FileIFrameField:
ATTACH: 'Āpiti {type}' ATTACH: 'Āpiti {type}'
ATTACHONCESAVED: 'Ka taea te āpiti i ngā {type} ina oti te tiaki tuatahi o te pūkete.' ATTACHONCESAVED: 'Ka taea te āpiti i ngā {type} ina oti te tiaki tuatahi o te pūkete.'
@ -147,12 +186,17 @@ mi:
TITLE: 'Iframe Tukuatu Atahanga' TITLE: 'Iframe Tukuatu Atahanga'
Filesystem: Filesystem:
SYNCRESULTS: 'Kua oti te tukutahi: e {createdcount} ngā tūemi i hangaia, e {deletedcount} ngā tūemi i mukua' SYNCRESULTS: 'Kua oti te tukutahi: e {createdcount} ngā tūemi i hangaia, e {deletedcount} ngā tūemi i mukua'
Folder:
PLURALNAME: Ngā Kōpaki
SINGULARNAME: Kōpaki
ForgotPasswordEmail_ss: ForgotPasswordEmail_ss:
HELLO: Kia ora HELLO: Kia ora
TEXT1: 'Anei tō' TEXT1: 'Anei tō'
TEXT2: 'hono tautuhi kupuhipa anō' TEXT2: 'hono tautuhi kupuhipa anō'
TEXT3: TEXT3:
Form: Form:
FIELDISREQUIRED: 'Ka hiahiatia te {name}'
SubmitBtnLabel: Haere
VALIDATIONCREDITNUMBER: 'Tirohia kua tika tō tāuru i te tau kāri nama {number}' VALIDATIONCREDITNUMBER: 'Tirohia kua tika tō tāuru i te tau kāri nama {number}'
VALIDATIONNOTUNIQUE: 'Ehara te uara i tāurua i te ahurei' VALIDATIONNOTUNIQUE: 'Ehara te uara i tāurua i te ahurei'
VALIDATIONPASSWORDSDONTMATCH: 'Kāore ngā kupuhipa i te ōrite' VALIDATIONPASSWORDSDONTMATCH: 'Kāore ngā kupuhipa i te ōrite'
@ -160,8 +204,10 @@ mi:
VALIDATIONSTRONGPASSWORD: 'Kia kotahi tonu te mati, kia tahi hoki te pūāhua retawhika i te iti rawa o ngā kupuhipa' VALIDATIONSTRONGPASSWORD: 'Kia kotahi tonu te mati, kia tahi hoki te pūāhua retawhika i te iti rawa o ngā kupuhipa'
VALIDATOR: Pūwhakamana VALIDATOR: Pūwhakamana
VALIDCURRENCY: 'Tāurua he moni tika' VALIDCURRENCY: 'Tāurua he moni tika'
CSRF_FAILED_MESSAGE: 'Te āhua nei kua puta he raru hangarau. Pāwhiria te pātene hoki, ka tāmata anō i tō pūtirotiro, ka ngana anō.'
FormField: FormField:
NONE: Kore NONE: Kore
Example: 'hei tauira %s'
GridAction: GridAction:
DELETE_DESCRIPTION: Muku DELETE_DESCRIPTION: Muku
Delete: Muku Delete: Muku
@ -183,6 +229,7 @@ mi:
ResetFilter: Tautuhi anō ResetFilter: Tautuhi anō
GridFieldAction_Delete: GridFieldAction_Delete:
DeletePermissionsFailure: 'Kāore he muku whakaaetanga' DeletePermissionsFailure: 'Kāore he muku whakaaetanga'
EditPermissionsFailure: 'Kāore ō whakaaetanga kia wetehono pūkete'
GridFieldDetailForm: GridFieldDetailForm:
CancelBtn: Whakakore CancelBtn: Whakakore
Create: Hanga Create: Hanga
@ -190,16 +237,25 @@ mi:
DeletePermissionsFailure: 'Kāore he whakaaetanga muku' DeletePermissionsFailure: 'Kāore he whakaaetanga muku'
Deleted: 'Kua mukua %s %s' Deleted: 'Kua mukua %s %s'
Save: Tiaki Save: Tiaki
Saved: 'I tiakina te {name} {link}'
GridFieldItemEditView_ss: GridFieldItemEditView_ss:
Go_back: 'Hoki' Go_back: 'Hoki'
Group: Group:
AddRole: 'Tāpiritia he tūnga mō tēnei rōpū' AddRole: 'Tāpiritia he tūnga mō tēnei rōpū'
Code: 'Waehere Rōpū'
DefaultGroupTitleAdministrators: Ngā Kaiwhakahaere
DefaultGroupTitleContentAuthors: 'Ngā Kaituhi Ihirangi' DefaultGroupTitleContentAuthors: 'Ngā Kaituhi Ihirangi'
Description: Whakaahuatanga
GroupReminder: 'Mēnā ka kōwhiri koe i tētahi rōpū matua, ka whiwhi tēnei rōpū i ōna tūnga katoa' GroupReminder: 'Mēnā ka kōwhiri koe i tētahi rōpū matua, ka whiwhi tēnei rōpū i ōna tūnga katoa'
Locked: 'Kua maukati?'
NoRoles: 'Kāore i kitea he tūnga'
PLURALNAME: Ngā Rōpū PLURALNAME: Ngā Rōpū
Parent: 'Rōpū Matua'
RolesAddEditLink: 'Whakahaere tūnga' RolesAddEditLink: 'Whakahaere tūnga'
SINGULARNAME: Rōpū SINGULARNAME: Rōpū
Sort: 'Raupapa Kōmaka'
has_many_Permissions: Ngā Whakaaetanga has_many_Permissions: Ngā Whakaaetanga
many_many_Members: Ngā Mema
GroupImportForm: GroupImportForm:
Help1: '<p>Kawea mai ngā kaiwhakamahi i te hōputu <em>CSV </em> (ngā uara ka wehea ki te piko). <small><a href="#" class="toggle-advanced">Whakaatu whakamahinga ara atu anō</a></small></p>' Help1: '<p>Kawea mai ngā kaiwhakamahi i te hōputu <em>CSV </em> (ngā uara ka wehea ki te piko). <small><a href="#" class="toggle-advanced">Whakaatu whakamahinga ara atu anō</a></small></p>'
Help2: "<div class=\"advanced\">\n <h4>Advanced usage</h4>\n <ul>\n <li>Allowed columns: <em>%s</em></li>\n <li>Existing groups are matched by their unique <em>Code</em> value, and updated with any new values from the \n imported file</li>\n <li>Group hierarchies can be created by using a <em>ParentCode</em> column.</li>\n <li>Permission codes can be assigned by the <em>PermissionCode</em> column. Existing permission codes are not\n cleared.</li>\n </ul>\n</div>" Help2: "<div class=\"advanced\">\n <h4>Advanced usage</h4>\n <ul>\n <li>Allowed columns: <em>%s</em></li>\n <li>Existing groups are matched by their unique <em>Code</em> value, and updated with any new values from the \n imported file</li>\n <li>Group hierarchies can be created by using a <em>ParentCode</em> column.</li>\n <li>Permission codes can be assigned by the <em>PermissionCode</em> column. Existing permission codes are not\n cleared.</li>\n </ul>\n</div>"
@ -231,6 +287,8 @@ mi:
FROMWEB: 'Mai i te tukutuku' FROMWEB: 'Mai i te tukutuku'
FindInFolder: 'Rapu i te Kōpaki' FindInFolder: 'Rapu i te Kōpaki'
IMAGEALT: 'Tuhinga kē (alt)' IMAGEALT: 'Tuhinga kē (alt)'
IMAGEALTTEXT: 'Kuputuhi kē (alt) - ka whakaaturia ki te kore e taea te atahanga te whakaatu'
IMAGEALTTEXTDESC: 'Ka whakaaturia ki ngā pūpānui mata ki te kore e taea te atahanga te whakaatu'
IMAGEDIMENSIONS: Ngā Rahinga IMAGEDIMENSIONS: Ngā Rahinga
IMAGEHEIGHTPX: Teitei IMAGEHEIGHTPX: Teitei
IMAGETITLE: 'Tuhinga taitara (ākiutauta) - mō ngā mōhiohio tāpiri mō te atahanga' IMAGETITLE: 'Tuhinga taitara (ākiutauta) - mō ngā mōhiohio tāpiri mō te atahanga'
@ -251,6 +309,7 @@ mi:
URL: PRO URL: PRO
URLNOTANOEMBEDRESOURCE: 'Kāore e taea te huri i te PRO ''{url}'' hei rawa pāpāho.' URLNOTANOEMBEDRESOURCE: 'Kāore e taea te huri i te PRO ''{url}'' hei rawa pāpāho.'
UpdateMEDIA: 'Whakahōu Pāpāho' UpdateMEDIA: 'Whakahōu Pāpāho'
BUTTONADDURL: 'Tāpiri PRO'
Image: Image:
PLURALNAME: Ngā Kōnae PLURALNAME: Ngā Kōnae
SINGULARNAME: Kōnae SINGULARNAME: Kōnae
@ -275,6 +334,9 @@ mi:
REORGANISATIONSUCCESSFUL: 'Kua momoho te whakaraupapa anō i te rākau pae' REORGANISATIONSUCCESSFUL: 'Kua momoho te whakaraupapa anō i te rākau pae'
SAVEDUP: Kua Tiakina SAVEDUP: Kua Tiakina
VersionUnknown: tē mōhiotia VersionUnknown: tē mōhiotia
ShowAsList: 'whakaaturia hei rārangi'
TooManyPages: 'He nui rawa ngā whārangi'
ValidationError: 'Hapa manatoko'
LeftAndMain_Menu_ss: LeftAndMain_Menu_ss:
Hello: Kia ora Hello: Kia ora
LOGOUT: 'Takiputa' LOGOUT: 'Takiputa'
@ -290,6 +352,7 @@ mi:
BUTTONLOGIN: 'Takiuru' BUTTONLOGIN: 'Takiuru'
BUTTONLOGINOTHER: 'Takiuru hei tangata kē' BUTTONLOGINOTHER: 'Takiuru hei tangata kē'
BUTTONLOSTPASSWORD: 'Kua ngaro i a au taku kupuhipa' BUTTONLOSTPASSWORD: 'Kua ngaro i a au taku kupuhipa'
CANTEDIT: 'Kāore ō whakaaetanga kia pēnā'
CONFIRMNEWPASSWORD: 'Whakaū Kupuhipa Hōu' CONFIRMNEWPASSWORD: 'Whakaū Kupuhipa Hōu'
CONFIRMPASSWORD: 'Whakaū Kupuhipa' CONFIRMPASSWORD: 'Whakaū Kupuhipa'
DATEFORMAT: 'Hōputu Rā' DATEFORMAT: 'Hōputu Rā'
@ -299,6 +362,7 @@ mi:
EMPTYNEWPASSWORD: 'Kāore e whakaaetia kia piako te kupuhipa hōu, ngana anō' EMPTYNEWPASSWORD: 'Kāore e whakaaetia kia piako te kupuhipa hōu, ngana anō'
ENTEREMAIL: 'Tāurua he wāhitau īmēra kia whiwhi i te hono tautuhi kupuhipa anō.' ENTEREMAIL: 'Tāurua he wāhitau īmēra kia whiwhi i te hono tautuhi kupuhipa anō.'
ERRORLOCKEDOUT: 'Kua mono rangitahitia tō pūkete nā te nui rawa o ngā whakamātau hē ki te takiuru. Ngana anō ā te 20 meneti.' ERRORLOCKEDOUT: 'Kua mono rangitahitia tō pūkete nā te nui rawa o ngā whakamātau hē ki te takiuru. Ngana anō ā te 20 meneti.'
ERRORLOCKEDOUT2: 'Kua monokia rangitahitia tō pūkete nā te nui rawa o ngā ngana takiuru kua rahua. Ngana anō ā muri i te {count} meneti.'
ERRORNEWPASSWORD: 'Kua rerekē tō tāuru kupuhipa, whakamātau anō' ERRORNEWPASSWORD: 'Kua rerekē tō tāuru kupuhipa, whakamātau anō'
ERRORPASSWORDNOTMATCH: 'Kāore i te ōrite tō kupuhipa o nāianei, ngana anō' ERRORPASSWORDNOTMATCH: 'Kāore i te ōrite tō kupuhipa o nāianei, ngana anō'
ERRORWRONGCRED: 'Te āhua nei ehara i te wāhitau īmerā tika, i te kuphipa tika rānei. Ngana anō' ERRORWRONGCRED: 'Te āhua nei ehara i te wāhitau īmerā tika, i te kuphipa tika rānei. Ngana anō'
@ -326,6 +390,7 @@ mi:
db_NumVisit: 'Maha o ngā Toronga' db_NumVisit: 'Maha o ngā Toronga'
db_Password: Kupuhipa db_Password: Kupuhipa
db_PasswordExpiry: 'Rā Mōnehu Kupuhipa' db_PasswordExpiry: 'Rā Mōnehu Kupuhipa'
NoPassword: 'Kāore he kupuhipa i tēnei mema.'
MemberAuthenticator: MemberAuthenticator:
TITLE: 'Īmērā &amp; Kupuhipa' TITLE: 'Īmērā &amp; Kupuhipa'
MemberDatetimeOptionsetField: MemberDatetimeOptionsetField:
@ -348,6 +413,7 @@ mi:
TWODIGITMONTH: 'Marama matirua (01=Kohitātea)' TWODIGITMONTH: 'Marama matirua (01=Kohitātea)'
TWODIGITSECOND: 'Ngā mati hēkona e rua (00 ki te 59)' TWODIGITSECOND: 'Ngā mati hēkona e rua (00 ki te 59)'
TWODIGITYEAR: 'Tau matirua' TWODIGITYEAR: 'Tau matirua'
Toggle: 'Whakaaturia te āwhina whakahōputu'
MemberImportForm: MemberImportForm:
Help1: '<p>Kawea mai ngā kaiwhakamahi i te <em>hōputu CSV </em> (ngā uara ka wehea ki te piko). <small><a href="#" class="toggle-advanced">Whakaatu whakamahinga ara atu anō</a></small></p>' Help1: '<p>Kawea mai ngā kaiwhakamahi i te <em>hōputu CSV </em> (ngā uara ka wehea ki te piko). <small><a href="#" class="toggle-advanced">Whakaatu whakamahinga ara atu anō</a></small></p>'
Help2: "<div class=\"advanced\">\n <h4>Advanced usage</h4>\n <ul>\n <li>Allowed columns: <em>%s</em></li>\n <li>Existing users are matched by their unique <em>Code</em> property, and updated with any new values from\n the imported file.</li>\n <li>Groups can be assigned by the <em>Groups</em> column. Groups are identified by their <em>Code</em> property,\n multiple groups can be separated by comma. Existing group memberships are not cleared.</li>\n </ul>\n</div>" Help2: "<div class=\"advanced\">\n <h4>Advanced usage</h4>\n <ul>\n <li>Allowed columns: <em>%s</em></li>\n <li>Existing users are matched by their unique <em>Code</em> property, and updated with any new values from\n the imported file.</li>\n <li>Groups can be assigned by the <em>Groups</em> column. Groups are identified by their <em>Code</em> property,\n multiple groups can be separated by comma. Existing group memberships are not cleared.</li>\n </ul>\n</div>"
@ -355,11 +421,15 @@ mi:
ResultDeleted: 'Kua mukua e %d ngā mema' ResultDeleted: 'Kua mukua e %d ngā mema'
ResultNone: 'Kāore he huringa' ResultNone: 'Kāore he huringa'
ResultUpdated: 'I whakahōutia e {count} mhā mema' ResultUpdated: 'I whakahōutia e {count} mhā mema'
MemberPassword:
PLURALNAME: 'Ngā Kupuhipa Mema'
SINGULARNAME: 'Kupuhipa Mema'
MemberTableField: MemberTableField:
APPLY_FILTER: 'Hoatu Tātari' APPLY_FILTER: 'Hoatu Tātari'
ModelAdmin: ModelAdmin:
DELETE: Muku DELETE: Muku
DELETEDRECORDS: 'I mukua e {count} ngā pūkete.' DELETEDRECORDS: 'I mukua e {count} ngā pūkete.'
EMPTYBEFOREIMPORT: 'Whakakapi raraunga'
IMPORT: 'Kawemai i CSV' IMPORT: 'Kawemai i CSV'
IMPORTEDRECORDS: 'I kawea mai e {count} ngā pūkete.' IMPORTEDRECORDS: 'I kawea mai e {count} ngā pūkete.'
NOCSVFILE: 'Pūtirotiro kia kitea he kōnae CSV hei kawemai' NOCSVFILE: 'Pūtirotiro kia kitea he kōnae CSV hei kawemai'
@ -387,22 +457,30 @@ mi:
VALIDATION: 'Ehara te ''{value}'' i te tau, ka taea ngā tau anake ki tēnei āpure' VALIDATION: 'Ehara te ''{value}'' i te tau, ka taea ngā tau anake ki tēnei āpure'
Pagination: Pagination:
Page: Whārangi Page: Whārangi
View: Tiro
Permission: Permission:
AdminGroup: Kaiwhakahaere AdminGroup: Kaiwhakahaere
CMS_ACCESS_CATEGORY: 'Uru CMS' CMS_ACCESS_CATEGORY: 'Uru CMS'
FULLADMINRIGHTS: 'Ngā motika kaiwhakahaere katoa' FULLADMINRIGHTS: 'Ngā motika kaiwhakahaere katoa'
FULLADMINRIGHTS_HELP: 'Ka whakapae me te takahi i ērā atu whakaaetanga katoa kua tautapatia.' FULLADMINRIGHTS_HELP: 'Ka whakapae me te takahi i ērā atu whakaaetanga katoa kua tautapatia.'
PLURALNAME: Ngā Whakaaetanga
SINGULARNAME: Whakaaetanga
PermissionCheckboxSetField: PermissionCheckboxSetField:
AssignedTo: 'kua tautapatia ki "{title}"' AssignedTo: 'kua tautapatia ki "{title}"'
FromGroup: 'I tukuna iho i te rōpū "{title}"' FromGroup: 'I tukuna iho i te rōpū "{title}"'
FromRole: 'I tukuna iho i te tūnga "{title}"' FromRole: 'I tukuna iho i te tūnga "{title}"'
FromRoleOnGroup: 'i tukuna iho i "%s" i te rōpū "%s"' FromRoleOnGroup: 'i tukuna iho i "%s" i te rōpū "%s"'
PermissionRole: PermissionRole:
OnlyAdminCanApply: 'Ka taea anake te tono e ngā kaiwhakahaere'
PLURALNAME: Ngā Tūnga PLURALNAME: Ngā Tūnga
SINGULARNAME: Tūranga SINGULARNAME: Tūranga
Title: Taitara Title: Taitara
PermissionRoleCode:
PLURALNAME: 'Ngā Waehere Tūnga Whakaaetanga'
SINGULARNAME: 'Waehere Tūnga Whakaaetanga'
Permissions: Permissions:
PERMISSIONS_CATEGORY: 'Ngā tūnga me ngā whakaaetanga uru' PERMISSIONS_CATEGORY: 'Ngā tūnga me ngā whakaaetanga uru'
UserPermissionsIntro: 'Mā te tautapa rōpū ki tēnei kaiwhakamahi e whakarite āna whakaaetanga. Tirohia te wāhanga rōpū mō ngā taipitopito o ngā whakaaetanga o ngā rōpū takitahi.'
PhoneNumberField: PhoneNumberField:
VALIDATION: 'Tāurua he tau waea tika' VALIDATION: 'Tāurua he tau waea tika'
RelationComplexTableField_ss: RelationComplexTableField_ss:
@ -411,6 +489,7 @@ mi:
NOTFOUND: 'Kāore i kitea he tūemi' NOTFOUND: 'Kāore i kitea he tūemi'
Security: Security:
ALREADYLOGGEDIN: 'Kāore i te whakaaetia kia uru koe ki tēnei whārangi. Mēnā he pūkete anō tōu e taea ai te uru ki tēnā whārangi, ka taea te takiuru anō i raro.' ALREADYLOGGEDIN: 'Kāore i te whakaaetia kia uru koe ki tēnei whārangi. Mēnā he pūkete anō tōu e taea ai te uru ki tēnā whārangi, ka taea te takiuru anō i raro.'
LOSTPASSWORDHEADER: 'Kupuhipa Ngaro'
BUTTONSEND: 'Tukuna mai te hono tautuhi kupuhipa anō' BUTTONSEND: 'Tukuna mai te hono tautuhi kupuhipa anō'
CHANGEPASSWORDBELOW: 'Ka taea te huri i tō kupuhipa i raro' CHANGEPASSWORDBELOW: 'Ka taea te huri i tō kupuhipa i raro'
CHANGEPASSWORDHEADER: 'Hurihia tō kupuhipa' CHANGEPASSWORDHEADER: 'Hurihia tō kupuhipa'
@ -446,6 +525,19 @@ mi:
FileFieldLabel: 'Kōnae CSV <small>(Ngā toronga ka whakaaetia: *.csv)</small>' FileFieldLabel: 'Kōnae CSV <small>(Ngā toronga ka whakaaetia: *.csv)</small>'
SilverStripeNavigator: SilverStripeNavigator:
Edit: Whakatika Edit: Whakatika
Auto: Aunoa
ChangeViewMode: 'Hurihia te aratau tiro'
Desktop: Papamahi
DualWindowView: 'Matapihi Takirua'
EditView: 'Aratau whakatika'
Mobile: Pūkoro
PreviewState: 'Tūnga Arokite'
PreviewView: 'Aratau arokite'
Responsive: Urupare
SplitView: 'Aratau weherua'
Tablet: Paparorohiko
ViewDeviceWidth: 'Tīpakohia he whānui arokite'
Width: whānui
SimpleImageField: SimpleImageField:
NOUPLOAD: 'Kāore He Atahanga Tukuatu' NOUPLOAD: 'Kāore He Atahanga Tukuatu'
SiteTree: SiteTree:
@ -493,17 +585,31 @@ mi:
FROMCOMPUTER: 'Mai i tō rorohiko' FROMCOMPUTER: 'Mai i tō rorohiko'
FROMCOMPUTERINFO: 'Tīpako mai i ngā kōnae' FROMCOMPUTERINFO: 'Tīpako mai i ngā kōnae'
FROMFILES: 'I ngā kōnae' FROMFILES: 'I ngā kōnae'
HOTLINKINFO: 'Mōhiohio: Ka honoweratia tēnei atahanga. Me whakarite kia whai whakaaetanga koe i te kaihanga pae taketake kia pēnā.'
MAXNUMBEROFFILES: 'Kua hipa te mōrahi o ngā kōnae {count}.' MAXNUMBEROFFILES: 'Kua hipa te mōrahi o ngā kōnae {count}.'
MAXNUMBEROFFILESSHORT: 'Ka taea te tukuatu i ngā kōnae {count} anake ' MAXNUMBEROFFILESSHORT: 'Ka taea te tukuatu i ngā kōnae {count} anake '
MAXNUMBEROFFILESONE: 'Ka taea tētahi kōnae kotahi anake te tukuatu'
REMOVE: Tango REMOVE: Tango
REMOVEERROR: 'Kua rarua te tango kōnae' REMOVEERROR: 'Kua rarua te tango kōnae'
REMOVEINFO: 'Tangohia tēnei kōane i konei, engari kaua e muku i te pātaka kōnae' REMOVEINFO: 'Tangohia tēnei kōane i konei, engari kaua e muku i te pātaka kōnae'
STARTALL: 'Tīmata katoa' STARTALL: 'Tīmata katoa'
STARTALLINFO: 'Tīmataria ngā tukuatu katoa' STARTALLINFO: 'Tīmataria ngā tukuatu katoa'
Saved: Kua Tiakina Saved: Kua Tiakina
CHOOSEANOTHERFILE: 'Kōwhiria tētahi kōnae anō'
CHOOSEANOTHERINFO: 'Whakakapia tēnei kōnae ki tētahi atu mai i te pātaka kōnae'
OVERWRITEWARNING: 'Kei te tīari kē tētahi kōnae me te ingoa ōrite'
UPLOADSINTO: 'ka tiaki ki /{path}'
Versioned: Versioned:
has_many_Versions: Ngā Putanga has_many_Versions: Ngā Putanga
CMSPageHistoryController_versions_ss:
PREVIEW: 'Arokite Paetukutuku'
GridFieldEditButton_ss: GridFieldEditButton_ss:
EDIT: Whakatika EDIT: Whakatika
ContentController:
NOTLOGGEDIN: 'kāore i te takiuru'
GridFieldItemEditView: GridFieldItemEditView:
Go_back: 'Hoki' Go_back: 'Hoki'
PasswordValidator:
LOWCHARSTRENGTH: 'Whakakahatia tō kupuhipa mā te tāpiri i ētahi o ēnei pūāhua: %s'
PREVPASSWORD: 'Kua whakamahi kētia tēnā kupuhipa i mua, kōwhiria he kupuhipa hou'
TOOSHORT: 'He poto rawa te kupuhipa, me %s pūāhua neke atu te roa'

View File

@ -413,8 +413,8 @@ zh:
TWODIGITYEAR: '两位数表示的年份' TWODIGITYEAR: '两位数表示的年份'
Toggle: '显示格式帮助' Toggle: '显示格式帮助'
MemberImportForm: MemberImportForm:
Help1: '&lt;p&gt;采用 &lt;em&gt;CSV 格式&lt;/em&gt; 导入用户(逗号分隔值)&lt;small&gt;&lt;a href="#" class="toggle-advanced"&gt;显示高级用法&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;' Help1: '<p>采用 <em>CSV 格式</em> 导入用户(逗号分隔值)<small><a href="#" class="toggle-advanced">显示高级用法</a></small></p>'
Help2: "&lt;div class=\"advanced\"&gt;\n &lt;h4&gt;高级用法&lt;/h4&gt;\n &lt;ul&gt;\n &lt;li&gt;允许的栏目:&lt;em&gt;%s&lt;/em&gt;&lt;/li&gt;\n &lt;li&gt;通过独有的 &lt;em&gt;代码&lt;/em&gt; 属性对现有用户进行配对并使用导入文件中任何新的值更新他们。&lt;/li&gt;\n &lt;li&gt;群组可通过 &lt;em&gt;组别&lt;/em&gt; 栏目进行分类。群组通过他们的&lt;em&gt;代码&lt;/em&gt; 属性进行识别,\n多个群组可用逗号隔开。现有的群组分配情况不会被清除。&lt;/li&gt;\n &lt;/ul&gt;\n&lt;/div&gt;" Help2: "<div class=\"advanced\">\n <h4>高级用法</h4>\n <ul>\n <li>允许的栏目:<em>%s</em></li>\n <li>通过独有的 <em>代码</em> 属性对现有用户进行配对并使用导入文件中任何新的值更新他们。</li>\n <li>群组可通过 <em>组别</em> 栏目进行分类。群组通过他们的<em>代码</em> 属性进行识别,\n多个群组可用逗号隔开。现有的群组分配情况不会被清除。</li>\n </ul>\n</div>"
ResultCreated: '已创建 {count} 位成员' ResultCreated: '已创建 {count} 位成员'
ResultDeleted: '已删除 %d 位成员' ResultDeleted: '已删除 %d 位成员'
ResultNone: '无更改' ResultNone: '无更改'
@ -520,7 +520,7 @@ zh:
Users: 用户 Users: 用户
SecurityAdmin_MemberImportForm: SecurityAdmin_MemberImportForm:
BtnImport: '从 CSV 导入' BtnImport: '从 CSV 导入'
FileFieldLabel: 'CSV 文件 &lt;small&gt;(允许的扩展名:*.csv)&lt;/small&gt;' FileFieldLabel: 'CSV 文件 <small>(允许的扩展名:*.csv)</small>'
SilverStripeNavigator: SilverStripeNavigator:
Edit: 编辑 Edit: 编辑
Auto: 自动 Auto: 自动

View File

@ -68,6 +68,7 @@ class ShortcodeParser {
* this will not have been parsed, and can optionally be fed back into the parser. * this will not have been parsed, and can optionally be fed back into the parser.
* - The {@link ShortcodeParser} instance used to parse the content. * - The {@link ShortcodeParser} instance used to parse the content.
* - The shortcode tag name that was matched within the parsed content. * - The shortcode tag name that was matched within the parsed content.
* - An associative array of extra information about the shortcode being parsed.
* *
* @param string $shortcode The shortcode tag to map to the callback - normally in lowercase_underscore format. * @param string $shortcode The shortcode tag to map to the callback - normally in lowercase_underscore format.
* @param callback $callback The callback to replace the shortcode with. * @param callback $callback The callback to replace the shortcode with.
@ -102,9 +103,9 @@ class ShortcodeParser {
$this->shortcodes = array(); $this->shortcodes = array();
} }
public function callShortcode($tag, $attributes, $content) { public function callShortcode($tag, $attributes, $content, $extra = array()) {
if (!isset($this->shortcodes[$tag])) return false; if (!isset($this->shortcodes[$tag])) return false;
return call_user_func($this->shortcodes[$tag], $attributes, $content, $this, $tag); return call_user_func($this->shortcodes[$tag], $attributes, $content, $this, $tag, $extra);
} }
// -------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------
@ -332,11 +333,12 @@ class ShortcodeParser {
for($i = 0; $i < $attributes->length; $i++) { for($i = 0; $i < $attributes->length; $i++) {
$node = $attributes->item($i); $node = $attributes->item($i);
$tags = $this->extractTags($node->nodeValue); $tags = $this->extractTags($node->nodeValue);
$extra = array('node' => $node, 'element' => $node->ownerElement);
if($tags) { if($tags) {
$node->nodeValue = $this->replaceTagsWithText($node->nodeValue, $tags, $node->nodeValue = $this->replaceTagsWithText($node->nodeValue, $tags,
function($idx, $tag) use ($parser){ function($idx, $tag) use ($parser, $extra){
$content = $parser->callShortcode($tag['open'], $tag['attrs'], $tag['content']); $content = $parser->callShortcode($tag['open'], $tag['attrs'], $tag['content'], $extra);
if ($content === false) { if ($content === false) {
if(ShortcodeParser::$error_behavior == ShortcodeParser::ERROR) { if(ShortcodeParser::$error_behavior == ShortcodeParser::ERROR) {

View File

@ -1192,7 +1192,11 @@ class Member extends DataObject implements TemplateGlobalProvider {
$fields->removeByName('Groups'); $fields->removeByName('Groups');
if(Permission::check('EDIT_PERMISSIONS')) { if(Permission::check('EDIT_PERMISSIONS')) {
$groupsMap = Group::get()->map('ID', 'Breadcrumbs')->toArray(); $groupsMap = array();
foreach(Group::get() as $group) {
// Listboxfield values are escaped, use ASCII char instead of &raquo;
$groupsMap[$group->ID] = $group->getBreadcrumbs(' > ');
}
asort($groupsMap); asort($groupsMap);
$fields->addFieldToTab('Root.Main', $fields->addFieldToTab('Root.Main',
ListboxField::create('DirectGroups', singleton('Group')->i18n_plural_name()) ListboxField::create('DirectGroups', singleton('Group')->i18n_plural_name())

View File

@ -6,6 +6,7 @@
class ShortcodeParserTest extends SapphireTest { class ShortcodeParserTest extends SapphireTest {
protected $arguments, $contents, $tagName, $parser; protected $arguments, $contents, $tagName, $parser;
protected $extra = array();
public function setUp() { public function setUp() {
ShortcodeParser::get('test')->register('test_shortcode', array($this, 'shortcodeSaver')); ShortcodeParser::get('test')->register('test_shortcode', array($this, 'shortcodeSaver'));
@ -210,15 +211,24 @@ class ShortcodeParserTest extends SapphireTest {
); );
} }
public function testExtraContext() {
$this->parser->parse('<a href="[test_shortcode]">Test</a>');
$this->assertInstanceOf('DOMNode', $this->extra['node']);
$this->assertInstanceOf('DOMElement', $this->extra['element']);
$this->assertEquals($this->extra['element']->tagName, 'a');
}
// ----------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------
/** /**
* Stores the result of a shortcode parse in object properties for easy testing access. * Stores the result of a shortcode parse in object properties for easy testing access.
*/ */
public function shortcodeSaver($arguments, $content = null, $parser, $tagName = null) { public function shortcodeSaver($arguments, $content, $parser, $tagName, $extra) {
$this->arguments = $arguments; $this->arguments = $arguments;
$this->contents = $content; $this->contents = $content;
$this->tagName = $tagName; $this->tagName = $tagName;
$this->extra = $extra;
return $content; return $content;
} }