/exchange/code/trunk/administrator/components/com_exchange/models/export.php
PHP | 66 lines | 41 code | 7 blank | 18 comment | 2 complexity | 351975f2cad8ba0940943fb07e9f909a MD5 | raw file
- <?php
- /**
- * @version $Id: export.php 280 2010-09-18 02:14:15Z eddieajau $
- * @package NewLifeInIT
- * @subpackage com_exchange
- * @copyright Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License version 2 or later.
- * @link http://www.theartofjoomla.com
- */
- // no direct access
- defined('_JEXEC') or die;
- jimport('joomla.application.component.model');
- jimport('joomla.filesystem.file');
- /**
- * @package NewLifeInIT
- * @subpackage com_exchange
- */
- class ExchangeModelExport extends JModel
- {
- /**
- * Get a list of the paths to search for definition files
- *
- * @return array
- */
- protected function getPaths()
- {
- $paths = array(
- 'builtin' => JPATH_COMPONENT.DS.'adapters'.DS.'export',
- 'custom' => JPATH_ADMINISTRATOR.DS.'custom'.DS.'com_exchange'.DS.'export'
- );
- return $paths;
- }
- function getTables()
- {
- $db = &$this->getDBO();
- return $db->getTableList();
- }
- function getAdapters()
- {
- $result = array();
- $paths = self::getPaths();
- foreach ($paths as $type => $path) {
- if (is_dir($path)) {
- $files = JFolder::files($path, '\.php$', false, true);
- foreach ($files as $file)
- {
- require_once($file);
- $name = JFile::stripExt(basename($file));
- if (file_exists($path.DS.$name.'.xml')) {
- $result[$name] = simplexml_load_file($path.DS.$name.'.xml');
- } else{
- $result[$name] = null;
- }
- }
- }
- }
- return $result;
- }
- }