Merge remote-tracking branch 'origin/3.0' into 3.1

Conflicts:
	tests/injector/InjectorTest.php
	tests/travis/before_script
This commit is contained in:
Ingo Schommer 2013-02-18 14:15:42 +01:00
commit a86e4ee00c
7 changed files with 65 additions and 2 deletions

View File

@ -0,0 +1,14 @@
if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
if(typeof(console) != 'undefined') console.error('Class ss.i18n not defined');
} else {
ss.i18n.addDictionary('nl_NL', {
'LeftAndMain.CONFIRMUNSAVED': "Weet u zeker dat u deze pagina wilt verlaten?\n\WAARSCHUWING: Uw veranderingen zijn niet opgeslagen.\n\nKies OK om te verlaten, of Cancel om op de huidige pagina te blijven.",
'LeftAndMain.CONFIRMUNSAVEDSHORT': "WAARSCHUWING: Uw veranderingen zijn niet opgeslagen",
'SecurityAdmin.BATCHACTIONSDELETECONFIRM': "Weet u zeker dat u deze groep %s wilt verwijderen?",
'ModelAdmin.SAVED': "Opgeslagen",
'ModelAdmin.REALLYDELETE': "Weet u zeker dat u wilt verwijderen?",
'ModelAdmin.DELETED': "Verwijderd",
'ModelAdmin.VALIDATIONERROR': "Validatie fout",
'LeftAndMain.PAGEWASDELETED': "Deze pagina is verwijderd. Om een pagina aan te passen, selecteer pagina aan de linkerkant."
});
}

View File

@ -774,6 +774,9 @@ class Injector {
if (isset($this->specs[$name])) {
$spec = $this->specs[$name];
$this->updateSpecConstructor($spec);
if ($constructorArgs) {
$spec['constructor'] = $constructorArgs;
}
return $this->instantiate($spec, $name);
}
}

View File

@ -928,7 +928,7 @@ class File extends DataObject {
if(!is_array($exts)) $exts = array($exts);
foreach($exts as $ext) {
if(is_subclass_of($ext, 'File')) {
if(!is_subclass_of($ext, 'File')) {
throw new InvalidArgumentException(
sprintf('Class "%s" (for extension "%s") is not a valid subclass of File', $class, $ext)
);

View File

@ -11,6 +11,31 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
'UNIQUEFIELD.CANNOTLEAVEEMPTY': 'Dit veld mag niet leeg blijven',
'RESTRICTEDTEXTFIELD.CHARCANTBEUSED': "Het karakter '%s' mag niet gebruikt worden in dit veld",
'UPDATEURL.CONFIRM': 'Wilt u de URL wijzigen naar:\n\n%s/\n\nKlik Ok om de URL te wijzigen, Klik Cancel om het'
+ ' te laten zoals het is:\n\n%s'
+ ' te laten zoals het is:\n\n%s',
'UPDATEURL.CONFIRMURLCHANGED':'Het URL is veranderd naar \n"%s"',
'FILEIFRAMEFIELD.DELETEFILE': 'Verwijder bestand',
'FILEIFRAMEFIELD.UNATTACHFILE': 'Deselecteer bestand',
'FILEIFRAMEFIELD.DELETEIMAGE': 'Verwijder afbeelding',
'FILEIFRAMEFIELD.CONFIRMDELETE': 'Weet u zeker dat u dit bestand wilt verwijderen?',
'LeftAndMain.IncompatBrowserWarning': 'Je huidige browser is niet compatible, gebruik één van deze browsers Internet Explorer 7+, Google Chrome 10+ or Mozilla Firefox 3.5+.',
'GRIDFIELD.ERRORINTRANSACTION': 'Er is een fout opgetreden bij het ophalen van gegevens van de server\n Probeer later opnieuw.',
'HtmlEditorField.SelectAnchor': 'Kies een anker',
'UploadField.ConfirmDelete': 'Weet u zeker dat u dit bestand wilt verwijderen uit het websitebestand?',
'UploadField.PHP_MAXFILESIZE': 'Bestandsgrootte is hoger dan upload_max_filesize (php.ini directive)',
'UploadField.HTML_MAXFILESIZE': 'Bestandsgrootte is hoger danMAX_FILE_SIZE (HTML form directive)',
'UploadField.ONLYPARTIALUPLOADED': 'Bestand is maar gedeeltelijk geupload',
'UploadField.NOFILEUPLOADED': 'Geen bestand is geupload',
'UploadField.NOTMPFOLDER': 'Mist een tijdelijke map',
'UploadField.WRITEFAILED': 'Kan bestand niet naar schijf schrijven',
'UploadField.STOPEDBYEXTENSION': 'Bestandsupload gestopt door extensie',
'UploadField.TOOLARGE': 'Bestandsgrootte is te groot',
'UploadField.TOOSMALL': 'Bestandsgrootte is te klein',
'UploadField.INVALIDEXTENSION': 'Extensie is niet toegestaan',
'UploadField.MAXNUMBEROFFILESSIMPLE': 'Maximaal aantal overschreven',
'UploadField.UPLOADEDBYTES': 'Upload overschrijd bestandsgrootte',
'UploadField.EMPTYRESULT': 'Leeg bestand geupload',
'UploadField.LOADING': 'Laden ...',
'UploadField.Editing': 'Bijwerken ...',
'UploadField.Uploaded': 'Geupload'
});
}

View File

@ -531,6 +531,15 @@ class InjectorTest extends SapphireTest {
$injector->registerNamedService('NamedService', $service);
$this->assertEquals($service, $injector->get('NamedService'));
}
public function testCreateConfiggedObjectWithCustomConstructorArgs() {
// need to make sure that even if the config defines some constructor params,
// that we take our passed in constructor args instead
$injector = new Injector(array('locator' => 'InjectorTestConfigLocator'));
$item = $injector->create('ConfigConstructor', 'othervalue');
$this->assertEquals($item->property, 'othervalue');
}
}
@ -540,6 +549,10 @@ class InjectorTestConfigLocator extends SilverStripeServiceConfigurationLocator
return array('class' => 'ConstructableObject', 'constructor' => array('%$OtherTestObject'));
}
if ($name == 'ConfigConstructor') {
return array('class' => 'ConstructableObject', 'constructor' => array('value'));
}
return parent::locateConfigFor($name);
}
}

View File

@ -0,0 +1,5 @@
tinyMCE.addI18n('nl.tinymce_ssbuttons', {
insertlink: 'Link toevoegen',
insertmedia: 'Media toevoegen',
insertflash: 'Flash Object toevoegen'
});

View File

@ -0,0 +1,3 @@
tinyMCE.addI18n('nl.tinymce_ssmacron', {
insertmacron: 'Een macron toevoegen'
});