diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index ee9fed2a5..0e488c48f 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -1170,7 +1170,7 @@ class LeftAndMain extends Controller implements PermissionProvider { * @return int */ public function currentPageID() { - if($this->request->requestVar('ID')) { + if($this->request->requestVar('ID') && is_numeric($this->request->requestVar('ID'))) { return $this->request->requestVar('ID'); } elseif (isset($this->urlParams['ID']) && is_numeric($this->urlParams['ID'])) { return $this->urlParams['ID']; diff --git a/admin/css/screen.css b/admin/css/screen.css index a883f3c1d..5b82ec918 100644 --- a/admin/css/screen.css +++ b/admin/css/screen.css @@ -553,6 +553,7 @@ body.cms-dialog { overflow: auto; background: url("../images/textures/bg_cms_mai .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url .btn-icon-addMedia { width: 20px; height: 20px; } .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url:active { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; opacity: 1; } .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled:active { opacity: 0.35; filter: Alpha(Opacity=35); } +.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb .loading button.add-url .ui-icon { background-image: url(../images/throbber.gif); background-position: 50% 50%; background-repeat: no-repeat; } .htmleditorfield-dialog .cms-content-header { padding: 0; width: 100%; height: 40px; } .htmleditorfield-dialog .cms-content-header h3 { padding: 0 8px; margin: 10px; } .htmleditorfield-dialog .ui-tabs { position: static; } diff --git a/admin/scss/_style.scss b/admin/scss/_style.scss index c566f3939..d0498374b 100644 --- a/admin/scss/_style.scss +++ b/admin/scss/_style.scss @@ -1452,7 +1452,7 @@ body.cms-dialog { float:left; position: relative; - label { + label { position: absolute; left: 8px; top: 13px; @@ -1491,6 +1491,12 @@ body.cms-dialog { } } } + + .loading button.add-url .ui-icon { + background-image: url(../images/throbber.gif); + background-position: 50% 50%; + background-repeat: no-repeat; + } } .cms-content-header{ diff --git a/docs/en/installation/nginx.md b/docs/en/installation/nginx.md index 7f70ac27c..833989bd4 100644 --- a/docs/en/installation/nginx.md +++ b/docs/en/installation/nginx.md @@ -21,10 +21,13 @@ Now you need to setup a virtual host in Nginx with the following configuration s error_page 404 /framework/main.php; location ~ \.php$ { + include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/yoursite.com/httpdocs$fastcgi_script_name; - include fastcgi_params; + fastcgi_buffer_size 32k; + fastcgi_buffers 4 32k; + fastcgi_busy_buffers_size 64k; } } diff --git a/docs/en/misc/translation-process.md b/docs/en/misc/translation-process.md index a075698a1..0ef5e16e2 100644 --- a/docs/en/misc/translation-process.md +++ b/docs/en/misc/translation-process.md @@ -14,21 +14,34 @@ This format is now deprecated, and we don't provide tools for editing the files. Please see below for information on how to convert these legacy files and existing translations to YML. +## Download Translations + +We are managing our translations through a tool called [getlocalization.com](http://getlocalization.com). +Most modules are managed under the "silverstripe" user there, +see [list of translatable modules](http://www.getlocalization.com/profile/?username=silverstripe). + +Translations are exported from there into YML files, generated every hour, +and committed to a special "translation-staging" branch on github. +You can download individual files by opening them on github.com (inside the `lang/` folder), and using the "Raw" view. +Place those files in the appropriate directories on a local silverstripe installation. + + * ["translation-staging" branch for framework module](https://github.com/silverstripe/sapphire/tree/translation-staging) + * ["translation-staging" branch for cms module](https://github.com/silverstripe/silverstripe-cms/tree/translation-staging) + ## Help as a translator ### The online translation tool -We are managing our translations through a tool called -[getlocalization.com](http://getlocalization.com). -Most modules are managed under the "silverstripe" user there, -see [list of translatable modules](http://www.getlocalization.com/profile/?username=silverstripe). +We provide a GUI for translations through [getlocalization.com](http://getlocalization.com). If you don't have an account yet, please follow the links there to sign up. +Select a project from the [list of translatable modules](http://www.getlocalization.com/profile/?username=silverstripe) +and start translating online! For all modules listed there, we automatically import new master strings as they get committed to the various codebases, so you're always translating -on the latest and greatest version (through github service hooks). +on the latest and greatest version. -## Set up your module for localization +## Set up your own module for localization ### Collecting translatable text @@ -61,9 +74,19 @@ change the first line in this file from "en_GB" to "en-GB". ### Export existing translations -You can simply download the whole language pack as a ZIP archive +As a project maintainer, you have the permission can simply download the whole language pack as a ZIP archive and add it to your project. But for composite locales (e.g. "en-GB"), -you have to change the keys in the first line of the file (see note above). +you have to change the keys in the first line of the file. + +We encourage you to use the SilverStripe build tools for this instead, +as they run some additional sanity checks. They require the "phing" tool. +Create a 'translation-staging' branch in your module before starting, +and merge it back manually to your 'master' as required. + + pear install phing/phing + cp build.properties.default + cp build.properties # Add your own getlocalization config to 'build.properties' + phing -Dmodule= -propertyfile build.properties translations-sync ### Converting your language files from 2.4 PHP format @@ -83,16 +106,10 @@ Special characters (such as german umlauts) need to be entered in their native f ### How can I check out my translation in the interface? Currently translated entities are not directly factored into code (for security reasons and release/review-control), so you can't see them straight away. -You can download automatically generated files for your language for each module (e.g. cms, sapphire, forum, ...) - -and place those files in the appropriate directories on a local silverstripe installation. -Example for downloading french files: -downloaded fr.yml for cms => /cms/lang/fr.yml -downloaded fr.yml for sapphire => /sapphire/lang/fr.yml -(repeat for all modules) It is strongly encouraged that you check your translation this way, as its a good way to doublecheck your translation works in the right context. -Please use our daily-builds for your local installation, to ensure you're looking at the most up to date interface. +Please use our [daily-builds](http://www.silverstripe.org/daily-builds/) for your local installation, to ensure you're looking at the most up to date interface. ### Can I change a translation just for one SilverStripe version? @@ -131,7 +148,8 @@ We are currently investigating the available options, and are eager to get feedb ### Can I translate/edit the language files in my favourite text editor (on my local installation) -No, as it causes us a lot of work in merging these files back. +Not for modules managed by getlocalization.com, including "framework" and "cms. +It causes us a lot of work in merging these files back. Please use the online translation tool for all new and existing translations. ### How does my translation get into a SilverStripe release? diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index 53bf85985..8bac10c0e 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -762,7 +762,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; // TODO Depends on managed mime type if(node.is('img')) { - this.showFileView(node.data('url') || node.attr('src'), function() { + this.showFileView(node.data('url') || node.attr('src')).complete(function() { $(this).updateFromNode(node); self.toggleCloseButton(); self.redraw(); @@ -811,7 +811,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; item.addClass('loading'); this.find('.content-edit').append(item); - $.ajax({ + return $.ajax({ // url: this.data('urlViewfile') + '?ID=' + id, url: $.path.addSearchParams(this.attr('action').replace(/MediaForm/, 'viewfile'), params), success: function(html, status, xhr) { @@ -908,11 +908,13 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; }, onclick: function(e) { - var urlField = this.getURLField(); + var urlField = this.getURLField(), container = this.closest('.CompositeField'), form = this.closest('form'); if (urlField.validate()) { - var form = this.closest('form'); - form.showFileView('http://' + urlField.val()); + container.addClass('loading'); + form.showFileView('http://' + urlField.val()).complete(function() { + container.removeClass('loading'); + }); form.redraw(); }