From bfb22d4b83363ff800780a9f2b5de67c3d2d9c60 Mon Sep 17 00:00:00 2001 From: wic Date: Thu, 9 Jan 2014 09:32:49 +0800 Subject: [PATCH 01/20] add lang zh-TW --- src/lang/zh-TW/administrator.php | 55 ++++++++++++++++++++++++++++++++ src/lang/zh-TW/knockout.php | 24 ++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/lang/zh-TW/administrator.php create mode 100644 src/lang/zh-TW/knockout.php diff --git a/src/lang/zh-TW/administrator.php b/src/lang/zh-TW/administrator.php new file mode 100644 index 000000000..ae6fdd2fa --- /dev/null +++ b/src/lang/zh-TW/administrator.php @@ -0,0 +1,55 @@ + '控制面板', + 'edit' => '編輯', + 'filters' => '篩選', + 'loading' => '載入中...', + 'createnew' => '新建', + 'new' => '新建', + 'viewitem' => '查看 :single', + 'id' => 'ID', + 'uploadimage' => '上傳圖片', + 'imageuploading' => '圖片上傳中', + 'uploadfile' => '上傳文件', + 'fileuploading' => '文件上傳中', + 'none' => '沒有', + 'all' => '全部', + 'itemsperpage' => '條目每頁', + 'noresults' => '沒有結果', + 'backtosite' => '返回主站', + 'logout' => '登出', + + 'previous' => '上一頁', + 'next' => '下一頁', + + 'close' => '關閉', + 'delete' => '刪除', + 'save' => '保存', + 'create' => '創建', + 'cancel' => '取消', + + 'active' => '稍等...', + 'success' => '成功!', + 'error' => '執行此操作時産生一個錯誤', + + 'valid_columns' => "在每個 model 的配置中你必須提供一個有效的 'columns' 數組", + 'valid_title' => "在每個 model 的配置中你必須要提供有效的標題( title )和單數名字( single )參數", + 'valid_model' => "在每個 model 的配置中你必須要提供有效的模型( model )參數", + 'valid_edit' => "在每個 model 的配置中你必須提供一個有效的 'edit_fields' 數組", + 'valid_menu' => "在 administrator.php 的配置中你必須提供一個有效的 'menu' 參數", + 'valid_config_path' => "在 administrator.php 的配置中你必須提供一個有效的 'model_config_path' 參數。這個文件夾必須是存在並且可讀的。", + 'not_eloquent' => " 不是 Eloquent model", + 'storage_path_permissions' => "爲了使用設置頁面,你必須用于 storage 路徑寫入的權限", + 'valid_home_page' => "在 administrator.php 的配置中你必須提供一個有效的 'home_page' 參數", +); \ No newline at end of file diff --git a/src/lang/zh-TW/knockout.php b/src/lang/zh-TW/knockout.php new file mode 100644 index 000000000..16befc891 --- /dev/null +++ b/src/lang/zh-TW/knockout.php @@ -0,0 +1,24 @@ + '你确定要删除这个条目?这个操作无法逆转。', + 'saving' => '保存中...', + 'saved' => '条目已经保存', + 'deleting' => '删除中...', + 'deleted' => '条目已被删除', + 'character_left' => ' 剩余字符', + 'characters_left' => ' 剩余字符串', + 'no_results' => '没有结果匹配', + 'select_options' => '选择一些选项', + +); From 1ac6cc433ebdfc42372c11bde0f66115eb9d0c72 Mon Sep 17 00:00:00 2001 From: wic Date: Thu, 9 Jan 2014 09:35:53 +0800 Subject: [PATCH 02/20] add lang zh-TW --- src/lang/zh-TW/knockout.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lang/zh-TW/knockout.php b/src/lang/zh-TW/knockout.php index 16befc891..33f0d5550 100644 --- a/src/lang/zh-TW/knockout.php +++ b/src/lang/zh-TW/knockout.php @@ -7,18 +7,18 @@ | Administrator Language Lines for knockout |-------------------------------------------------------------------------- | - | zh-CN - 简体中文 + | zh-TW - 繁體中文 | */ - 'delete_active_item' => '你确定要删除这个条目?这个操作无法逆转。', + 'delete_active_item' => '你確定要刪除這個條目?這個操作無法逆轉。', 'saving' => '保存中...', - 'saved' => '条目已经保存', - 'deleting' => '删除中...', - 'deleted' => '条目已被删除', + 'saved' => '條目已經保存', + 'deleting' => '刪除中...', + 'deleted' => '條目已被刪除', 'character_left' => ' 剩余字符', 'characters_left' => ' 剩余字符串', - 'no_results' => '没有结果匹配', - 'select_options' => '选择一些选项', + 'no_results' => '沒有結果匹配', + 'select_options' => '選擇一些選項', ); From c1d2972adfc688fad64ee47059432f7233d8983a Mon Sep 17 00:00:00 2001 From: Gadoma Date: Thu, 9 Jan 2014 18:10:35 +0100 Subject: [PATCH 03/20] updated new entries and corrected the existing ones for PL lang --- src/lang/pl/administrator.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lang/pl/administrator.php b/src/lang/pl/administrator.php index 1c69449dd..8ce83860c 100644 --- a/src/lang/pl/administrator.php +++ b/src/lang/pl/administrator.php @@ -14,19 +14,19 @@ 'dashboard' => 'Panel', 'edit' => 'Edycja', 'filters' => 'Filtry', - 'loading' => 'Ładuje...', + 'loading' => 'Ładuję ...', 'createnew' => 'Stwórz nowy', 'new' => 'Nowy', 'viewitem' => 'wyświetl :single', 'id' => 'ID', 'uploadimage' => 'Dodaj zdjęcie', - 'imageuploading' => 'Ładuje zdjęcie', - 'uploadfile' => 'Upload File', - 'fileuploading' => 'File Uploading', + 'imageuploading' => 'Ładuję zdjęcie', + 'uploadfile' => 'Dodaj plik', + 'fileuploading' => 'Ładuję plik', 'none' => 'Żaden', 'all' => 'Wszystkie', 'itemsperpage' => 'pozycji na stronie', - 'noresults' => 'Brak wynikow', + 'noresults' => 'Brak wyników', 'backtosite' => 'Powrót do strony', 'logout' => 'Wyloguj', @@ -39,7 +39,7 @@ 'create' => 'Stwórz', 'cancel' => 'Anuluj', - 'active' => 'Chwileczkę...', + 'active' => 'Chwileczkę ...', 'success' => 'Sukces!', 'error' => 'Wystąpił błąd podczas wykonywania tej czynności', @@ -47,9 +47,9 @@ 'valid_title' => "Musisz podać poprawny tytuł i pojedynczą nazwę dla każdego zdefiniowanego modelu", 'valid_model' => "Dla każdego zdefiniowanego modelu musisz podać jego opcje", 'valid_edit' => "Musisz podać poprawną tablicę 'edit_fields' dla każdego zdefiniowanego modelu", - 'valid_menu' => "Musisz podać poprawną opcję 'Menu' w pliku konfiguracyjnym administrator.php", + 'valid_menu' => "Musisz podać poprawną opcję 'menu' w pliku konfiguracyjnym administrator.php", 'valid_config_path' => "Musisz podać poprawny 'model_config_path' w pliku konfiguracyjnym administrator.php. Katalog musi istnieć i mieć prawo do odczytu.", 'not_eloquent' => " nie jest Eloquent model", - 'storage_path_permissions' => "You must make your storage path writable in order to make a settings page", - 'valid_home_page' => "You must provide a valid menu item in the home_page option of your config", -); \ No newline at end of file + 'storage_path_permissions' => "Aby utworzyć stronę typu 'settings' katalog 'storage_path' musi istnieć i mieć prawo do zapisu", + 'valid_home_page' => "Musisz podać poprawny element 'menu' dla opcji 'home_page' w pliku konfiguracyjnym administrator.php", +); From f3ad54caea418297b47a4885ddb238ac6a08dc94 Mon Sep 17 00:00:00 2001 From: Gadoma Date: Thu, 9 Jan 2014 18:13:18 +0100 Subject: [PATCH 04/20] updated new entries and corrected the existing ones for PL lang --- src/lang/pl/knockout.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lang/pl/knockout.php b/src/lang/pl/knockout.php index 66e3a3b2b..278f087c2 100644 --- a/src/lang/pl/knockout.php +++ b/src/lang/pl/knockout.php @@ -11,14 +11,14 @@ | */ - 'delete_active_item' => 'Czy na pewno chcesz usunąć ten obiekt? Czynności tej nie można odwrócić.', - 'saving' => 'Trwa zapisywanie...', + 'delete_active_item' => 'Czy na pewno chcesz usunąć ten obiekt? Czynności tej nie można cofnąć.', + 'saving' => 'Trwa zapisywanie ...', 'saved' => 'Obiekt zapisany.', - 'deleting' => 'Usuwanie...', + 'deleting' => 'Usuwanie ...', 'deleted' => 'Obiekt usunięty.', 'character_left' => ' znak pozostał', 'characters_left' => ' znaki pozostały', - 'no_results' => 'No results matched', - 'select_options' => 'Select Some Options', + 'no_results' => 'Brak pasujących wyników', + 'select_options' => 'Wybierz jakieś opcje', -); \ No newline at end of file +); From 2c31f93a93a9166776d65d9d16bc54f4cc40c561 Mon Sep 17 00:00:00 2001 From: edhahn Date: Thu, 9 Jan 2014 15:36:18 -0700 Subject: [PATCH 05/20] Added class_exists check to AdministratorServiceProvider boot to prevent redefinition of AdministratorBaseController alias. This prevent errors in Laravel 4.1 phpunit tests. --- .../Administrator/AdministratorServiceProvider.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Frozennode/Administrator/AdministratorServiceProvider.php b/src/Frozennode/Administrator/AdministratorServiceProvider.php index d3606d308..75468e133 100644 --- a/src/Frozennode/Administrator/AdministratorServiceProvider.php +++ b/src/Frozennode/Administrator/AdministratorServiceProvider.php @@ -34,10 +34,12 @@ public function boot() $this->app['administrator.4.1'] = version_compare(\Illuminate\Foundation\Application::VERSION, '4.1') > -1; //set up an alias for the base laravel controller to accommodate >=4.1 and <4.1 - if ($this->app['administrator.4.1']) - class_alias('Illuminate\Routing\Controller', 'AdministratorBaseController'); - else - class_alias('Illuminate\Routing\Controllers\Controller', 'AdministratorBaseController'); + if (!class_exists('AdministratorBaseController')){ // Verify alias is not already created + if ($this->app['administrator.4.1']) + class_alias('Illuminate\Routing\Controller', 'AdministratorBaseController'); + else + class_alias('Illuminate\Routing\Controllers\Controller', 'AdministratorBaseController'); + } //include our filters, view composers, and routes include __DIR__.'/../../filters.php'; From 1b315a522cf525575687cb510b2458a21b83a013 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Jan 2014 00:07:35 +0100 Subject: [PATCH 06/20] Slovenian language --- src/lang/si/administrator.php | 55 +++++++++++++++++++++++++++++++++++ src/lang/si/knockout.php | 24 +++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/lang/si/administrator.php create mode 100644 src/lang/si/knockout.php diff --git a/src/lang/si/administrator.php b/src/lang/si/administrator.php new file mode 100644 index 000000000..32f6f2ec8 --- /dev/null +++ b/src/lang/si/administrator.php @@ -0,0 +1,55 @@ + 'Nadzorna plošča', + 'edit' => 'Uredi', + 'filters' => 'Filtri', + 'loading' => 'Nalaganje...', + 'createnew' => 'Ustvari nov', + 'new' => 'Ustvari', + 'viewitem' => 'Poglej :single', + 'id' => 'ID', + 'uploadimage' => 'Naloži Sliko', + 'imageuploading' => 'Nalaganje Slike', + 'uploadfile' => 'Naloži Datoteko', + 'fileuploading' => 'Nalaganje Datoteke', + 'none' => 'Nič', + 'all' => 'Vse', + 'itemsperpage' => 'Število elementov na stran', + 'noresults' => 'Ni rezultatov', + 'backtosite' => 'Nazaj na stran', + 'logout' => 'Odjava', + + 'previous' => 'prejšnja', + 'next' => 'naslednja', + + 'close' => 'Zapri', + 'delete' => 'Izbriši', + 'save' => 'Shrani', + 'create' => 'Ustvari', + 'cancel' => 'Prekliči', + + 'active' => 'Počakajte trenutek...', + 'success' => 'Narejeno!', + 'error' => 'Med izvajanjem te operacije je prišlo do napake', + + 'valid_columns' => "Podati morate veljavno polje 'columns' v vseh nastavitvah modela", + 'valid_title' => "Podati morate veljaven title v vseh nastavitvah modela", + 'valid_model' => "Podati morate opcijo 'model' v vseh nastavitvah modela", + 'valid_edit' => "Podati morate veljavno polje 'edit_fields' v vseh nastavitvah modela", + 'valid_menu' => "Podati morate veljavno opcijo 'menu' v nastavitveni datoteki administrator.php", + 'valid_config_path' => "Podati morate veljavno opcijo 'model_config_path' v nastavitveni datoteki administrator.php. Prav tako mora imenik obstajati in imeti nastavalene pravice za branje.", + 'not_eloquent' => "ni Eloquent model", + 'storage_path_permissions' => "Za stran z nastavitvami je potrebno nastaviti pot do imenika ki ima pravice za pisanje", + 'valid_home_page' => "Podati morate veljavno opcijo 'home_page' v nastavitveni datoteki administrator.php", +); diff --git a/src/lang/si/knockout.php b/src/lang/si/knockout.php new file mode 100644 index 000000000..fd248f26d --- /dev/null +++ b/src/lang/si/knockout.php @@ -0,0 +1,24 @@ + 'Ali ste prepričani da želite izbrisati ta element? Te operacije ni mogoče razveljaviti', + 'saving' => 'Shranjevanje...', + 'saved' => 'Shranjeno.', + 'deleting' => 'Brisanje...', + 'deleted' => 'Izbrisano.', + 'character_left' => ' znak vam je še na voljo', + 'characters_left' => ' znakov vam je še na voljo', + 'no_results' => 'Ni rezultatov ujemanja', + 'select_options' => 'Izbira', + +); From 64b2147fecf19eea98138568a41ebab7e655c491 Mon Sep 17 00:00:00 2001 From: Morgon Date: Sun, 19 Jan 2014 13:28:31 -0500 Subject: [PATCH 07/20] Allows closure within column 'output' option --- .../Administrator/DataTable/Columns/Column.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Frozennode/Administrator/DataTable/Columns/Column.php b/src/Frozennode/Administrator/DataTable/Columns/Column.php index bdb4cfe0f..59b095f1e 100644 --- a/src/Frozennode/Administrator/DataTable/Columns/Column.php +++ b/src/Frozennode/Administrator/DataTable/Columns/Column.php @@ -78,8 +78,7 @@ class Column { 'column_name' => 'required|string', 'title' => 'string', 'relationship' => 'string', - 'select' => 'required_with:relationship|string', - 'output' => 'string', + 'select' => 'required_with:relationship|string' ); /** @@ -241,13 +240,19 @@ public function getOption($key) /** * Takes a column output string and renders the column with it (replacing '(:value)' with the column's field value) * - * @param string $output + * @param string $value * * @return string */ public function renderOutput($value) { - return str_replace('(:value)', $value, $this->getOption('output')); + $output = $this->getOption('output'); + + if (is_callable($output)) { + return $output($value); + } + + return str_replace('(:value)', $value, $output); } /** @@ -269,4 +274,4 @@ public function getDefaults() { return array_merge($this->baseDefaults, $this->defaults); } -} \ No newline at end of file +} From 69190e037b8f250bacfd6576bc6c87afd41f34bd Mon Sep 17 00:00:00 2001 From: Nille af Ekenstam Date: Tue, 21 Jan 2014 09:30:15 +0100 Subject: [PATCH 08/20] Added Swedish (se) translation. --- src/lang/se/administrator.php | 55 +++++++++++++++++++++++++++++++++++ src/lang/se/knockout.php | 24 +++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/lang/se/administrator.php create mode 100644 src/lang/se/knockout.php diff --git a/src/lang/se/administrator.php b/src/lang/se/administrator.php new file mode 100644 index 000000000..a0b8dbcc4 --- /dev/null +++ b/src/lang/se/administrator.php @@ -0,0 +1,55 @@ + 'Kontrollpanel', + 'edit' => 'Redigera', + 'filters' => 'Filter', + 'loading' => 'Laddar...', + 'createnew' => 'Skapa ny', + 'new' => 'Ny', + 'viewitem' => 'Visa :enskild', + 'id' => 'ID', + 'uploadimage' => 'Ladda upp bild', + 'imageuploading' => 'Bild laddas upp', + 'uploadfile' => 'Ladda upp fil', + 'fileuploading' => 'Fil laddas upp', + 'none' => 'Ingen', + 'all' => 'Alla', + 'itemsperpage' => 'objekt per sida', + 'noresults' => 'Inget resultat', + 'backtosite' => 'Tillbaka till sajten', + 'logout' => 'Logga ut', + + 'previous' => 'föregående', + 'next' => 'nästa', + + 'close' => 'Stäng', + 'delete' => 'Radera', + 'save' => 'Spara', + 'create' => 'Skapa', + 'cancel' => 'Avbryt', + + 'active' => 'Ett ögonblick...', + 'success' => 'Klart!', + 'error' => 'Ett fel uppstod i samband med denna operation', + + 'valid_columns' => "Du måste ange en giltig 'columns'-array i varje modells konfiguration", + 'valid_title' => "Du måste ange en giltig 'title' och 'single name' i varje modells konfiguration", + 'valid_model' => "Du måste ange en 'model'-option i varje modells konfiguration", + 'valid_edit' => "Du måste ange en giltig 'edit_fields'-array i varje modells konfiguration", + 'valid_menu' => "Du måste ange en giltig 'menu'-option i administrator.php:s konfiguration", + 'valid_config_path' => "Du måste ange en giltig 'model_config_path' i administrator.php:s konfiguration. Katalogen måste även existera samt vara skrivbar.", + 'not_eloquent' => " är inte en Eloquent-modell", + 'storage_path_permissions' => "Du måste göra din 'storage path' skrivbar för att skapa en inställningssida (settings page)", + 'valid_home_page' => "Du måste ange en giltig 'menu item' i 'home_page'-inställningen i din konfiguration", +); \ No newline at end of file diff --git a/src/lang/se/knockout.php b/src/lang/se/knockout.php new file mode 100644 index 000000000..1476860b2 --- /dev/null +++ b/src/lang/se/knockout.php @@ -0,0 +1,24 @@ + 'Är du säker du vill radera detta? Raderingen är permanent.', + 'saving' => 'Sparar...', + 'saved' => 'Objektet sparat.', + 'deleting' => 'Raderar...', + 'deleted' => 'Objektet raderat.', + 'character_left' => ' tecken kvar', + 'characters_left' => ' tecken kvar', + 'no_results' => 'Inga resultat matchade', + 'select_options' => 'Gör några val', + +); From 2ebfd1eb4faa5dc6052307ff06da5ec645a5cab3 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Tue, 21 Jan 2014 22:06:47 -0800 Subject: [PATCH 09/20] changelog for new translations (see #464 #450) --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 874f7143e..c1e903369 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ ## Changelog +- New translations (se, si) ### 4.9.0 - Laravel 4.1 support - New translations (ja, pt) From 2f97f7d4290c679069c336f3625865b63445f658 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Tue, 21 Jan 2014 22:07:01 -0800 Subject: [PATCH 10/20] changelog for bugfix (see #448) --- changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index c1e903369..957b3be8c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,8 @@ ## Changelog - New translations (se, si) +- Bugfix: The administrator base controller was being instantiated multiple times during unit tests in laravel 4.1. + ### 4.9.0 - Laravel 4.1 support - New translations (ja, pt) From a06394d7cd4941120df0ccb774893098aa1e0d36 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sun, 2 Feb 2014 15:01:27 -0800 Subject: [PATCH 11/20] adding changelog and docs for output closure (See #458) --- changelog.md | 1 + src/docs/columns.md | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 957b3be8c..aa85b07d2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ ## Changelog +- Closures can now be passed into the output option for columns - New translations (se, si) - Bugfix: The administrator base controller was being instantiated multiple times during unit tests in laravel 4.1. diff --git a/src/docs/columns.md b/src/docs/columns.md index bb4f8636c..a933f6dd9 100644 --- a/src/docs/columns.md +++ b/src/docs/columns.md @@ -140,9 +140,19 @@ Any SQL grouping function will work in the `select` statement. Much more is poss ## Custom Outputs -If you want your column to show more than just text, you can use the `output` option. At any place in the `output` string, you can put `(:value)`. This will be replaced by the row's value for this column. +If you want your column to show more than just text, you can use the `output` option. This can either be a string or an anonymous function. -For instance, if you are using a [color](/docs/field-type-color) field and you want to clearly show the admin user what color a row is, you can do this: +If you provide an anonymous function, the only argument is the relevant column's value from the database. For instance, if you are using a [color](/docs/field-type-color) field and you want to clearly show the admin user what color a row is, you can do this: + + 'hex' => array( + 'title' => 'Color', + 'output' => function($value) + { + return '
'; + }, + ), + +Alternatively, you can also pass a string to the `output` option and Administrator will replace the string `(:value)` with the row's value for this column. 'hex' => array( 'title' => 'Color', From 26bbee8977221462820b540daff2a8afc45c79ee Mon Sep 17 00:00:00 2001 From: Alex Plekhanov Date: Tue, 11 Feb 2014 23:58:24 +0200 Subject: [PATCH 12/20] Update administrator.php Fix comment about login_redirect_key. --- src/config/administrator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/administrator.php b/src/config/administrator.php index 32254382f..534fecf52 100644 --- a/src/config/administrator.php +++ b/src/config/administrator.php @@ -101,7 +101,7 @@ 'logout_path' => false, /** - * This is the key of the return path that is sent with the redirection to your login_action. Input::get('redirect') will hold the return URL. + * This is the key of the return path that is sent with the redirection to your login_action. Session::get('redirect') will hold the return URL. * * @type string */ From 6068d68f041cdf0873fcfd40fea4de2841a243a1 Mon Sep 17 00:00:00 2001 From: Alexey Plekhanov Date: Wed, 12 Feb 2014 10:16:32 +0200 Subject: [PATCH 13/20] Add ukrainian language --- src/lang/uk/administrator.php | 55 +++++++++++++++++++++++++++++++++++ src/lang/uk/knockout.php | 24 +++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/lang/uk/administrator.php create mode 100644 src/lang/uk/knockout.php diff --git a/src/lang/uk/administrator.php b/src/lang/uk/administrator.php new file mode 100644 index 000000000..4dcd45790 --- /dev/null +++ b/src/lang/uk/administrator.php @@ -0,0 +1,55 @@ + 'Контрольний центр', + 'edit' => 'Редагувати', + 'filters' => 'Фільтрація', + 'loading' => 'Загрузка...', + 'createnew' => 'Створити ', + 'new' => 'Створити', + 'viewitem' => 'Подивитись :single', + 'id' => 'ID', + 'uploadimage' => 'Завантажити зображення', + 'imageuploading' => 'Завантаження зображення', + 'uploadfile' => 'Завантажити файл', + 'fileuploading' => 'Завантаження файла', + 'none' => 'Пусто', + 'all' => 'Все', + 'itemsperpage' => 'елементів на сторінці', + 'noresults' => 'Немає результатів', + 'backtosite' => 'Повернутись на сайт', + 'logout' => 'Вийти', + + 'previous' => 'назад', + 'next' => 'вперед', + + 'close' => 'Зачинити', + 'delete' => 'Видалити', + 'save' => 'Зберегти', + 'create' => 'Створити', + 'cancel' => 'Відміна', + + 'active' => 'Один момент...', + 'success' => 'Вдало!', + 'error' => 'Виникла помилка при виконанні цієї дії', + + 'valid_columns' => "Ви маєте описати коректний масив 'columns' в кожній конфігурації моделі", + 'valid_title' => "Ви маєте описати коректний заголовок та одне ім'я в кожній конфігурації моделі", + 'valid_model' => "Ви маєте описати опцію 'model' в кожній конфігурації моделі", + 'valid_edit' => "Ви маєте описати коректний масив 'edit_fields' в кожній конфігурації моделі", + 'valid_menu' => "Ви маєте описати коректну опцію 'menu' в конфігурації administrator.php", + 'valid_config_path' => "Ви маєте описати коректну опцію 'model_config_path' в конфігурації administrator.php. Директорія має бути створена та доступна для читання.", + 'not_eloquent' => " це не Eloquent модель", + 'storage_path_permissions' => "Ви маєте зробити директорію storage path доступною для запису для створення сторінки налаштувань", + 'valid_home_page' => "Ви маєете описати коретний елемент меню в опції home_page в конфігурації", +); diff --git a/src/lang/uk/knockout.php b/src/lang/uk/knockout.php new file mode 100644 index 000000000..41d081d6d --- /dev/null +++ b/src/lang/uk/knockout.php @@ -0,0 +1,24 @@ + 'Ви дійсно бажаєте видалити цей елемент? Це неможливо відмінити.', + 'saving' => 'Збереження...', + 'saved' => 'Елемент збережен.', + 'deleting' => 'Видалення...', + 'deleted' => 'Елемент видалений.', + 'character_left' => ' символ вліво', + 'characters_left' => ' символів вліво', + 'no_results' => 'Результатів не знайдено', + 'select_options' => 'Оберіть', + +); From bcf03cfb1da8a044c6ce5b33be038504e0fa97c3 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sun, 16 Feb 2014 15:44:14 -0800 Subject: [PATCH 14/20] adding changelog and docs for ukrainian translation (see #483) --- changelog.md | 2 +- src/docs/localization.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index aa85b07d2..53f075693 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,7 @@ ## Changelog - Closures can now be passed into the output option for columns -- New translations (se, si) +- New translations (se, si, uk) - Bugfix: The administrator base controller was being instantiated multiple times during unit tests in laravel 4.1. ### 4.9.0 diff --git a/src/docs/localization.md b/src/docs/localization.md index b69f04c35..10bf6cfba 100644 --- a/src/docs/localization.md +++ b/src/docs/localization.md @@ -74,7 +74,7 @@ There are no special exceptions in the model config files...so you can localize Administrator currently supports the following languages: -> ca da de en es eu fr hu it ja nl pl pt pt-BR ru sr tr zh-CN +> ca da de en es eu fr hu it ja nl pl pt pt-BR ru sr tr uk zh-CN If you don't see the language you want, [contributing a new language is crazy easy](#contributing)! From 01ef96f6c3216a7f7073f4d8aa46d5f7bf2e6744 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sun, 16 Feb 2014 15:44:28 -0800 Subject: [PATCH 15/20] adding docs for other translations that were missed --- src/docs/localization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/localization.md b/src/docs/localization.md index 10bf6cfba..a8a98ac1c 100644 --- a/src/docs/localization.md +++ b/src/docs/localization.md @@ -74,7 +74,7 @@ There are no special exceptions in the model config files...so you can localize Administrator currently supports the following languages: -> ca da de en es eu fr hu it ja nl pl pt pt-BR ru sr tr uk zh-CN +> ca da de en es eu fr hu it ja nl pl pt pt-BR ru se si sr tr uk zh-CN If you don't see the language you want, [contributing a new language is crazy easy](#contributing)! From dc6723af064c288b09ae835ca4227cb47fc349d5 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sun, 16 Feb 2014 15:45:14 -0800 Subject: [PATCH 16/20] moving the docs to the repo root --- {src/docs => docs}/actions.md | 0 {src/docs => docs}/columns.md | 0 {src/docs => docs}/configuration.md | 0 {src/docs => docs}/contributing.md | 0 {src/docs => docs}/documentation.md | 0 {src/docs => docs}/field-type-bool.md | 0 {src/docs => docs}/field-type-color.md | 0 {src/docs => docs}/field-type-date.md | 0 {src/docs => docs}/field-type-datetime.md | 0 {src/docs => docs}/field-type-enum.md | 0 {src/docs => docs}/field-type-file.md | 0 {src/docs => docs}/field-type-image.md | 0 {src/docs => docs}/field-type-key.md | 0 {src/docs => docs}/field-type-markdown.md | 0 {src/docs => docs}/field-type-number.md | 0 {src/docs => docs}/field-type-password.md | 0 {src/docs => docs}/field-type-relationship.md | 0 {src/docs => docs}/field-type-text.md | 0 {src/docs => docs}/field-type-textarea.md | 0 {src/docs => docs}/field-type-time.md | 0 {src/docs => docs}/field-type-wysiwyg.md | 0 {src/docs => docs}/fields.md | 0 {src/docs => docs}/installation.md | 0 {src/docs => docs}/introduction.md | 0 {src/docs => docs}/license.md | 0 {src/docs => docs}/localization.md | 0 {src/docs => docs}/model-configuration.md | 0 {src/docs => docs}/relationship-columns.md | 0 {src/docs => docs}/settings-configuration.md | 0 {src/docs => docs}/style-guide.md | 0 {src/docs => docs}/tutorials.md | 0 {src/docs => docs}/validation.md | 0 32 files changed, 0 insertions(+), 0 deletions(-) rename {src/docs => docs}/actions.md (100%) rename {src/docs => docs}/columns.md (100%) rename {src/docs => docs}/configuration.md (100%) rename {src/docs => docs}/contributing.md (100%) rename {src/docs => docs}/documentation.md (100%) rename {src/docs => docs}/field-type-bool.md (100%) rename {src/docs => docs}/field-type-color.md (100%) rename {src/docs => docs}/field-type-date.md (100%) rename {src/docs => docs}/field-type-datetime.md (100%) rename {src/docs => docs}/field-type-enum.md (100%) rename {src/docs => docs}/field-type-file.md (100%) rename {src/docs => docs}/field-type-image.md (100%) rename {src/docs => docs}/field-type-key.md (100%) rename {src/docs => docs}/field-type-markdown.md (100%) rename {src/docs => docs}/field-type-number.md (100%) rename {src/docs => docs}/field-type-password.md (100%) rename {src/docs => docs}/field-type-relationship.md (100%) rename {src/docs => docs}/field-type-text.md (100%) rename {src/docs => docs}/field-type-textarea.md (100%) rename {src/docs => docs}/field-type-time.md (100%) rename {src/docs => docs}/field-type-wysiwyg.md (100%) rename {src/docs => docs}/fields.md (100%) rename {src/docs => docs}/installation.md (100%) rename {src/docs => docs}/introduction.md (100%) rename {src/docs => docs}/license.md (100%) rename {src/docs => docs}/localization.md (100%) rename {src/docs => docs}/model-configuration.md (100%) rename {src/docs => docs}/relationship-columns.md (100%) rename {src/docs => docs}/settings-configuration.md (100%) rename {src/docs => docs}/style-guide.md (100%) rename {src/docs => docs}/tutorials.md (100%) rename {src/docs => docs}/validation.md (100%) diff --git a/src/docs/actions.md b/docs/actions.md similarity index 100% rename from src/docs/actions.md rename to docs/actions.md diff --git a/src/docs/columns.md b/docs/columns.md similarity index 100% rename from src/docs/columns.md rename to docs/columns.md diff --git a/src/docs/configuration.md b/docs/configuration.md similarity index 100% rename from src/docs/configuration.md rename to docs/configuration.md diff --git a/src/docs/contributing.md b/docs/contributing.md similarity index 100% rename from src/docs/contributing.md rename to docs/contributing.md diff --git a/src/docs/documentation.md b/docs/documentation.md similarity index 100% rename from src/docs/documentation.md rename to docs/documentation.md diff --git a/src/docs/field-type-bool.md b/docs/field-type-bool.md similarity index 100% rename from src/docs/field-type-bool.md rename to docs/field-type-bool.md diff --git a/src/docs/field-type-color.md b/docs/field-type-color.md similarity index 100% rename from src/docs/field-type-color.md rename to docs/field-type-color.md diff --git a/src/docs/field-type-date.md b/docs/field-type-date.md similarity index 100% rename from src/docs/field-type-date.md rename to docs/field-type-date.md diff --git a/src/docs/field-type-datetime.md b/docs/field-type-datetime.md similarity index 100% rename from src/docs/field-type-datetime.md rename to docs/field-type-datetime.md diff --git a/src/docs/field-type-enum.md b/docs/field-type-enum.md similarity index 100% rename from src/docs/field-type-enum.md rename to docs/field-type-enum.md diff --git a/src/docs/field-type-file.md b/docs/field-type-file.md similarity index 100% rename from src/docs/field-type-file.md rename to docs/field-type-file.md diff --git a/src/docs/field-type-image.md b/docs/field-type-image.md similarity index 100% rename from src/docs/field-type-image.md rename to docs/field-type-image.md diff --git a/src/docs/field-type-key.md b/docs/field-type-key.md similarity index 100% rename from src/docs/field-type-key.md rename to docs/field-type-key.md diff --git a/src/docs/field-type-markdown.md b/docs/field-type-markdown.md similarity index 100% rename from src/docs/field-type-markdown.md rename to docs/field-type-markdown.md diff --git a/src/docs/field-type-number.md b/docs/field-type-number.md similarity index 100% rename from src/docs/field-type-number.md rename to docs/field-type-number.md diff --git a/src/docs/field-type-password.md b/docs/field-type-password.md similarity index 100% rename from src/docs/field-type-password.md rename to docs/field-type-password.md diff --git a/src/docs/field-type-relationship.md b/docs/field-type-relationship.md similarity index 100% rename from src/docs/field-type-relationship.md rename to docs/field-type-relationship.md diff --git a/src/docs/field-type-text.md b/docs/field-type-text.md similarity index 100% rename from src/docs/field-type-text.md rename to docs/field-type-text.md diff --git a/src/docs/field-type-textarea.md b/docs/field-type-textarea.md similarity index 100% rename from src/docs/field-type-textarea.md rename to docs/field-type-textarea.md diff --git a/src/docs/field-type-time.md b/docs/field-type-time.md similarity index 100% rename from src/docs/field-type-time.md rename to docs/field-type-time.md diff --git a/src/docs/field-type-wysiwyg.md b/docs/field-type-wysiwyg.md similarity index 100% rename from src/docs/field-type-wysiwyg.md rename to docs/field-type-wysiwyg.md diff --git a/src/docs/fields.md b/docs/fields.md similarity index 100% rename from src/docs/fields.md rename to docs/fields.md diff --git a/src/docs/installation.md b/docs/installation.md similarity index 100% rename from src/docs/installation.md rename to docs/installation.md diff --git a/src/docs/introduction.md b/docs/introduction.md similarity index 100% rename from src/docs/introduction.md rename to docs/introduction.md diff --git a/src/docs/license.md b/docs/license.md similarity index 100% rename from src/docs/license.md rename to docs/license.md diff --git a/src/docs/localization.md b/docs/localization.md similarity index 100% rename from src/docs/localization.md rename to docs/localization.md diff --git a/src/docs/model-configuration.md b/docs/model-configuration.md similarity index 100% rename from src/docs/model-configuration.md rename to docs/model-configuration.md diff --git a/src/docs/relationship-columns.md b/docs/relationship-columns.md similarity index 100% rename from src/docs/relationship-columns.md rename to docs/relationship-columns.md diff --git a/src/docs/settings-configuration.md b/docs/settings-configuration.md similarity index 100% rename from src/docs/settings-configuration.md rename to docs/settings-configuration.md diff --git a/src/docs/style-guide.md b/docs/style-guide.md similarity index 100% rename from src/docs/style-guide.md rename to docs/style-guide.md diff --git a/src/docs/tutorials.md b/docs/tutorials.md similarity index 100% rename from src/docs/tutorials.md rename to docs/tutorials.md diff --git a/src/docs/validation.md b/docs/validation.md similarity index 100% rename from src/docs/validation.md rename to docs/validation.md From 9b35fdc05cbae0c67e9f1515cdddecc6f9e8e3d2 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sun, 16 Feb 2014 15:50:11 -0800 Subject: [PATCH 17/20] Bug in default value for rules array (See #491) --- changelog.md | 1 + src/Frozennode/Administrator/Config/Settings/Config.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 53f075693..b41d69084 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ - Closures can now be passed into the output option for columns - New translations (se, si, uk) +- Bugfix: When missing a rules option in a settings config file, an error would be thrown despite there being no explicit requirement for one - Bugfix: The administrator base controller was being instantiated multiple times during unit tests in laravel 4.1. ### 4.9.0 diff --git a/src/Frozennode/Administrator/Config/Settings/Config.php b/src/Frozennode/Administrator/Config/Settings/Config.php index e1530ef51..c896922f5 100644 --- a/src/Frozennode/Administrator/Config/Settings/Config.php +++ b/src/Frozennode/Administrator/Config/Settings/Config.php @@ -22,7 +22,7 @@ class Config extends ConfigBase implements ConfigInterface { 'permission' => true, 'before_save' => null, 'actions' => array(), - 'rules' => false, + 'rules' => array(), 'storage_path' => null, ); From b05fec121b9d3cb6c9d6a88d3f3d325483800998 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sun, 16 Feb 2014 16:04:56 -0800 Subject: [PATCH 18/20] fixing browser history json caching (see #489) --- changelog.md | 1 + src/controllers/AdminController.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index b41d69084..77d5775bf 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ - Closures can now be passed into the output option for columns - New translations (se, si, uk) +- Bugfix: When navigating away from an item edit route and then hitting the back button, the browser would cache the dynamic json response. Proper headers have now been set to avoid this. - Bugfix: When missing a rules option in a settings config file, an error would be thrown despite there being no explicit requirement for one - Bugfix: The administrator base controller was being instantiated multiple times during unit tests in laravel 4.1. diff --git a/src/controllers/AdminController.php b/src/controllers/AdminController.php index 9f478f20a..616e8a20e 100644 --- a/src/controllers/AdminController.php +++ b/src/controllers/AdminController.php @@ -75,10 +75,13 @@ public function item($modelName, $itemId = 0) $model = $config->updateModel($model, $fieldFactory, $actionFactory); } - return $actionPermissions['view'] ? $model->toJson() : Response::json(array( + $response = $actionPermissions['view'] ? Response::json($model) : Response::json(array( 'success' => false, 'errors' => "You do not have permission to view this item", )); + + //set the Vary : Accept header to avoid the browser caching the json response + return $response->header('Vary', 'Accept'); } else { From 9b130e0e6594ef931ad436e112d8af8f3160e02c Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sun, 16 Feb 2014 16:33:19 -0800 Subject: [PATCH 19/20] Adding customizable "back to site" path (closes #456) --- changelog.md | 1 + docs/configuration.md | 33 ++++++++++++++++++++--------- src/config/administrator.php | 7 ++++++ src/views/partials/header.blade.php | 2 +- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 77d5775bf..c01b9932f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ ## Changelog +- It's now possible to customize the "back to site" link at the top right of admin pages - Closures can now be passed into the output option for columns - New translations (se, si, uk) - Bugfix: When navigating away from an item edit route and then hitting the back button, the browser would cache the dynamic json response. Proper headers have now been set to avoid this. diff --git a/docs/configuration.md b/docs/configuration.md index 7a0da01da..76e9db01d 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -29,6 +29,7 @@ Below is a list of all the available options: - [Use Dashboard](#use-dashboard) - [Dashboard View](#dashboard-view) - [Home Page](#home-page) +- [Back To Site Path](#back-to-site-path) - [Login Path](#login-path) - [Logout Path](#logout-path) - [Redirect Key](#redirect-key) @@ -129,6 +130,22 @@ If you want to have a submenu, instead of passing in a string, pass in an array > For a detailed description of all the settings configuration options, see the **[settings configuration docs](/docs/settings-configuration)** + +### Permission + + /** + * The permission option is the highest-level authentication check that lets you define a closure that should return true if the current user + * is allowed to view the admin section. Any "falsey" response will send the user back to the 'login_path' defined below. + * + * @type closure + */ + 'permission'=> function() + { + return Auth::check(); + }, + +The permission option lets you define a closure that determines whether or not the current user can access all of Administrator. You can also define per-model permissions in each model's config. A user will only be given access if this resolves to a truthy value. If this fails, the user will be redirected to the `login_path`. + ### Use Dashboard @@ -172,21 +189,17 @@ If the `use_dashboard` option is set to true, Administrator will attempt to load If the `use_dashboard` option is set to false, Administrator will redirect the user to the above page when they visit the Administrator base URL. This must match an item in the `menu` option. - -### Permission + +### Back To Site Path /** - * The permission option is the highest-level authentication check that lets you define a closure that should return true if the current user - * is allowed to view the admin section. Any "falsey" response will send the user back to the 'login_path' defined below. + * The route to which the user will be taken when they click the "back to site" button * - * @type closure + * @type string */ - 'permission'=> function() - { - return Auth::check(); - }, + 'back_to_site_path' => '/', -The permission option lets you define a closure that determines whether or not the current user can access all of Administrator. You can also define per-model permissions in each model's config. A user will only be given access if this resolves to a truthy value. If this fails, the user will be redirected to the `login_path`. +Provide any value that would work with Laravel's `URL::to()` method. ### Login Path diff --git a/src/config/administrator.php b/src/config/administrator.php index 534fecf52..28fabc97e 100644 --- a/src/config/administrator.php +++ b/src/config/administrator.php @@ -86,6 +86,13 @@ */ 'home_page' => '', + /** + * The route to which the user will be taken when they click the "back to site" button + * + * @type string + */ + 'back_to_site_path' => '/', + /** * The login path is the path where Administrator will send the user if they fail a permission check * diff --git a/src/views/partials/header.blade.php b/src/views/partials/header.blade.php index 07628d801..5a7a42e22 100644 --- a/src/views/partials/header.blade.php +++ b/src/views/partials/header.blade.php @@ -38,7 +38,7 @@ @endif - {{trans('administrator::administrator.backtosite')}} + {{trans('administrator::administrator.backtosite')}} @if(Config::get('administrator::administrator.logout_path')) {{trans('administrator::administrator.logout')}} @endif From 889bd8503c4b005fa35876e7988a619f4850b532 Mon Sep 17 00:00:00 2001 From: Jan Hartigan Date: Sun, 16 Feb 2014 16:39:37 -0800 Subject: [PATCH 20/20] version bump to 4.10.0 --- changelog.md | 3 ++- readme.md | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index c01b9932f..556270aa7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,11 +1,12 @@ ## Changelog +### 4.10.0 - It's now possible to customize the "back to site" link at the top right of admin pages - Closures can now be passed into the output option for columns - New translations (se, si, uk) - Bugfix: When navigating away from an item edit route and then hitting the back button, the browser would cache the dynamic json response. Proper headers have now been set to avoid this. - Bugfix: When missing a rules option in a settings config file, an error would be thrown despite there being no explicit requirement for one -- Bugfix: The administrator base controller was being instantiated multiple times during unit tests in laravel 4.1. +- Bugfix: The administrator base controller was being instantiated multiple times during unit tests in laravel 4.1 ### 4.9.0 - Laravel 4.1 support diff --git a/readme.md b/readme.md index 57f9381c0..98f4ce40d 100644 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ Administrator is an administrative interface builder for [Laravel](http://larave - **Author:** Jan Hartigan - **Website:** [http://frozennode.com](http://frozennode.com) -- **Version:** 4.9.0 +- **Version:** 4.10.0 [![Build Status](https://travis-ci.org/FrozenNode/Laravel-Administrator.png?branch=master)](https://travis-ci.org/FrozenNode/Laravel-Administrator) @@ -53,7 +53,10 @@ Administrator is released under the MIT License. See the LICENSE file for detail ## Changelog -### 4.9.0 -- Laravel 4.1 support -- New translations (ja, pt) -- Bugfix: There was a PSR-0 filename/classname disagreement in on of the relatively unused classes (Fields\Relationships\HasOne) \ No newline at end of file +### 4.10.0 +- It's now possible to customize the "back to site" link at the top right of admin pages +- Closures can now be passed into the output option for columns +- New translations (se, si, uk) +- Bugfix: When navigating away from an item edit route and then hitting the back button, the browser would cache the dynamic json response. Proper headers have now been set to avoid this. +- Bugfix: When missing a rules option in a settings config file, an error would be thrown despite there being no explicit requirement for one +- Bugfix: The administrator base controller was being instantiated multiple times during unit tests in laravel 4.1 \ No newline at end of file