PageRenderTime 22ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/Translate/Lib/Translations.php

https://github.com/kareypowell/croogo
PHP | 28 lines | 14 code | 3 blank | 11 comment | 0 complexity | 567ef95148406633c003099ea9fc6e77 MD5 | raw file
  1. <?php
  2. /**
  3. * Translations
  4. *
  5. * @package Croogo.Translate.Lib
  6. * @author Rachman Chavik <rchavik@gmail.com>
  7. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  8. * @link http://www.croogo.org
  9. */
  10. class Translations {
  11. /**
  12. * Read configured Translate.models and hook the appropriate behaviors
  13. */
  14. public static function translateModels() {
  15. $path ='admin:true/plugin:translate/controller:translate/action:index/:id/';
  16. foreach (Configure::read('Translate.models') as $model => $config) {
  17. Croogo::hookBehavior($model, 'Translate.CroogoTranslate', $config);
  18. Croogo::hookAdminRowAction(
  19. Inflector::pluralize($model) . '/admin_index',
  20. __d('croogo', 'Translate'),
  21. $path . $model
  22. );
  23. }
  24. }
  25. }