function __construct(&$subject, $config) { parent::__construct($subject, $config); $app = &JFactory::getApplication(); $filepath = JPATH_ROOT . DS . 'components' . DS . 'com_bids' . DS . 'options.php'; if ($app->isAdmin() || !file_exists($filepath)) { $this->_is_valid = false; return false; } //load component settings require_once($filepath); $cfg=new BidConfig(); if('component'!=$cfg->bid_opt_registration_mode) { $this->_is_valid = false; return false; } require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_bids'.DS.'thefactory'.DS.'application'.DS.'application.class.php'); $configfile = JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_bids'.DS.'application.ini'; $MyApp = &JTheFactoryApplication::getInstance($configfile, true); JTable::addIncludePath(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_bids'.DS.'tables'); }
function cbTabHandler() { if(!file_exists(JPATH_SITE.DS.'components'.DS.'com_bids'.DS.'bids.php')) { return "<div>You must First install <a href='http://www.thefactory.ro/shop/joomla-components/auction-factory.html'> Auction Factory </a></div>"; } //need the whole framework loaded so we can access the price_item classes, in order to get the correct price for current user (verified, powerseller,...) require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_bids'.DS.'thefactory'.DS.'application'.DS.'application.class.php'); $cnfigfile = JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_bids'.DS.'application.ini'; $MyApp = JTheFactoryApplication::getInstance($cnfigfile, true); JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_bids'.DS.'tables'); JHTML::addIncludePath(JPATH_SITE.DS.'components'.DS.'com_bids'.DS.'helpers'.DS.'html'); require_once(JPATH_ROOT.DS.'components'.DS.'com_bids'.DS.'options.php'); require_once(JPATH_ROOT.DS.'components'.DS.'com_bids'.DS.'defines.php'); require_once(JPATH_SITE.DS.'components'.DS.'com_bids'.DS.'helpers'.DS.'bids.php'); BidsHelper::LoadHelperClasses(); JFactory::getLanguage()->load('com_bids'); parent::cbTabHandler(); }
public function display($tmpl = null) { $app = JFactory::getApplication(); $params = $app->getParams(); if (!$this->smarty->get_template_vars('page_title') && $params->get('show_page_title', 1)) { $page_title = $this->escape($params->get('page_title')); if($page_title) { $this->smarty->assign("page_title", $page_title); } } //add alternate feed link if($params->get('show_feed_link', 1) && file_exists(dirname(__FILE__).'view.feed.php')) { $document = JFactory::getDocument(); $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); } $MyApp = JTheFactoryApplication::getInstance(); if($MyApp->getIniValue('use_custom_fields')) { JHtml::addIncludePath($MyApp->app_path_admin.DS."fields".DS."html"); } $this->smarty->display($tmpl); }
static function loadController($task) { //atentie la Integration sunt mai multe controllere if (strpos($task,'.')!==FALSE) //task=controller.task? { $task=explode('.',$task); $module=$task[0]; $controllerName='JTheFactory'.ucfirst($module).'Controller'; $taskName=$task[1]; if (class_exists($controllerName)) { $controller=new $controllerName; return $controller; } $MyApp= JTheFactoryApplication::getInstance(); if ($MyApp->frontpage){ $controllerfile=$MyApp->app_path_front.strtolower($module).DS.'controllers'.DS.strtolower($module).'.php'; }else{ $controllerfile=$MyApp->app_path_admin.strtolower($module).DS.'controllers'.DS.strtolower($module).'.php'; } if (file_exists($controllerfile)) { require_once($controllerfile); if (class_exists($controllerName)) { $controller=new $controllerName; return $controller; } } } return false; }
function display($task = null) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('FACTORY_THEME_POSITIONS_MANAGEMENT'), $appname); JTheFactoryPositionsSubmenu::subMenuListPages(); switch ($task) { default: case 'listpages': JToolBarHelper::title(JText::_('FACTORY_PAGES_LIST_TITLE'), $appname); JToolBarHelper::custom('positions.listpositions', 'edit.png', 'edit_f2.png', JText::_('FACTORY_EDIT_PAGE_POSITONS'), true); break; case 'listpositions': JToolBarHelper::title(JText::_('FACTORY_POSITIONS_LIST_TITLE'), $appname); JToolBarHelper::custom('positions.listfields', 'edit.png', 'edit_f2.png', JText::_('FACTORY_EDIT_FIELDS_IN_POSITON'), true); break; case 'listfields': //JToolBarHelper::addNew( 'positions.assignfields',JText::_('FACTORY_ASSIGN_FIELDS') ); JToolBarHelper::custom('positions.listpages', 'archive.png', '', JText::_('FACTORY_PAGES_LIST'), false); JToolBarHelper::custom('positions.listpositions', 'archive.png', '', JText::_('FACTORY_POSITIONS_LIST'), false); break; case 'assignfields': JToolBarHelper::save("positions.saveassigns", JText::_('FACTORY_SAVE_ASSIGNS')); JToolBarHelper::cancel("positions.cancelassigns", JText::_('FACTORY_CANCEL')); break; } }
function installGatewayPack($sourcepath) { if (!self::isPackXML($sourcepath . DS . "manifest.xml")) { JError::raiseWarning(500, JText::_("FACTORY_FILE_IS_NOT_A_VALID_GATEWAY_MANIFEST") . $sourcepath . DS . "manifest.xml"); return null; } $xml = JFactory::getXML($sourcepath . DS . "manifest.xml"); $destfolder = (string) $xml->attributes()->folder; $MyApp = JTheFactoryApplication::getInstance(); $destination = $MyApp->app_path_admin . 'payments' . DS . 'plugins' . DS . 'gateways' . DS . strtolower($destfolder); jimport("joomla.filesystem.folder"); JFolder::copy($sourcepath, $destination); $db = JFactory::getDbo(); $db->setQuery("select max(`ordering`)+1 from #__" . APP_PREFIX . "_paysystems"); $maxordering = $db->loadResult(); $gw = JTable::getInstance('GatewaysTable', 'JTheFactory'); $gw->paysystem = (string) $xml->name; $gw->classname = (string) $xml->attributes()->folder; $gw->enabled = 0; $gw->params = null; $gw->ordering = $maxordering; $gw->isdefault = 0; $gw->store(); self::parseQueries($xml->queries); }
function getView( $name = '', $type = 'html', $prefix = '', $config = array() ) { $MyApp= JTheFactoryApplication::getInstance(); $config['template_path']=$MyApp->app_path_front.'payments'.DS."views".DS.strtolower($name).DS."tmpl"; return parent::getView($name,$type,'JTheFactoryViewPayments',$config); }
static function registerModule($app=null) { if (!$app) $app= JTheFactoryApplication::getInstance(); if ($app->getIniValue('use_integration')){ JLoader::register('JTheFactoryIntegration',$app->app_path_admin.'integration'.DS.'integration.php'); } }
function __construct($profile_mode='component') { $MyApp = JTheFactoryApplication::getInstance(); $integrationClass='JTheFactoryIntegration'.ucfirst($profile_mode); JLoader::register($integrationClass,$MyApp->app_path_admin.'integration'.DS.$profile_mode.'.php'); $this->integrationObject=new $integrationClass(); $this->profile_mode = $profile_mode; }
function __construct() { $MyApp = JTheFactoryApplication::getInstance(); $this->formxml = $MyApp->app_path_admin . 'payments' . DS . 'plugins' . DS . 'gateways' . DS . strtolower($this->name) . DS . 'form.xml'; $this->pluginfolder = $MyApp->app_path_admin . 'payments' . DS . 'plugins' . DS . 'gateways' . DS . strtolower($this->name); $lang = JFactory::getLanguage(); $lang->load('thefactory.gateway.' . $this->name); }
function getIntegrationFields() { $MyApp = JTheFactoryApplication::getInstance(); $flist = $MyApp->getIniValue("fields_list", "profile-integration"); if ($flist) { return explode(",", $flist); } else { return array(); } }
function getShortcuts() { $myApp = JTheFactoryApplication::getInstance(); $short = explode(',', $myApp->getIniValue('shortcuts', 'mail-settings')); $short_d = explode(',', $myApp->getIniValue('shortcuts_description', 'mail-settings')); $shortcuts = array(); for ($i = 0; $i < count($short); $i++) { $shortcuts[$short[$i]] = $short_d[$i]; } return $shortcuts; }
function display($task = null) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('FACTORY_ABOUT_THE_FACTORY_EXTENSION'), $appname); switch ($task) { default: JToolBarHelper::back(); break; } }
function display($task = null) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('FACTORY_GLOBAL_CONFIGURATION'), $appname); switch ($task) { default: JToolBarHelper::save('config.savesettings', JText::_("FACTORY_SAVE")); JToolBarHelper::back(); break; } }
function display($task) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('FACTORY_USER_BALANCES'), $appname); switch ($task) { default: case 'listing': JToolBarHelper::custom('payments.newpayment', 'new', 'new', JText::_('FACTORY_ADD_FUNDS'), false); break; } }
function display($task = null) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('FACTORY_MAILS_MANAGEMENT'), $appname); switch ($task) { default: JToolBarHelper::save('mailman.save', JText::_("FACTORY_SAVE")); JToolBarHelper::back(); break; } }
function display($task = null) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('COM_BIDS_PAY_PER_LISTING_CONFIGURATION'), $appname); switch ($task) { default: JToolBarHelper::apply('pricing.save'); JToolBarHelper::cancel('pricing.cancel'); JSubMenuHelper::addEntry(JText::_('COM_BIDS_PAYMENT_ITEMS'), 'index.php?option=' . APP_EXTENSION . '&task=pricing.listing', false); break; } }
function getIntegrationArray() { $MyApp = JTheFactoryApplication::getInstance(); $tablename = $MyApp->getIniValue("field_map_table", "profile-integration"); $fieldmap = array(); $database = JFactory::getDBO(); $database->setQuery("SELECT field,assoc_field FROM `" . $tablename . "`"); $r = $database->loadAssocList(); for ($i = 0; $i < count($r); $i++) { $fieldmap[$r[$i]['field']] = $r[$i]['assoc_field']; } return $fieldmap; }
static function registerModule($app = null) { if (!$app) { $app = JTheFactoryApplication::getInstance(); } if ($app->getIniValue('use_integration')) { JLoader::register('JTheFactoryIntegration', $app->app_path_admin . 'integration' . DS . 'integration.php'); JLoader::register('JTheFactoryIntegrationCBController', $app->app_path_admin . 'integration' . DS . 'controllers' . DS . 'cb.php'); JLoader::register('JTheFactoryIntegrationLoveController', $app->app_path_admin . 'integration' . DS . 'controllers' . DS . 'love.php'); $lang = JFactory::getLanguage(); $lang->load('thefactory.integration', JPATH_ADMINISTRATOR); } }
function getGatewayObject($name) { $MyApp = JTheFactoryApplication::getInstance(); $path = $MyApp->app_path_admin . 'payments' . DS . 'plugins' . DS . 'gateways' . DS . strtolower($name) . DS . 'controller.php'; if (!file_exists($path)) { return null; } require_once $path; if (!class_exists($name)) { return null; } $gateway = new $name(); return $gateway; }
function display($task = null) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('FACTORY_LOVE_FACTORY_INTEGRATION'), $appname); switch ($task) { default: JToolBarHelper::save('integrationlove.save', JText::_('FACTORY_SAVE')); JToolBarHelper::cancel('integration.display'); break; case 'installPlugins': JToolBarHelper::customX('integrationlove.display', 'back', 'back', JText::_("FACTORY_BACK"), false); break; } }
static function registerModule($app = null) { if (!$app) { $app = JTheFactoryApplication::getInstance(); } if ($app->getIniValue('use_custom_fields')) { JLoader::register('FactoryFieldsTbl', $app->app_path_admin . "fields" . DS . 'tables' . DS . 'table.class.php'); JLoader::register('CustomFieldsFactory', $app->app_path_admin . DS . 'fields' . DS . 'helper' . DS . 'factory.class.php'); JLoader::register('FactoryFieldTypes', $app->app_path_admin . 'fields' . DS . 'plugins' . DS . 'field_types.php'); JLoader::register('FactoryFieldValidator', $app->app_path_admin . 'fields' . DS . 'plugins' . DS . 'field_validator.php'); JLoader::register('JTheFactoryListModel', $app->app_path_admin . "fields" . DS . 'models' . DS . 'listmodel.php'); JHtml::addIncludePath($app->app_path_admin . 'fields' . DS . 'html'); JTable::addIncludePath($app->app_path_admin . 'fields' . DS . 'tables'); } }
function display($task) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('FACTORY_PAYMENT_ITEMS_AND_PRICES'), $appname); switch ($task) { default: case 'listing': JToolBarHelper::custom('pricing.install', 'upload.png', 'upload_f2.png', JText::_('FACTORY_INSTALL_NEW_ITEM'), false); break; case 'install': JToolBarHelper::custom('pricing.doupload', 'upload.png', 'upload_f2.png', JText::_('FACTORY_UPLOAD_NEW_ITEM'), false); break; } }
static function registerModule($app = null) { if (!$app) { $app = JTheFactoryApplication::getInstance(); } if ($app->getIniValue('use_events')) { JLoader::register('JTheFactoryEvents', $app->app_path_admin . 'events/events.class.php'); JLoader::register('JTheFactoryEventsHelper', $app->app_path_admin . 'events/events.helper.php'); JLoader::register('JTheFactoryDispatcher', $app->app_path_admin . 'events/events.dispatcher.php'); if ($app->frontpage) { JTheFactoryEventsHelper::registerEvents(JPATH_SITE . DS . 'components' . DS . APP_EXTENSION . DS . 'events'); } else { JTheFactoryEventsHelper::registerEvents(JPATH_ADMINISTRATOR . DS . 'components' . DS . APP_EXTENSION . DS . 'events'); } } }
function preflight($route, $adapter) { jimport('joomla.filesystem.file'); $currentApplicationFile = JPATH_COMPONENT_ADMINISTRATOR . DS . 'thefactory' . DS . 'application' . DS . 'application.class.php'; if (JFile::exists($currentApplicationFile)) { require_once $currentApplicationFile; $currentApplication = JTheFactoryApplication::getInstance(); $currentVersion = (string) $currentApplication->getIniValue('version'); if ($currentVersion < '3.0.0') { JError::raiseError(500, 'Can not upgrade from version ' . $currentVersion . '!'); return false; } } require_once $adapter->getParent()->getPath('source') . DS . 'administrator' . DS . 'components' . DS . 'com_bids' . DS . 'thefactory' . DS . 'installer' . DS . 'installer.php'; require_once $adapter->getParent()->getPath('source') . DS . 'components' . DS . 'com_bids' . DS . 'installer' . DS . 'bids_installer.php'; $this->installer = new TheFactoryBIDSInstaller('com_bids', $adapter); }
static function registerModule($app=null) { if (!$app) $app= JTheFactoryApplication::getInstance(); if ($app->getIniValue('use_payment_gateways')){ JLoader::register('JTheFactoryPricingHelper',$app->app_path_admin.'payments'.DS.'helper'.DS.'pricing.php'); JLoader::register('JTheFactoryBalanceController',$app->app_path_front.'payments'.DS.'controllers'.DS.'balance.php'); JLoader::register('JTheFactoryOrderProcessorController',$app->app_path_front.'payments'.DS.'controllers'.DS.'processor.php'); JLoader::register('JTheFactoryOrder',$app->app_path_admin.'payments'.DS.'classes'.DS.'orders.php'); if ($app->getIniValue('use_events')){ JTheFactoryPricingHelper::registerEvents(); JTheFactoryEventsHelper::registerEvents($app->app_path_admin.'payments'.DS.'events'); } $lang=JFactory::getLanguage(); $lang->load('thefactory.payments',JPATH_ADMINISTRATOR); } }
function display($task) { $MyApp = JTheFactoryApplication::getInstance(); $appname = $MyApp->getIniValue('name'); JToolBarHelper::title(JText::_('FACTORY_PAYMENT_GATEWAYS_LIST'), $appname); switch ($task) { default: break; case 'install': JToolBarHelper::custom('gateways.doupload', 'upload.png', 'upload_f2.png', JText::_('FACTORY_UPLOAD_NEW_PAYMENT_GATEWAY'), false); break; case 'listing': JToolBarHelper::publish('gateways.toggle', JText::_('FACTORY_TOGGLE_ENABLE')); JToolBarHelper::publish('gateways.setdefault', JText::_('FACTORY_SET_DEFAULT_GATEWAY')); JToolBarHelper::custom('gateways.install', 'upload.png', 'upload_f2.png', JText::_('FACTORY_INSTALL_NEW_ITEM'), false); break; } }
function save() { $MyApp = JTheFactoryApplication::getInstance(); $tablename = $MyApp->getIniValue("field_map_table", "profile-integration"); $fields = JTheFactoryIntegrationCB::getIntegrationFields(); $db = JFactory::getDBO(); foreach ($fields as $field) { $cb = JRequest::getVar($field, null); $db->setQuery("select * from `{$tablename}` where `field`='{$field}'"); $res = $db->loadObject(); if ($res) { $db->setQuery("update `{$tablename}` set `assoc_field`='{$cb}' where `field`='{$field}'"); } else { $db->setQuery("insert into `{$tablename}` set `assoc_field`='{$cb}' ,`field`='{$field}'"); } $db->query(); } $this->setRedirect("index.php?option=" . APP_EXTENSION . "&task=integrationLove.display", JText::_("FACTORY_SETTINGS_SAVED")); }
static function registerModule($app = null) { if (!$app) { $app = JTheFactoryApplication::getInstance(); } if ($app->getIniValue('use_payment_gateways')) { JLoader::register('JTheFactoryPricingHelper', $app->app_path_admin . 'payments' . DS . 'helper' . DS . 'pricing.php'); JLoader::register('JTheFactoryPaymentsHtmlHelper', $app->app_path_admin . 'payments' . DS . 'helper' . DS . 'paymentshtml.php'); JLoader::register('JTheFactoryBalancesController', $app->app_path_admin . 'payments' . DS . 'controllers' . DS . 'balances.php'); JLoader::register('JTheFactoryCurrenciesController', $app->app_path_admin . 'payments' . DS . 'controllers' . DS . 'currencies.php'); JLoader::register('JTheFactoryGatewaysController', $app->app_path_admin . 'payments' . DS . 'controllers' . DS . 'gateways.php'); JLoader::register('JTheFactoryOrdersController', $app->app_path_admin . 'payments' . DS . 'controllers' . DS . 'orders.php'); JLoader::register('JTheFactoryPricingController', $app->app_path_admin . 'payments' . DS . 'controllers' . DS . 'pricing.php'); if ($app->getIniValue('use_events')) { JTheFactoryPricingHelper::registerEvents(); JTheFactoryEventsHelper::registerEvents($app->app_path_admin . 'payments' . DS . 'events'); } } }
/** * Field related Tasks / Admin Section */ function Main() { $MyApp = JTheFactoryApplication::getInstance(); $filename = $MyApp->getIniValue('version_root') . '/' . APP_EXTENSION . ".xml"; $doc = JTheFactoryHelper::remote_read_url($filename); $xml = JFactory::getXML($doc, false); $view = $this->getView('main'); if (version_compare(COMPONENT_VERSION, (string) $xml->latestversion) >= 0) { $view->assign('isnew_version', false); } else { $view->assign('isnew_version', true); } $view->assign('latestversion', (string) $xml->latestversion); $view->assign('versionhistory', (string) $xml->versionhistory); $view->assign('downloadlink', (string) $xml->downloadlink); $view->assign('aboutfactory', html_entity_decode((string) $xml->aboutfactory)); $view->assign('otherproducts', html_entity_decode((string) $xml->otherproducts)); $view->assign('build', (string) $xml->build); $view->display(); }