{$title} is disabled
"; } else { echo "Build task '$taskName' not found."; if(class_exists($taskName)) echo " It isn't a subclass of BuildTask."; diff --git a/filesystem/Folder.php b/filesystem/Folder.php index 80b801322..efeb40167 100755 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -322,7 +322,7 @@ class Folder extends File { $fileList->setFolder($this); $fileList->setPopupCaption(_t('Folder.VIEWEDITASSET', "View/Edit Asset")); - $nameField = ($this->ID && $this->ID != "root") ? new TextField("Name", "Folder Name") : new HiddenField("Name"); + $nameField = ($this->ID && $this->ID != "root") ? new TextField("Name", _t('Folder.TITLE')) : new HiddenField("Name"); if( $this->canEdit() ) { $deleteButton = new InlineFormAction('deletemarked',_t('Folder.DELSELECTED','Delete selected files'), 'delete'); $deleteButton->includeDefaultJS(false); diff --git a/forms/CalendarDateField.php b/forms/CalendarDateField.php index 0080aa60a..bec022c43 100755 --- a/forms/CalendarDateField.php +++ b/forms/CalendarDateField.php @@ -16,6 +16,7 @@ HTML; } function Field() { + Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js"); Requirements::javascript(THIRDPARTY_DIR . "/calendar/calendar.js"); Requirements::javascript(THIRDPARTY_DIR . "/calendar/lang/calendar-en.js"); Requirements::javascript(THIRDPARTY_DIR . "/calendar/calendar-setup.js"); diff --git a/forms/ComplexTableField.php b/forms/ComplexTableField.php index 49bfaccdc..4bb4f9d2d 100755 --- a/forms/ComplexTableField.php +++ b/forms/ComplexTableField.php @@ -966,7 +966,10 @@ class ComplexTableField_Popup extends Form { $actions = new FieldSet(); if(!$readonly) { $actions->push( - $saveAction = new FormAction("saveComplexTableField", "Save") + $saveAction = new FormAction( + "saveComplexTableField", + _t('CMSMain.SAVE') + ) ); $saveAction->addExtraClass('save'); } diff --git a/forms/CountryDropdownField.php b/forms/CountryDropdownField.php index 4342f5989..2b13786b8 100644 --- a/forms/CountryDropdownField.php +++ b/forms/CountryDropdownField.php @@ -8,11 +8,11 @@ class CountryDropdownField extends DropdownField { protected $defaultToVisitorCountry = true; - function __construct($name, $title, $source = null, $value = "", $form=null) { + function __construct($name, $title = null, $source = null, $value = "", $form=null) { if(!is_array($source)) $source = Geoip::getCountryDropDown(); if(!$value) $value = Geoip::visitor_country(); - parent::__construct($name, $title, $source, $value, $form); + parent::__construct($name, ($title===null) ? $name : $title, $source, $value, $form); } function defaultToVisitorCountry($val) { diff --git a/forms/DropdownField.php b/forms/DropdownField.php index bf0b267c1..8cc06ccbb 100755 --- a/forms/DropdownField.php +++ b/forms/DropdownField.php @@ -71,6 +71,11 @@ class DropdownField extends FormField { $source = $this->getSource(); if($source) { + // For SQLMap sources, the empty string needs to be added specially + if(is_object($source) && $this->emptyString) { + $options .= $this->createTag('option', array('value' => ''), $this->emptyString); + } + foreach($source as $value => $title) { $selected = ($value == $this->value) ? 'selected' : null; if($selected && $this->value != 0) { diff --git a/forms/FieldSet.php b/forms/FieldSet.php index 8d6d70ee7..218148b2e 100755 --- a/forms/FieldSet.php +++ b/forms/FieldSet.php @@ -201,6 +201,22 @@ class FieldSet extends DataObjectSet { return false; } + /** + * Rename the title of a particular field name in this set. + * + * @param string $fieldName Name of field to rename title of + * @param string $newFieldTitle New title of field + * @return boolean + */ + function renameField($fieldName, $newFieldTitle) { + $field = $this->dataFieldByName($fieldName); + if(!$field) return false; + + $field->setTitle($newFieldTitle); + + return $field->Title() == $newFieldTitle; + } + /** * @return boolean */ @@ -456,25 +472,8 @@ class FieldSet extends DataObjectSet { */ function makeFieldReadonly($field) { $fieldName = ($field instanceof FormField) ? $field->Name() : $field; - - // Iterate on items, looking for the applicable field - foreach($this->items as $i => $item) { - if($item->isComposite()) { - $item->makeFieldReadonly($fieldName); - } else { - // Once it's found, use FormField::transform to turn the field into a readonly version of itself. - if($item->Name() == $fieldName) { - $this->items[$i] = $item->transform(new ReadonlyTransformation()); - - // Clear an internal cache - $this->sequentialSet = null; - - // A true results indicates that the field was foudn - return true; - } - } - } - return false; + $srcField = $this->dataFieldByName($fieldName); + $this->replaceField($fieldName, $srcField->performReadonlyTransformation()); } /** diff --git a/forms/FormScaffolder.php b/forms/FormScaffolder.php index d02b60189..aa5ddd08b 100644 --- a/forms/FormScaffolder.php +++ b/forms/FormScaffolder.php @@ -67,7 +67,10 @@ class FormScaffolder extends Object { $fields = new FieldSet(); // tabbed or untabbed - if($this->tabbed) $fields->push(new TabSet("Root", new Tab("Main"))); + if($this->tabbed) { + $fields->push(new TabSet("Root", $mainTab = new Tab("Main"))); + $mainTab->setTitle(_t('SiteTree.TABMAIN', "Main")); + } // add database fields foreach($this->obj->db() as $fieldName => $fieldType) { diff --git a/forms/HasManyComplexTableField.php b/forms/HasManyComplexTableField.php index 0cb54cdf0..5445e755d 100644 --- a/forms/HasManyComplexTableField.php +++ b/forms/HasManyComplexTableField.php @@ -68,33 +68,24 @@ class HasManyComplexTableField extends ComplexTableField { } function sourceItems() { - if($this->sourceItems) - return $this->sourceItems; + if($this->sourceItems) return $this->sourceItems; $limitClause = ''; - if(isset($_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ]) && is_numeric($_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ])) + if(isset($_REQUEST['ctf'][$this->Name()]['start']) && is_numeric($_REQUEST['ctf'][$this->Name()]['start'])) { $limitClause = $_REQUEST[ 'ctf' ][ $this->Name() ][ 'start' ] . ", $this->pageSize"; - else + } else { $limitClause = "0, $this->pageSize"; + } $dataQuery = $this->getQuery($limitClause); $records = $dataQuery->execute(); $items = new DataObjectSet(); - foreach($records as $record) { - if(! get_class($record)) - $record = new DataObject($record); - $items->push($record); - } + + $sourceClass = $this->sourceClass; + $dataobject = new $sourceClass(); + $items = $dataobject->buildDataObjectSet($records, 'DataObjectSet'); - $dataQuery = $this->getQuery(); - $records = $dataQuery->execute(); - $unpagedItems = new DataObjectSet(); - foreach($records as $record) { - if(! get_class($record)) - $record = new DataObject($record); - $unpagedItems->push($record); - } - $this->unpagedSourceItems = $unpagedItems; + $this->unpagedSourceItems = $dataobject->buildDataObjectSet($records, 'DataObjectSet'); $this->totalCount = ($this->unpagedSourceItems) ? $this->unpagedSourceItems->TotalItems() : null; @@ -133,9 +124,11 @@ class HasManyComplexTableField extends ComplexTableField { function ExtraData() { $items = array(); - foreach($this->unpagedSourceItems as $item) { - if($item->{$this->joinField} == $this->controller->ID) - $items[] = $item->ID; + if($this->unpagedSourceItems) { + foreach($this->unpagedSourceItems as $item) { + if($item->{$this->joinField} == $this->controller->ID) + $items[] = $item->ID; + } } $list = implode(',', $items); $inputId = $this->id() . '_' . $this->htmlListEndName; diff --git a/forms/HtmlEditorField.php b/forms/HtmlEditorField.php index 782f369af..1977fa522 100755 --- a/forms/HtmlEditorField.php +++ b/forms/HtmlEditorField.php @@ -26,11 +26,7 @@ class HtmlEditorField extends TextareaField { */ function Field() { Requirements::javascript(MCE_ROOT . "tiny_mce_src.js"); - Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js"); - Requirements::css('cms/css/TinyMCEImageEnhancement.css'); - Requirements::javascript('jsparty/SWFUpload/SWFUpload.js'); - Requirements::javascript('cms/javascript/Upload.js'); - Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js'); + Requirements::javascript(SAPPHIRE_DIR . '/javascript/HtmlEditorField.js'); // Don't allow unclosed tags - they will break the whole application ;-) $cleanVal = $this->value; @@ -353,6 +349,9 @@ class HtmlEditorField_Toolbar extends RequestHandler { * @return Form */ function LinkForm() { + Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js"); + Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js"); + $form = new Form( $this->controller, "{$this->name}/LinkForm", @@ -396,6 +395,10 @@ class HtmlEditorField_Toolbar extends RequestHandler { * @return Form */ function ImageForm() { + Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js"); + Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js"); + Requirements::css('cms/css/TinyMCEImageEnhancement.css'); + Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js'); Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/SWFUpload.js'); Requirements::javascript(CMS_DIR . '/javascript/Upload.js'); @@ -452,6 +455,8 @@ class HtmlEditorField_Toolbar extends RequestHandler { } function FlashForm() { + Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js"); + Requirements::javascript(THIRDPARTY_DIR . "/tiny_mce_improvements.js"); Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/SWFUpload.js'); Requirements::javascript(CMS_DIR . '/javascript/Upload.js'); diff --git a/integration/Geoip.php b/integration/Geoip.php index ca633fabb..ddcc39a13 100755 --- a/integration/Geoip.php +++ b/integration/Geoip.php @@ -1,11 +1,5 @@ "Zaire", 'ZW' => "Zimbabwe" ); - /** - * Returns the country code of the person given an IP + * Returns the country code of the person given an IP. + * * @param address - The IP address of the user, * @param codeOnly - Returns just the code of the IP instead of array( $CountryCode => $CountryName) */ static function ip2country($address, $codeOnly = false) { // Detect internal networks - this is us, so we're NZ - if(substr($address,0,7)=="192.168" || substr($address,0,4)=="127.") { - $code = "NZ"; + if(substr($address, 0, 7) == "192.168" || substr($address,0,4) == "127.") { + $code = 'NZ'; } else { - $cmd = "geoiplookup ".escapeshellarg($address); + $cmd = 'geoiplookup ' . escapeshellarg($address); exec($cmd, $result, $code); // Note: At time of writing, $result is always zero for this program - if ($code == 127) { - return false; - } - - if ($result == false) { - // don't return any error - @see http://open.silverstripe.com/ticket/1458 - //user_error("ip2country($address): geoiplookup executable returned nothing.", E_USER_NOTICE); - return false; - } + if($code == 127) return false; + if($result == false) return false; // Always returns one line of code, e.g. : // Geoip Country Edition: GB, United Kingdom // NZ - $country = $result[0]; $start = strpos($country, ':'); - if ($start) $start+=2; + if($start) $start += 2; $code = substr($country, $start, 2); // skip space } - if ($code == 'IP' || $code == '--') { - if (self::$default_country_code) $code = self::$default_country_code; + if($code == 'IP' || $code == '--') { + if(self::$default_country_code) $code = self::$default_country_code; else return false; } if(!$codeOnly) { $name = substr($country, $start+4); - if (! $name) $name = CountryCode2Name($code); + if(!$name) $name = $this->countryCode2name($code); return array('code' => $code, 'name' => $name); } else { @@ -358,7 +345,7 @@ class Geoip extends Object { foreach ($checks as $url => $expectedResponse) { $response = ip2country($url); - if (!$response && $expectedResponse) { + if(!$response && $expectedResponse) { user_error("ip2country_check failed sanity check: ip2country($url) returned false. Expected code: '$expectedResponse'", E_USER_WARNING); $status = false; } elseif ($response != $expectedResponse) { @@ -372,16 +359,10 @@ class Geoip extends Object { /** * Returns the country name from the appropriate code. + * @return null|string String if country found, null if none found */ - static function countryCode2name($code) { - $name = Geoip::$iso_3166_countryCodes[ $code ]; - if (! $name ) { - if (! $code ) - trigger_error("countryCode2name() Failed to find a country name as no code was provided.", E_USER_WARNING); - else - trigger_error("countryCode2name() Failed to find a country name matching the ISO 3166 code '$code'", E_USER_WARNING); - } - + static function countryCode2name($code) { + $name = isset(Geoip::$iso_3166_countryCodes[$code]) ? Geoip::$iso_3166_countryCodes[$code] : null; return $name; } diff --git a/javascript/lang/en_US.js b/javascript/lang/en_US.js index 45e062010..02a8cf98f 100644 --- a/javascript/lang/en_US.js +++ b/javascript/lang/en_US.js @@ -1,5 +1,5 @@ if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') { - console.error('Class ss.i18n not defined'); + if(typeof(console) != 'undefined') console.error('Class ss.i18n not defined'); } else { ss.i18n.addDictionary('en_US', { 'VALIDATOR.FIELDREQUIRED': 'Please fill out "%s", it is required.', diff --git a/javascript/lang/fr_FR.js b/javascript/lang/fr_FR.js new file mode 100644 index 000000000..725fbf278 --- /dev/null +++ b/javascript/lang/fr_FR.js @@ -0,0 +1,15 @@ +if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') { + console.error('Class ss.i18n not defined'); +} else { + ss.i18n.addDictionary('fr_FR', { + 'VALIDATOR.FIELDREQUIRED': 'Veuillez remplir "%s", c\'est un champ requis.', + 'HASMANYFILEFIELD.UPLOADING': 'Uploading... %s', + 'TABLEFIELD.DELETECONFIRMMESSAGE': 'Etes-vous sûr de vouloir supprimer cet enregistrement ?', + 'LOADING': 'chargement...', + 'UNIQUEFIELD.SUGGESTED': "Changez la valeur de '%s' : %s", + 'UNIQUEFIELD.ENTERNEWVALUE': 'You devez saisir une nouvelle valeur pou ce champ', + 'UNIQUEFIELD.CANNOTLEAVEEMPTY': 'Ce champ ne peut être laissé vide', + 'RESTRICTEDTEXTFIELD.CHARCANTBEUSED': "Le character '%s' ne peut être utilisé dans ce champ", + 'UPDATEURL.CONFIRM': 'Voulez-vous que je change l\'URL en:\n\n%s/\n\nCliquez Ok pour changer l\'URL, cliquez Annuler pour la laisser à:\n\n%s' + }); +} diff --git a/lang/de_DE.php b/lang/de_DE.php index 0fd368954..194084793 100644 --- a/lang/de_DE.php +++ b/lang/de_DE.php @@ -60,8 +60,19 @@ $lang['de_DE']['BBCodeParser']['UNORDEREDEXAMPLE1'] = 'Ungeordneter Eintrag 1'; $lang['de_DE']['BBCodeParser']['UNORDEREDEXAMPLE2'] = 'Ungeordneter Eintrag 2'; $lang['de_DE']['ChangePasswordEmail.ss']['CHANGEPASSWORDTEXT1'] = 'Sie haben ihr Passwort geändert für'; $lang['de_DE']['ChangePasswordEmail.ss']['CHANGEPASSWORDTEXT2'] = 'Sie können nun folgende Angaben benutzen um sich einzuloggen'; +$lang['de_DE']['ChangePasswordEmail.ss']['EMAIL'] = 'E-Mail'; $lang['de_DE']['ChangePasswordEmail.ss']['HELLO'] = 'Hi'; +$lang['de_DE']['ChangePasswordEmail.ss']['PASSWORD'] = 'Passwort'; +$lang['de_DE']['CMSMain']['DELETE'] = 'Von Entwurf-Seite löschen'; +$lang['de_DE']['CollectionController.ss']['ADDNEWRECORD'] = 'Neuen Eintrag hinzufügen'; +$lang['de_DE']['CollectionController.ss']['SEARCH'] = 'Suche'; +$lang['de_DE']['CollectionController_Results.ss']['NEXT'] = 'nächster'; +$lang['de_DE']['CollectionController_Results.ss']['NORESULTSFOUND'] = 'Keine Einträge gefunden'; +$lang['de_DE']['CollectionController_Results.ss']['PREV'] = 'vorheriger'; +$lang['de_DE']['CollectionController_Results.ss']['RESULTS'] = 'Ergebnisse'; +$lang['de_DE']['ComplexTableField']['CLOSEPOPUP'] = 'Popup schließen'; $lang['de_DE']['ComplexTableField.ss']['ADDITEM'] = 'Hinzufügen'; +$lang['de_DE']['ComplexTableField.ss']['CSVEXPORT'] = 'CSV Export'; $lang['de_DE']['ComplexTableField.ss']['DELETE'] = 'löschen'; $lang['de_DE']['ComplexTableField.ss']['DELETEROW'] = 'Zeile löschen'; $lang['de_DE']['ComplexTableField.ss']['EDIT'] = 'ändern'; @@ -95,6 +106,8 @@ $lang['de_DE']['CreditCardField']['VALIDATIONJS1'] = 'Bitte versichern Sie sich, $lang['de_DE']['CreditCardField']['VALIDATIONJS2'] = 'Kreditkartenummer richtig'; $lang['de_DE']['CurrencyField']['CURRENCYSYMBOL'] = '€'; $lang['de_DE']['CurrencyField']['VALIDATIONJS'] = 'Bitte geben Sie eine gültige Währung ein.'; +$lang['de_DE']['DataObject']['PLURALNAME'] = 'DataObjects'; +$lang['de_DE']['DataObject']['SINGULARNAME'] = 'DataObject'; $lang['de_DE']['DataReport']['EXPORTCSV'] = 'Ins CSV exportieren.'; $lang['de_DE']['Date']['AGO'] = 'vor'; $lang['de_DE']['Date']['AWAY'] = 'weg'; @@ -108,6 +121,8 @@ $lang['de_DE']['Date']['MONTH'] = 'Monat'; $lang['de_DE']['Date']['MONTHS'] = 'Monat'; $lang['de_DE']['Date']['SEC'] = 'Sekunden'; $lang['de_DE']['Date']['SECS'] = 'Sekunden'; +$lang['de_DE']['Date']['TIMEDIFFAGO'] = 'vor %s'; +$lang['de_DE']['Date']['TIMEDIFFAWAY'] = 'noch %s'; $lang['de_DE']['Date']['YEAR'] = 'Jahr'; $lang['de_DE']['Date']['YEARS'] = 'Jahre'; $lang['de_DE']['DateField']['NODATESET'] = 'Kein Datum gesetzt.'; @@ -145,8 +160,12 @@ $lang['de_DE']['ErrorPage']['505'] = '505 - HTTP Version wird nicht unterstützt $lang['de_DE']['ErrorPage']['CODE'] = 'Fehlercode'; $lang['de_DE']['ErrorPage']['DEFAULTERRORPAGECONTENT'] = 'Entschuldigung, möglicherweise versuchen Sie eine Seite zu erreichen die nicht existiert.
Bitte überprüfen Sie die Schreibweise der URL die Sie versucht haben zu erreichen und versuchen Sie es noch einmal.
'; $lang['de_DE']['ErrorPage']['DEFAULTERRORPAGETITLE'] = 'Seite nicht gefunden'; +$lang['de_DE']['ErrorPage']['PLURALNAME'] = 'Fehlerseiten'; +$lang['de_DE']['ErrorPage']['SINGULARNAME'] = 'Fehlerseite'; $lang['de_DE']['File']['NOFILESIZE'] = 'Dateigröße ist 0 bytes'; -$lang['de_DE']['FileIFrameField']['NOTEADDFILES'] = 'Sie können Dateien hinzufügen sobald Sie das erste mal gespeichert haben'; +$lang['de_DE']['File']['PLURALNAME'] = 'Dateien'; +$lang['de_DE']['File']['SINGULARNAME'] = 'Datei'; +$lang['de_DE']['FileIframeField']['NOTEADDFILES'] = 'Sie können Dateien hinzufügen sobald Sie das erste mal gespeichert haben'; $lang['de_DE']['Folder']['CREATED'] = 'Zuerst hochgeladen'; $lang['de_DE']['Folder']['DELETEUNUSEDTHUMBNAILS'] = 'löschen ungebrauchte Vorschaubilder'; $lang['de_DE']['Folder']['DELSELECTED'] = 'Löschen selektierte Dateien'; @@ -154,6 +173,8 @@ $lang['de_DE']['Folder']['DETAILSTAB'] = 'Detail'; $lang['de_DE']['Folder']['FILENAME'] = 'Dateiname'; $lang['de_DE']['Folder']['FILESTAB'] = 'Dateien'; $lang['de_DE']['Folder']['LASTEDITED'] = 'Zuletzt geändert'; +$lang['de_DE']['Folder']['PLURALNAME'] = 'Ordner'; +$lang['de_DE']['Folder']['SINGULARNAME'] = 'Ordner'; $lang['de_DE']['Folder']['TITLE'] = 'Titel'; $lang['de_DE']['Folder']['TYPE'] = 'Typ'; $lang['de_DE']['Folder']['UNUSEDFILESTAB'] = 'ungebrauchte Dateien'; @@ -185,6 +206,10 @@ $lang['de_DE']['Form']['VALIDATOR'] = 'Prüfer'; $lang['de_DE']['Form']['VALIDCURRENCY'] = 'Bitte geben Sie eine gültige Währung an'; $lang['de_DE']['FormField']['NONE'] = 'keine'; $lang['de_DE']['GhostPage']['NOLINKED'] = 'Diese Stellvertreter-Seite ist nicht verlinkt.'; +$lang['de_DE']['GhostPage']['PLURALNAME'] = 'Kopien'; +$lang['de_DE']['GhostPage']['SINGULARNAME'] = 'Kopie'; +$lang['de_DE']['Group']['PLURALNAME'] = 'Gruppen'; +$lang['de_DE']['Group']['SINGULARNAME'] = 'Gruppe'; $lang['de_DE']['GSTNumberField']['VALIDATION'] = 'Bitte geben Sie eine gültige GST Nummer ein'; $lang['de_DE']['GSTNumberField']['VALIDATIONJS'] = 'Bitte geben Sie eine korrekte Steuernummer ein.'; $lang['de_DE']['HtmlEditorField']['ALTTEXT'] = 'Beschreibung'; @@ -230,6 +255,7 @@ $lang['de_DE']['HtmlEditorField']['FORMATH4'] = 'Überschrift 4'; $lang['de_DE']['HtmlEditorField']['FORMATH5'] = 'Überschrift 5'; $lang['de_DE']['HtmlEditorField']['FORMATH6'] = 'Überschrift 6'; $lang['de_DE']['HtmlEditorField']['FORMATP'] = 'Paragraph'; +$lang['de_DE']['HtmlEditorField']['FORMATPRE'] = 'Präformatiert'; $lang['de_DE']['HtmlEditorField']['HR'] = 'Horizontale Linie einfügen'; $lang['de_DE']['HtmlEditorField']['IMAGE'] = 'Bild'; $lang['de_DE']['HtmlEditorField']['IMAGEDIMENSIONS'] = 'Dimensionen'; @@ -264,6 +290,8 @@ $lang['de_DE']['HtmlEditorField']['UNLINK'] = 'Verweis entfernen'; $lang['de_DE']['HtmlEditorField']['UPLOAD'] = 'hochladen'; $lang['de_DE']['HtmlEditorField']['URL'] = 'URL'; $lang['de_DE']['HtmlEditorField']['VISUALAID'] = 'Hinweistexte anzeigen/verbergen'; +$lang['de_DE']['Image']['PLURALNAME'] = 'Bilder'; +$lang['de_DE']['Image']['SINGULARNAME'] = 'Bild'; $lang['de_DE']['ImageField']['NOTEADDIMAGES'] = 'Sie können Bilder hinzufügen nachdem Sie das erste mal gespeichert haben'; $lang['de_DE']['ImageUplaoder']['ONEFROMFILESTORE'] = 'mit einem aus dem Dateispeicher'; $lang['de_DE']['ImageUploader']['ATTACH'] = '%s anhängen'; @@ -274,6 +302,8 @@ $lang['de_DE']['ImageUploader']['ONEFROMCOMPUTER'] = 'mit einer von Ihrem Comput $lang['de_DE']['ImageUploader']['REALLYDELETE'] = 'Möchten Sie wirklich %s löschen?'; $lang['de_DE']['ImageUploader']['REPLACE'] = 'Ersetzen'; $lang['de_DE']['Image_iframe.ss']['TITLE'] = 'Iframe Bilder hochladen'; +$lang['de_DE']['LoginAttempt']['PLURALNAME'] = 'Loginversuche'; +$lang['de_DE']['LoginAttempt']['SINGULARNAME'] = 'Login-Versuch'; $lang['de_DE']['Member']['ADDRESS'] = 'Adresse'; $lang['de_DE']['Member']['BUTTONCHANGEPASSWORD'] = 'Passwort ändern'; $lang['de_DE']['Member']['BUTTONLOGIN'] = 'Einloggen'; @@ -303,7 +333,10 @@ $lang['de_DE']['Member']['PASSWORD'] = 'Passwort'; $lang['de_DE']['Member']['PASSWORDCHANGED'] = 'Ihr Passwort wurde geändert und eine Kopie wurde per Email an Sie versendet'; $lang['de_DE']['Member']['PERSONALDETAILS'] = 'Persönliche Daten'; $lang['de_DE']['Member']['PHONE'] = 'Telefon'; +$lang['de_DE']['Member']['PLURALNAME'] = 'Benutzer'; $lang['de_DE']['Member']['REMEMBERME'] = 'Für das nächste mal merken?'; +$lang['de_DE']['Member']['SECURITYGROUPS'] = 'Sicherheitsgruppen'; +$lang['de_DE']['Member']['SINGULARNAME'] = 'Benutzer'; $lang['de_DE']['Member']['SUBJECTPASSWORDCHANGED'] = 'Ihr Passwort wurde geändert'; $lang['de_DE']['Member']['SUBJECTPASSWORDRESET'] = 'Ihr Link zur Passwortrücksetzung'; $lang['de_DE']['Member']['SURNAME'] = 'Nachname'; @@ -312,19 +345,32 @@ $lang['de_DE']['Member']['VALIDATIONMEMBEREXISTS'] = 'Es gibt bereits ein Mitgli $lang['de_DE']['Member']['WELCOMEBACK'] = 'Willkommen zurück %s'; $lang['de_DE']['Member']['YOUROLDPASSWORD'] = 'Ihr alten Passwort'; $lang['de_DE']['MemberAuthenticator']['TITLE'] = 'Email & Passwort'; +$lang['de_DE']['MemberPassword']['PLURALNAME'] = 'Benutzerpasswörter'; +$lang['de_DE']['MemberPassword']['SINGULARNAME'] = 'Benutzerpasswort'; $lang['de_DE']['NumericField']['VALIDATION'] = '%s ist keine Zahl, nur Zahlen dürfen in dieses Feld eingetragen werden'; $lang['de_DE']['NumericField']['VALIDATIONJS'] = 'ist keine Ziffer. Dieses Feld akzeptiert nur Ziffern.'; +$lang['de_DE']['Page']['PLURALNAME'] = 'Seiten'; +$lang['de_DE']['Page']['SINGULARNAME'] = 'Seite'; $lang['de_DE']['Permission']['FULLADMINRIGHTS'] = 'Unbeschränkte Administratorenrechte'; $lang['de_DE']['Permission']['PERMSDEFINED'] = 'Die folgenden Berechtigungen sind definiert:'; +$lang['de_DE']['Permission']['PLURALNAME'] = 'Zugriffsberechtigungen'; +$lang['de_DE']['Permission']['SINGULARNAME'] = 'Zugriffsberechtigung'; $lang['de_DE']['PhoneNumberField']['VALIDATION'] = 'Bitte geben Sie eine gültige Telefonnummer ein'; +$lang['de_DE']['QueuedEmail']['PLURALNAME'] = 'Emails'; +$lang['de_DE']['QueuedEmail']['SINGULARNAME'] = 'Zeitverzögerte Email'; +$lang['de_DE']['RecordController']['DELETESUCCESS'] = 'Eintrag erfolgreich gelöscht'; +$lang['de_DE']['RecordController']['SAVESUCCESS'] = 'Eintrag gespeichert'; $lang['de_DE']['RedirectorPage']['HASBEENSETUP'] = 'Eine Weiterleitungsseite wurde erstellt ohne das eine Weiterleitung definiert wurde.'; $lang['de_DE']['RedirectorPage']['HEADER'] = 'Diese Seite wird Nutzer auf eine andere Seite weiterleiten'; $lang['de_DE']['RedirectorPage']['OTHERURL'] = 'Andere Webseiten URL'; +$lang['de_DE']['RedirectorPage']['PLURALNAME'] = 'Weiterleitungen'; $lang['de_DE']['RedirectorPage']['REDIRECTTO'] = 'Weiterleiten zu'; $lang['de_DE']['RedirectorPage']['REDIRECTTOEXTERNAL'] = 'Andere Website'; $lang['de_DE']['RedirectorPage']['REDIRECTTOPAGE'] = 'Eine Seite auf Ihrer Website'; +$lang['de_DE']['RedirectorPage']['SINGULARNAME'] = 'Weiterleitung'; $lang['de_DE']['RedirectorPage']['YOURPAGE'] = 'Seite auf Ihrer Website'; $lang['de_DE']['RelationComplexTableField.ss']['ADD'] = 'Hinzufügen'; +$lang['de_DE']['RelationComplexTableField.ss']['CSVEXPORT'] = 'CSV Export'; $lang['de_DE']['RelationComplexTableField.ss']['DELETE'] = 'löschen'; $lang['de_DE']['RelationComplexTableField.ss']['EDIT'] = 'editieren'; $lang['de_DE']['RelationComplexTableField.ss']['NOTFOUND'] = 'Keine Artikel gefunden'; @@ -380,7 +426,7 @@ $lang['de_DE']['SiteTree']['ALLOWCOMMENTS'] = 'Kommentare auf dieser Seite erlau $lang['de_DE']['SiteTree']['APPEARSVIRTUALPAGES'] = 'Dieser Inhalt erscheint auch auf den virtuellen Seiten im %s Bereich.'; $lang['de_DE']['SiteTree']['BUTTONCANCELDRAFT'] = 'Verwerfe Entwurfsänderungen'; $lang['de_DE']['SiteTree']['BUTTONCANCELDRAFTDESC'] = 'Löschen Sie Ihren Entwurf und kehren Sie zur derzeit veröffentlichten Seite zurück.'; -$lang['de_DE']['SiteTree']['BUTTONSAVEPUBLISH'] = 'Sichern & Veröffentlichen'; +$lang['de_DE']['SiteTree']['BUTTONSAVEPUBLISH'] = 'Speichern und Veröffentlichen'; $lang['de_DE']['SiteTree']['BUTTONUNPUBLISH'] = 'Veröffentlichung zurücknehmen'; $lang['de_DE']['SiteTree']['BUTTONUNPUBLISHDESC'] = 'Entferne diese Seite aus der veröffentlichten Website'; $lang['de_DE']['SiteTree']['CHANGETO'] = 'Ändern zu'; @@ -416,12 +462,15 @@ $lang['de_DE']['SiteTree']['NOTEUSEASHOMEPAGE'] = 'Diese Seite als "Homepage" f $lang['de_DE']['SiteTree']['PAGESLINKING'] = 'Die folgenden Seiten verweisen auf diese Seite:'; $lang['de_DE']['SiteTree']['PAGETITLE'] = 'Seiten Name'; $lang['de_DE']['SiteTree']['PAGETYPE'] = 'Seitentyp'; +$lang['de_DE']['SiteTree']['PLURALNAME'] = 'Seiten'; +$lang['de_DE']['SiteTree']['PRIORITYAUTOSET'] = 'Automatisch, basierend auf der Tiefe der Verschachtelung der Seite'; $lang['de_DE']['SiteTree']['PRIORITYLEASTIMPORTANT'] = 'am wenigsten wichtig'; $lang['de_DE']['SiteTree']['PRIORITYMOSTIMPORTANT'] = 'am wichtigsten'; $lang['de_DE']['SiteTree']['PRIORITYNOTINDEXED'] = 'Nicht indiziert.'; $lang['de_DE']['SiteTree']['REMOVEDFROMDRAFT'] = 'von der Entwurfsseite entfernt '; $lang['de_DE']['SiteTree']['SHOWINMENUS'] = 'In Menüs anzeigen?'; $lang['de_DE']['SiteTree']['SHOWINSEARCH'] = 'In der Suche anzeigen?'; +$lang['de_DE']['SiteTree']['SINGULARNAME'] = 'Seite'; $lang['de_DE']['SiteTree']['TABACCESS'] = 'Zugriff'; $lang['de_DE']['SiteTree']['TABBACKLINKS'] = 'Rückverweise'; $lang['de_DE']['SiteTree']['TABBEHAVIOUR'] = 'Verhalten'; @@ -461,5 +510,11 @@ $lang['de_DE']['TypeDropdown']['NONE'] = 'Keine'; $lang['de_DE']['VirtualPage']['CHOOSE'] = 'Wählen Sie eine Seite auf die Sie verweisen möchten'; $lang['de_DE']['VirtualPage']['EDITCONTENT'] = 'drücken Sie hier um den Inhalt abzuändern'; $lang['de_DE']['VirtualPage']['HEADER'] = 'Dies ist eine virtuelle Seite'; -$lang['de_DE']['ConfirmedFormAction']['CONFIRMATION'] = 'Sind Sie sicher?'; +$lang['de_DE']['VirtualPage']['PLURALNAME'] = 'Virtuelle Seiten'; +$lang['de_DE']['VirtualPage']['SINGULARNAME'] = 'Virtuelle Seite'; +$lang['de_DE']['Widget']['PLURALNAME'] = 'Widgets'; +$lang['de_DE']['Widget']['SINGULARNAME'] = 'Widget'; +$lang['de_DE']['WidgetArea']['PLURALNAME'] = 'Widgetbereiche'; +$lang['de_DE']['WidgetArea']['SINGULARNAME'] = 'Widgetbereich'; + ?> \ No newline at end of file diff --git a/lang/en_US.php b/lang/en_US.php index 6ebf98a24..335bba051 100644 --- a/lang/en_US.php +++ b/lang/en_US.php @@ -2,6 +2,16 @@ global $lang; +$lang['en_US']['Page']['PLURALNAME'] = array( + 'Pags', + 50, + 'Pural name of the object, used in dropdowns and to generally identify a collection of this object in the interface' +); +$lang['en_US']['Page']['SINGULARNAME'] = array( + 'Page', + 50, + 'Singular name of the object, used in dropdowns and to generally identify a single object in the interface' +); $lang['en_US']['AdvancedSearchForm']['ALLWORDS'] = 'All Words'; $lang['en_US']['AdvancedSearchForm']['ATLEAST'] = 'At Least One Of the Words'; $lang['en_US']['AdvancedSearchForm']['EXACT'] = 'Exact Phrase'; @@ -107,8 +117,6 @@ $lang['en_US']['DataObject']['SINGULARNAME'] = array( 50, 'Singular name of the object, used in dropdowns and to generally identify a single object in the interface' ); -$lang['en_US']['Date']['AGO'] = ' ago'; -$lang['en_US']['Date']['AWAY'] = ' away'; $lang['en_US']['Date']['DAY'] = ' day'; $lang['en_US']['Date']['DAYS'] = ' days'; $lang['en_US']['Date']['HOUR'] = ' hour'; @@ -119,6 +127,16 @@ $lang['en_US']['Date']['MONTH'] = ' month'; $lang['en_US']['Date']['MONTHS'] = ' months'; $lang['en_US']['Date']['SEC'] = ' sec'; $lang['en_US']['Date']['SECS'] = ' secs'; +$lang['en_US']['Date']['TIMEDIFFAGO'] = array( + '%s ago', + PR_MEDIUM, + 'Natural language time difference, e.g. 2 hours ago' +); +$lang['en_US']['Date']['TIMEDIFFAWAY'] = array( + '%s away', + PR_MEDIUM, + 'Natural language time difference, e.g. 2 hours away' +); $lang['en_US']['Date']['YEAR'] = ' year'; $lang['en_US']['Date']['YEARS'] = ' years'; $lang['en_US']['DateField']['NODATESET'] = 'No date set'; @@ -664,9 +682,11 @@ $lang['en_US']['SiteTree']['BUTTONCANCELDRAFTDESC'] = 'Delete your draft and rev $lang['en_US']['SiteTree']['BUTTONSAVEPUBLISH'] = 'Save and Publish'; $lang['en_US']['SiteTree']['BUTTONUNPUBLISH'] = 'Unpublish'; $lang['en_US']['SiteTree']['BUTTONUNPUBLISHDESC'] = 'Remove this page from the published site'; -$lang['en_US']['SiteTree']['CHANGETO'] = 'Change to'; -$lang['en_US']['SiteTree']['CURRENT'] = 'current'; -$lang['en_US']['SiteTree']['CURRENTLY'] = 'Currently'; +$lang['en_US']['SiteTree']['CHANGETO'] = array( + 'Change to "%s"', + PR_MEDIUM, + 'Pagetype selection dropdown with class names' +); $lang['en_US']['SiteTree']['Comments'] = 'Comments'; $lang['en_US']['SiteTree']['Content'] = array( 'Content', diff --git a/main.php b/main.php index 88545c462..a2dc866db 100644 --- a/main.php +++ b/main.php @@ -76,9 +76,13 @@ if (isset($_GET['url'])) { // Lighttpd uses this } else { - list($url, $query) = explode('?', $_SERVER['REQUEST_URI'], 2); - parse_str($query, $_GET); - if ($_GET) $_REQUEST = array_merge((array)$_REQUEST, (array)$_GET); + if(strpos($_SERVER['REQUEST_URI'],'?') !== false) { + list($url, $query) = explode('?', $_SERVER['REQUEST_URI'], 2); + parse_str($query, $_GET); + if ($_GET) $_REQUEST = array_merge((array)$_REQUEST, (array)$_GET); + } else { + $url = $_SERVER["REQUEST_URI"]; + } } // Fix glitches in URL generation @@ -96,7 +100,8 @@ require_once("core/model/DB.php"); // Redirect to the installer if no database is selected if(!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) { - $installURL = dirname(dirname($_SERVER['SCRIPT_NAME'])) . '/install.php'; + $s = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 's' : ''; + $installURL = "http$s://" . $_SERVER['HTTP_HOST'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . '/install.php'; header("Location: $installURL"); die(); } diff --git a/parsers/BBCodeParser.php b/parsers/BBCodeParser.php index 7225d0534..d07a75777 100644 --- a/parsers/BBCodeParser.php +++ b/parsers/BBCodeParser.php @@ -51,8 +51,32 @@ class BBCodeParser extends TextParser { new ArrayData(array( "Title" => _t('BBCodeParser.ALIGNEMENT', 'Alignment'), "Example" => '[align=right]'._t('BBCodeParser.ALIGNEMENTEXAMPLE', 'right aligned').'[/align]' + )), + new ArrayData(array( + "Title" => _t('BBCodeParser.CODE', 'Code Block'), + "Description" => _t('BBCodeParser.CODEDESCRIPTION', 'Unformatted code block'), + "Example" => '[code]'._t('BBCodeParser.CODEEXAMPLE', 'Code block').'[/code]' + )), + new ArrayData(array( + "Title" => _t('BBCodeParser.EMAILLINK', 'Email link'), + "Description" => _t('BBCodeParser.EMAILLINKDESCRIPTION', 'Create link to an email address'), + "Example" => "[email]you@yoursite.com[/email]" + )), + new ArrayData(array( + "Title" => _t('BBCodeParser.EMAILLINK', 'Email link'), + "Description" => _t('BBCodeParser.EMAILLINKDESCRIPTION', 'Create link to an email address'), + "Example" => "[email=you@yoursite.com]Email[/email]" + )), + new ArrayData(array( + "Title" => _t('BBCodeParser.UNORDERED', 'Unordered list'), + "Description" => _t('BBCodeParser.UNORDEREDDESCRIPTION', 'Unordered list'), + "Example" => '[ulist][*]'._t('BBCodeParser.UNORDEREDEXAMPLE1', 'unordered item 1').'[/ulist]' + )), + new ArrayData(array( + "Title" => _t('BBCodeParser.IMAGE', 'Image'), + "Description" => _t('BBCodeParser.IMAGEDESCRIPTION', 'Show an image in your post'), + "Example" => "[img]http://www.website.com/image.jpg[/img]" )), - new ArrayData(array( "Title" => _t('BBCodeParser.LINK', 'Website link'), "Description" => _t('BBCodeParser.LINKDESCRIPTION', 'Link to another website or URL'), @@ -61,37 +85,8 @@ class BBCodeParser extends TextParser { new ArrayData(array( "Title" => _t('BBCodeParser.LINK', 'Website link'), "Description" => _t('BBCodeParser.LINKDESCRIPTION', 'Link to another website or URL'), - "Example" => "[url=http://www.website.com/]Some website[/url]" - )), - new ArrayData(array( - "Title" => _t('BBCodeParser.EMAILLINK', 'Email link'), - "Description" => _t('BBCodeParser.EMAILLINKDESCRIPTION', 'Create link to an email address'), - "Example" => "[email]you@yoursite.com[/email]" - )), - new ArrayData(array( - "Title" => _t('BBCodeParser.EMAILLINK', 'Email link'), - "Description" => _t('BBCodeParser.EMAILLINKDESCRIPTION', 'Create link to an email address'), - "Example" => "[email=you@yoursite.com]email me[/email]" - )), - - new ArrayData(array( - "Title" => _t('BBCodeParser.IMAGE', 'Image'), - "Description" => _t('BBCodeParser.IMAGEDESCRIPTION', 'Show an image in your post'), - "Example" => "[img]http://www.website.com/image.jpg[/img]" - )), - - new ArrayData(array( - "Title" => _t('BBCodeParser.CODE', 'Code Block'), - "Description" => _t('BBCodeParser.CODEDESCRIPTION', 'Unformatted code block'), - "Example" => '[code]'._t('BBCodeParser.CODEEXAMPLE', 'Code block').'[/code]' - )), - new ArrayData(array( - "Title" => _t('BBCodeParser.UNORDERED', 'Unordered list'), - "Description" => _t('BBCodeParser.UNORDEREDDESCRIPTION', 'Unordered list'), - "Example" => '[ulist][*]'._t('BBCodeParser.UNORDEREDEXAMPLE1', 'unordered item 1').'[*]'._t('BBCodeParser.UNORDEREDEXAMPLE2', 'unordered item 2').'[/ulist]' - )) - - + "Example" => "[url=http://www.website.com/]Website[/url]" + )) ); } @@ -107,6 +102,10 @@ class BBCodeParser extends TextParser { $this->content = str_replace(array('&', '<', '>'), array('&', '<', '>'), $this->content); $this->content = SSHTMLBBCodeParser::staticQparse($this->content); $this->content = "".$this->content."
"; + + $this->content = preg_replace('/(]*>)\s+/i', '\\1', $this->content); + $this->content = preg_replace('/\s+(<\/p[^>]*>)/i', '\\1', $this->content); + $this->content = preg_replace("/\n\s*\n/", "
", $this->content);
$this->content = str_replace("\n", "
", $this->content);
return $this->content;
diff --git a/parsers/HTML/BBCodeParser/Filter/Extended.php b/parsers/HTML/BBCodeParser/Filter/Extended.php
index 7f49dafc9..9858ad4c9 100644
--- a/parsers/HTML/BBCodeParser/Filter/Extended.php
+++ b/parsers/HTML/BBCodeParser/Filter/Extended.php
@@ -65,12 +65,12 @@ class SSHTMLBBCodeParser_Filter_Extended extends SSHTMLBBCodeParser_Filter
'htmlclose' => 'q',
'allowed' => 'all',
'attributes'=> array('quote' =>'cite=%2$s%1$s%2$s')),
- 'code' => array('htmlopen' => 'div class="codesnippet"',
- 'htmlclose' => 'div',
+ 'code' => array('htmlopen' => 'div class="codesnippet">
'p> 'all', 'attributes' => array()), - 'php' => array('htmlopen' => 'div class="codesnippet"', - 'htmlclose' => 'div', + 'php' => array('htmlopen' => 'div class="codesnippet">
'p> 'all', 'attributes' => array()), 'h1' => array('htmlopen' => 'h1', diff --git a/security/Member.php b/security/Member.php index e0255e596..b62303bde 100644 --- a/security/Member.php +++ b/security/Member.php @@ -819,12 +819,13 @@ class Member extends DataObject { $password = new ConfirmedPasswordField( 'Password', - 'Password', + null, null, null, true // showOnClick ); $password->setCanBeEmpty(true); + if(!$this->ID) $password->showOnClick = false; $mainFields->replaceField('Password', $password); $mainFields->insertBefore( @@ -860,6 +861,7 @@ class Member extends DataObject { $mainFields->removeByName('Salt'); $mainFields->removeByName('NumVisit'); $mainFields->removeByName('LastVisited'); + $mainFields->removeByName('BlacklistedEmail'); $fields->removeByName('Subscriptions'); $fields->removeByName('UnsubscribedRecords'); diff --git a/tests/api/RestfulServerTest.php b/tests/api/RestfulServerTest.php index eac8dac70..9e8b80a9f 100644 --- a/tests/api/RestfulServerTest.php +++ b/tests/api/RestfulServerTest.php @@ -70,6 +70,26 @@ class RestfulServerTest extends SapphireTest { unset($_SERVER['PHP_AUTH_USER']); unset($_SERVER['PHP_AUTH_PW']); } + + public function testGETRelationshipsXML() { + $author1 = $this->objFromFixture('RestfulServerTest_Author', 'author1'); + $rating1 = $this->objFromFixture('RestfulServerTest_AuthorRating', 'rating1'); + $rating2 = $this->objFromFixture('RestfulServerTest_AuthorRating', 'rating2'); + + // @todo should be set up by fixtures, doesn't work for some reason... + $author1->Ratings()->add($rating1); + $author1->Ratings()->add($rating2); + + $url = "/api/v1/RestfulServerTest_Author/" . $author1->ID; + $response = Director::test($url, null, null, 'GET'); + $this->assertEquals($response->getStatusCode(), 200); + + $responseArr = Convert::xml2array($response->getBody()); + $ratingsArr = $responseArr['Ratings']['RestfulServerTest_AuthorRating']; + $this->assertEquals(count($ratingsArr), 2); + $this->assertEquals($ratingsArr[0]['@attributes']['id'], $rating1->ID); + $this->assertEquals($ratingsArr[1]['@attributes']['id'], $rating2->ID); + } public function testPUTWithFormEncoded() { $_SERVER['PHP_AUTH_USER'] = 'editor@test.com'; @@ -366,6 +386,10 @@ class RestfulServerTest_Author extends DataObject implements TestOnly { static $has_many = array( 'Ratings' => 'RestfulServerTest_AuthorRating', ); + + public function canView($member = null) { + return true; + } } class RestfulServerTest_AuthorRating extends DataObject implements TestOnly { diff --git a/tests/api/RestfulServerTest.yml b/tests/api/RestfulServerTest.yml index a899f684e..1b7a0b242 100644 --- a/tests/api/RestfulServerTest.yml +++ b/tests/api/RestfulServerTest.yml @@ -1,7 +1,3 @@ -RestfulServerTest_Comment: - comment1: - Name: Joe - Comment: This is a test comment Member: editor: FirstName: Editor @@ -39,6 +35,11 @@ Permission: RestfulServerTest_Page: page1: Title: Testpage without API Access +RestfulServerTest_Comment: + comment1: + Name: Joe + Comment: This is a test comment + Page: =>RestfulServerTest_Page.page1 RestfulServerTest_Author: author1: FirstName: Author 1 @@ -48,6 +49,9 @@ RestfulServerTest_AuthorRating: WriteProtectedField: Dont overwrite me SecretField: Dont look at me! Author: =>RestfulServerTest_Author.author1 + rating2: + Rating: 5 + Author: =>RestfulServerTest_Author.author1 RestfulServerTest_SecretThing: thing1: Name: Unspeakable \ No newline at end of file diff --git a/tests/api/RestfulServiceTest.php b/tests/api/RestfulServiceTest.php index 9a7018965..8f2ce3cd3 100644 --- a/tests/api/RestfulServiceTest.php +++ b/tests/api/RestfulServiceTest.php @@ -40,7 +40,7 @@ class RestfulServiceTest extends SapphireTest { } function testPostData() { - $connection = new RestfulService(Director::absoluteBaseURL()); + $connection = new RestfulService(Director::absoluteBaseURL(), 0); $test1params = array( 'test1a' => mktime(), 'test1b' => mt_rand(), @@ -88,4 +88,4 @@ XML; } } -?> \ No newline at end of file +?> diff --git a/tests/forms/FieldSetTest.php b/tests/forms/FieldSetTest.php index a5b854d5c..8ed27f4d4 100644 --- a/tests/forms/FieldSetTest.php +++ b/tests/forms/FieldSetTest.php @@ -166,6 +166,24 @@ class FieldSetTest extends SapphireTest { /* We have 1 field inside our tab */ $this->assertEquals(1, $tab->Fields()->Count()); } + + function testRenameField() { + $fields = new FieldSet(); + $nameField = new TextField('Name', 'Before title'); + $fields->push($nameField); + + /* The title of the field object is the same as what we put in */ + $this->assertSame('Before title', $nameField->Title()); + + /* The field gets renamed to a different title */ + $fields->renameField('Name', 'After title'); + + /* The title of the field object is the title we renamed to, this + includes the original object we created ($nameField), and getting + the field back out of the set */ + $this->assertSame('After title', $nameField->Title()); + $this->assertSame('After title', $fields->dataFieldByName('Name')->Title()); + } function testReplaceAFieldInADifferentTab() { /* A FieldSet gets created with a TabSet and some field objects */