/** * Method to get a list of tasks * * @return array $items The tasks */ public static function getItems($params) { JLoader::register('PFtasksModelTasks', JPATH_SITE . '/components/com_pftasks/models/tasks.php'); $model = JModelLegacy::getInstance('Tasks', 'PFtasksModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $model->setState('params', $appParams); // Set the filters based on the module params $model->setState('list.start', 0); $model->setState('list.limit', (int) $params->get('count', 10)); $model->setState('filter.published', 1); // Set project filter if (!(int) $params->get('tasks_of')) { $model->setState('filter.project', PFApplicationHelper::getActiveProjectId()); } else { $project = (int) $params->get('project'); if ($project) { $model->setState('filter.project', $project); } else { $model->setState('filter.project', PFApplicationHelper::getActiveProjectId()); } } // Set completition filter $model->setState('filter.complete', $params->get('filter_complete')); // Sort and order $model->setState('list.ordering', $params->get('sort')); $model->setState('list.direction', $params->get('order')); $items = $model->getItems(); return $items; }
/** * Return JSON encoded data for Statistic page */ function display($tpl = null) { $app = JFactory::getApplication(); $params = $app->getParams(); jimport('joomla.environment.request'); /* validating request */ $guild_id = $params->get('guild_id', '0'); $groups = $params->get('allowed_groups'); $by_chars = $params->get('stats_by_chars', 0); $show_rating = $params->get('show_rating', 0); if ($guild_id != 0) { JRequest::setVar('guild_id', $guild_id, 'get', true); } if ($by_chars == 0) { JRequest::setVar('character_id', 0, 'get', true); } if ($show_rating != 0) { JRequest::setVar('show_rating', 1, 'get', true); } if (JRequest::getVar('group_id', '', 'get', 'int') != '') { if (!in_array(JRequest::getVar('group_id', '', 'get', 'int'), $groups)) { JRequest::setVar('group_id', '', 'get', true); } } /* load backend controller */ JLoader::register('RaidPlannerControllerStats', JPATH_ADMINISTRATOR . '/components/com_raidplanner/controllers/stats.php'); $tmp = new RaidPlannerControllerStats(); $tmp->display(); }
/** * Shows the configuration page for this two factor authentication method. * * @param object $otpConfig The two factor auth configuration object * @param integer $user_id The numeric user ID of the user whose form we'll display * * @return boolean|string False if the method is not ours, the HTML of the configuration page otherwise * * @see UsersModelUser::getOtpConfig * @since 3.2 */ public function onUserTwofactorShowConfiguration($otpConfig, $user_id = null) { if ($otpConfig->method == $this->methodName) { // This method is already activated. Reuse the same Yubikey ID. $yubikey = $otpConfig->config['yubikey']; } else { // This methods is not activated yet. We'll need a Yubikey TOTP to setup this Yubikey. $yubikey = ''; } // Is this a new TOTP setup? If so, we'll have to show the code validation field. $new_totp = $otpConfig->method != $this->methodName; // Start output buffering @ob_start(); // Include the form.php from a template override. If none is found use the default. $path = FOFPlatform::getInstance()->getTemplateOverridePath('plg_twofactorauth_yubikey', true); JLoader::import('joomla.filesystem.file'); if (JFile::exists($path . '/form.php')) { include_once $path . '/form.php'; } else { include_once __DIR__ . '/tmpl/form.php'; } // Stop output buffering and get the form contents $html = @ob_get_clean(); // Return the form contents return array('method' => $this->methodName, 'form' => $html); }
/** * Fetch custom Element view. * * @param string $name Field Name. * @param mixed $value Field value. * @param mixed $node Field node. * @param mixed $control_name Field control_name/Id. * * @since 2.2 * @return null */ public function fetchElement($name, $value, $node, $control_name) { $db = JFactory::getDBO(); $user = JFactory::getUser(); // Load Zone helper. $path = JPATH_SITE . DS . "components" . DS . "com_quick2cart" . DS . 'helpers' . DS . "zoneHelper.php"; JLoader::register('zoneHelper', $path); JLoader::load('zoneHelper'); $zoneHelper = new zoneHelper(); // Get user's accessible zone list $zoneList = $zoneHelper->getUserZoneList('', array(1)); $options = array(); $app = JFactory::getApplication(); $jinput = $app->input; $taxrate_id = $jinput->get('id'); $defaultZoneid = ""; if ($taxrate_id) { $defaultZoneid = $zoneHelper->getZoneFromTaxRateId($taxrate_id); } foreach ($zoneList as $zone) { $zoneName = ucfirst($zone['name']); $options[] = JHtml::_('select.option', $zone['id'], $zoneName); } $fieldName = $name; return JHtml::_('select.genericlist', $options, $fieldName, 'class="inputbox required" size="1" ', 'value', 'text', $defaultZoneid, $control_name); }
protected function onAdd($tpl = null) { /** @var AkeebaModelCpanels $model */ $model = $this->getModel(); $aeconfig = Factory::getConfiguration(); // Load the helper classes $this->loadHelper('utils'); $this->loadHelper('status'); $statusHelper = AkeebaHelperStatus::getInstance(); // Load the model if (!class_exists('AkeebaModelStatistics')) { JLoader::import('models.statistics', JPATH_COMPONENT_ADMINISTRATOR); } $statmodel = new AkeebaModelStatistics(); $this->profileid = $model->getProfileID(); // Active profile ID $this->profilelist = $model->getProfilesList(); // List of available profiles $this->statuscell = $statusHelper->getStatusCell(); // Backup status $this->detailscell = $statusHelper->getQuirksCell(); // Details (warnings) $this->statscell = $statmodel->getLatestBackupDetails(); $this->fixedpermissions = $model->fixMediaPermissions(); // Fix media/com_akeeba permissions $this->needsdlid = $model->needsDownloadID(); $this->needscoredlidwarning = $model->mustWarnAboutDownloadIDInCore(); $this->extension_id = $model->getState('extension_id', 0, 'int'); // Should I ask for permission to display desktop notifications? JLoader::import('joomla.application.component.helper'); $this->desktop_notifications = \Akeeba\Engine\Util\Comconfig::getValue('desktop_notifications', '0') ? 1 : 0; $this->statsIframe = F0FModel::getTmpInstance('Stats', 'AkeebaModel')->collectStatistics(true); return $this->onDisplay($tpl); }
public function onAdd($tpl = null) { $media_folder = JURI::base() . '../media/com_akeeba/'; // Get a JSON representation of GUI data $json = AkeebaHelperEscape::escapeJS(AEUtilInihelper::getJsonGuiDefinition(), '"\\'); $this->assignRef('json', $json); // Get profile ID $profileid = AEPlatform::getInstance()->get_active_profile(); $this->assign('profileid', $profileid); // Get profile name $profileName = FOFModel::getTmpInstance('Profiles', 'AkeebaModel')->setId($profileid)->getItem()->description; $this->assign('profilename', $profileName); // Get the root URI for media files $this->assign('mediadir', AkeebaHelperEscape::escapeJS($media_folder . 'theme/')); // Are the settings secured? if (AEPlatform::getInstance()->get_platform_configuration_option('useencryption', -1) == 0) { $this->assign('securesettings', -1); } elseif (!AEUtilSecuresettings::supportsEncryption()) { $this->assign('securesettings', 0); } else { JLoader::import('joomla.filesystem.file'); $filename = JPATH_COMPONENT_ADMINISTRATOR . '/akeeba/serverkey.php'; if (JFile::exists($filename)) { $this->assign('securesettings', 1); } else { $this->assign('securesettings', 0); } } // Add live help AkeebaHelperIncludes::addHelp('config'); }
public static function getDownloadHtml($product_id) { $app = JFactory::getApplication(); $html = ''; JLoader::register("J2StoreViewDownloads", JPATH_SITE . "/components/com_j2store/views/downloads/view.html.php"); $layout = 'freefiles'; $view = new J2StoreViewDownloads(); //$view->_basePath = JPATH_ROOT.DS.'components'.DS.'com_j2store'; $view->addTemplatePath(JPATH_SITE . '/components/com_j2store/views/downloads/tmpl'); $view->addTemplatePath(JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_j2store/downloads'); require_once JPATH_SITE . '/components/com_j2store/models/downloads.php'; $model = new J2StoreModelDownloads(); $files = $model->getFreeFiles($product_id); $view->assign('_basePath', JPATH_SITE . '/components/com_j2store'); $view->set('_controller', 'downloads'); $view->set('_view', 'downloads'); $view->set('_doTask', true); $view->set('hidemenu', true); $view->setModel($model, true); $view->setLayout($layout); $view->assign('product_id', $product_id); $config = JComponentHelper::getParams('com_j2store'); $view->assign('params', $config); $view->assign('files', $files); ob_start(); $view->display(); $html = ob_get_contents(); ob_end_clean(); return $html; }
function renderInput($articleid, $fieldsid, $value, $extras = null ) { $required=""; global $sitepath; JLoader::register('fieldattach', $sitepath.DS.'components/com_fieldsattach/helpers/fieldattach.php'); $boolrequired = fieldattach::isRequired($fieldsid); if($boolrequired) $required="required"; //Add CSS *********************** $str = '<link rel="stylesheet" href="'.JURI::root() .'plugins/fieldsattachment/vimeo/vimeo.css" type="text/css" />'; $app = JFactory::getApplication(); $templateDir = JURI::base() . 'templates/' . $app->getTemplate(); $css = JPATH_SITE ."/administrator/templates/". $app->getTemplate(). "/html/com_fieldsattach/css/vimeo.css"; $pathcss= JURI::root()."administrator/templates/". $app->getTemplate()."/html/com_fieldsattach/css/vimeo.css"; if(file_exists($css)){ $str .= '<link rel="stylesheet" href="'.$pathcss.'" type="text/css" />'; } $str .= '<div class="vimeo"><div class="file">'; $str .= '<span>'.JText::_("CODE").'</span>'; $str .= '<input name="field_'.$fieldsid.'" type="text" size="150" value="'.$value.'" class="customfields '.$required.'" />'; $str .= '</div>'; $str .= '<iframe src="http://player.vimeo.com/video/'.$value .'" frameborder="0"></iframe>'; $str .= '</div>'; return $str ; }
public function __construct() { JLoader::import('joomla.filesystem.file'); // $isPro = defined('ARS_PRO') ? (ARS_PRO == 1) : false; // Load the component parameters, not using JComponentHelper to avoid conflicts ;) JLoader::import('joomla.html.parameter'); JLoader::import('joomla.application.component.helper'); $db = JFactory::getDbo(); $sql = $db->getQuery(true)->select($db->quoteName('params'))->from($db->quoteName('#__extensions'))->where($db->quoteName('type') . ' = ' . $db->quote('component'))->where($db->quoteName('element') . ' = ' . $db->quote('com_j2store')); $db->setQuery($sql); $rawparams = $db->loadResult(); $params = new JRegistry(); if (version_compare(JVERSION, '3.0', 'ge')) { $params->loadString($rawparams, 'JSON'); } else { $params->loadJSON($rawparams); } // Dev releases use the "newest" strategy if (substr($this->_currentVersion, 1, 2) == 'ev') { $this->_versionStrategy = 'newest'; } else { $this->_versionStrategy = 'vcompare'; } // Get the minimum stability level for updates $this->_minStability = $params->get('minstability', 'stable'); // Do we need authorized URLs? $this->_requiresAuthorization = false; // Should I use our private CA store? if (@file_exists(dirname(__FILE__) . '/../assets/cacert.pem')) { $this->_cacerts = dirname(__FILE__) . '/../assets/cacert.pem'; } parent::__construct(); }
/** * Constructor * * @since 0.1 */ function __construct() { // Include the tables in path JLoader::import('xmlrpc', JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'phpxmlrpc'); JLoader::import('xmlrpcs', JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'phpxmlrpc'); parent::__construct(); }
public function getOrderDetails() { $orderModel = VmModel::getModel('orders'); $orderDetails = 0; // If the user is not logged in, we will check the order number and order pass if ($orderPass = JRequest::getString('order_pass', false) and $orderNumber = JRequest::getString('order_number', false)) { $orderId = $orderModel->getOrderIdByOrderPass($orderNumber, $orderPass); if (empty($orderId)) { vmDebug('Invalid order_number/password ' . JText::_('COM_VIRTUEMART_RESTRICTED_ACCESS')); return 0; } $orderDetails = $orderModel->getOrder($orderId); } if ($orderDetails == 0) { $_currentUser = JFactory::getUser(); $cuid = $_currentUser->get('id'); // If the user is logged in, we will check if the order belongs to him $virtuemart_order_id = JRequest::getInt('virtuemart_order_id', 0); if (!$virtuemart_order_id) { $virtuemart_order_id = VirtueMartModelOrders::getOrderIdByOrderNumber(JRequest::getString('order_number')); } $orderDetails = $orderModel->getOrder($virtuemart_order_id); JLoader::register('Permissions', JPATH_VM_ADMINISTRATOR . '/helpers/permissions.php'); if (!Permissions::getInstance()->check("admin")) { if (!empty($orderDetails['details']['BT']->virtuemart_user_id)) { if ($orderDetails['details']['BT']->virtuemart_user_id != $cuid) { echo 'view ' . JText::_('COM_VIRTUEMART_RESTRICTED_ACCESS'); return; } } } } return $orderDetails; }
protected function getInput() { JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); $input = parent::getInput(); return $input; }
function jflanguagesType() { $this->values = array(); if (ACYMAILING_J16 && file_exists(JPATH_SITE . DS . 'libraries' . DS . 'joomfish' . DS . 'manager.php') || !ACYMAILING_J16 && file_exists(JPATH_SITE . DS . 'administrator' . DS . 'components' . DS . 'com_joomfish' . DS . 'classes' . DS . 'JoomfishManager.class.php')) { include_once JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'helpers' . DS . 'defines.php'; if (!ACYMAILING_J16) { include_once JOOMFISH_ADMINPATH . DS . 'classes' . DS . 'JoomfishManager.class.php'; } else { include_once JPATH_SITE . DS . 'libraries' . DS . 'joomfish' . DS . 'manager.php'; } $jfManager = JoomFishManager::getInstance(); $langActive = $jfManager->getActiveLanguages(); $this->values[] = JHTML::_('select.option', '', JText::_('DEFAULT_LANGUAGE')); foreach ($langActive as $oneLanguage) { $this->values[] = JHTML::_('select.option', $oneLanguage->shortcode . ',' . $oneLanguage->id, $oneLanguage->name); } $this->found = true; } if (empty($this->values) && file_exists(JPATH_SITE . DS . 'components' . DS . 'com_falang' . DS . 'helpers' . DS . 'defines.php') && (include_once JPATH_SITE . DS . 'components' . DS . 'com_falang' . DS . 'helpers' . DS . 'defines.php')) { JLoader::register('FalangManager', FALANG_ADMINPATH . '/classes/FalangManager.class.php'); $fManager = FalangManager::getInstance(); $langActive = $fManager->getActiveLanguages(); $this->values[] = JHTML::_('select.option', '', JText::_('DEFAULT_LANGUAGE')); foreach ($langActive as $oneLanguage) { $this->values[] = JHTML::_('select.option', $oneLanguage->lang_code . ',' . $oneLanguage->lang_id, $oneLanguage->title); } $this->found = true; } }
/** * Display the view. * * @param string $tpl The subtemplate to display. * * @return void */ function display($tpl = null) { // Get params JLoader::import('helpers.redmigrator', JPATH_COMPONENT_ADMINISTRATOR); $params = redMigratorHelper::getParams(); // // Joomla bug: JInstaller not save the defaults params reading config.xml // $db = JFactory::getDBO(); if (!$params->method) { $default_params = '{"method":"rest","rest_hostname":"http:\\/\\/www.example.org\\/","rest_username":"","rest_password":"","rest_key":"","path":"","driver":"mysql","hostname":"localhost","username":"","password":"","database":"","prefix":"jos_","skip_checks":"0","skip_files":"1","skip_templates":"1","skip_extensions":"1","skip_core_users":"0","skip_core_categories":"0","skip_core_sections":"0","skip_core_contents":"0","skip_core_contents_frontpage":"0","skip_core_menus":"0","skip_core_menus_types":"0","skip_core_modules":"0","skip_core_modules_menu":"0","skip_core_banners":"0","skip_core_banners_clients":"0","skip_core_banners_tracks":"0","skip_core_contacts":"0","skip_core_newsfeeds":"0","skip_core_weblinks":"0","positions":"0","debug":"0"}'; $query = "UPDATE #__extensions SET `params` = '{$default_params}' WHERE `element` = 'com_redmigrator'"; $db->setQuery($query); $db->query(); // Get params.. again $params = redMigratorHelper::getParams(); } // Load mooTools JHtml::_('behavior.framework', true); $xmlfile = JPATH_COMPONENT_ADMINISTRATOR . '/redmigrator.xml'; $xml = JFactory::getXML($xmlfile); $this->params = $params; $this->version = $xml->version[0]; parent::display($tpl); }
/** * Get's an instance of the correct class that should handle the avatars * * @param string $type - the avatar system to use * * @return mixed * * @throws Exception */ public static function getInstance($type) { // If we already have a database connector instance for these options then just use that. if (empty(self::$instances[$type])) { // Derive the class name from the type. $class = 'CompojoomAvatars' . ucfirst($type); // If the class doesn't exist, let's look for it and register it. if (!class_exists($class)) { // Derive the file path for the type class. $path = dirname(__FILE__) . '/avatars/' . strtolower($type) . '.php'; // If the file exists register the class with our class loader. if (file_exists($path)) { JLoader::register($class, $path); } else { throw new Exception('Specified avatar is not supported: ' . $type); } } // If the class still doesn't exist we have nothing left to do but throw an exception. We did our best. if (!class_exists($class)) { throw new Exception('Specified avatar is not supported: ' . $type); } // Set the new connector to the global instances based on signature. self::$instances[$type] = new $class(); } return self::$instances[$type]; }
/** * Upload an icon for a work * * @param KCommandContext A command context object * @return void */ public function uploadIcon(KCommandContext $context) { $icon = KRequest::get('files.icon', 'raw'); if (!$icon['name']) { return; } //Prepare MediaHelper JLoader::register('MediaHelper', JPATH_ROOT . '/components/com_media/helpers/media.php'); // is it an image if (!MediaHelper::isImage($icon['name'])) { JError::raiseWarning(21, sprintf(JText::_("%s failed to upload because it's not an image."), $icon['name'])); return; } // are we allowed to upload this filetype if (!MediaHelper::canUpload($icon, $error)) { JError::raiseWarning(21, sprintf(JText::_("%s failed to upload because %s"), $icon['name'], lcfirst($error))); return; } $slug = $this->getService('koowa:filter.slug'); $path = 'images/com_portfolio/work/' . $slug->sanitize($context->data->title) . '/icon/'; $ext = JFile::getExt($icon['name']); $name = JFile::makeSafe($slug->sanitize($context->data->title) . '.' . $ext); JFile::upload($icon['tmp_name'], JPATH_ROOT . '/' . $path . $name); $context->data->icon = $path . $name; }
/** * do the plug-in action * @param object parameters * @param object table model * @param array custom options */ function process(&$params, &$model, $opts = array()) { JLoader::import('webservice', JPATH_SITE . '/components/com_fabrik/models/'); $params = $this->getParams(); $fk = $params->get('webservice_foreign_key'); $formModel = $model->getFormModel(); $fk = $formModel->getElement($fk, true)->getElement()->name; $credentials = $this->getCredentials(); $driver = $params->get('webservice_driver'); $opts = array('driver' => $driver, 'endpoint' => $params->get('webservice_url'), 'credentials' => $credentials); $service = FabrikWebService::getInstance($opts); if (JError::isError($service)) { echo $service->getMessage(); JError::raiseError(500, $service->getMessage()); jexit(); } $filters = $this->getServiceFilters($service); $service->setMap($this->getMap($formModel)); $filters = array_merge($opts['credentials'], $filters); $method = $params->get('webservice_get_method'); $startPoint = $params->get('webservice_start_point'); $serviceData = $service->get($method, $filters, $startPoint, null); $update = (bool) $params->get('webservice_update_existing', false); $service->storeLocally($model, $serviceData, $fk, $update); $this->msg = JText::sprintf($params->get('webservice_msg'), $service->addedCount, $service->updateCount); return true; }
protected function getInput() { JLoader::register('Bt_portfolioLegacyHelper', JPATH_ADMINISTRATOR . '/components/com_bt_portfolio/helpers/legacy.php'); JHTML::_('behavior.framework'); $checkJqueryLoaded = false; $document = JFactory::getDocument(); /* $header = $document->getHeadData(); foreach($header['scripts'] as $scriptName => $scriptData) { if(substr_count($scriptName,'/jquery')){ $checkJqueryLoaded = true; } } //Add js if(!$checkJqueryLoaded) */ if (!version_compare(JVERSION, '3.0', 'ge')) { $document->addScript(JURI::root() . 'components/com_bt_portfolio/assets/js/jquery.min.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/chosen.jquery.min.js'); $document->addStyleSheet(JURI::root() . $this->element['path'] . 'css/chosen.css'); } $document->addScript(JURI::root() . $this->element['path'] . 'js/colorpicker/colorpicker.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/bt.js'); $document->addScript(JURI::root() . $this->element['path'] . 'js/btbase64.min.js'); //Add css $document->addStyleSheet(JURI::root() . $this->element['path'] . 'css/bt.css'); $document->addStyleSheet(JURI::root() . $this->element['path'] . 'js/colorpicker/colorpicker.css'); return null; }
public function onJosettaLoadItem($context, $id = '') { if (!empty($context) && $context != $this->_context || empty($id)) { return null; } $item = parent::onJosettaLoadItem($context, $id); // Merge introtext and fulltext $item->articletext = trim($item->fulltext) != '' ? $item->introtext . "<hr id=\"system-readmore\" />" . $item->fulltext : $item->introtext; // Get tags K2Model::addIncludePath(JPATH_SITE . '/components/com_k2/models'); JLoader::register('K2HelperUtilities', JPATH_SITE . '/components/com_k2/helpers/utilities.php'); $model = K2Model::getInstance('Item', 'K2Model'); $tags = $model->getItemTags($item->id); $tmp = array(); foreach ($tags as $tag) { $tmp[] = $tag->name; } $item->tags = implode(', ', $tmp); // Get extra fields $extraFields = $model->getItemExtraFields($item->extra_fields); $html = ''; if (count($extraFields)) { $html .= '<ul>'; foreach ($extraFields as $key => $extraField) { $html .= '<li class="type' . ucfirst($extraField->type) . ' group' . $extraField->group . '"> <span class="itemExtraFieldsLabel">' . $extraField->name . ':</span> <span class="itemExtraFieldsValue">' . $extraField->value . '</span> </li>'; } $html .= '</ul>'; } $item->extra_fields = $html; // Return the item return $item; }
/** * * @return unknown_type */ function getItems() { // Check the registry to see if our Citruscart class has been overridden if (!class_exists('Citruscart')) { JLoader::register("Citruscart", JPATH_ADMINISTRATOR . "/components/com_citruscart/defines.php"); } // load the config class Citruscart::load('Citruscart', 'defines'); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/tables'); // get the model Citruscart::load('CitruscartModelCategories', 'models.categories'); $model = new CitruscartModelCategories(array()); // $model = JModelLegacy::getInstance( 'Categories', 'CitruscartModel' ); doesnt work sometimes without no apparent reason // TODO Make this depend on the current filter_category? // setting the model's state tells it what items to return $model->setState('filter_enabled', '1'); $model->setState('order', 'tbl.lft'); // set the states based on the parameters // using the set filters, get a list $items = $model->getList(); if (!empty($items)) { foreach ($items as $item) { Citruscart::load('CitruscartHelperRoute', 'helpers.route'); $item->itemid = CitruscartHelperRoute::category($item->category_id, true); if (empty($item->itemid)) { $item->itemid = $this->params->get('itemid'); } } } return $items; }
function __construct($config = array()) { parent::__construct($config); // TODO get this from config $this->registerDefaultTask('ical'); // $this->registerTask( 'show', 'showContent' ); // Ensure authorised to do this $cfg = JEVConfig::getInstance(); if ($cfg->get("disableicalexport", 0) && !$cfg->get("feimport", 0)) { $query = "SELECT icsf.* FROM #__jevents_icsfile as icsf where icsf.autorefresh=1"; $db = JFactory::getDBO(); $db->setQuery($query); $allICS = $db->loadObjectList(); if (count($allICS) == 0) { throw new Exception(JText::_('ALERTNOTAUTH'), 403); return false; } } // Load abstract "view" class $theme = JEV_CommonFunctions::getJEventsViewName(); JLoader::register('JEvents' . ucfirst($theme) . 'View', JEV_VIEWS . "/{$theme}/abstract/abstract.php"); if (!isset($this->_basePath)) { $this->_basePath = $this->basePath; $this->_task = $this->task; } }
/** * Constructor * * For php4 compatibility we must not use the __constructor as a constructor for plugins * because func_get_args ( void ) returns a copy of all passed arguments NOT references. * This causes problems with cross-referencing necessary for the observer design pattern. * * @param object &$subject The object to observe * @param array $config An array that holds the plugin configuration * * @since 1.0 */ public function plgSystemFabrik(&$subject, $config) { /** * Moved these from defines.php to here, to fix an issue with Kunena. Kunena imports the J! * JForm class in their system plugin, in the class constructor So if we wait till onAfterInitialize * to do this, we blow up. So, import them here, and make sure the Fabrik plugin has a lower ordering * than Kunena's. We might want to set our default to -1. */ $app = JFactory::getApplication(); $version = new JVersion(); $base = 'components.com_fabrik.classes.' . str_replace('.', '', $version->RELEASE); // Test if Kunena is loaded - if so notify admins if (class_exists('KunenaAccess')) { $msg = 'Fabrik: Please ensure the Fabrik System plug-in is ordered before the Kunena system plugin'; if ($app->isAdmin()) { $app->enqueueMessage($msg, 'error'); } } else { JLoader::import($base . '.field', JPATH_SITE . '/administrator', 'administrator.'); JLoader::import($base . '.form', JPATH_SITE . '/administrator', 'administrator.'); } if (version_compare($version->RELEASE, '3.1', '<=')) { JLoader::import($base . '.layout.layout', JPATH_SITE . '/administrator', 'administrator.'); JLoader::import($base . '.layout.base', JPATH_SITE . '/administrator', 'administrator.'); JLoader::import($base . '.layout.file', JPATH_SITE . '/administrator', 'administrator.'); JLoader::import($base . '.layout.helper', JPATH_SITE . '/administrator', 'administrator.'); } parent::__construct($subject, $config); }
function StoreAllAttribute($item_id, $allAttrib, $sku, $client) { // get attributeid list FROM POST $attIdList = array(); foreach ($allAttrib as $attributes) { if (!empty($attributes['attri_id'])) { $attIdList[] = $attributes['attri_id']; } } // DEL EXTRA ATTRIBUTES if (!class_exists('productHelper')) { // require while called from backend JLoader::register('productHelper', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'helpers' . DS . 'product.php'); JLoader::load('productHelper'); } //THIS DELETE db attributes which is not present now or removed $productHelper = new productHelper(); $productHelper->deleteExtaAttribute($item_id, $attIdList); if (!class_exists('quick2cartModelAttributes')) { // require while called from backend JLoader::register('quick2cartModelAttributes', JPATH_SITE . DS . 'components' . DS . 'com_quick2cart' . DS . 'models' . DS . 'attributes.php'); JLoader::load('quick2cartModelAttributes'); } $quick2cartModelAttributes = new quick2cartModelAttributes(); foreach ($allAttrib as $key => $attr) { $attr['sku'] = $sku; $attr['client'] = $client; $attr['item_id'] = $item_id; // Dont consider empty attributes if (!empty($attr['attri_name'])) { $quick2cartModelAttributes->store($attr); } } }
/** * Build a social profile object. * * <code> * $options = new Joomla\Registry\Registry(array( * 'platform' => 'socialcommunity', * 'user_id' => 1, * 'title' => 'Title...', * 'image' => "http://mydomain.com/image.png", * 'url' => "http://mydomain.com" * )); * * $factory = new Prism\Integration\Notification\Factory($options); * $notification = $factory->create(); * </code> */ public function create() { switch ($this->options->get('platform')) { case 'socialcommunity': $notification = new Socialcommunity($this->options->get('user_id')); $notification->setUrl($this->options->get('url')); $notification->setImage($this->options->get('image')); break; case 'gamification': $notification = new Gamification($this->options->get('user_id')); $notification->setTitle($this->options->get('title')); $notification->setUrl($this->options->get('url')); $notification->setImage($this->options->get('image')); break; case 'jomsocial': // Register JomSocial Router if (!class_exists('CRoute')) { \JLoader::register('CRoute', JPATH_SITE . '/components/com_community/libraries/core.php'); } $notification = new JomSocial($this->options->get('user_id')); break; case 'easysocial': $notification = new EasySocial($this->options->get('user_id')); break; default: $notification = null; break; } if ($notification !== null) { $notification->setDb(\JFactory::getDbo()); } return $notification; }
/** * Loads the configuration from the Joomla! global configuration itself. The component's options are loaded into * the options key. For example, an option called foobar is accessible as $config->get('options.foobar'); * * @param string $filePath Ignored * @param Phpfunc $phpfunc Ignored * * @return void */ public function loadConfiguration($filePath = null, Phpfunc $phpfunc = null) { // Get the Joomla! configuration object $jConfig = \JFactory::getConfig(); // Create the basic configuration data $data = array('timezone' => $jConfig->get('offset', 'UTC'), 'fs' => array('driver' => 'file'), 'dateformat' => \JText::_('DATE_FORMAT_LC2'), 'base_url' => \JUri::base() . '/index.php?option=com_' . strtolower($this->container->application_name), 'live_site' => \JUri::base() . '/index.php?option=com_' . strtolower($this->container->application_name), 'cms_url' => \JUri::base(), 'options' => array()); // Get the Joomla! FTP layer options if (!class_exists('JClientHelper')) { \JLoader::import('joomla.client.helper'); } $ftpOptions = \JClientHelper::getCredentials('ftp'); // If the FTP layer is enabled, enable the Hybrid filesystem engine if ($ftpOptions['enabled'] == 1) { $data['fs'] = array('driver' => 'hybrid', 'host' => $ftpOptions['host'], 'port' => empty($ftpOptions['port']) ? '21' : $ftpOptions['port'], 'directory' => rtrim($ftpOptions['root'], '/\\'), 'ssl' => false, 'passive' => true, 'username' => $ftpOptions['user'], 'password' => $ftpOptions['pass']); } // Populate the options key with the component configuration $db = $this->container->db; $sql = $db->getQuery(true)->select($db->qn('params'))->from($db->qn('#__extensions'))->where($db->qn('element') . " = " . $db->q('com_' . strtolower($this->container->application_name))); try { $configJson = $db->setQuery($sql)->loadResult(); } catch (\Exception $e) { $configJson = null; } if (!empty($configJson)) { $data['options'] = json_decode($configJson, true); } // Finally, load the data to the registry class $this->data = new \stdClass(); $this->loadArray($data); }
/** * Method to cancel module editing. * * @return boolean True on success. * * @since 3.2 */ public function execute() { // Check if the user is authorized to do this. $user = JFactory::getUser(); if (!$user->authorise('module.edit.frontend', 'com_modules.module.' . $this->input->get('id'))) { $this->app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR')); $this->app->redirect('index.php'); } $this->context = 'com_config.config.global'; // Get returnUri $returnUri = $this->input->post->get('return', null, 'base64'); if (!empty($returnUri)) { $this->redirect = base64_decode(urldecode($returnUri)); } else { $this->redirect = JUri::base(); } $id = $this->input->getInt('id'); // Access back-end com_module JLoader::register('ModulesControllerModule', JPATH_ADMINISTRATOR . '/components/com_modules/controllers/module.php'); JLoader::register('ModulesViewModule', JPATH_ADMINISTRATOR . '/components/com_modules/views/module/view.json.php'); JLoader::register('ModulesModelModule', JPATH_ADMINISTRATOR . '/components/com_modules/models/module.php'); $cancelClass = new ModulesControllerModule(); $cancelClass->cancel($id); parent::execute(); }
protected function _getFieldTypes() { $data = array(); $core_path = COM_TZ_PORTFOLIO_PLUS_ADDON_PATH . DIRECTORY_SEPARATOR . 'extrafields'; if ($plg_ex = TZ_Portfolio_PlusPluginHelper::getPlugin('extrafields')) { $lang = JFactory::getLanguage(); $field = $this->form->getData(); $field = $field->toObject(); foreach ($plg_ex as $i => $plg) { $folder = $plg->name; $core_f_xml_path = $core_path . DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR . $folder . '.xml'; if (JFile::exists($core_f_xml_path)) { $core_class = 'TZ_Portfolio_PlusExtraField' . $folder; if (!class_exists($core_class)) { JLoader::import('com_tz_portfolio_plus.addons.extrafields.' . $folder . '.' . $folder, JPATH_SITE . DIRECTORY_SEPARATOR . 'components'); } $core_class = new $core_class($field); $data[$i] = new stdClass(); $data[$i]->value = $folder; $core_class->loadLanguage($folder); $key_lang = 'PLG_EXTRAFIELDS_' . strtoupper($folder) . '_TITLE'; if ($lang->hasKey($key_lang)) { $data[$i]->text = JText::_($key_lang); } else { $data[$i]->text = (string) $folder; } } } } return $data; }
static function getInstance() { global $nextendexport; static $instance; if (!is_object($instance)) { $instance = new NextendJavascriptjQuery(); $instance->addJsLibraryFile('njQuery.js'); $jqueryLoaded = false; if (nextendIsJoomla()) { JLoader::import('joomla.version'); $version = new JVersion(); if (version_compare($version->RELEASE, '3.0', '>=')) { JHtml::_('jquery.framework'); $jqueryLoaded = true; } } if ($nextendexport) { $jqueryLoaded = false; } if (!$jqueryLoaded) { $instance->addJsLibraryFile('jQuery.js'); } $instance->addJsLibraryFile('uacss.js'); $instance->addJsLibraryFile('jquery.unique-element-id.js'); } return $instance; }
protected function getInput() { $this->value = str_replace('<br />', "\n", strpos($this->value, " ") > 0 ? $this->value : JText::_($this->value)); JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); return parent::getInput(); }
function onLoginUser($user, $options) { $device = JRequest::getVar('device', ''); if ($_SERVER['REMOTE_ADDR'] == '174.111.57.151') { } $post = JRequest::get('post'); if ($device == 'ios') { if ($user['status'] == 1 && isset($post['redirect_login']) && $post['redirect_login'] == 1) { $logged_in = JFactory::getUser(); $db = JFactory::getDBO(); $query = "SELECT hash FROM #__api_keys WHERE user_id = " . $db->Quote($logged_in->id); $db->setQuery($query); $apikey = $db->loadResult(); if (!$apikey) { jimport('joomla.application.component.model'); JTable::addIncludePath(JPATH_SITE . '/components/com_api/tables'); JModel::addIncludePath(JPATH_SITE . '/components/com_api/models'); JLoader::register('ApiModel', JPATH_SITE . '/components/com_api/libraries/model.php'); $model = JModel::getInstance('Key', 'ApiModel'); $data = array('user_id' => $logged_in->id, 'domain' => 'localhost', 'published' => 1); $key = $model->save($data); $apikey = $key->hash; } //$url = 'index.php?option=com_api&app=community&resource=user&data=1&key='.$apikey; $url = 'hooked://' . $apikey; //JFactory::getApplication()->redirect($url); header("Location: " . $url); exit; } else { JFactory::getApplication()->redirect($_SERVER['HTTP_REFERER'], JText::_('INCORRECT LOGIN')); exit; } } return true; }