index.class.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Gallery
  4. *
  5. * Copyright 2010-2012 by Shaun McCormick <shaun@modx.com>
  6. *
  7. * Gallery is free software; you can redistribute it and/or modify it under the
  8. * terms of the GNU General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option) any later
  10. * version.
  11. *
  12. * Gallery is distributed in the hope that it will be useful, but WITHOUT ANY
  13. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  14. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * Gallery; if not, write to the Free Software Foundation, Inc., 59 Temple
  18. * Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. * @package gallery
  21. */
  22. /**
  23. * @package gallery
  24. * @subpackage controllers
  25. */
  26. require_once dirname(__FILE__) . '/model/gallery/gallery.class.php';
  27. class IndexManagerController extends modExtraManagerController {
  28. public static function getDefaultController() { return 'home'; }
  29. }
  30. abstract class GalleryManagerController extends modManagerController {
  31. /** @var Gallery $gallery */
  32. public $gallery;
  33. public function initialize() {
  34. $this->gallery = new Gallery($this->modx);
  35. $this->addCss($this->gallery->config['cssUrl'].'mgr.css');
  36. $this->addJavascript($this->gallery->config['jsUrl'].'mgr/gallery.js');
  37. $this->addHtml('<script type="text/javascript">
  38. Ext.onReady(function() {
  39. GAL.config = '.$this->modx->toJSON($this->gallery->config).';
  40. GAL.config.connector_url = "'.$this->gallery->config['connectorUrl'].'";
  41. GAL.action = "'.(!empty($_REQUEST['a']) ? $_REQUEST['a'] : 0).'";
  42. });
  43. </script>');
  44. }
  45. public function process(array $scriptProperties = array()) {
  46. }
  47. public function getLanguageTopics() {
  48. return array('gallery:default');
  49. }
  50. public function checkPermissions() { return true;}
  51. }