protected function getInput() { JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); $params = JComponentHelper::getParams("com_jevents"); $value = (int) $this->value; if ($value == -1) { if (version_compare(JVERSION, '3.0.0', "<")) { $default25 = (string) $this->element["default25"]; if ($default25 != "") { $this->value = $this->default = intval($default25); } } else { if (version_compare(JVERSION, '3.0.0', ">=")) { $default30 = (string) $this->element["default30"]; if ($default30 != "") { $this->value = $this->default = intval($default30); } } } } if (!$params->get("bootstrapchosen", 1)) { $x = 1; } return parent::getInput(); }
/** * * @param stdClass $options Parameters to be passed to the database driver. * * @return redMigrator A redMigrator object. * * @since 3.0.0 */ static function getInstance(redMigratorStep $step = null) { // Loading the JFile class jimport('joomla.filesystem.file'); // Getting the params and Joomla version web and cli $params = redMigratorHelper::getParams(); // Derive the class name from the driver. $class_name = 'redMigratorDriver' . ucfirst(strtolower($params->method)); $class_file = JPATH_COMPONENT_ADMINISTRATOR . '/includes/driver/' . $params->method . '.php'; // Require the driver file if (JFile::exists($class_file)) { JLoader::register($class_name, $class_file); } // 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_name)) { throw new RuntimeException(sprintf('Unable to load redMigrator Driver: %s', $params->method)); } // Create our new redMigratorDriver connector based on the options given. try { $instance = new $class_name($step); } catch (RuntimeException $e) { throw new RuntimeException(sprintf('Unable to load redMigrator object: %s', $e->getMessage())); } return $instance; }
/** * 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(); }
/** * 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); }
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; }
/** * 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]; }
/** * 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; }
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; }
/** * Register class with Joomla Loader. Override joomla core if $import_key avaiable * * @return void */ public static function register($class, $path, $import_key = null) { if (!empty($import_key)) { jimport($import_key); } JLoader::register($class, $path); }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { ob_start(); $event = $this->form->jevdata[$this->name]["event"]; $eventfield = $this->name == "publish_up" ? "startDate" : "endDate"; $params = JComponentHelper::getParams(JEV_COM_COMPONENT); $minyear = JEVHelper::getMinYear(); $maxyear = JEVHelper::getMaxYear(); $inputdateformat = $params->get("com_editdateformat", "d.m.Y"); static $firsttime; if (!defined($firsttime)) { $document = JFactory::getDocument(); $js = "\neventEditDateFormat='{$inputdateformat}';//Date.defineParser(eventEditDateFormat.replace('d','%d').replace('m','%m').replace('Y','%Y'));"; $document->addScriptDeclaration($js); $firsttime = false; } $cal = JEVHelper::loadCalendar($this->name, $this->name, $event->{$eventfield}(), $minyear, $maxyear, 'var elem =jevjq(this);' . $this->element['onhidestart'], "var elem = jevjq(this);" . $this->element['onchange'], $inputdateformat); echo $cal; ?> <input type="hidden" name="<?php echo $this->name; ?> 2" id="<?php echo $this->name; ?> 2" value="" /> <?php $html = ob_get_clean(); JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); return $html; }
public function __construct() { parent::__construct(); ApiResource::addIncludePath(dirname(__FILE__) . '/relate'); JLoader::register('RelateAPIHelper', dirname(__FILE__) . '/relate/helper.php'); RelateAPIHelper::setup(); }
/** * initialize */ public static function initial() { $app = JFactory::getApplication(); if ($app->isSite()) { $jsnUtils = JSNTplUtils::getInstance(); $isInstalledSh404Sef = $jsnUtils->checkSH404SEF(); if ($jsnUtils->isJoomla3()) { // JViewLegacy JLoader::register('JViewLegacy', JSN_PATH_TPLFRAMEWORK . '/includes/core/j3x/jsntplviewlegacy.php'); // JModuleHelper JLoader::register('JModuleHelper', JSN_PATH_TPLFRAMEWORK . '/includes/core/j3x/jsntplmodulehelper.php'); //Check if SH404Sef is installed or not. If yes, then do not load jsntplpagination.php if (!$isInstalledSh404Sef) { // JPagination JLoader::register('JPagination', JSN_PATH_TPLFRAMEWORK . '/includes/core/j3x/jsntplpagination.php'); } } else { // JView jimport('joomla.application.component.view'); JLoader::register('JView', JSN_PATH_TPLFRAMEWORK . '/includes/core/j25/jsntplview.php'); // JModuleHelper jimport('joomla.application.module.helper'); JLoader::register('JModuleHelper', JSN_PATH_TPLFRAMEWORK . '/includes/core/j25/jsntplmodulehelper.php'); //Check if SH404Sef is installed or not. If yes, then do not load jsntplpagination.php if (!$isInstalledSh404Sef) { // JPagination jimport('joomla.html.pagination'); JLoader::register('JPagination', JSN_PATH_TPLFRAMEWORK . '/includes/core/j25/jsntplpagination.php'); } } } }
/** * Method to recursively discover classes of a given type in a given path. * * @param string $classPrefix The class name prefix to use for discovery. * @param string $parentPath Full path to the parent folder for the classes to discover. * @param boolean $force True to overwrite the autoload path value for the class if it already exists. * * @return void * * @since 11.1 */ public static function discover($classPrefix, $parentPath, $force = true, $recurse = false) { $excluded_dirs = array('.', '..'); // Ignore the operation if the folder doesn't exist. if (is_dir($parentPath)) { // Open the folder. $d = dir($parentPath); // Iterate through the folder contents to search for input classes. while (false !== ($entry = $d->read())) { if (!in_array($entry, $excluded_dirs) && is_dir($parentPath . '/' . $entry)) { self::discover($classPrefix . $entry, $parentPath . '/' . $entry, $force, $recurse); } else { // Only load for php files. if (file_exists($parentPath . '/' . $entry) && substr($entry, strrpos($entry, '.') + 1) == 'php') { // Get the class name and full path for each file. $class = strtolower($classPrefix . preg_replace('#\\.[^.]*$#', '', $entry)); $path = $parentPath . '/' . $entry; // Register the class with the autoloader if not already registered or the force flag is set. if (version_compare(JVERSION, '1.6.0', 'ge')) { // Joomla! 1.6+ code here self::register($class, $path, $force); } else { // Joomla! 1.5 code here JLoader::register($class, $path); } } } } // Close the folder. $d->close(); } }
/** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached * @param array|boolean $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()} * * @return JController This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = false) { $id = $this->input->getInt('id'); $document = JFactory::getDocument(); // For JSON requests if ($document->getType() == 'json') { $view = new ModulesViewModule(); // Get/Create the model if ($model = new ModulesModelModule()) { // Checkin table entry if (!$model->checkout($id)) { JFactory::getApplication()->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_CHECKIN_USER_MISMATCH'), 'error'); return false; } // Push the model into the view (as default) $view->setModel($model, true); } $view->document = $document; return $view->display(); } JLoader::register('ModulesHelper', JPATH_ADMINISTRATOR . '/components/com_modules/helpers/modules.php'); $layout = $this->input->get('layout', 'edit'); $id = $this->input->getInt('id'); // Check for edit form. if ($layout == 'edit' && !$this->checkEditId('com_modules.edit.module', $id)) { // Somehow the person just went to the form - we don't allow that. $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); $this->setRedirect(JRoute::_('index.php?option=com_modules&view=modules', false)); return false; } // Load the submenu. ModulesHelper::addSubmenu($this->input->get('view', 'modules')); return parent::display(); }
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 ; }
protected function getInput() { $document = JFactory::getDocument(); $document->addScriptDeclaration('var K2BasePath = "' . JURI::root(true) . '";'); $document->addScript(JURI::root(true) . '/plugins/josetta_ext/k2item/fields/k2extrafields.js'); K2Model::addIncludePath(JPATH_SITE . '/components/com_k2/models'); JLoader::register('K2HelperUtilities', JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'utilities.php'); $model = K2Model::getInstance('Item', 'K2Model'); $extraFields = $model->getItemExtraFields($this->value); $html = '<div id="extraFieldsContainer">'; if (count($extraFields)) { $html .= '<table class="admintable" id="extraFields">'; foreach ($extraFields as $extraField) { $html .= '<tr> <td align="right" class="key">' . $extraField->name . '</td> <td>' . $extraField->element . '</td> </tr>'; } $html .= '</table>'; } else { $html .= '<span class="k2Note"> ' . JText::_('K2_PLEASE_SELECT_A_CATEGORY_FIRST_TO_RETRIEVE_ITS_RELATED_EXTRA_FIELDS') . ' </span>'; } $html .= '</div>'; return $html; }
/** * 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; }
/** * Method to get a list of available buttons * * @return array $buttons The available buttons */ public static function getButtons() { $components = PFApplicationHelper::getComponents(); $buttons = array(); foreach ($components as $component) { if (!PFApplicationHelper::enabled($component->element)) { continue; } // Register component route helper if exists $router = JPATH_SITE . '/components/' . $component->element . '/helpers/route.php'; $class = str_replace('com_pf', 'PF', $component->element) . 'HelperRoute'; if (JFile::exists($router)) { JLoader::register($class, $router); } // Register component dashboard helper if exists $helper = JPATH_ADMINISTRATOR . '/components/' . $component->element . '/helpers/dashboard.php'; $class = str_replace('com_pf', 'PF', $component->element) . 'HelperDashboard'; if (!JFile::exists($helper)) { continue; } JLoader::register($class, $helper); // Get the dashboard button if (class_exists($class)) { if (in_array('getSiteButtons', get_class_methods($class))) { $com_buttons = (array) call_user_func(array($class, 'getSiteButtons')); $buttons[$component->element] = array(); foreach ($com_buttons as $button) { $buttons[$component->element][] = $button; } } } } return $buttons; }
/** * * @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; }
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(); }
/** * 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(); }
/** * 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; }
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; }
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; } }
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; } }
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 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); } } }
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; }
/** * Returns a JPathway object * * @param string $client The name of the client * @param array $options An associative array of options * * @return JPathway A JPathway object. * * @since 1.5 * @throws RuntimeException */ public static function getInstance($client, $options = array()) { if (empty(self::$instances[$client])) { // Create a JPathway object $classname = 'JPathway' . ucfirst($client); if (!class_exists($classname)) { // @deprecated 4.0 Everything in this block is deprecated but the warning is only logged after the file_exists // Load the pathway object $info = JApplicationHelper::getClientInfo($client, true); if (is_object($info)) { $path = $info->path . '/includes/pathway.php'; JLoader::register($classname, $path); if (class_exists($classname)) { JLog::add('Non-autoloadable JPathway subclasses are deprecated, support will be removed in 4.0.', JLog::WARNING, 'deprecated'); } } } if (class_exists($classname)) { self::$instances[$client] = new $classname($options); } else { throw new RuntimeException(JText::sprintf('JLIB_APPLICATION_ERROR_PATHWAY_LOAD', $client), 500); } } return self::$instances[$client]; }
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; }