Merge remote-tracking branch 'origin/3.1'

Conflicts:
	.travis.yml
This commit is contained in:
Ingo Schommer 2013-03-29 17:37:19 +01:00
commit afb8465d05
9 changed files with 701 additions and 229 deletions

View File

@ -193,7 +193,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
CMSMenu::add_link( CMSMenu::add_link(
'Help', 'Help',
_t('LeftAndMain.HELP', 'Help', 'Menu title'), _t('LeftAndMain.HELP', 'Help', 'Menu title'),
self::$help_link $this->config()->help_link
); );
// Allow customisation of the access check by a extension // Allow customisation of the access check by a extension
@ -1413,7 +1413,11 @@ class LeftAndMain extends Controller implements PermissionProvider {
$cache = SS_Cache::factory('LeftAndMain_CMSVersion'); $cache = SS_Cache::factory('LeftAndMain_CMSVersion');
$cacheKey = filemtime($composerLockPath); $cacheKey = filemtime($composerLockPath);
$versions = $cache->load($cacheKey); $versions = $cache->load($cacheKey);
if(!$versions) $versions = array(); if($versions) {
$versions = json_decode($versions, true);
} else {
$versions = array();
}
if(!$versions && $jsonData = file_get_contents($composerLockPath)) { if(!$versions && $jsonData = file_get_contents($composerLockPath)) {
$lockData = json_decode($jsonData); $lockData = json_decode($jsonData);
if($lockData && isset($lockData->packages)) { if($lockData && isset($lockData->packages)) {
@ -1429,7 +1433,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
} }
} }
} }
// Fall back to static version file // Fall back to static version file
foreach($modules as $moduleName => $moduleSpec) { foreach($modules as $moduleName => $moduleSpec) {
if(!isset($versions[$moduleName])) { if(!isset($versions[$moduleName])) {

View File

@ -16,7 +16,7 @@
<ul> <ul>
<% loop ManagedModelTabs %> <% loop ManagedModelTabs %>
<li class="tab-$ClassName $LinkOrCurrent<% if $LinkOrCurrent == 'current' %> ui-tabs-active<% end_if %>"> <li class="tab-$ClassName $LinkOrCurrent<% if $LinkOrCurrent == 'current' %> ui-tabs-active<% end_if %>">
<a href="$Link" class="cms-panel-link">$Title</a> <a href="$Link" class="cms-panel-link" title="Form_EditForm">$Title</a>
</li> </li>
<% end_loop %> <% end_loop %>
</ul> </ul>

View File

@ -426,3 +426,5 @@ you can enable those warnings and future-proof your code already.
* `ScheduledTask`, `QuarterHourlyTask`, `HourlyTask`, `DailyTask`, `MonthlyTask`, `WeeklyTask` and * `ScheduledTask`, `QuarterHourlyTask`, `HourlyTask`, `DailyTask`, `MonthlyTask`, `WeeklyTask` and
`YearlyTask` are deprecated, please extend from `BuildTask` or `CliController`, `YearlyTask` are deprecated, please extend from `BuildTask` or `CliController`,
and invoke them in self-defined frequencies through Unix cronjobs etc. and invoke them in self-defined frequencies through Unix cronjobs etc.
* `i18n::$common_locales` and `i18n::$common_languages` are now accessed via the Config API, and contain associative rather than indexed arrays.
Before: `array('de_DE' => array('German', 'Deutsch'))`, after: `array('de_DE' => array('name' => 'German', 'native' => 'Deutsch'))`.

View File

@ -116,7 +116,7 @@ class Email extends ViewableData {
* @var string The default administrator email address. * @var string The default administrator email address.
* This will be set in the config on a site-by-site basis * This will be set in the config on a site-by-site basis
*/ */
private static $admin_email_address = ''; private static $admin_email = '';
/** /**
* Send every email generated by the Email class to the given address. * Send every email generated by the Email class to the given address.

View File

@ -692,7 +692,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
*/ */
protected function getFieldsForImage($url, $file) { protected function getFieldsForImage($url, $file) {
if($file->File instanceof Image) { if($file->File instanceof Image) {
$formattedImage = $file->File->generateFormattedImage('SetWidth', Image::$asset_preview_width); $formattedImage = $file->File->generateFormattedImage('SetWidth', Config::inst()->get('Image', 'asset_preview_width'));
$thumbnailURL = $formattedImage ? $formattedImage->URL : $url; $thumbnailURL = $formattedImage ? $formattedImage->URL : $url;
} else { } else {
$thumbnailURL = $url; $thumbnailURL = $url;

View File

@ -125,7 +125,7 @@ class i18n extends Object implements TemplateGlobalProvider {
*/ */
public static function get_js_i18n() { public static function get_js_i18n() {
Deprecation::notice('3.2', 'Use the "i18n.js_i18n" config setting instead'); Deprecation::notice('3.2', 'Use the "i18n.js_i18n" config setting instead');
return self::$js_i18n; return Config::inst()->get('i18n', 'js_i18n');
} }
/** /**
@ -653,96 +653,350 @@ class i18n extends Object implements TemplateGlobalProvider {
); );
/** /**
* @config
* @var array $common_languages A list of commonly used languages, in the form * @var array $common_languages A list of commonly used languages, in the form
* langcode => array( EnglishName, NativeName) * langcode => array( EnglishName, NativeName)
*/ */
public static $common_languages = array( private static $common_languages = array(
'af' => array('Afrikaans', 'Afrikaans'), 'af' => array(
'sq' => array('Albanian', 'shqip'), 'name' => 'Afrikaans',
'ar' => array('Arabic', '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;'), 'native' => 'Afrikaans'
'eu' => array('Basque', 'euskera'), ),
'be' => array('Belarusian', 'sq' => array(
'&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1072;&#1103; &#1084;&#1086;&#1074;&#1072;'), 'name' => 'Albanian',
'bn' => array('Bengali', '&#2476;&#2494;&#2434;&#2482;&#2494;'), 'native' => 'shqip'
'bg' => array('Bulgarian', '&#1073;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080;'), ),
'ca' => array('Catalan', 'catal&agrave;'), 'ar' => array(
'zh_yue' => array('Chinese (Cantonese)', '&#24291;&#26481;&#35441; [&#24191;&#19996;&#35805;]'), 'name' => 'Arabic',
'zh_cmn' => array('Chinese (Mandarin)', '&#26222;&#36890;&#35441; [&#26222;&#36890;&#35805;]'), 'native' => '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;'
'hr' => array('Croatian', 'Hrvatski'), ),
'zh' => array('Chinese','中国的'), 'eu' => array(
'cs' => array('Czech', '&#x010D;e&#353;tina'), 'name' => 'Basque',
'cy' => array('Welsh', 'Welsh/Cymraeg'), 'native' => 'euskera'
'da' => array('Danish', 'dansk'), ),
'nl' => array('Dutch', 'Nederlands'), 'be' => array(
'en' => array('English', 'English'), 'name' => 'Belarusian',
'eo' => array('Esperanto', 'Esperanto'), 'native' => '&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1072;&#1103; &#1084;&#1086;&#1074;&#1072;'
'et' => array('Estonian', 'eesti keel'), ),
'fo' => array('Faroese', 'F&oslash;royska'), 'bn' => array(
'fi' => array('Finnish', 'suomi'), 'name' => 'Bengali',
'fr' => array('French', 'fran&ccedil;ais'), 'native' => '&#2476;&#2494;&#2434;&#2482;&#2494;'
'gd' => array('Gaelic', 'Gaeilge'), ),
'gl' => array('Galician', 'Galego'), 'bg' => array(
'de' => array('German', 'Deutsch'), 'name' => 'Bulgarian',
'el' => array('Greek', '&#949;&#955;&#955;&#951;&#957;&#953;&#954;&#940;'), 'native' => '&#1073;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080;'
'gu' => array('Gujarati', '&#2711;&#2753;&#2716;&#2736;&#2750;&#2724;&#2752;'), ),
'ha' => array('Hausa', '&#1581;&#1614;&#1608;&#1618;&#1587;&#1614;'), 'ca' => array(
'he' => array('Hebrew', '&#1506;&#1489;&#1512;&#1497;&#1514;'), 'name' => 'Catalan',
'hi' => array('Hindi', '&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;'), 'native' => 'catal&agrave;'
'hu' => array('Hungarian', 'magyar'), ),
'is' => array('Icelandic', '&Iacute;slenska'), 'zh_yue' => array(
'io' => array('Ido', 'Ido'), 'name' => 'Chinese (Cantonese)',
'id' => array('Indonesian', 'Bahasa Indonesia'), 'native' => '&#24291;&#26481;&#35441; [&#24191;&#19996;&#35805;]'
'ga' => array('Irish', 'Irish'), ),
'it' => array('Italian', 'italiano'), 'zh_cmn' => array(
'ja' => array('Japanese', '&#26085;&#26412;&#35486;'), 'name' => 'Chinese (Mandarin)',
'jv' => array('Javanese', 'basa Jawa'), 'native' => '&#26222;&#36890;&#35441; [&#26222;&#36890;&#35805;]'
'ko' => array('Korean', '&#54620;&#44397;&#50612; [&#38867;&#22283;&#35486;]'), ),
'ku' => array('Kurdish', 'Kurd&iacute;'), 'hr' => array(
'lv' => array('Latvian', 'latvie&#353;u'), 'name' => 'Croatian',
'lt' => array('Lithuanian', 'lietuvi&#353;kai'), 'native' => 'Hrvatski'
'lmo' => array('Lombard', 'Lombardo'), ),
'mk' => array('Macedonian', '&#1084;&#1072;&#1082;&#1077;&#1076;&#1086;&#1085;&#1089;&#1082;&#1080;'), 'zh' => array(
'mi' => array('Maori', 'Māori'), 'name' => 'Chinese','中国的'
'ms' => array('Malay', 'Bahasa melayu'), ),
'mt' => array('Maltese', 'Malti'), 'cs' => array(
'mr' => array('Marathi', '&#2350;&#2352;&#2366;&#2336;&#2368;'), 'name' => 'Czech',
'ne' => array('Nepali', '&#2344;&#2375;&#2346;&#2366;&#2354;&#2368;'), 'native' => '&#x010D;e&#353;tina'
'no' => array('Norwegian', 'Norsk'), ),
'om' => array('Oromo', 'Afaan Oromo'), 'cy' => array(
'fa' => array('Persian', '&#1601;&#1575;&#1585;&#1587;&#1609;'), 'name' => 'Welsh',
'pl' => array('Polish', 'polski'), 'native' => 'Welsh/Cymraeg'
'pt_PT' => array('Portuguese (Portugal)', 'portugu&ecirc;s (Portugal)'), ),
'pt_BR' => array('Portuguese (Brazil)', 'portugu&ecirc;s (Brazil)'), 'da' => array(
'pa' => array('Punjabi', '&#2602;&#2672;&#2588;&#2622;&#2604;&#2624;'), 'name' => 'Danish',
'qu' => array('Quechua', 'Quechua'), 'native' => 'dansk'
'rm' => array('Romansh', 'rumantsch'), ),
'ro' => array('Romanian', 'rom&acirc;n'), 'nl' => array(
'ru' => array('Russian', '&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;'), 'name' => 'Dutch',
'sco' => array('Scots', 'Scoats leid, Lallans'), 'native' => 'Nederlands'
'sr' => array('Serbian', '&#1089;&#1088;&#1087;&#1089;&#1082;&#1080;'), ),
'sk' => array('Slovak', 'sloven&#269;ina'), 'en' => array(
'sl' => array('Slovenian', 'sloven&#353;&#269;ina'), 'name' => 'English',
'es' => array('Spanish', 'espa&ntilde;ol'), 'native' => 'English'
'sv' => array('Swedish', 'Svenska'), ),
'tl' => array('Tagalog', 'Tagalog'), 'eo' => array(
'ta' => array('Tamil', '&#2980;&#2990;&#3007;&#2996;&#3021;'), 'name' => 'Esperanto',
'te' => array('Telugu', '&#3108;&#3142;&#3122;&#3137;&#3095;&#3137;'), 'native' => 'Esperanto'
'to' => array('Tonga', 'chiTonga'), ),
'ts' => array('Tsonga', 'xiTshonga'), 'et' => array(
'tn' => array('Tswana', 'seTswana'), 'name' => 'Estonian',
'tr' => array('Turkish', 'T&uuml;rk&ccedil;e'), 'native' => 'eesti keel'
'tk' => array('Turkmen', '&#1090;&#1199;&#1088;&#1082;m&#1077;&#1085;&#1095;&#1077;'), ),
'tw' => array('Twi', 'twi'), 'fo' => array(
'uk' => array('Ukrainian', '&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;'), 'name' => 'Faroese',
'ur' => array('Urdu', '&#1575;&#1585;&#1583;&#1608;'), 'native' => 'F&oslash;royska'
'uz' => array('Uzbek', '&#1118;&#1079;&#1073;&#1077;&#1082;'), ),
've' => array('Venda', 'tshiVen&#x1E13;a'), 'fi' => array(
'vi' => array('Vietnamese', 'ti&#7871;ng vi&#7879;t'), 'name' => 'Finnish',
'wa' => array('Walloon', 'walon'), 'native' => 'suomi'
'wo' => array('Wolof', 'Wollof'), ),
'xh' => array('Xhosa', 'isiXhosa'), 'fr' => array(
'yi' => array('Yiddish', '&#1522;&#1460;&#1491;&#1497;&#1513;'), 'name' => 'French',
'zu' => array('Zulu', 'isiZulu') 'native' => 'fran&ccedil;ais'
),
'gd' => array(
'name' => 'Gaelic',
'native' => 'Gaeilge'
),
'gl' => array(
'name' => 'Galician',
'native' => 'Galego'
),
'de' => array(
'name' => 'German',
'native' => 'Deutsch'
),
'el' => array(
'name' => 'Greek',
'native' => '&#949;&#955;&#955;&#951;&#957;&#953;&#954;&#940;'
),
'gu' => array(
'name' => 'Gujarati',
'native' => '&#2711;&#2753;&#2716;&#2736;&#2750;&#2724;&#2752;'
),
'ha' => array(
'name' => 'Hausa',
'native' => '&#1581;&#1614;&#1608;&#1618;&#1587;&#1614;'
),
'he' => array(
'name' => 'Hebrew',
'native' => '&#1506;&#1489;&#1512;&#1497;&#1514;'
),
'hi' => array(
'name' => 'Hindi',
'native' => '&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;'
),
'hu' => array(
'name' => 'Hungarian',
'native' => 'magyar'
),
'is' => array(
'name' => 'Icelandic',
'native' => '&Iacute;slenska'
),
'io' => array(
'name' => 'Ido',
'native' => 'Ido'
),
'id' => array(
'name' => 'Indonesian',
'native' => 'Bahasa Indonesia'
),
'ga' => array(
'name' => 'Irish',
'native' => 'Irish'
),
'it' => array(
'name' => 'Italian',
'native' => 'italiano'
),
'ja' => array(
'name' => 'Japanese',
'native' => '&#26085;&#26412;&#35486;'
),
'jv' => array(
'name' => 'Javanese',
'native' => 'basa Jawa'
),
'ko' => array(
'name' => 'Korean',
'native' => '&#54620;&#44397;&#50612; [&#38867;&#22283;&#35486;]'
),
'ku' => array(
'name' => 'Kurdish',
'native' => 'Kurd&iacute;'
),
'lv' => array(
'name' => 'Latvian',
'native' => 'latvie&#353;u'
),
'lt' => array(
'name' => 'Lithuanian',
'native' => 'lietuvi&#353;kai'
),
'lmo' => array(
'name' => 'Lombard',
'native' => 'Lombardo'
),
'mk' => array(
'name' => 'Macedonian',
'native' => '&#1084;&#1072;&#1082;&#1077;&#1076;&#1086;&#1085;&#1089;&#1082;&#1080;'
),
'mi' => array(
'name' => 'Maori',
'native' => 'Māori'
),
'ms' => array(
'name' => 'Malay',
'native' => 'Bahasa melayu'
),
'mt' => array(
'name' => 'Maltese',
'native' => 'Malti'
),
'mr' => array(
'name' => 'Marathi',
'native' => '&#2350;&#2352;&#2366;&#2336;&#2368;'
),
'ne' => array(
'name' => 'Nepali',
'native' => '&#2344;&#2375;&#2346;&#2366;&#2354;&#2368;'
),
'no' => array(
'name' => 'Norwegian',
'native' => 'Norsk'
),
'om' => array(
'name' => 'Oromo',
'native' => 'Afaan Oromo'
),
'fa' => array(
'name' => 'Persian',
'native' => '&#1601;&#1575;&#1585;&#1587;&#1609;'
),
'pl' => array(
'name' => 'Polish',
'native' => 'polski'
),
'pt_PT' => array(
'name' => 'Portuguese (Portugal)',
'native' => 'portugu&ecirc;s (Portugal)'
),
'pt_BR' => array(
'name' => 'Portuguese (Brazil)',
'native' => 'portugu&ecirc;s (Brazil)'
),
'pa' => array(
'name' => 'Punjabi',
'native' => '&#2602;&#2672;&#2588;&#2622;&#2604;&#2624;'
),
'qu' => array(
'name' => 'Quechua',
'native' => 'Quechua'
),
'rm' => array(
'name' => 'Romansh',
'native' => 'rumantsch'
),
'ro' => array(
'name' => 'Romanian',
'native' => 'rom&acirc;n'
),
'ru' => array(
'name' => 'Russian',
'native' => '&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;'
),
'sco' => array(
'name' => 'Scots',
'native' => 'Scoats leid, Lallans'
),
'sr' => array(
'name' => 'Serbian',
'native' => '&#1089;&#1088;&#1087;&#1089;&#1082;&#1080;'
),
'sk' => array(
'name' => 'Slovak',
'native' => 'sloven&#269;ina'
),
'sl' => array(
'name' => 'Slovenian',
'native' => 'sloven&#353;&#269;ina'
),
'es' => array(
'name' => 'Spanish',
'native' => 'espa&ntilde;ol'
),
'sv' => array(
'name' => 'Swedish',
'native' => 'Svenska'
),
'tl' => array(
'name' => 'Tagalog',
'native' => 'Tagalog'
),
'ta' => array(
'name' => 'Tamil',
'native' => '&#2980;&#2990;&#3007;&#2996;&#3021;'
),
'te' => array(
'name' => 'Telugu',
'native' => '&#3108;&#3142;&#3122;&#3137;&#3095;&#3137;'
),
'to' => array(
'name' => 'Tonga',
'native' => 'chiTonga'
),
'ts' => array(
'name' => 'Tsonga',
'native' => 'xiTshonga'
),
'tn' => array(
'name' => 'Tswana',
'native' => 'seTswana'
),
'tr' => array(
'name' => 'Turkish',
'native' => 'T&uuml;rk&ccedil;e'
),
'tk' => array(
'name' => 'Turkmen',
'native' => '&#1090;&#1199;&#1088;&#1082;m&#1077;&#1085;&#1095;&#1077;'
),
'tw' => array(
'name' => 'Twi',
'native' => 'twi'
),
'uk' => array(
'name' => 'Ukrainian',
'native' => '&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;'
),
'ur' => array(
'name' => 'Urdu',
'native' => '&#1575;&#1585;&#1583;&#1608;'
),
'uz' => array(
'name' => 'Uzbek',
'native' => '&#1118;&#1079;&#1073;&#1077;&#1082;'
),
've' => array(
'name' => 'Venda',
'native' => 'tshiVen&#x1E13;a'
),
'vi' => array(
'name' => 'Vietnamese',
'native' => 'ti&#7871;ng vi&#7879;t'
),
'wa' => array(
'name' => 'Walloon',
'native' => 'walon'
),
'wo' => array(
'name' => 'Wolof',
'native' => 'Wollof'
),
'xh' => array(
'name' => 'Xhosa',
'native' => 'isiXhosa'
),
'yi' => array(
'name' => 'Yiddish',
'native' => '&#1522;&#1460;&#1491;&#1497;&#1513;'
),
'zu' => array(
'name' => 'Zulu',
'native' => 'isiZulu'
)
); );
/** /**
@ -752,90 +1006,338 @@ class i18n extends Object implements TemplateGlobalProvider {
* not the locale key. * not the locale key.
*/ */
private static $common_locales = array( private static $common_locales = array(
'af_ZA' => array('Afrikaans', 'Afrikaans'), 'af_ZA' => array(
'sq_AL' => array('Albanian', 'shqip'), 'name' => 'Afrikaans',
'ar_EG' => array('Arabic', '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;'), 'native' => 'Afrikaans'
'eu_ES' => array('Basque', 'euskera'), ),
'be_BY' => array('Belarusian', 'sq_AL' => array(
'&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1072;&#1103; &#1084;&#1086;&#1074;&#1072;'), 'name' => 'Albanian',
'bn_BD' => array('Bengali', '&#2476;&#2494;&#2434;&#2482;&#2494;'), 'native' => 'shqip'
'bg_BG' => array('Bulgarian', '&#1073;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080;'), ),
'ca_ES' => array('Catalan', 'catal&agrave;'), 'ar_EG' => array(
'zh_CN' => array('Chinese','中国的'), 'name' => 'Arabic',
'zh_yue' => array('Chinese (Cantonese)', '&#24291;&#26481;&#35441; [&#24191;&#19996;&#35805;]'), 'native' => '&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;'
'zh_cmn' => array('Chinese (Mandarin)', '&#26222;&#36890;&#35441; [&#26222;&#36890;&#35805;]'), ),
'hr_HR' => array('Croatian', 'Hrvatski'), 'eu_ES' => array(
'cs_CZ' => array('Czech', '&#x010D;e&#353;tina'), 'name' => 'Basque',
'cy_GB' => array('Welsh', 'Welsh/Cymraeg'), 'native' => 'euskera'
'da_DK' => array('Danish', 'dansk'), ),
'nl_NL' => array('Dutch', 'Nederlands'), 'be_BY' => array(
'en_NZ' => array('English (NZ)', 'English (NZ)'), 'name' => 'Belarusian',
'en_US' => array('English (US)', 'English (US)'), 'native' => '&#1041;&#1077;&#1083;&#1072;&#1088;&#1091;&#1089;&#1082;&#1072;&#1103; &#1084;&#1086;&#1074;&#1072;'
'en_GB' => array('English (UK)', 'English (UK)'), ),
'eo_XX' => array('Esperanto', 'Esperanto'), 'bn_BD' => array(
'et_EE' => array('Estonian', 'eesti keel'), 'name' => 'Bengali',
'fo_FO' => array('Faroese', 'F&oslash;royska'), 'native' => '&#2476;&#2494;&#2434;&#2482;&#2494;'
'fi_FI' => array('Finnish', 'suomi'), ),
'fr_FR' => array('French', 'fran&ccedil;ais'), 'bg_BG' => array(
'gd_GB' => array('Gaelic', 'Gaeilge'), 'name' => 'Bulgarian',
'gl_ES' => array('Galician', 'Galego'), 'native' => '&#1073;&#1098;&#1083;&#1075;&#1072;&#1088;&#1089;&#1082;&#1080;'
'de_DE' => array('German', 'Deutsch'), ),
'el_GR' => array('Greek', '&#949;&#955;&#955;&#951;&#957;&#953;&#954;&#940;'), 'ca_ES' => array(
'gu_IN' => array('Gujarati', '&#2711;&#2753;&#2716;&#2736;&#2750;&#2724;&#2752;'), 'name' => 'Catalan',
'ha_NG' => array('Hausa', '&#1581;&#1614;&#1608;&#1618;&#1587;&#1614;'), 'native' => 'catal&agrave;'
'he_IL' => array('Hebrew', '&#1506;&#1489;&#1512;&#1497;&#1514;'), ),
'hi_IN' => array('Hindi', '&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;'), 'zh_CN' => array(
'hu_HU' => array('Hungarian', 'magyar'), 'name' => 'Chinese',
'is_IS' => array('Icelandic', '&Iacute;slenska'), 'native' => '中国的'
'id_ID' => array('Indonesian', 'Bahasa Indonesia'), ),
'ga_IE' => array('Irish', 'Irish'), 'zh_yue' => array(
'it_IT' => array('Italian', 'italiano'), 'name' => 'Chinese (Cantonese)',
'ja_JP' => array('Japanese', '&#26085;&#26412;&#35486;'), 'native' => '&#24291;&#26481;&#35441; [&#24191;&#19996;&#35805;]'
'jv_ID' => array('Javanese', 'basa Jawa'), ),
'ko_KR' => array('Korean', '&#54620;&#44397;&#50612; [&#38867;&#22283;&#35486;]'), 'zh_cmn' => array(
'ku_IQ' => array('Kurdish', 'Kurd&iacute;'), 'name' => 'Chinese (Mandarin)',
'lv_LV' => array('Latvian', 'latvie&#353;u'), 'native' => '&#26222;&#36890;&#35441; [&#26222;&#36890;&#35805;]'
'lt_LT' => array('Lithuanian', 'lietuvi&#353;kai'), ),
'mk_MK' => array('Macedonian', '&#1084;&#1072;&#1082;&#1077;&#1076;&#1086;&#1085;&#1089;&#1082;&#1080;'), 'hr_HR' => array(
'mi_NZ' => array('Maori', 'Māori'), 'name' => 'Croatian',
'ms_MY' => array('Malay', 'Bahasa melayu'), 'native' => 'Hrvatski'
'mt_MT' => array('Maltese', 'Malti'), ),
'mr_IN' => array('Marathi', '&#2350;&#2352;&#2366;&#2336;&#2368;'), 'cs_CZ' => array(
'ne_NP' => array('Nepali', '&#2344;&#2375;&#2346;&#2366;&#2354;&#2368;'), 'name' => 'Czech',
'nb_NO' => array('Norwegian', 'Norsk'), 'native' => '&#x010D;e&#353;tina'
'om_ET' => array('Oromo', 'Afaan Oromo'), ),
'fa_IR' => array('Persian', '&#1601;&#1575;&#1585;&#1587;&#1609;'), 'cy_GB' => array(
'pl_PL' => array('Polish', 'polski'), 'name' => 'Welsh',
'pt_PT' => array('Portuguese (Portugal)', 'portugu&ecirc;s (Portugal)'), 'native' => 'Welsh/Cymraeg'
'pt_BR' => array('Portuguese (Brazil)', 'portugu&ecirc;s (Brazil)'), ),
'pa_IN' => array('Punjabi', '&#2602;&#2672;&#2588;&#2622;&#2604;&#2624;'), 'da_DK' => array(
'qu_PE' => array('Quechua', 'Quechua'), 'name' => 'Danish',
'rm_CH' => array('Romansh', 'rumantsch'), 'native' => 'dansk'
'ro_RO' => array('Romanian', 'rom&acirc;n'), ),
'ru_RU' => array('Russian', '&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;'), 'nl_NL' => array(
'sco_SCO' => array('Scots', 'Scoats leid, Lallans'), 'name' => 'Dutch',
'sr_RS' => array('Serbian', '&#1089;&#1088;&#1087;&#1089;&#1082;&#1080;'), 'native' => 'Nederlands'
'sk_SK' => array('Slovak', 'sloven&#269;ina'), ),
'sl_SI' => array('Slovenian', 'sloven&#353;&#269;ina'), 'en_NZ' => array(
'es_ES' => array('Spanish', 'espa&ntilde;ol'), 'name' => 'English (NZ)',
'sv_SE' => array('Swedish', 'Svenska'), 'native' => 'English (NZ)'
'tl_PH' => array('Tagalog', 'Tagalog'), ),
'ta_IN' => array('Tamil', '&#2980;&#2990;&#3007;&#2996;&#3021;'), 'en_US' => array(
'te_IN' => array('Telugu', '&#3108;&#3142;&#3122;&#3137;&#3095;&#3137;'), 'name' => 'English (US)',
'to_TO' => array('Tonga', 'chiTonga'), 'native' => 'English (US)'
'ts_ZA' => array('Tsonga', 'xiTshonga'), ),
'tn_ZA' => array('Tswana', 'seTswana'), 'en_GB' => array(
'tr_TR' => array('Turkish', 'T&uuml;rk&ccedil;e'), 'name' => 'English (UK)',
'tk_TM' => array('Turkmen', '&#1090;&#1199;&#1088;&#1082;m&#1077;&#1085;&#1095;&#1077;'), 'native' => 'English (UK)'
'tw_GH' => array('Twi', 'twi'), ),
'uk_UA' => array('Ukrainian', '&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;'), 'eo_XX' => array(
'ur_PK' => array('Urdu', '&#1575;&#1585;&#1583;&#1608;'), 'name' => 'Esperanto',
'uz_UZ' => array('Uzbek', '&#1118;&#1079;&#1073;&#1077;&#1082;'), 'native' => 'Esperanto'
've_ZA' => array('Venda', 'tshiVen&#x1E13;a'), ),
'vi_VN' => array('Vietnamese', 'ti&#7871;ng vi&#7879;t'), 'et_EE' => array(
'wo_SN' => array('Wolof', 'Wollof'), 'name' => 'Estonian',
'xh_ZA' => array('Xhosa', 'isiXhosa'), 'native' => 'eesti keel'
'zu_ZA' => array('Zulu', 'isiZulu'), ),
'fo_FO' => array(
'name' => 'Faroese',
'native' => 'F&oslash;royska'
),
'fi_FI' => array(
'name' => 'Finnish',
'native' => 'suomi'
),
'fr_FR' => array(
'name' => 'French',
'native' => 'fran&ccedil;ais'
),
'gd_GB' => array(
'name' => 'Gaelic',
'native' => 'Gaeilge'
),
'gl_ES' => array(
'name' => 'Galician',
'native' => 'Galego'
),
'de_DE' => array(
'name' => 'German',
'native' => 'Deutsch'
),
'el_GR' => array(
'name' => 'Greek',
'native' => '&#949;&#955;&#955;&#951;&#957;&#953;&#954;&#940;'
),
'gu_IN' => array(
'name' => 'Gujarati',
'native' => '&#2711;&#2753;&#2716;&#2736;&#2750;&#2724;&#2752;'
),
'ha_NG' => array(
'name' => 'Hausa',
'native' => '&#1581;&#1614;&#1608;&#1618;&#1587;&#1614;'
),
'he_IL' => array(
'name' => 'Hebrew',
'native' => '&#1506;&#1489;&#1512;&#1497;&#1514;'
),
'hi_IN' => array(
'name' => 'Hindi',
'native' => '&#2361;&#2367;&#2344;&#2381;&#2342;&#2368;'
),
'hu_HU' => array(
'name' => 'Hungarian',
'native' => 'magyar'
),
'is_IS' => array(
'name' => 'Icelandic',
'native' => '&Iacute;slenska'
),
'id_ID' => array(
'name' => 'Indonesian',
'native' => 'Bahasa Indonesia'
),
'ga_IE' => array(
'name' => 'Irish',
'native' => 'Irish'
),
'it_IT' => array(
'name' => 'Italian',
'native' => 'italiano'
),
'ja_JP' => array(
'name' => 'Japanese',
'native' => '&#26085;&#26412;&#35486;'
),
'jv_ID' => array(
'name' => 'Javanese',
'native' => 'basa Jawa'
),
'ko_KR' => array(
'name' => 'Korean',
'native' => '&#54620;&#44397;&#50612; [&#38867;&#22283;&#35486;]'
),
'ku_IQ' => array(
'name' => 'Kurdish',
'native' => 'Kurd&iacute;'
),
'lv_LV' => array(
'name' => 'Latvian',
'native' => 'latvie&#353;u'
),
'lt_LT' => array(
'name' => 'Lithuanian',
'native' => 'lietuvi&#353;kai'
),
'mk_MK' => array(
'name' => 'Macedonian',
'native' => '&#1084;&#1072;&#1082;&#1077;&#1076;&#1086;&#1085;&#1089;&#1082;&#1080;'
),
'mi_NZ' => array(
'name' => 'Maori',
'native' => 'Māori'
),
'ms_MY' => array(
'name' => 'Malay',
'native' => 'Bahasa melayu'
),
'mt_MT' => array(
'name' => 'Maltese',
'native' => 'Malti'
),
'mr_IN' => array(
'name' => 'Marathi',
'native' => '&#2350;&#2352;&#2366;&#2336;&#2368;'
),
'ne_NP' => array(
'name' => 'Nepali',
'native' => '&#2344;&#2375;&#2346;&#2366;&#2354;&#2368;'
),
'nb_NO' => array(
'name' => 'Norwegian',
'native' => 'Norsk'
),
'om_ET' => array(
'name' => 'Oromo',
'native' => 'Afaan Oromo'
),
'fa_IR' => array(
'name' => 'Persian',
'native' => '&#1601;&#1575;&#1585;&#1587;&#1609;'
),
'pl_PL' => array(
'name' => 'Polish',
'native' => 'polski'
),
'pt_PT' => array(
'name' => 'Portuguese (Portugal)',
'native' => 'portugu&ecirc;s (Portugal)'
),
'pt_BR' => array(
'name' => 'Portuguese (Brazil)',
'native' => 'portugu&ecirc;s (Brazil)'
),
'pa_IN' => array(
'name' => 'Punjabi',
'native' => '&#2602;&#2672;&#2588;&#2622;&#2604;&#2624;'
),
'qu_PE' => array(
'name' => 'Quechua',
'native' => 'Quechua'
),
'rm_CH' => array(
'name' => 'Romansh',
'native' => 'rumantsch'
),
'ro_RO' => array(
'name' => 'Romanian',
'native' => 'rom&acirc;n'
),
'ru_RU' => array(
'name' => 'Russian',
'native' => '&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;'
),
'sco_SCO' => array(
'name' => 'Scots',
'native' => 'Scoats leid, Lallans'
),
'sr_RS' => array(
'name' => 'Serbian',
'native' => '&#1089;&#1088;&#1087;&#1089;&#1082;&#1080;'
),
'sk_SK' => array(
'name' => 'Slovak',
'native' => 'sloven&#269;ina'
),
'sl_SI' => array(
'name' => 'Slovenian',
'native' => 'sloven&#353;&#269;ina'
),
'es_ES' => array(
'name' => 'Spanish',
'native' => 'espa&ntilde;ol'
),
'sv_SE' => array(
'name' => 'Swedish',
'native' => 'Svenska'
),
'tl_PH' => array(
'name' => 'Tagalog',
'native' => 'Tagalog'
),
'ta_IN' => array(
'name' => 'Tamil',
'native' => '&#2980;&#2990;&#3007;&#2996;&#3021;'
),
'te_IN' => array(
'name' => 'Telugu',
'native' => '&#3108;&#3142;&#3122;&#3137;&#3095;&#3137;'
),
'to_TO' => array(
'name' => 'Tonga',
'native' => 'chiTonga'
),
'ts_ZA' => array(
'name' => 'Tsonga',
'native' => 'xiTshonga'
),
'tn_ZA' => array(
'name' => 'Tswana',
'native' => 'seTswana'
),
'tr_TR' => array(
'name' => 'Turkish',
'native' => 'T&uuml;rk&ccedil;e'
),
'tk_TM' => array(
'name' => 'Turkmen',
'native' => '&#1090;&#1199;&#1088;&#1082;m&#1077;&#1085;&#1095;&#1077;'
),
'tw_GH' => array(
'name' => 'Twi',
'native' => 'twi'
),
'uk_UA' => array(
'name' => 'Ukrainian',
'native' => '&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;'
),
'ur_PK' => array(
'name' => 'Urdu',
'native' => '&#1575;&#1585;&#1583;&#1608;'
),
'uz_UZ' => array(
'name' => 'Uzbek',
'native' => '&#1118;&#1079;&#1073;&#1077;&#1082;'
),
've_ZA' => array(
'name' => 'Venda',
'native' => 'tshiVen&#x1E13;a'
),
'vi_VN' => array(
'name' => 'Vietnamese',
'native' => 'ti&#7871;ng vi&#7879;t'
),
'wo_SN' => array(
'name' => 'Wolof',
'native' => 'Wollof'
),
'xh_ZA' => array(
'name' => 'Xhosa',
'native' => 'isiXhosa'
),
'zu_ZA' => array(
'name' => 'Zulu',
'native' => 'isiZulu'
),
); );
/** /**
@ -1673,8 +2175,8 @@ class i18n extends Object implements TemplateGlobalProvider {
*/ */
public static function get_common_languages($native = false) { public static function get_common_languages($native = false) {
$languages = array(); $languages = array();
foreach (self::$common_languages as $code => $name) { foreach (Config::inst()->get('i18n', 'common_languages') as $code => $name) {
$languages[$code] = ($native ? $name[1] : $name[0]); $languages[$code] = ($native ? $name['native'] : $name['name']);
} }
return $languages; return $languages;
} }
@ -1688,7 +2190,7 @@ class i18n extends Object implements TemplateGlobalProvider {
public static function get_common_locales($native = false) { public static function get_common_locales($native = false) {
$languages = array(); $languages = array();
foreach (Config::inst()->get('i18n', 'common_locales') as $code => $name) { foreach (Config::inst()->get('i18n', 'common_locales') as $code => $name) {
$languages[$code] = ($native ? $name[1] : $name[0]); $languages[$code] = ($native ? $name['native'] : $name['name']);
} }
return $languages; return $languages;
} }
@ -1748,11 +2250,11 @@ class i18n extends Object implements TemplateGlobalProvider {
* @return Name of the language * @return Name of the language
*/ */
public static function get_language_name($code, $native = false) { public static function get_language_name($code, $native = false) {
$langs = self::$common_languages; $langs = Config::inst()->get('i18n', 'common_languages');
if($native) { if($native) {
return (isset($langs[$code][1])) ? $langs[$code][1] : false; return (isset($langs[$code]['native'])) ? $langs[$code]['native'] : false;
} else { } else {
return (isset($langs[$code][0])) ? $langs[$code][0] : false; return (isset($langs[$code]['name'])) ? $langs[$code]['name'] : false;
} }
} }

View File

@ -7,30 +7,6 @@
*/ */
abstract class DataExtension extends Extension { abstract class DataExtension extends Extension {
/**
* Statics on a {@link DataObject} subclass
* which can be extended by an extension. This list is
* limited for security and performance reasons.
*
* Keys are the static names, and the values are whether or not the value is an array that should
* be merged.
*
* @var array
*/
protected static $extendable_statics = array(
'db' => true,
'has_one' => true,
'belongs_to' => true,
'indexes' => true,
'defaults' => true,
'has_many' => true,
'many_many' => true,
'belongs_many_many' => true,
'many_many_extraFields' => true,
'searchable_fields' => true,
'api_access' => false,
);
public static function get_extra_config($class, $extension, $args) { public static function get_extra_config($class, $extension, $args) {
if(method_exists($extension, 'extraDBFields')) { if(method_exists($extension, 'extraDBFields')) {
$extraStaticsMethod = 'extraDBFields'; $extraStaticsMethod = 'extraDBFields';

View File

@ -1,21 +0,0 @@
--- /Users/ingo/Silverstripe/ss-3.1/framework/security/Security.php
+++ /Users/ingo/Silverstripe/ss-3.1/framework/security/Security.php
@@ -52,2 +52,3 @@
+ * @config
*/
- protected static $encryption_algorithm = 'blowfish';
+ private static $encryption_algorithm = 'blowfish';
--- /Users/ingo/Silverstripe/ss-3.1/framework/security/Security.php
+++ /Users/ingo/Silverstripe/ss-3.1/framework/security/Security.php
@@ -52,2 +52,3 @@
+ * @config
*/
- protected static $encryption_algorithm = 'blowfish';
+ private static $encryption_algorithm = 'blowfish';
--- /Users/ingo/Silverstripe/ss-3.1/framework/security/Security.php
+++ /Users/ingo/Silverstripe/ss-3.1/framework/security/Security.php
@@ -52,2 +52,3 @@
+ * @config
*/
- protected static $encryption_algorithm = 'blowfish';
+ private static $encryption_algorithm = 'blowfish';

View File

@ -563,6 +563,15 @@ class i18nTest extends SapphireTest {
SS_ClassLoader::instance()->popManifest(); SS_ClassLoader::instance()->popManifest();
} }
public function testGetLanguageName() {
Config::inst()->update(
'i18n',
'common_languages',
array('de_CGN' => array('name' => 'German (Cologne)', 'native' => 'K&ouml;lsch'))
);
$this->assertEquals('German (Cologne)', i18n::get_language_name('de_CGN'));
$this->assertEquals('K&ouml;lsch', i18n::get_language_name('de_CGN', true));
}
} }
class i18nTest_DataObject extends DataObject implements TestOnly { class i18nTest_DataObject extends DataObject implements TestOnly {