?
Path : /home/admin/public_html/old/administrator/components/com_xijc/libraries/ |
Current File : /home/admin/public_html/old/administrator/components/com_xijc/libraries/core.php |
<?php // no direct access defined('_JEXEC') or die('Restricted access'); class XiJCFactory { function &getModel( $name = '') { static $modelInstances = null; if(!isset($modelInstances[$name])) { include_once( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_xijc' .DS.'models'.DS. JString::strtolower( $name ) .'.php'); $classname = 'XiJCModel'.$name; $modelInstances[$name] =& new $classname; } return $modelInstances[$name]; } /*function getComponentInfo($comid,$what='') { assert($comid); $filter = array(); $filter['id'] = $comid; $info = self::getComponents($filter); if(!empty($info)) { if($what) return $info[0]->$what; else return $info[0]; } }*/ function getComponents($filter='',$join='AND') { return XiJCPluginhandlerLibrary::getComponents($filter); /*$db =& JFactory::getDBO(); $filterSql = ''; if(!empty($filter)){ $filterSql = ' WHERE '; $counter = 0; foreach($filter as $name => $info) { $filterSql .= $counter ? ' '.$join.' ' : ''; $filterSql .= $db->nameQuote($name).'='.$db->Quote($info); $counter++; } } $query = 'SELECT * FROM '.$db->nameQuote('#__components').$filterSql; $db->setQuery($query); $result = $db->loadObjectList(); return $result;*/ } function getFonts() { $path = JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_xijc' . DS . 'assets' . DS . 'fonts'; jimport( 'joomla.filesystem.file' ); $fonts = array(); if( $handle = @opendir($path) ) { while( false !== ( $file = readdir( $handle ) ) ) { if( JFile::getExt($file) === 'ttf') $fonts[JFile::stripExt($file)] = JFile::stripExt($file); } } return $fonts; } }