70c139fed11cd09060fbfbc1d5287117.resolve.tables.resolver 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. * Resolve creating db tables
  24. *
  25. * @package gallery
  26. * @subpackage build
  27. */
  28. if ($object->xpdo) {
  29. switch ($options[xPDOTransport::PACKAGE_ACTION]) {
  30. case xPDOTransport::ACTION_INSTALL:
  31. $modx =& $object->xpdo;
  32. $modelPath = $modx->getOption('gallery.core_path',null,$modx->getOption('core_path').'components/gallery/').'model/';
  33. $modx->addPackage('gallery',$modelPath);
  34. $manager = $modx->getManager();
  35. $manager->createObjectContainer('galItem');
  36. $manager->createObjectContainer('galAlbum');
  37. $manager->createObjectContainer('galAlbumItem');
  38. $manager->createObjectContainer('galAlbumContext');
  39. $manager->createObjectContainer('galTag');
  40. break;
  41. case xPDOTransport::ACTION_UPGRADE:
  42. break;
  43. }
  44. }
  45. return true;