public static function verify() { if (! self::enabled ()) return true; $app = JFactory::getApplication (); $dispatcher = JDispatcher::getInstance (); $results = $dispatcher->trigger ( 'onCaptchaRequired', array ('kunena.post' ) ); if (! JPluginHelper::isEnabled ( 'system', 'captcha' ) || ! $results [0]) { $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_CAPTCHA_CANNOT_CHECK_CODE' ), 'error' ); return false; } if ($results [0]) { $captchaparams = array ( JRequest::getVar ( 'captchacode', '', 'post' ), JRequest::getVar ( 'captchasuffix', '', 'post' ), JRequest::getVar ( 'captchasessionid', '', 'post' ) ); $results = $dispatcher->trigger ( 'onCaptchaVerify', $captchaparams ); if (! $results [0]) { $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_CAPTCHACODE_DO_NOT_MATCH' ), 'error' ); return false; } } return true; }
public function saveOrder($pks = array(), $lft = array()) { JPluginHelper::importPlugin('cck_storage_location'); if (!count($pks)) { return false; } $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('a.id, a.pk, a.storage_location, b.id AS type_id')->from('#__cck_core AS a')->join('LEFT', '#__cck_core_types AS b ON b.name = a.cck')->where('a.id IN (' . implode(',', $pks) . ')'); $db->setQuery($query); $results = $db->loadAssocList('id'); if (!empty($results)) { $ids = array(); $location = null; $user = JCck::getUser(); $user_id = $user->get('id'); foreach ($pks as $i => $pk) { $canEdit = $user->authorise('core.edit', 'com_cck.form.' . $results[$pk]['type_id']); $canEditOwn = $user->authorise('core.edit.own', 'com_cck.form.' . $results[$pk]['type_id']); // Check Permissions if (!($canEdit && $canEditOwn || $canEdit && !$canEditOwn && $results[$pk]['author_id'] != $user_id || $canEditOwn && $results[$pk]['author_id'] == $user_id)) { unset($lft[$i]); continue; } $ids[] = $results[$pk]['pk']; if (null === $location) { $location = $results[$pk]['storage_location']; } } if ($location && count($ids)) { return JCck::callFunc_Array('plgCCK_Storage_Location' . $location, 'onCCK_Storage_LocationSaveOrder', array($ids, $lft)); } } return false; }
function plgAcymailingContentplugin(&$subject, $config) { parent::__construct($subject, $config); if (!isset($this->params)) { $plugin = JPluginHelper::getPlugin('acymailing', 'contentplugin'); $this->params = new acyParameter($plugin->params); } $this->paramsContent = JComponentHelper::getParams('com_content'); JPluginHelper::importPlugin('content'); $this->dispatcherContent = JDispatcher::getInstance(); $excludedHandlers = array('plgContentEmailCloak', 'pluginImageShow'); $excludedNames = array('system' => array('SEOGenerator', 'SEOSimple'), 'content' => array('webeecomment', 'highslide', 'smartresizer', 'phocagallery')); $excludedType = array_keys($excludedNames); if (!ACYMAILING_J16) { foreach ($this->dispatcherContent->_observers as $id => $observer) { if (is_array($observer) and in_array($observer['handler'], $excludedHandlers)) { $this->dispatcherContent->_observers[$id]['event'] = ''; } elseif (is_object($observer)) { if (in_array($observer->_type, $excludedType) and in_array($observer->_name, $excludedNames[$observer->_type])) { $this->dispatcherContent->_observers[$id] = null; } } } } if (!class_exists('JSite')) { include_once ACYMAILING_ROOT . 'includes' . DS . 'application.php'; } }
/** * Method to get the field options. * * @return array The field option objects. * @since 1.6 */ protected function getOptions() { $options = array(); $params = JComponentHelper::getParams('com_joomdle'); $app = $params->get('activities'); $option = array('value' => 'no', 'text' => JText::_('COM_JOOMDLE_NONE')); $options[] = $option; $option = array('value' => 'jomsocial', 'text' => 'Jomsocial'); $options[] = $option; // Add sources added via plugins JPluginHelper::importPlugin('joomdleactivities'); $dispatcher = JDispatcher::getInstance(); $more_sources = $dispatcher->trigger('onGetActivitiesSource', array()); if (is_array($more_sources)) { foreach ($more_sources as $source) { $keys = array_keys($source); $key = $keys[0]; $source_name = array_shift($source); $option['value'] = $key; $option['text'] = $source_name; $options[] = $option; } } return $options; }
function tag() { $doc = JFactory::getDocument(); $doc->addStyleSheet(ACYMAILING_CSS . 'frontendedition.css?v=' . filemtime(ACYMAILING_MEDIA . 'css' . DS . 'frontendedition.css')); JPluginHelper::importPlugin('acymailing'); $dispatcher = JDispatcher::getInstance(); $tagsfamilies = $dispatcher->trigger('acymailing_getPluginType'); $defaultFamily = reset($tagsfamilies); $app = JFactory::getApplication(); $fctplug = $app->getUserStateFromRequest(ACYMAILING_COMPONENT . ".tag", 'fctplug', $defaultFamily->function, 'cmd'); ob_start(); $defaultContents = $dispatcher->trigger($fctplug); $defaultContent = ob_get_clean(); $js = 'function insertTag(){if(window.parent.insertTag(window.document.getElementById(\'tagstring\').value)) {acymailing_js.closeBox(true);}}'; $js .= 'function setTag(tagvalue){window.document.getElementById(\'tagstring\').value = tagvalue;}'; $js .= 'function showTagButton(){window.document.getElementById(\'insertButton\').style.display = \'inline\'; window.document.getElementById(\'tagstring\').style.display=\'inline\';}'; $js .= 'function hideTagButton(){}'; $js .= 'try{window.parent.previousSelection = window.parent.getPreviousSelection(); }catch(err){window.parent.previousSelection=false; }'; $doc->addScriptDeclaration($js); $this->assignRef('fctplug', $fctplug); $type = JRequest::getString('type', 'news'); $this->assignRef('type', $type); $this->assignRef('defaultContent', $defaultContent); $this->assignRef('tagsfamilies', $tagsfamilies); $app = JFactory::getApplication(); $this->assignRef('app', $app); $ctrl = JRequest::getString('ctrl'); $this->assignRef('ctrl', $ctrl); }
public static function createObserver(JObservableInterface $observableObject, $params = array()) { $observer = new self($observableObject); $observer->plugin = JPluginHelper::getPlugin('system', 'jds'); $observer->params = new JRegistry($observer->plugin->params); return $observer; }
function listing() { JRequest::setVar('tmpl', 'component'); $statsClass = acymailing_get('class.stats'); $statsClass->saveStats(); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); header("Expires: Wed, 17 Sep 1975 21:32:10 GMT"); ob_end_clean(); JPluginHelper::importPlugin('acymailing'); $this->dispatcher = JDispatcher::getInstance(); $results = $this->dispatcher->trigger('acymailing_getstatpicture'); $picture = reset($results); if (empty($picture)) { $picture = 'media/com_acymailing/images/statpicture.png'; } $picture = ltrim(str_replace(array('\\', '/'), DS, $picture), DS); $imagename = ACYMAILING_ROOT . $picture; $handle = fopen($imagename, 'r'); if (!$handle) { exit; } header("Content-type: image/png"); $contents = fread($handle, filesize($imagename)); fclose($handle); echo $contents; exit; }
/** * Constructor * * For php4 compatability 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. */ function plgContentCpTags(&$subject) { parent::__construct($subject); // load plugin parameters $this->_plugin =& JPluginHelper::getPlugin('content', 'cptags'); $this->_params = new JParameter($this->_plugin->params); }
public static function _getArticleHTML($userid, $limit, $limitstart, $row, $app, $total, $cat, $params) { JPluginHelper::importPlugin('content'); $dispatcher = JDispatcher::getInstance(); $html = ""; if (!empty($row)) { $html .= '<div class="joms-app--myarticle">'; $html .= '<ul class="joms-list">'; foreach ($row as $data) { $text_limit = $params->get('limit', 50); $result = $dispatcher->trigger('onPrepareContent', array(&$data, &$params, 0)); if (empty($cat[$data->catid])) { $cat[$data->catid] = ""; } $data->sectionid = empty($data->sectionid) ? 0 : $data->sectionid; $link = plgCommunityMyArticles::buildLink($data->id, $data->alias, $data->catid, $cat[$data->catid], $data->sectionid); $created = new JDate($data->created); $date = CTimeHelper::timeLapse($created); $html .= ' <li>'; $html .= ' <a href="' . $link . '">' . htmlspecialchars($data->title) . '</a>'; $html .= '<span class="joms-block joms-text--small joms-text--light">' . $date . '</span>'; $html .= ' </li>'; } $html .= '</ul>'; $showall = CRoute::_('index.php?option=com_community&view=profile&userid=' . $userid . '&task=app&app=myarticles'); $html .= "<div class='joms-gap'></div><div class='list-articles--button'><small><a class='joms-button--link' href='" . $showall . "'>" . JText::_('PLG_MYARTICLES_SHOWALL') . "</a></small></div>"; $html .= '</div>'; } else { $html .= "<p>" . JText::_("PLG_MYARTICLES_NO_ARTICLES") . "</p>"; } return $html; }
public function display($tpl = null) { global $mainframe; $pathway =& $mainframe->getPathway(); $params =& $mainframe->getParams(); $model = KFactory::get('site::com.picman.model.album'); $album = $model->getItem(); // set Breadcrumbs $pathway->addItem($album->name); // set Document data $document =& JFactory::getDocument(); $document->setMetaData('keywords', $album->metakey); $document->setMetaData('description', $album->metadesc); $document->setTitle($album->name); // Load GData plugin $plugin =& JPluginHelper::getPlugin('system', 'gdata'); $gdata = new JParameter($plugin->params); // get Simple XML feed from GData Plugin $album = "picman_album_" . $album->id; $query = "kind=photo&access=all&thumbsize=144c&imgmax=512"; $simpleXml = plgSystemGdata::getSimpleXml($album, $query); $this->assignRef('album', $album); $this->assignRef('params', $params); $this->assignRef('simpleXml', $simpleXml); $this->assignRef('filter', $model->getFilters()); $this->assignRef('pagination', $model->getPagination()); // Display the layout parent::display($tpl); }
public function getRequiredScope() { if (self::$requiredScope) { return self::$requiredScope; } JPluginHelper::importPlugin('socialprofiles'); $app = JFactory::getApplication(); $args = array('google'); $perms = $app->triggerEvent('socialProfilesGetRequiredScope', $args); if ($perms) { foreach ($perms as $permArray) { self::$requiredScope = array_merge(self::$requiredScope, $permArray); } } $configModel = JFBCFactory::config(); $customPermsSetting = $configModel->getSetting('google_custom_scope'); if ($customPermsSetting != '') { $customPermsSetting = str_replace("\r\n", ',', $customPermsSetting); //Separate into an array to be able to merge and then take out duplicates $customPerms = explode(',', $customPermsSetting); foreach ($customPerms as $customPerm) { self::$requiredScope[] = trim($customPerm); } } self::$requiredScope = array_unique(self::$requiredScope); self::$requiredScope = implode(",", self::$requiredScope); return self::$requiredScope; }
function fetchElement($name, $value, &$node, $control_name) { // Base name of the HTML control. $ctrl = $control_name . '[' . $name . ']'; // Construct the various argument calls that are supported. $attribs = ' '; if ($v = $node->attributes('size')) { $attribs .= 'size="' . $v . '"'; } if ($v = $node->attributes('class')) { $attribs .= 'class="' . $v . '"'; } else { $attribs .= 'class="inputbox"'; } if ($m = $node->attributes('multiple')) { $attribs .= ' multiple="multiple"'; $ctrl .= '[]'; } //get plugin name (plugin entryfile name) $element = $node->attributes('element'); $db =& JFactory::getDBO(); //get plugin params from #__plugins table $plugin = JPluginHelper::getPlugin('emailalerts', $element); if (!empty($plugin)) { $pluginParams = new JParameter($plugin->params); $pluginParamsDefault = $pluginParams->_raw; //example: plugintitle=K2-Latest Items category=1|3|4|5|2 no_of_items=5 catid=1|3|4|5|2 $new1 = explode("\n", $pluginParamsDefault); $new2 = explode("=", $new1[2]); $cats = str_replace('|', ',', $new2[1]); if ($cats) { $sql = "SELECT id ,title FROM #__categories WHERE published = 1 AND section !='com_docman' AND id IN (" . $cats . ")"; } else { //if no category is yet selected $sql = "SELECT id ,title FROM #__categories WHERE published = 1 AND section !='com_docman'"; } } else { //if plugin is not yet enabled load all categories $sql = "SELECT id ,title FROM #__categories WHERE published = 1 AND section !='com_docman'"; } $db->setQuery($sql); // Query items for list. $key = $node->attributes('key_field') ? $node->attributes('key_field') : 'value'; $val = $node->attributes('value_field') ? $node->attributes('value_field') : $name; $options = array(); foreach ($node->children() as $option) { $options[] = array($key => $option->attributes('value'), $val => $option->data()); } $rows = $db->loadAssocList(); if ($rows) { foreach ($rows as $row) { $options[] = array($key => $row[$key], $val => $row[$val]); } } if ($options) { return JHTML::_('select.genericlist', $options, $ctrl, $attribs, $key, $val, $value, $control_name . $name); } else { return JText::_('NO_CATS_USER'); } }
public function onStylesSave(Event $event) { \JPluginHelper::importPlugin('gantry5'); // Trigger the onGantryThemeUpdateCss event. $dispatcher = \JEventDispatcher::getInstance(); $dispatcher->trigger('onGantry5UpdateCss', ['theme' => $event->theme]); }
function NextendSliderWidgets($slider, $id) { $this->_slider = $slider; $this->_id = $id; $this->_widgets = array(); $this->_enabledWidgets = array(); $params = $this->_slider->_sliderParams; if ($slider->_backend) { return; } $plugins = array(); NextendPlugin::callPlugin('nextendsliderwidget', 'onNextendSliderWidgetList', array(&$plugins)); foreach ($plugins as $k => $v) { $widget = $params->get('widget' . $k); $display = NextendParse::parse($params->get('widget' . $k . 'display', '0|*|always|*|0|*|0')); if ($widget != '' && (isset($display[0]) && intval($display[0]) || isset($display[2]) && intval($display[2]) || isset($display[3]) && intval($display[3]))) { $this->_enabledWidgets[$k] = $widget; } } foreach ($this->_enabledWidgets as $k => $v) { if (nextendIsJoomla()) { JPluginHelper::importPlugin('nextendsliderwidget' . $k); } $class = 'plgNextendSliderWidget' . $k . $v; if (class_exists($class, false)) { $this->_widgets[$k] = call_user_func(array($class, 'render'), $slider, $id, $params); } } }
function display($tpl = null) { JHTML::_('behavior.modal'); $app = JFactory::getApplication(); $document = JFactory::getDocument(); $model = $this->getModel(); $params = Djcatalog2Helper::getParams(); $menus = $app->getMenu('site'); $menu = $menus->getActive(); $dispatcher = JDispatcher::getInstance(); $categories = Djc2Categories::getInstance(array('state' => '1')); $item = $model->getData(); /* If Item not published set 404 */ if ($item->id == 0 || !$item->published) { throw new Exception(JText::_('COM_DJCATALOG2_PRODUCT_NOT_FOUND'), 404); } /* plugins */ JPluginHelper::importPlugin('djcatalog2'); $results = $dispatcher->trigger('onPrepareItemDescription', array(&$item, &$params, 0)); $this->assignref('categories', $categories); $this->assignref('item', $item); $this->assignref('images', $images); $this->assignref('params', $params); $this->_prepareDocument(); parent::display($tpl); }
/** * Display the button * * @return array A two element array of ( imageName, textToInsert ) */ function onDisplay($name) { jimport('joomla.filesystem.file'); // return if system plugin is not installed if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . $this->_name . DS . $this->_name . '.php')) { return; } // return if NoNumber! Elements plugin is not installed if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'nonumberelements.php')) { return; } // load the admin language file $lang =& JFactory::getLanguage(); if ($lang->getTag() != 'en-GB') { // Loads English language file as fallback (for undefined stuff in other language file) $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, 'en-GB'); } $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, null, 1); // Load system plugin parameters require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php'; $parameters =& NNParameters::getParameters(); $system_params = JPluginHelper::getPlugin('system', $this->_name); $params = $parameters->getParams($system_params->params, JPATH_PLUGINS . DS . 'system' . DS . $this->_name . DS . $this->_name . '.xml'); // Include the Helper require_once JPATH_PLUGINS . DS . $this->_type . DS . $this->_name . DS . 'helper.php'; $class = get_class($this) . 'Helper'; $this->helper = new $class($params); return $this->helper->render($name); }
/** * Method to display a view. * * @param boolean If true, the view output will be cached * @param array 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) { JPluginHelper::importPlugin('content'); $vName = JRequest::getCmd('view', 'images'); switch ($vName) { case 'imagesList': $mName = 'list'; $vLayout = JRequest::getCmd('layout', 'default'); break; case 'images': default: $vLayout = JRequest::getCmd('layout', 'default'); $mName = 'manager'; $vName = 'images'; break; } $document = JFactory::getDocument(); $vType = $document->getType(); // Get/Create the view $view = $this->getView($vName, $vType); $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR . '/views/' . strtolower($vName) . '/tmpl'); // Get/Create the model if ($model = $this->getModel($mName)) { // Push the model into the view (as default) $view->setModel($model, true); } // Set the layout $view->setLayout($vLayout); // Display the view $view->display(); return $this; }
/** * Check if the debug plugin is disabled. * * @return boolean */ public function checkDebugPluginDisabled() { if ($enabled = \JPluginHelper::isEnabled('system', 'debug')) { $this->issues['critical'][] = sprintf("System - Debug Plugin enabled. This might cause memory issues, while compiling the LESS files."); } return !$enabled; }
/** * Helper method to return button list. * * This method returns the array by reference so it can be * used to add custom buttons or remove default ones. * * @param JRegistry The module parameters. * * @return array An array of buttons * @since 1.6 */ public static function &getButtons($params) { $key = (string) $params; if (!isset(self::$buttons[$key])) { $context = $params->get('context', 'mod_pj_quickicon'); if ($context == 'mod_pj_quickicon') { // Load mod_quickicon language file in case this method is called before rendering the module JFactory::getLanguage()->load('mod_pj_quickicon'); self::$buttons[$key] = array(array('link' => JRoute::_('index.php?option=com_playjoom&view=audiotracks'), 'params' => null, 'id' => null, 'imagePath' => null, 'image' => ' fa fa-list-alt', 'text' => JText::_('MOD_PJ_QUICKICON_TRACKSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_playjoom&view=media'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-music', 'text' => JText::_('MOD_PJ_QUICKICON_ADD_TRACKS'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_playjoom&view=artists'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-users', 'text' => JText::_('MOD_PJ_QUICKICON_ARTISTSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_playjoom&view=albums'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-picture-o', 'text' => JText::_('MOD_PJ_QUICKICON_ALBUMSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_playjoom&view=covers'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-file-image-o', 'text' => JText::_('MOD_PJ_QUICKICON_COVERSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_TRACKS'), array('link' => JRoute::_('index.php?option=com_categories&view=categories&extension=com_playjoom'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-folder-o', 'text' => JText::_('MOD_PJ_QUICKICON_GENRESMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_CATEGORIES'), array('link' => JRoute::_('index.php?option=com_categories&view=categories&extension=com_playjoom.playlist'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-play', 'text' => JText::_('MOD_PJ_QUICKICON_PLAYLISTSMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_CATEGORIES'), array('link' => JRoute::_('index.php?option=com_categories&view=categories&extension=com_playjoom.trackfilter'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-filter', 'text' => JText::_('MOD_PJ_QUICKICON_TRACKFILTERMANAGER'), 'access' => array('core.manage', 'com_playjoom', 'core.create', 'com_playjoom'), 'group' => 'MOD_PJ_QUICKICON_CATEGORIES')); //Get user objects $user = JFactory::getUser(); if ($user->authorise('core.admin', 'com_playjoom')) { $PJbuttons = array(array('link' => JRoute::_('index.php?option=com_users'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-user', 'text' => JText::_('MOD_QUICKICON_USER_MANAGER'), 'access' => array('core.manage', 'com_users'), 'group' => 'MOD_PJ_QUICKICON_USERS'), array('link' => JRoute::_('index.php?option=com_config'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-cogs', 'text' => JText::_('MOD_QUICKICON_GLOBAL_CONFIGURATION'), 'access' => array('core.manage', 'com_config', 'core.admin', 'com_config'), 'group' => 'MOD_PJ_QUICKICON_CONFIGURATIONS'), array('link' => JRoute::_('index.php?option=com_config&view=component&component=com_playjoom'), 'params' => null, 'id' => null, 'imagePath' => '/administrator/components/com_playjoom/images/header/', 'image' => 'fa fa-cog', 'text' => JText::_('MOD_PJ_QUICKICON_PLAYJOOM_OPTIONS'), 'access' => array('core.manage', 'com_config', 'core.admin', 'com_config'), 'group' => 'MOD_PJ_QUICKICON_CONFIGURATIONS')); //Marge standard icons with PlayJoom admin icons self::$buttons[$key] = array_merge(self::$buttons[$key], $PJbuttons); // Include buttons defined by published quickicon plugins JPluginHelper::importPlugin('quickicon'); $app = JFactory::getApplication(); $arrays = (array) $app->triggerEvent('onGetIcons', array($context)); foreach ($arrays as $response) { foreach ($response as $icon) { $default = array('link' => null, 'image' => 'cog', 'text' => null, 'access' => true, 'group' => 'MOD_QUICKICON_EXTENSIONS'); $icon = array_merge($default, $icon); if (!is_null($icon['link']) && !is_null($icon['text'])) { self::$buttons[$key][] = $icon; } } } } } else { self::$buttons[$key] = array(); } } return self::$buttons[$key]; }
function _form($tpl = null) { parent::_form($tpl); // load the plugin $row = $this->getModel()->getItem(); $import = JPluginHelper::importPlugin('Citruscart', $row->element); }
function initialize() { // Get Plugin info $plugin =& JPluginHelper::getPlugin('content', 'flickrAlbum'); $pluginParams = new JParameter($plugin->params); $this->thumbsize = $pluginParams->get('thumbsizedef', 1); $this->imagesize = $pluginParams->get('imagesizedef', 1); $this->rows = $pluginParams->get('rowsdef', 1); $this->cols = $pluginParams->get('colsdef', 1); $this->type = ''; $this->photoset = ''; $this->keywords = ''; $this->user = $pluginParams->get('userdef', 1); $this->group = ''; $this->tags = ''; $this->sort = $pluginParams->get('sortdef', 1); $this->color = $pluginParams->get('colorthemedef', 1); $this->title = $pluginParams->get('albumtitledef', 1); $this->linktext = $pluginParams->get('linktextdef', 1); $this->debug = strtolower($pluginParams->get('enabledebug', 1)) == 'yes'; $this->thumbpadding = $pluginParams->get('thumbpadding', 1); $this->thumbborder = $pluginParams->get('thumbborder', 1); $this->thumbmargin = $pluginParams->get('thumbmargin', 1); $this->flickr_api_key = $pluginParams->get('flickr_api_key', 1); $this->inc_jquery = strtolower($pluginParams->get('incjquery', 1)) == 'yes'; $this->inc_jquery_flickr = strtolower($pluginParams->get('incjqueryflickr', 1)) == 'yes'; }
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 plgSystemmyApiOpenGraph(&$subject, $config){ parent::__construct($subject, $config); if(!class_exists('plgSystemmyApiConnect')) return; $cache = & JFactory::getCache('plgSystemmyApiOpenGraph - FB Admins query'); $cache->setCaching( 1 ); $config =& JFactory::getConfig(); $connect_plugin =& JPluginHelper::getPlugin('system', 'myApiConnect'); $connect_params = new JParameter( $connect_plugin->params ); $plugin =& JPluginHelper::getPlugin('system', 'myApiOpenGraph'); $plugin_params = new JParameter( $plugin->params ); $db_admins = $cache->call( array( 'plgSystemmyApiOpenGraph', 'getFbAdmins')); $param_admins = ($plugin_params->get('fbadmins') != '') ? explode(',',$plugin_params->get('fbadmins')) : array(); $admins = array_merge($db_admins,$param_admins); $ogptags_default = array(); $ogptags_default['og:title'] = $config->getValue( 'config.sitename' ); $ogptags_default['og:type'] = 'website'; $ogptags_default['og:url'] = JURI::getInstance()->toString(); $ogptags_default['og:site_name'] = $config->getValue( 'config.sitename' ); $ogptags_default['fb:app_id'] = $connect_params->get('appId'); $ogptags_default['fb:admins'] = implode(',',$admins); if($plugin_params->get('ogimage') != '' && $plugin_params->get('ogimage') != -1) $ogptags_default['og:image'] = JURI::base().'images/'.$plugin_params->get('ogimage'); if($plugin_params->get('fbpageid') != '') $ogptags_default['fb:page_id'] = $plugin_params->get('fbpageid'); plgSystemmyApiOpenGraph::setTags($ogptags_default); }
/** * Funkce pro načtení dat 1 článku z databáze */ private function prepareArticleDB($articleId, $text = 'all', $skipPlugins = false) { $db =& JFactory::getDBO(); $db->setQuery("SELECT * FROM #__content WHERE id='{$articleId}' LIMIT 1;"); $rows = $db->loadObjectList(); if (count($rows) == 1) { $article = $rows[0]->introtext . $rows[0]->fulltext; } else { return false; } //připravíme text if ($text == 'introtext') { $rows[0]->text = $rows[0]->introtext; } elseif ($text == 'fulltext') { $rows[0]->text = $rows[0]->fulltext; } else { $rows[0]->text = $rows[0]->introtext . $rows[0]->fulltext; } if (!$skipPlugins) { $dispatcher =& JDispatcher::getInstance(); JPluginHelper::importPlugin("content"); //naimportujeme všechny pluginy pro zpracování obsahu $rows[0]->parameters = new JParameter($rows[0]->attribs); //vytvoříme objekt s parametry článku $results = $dispatcher->trigger('onPrepareContent', array(&$rows[0], &$rows[0]->parameters, 0)); //načtení pluginů } /*nahradíme event. špatný tvar komentářů*/ $rows[0]->text = str_replace('<!--gInclude{', '<!-- gInclude{', $rows[0]->text); $rows[0]->text = str_replace('}-->', '} -->', $rows[0]->text); /**/ return $rows[0]; }
function sendMemberDaytimeToAdmin($member_id, $service_id, $daytime_id) { define("BodyMemberDaytimeToAdmin", "<h1>Nouvelle inscription à une tranche horaire</h1><p>Un bénévole s'est inscrit à un secteur / tranche horaire.</p><p><strong>Nom :</strong> %s <br /><strong>Secteur :</strong> %s<br /><strong>Date :</strong> %s<br /><strong>Tranche horaire :</strong> %s</p><p><a href=\"" . JURI::root() . "/administrator/index.php?option=com_estivole&view=member&layout=edit&member_id=%s\">Cliquez ici</a> pour valider l'inscription et/ou recontacter le bénévole.</p>"); define("SubjectMemberDaytimeToAdmin", "Nouvelle inscription à une tranche horaire"); $db = JFactory::getDBO(); $query = $db->getQuery(TRUE); $this->user = JFactory::getUser(); // Get the dispatcher and load the user's plugins. $dispatcher = JEventDispatcher::getInstance(); JPluginHelper::importPlugin('user'); $data = new JObject(); $data->id = $this->user->id; // Trigger the data preparation event. $dispatcher->trigger('onContentPrepareData', array('com_users.profilestivole', &$data)); $userProfilEstivole = $data; $userName = $userProfilEstivole->profilestivole['firstname'] . ' ' . $userProfilEstivole->profilestivole['lastname']; $query->select('*'); $query->from('#__estivole_members as b, #__estivole_services as s, #__estivole_daytimes as d'); $query->where('b.member_id = ' . (int) $member_id); $query->where('s.service_id = ' . (int) $service_id); $query->where('d.daytime_id = ' . (int) $daytime_id); $db->setQuery($query); $mailModel = $db->loadObject(); $mail = JFactory::getMailer(); $mail->setBody(sprintf(constant("BodyMemberDaytimeToAdmin"), $userName, $mailModel->service_name, date('d-m-Y', strtotime($mailModel->daytime_day)), date('H:i', strtotime($mailModel->daytime_hour_start)) . ' - ' . date('H:i', strtotime($mailModel->daytime_hour_end)), $mailModel->member_id)); $mail->setSubject(constant("SubjectMemberDaytimeToAdmin")); $mail->isHtml(); $recipient = array('*****@*****.**', $mailModel->email_responsable); $mail->addRecipient($recipient); $mail->Send('*****@*****.**'); }
static function render() { $app = JFactory::getApplication(); $options = array(); // Setup the document options. $options['template'] = $app->get('theme'); $options['file'] = $app->get('themeFile', 'index.php'); $options['params'] = $app->get('themeParams'); if ($app->get('themes.base')) { $options['directory'] = $app->get('themes.base'); } else { $options['directory'] = defined('JPATH_THEMES') ? JPATH_THEMES : (defined('JPATH_BASE') ? JPATH_BASE : __DIR__) . '/themes'; } // Parse the document. JFactory::getDocument()->parse($options); // Trigger the onBeforeRender event. JPluginHelper::importPlugin('system'); $app->triggerEvent('onBeforeRender'); $caching = false; if ($app->isSite() && $app->get('caching') && $app->get('caching', 2) == 2 && !JFactory::getUser()->get('id')) { $caching = true; } // Render the document. $data = JFactory::getDocument()->render($caching, $options); // Set the application output data. $app->setBody($data); // Trigger the onAfterRender event. $app->triggerEvent('onAfterRender'); // Mark afterRender in the profiler. // Causes issues, so commented out. // JDEBUG ? $app->profiler->mark('afterRender') : null; }
/** * Helper method to return button list. * * This method returns the array by reference so it can be * used to add custom buttons or remove default ones. * * @param JRegistry The module parameters. * * @return array An array of buttons * @since 1.6 */ public static function &getButtons($params) { $key = (string) $params; if (!isset(self::$buttons[$key])) { $context = $params->get('context', 'mod_quickicon'); if ($context == 'mod_quickicon') { // Load mod_quickicon language file in case this method is called before rendering the module JFactory::getLanguage()->load('mod_quickicon'); self::$buttons[$key] = array(array('link' => JRoute::_('index.php?option=com_content&task=article.add'), 'image' => 'header/icon-48-article-add.png', 'text' => JText::_('MOD_QUICKICON_ADD_NEW_ARTICLE'), 'access' => array('core.manage', 'com_content', 'core.create', 'com_content')), array('link' => JRoute::_('index.php?option=com_content'), 'image' => 'header/icon-48-article.png', 'text' => JText::_('MOD_QUICKICON_ARTICLE_MANAGER'), 'access' => array('core.manage', 'com_content')), array('link' => JRoute::_('index.php?option=com_categories&extension=com_content'), 'image' => 'header/icon-48-category.png', 'text' => JText::_('MOD_QUICKICON_CATEGORY_MANAGER'), 'access' => array('core.manage', 'com_content')), array('link' => JRoute::_('index.php?option=com_media'), 'image' => 'header/icon-48-media.png', 'text' => JText::_('MOD_QUICKICON_MEDIA_MANAGER'), 'access' => array('core.manage', 'com_media')), array('link' => JRoute::_('index.php?option=com_menus'), 'image' => 'header/icon-48-menumgr.png', 'text' => JText::_('MOD_QUICKICON_MENU_MANAGER'), 'access' => array('core.manage', 'com_menus')), array('link' => JRoute::_('index.php?option=com_users'), 'image' => 'header/icon-48-user.png', 'text' => JText::_('MOD_QUICKICON_USER_MANAGER'), 'access' => array('core.manage', 'com_users')), array('link' => JRoute::_('index.php?option=com_modules'), 'image' => 'header/icon-48-module.png', 'text' => JText::_('MOD_QUICKICON_MODULE_MANAGER'), 'access' => array('core.manage', 'com_modules')), array('link' => JRoute::_('index.php?option=com_installer'), 'image' => 'header/icon-48-extension.png', 'text' => JText::_('MOD_QUICKICON_EXTENSION_MANAGER'), 'access' => array('core.manage', 'com_installer')), array('link' => JRoute::_('index.php?option=com_languages'), 'image' => 'header/icon-48-language.png', 'text' => JText::_('MOD_QUICKICON_LANGUAGE_MANAGER'), 'access' => array('core.manage', 'com_languages')), array('link' => JRoute::_('index.php?option=com_config'), 'image' => 'header/icon-48-config.png', 'text' => JText::_('MOD_QUICKICON_GLOBAL_CONFIGURATION'), 'access' => array('core.manage', 'com_config', 'core.admin', 'com_config')), array('link' => JRoute::_('index.php?option=com_templates'), 'image' => 'header/icon-48-themes.png', 'text' => JText::_('MOD_QUICKICON_TEMPLATE_MANAGER'), 'access' => array('core.manage', 'com_templates')), array('link' => JRoute::_('index.php?option=com_admin&task=profile.edit&id=' . JFactory::getUser()->id), 'image' => 'header/icon-48-user-profile.png', 'text' => JText::_('MOD_QUICKICON_PROFILE'), 'access' => true)); } else { self::$buttons[$key] = array(); } // Include buttons defined by published quickicon plugins JPluginHelper::importPlugin('quickicon'); $app = JFactory::getApplication(); $arrays = (array) $app->triggerEvent('onGetIcons', array($context)); foreach ($arrays as $response) { foreach ($response as $icon) { $default = array('link' => null, 'image' => 'header/icon-48-config.png', 'text' => null, 'access' => true); $icon = array_merge($default, $icon); if (!is_null($icon['link']) && !is_null($icon['text'])) { self::$buttons[$key][] = $icon; } } } } return self::$buttons[$key]; }
function plugin_init() { //invoke plugins. JPluginHelper::importPlugin('civicrm'); $app =& JFactory::getApplication(); $app->triggerEvent('onCiviLoad'); }
/** * Prepare content method * * Method is called by the view * * @param string $context The context of the content being passed to the plugin. * @param object &$row The article object. Note $article->text is also available * @param object &$params The article params * @param int $page The 'page' number * * @return void */ 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 . '/components/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 JRegistry($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 . '/helpers/parent.php'; /* $$$ hugh - hacky fix for nasty issue with IE, which (for gory reasons) doesn't like having our JS content * wrapped in P tags. But the default WYSIWYG editor in J! will automagically wrap P tags around everything. * So let's just look for obvious cases of <p>{fabrik ...}</p>, and replace the P's with DIV's. * Yes, it's hacky, but it'll save us a buttload of support work. */ $pregex = "/<p>\\s*{" . $botRegex . "\\s*.*?}\\s*<\\/p>/i"; $row->text = preg_replace_callback($pregex, array($this, 'preplace'), $row->text); // $$$ hugh - having to change this to use {[]} $regex = "/{" . $botRegex . "\\s*.*?}/i"; $row->text = preg_replace_callback($regex, array($this, 'replace'), $row->text); }
public function fetchElement($name, $value, &$node, $control_name) { jimport('joomla.plugin.helper'); wfimport('admin.helpers.extension'); $language = JFactory::getLanguage(); $plugins = JPluginHelper::getPlugin('search'); // use tested defaults if (!$value) { $value = array('categories', 'contacts', 'content', 'newsfeeds', 'weblinks'); } else { $value = (array) $value; } //$html = '<span style="display:inline-block;"><input class="checkbox-list-toggle-all" type="checkbox"'. $checked .' /><label>'. WFText::_('WF_PROFILES_TOGGLE_ALL') . '</label>'; $html = '<span style="display:inline-block;" data-parent="' . preg_replace(array('#^params#', '#([^\\w]+)#'), '', $control_name) . $node->attributes()->parent . '"><ul class="checkbox-list">'; foreach ($plugins as $item) { $plugin = WFExtensionHelper::getPlugin(null, $item->name, 'search'); $extension = 'plg_' . $plugin->folder . '_' . $plugin->element; $language->load($extension) || $language->load($extension, JPATH_ADMINISTRATOR); $language->load($extension . '.sys') || $language->load($extension . '.sys', JPATH_ADMINISTRATOR); $checked = in_array($plugin->element, $value) ? ' checked="checked"' : ''; $html .= '<li><input type="checkbox" name="' . $control_name . '[' . $name . '][]" value="' . $plugin->element . '"' . $checked . ' /><label>' . JText::_($plugin->name) . '</label></li>'; } $html .= '</ul></span>'; return $html; }