Commit Graph

114 Commits

Author SHA1 Message Date
Ingo Schommer
6fa8f8341c BUGFIX Escaping $locale values in Translatable->augmentSQL() in addition to the i18n::validate_locale() input validation (from r114515)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114516 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:20:04 +13:00
Ingo Schommer
1670dab5e1 API CHANGE Using i18n::validate_locale() in various Translatable methods to ensure the locale exists (as defined through i18n::$allowed_locales) (from r114470)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114474 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:20:03 +13:00
Ingo Schommer
b5e9b911d3 BUGFIX Removed double quoting of $where parameter in Translatable::get_existing_content_languages() (fixes #6203, thanks cloph) (from r114080)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114081 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:20:02 +13:00
Saophalkun Ponlu
8381858d58 MINOR: Make sure that Translatable creates a translated parent of SiteTree only when the parent is not translated (from r113955)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@113956 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:20:01 +13:00
Sam Minnee
cff1cf10d3 BUGFIX: Fixed Translatable::canEdit() to suit new permission customisation scheme
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104678 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:23 +13:00
Ingo Schommer
0e4a042ece BUGFIX Always including "Locale" field in Translatable->getCMSFields() regardless of "excluded" page types. Necessary to enable form state serialization for fields like TreeSelectorField on a VirtualPage (fixes #5269)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@101747 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:08 +13:00
Ingo Schommer
c79a9d5a03 ENHANCEMENT Redirecting to translated page when original is requested with a 'locale' GET parameter (e.g. 'about-us/?locale=de_DE' will redirect to 'ueber-uns' with a 301 HTTP response). Implemented in ContentController->handleRequest(). (see #5001)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100937 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:57 +13:00
Sean Harvey
a9241e3fc4 API CHANGE Removed deprecated function SiteTree::get_by_url(), please use SiteTree::get_by_link() instead!
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100492 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:46 +13:00
Luke Hudson
6b82cc8ab0 BUGFIX: Show Language dropdown in English (#5098)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100359 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:44 +13:00
Luke Hudson
be26cf2579 BUGFIX: Fix #5097, Translatable uses augmentValidURLSegment to check that URLSegment is valid
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99850 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:43 +13:00
Ingo Schommer
3f8ae83dad BUGFIX Don't allow translations of VirtualPage (until we can reliably copy data between locales) (see #5000)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98217 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:24 +13:00
Ingo Schommer
810b2162da BUGFIX If a Group doesn't have any specific TRANSLATE_<locale> edit rights, but has general CMS access (CMS_ACCESS_CMSMain, CMS_ACCESS_LeftAndMain, ADMIN), then assign TRANSLATE_ALL permissions as a default. Necessary to avoid locking out CMS editors from their default language (see #4940 and 4941)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97911 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:18 +13:00
Ingo Schommer
3e8526960b FEATURE Allowing translation of SiteConfig (including toplevel permission groups)
BUGFIX Fixed SiteConfig->canView()/canEdit() to respect empty CanViewType/CanEditType assignments.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97370 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:11 +13:00
Sam Minnee
1c851476b6 BUGFIX: Let users without a specific TRANSLATE_ permission edit the default locale, so that things don't break when you install the Translatabe module.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97267 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:10 +13:00
Sam Minnee
fe343f9d5d BUGFIX: Fixed bug in r93095 (from r93097)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96750 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:06 +13:00
Sam Minnee
f2416032c6 API CHANGE: Added DataObjectDecorator::cacheKeyComponent() to ensure that the cached behind DataObject::get_one() is appropriately specific (from r93095)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96749 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:06 +13:00
Sean Harvey
07e40ee91f BUGFIX Removed calls to Translatable::is_enabled() since it's deprecated, replaced with Object::has_extension('SiteTree', 'Translatable') instead
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@93677 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:17:53 +13:00
Ingo Schommer
88a8c04d9b BUGFIX Returning TRUE on Translatable->hasTranslation() if called on a record that is in the current locale (merged from r91032)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@91156 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:17:35 +13:00
Ingo Schommer
3b794bb97a MINOR Changed silverstripe.com references to silverstripe.org
MINOR Fixed broken wiki links (#4672)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@90886 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:17:31 +13:00
Sam Minnee
994e93f790 API CHANGE: replaced Database::USE_ANSI_SQL with DB::USE_ANSI_SQL
API CHANGE: replaced Database::alteration_message() with DB::alteration_message()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90097 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-26 22:03:29 +00:00
Andrew Short
79773042be API CHANGE: Renamed conflicting classes to have an "SS_" namespace, and renamed existing "SS" namespace to "SS_". The affected classes are: HTTPRequest, HTTPResponse, Query, Database, SSBacktrace, SSCli, SSDatetime, SSDatetimeTest, SSLog, SSLogTest, SSLogEmailWriter, SSLogErrorEmailFormatter, SSLogErrorFileFormatter, SSLogFileWriter and SSZendLog.
MINOR: Replaced usage of renamed classes with the new namespaced name.

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90075 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-26 03:06:31 +00:00
Sean Harvey
559bbfcca8 BUGFIX #4605 DataObject::newClassInstance() should repopulate it's defaults after changing to an instance of a different class, otherwise databases will complain of NULL values being written to columns that don't accept NULL values.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88956 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-14 06:35:45 +00:00
Andrew Short
ea906a50a8 FEATURE: Implemented Translatable::get_homepage_link_by_locale() to enable translated home pages to function.
FEATURE: Updated SiteTree::get_by_link() to integrate with translatable, and allow it to work across languages by implementing Translatable->alternateGetByLink().
API CHANGE: Moved lang_filter enabling & disabling into static methods on Translatable, and renamed to locale_filter.
BUGFIX: Fixed viewing a translatable page by URL without explicitly setting a Locale in ContentController->handleRequest().

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88503 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:07:22 +00:00
Andrew Short
ad7194cc40 FEATURE: Refactored RootURLController to allow nested home pages.
MINOR: Deprecated RootURLController::get_homepage_urlsegment() in favour of get_homepage_link().
MINOR: Updated SiteTree->RelativeLink() to return a link to the site root for the home page.

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88496 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-11 00:07:17 +00:00
Ingo Schommer
54824945f5 MINOR Don't invoke Translatable->providePermissions() if its not enabled
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88137 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-05 20:39:57 +00:00
Ingo Schommer
2506816ad6 ENHANCEMENT Added Translatable->getAllowedLocalesForMember()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88125 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-05 20:07:03 +00:00
Ingo Schommer
0faf03ee4e API CHANGE Requiring TRANSLATE_ALL or TRANSLATE_<locale> permission for authors without administrative access to edit translations
ENHANCEMENT Added Translatable->providePermissions()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88123 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-05 10:33:36 +00:00
Sam Minnee
f85a95f3aa BUGFIX #4579: Translatable's call to new LanguageDropdownField() broked
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87456 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-29 01:04:37 +00:00
Geoff Munn
9ec8c5c310 MINOR FIX: columns quoted properly
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86508 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-17 00:06:12 +00:00
Sam Minnee
5f6bee22ba BUGFIX: Added static resetting methods for more reliable test execution.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84147 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-11 04:45:54 +00:00
Sam Minnee
6fd387c99c API CHANGE ajshort: Deprecated the Director site mode and callback functionality.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80055 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-25 08:15:52 +00:00
Sam Minnee
0540bec71f BUGFIX #4255 sharvey: Fix application of extra db fields by DataObjectDecorators.
API CHANGE #4255 sharvey: DataObjectDecorator::extraStatics() can no longer refer to $this because it's called staticly


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79430 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-17 07:01:28 +00:00
Ingo Schommer
a145ebf8d2 BUGFIX Marking has_many() and many_many() fields as Translatable fields
BUGFIX Excluding Access fields on SiteTree from Translatable->updateCMSFields(), as their original values break the javascript logic for showing/hiding the fields

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79269 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-15 23:29:53 +00:00
Ingo Schommer
20ada72b4d BUGFIX Don't remove translation groups in Translatable->onBeforeDelete() if the decorated record uses Versioned, as other representations of the record might still exist in other tables (e.g. SiteTree_Live) (see #4219)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79208 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-15 05:02:43 +00:00
Ingo Schommer
de23d55a8b BUGFIX Writing Locale in Translatable->onBeforeWrite() regardless of the record ID existing (see #4232). This is more in line with Translatable->requireDefaultRecords() which automatically updates all NULL locale values anyway.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79194 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-15 04:34:03 +00:00
Ingo Schommer
601672cdff BUGFIX Fixed Translatable->requireDefaultRecords() for non-SiteTree objects (was assuming Versioned to be present)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78729 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-09 21:00:11 +00:00
Sam Minnee
b2460de140 ENHANCEMENT: Removed circular references from extensions to improve garbage collection.
API CHANGE: The result of any extension returned by Object::extInstance() should have setOwner() called on it before calling a method, and clearOwner() after.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78414 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-04 06:48:44 +00:00
Sean Harvey
08b651bd2d Merged r77256 from sapphire/branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77257 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-19 22:02:44 +00:00
Sean Harvey
161e7a35c7 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77020 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-17 23:15:31 +00:00
Ingo Schommer
104470006e API CHANGE Deprecated Translatable::set_reading_lang(), use Translatable::set_current_locale().
MINOR Renamed internal property Translatable::$reading_lang to $current_lang

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77006 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-17 05:36:01 +00:00
Ingo Schommer
9790c4832a BUGFIX Fixed default locale setting in SiteTree_Live through Translatable->requireDefaultRecords()
BUGFIX Added translation groups for existing entries the first time Translatable is switched on through Translatable->requireDefaultRecords() (see #4051)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76866 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-14 21:05:48 +00:00
Ingo Schommer
1b76ac9130 MINOR Documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76862 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-14 06:58:04 +00:00
Ingo Schommer
67180937ff API CHANGE Deprecated Translatable::current_lang(), use Translatable::get_current_locale()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76853 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-14 06:05:48 +00:00
Ingo Schommer
5b0ee9678f API CHANGE Deprecated Translatable->getTranslatedLangs(), use getTranslatedLocales()
ENHANCEMENT Added Translatable::$allowed_locales to limit the available locales in the CMS for page translations. Added Translatable->canTranslate() and Translatable->canEdit() to determine if a translation is allowed.
ENHANCEMENT Added $instance parameter to LanguageDropdownField to call instance-specific canTranslate() on it (optionally)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76839 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-14 05:16:49 +00:00
Ingo Schommer
261ab10e00 MINOR Class naming in Translatable (see #4060)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76737 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-13 21:39:32 +00:00
Ingo Schommer
d3b95a0009 BUGFIX Fixed "Translations" tab display in CMS - no more duplication of original language and translated tab - see #4020
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76613 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-12 02:33:59 +00:00
Ingo Schommer
3fbdbd50d0 BUGFIX Closing <link type="alternate"> tags for XHTML compliance on Translatable->MetaTags(). Use ContentNegotiator to transform them back to HTML markup. See #3989
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76517 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-11 02:47:20 +00:00
Ingo Schommer
0cab3bf61e MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76306 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-06 23:50:19 +00:00
Sean Harvey
b20b6e0f95 Merged from 2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76269 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-06 06:36:16 +00:00
Ingo Schommer
aafaee660b BUGFIX Removing ParentType and ParentID fields in Translatable->updateCMSFields() as they are causing js problems when set to readonly. These fields should only be set on the original record anyway (at least as long as we don't have a multi-language capable TreeMultiSelectField).
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75984 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-04 09:01:14 +00:00