function display($tpl = null) { global $mainframe; // Check if registration is allowed $usersConfig =& JComponentHelper::getParams('com_users'); if (!$usersConfig->get('allowUserRegistration')) { JError::raiseError(403, JText::_('Access Forbidden')); return; } $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $params =& $mainframe->getParams(); // Page Title $menus =& JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object($menu)) { $menu_params = new JParameter($menu->params); if (!$menu_params->get('page_title')) { $params->set('page_title', JText::_('Registration')); } } else { $params->set('page_title', JText::_('Registration')); } $document->setTitle($params->get('page_title')); $pathway->addItem(JText::_('New')); // Load the form validation behavior JHTML::_('behavior.formvalidation'); $user =& JFactory::getUser(); $this->assignRef('user', $user); $this->assignRef('params', $params); parent::display($tpl); }
/** * Tags Search method * * The sql must return the following fields that are * used in a common display routine: href, title, section, created, text, * browsernav * @param string Target search string * @param string mathcing option, exact|any|all * @param string ordering option, newest|oldest|popular|alpha|category * @param mixed An array if restricted to areas, null if search all */ function onContentSearch($text, $phrase = '', $ordering = '', $areas = null) { $searchText = $text; if (is_array($areas)) { if (!array_intersect($areas, array_keys(plgSearchTagsAreas()))) { return array(); } } // load plugin params info $plugin = JPluginHelper::getPlugin('search', 'cedtags'); $pluginParams = new JParameter($plugin->params); $limit = $pluginParams->def('search_limit', 50); $text = trim($text); if ($text == '') { return array(); } $rows = $this->searchForText($text, $limit); $count = count($rows); for ($i = 0; $i < $count; $i++) { $link = 'index.php?option=com_cedtag&task=tag&tag=' . CedTagsHelper::urlTagname($rows[$i]->name); $rows[$i]->href = JRoute::_($link); $rows[$i]->section = JText::_('TAG'); } $return = array(); foreach ($rows as $key => $tag) { if (searchHelper::checkNoHTML($tag, $searchText, array('name', 'title', 'text'))) { $return[] = $tag; } } return $return; }
/** * Display function * * @since 1.5 */ function display($tpl = null) { jimport('joomla.html.html'); $mainframe =& JFactory::getApplication(); // Get the page/component configuration $params =& $mainframe->getParams(); $menus =& JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object($menu)) { $menu_params = new JParameter($menu->params); if (!$menu_params->get('page_title')) { $params->set('page_title', JText::_('FORGOT_YOUR_USERNAME')); } } else { $params->set('page_title', JText::_('FORGOT_YOUR_USERNAME')); } $document =& JFactory::getDocument(); $document->setTitle($params->get('page_title')); // Load the form validation behavior JHTML::_('behavior.formvalidation'); // Add the tooltip behavior JHTML::_('behavior.tooltip'); $this->assignRef('params', $params); parent::display($tpl); }
function plgcontentloadozio($galleriaozio) { $db =& JFactory::getDBO(); $query = 'SELECT published, link, id, access, params' . ' FROM #__menu' . ' WHERE id=' . (int) $galleriaozio; $db->setQuery($query); $codice = $db->loadObject(); $query = 'SELECT *' . ' FROM #__menu' . ' WHERE (link LIKE "index.php?option=com_oziogallery2&view=01tilt3d" OR link LIKE "index.php?option=com_oziogallery2&view=02flashgallery" OR link LIKE "index.php?option=com_oziogallery2&view=03imagin" OR link LIKE "index.php?option=com_oziogallery2&view=04carousel" OR link LIKE "index.php?option=com_oziogallery2&view=05imagerotator" OR link LIKE "index.php?option=com_oziogallery2&view=06accordion" OR link LIKE "index.php?option=com_oziogallery2&view=07flickrslidershow" OR link LIKE "index.php?option=com_oziogallery2&view=08flickrphoto" OR link LIKE "index.php?option=com_oziogallery2&view=09mediagallery" OR link LIKE "index.php?option=com_oziogallery2&view=10cooliris" )'; $db->setQuery($query); $cp = $db->loadObject(); $document =& JFactory::getDocument(); if ($cp->id = $galleriaozio) { @($gall = JURI::root() . $codice->link . '&Itemid=' . (int) $galleriaozio); $parametar = new JParameter($codice->params); // alexred if (@$codice->published != 0 && @$codice->access != 1 && @$codice->access != 2) { $document->addScript(JURI::root(true) . '/components/com_oziogallery2/assets/js/autoHeight.js'); $contents = ''; $contents .= '<div class="clr"></div>'; $contents .= '<iframe src="' . $gall . '&tmpl=component" width="' . $parametar->get("width") . '" marginwidth="0px" allowtransparency="true" frameborder="0" scrolling="no" class="autoHeight">'; $contents .= '</iframe>'; $contents .= '<div class="clr"></div>'; return $contents; } } }
/** * Prepares the document */ protected function _prepareDocument() { $app =& JFactory::getApplication(); $pathway =& $app->getPathway(); $menus =& JSite::getMenu(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself if ($menu = $menus->getActive()) { if (isset($menu->query['view']) && $menu->query['view'] == 'form') { $menuParams = new JParameter($menu->params); $title = $menuParams->get('page_title'); } } if (empty($title)) { $title = JText::_('Content_Form_Edit_Article'); } $this->document->setTitle($title); $this->params->set('page_title', $title); $pathway =& $app->getPathWay(); $pathway->addItem($title, ''); // If there is a pagebreak heading or title, add it to the page title if (!empty($this->item->page_title)) { $article->title = $article->title . ' - ' . $article->page_title; $this->document->setTitle($article->page_title . ' - ' . JText::sprintf('Page %s', $this->state->get('page.offset') + 1)); } }
function renderItem(&$item, &$params, &$access) { global $mainframe; $user =& JFactory::getUser(); $item->text = $item->introtext; $item->groups = ''; $item->readmore = trim($item->fulltext) != ''; $item->metadesc = ''; $item->metakey = ''; $item->created = ''; $item->modified = ''; if ($params->get('readmore') || $params->get('link_titles')) { if ($params->get('intro_only')) { // Check to see if the user has access to view the full article if ($item->access <= $user->get('aid', 0)) { $itemparams = new JParameter($item->attribs); $readmoretxt = $itemparams->get('readmore', JText::_('Read more text')); $item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid)); $item->linkText = $readmoretxt; } else { $item->linkOn = JRoute::_('index.php?option=com_user&view=login'); $item->linkText = JText::_('Login To Read More'); } } } if (!$params->get('image')) { $item->text = preg_replace('/<img[^>]*>/', '', $item->text); } $results = $mainframe->triggerEvent('onAfterDisplayTitle', array(&$item, &$params, 1)); $item->afterDisplayTitle = trim(implode("\n", $results)); $results = $mainframe->triggerEvent('onBeforeDisplayContent', array(&$item, &$params, 1)); $item->beforeDisplayContent = trim(implode("\n", $results)); require JModuleHelper::getLayoutPath('mod_newsflash', '_item'); }
/** * prepare content method * * Method is called by the view * * @param string The context of the content being passed to the plugin. * @param object The article object. Note $article->text is also available * @param object The article params * @param int The 'page' number */ public function onContentPrepare($context, &$row, &$params, $page = 0) { jimport('joomla.html.parameter'); jimport('joomla.filesystem.file'); //load fabrik language $lang =& JFactory::getLanguage(); $lang->load('com_fabrik', JPATH_BASE . DS . 'components' . DS . 'com_fabrik'); if (!defined('COM_FABRIK_FRONTEND')) { JError::raiseError(400, JText::_('COM_FABRIK_SYSTEM_PLUGIN_NOT_ACTIVE')); } // Get plugin info $plugin =& JPluginHelper::getPlugin('content', 'fabrik'); // $$$ hugh had to rename this, it was stomping on com_content and friends $params // $$$ which is passed by reference to us! $fparams = new JParameter($plugin->params); // simple performance check to determine whether bot should process further $botRegex = $fparams->get('Botregex') != '' ? $fparams->get('Botregex') : 'fabrik'; if (JString::strpos($row->text, $botRegex) === false) { return true; } require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'parent.php'; // $$$ hugh - having to change this to use {[]} $regex = "/{" . $botRegex . "\\s*.*?}/i"; $row->text = preg_replace_callback($regex, array($this, 'replace'), $row->text); }
function load($id = null) { parent::load($id); jimport('joomla.html.parameter'); $params = new JParameter($this->settings); $this->settings = $params->toArray(); }
function display($tpl = null) { // Get the url of the Alfresco repository from the Joosco plugin // That's why the Joosco plugin needs to be installed and configured before the component $plugin =& JPluginHelper::getPlugin('authentication', 'joosco'); $pluginParams = new JParameter($plugin->params); // Here we connect to the Repository $repositoryUrl = $pluginParams->get('alf-url'); $repository = new Repository($repositoryUrl); // The ticket is created by the plugin when a user connects $ticket = $_SESSION["ticket"]; $session = $repository->createSession($ticket); $store = new SpacesStore($session); $currentNode = null; $uuid = null; $uuid =& JRequest::getVar('uuid'); if (!isset($uuid)) { $currentNode = $store->companyHome; $path = 'Company Home'; } else { $currentNode = $session->getNode($store, JRequest::getVar('uuid')); $path = JRequest::getVar('path') . '|' . JRequest::getVar('uuid') . '|' . JRequest::getVar('name'); } // Pass the values to the rest of the template $this->assignRef('path', $path); $this->assignRef('session', $session); $this->assignRef('store', $store); $this->assignRef('currentNode', $currentNode); $this->assignRef('option', JRequest::getVar('option')); $this->assignRef('view', JRequest::getVar('view')); $this->assignRef('itemid', JRequest::getVar('Itemid')); parent::display($tpl); }
function display($tpl = null) { // redirect guests to login page $mainframe =& JFactory::getApplication(); $user =& JFactory::getUser(); if ($user->id != 0) { $Lists = $this->get('Lists'); $this->assignRef('lists', $Lists); //--Creating a link to the edit form $this->assignRef('editlink', JRoute::_('index.php?option=com_joomailermailchimpintegration&view=subscriptions&task=edit')); // retrieve page title from the menuitem $menus =& JSite::getMenu(); $menu = $menus->getActive(); $menu_params = new JParameter($menu->params); $this->assignRef('page_title', $menu_params->get('page_title')); parent::display($tpl); } else { // Redirect to login $uri = JFactory::getURI(); $return = $uri->toString(); if (version_compare(JVERSION, '1.6.0', 'ge')) { $url = 'index.php?option=com_users&view=login'; } else { $url = 'index.php?option=com_user&view=login'; } $url .= '&return=' . base64_encode($return); $mainframe->redirect($url, JText::_('JM_ONLY_LOGGED_IN_USERS_CAN_VIEW_SUBSCRIPTIONS')); } }
function bindSetValues($ext_params = null) { if (!empty($this->_menuid)) { if (is_array($this->_menuid)) { $menuid = $this->_menuid[0]; } else { $menuid = $this->_menuid; } $db =& JFactory::getDBO(); $query = "SELECT params FROM #__menu WHERE id = " . $menuid; $db->setQuery($query); $row = $db->loadObject(); if (!empty($row)) { $params = new JParameter($row->params); $list_params = $ext_params->renderToArray("params", "params"); foreach ($list_params as $key => $value) { if (!empty($key) && strpos($key, "ytext_") !== false) { $tmp_value = $params->get($key, ""); if (is_array($tmp_value)) { $tmp_value = implode("|", $tmp_value); } $ext_params->set($key, $tmp_value); } } } } return $ext_params; }
/** * Up **/ public function up() { $query = "CREATE TABLE IF NOT EXISTS `jos_announcements` (\n\t\t\t\t\t\t`id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t`scope` varchar(100) DEFAULT NULL,\n\t\t\t\t\t\t`scope_id` int(11) DEFAULT NULL,\n\t\t\t\t\t\t`content` text,\n\t\t\t\t\t\t`priority` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`created_by` int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`state` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`sticky` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;"; $this->db->setQuery($query); $this->db->query(); $params = array('plugin_access' => 'members', 'display_tab' => 1); $this->addPluginEntry('groups', 'announcements', 1, $params); //get citation params if ($this->db->tableExists('#__extensions')) { $sql = "SELECT `params` FROM `#__extensions` WHERE `type`='plugin' AND `element`='messages' AND `folder` = 'groups'"; } else { $sql = "SELECT `params` FROM `#__plugins` WHERE `element`='messages' AND `folder`='groups'"; } $this->db->setQuery($sql); $p = $this->db->loadResult(); //load params object $params = new \JParameter($p); //set param to hide messages tab $params->set('display_tab', 0); //save new params if ($this->db->tableExists('#__extensions')) { $query = "UPDATE `#__extensions` SET `params`=" . $this->db->quote(json_encode($params->toArray())) . " WHERE `element`='messages' AND `folder`='groups'"; } else { $query = "UPDATE `#__plugins` SET `params`='" . $params->toString() . "' WHERE `element`='messages' AND `folder`='groups'"; } $this->db->setQuery($query); $this->db->query(); }
public function render() { $model = $this->getModel(); $module = $model->getRow(); if ($this->getLayout() == 'modal') { $this->menus = $this->getObject('com:pages.model.menus')->sort('title')->getRowset(); $this->pages = $this->getObject('com:pages.model.pages')->application('site')->getRowset(); $this->modules = $this->getObject('com:pages.model.modules')->application('site')->getRowset(); } if ($this->getModel()->getState()->isUnique()) { if ($module->isNew()) { $module->application = $model->application; $module->name = $model->name; } $path = Library\ClassLoader::getInstance()->getApplication($module->application); JFactory::getLanguage()->load(substr($module->extension_name, 4), $module->name, $path); } // Build path to module config file $path = Library\ClassLoader::getInstance()->getApplication('site'); $path .= '/component/' . substr($module->extension_name, 4) . '/module/' . substr($module->name, 4) . '/config.xml'; $params = new \JParameter(null, $path); $params->loadArray($module->params->toArray()); $this->params = $params; return parent::render(); }
function display($tpl = null) { global $mainframe; $db =& JFactory::getDBO(); $client = JRequest::getWord('client', 'site'); $plugin =& JPluginHelper::getPlugin('editors', 'jce'); $params = new JParameter($plugin->params); $num = intval($params->get('layout_rows', 5)); $rows = array(); for ($i = 1; $i <= $num; $i++) { $query = "SELECT id, title, name, type, layout, icon" . "\n FROM #__jce_plugins" . "\n WHERE row = " . $i . "" . "\n AND published = 1" . "\n AND icon != ''" . "\n ORDER BY ordering ASC"; $db->setQuery($query); $rows[] = $db->loadObjectList(); } $dimensions['width'] = $params->get('width', '600'); $dimensions['height'] = $params->get('height', '600'); if ($client == 'admin') { $client_id = 1; } else { $client_id = 0; } $this->assignRef('dimensions', $dimensions); $this->assignRef('client', $client_id); $this->assignRef('items', $rows); parent::display($tpl); }
public function display($cachable = false, $urlparams = false) { // Redirect profile to integrated component if profile integration is turned on $redirect = 1; $active = $this->app->getMenu()->getActive(); if (!empty($active)) { if (version_compare(JVERSION, '1.6', '>')) { // Joomla 1.6+ $params = $active->params; } else { // Joomla 1.5 $params = new JParameter($active->params); } $redirect = $params->get('integration', 1); } if ($redirect && JRequest::getCmd('format') == 'html') { $profileIntegration = KunenaFactory::getProfile(); if ($profileIntegration instanceof KunenaProfileKunena) { // Continue } elseif (JRequest::getCmd('layout', 'default') == 'default') { $url = $this->me->getUrl(false); } elseif (JRequest::getCmd('layout') == 'list') { $url = $profileIntegration->getUserListURL('', false); } if (!empty($url)) { $this->setRedirect($url); return; } } parent::display(); }
protected function _getFiles() { $page = $this->getObject('application.pages')->getActive(); $params = new JParameter($page->params); $state = $this->getModel()->getState(); $request = $this->getObject('lib:controller.request'); if ($this->getLayout() == 'gallery') { $request->query->set('types', array('image')); } $request->query->set('thumbnails', true); $request->query->set('sort', $params->get('sort')); $request->query->set('direction', $params->get('direction')); $request->query->set('offset', $state->offset); $request->query->set('folder', $state->folder); $request->query->set('container', $state->container); $request->query->set('limit', $state->limit); $identifier = clone $this->getIdentifier(); $identifier->path = array('controller'); $identifier->name = 'file'; $controller = $this->getObject($identifier, array('request' => $request)); $files = $controller->browse(); $total = $controller->getModel()->getTotal(); if ($params->get('humanize_filenames', 1)) { foreach ($files as $file) { $file->display_name = ucfirst(preg_replace('#[-_\\s\\.]+#i', ' ', $file->filename)); } } return array('items' => $files, 'total' => $total); }
function _displayForm($tpl = null) { global $mainframe; // Load the form validation behavior JHTML::_('behavior.formvalidation'); $user =& JFactory::getUser(); $params =& $mainframe->getParams(); // check to see if Frontend User Params have been enabled $usersConfig =& JComponentHelper::getParams('com_users'); $check = $usersConfig->get('frontend_userparams'); if ($check == '1' || $check == 1 || $check == NULL) { if ($user->authorize('com_user', 'edit')) { $params = $user->getParameters(true); } } $params->merge($params); $menus =& JSite::getMenu(); $menu = $menus->getActive(); // because the application sets a default page title, we need to get it // right from the menu item itself if (is_object($menu)) { $menu_params = new JParameter($menu->params); if (!$menu_params->get('page_title')) { $params->set('page_title', JText::_('Edit Your Details')); } } else { $params->set('page_title', JText::_('Edit Your Details')); } $document =& JFactory::getDocument(); $document->setTitle($params->get('page_title')); $this->assignRef('user', $user); $this->assignRef('params', $params); parent::display($tpl); }
private function _setConfWizStatus() { static $enableconfwiz; $component = JComponentHelper::getComponent('com_akeeba'); if (is_object($component->params) && $component->params instanceof JRegistry) { $params = $component->params; } else { $params = new JParameter($component->params); } if (empty($enableconfwiz)) { $lv = $params->get('lastversion', ''); $enableconfwiz = empty($lv); } $minStability = $params->get('minstability', 'stable'); $acceptlicense = $params->get('acceptlicense', '0'); $acceptsupport = $params->get('acceptsupport', '0'); $acceptbackuptest = $params->get('acceptbackuptest', '0'); $angieupgrade = $params->get('angieupgrade', '0'); $this->assign('enableconfwiz', $enableconfwiz); $this->assign('minstability', $minStability); $this->assign('acceptlicense', $acceptlicense); $this->assign('acceptsupport', $acceptsupport); $this->assign('acceptbackuptest', $acceptbackuptest); $this->assign('showangieupgrade', $angieupgrade == 0); return $enableconfwiz; }
function processSize($size = 'big', $form, $actiondata, $photo, $filein, $upload_path, $file_info) { $params = new JParameter($actiondata->params); $quality = $params->get('quality', 90); $dir = ''; if ($params->get($size . '_directory', '')) { $dir .= $params->get($size . '_directory', ''); } else { $dir .= $upload_path; } // add a final slash if needed if (substr($dir, -1) != DS) { $dir .= DS; } $fileout = $dir . $params->get($size . '_image_prefix', '') . str_replace('.' . $file_info['extension'], '', $photo) . $params->get($size . '_image_suffix', '_' . $size) . '.' . $file_info['extension']; $crop = $params->get($size . '_image_method', 0); $imagethumbsize_w = $params->get($size . '_image_width', 400); $imagethumbsize_h = $params->get($size . '_image_height', 300); $red = $params->get($size . '_image_r', 255); $green = $params->get($size . '_image_g', 255); $blue = $params->get($size . '_image_b', 255); $use = $params->get($size . '_image_use', 0); if ($size == 'big') { $use = true; } if ($use) { if ($crop) { $this->resizeThenCrop($filein, $fileout, $imagethumbsize_w, $imagethumbsize_h, $red, $green, $blue, $quality); } else { $this->resize($filein, $fileout, $imagethumbsize_w, $imagethumbsize_h, $red, $green, $blue, $quality); } return $params->get($size . '_image_prefix', '') . str_replace('.' . $file_info['extension'], '', $photo) . $params->get($size . '_image_suffix', '_' . $size) . '.' . $file_info['extension']; } return null; }
function run($form, $actiondata) { if (isset($form->form_actions) && !empty($form->form_actions)) { $params = new JParameter($actiondata->params); $lang = JFactory::getLanguage(); if ($lang->getTag() == $params->get('lang_tag', '')) { $lang_strings = explode("\n", $actiondata->content1); usort($lang_strings, array('CfactionMultiLanguage', 'sortByLength')); foreach ($lang_strings as $lang_string) { if (!empty($lang_string) && strpos($lang_string, "=") !== false) { $texts = explode("=", $lang_string, 2); $original = trim($texts[0]); $new = trim($texts[1]); //do replacements in all loaded actions foreach ($form->form_actions as $k => $action) { if ($action->type != 'multi_language') { //do replacements in params $form->form_actions[$k]->params = str_replace($original, $new, $form->form_actions[$k]->params); //do replacements in content1 $form->form_actions[$k]->content1 = str_replace($original, $new, $form->form_actions[$k]->content1); } } //do replacements in main form code and params //do replacements in params $form->form_details->params = str_replace($original, $new, $form->form_details->params); //do replacements in content1 $form->form_details->content = str_replace($original, $new, $form->form_details->content); } } } } //print_r2($form->form_actions); }
public function load($config) { if (!array_key_exists('component', $config)) { self::$component = $config['extensionName']; } else { self::$component = $config['component']; } if (!array_key_exists('key', $config)) { self::$key = 'liveupdate'; } else { self::$key = $config['key']; } jimport('joomla.html.parameter'); jimport('joomla.application.component.helper'); // Not using JComponentHelper to avoid conflicts ;) $db = JFactory::getDbo(); if (version_compare(JVERSION, '1.6.0', 'ge')) { $sql = $db->getQuery(true)->select($db->nq('params'))->from($db->nq('#__extensions'))->where($db->nq('type') . ' = ' . $db->q('component'))->where($db->nq('element') . ' = ' . $db->q(self::$component)); } else { $sql = 'SELECT ' . $db->nameQuote('params') . ' FROM ' . $db->nameQuote('#__components') . ' WHERE ' . $db->nameQuote('option') . ' = ' . $db->Quote(self::$component) . " AND `parent` = 0 AND `menuid` = 0"; } $db->setQuery($sql); $rawparams = $db->loadResult(); if (version_compare(JVERSION, '1.6.0', 'ge')) { $params = new JRegistry(); $params->loadJSON($rawparams); } else { $params = new JParameter($rawparams); } $data = $params->getValue(self::$key, ''); jimport('joomla.registry.registry'); self::$registry = new JRegistry('update'); self::$registry->loadINI($data); }
function getParams($data) { jimport('joomla.form.form'); if (class_exists('JForm')) { //JForm::addFormPath(JPATH_PLUGINS . '/system/jcemediabox'); $xml = JPATH_PLUGINS . '/system/jcemediabox/jcemediabox.xml'; $params = new WFParameter($data, $xml, '', array('control' => 'config:fields:fieldset')); $params->addElementPath(JPATH_PLUGINS . '/system/jcemediabox/elements'); $groups = array(); $array = array(); foreach ($params->getGroups() as $group) { $groups[] = $params->getParams('params', $group); } foreach ($groups as $group) { $array = array_merge($array, $group); } return $array; } else { // get params definitions $params = new JParameter($data, JPATH_PLUGINS . '/system/jcemediabox.xml'); $xml = JPATH_PLUGINS . '/system/jcemediabox.xml'; $params->loadSetupFile($xml); return $params->getParams(); } }
function run($form, $actiondata) { $mainframe =& JFactory::getApplication(); $params = new JParameter($actiondata->params); if (function_exists('curl_init')) { $form->debug['curl'][] = "CURL OK : the CURL function was found on this server."; } else { $form->debug['curl'][] = "CURL problem : the CURL function was not found on this server."; return; } if (!empty($actiondata->content1)) { $list = explode("\n", trim($actiondata->content1)); $curl_values = array(); foreach ($list as $item) { $fields_data = explode("=", $item); $curl_values[$fields_data[0]] = $form->data[trim($fields_data[1])]; } } $query = JURI::buildQuery($curl_values); $form->debug['curl'][] = '$curl_values: ' . print_r($query, true); $form->debug['curl'][] = 'curl_target_url: ' . $params->get('target_url'); $ch = curl_init($params->get('target_url')); curl_setopt($ch, CURLOPT_HEADER, $params->get('header_in_response', 0)); // set to 0 to eliminate header info from response curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1) curl_setopt($ch, CURLOPT_POSTFIELDS, $query); // use HTTP POST to send form data curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch); //execute post and get results curl_close($ch); //add the response in the form data array $form->data['curl'] = $response; }
/** * Plugin that loads module positions within content */ function plgContentLoadModule(&$row, &$params, $page = 0) { $db =& JFactory::getDBO(); // simple performance check to determine whether bot should process further if (JString::strpos($row->text, 'loadposition') === false) { return true; } // Get plugin info $plugin =& JPluginHelper::getPlugin('content', 'loadmodule'); // expression to search for $regex = '/{loadposition\\s*.*?}/i'; $pluginParams = new JParameter($plugin->params); // check whether plugin has been unpublished if (!$pluginParams->get('enabled', 1)) { $row->text = preg_replace($regex, '', $row->text); return true; } // find all instances of plugin and put in $matches preg_match_all($regex, $row->text, $matches); // Number of plugins $count = count($matches[0]); // plugin only processes if there are any instances of the plugin in the text if ($count) { // Get plugin parameters $style = $pluginParams->def('style', -2); plgContentProcessPositions($row, $matches, $count, $regex, $style); } }
function plgSearchEvents($text, $phrase = '', $ordering = '', $areas = null) { require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_search' . DS . 'helpers' . DS . 'search.php'; if (is_array($areas)) { if (!array_intersect($areas, array_keys(plgSearchEventsAreas()))) { return array(); } } // load plugin params info $plugin =& JPluginHelper::getPlugin('search', 'events'); $pluginParams = new JParameter($plugin->params); $limit = $pluginParams->def('search_limit', 50); $text = trim($text); if ($text == '') { return array(); } $events = KService::get('com://admin/calendar.model.events')->sort('tbl.start_date')->direction('ASC')->limit($limit)->search($text)->getList(); $return = array(); foreach ($events as $event) { if (searchHelper::checkNoHTML($event, $text, array('title', 'description'))) { $event->text = $event->description; $event->origin = 'events'; $event->href = 'index.php?option=com_calendar&view=event&id=' . $event->id . '&slug=' . $event->slug; $event->section = JText::_('Events'); $return[] = $event->getData(); } } return $return; }
function _populateSingleItem($itemId) { global $gantry; $ini_string = $gantry->readMenuItemParams($itemId); $menu_params = new JParameter($ini_string); foreach ($gantry->_preset_names as $param_name) { $menuitem_param_name = $param_name; if (in_array($param_name, $gantry->_setbymenuitem) && $menu_params->get($menuitem_param_name, null) != null) { $param =& $gantry->_working_params[$param_name]; $menuitem_value = $menu_params->get($menuitem_param_name); $menuitem_preset_params = $gantry->_getPresetParams($param['name'], $menuitem_value); foreach ($menuitem_preset_params as $menuitem_preset_param_name => $menuitem_preset_param_value) { if (!is_null($menuitem_preset_param_value)) { $gantry->_working_params[$menuitem_preset_param_name]['value'] = $menuitem_preset_param_value; $gantry->_working_params[$menuitem_preset_param_name]['setby'] = 'menuitem'; } } } } // set individual values foreach ($gantry->_param_names as $param_name) { $menuitem_param_name = $param_name; if (in_array($param_name, $gantry->_setbymenuitem) && $menu_params->get($menuitem_param_name, null) != null) { $param =& $gantry->_working_params[$param_name]; $menuitem_value = $menu_params->get($menuitem_param_name); if (!is_null($menuitem_value)) { $gantry->_working_params[$param['name']]['value'] = $menuitem_value; $gantry->_working_params[$param['name']]['setby'] = 'menuitem'; } } } }
function plgContentChronoforms($context, &$row, &$params, $page = 0) { $plugin =& JPluginHelper::getPlugin('content', 'chronoforms'); $pluginParams = new JParameter($plugin->params); // define the regular expression for the bot $regex = "#{chronoforms}(.*?){/chronoforms}#s"; if (isset($row->text)) { $row->text = preg_replace_callback($regex, '_processForm', $row->text); } else { $row->text = ''; } //check after text forms $after_text = trim($pluginParams->get('after_text_forms')); if (!empty($after_text)) { $details = explode("\n", $after_text); foreach ($details as $detail) { $form_details = explode("=", $detail); if (count($form_details) == 2 && !empty($form_details[1])) { $cats = explode(',', $form_details[1]); foreach ($cats as $cat) { if ($cat == $row->catid) { $row->text = $row->text . _displayForm($form_details[0]); } } } } } return true; }
function getLoggedInUserLiked(){ global $facebook; try { $plugin =& JPluginHelper::getPlugin('system', 'myApiConnect'); $com_params = new JParameter( $plugin->params ); $fql['email'] = "SELECT email FROM user WHERE uid = me()"; $fql['like'] = "SELECT uid FROM page_fan WHERE uid = me() AND page_id = ".$com_params->get('appId'); $param = array( 'method' => 'fql.multiquery', 'queries' => json_encode($fql), 'callback' => '' ); $fqlResult = $facebook->api($param); $return['email'] = $fqlResult[0]['fql_result_set'][0]['email']; if(sizeof($fqlResult[1]['fql_result_set']) > 0) $return['liked'] = true; else $return['liked'] = false; } catch (FacebookApiException $e) { error_log($e); return false; } return $return; }
/** * get all events_categories to use category color * @return object */ function getCategoryData() { static $cats; if (!isset($cats)) { $db =& JFactory::getDBO(); if (JVersion::isCompatible("1.6.0")) { $sql = "SELECT c.* FROM #__categories as c WHERE extension='" . JEV_COM_COMPONENT . "' order by c.lft asc"; $db->setQuery($sql); $cats = $db->loadObjectList('id'); foreach ($cats as &$cat) { $cat->name = $cat->title; $params = new JParameter($cat->params); $cat->color = $params->get("catcolour", ""); $cat->overlaps = $params->get("overlaps", 0); } unset($cat); } else { $sql = "SELECT c.*, e.color FROM #__jevents_categories AS e LEFT JOIN #__categories as c ON c.id=e.id"; $db->setQuery($sql); $cats = $db->loadObjectList('id'); } $dispatcher =& JDispatcher::getInstance(); $dispatcher->trigger('onGetCategoryData', array(&$cats)); } $dispatcher =& JDispatcher::getInstance(); $dispatcher->trigger('onGetAccessibleCategories', array(&$cats)); return $cats; }
public function getList() { if (!isset($this->_list)) { $rowset = KFactory::get('com://admin/settings.database.rowset.settings'); //Insert the system configuration settings $rowset->insert(KFactory::get('com://admin/settings.database.row.system')); //Insert the component configuration settings $components = KFactory::get('com://admin/extensions.model.components')->enabled(1)->parent(0)->getList(); foreach($components as $component) { $path = JPATH_ADMINISTRATOR.'/components/'.$component->option.'/config.xml'; $params = new JParameter( $component->params); $config = array( 'name' => strtolower(substr($component->option, 4)), 'path' => file_exists($path) ? $path : '', 'id' => $component->id, 'data' => $params->toArray(), ); $row = KFactory::get('com://admin/settings.database.row.component', $config); $rowset->insert($row); } $this->_list = $rowset; } return $this->_list; }