diff --git a/changelog.md b/changelog.md index 258a3b1af..874f7143e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ ## 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) + ### 4.8.0 - Anonymous functions can now be passed for custom action title, confirmation, and messages options - It is now possible to return a redirect from custom actions diff --git a/composer.json b/composer.json index 0c77c30e7..239ae2960 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "require": { "php": ">=5.3.0", - "laravel/framework": ">=4.0.0" + "laravel/framework": "4.*" }, "require-dev": { "mockery/mockery": "0.8.0" diff --git a/readme.md b/readme.md index 834154735..57f9381c0 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.8.0 +- **Version:** 4.9.0 [![Build Status](https://travis-ci.org/FrozenNode/Laravel-Administrator.png?branch=master)](https://travis-ci.org/FrozenNode/Laravel-Administrator) @@ -53,13 +53,7 @@ Administrator is released under the MIT License. See the LICENSE file for detail ## Changelog -### 4.8.0 -- Anonymous functions can now be passed for custom action title, confirmation, and messages options -- It is now possible to return a redirect from custom actions -- Selecting an item now scrolls the browser to the top of the page -- It is now possible to return accessor values into the edit form -- Default values can now be set for edit fields -- Bugfix: Custom dashboards no longer include unnecessary js files -- Bugfix: Updated to latest jQuery timepicker addon to fix some legacy jQuery UI bugs -- Bugfix: The detach() method is now used to remove related items instead of delete() -- Bugfix: The bool filter field wasn't properly grabbing results \ No newline at end of file +### 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 diff --git a/src/Frozennode/Administrator/AdministratorServiceProvider.php b/src/Frozennode/Administrator/AdministratorServiceProvider.php index f70c2869d..d3606d308 100644 --- a/src/Frozennode/Administrator/AdministratorServiceProvider.php +++ b/src/Frozennode/Administrator/AdministratorServiceProvider.php @@ -30,6 +30,30 @@ public function boot() //set the locale $this->setLocale(); + //define a constant that the rest of the package can use to conditionally use pieces of Laravel 4.1.x vs. 4.0.x + $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'); + + //include our filters, view composers, and routes + include __DIR__.'/../../filters.php'; + include __DIR__.'/../../viewComposers.php'; + include __DIR__.'/../../routes.php'; + + $this->app['events']->fire('administrator.ready'); + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { //the admin validator $this->app['admin_validator'] = $this->app->share(function($app) { @@ -91,23 +115,6 @@ public function boot() { return new Menu($app->make('config'), $app->make('admin_config_factory')); }); - - //include our filters, view composers, and routes - include __DIR__.'/../../filters.php'; - include __DIR__.'/../../viewComposers.php'; - include __DIR__.'/../../routes.php'; - - $this->app['events']->fire('administrator.ready'); - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - } /** @@ -117,7 +124,8 @@ public function register() */ public function provides() { - return array(); + return array('admin_validator', 'admin_config_factory', 'admin_field_factory', 'admin_datatable', 'admin_column_factory', + 'admin_action_factory', 'admin_menu'); } /** diff --git a/src/Frozennode/Administrator/Fields/Relationships/HasOne.php b/src/Frozennode/Administrator/Fields/Relationships/HasOne.php index 35c02cf7c..4d256bd34 100644 --- a/src/Frozennode/Administrator/Fields/Relationships/HasOne.php +++ b/src/Frozennode/Administrator/Fields/Relationships/HasOne.php @@ -1,6 +1,6 @@ ca da de en es eu fr hu it nl pl 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 zh-CN If you don't see the language you want, [contributing a new language is crazy easy](#contributing)! diff --git a/src/filters.php b/src/filters.php index 34fdd9a3c..f3d8ccca3 100644 --- a/src/filters.php +++ b/src/filters.php @@ -35,7 +35,7 @@ //validate_model filter Route::filter('validate_model', function($route, $request) { - $modelName = $route->getParameter('model'); + $modelName = App::make('administrator.4.1') ? $route->parameter('model') : $route->getParameter('model'); App::singleton('itemconfig', function($app) use ($modelName) { @@ -47,7 +47,7 @@ //validate_settings filter Route::filter('validate_settings', function($route, $request) { - $settingsName = $route->getParameter('settings'); + $settingsName = App::make('administrator.4.1') ? $route->parameter('settings') : $route->getParameter('settings'); App::singleton('itemconfig', function($app) use ($settingsName) { diff --git a/src/lang/ja/administrator.php b/src/lang/ja/administrator.php new file mode 100644 index 000000000..9a4e7e4a9 --- /dev/null +++ b/src/lang/ja/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' => "有効な title と single 名を各モデルの設定で指定してください", + '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' => "設定ページを作成するにはストレージパスを書き込み可能にしてください", + 'valid_home_page' => "有効なメニューアイテムを設定ファイルの home_page オプションで指定してください。", +); \ No newline at end of file diff --git a/src/lang/ja/knockout.php b/src/lang/ja/knockout.php new file mode 100644 index 000000000..ac45dd04f --- /dev/null +++ b/src/lang/ja/knockout.php @@ -0,0 +1,24 @@ + '本当にこのアイテムを削除してもよろしいですか? この操作は元に戻せません。', + 'saving' => '保存中...', + 'saved' => 'アイテムを保存しました。', + 'deleting' => '削除中...', + 'deleted' => 'アイテムを削除しました', + 'character_left' => ' 文字残り', + 'characters_left' => ' 文字残り', + 'no_results' => '該当する項目がありません', + 'select_options' => 'オプションを選択', + +); diff --git a/src/lang/pt/administrator.php b/src/lang/pt/administrator.php new file mode 100644 index 000000000..1a38732df --- /dev/null +++ b/src/lang/pt/administrator.php @@ -0,0 +1,56 @@ + 'Painel', + 'edit' => 'Editar', + 'filters' => 'Filtros', + 'loading' => 'A carregar...', + 'createnew' => 'Criar novo', + 'new' => 'Novo', + 'viewitem' => 'Visualizar :single', + 'id' => 'ID', + 'uploadimage' => 'Carregar imagem', + 'imageuploading' => 'A carregar imagem', + 'uploadfile' => 'Carregar arquivo', + 'fileuploading' => 'Carregar arquivo', + 'none' => 'Nenhum', + 'all' => 'Todos', + 'itemsperpage' => 'itens por página', + 'noresults' => 'Sem Resultados', + 'backtosite' => 'Voltar para o Site', + 'logout' => 'Sair', + + 'previous' => 'anterior', + 'next' => 'próximo', + + 'close' => 'Fechar', + 'delete' => 'Remover', + 'save' => 'Guardar', + 'create' => 'Criar', + 'cancel' => 'Cancelar', + + 'active' => 'Um momento...', + 'success' => 'Sucesso!', + 'error' => 'Ocorreu um erro a executar esta ação.', + + 'valid_columns' => "Precisa de fornecer um array válido em 'columns' em cada configuração dos models.", + 'valid_title' => "Precisa de fornecer um título e nome singular em cada configuração dos models", + 'valid_model' => "Precisa de fornecer uma opção válida em 'model' para cada configuração de models", + 'valid_edit' => "Precisa de fornecer uma opção válida em 'edit_fields' para cada configuração de models", + 'valid_menu' => "Precisa de fornecer uma opção válida em 'menu' no arquivo de configuração administrator.php", + 'valid_config_path' => "Opção inválida em 'model_config_path' no arquivo de configuração administrator.php. O diretório precisa existir e ter permissão de leitura.", + 'not_eloquent' => " não é um model Eloquent", + 'storage_path_permissions' => "O caminho para o storage precisa ter permissão de escrita.", + 'valid_home_page' => "Precisa de fornecer um item de menu válido na opção 'home_page'.", +); + diff --git a/src/lang/pt/knockout.php b/src/lang/pt/knockout.php new file mode 100644 index 000000000..2c6af745c --- /dev/null +++ b/src/lang/pt/knockout.php @@ -0,0 +1,23 @@ + 'Tem certeza que deseja apagar este item? Este processo não é reversível.', + 'saving' => 'A guardar...', + 'saved' => 'Item guardado.', + 'deleting' => 'A remover...', + 'deleted' => 'Item removido.', + 'character_left' => ' caracter a faltar', + 'characters_left' => ' caracteres a faltar', + 'no_results' => 'Nenhum resultado encontrado', + 'select_options' => 'Selecione uma opção', +);