function loadMultilangData($prepareElementCallback)
{
    $languages = JLanguageHelper::getLanguages();
    $app = JApplication::getInstance('site');
    $menu = $app->getMenu();
    $config = JFactory::getConfig();
    $sef = $config->get('sef', 0);
    $sefRewrite = $config->get('sef_rewrite', 0);
    $defaultLangCode = JFactory::getLanguage()->getDefault();
    $websites = array();
    //$websites['*'] = $menu->getDefault('*'); // TODO add?
    $languageFilterEnabled = JPluginHelper::isEnabled('system', 'languagefilter');
    if (!$languageFilterEnabled || $sef != '1') {
        // TODO check also if sef is enabled
        return $websites;
    }
    $oldLanguageFilterValue = $app->setLanguageFilter(true);
    // necessary that $menu->getDefault() works
    foreach ($languages as $language) {
        $langCode = $language->lang_code;
        $default = $menu->getDefault($langCode);
        if ($default && $default->language == $langCode) {
            $websites[$langCode] = $prepareElementCallback($language, $langCode, $defaultLangCode, $sefRewrite);
        }
    }
    $app->setLanguageFilter($oldLanguageFilterValue);
    return $websites;
}
Example #2
0
    /**
     * Method to get the field input markup.
     *
     * @return  string  The field input markup.
     */
    protected function getInput()
    {
        $plugin = JPluginHelper::isEnabled('system', 'ezset');
        if (!$plugin) {
            return print_r($plugin, 1) . '需要先啟動外掛!';
        }
        $name = str_replace('jform_params_', '', $this->id);
        \JHtmlBehavior::framework(true);
        $token = JFactory::getSession()->getFormToken();
        $ajaxUrl = JURI::root() . 'index.php?cmd=ajax.overlay.' . $name;
        $ajaxCode = <<<AJAX
window.addEvent('domready', function() {

\t\$('{$name}').addEvent('click', function(e) {
\t\tvar myRequest = new Request({
\t\t\tmethod: 'post',
\t\t\tdata: {
\t\t\t\t'{$token}': 1
\t\t\t},
\t\t\turl: '{$ajaxUrl}',
\t\t\tonSuccess: function(responseText) {
\t\t\t\t\$('{$name}_response').set('html', '<input class="btn btn-default" disabled="true" type="button" value="'+responseText+'">');
\t\t\t}
\t\t});

\t\tmyRequest.send();
\t});
});
AJAX;
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration($ajaxCode);
        $link = '<div id="' . $name . '_response" ><input class="btn btn-default" id="' . $name . '" type="button" value="按此覆蓋"></div>';
        return $link;
    }
 protected function getLabel()
 {
     if (JPluginHelper::isEnabled('system', 'wow')) {
         return parent::getLabel();
     }
     return '';
 }
Example #4
0
 function onAfterRoute()
 {
     JHtml::_('jquery.framework');
     if (class_exists('SRHtml')) {
         SRHtml::_('js.noconflict');
         SRHtml::_('jquery.ui');
         SRHtml::_('js.site');
         SRHtml::_('js.admin');
         SRHtml::_('jquery.cookie');
         SRHtml::_('jquery.validate');
     }
     if (JPluginHelper::isEnabled('solidres', 'statistics')) {
         define('SR_PLUGIN_STATISTICS_ENABLED', true);
         if (JFactory::getApplication()->isAdmin()) {
             $lang = JFactory::getLanguage();
             $lang->load('plg_solidres_statistics', JPATH_ADMINISTRATOR, null, 1);
             SRHtml::_('js.statistics');
         }
     } else {
         define('SR_PLUGIN_STATISTICS_ENABLED', false);
     }
     if (JPluginHelper::isEnabled('solidres', 'feedback')) {
         define('SR_PLUGIN_FEEDBACK_ENABLED', true);
     } else {
         define('SR_PLUGIN_FEEDBACK_ENABLED', false);
     }
     if (JPluginHelper::isEnabled('solidres', 'paypal_expresscheckout')) {
         define('SR_PLUGIN_PAYPAL_EXPRESSCHECKOUT_ENABLED', true);
     } else {
         define('SR_PLUGIN_PAYPAL_EXPRESSCHECKOUT_ENABLED', false);
     }
 }
Example #5
0
    /**
     * Method to get the field input markup.
     *
     * @return	string	The field input markup.
     * @since	1.6
     */
    protected function getInput()
    {
        $plugin = JPluginHelper::isEnabled('system', 'asikart_easyset');
        if (!$plugin) {
            return print_r($plugin, 1) . '需要先啟動外掛!';
        }
        $name = str_replace('jform_params_', '', $this->id);
        $ajaxUrl = JURI::root() . 'index.php?cmd=ajax.overlay.' . $name;
        $ajaxCode = <<<AJAX
\t\twindow.addEvent('domready', function() {
\t\t\t
\t\t\t\$('{$name}').addEvent('click', function(e) {
\t\t\t\tvar myRequest = new Request({
\t\t\t\t\tmethod: 'get' ,
\t\t\t\t    url: '{$ajaxUrl}',
\t\t\t\t    onSuccess: function(responseText){
\t\t\t\t        \$('{$name}_response').set('html', '<input disabled="true" value="'+responseText+'">');
\t\t\t\t    }
\t\t\t\t});
\t\t\t 
\t\t\t\tmyRequest.send();
\t\t\t});\t
\t\t});
\t\t
AJAX;
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration($ajaxCode);
        $link = '<div id="' . $name . '_response" ><input id="' . $name . '" type="button" value="按此覆蓋"></div>';
        return $link;
    }
Example #6
0
 /**
  * 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;
 }
 public function onAfterInitialise()
 {
     $enabled = JPluginHelper::isEnabled('system', 'pfdemo') && $this->params->get('demo');
     // Do nothing if the plugin is disabled
     if (!$enabled) {
         return true;
     }
     // Set the demo constant
     if (!defined('PFDEMO')) {
         define('PFDEMO', 1);
     }
     $next_reset = $this->params->get('next_reset');
     $interval = (int) $this->params->get('interval') * 60;
     $reset = $this->params->get('reset');
     $next_time = (empty($next_reset) ? 0 : strtotime($next_reset)) + $interval;
     $now = JFactory::getDate()->toUnix();
     if (empty($next_reset)) {
         $this->setLastResetDate();
         return true;
     }
     if ($now >= $next_time && $reset) {
         $this->deleteAssets();
         $this->resetContent();
         $this->setLastResetDate();
     }
     return true;
 }
    function _getJoomla15Info(){
        $mainframe =& JFactory::getApplication();

        $this->jslib = 'mootools';

        $this->jslib_shortname= 'mt';

        $mootools_version = JFactory::getApplication()->get('MooToolsVersion', '1.11');
        if ($mootools_version != "1.11" || $mainframe->isAdmin()){
            $this->jslib_version = '1.2';
        }
        else {
            $this->jslib_version = '1.1';
        }

        // Create the JS checks for Joomla 1.5
        $this->_js_file_checks = array(
            '-'.$this->jslib.$this->jslib_version,
            '-'.$this->jslib_shortname.$this->jslib_version
        );
        if (JPluginHelper::isEnabled('system', 'mtupgrade')){
            $this->_js_file_checks[] = '-upgrade';
        }
        $this->_js_file_checks[] = '';
    }
Example #9
0
 public static function watch($type, $i, $state = 0, $options = array())
 {
     static $enabled = null;
     if (is_null($enabled)) {
         $enabled = JPluginHelper::isEnabled('content', 'pfnotifications');
     }
     if (!$enabled) {
         return '';
     }
     $html = array();
     $div_class = isset($options['div-class']) ? ' ' . $options['div-class'] : '';
     $a_class = isset($options['a-class']) ? ' ' . $options['a-class'] : '';
     $class = $state == 1 ? ' btn-success active' : '';
     $new_state = $state == 1 ? 0 : 1;
     $aid = 'watch-btn-' . $type . '-' . $i;
     $title = addslashes(JText::_('COM_PROJECTFORK_ACTION_WATCH_DESC'));
     $html[] = '<div class="btn-group' . $div_class . '">';
     $html[] = '<a id="' . $aid . '" rel="tooltip" class="btn hasTooltip' . $class . $a_class . '" title="' . $title . '" href="javascript:void(0);" ';
     $html[] = 'onclick="Projectfork.watchItem(' . $i . ', \'' . $type . '\')">';
     $html[] = '<span aria-hidden="true" class="icon-envelope"></span>';
     $html[] = '</a>';
     $html[] = '</div>';
     $html[] = '<div class="btn-group' . $div_class . '">';
     $html[] = '<input type="hidden" id="watch-' . $type . '-' . $i . '" value="' . (int) $state . '"/>';
     $html[] = '</div>';
     return implode('', $html);
 }
Example #10
0
 public function loadMootools()
 {
     if (KUNENA_JOOMLA_COMPAT == '1.5') {
         jimport('joomla.plugin.helper');
         $mtupgrade = JPluginHelper::isEnabled('system', 'mtupgrade');
         if (!$mtupgrade) {
             $app = JFactory::getApplication();
             if (!class_exists('JHTMLBehavior')) {
                 if (is_dir(JPATH_PLUGINS . '/system/mtupgrade')) {
                     JHTML::addIncludePath(JPATH_PLUGINS . '/system/mtupgrade');
                 } else {
                     // TODO: translate
                     KunenaError::warning('<em>System - MooTools Upgrade</em> plug-in is not installed into your system. Many features, including the BBCode editor, may be broken.', 'notice');
                 }
             }
         }
         JHTML::_('behavior.mootools');
         // Get the MooTools version string
         $mtversion = preg_replace('/[^\\d\\.]/', '', JFactory::getApplication()->get('MooToolsVersion'));
         if (version_compare($mtversion, '1.2.4', '<')) {
             // TODO: translate
             KunenaError::warning('Your site is not using <em>System - MooTools Upgrade</em> (or compatible) plug-in. Many features, including the BBCode editor, may be broken.');
         }
     } else {
         // Joomla 1.6+
         JHTML::_('behavior.framework', true);
     }
     if (KunenaFactory::getConfig()->debug) {
         // Debugging Mootools issues
         CKunenaTools::addScript(KUNENA_DIRECTURL . 'template/default/js/debug-min.js');
     }
 }
Example #11
0
 public static function getList(&$params)
 {
     // Get the dbo
     $db = JFactory::getDbo();
     // Get an instance of the generic tracks model
     $model = JModelLegacy::getInstance('Sections', 'PlayjoomModel', 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', 5));
     // Access filter
     $access = !JComponentHelper::getParams('com_playjoom')->get('show_noauth', 1);
     $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id'));
     $ordering = 'a.access_datetime';
     $dir = 'DESC';
     $model->setState('list.ordering', $ordering);
     $model->setState('list.direction', $dir);
     $items = $model->getItems();
     //create item link
     foreach ($items as &$item) {
         //Check for Trackcontrol
         if (JPluginHelper::isEnabled('playjoom', 'trackcontrol') == false) {
             $item->link = null;
         } else {
             $item->link = JRoute::_('index.php?option=com_playjoom&view=broadcast&id=' . $item->id);
         }
         $item->accessinfo = modLastPlayedHelper::GetTimeInfoList($item->access_datetime, $params, 'access');
     }
     return $items;
 }
Example #12
0
	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;
	}
Example #13
0
 public function getInput()
 {
     $published = JPluginHelper::isEnabled('system', 'jcompress');
     if (!$published) {
         return;
     }
     $assets_path = str_replace(JPATH_ROOT, rtrim(JURI::root(), "/"), dirname(__FILE__));
     $assets_path = str_replace('\\', '/', $assets_path);
     $document = JFactory::getDocument();
     $document->addStyleSheet($assets_path . '/css/stylesheet.css');
     if (intval(JVERSION) < 3) {
         $document->addScript('//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js');
     }
     $document->addScript($assets_path . '/src/jcompress.js');
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select("template FROM #__template_styles WHERE client_id =0 AND home = 1");
     $db->setQuery($query);
     $db->query();
     $template = $db->loadResult();
     $cache_folder = JPATH_ROOT . DIRECTORY_SEPARATOR . "cache" . DIRECTORY_SEPARATOR . "jcompress" . DIRECTORY_SEPARATOR . $template;
     $filescount_css = $this->getFilesCount($cache_folder . DIRECTORY_SEPARATOR . 'css', array('_css', '_log'));
     $filescount_js = $this->getFilesCount($cache_folder . DIRECTORY_SEPARATOR . 'js', array('_js', '_log'));
     $filescount_all = $filescount_css + $filescount_js;
     $output = '<div class="clearcache">';
     $output .= '<a id="clearall" class="clearcache_button" href="#"> ' . JText::_('PLG_JCOMPRESS_CLEAR') . ' ' . JText::_('PLG_JCOMPRESS_CACHE') . ' <span class="filescount">' . $filescount_all . '</span></a>';
     $output .= '<a id="clearcss" class="clearcache_button" href="#"> ' . JText::_('PLG_JCOMPRESS_CLEAR') . ' CSS ' . JText::_('PLG_JCOMPRESS_CACHE') . ' <span class="filesount_css">' . $filescount_css . '</span></a>';
     $output .= '<a id="clearjs" class="clearcache_button" href="#"> ' . JText::_('PLG_JCOMPRESS_CLEAR') . ' JS ' . JText::_('PLG_JCOMPRESS_CACHE') . ' <span class="filesount_js">' . $filescount_js . '</span></a>';
     $output .= '<a id="scanpages" class="clearcache_button" href="#"> ' . JText::_('PLG_JCOMPRESS_SCAN_PAGES') . ' </a>';
     $output .= '<input type="hidden" name="compress_ajax_path" id="compress_ajax_path" value="' . $assets_path . '" />';
     $output .= '<div class="ajaxresponse" data-scannning="' . JText::_('PLG_JCOMPRESS_SCANNING') . '" data-resetting="' . JText::_('PLG_JCOMPRESS_RESETTING') . '"></div>';
     $output .= '</div>';
     return $output;
 }
Example #14
0
 function display($tpl = null)
 {
     wfimport('admin.models.updates');
     $mainframe = JFactory::getApplication();
     $model = $this->getModel();
     $version = $model->getVersion();
     $component = WFExtensionHelper::getComponent();
     // get params definitions
     $params = new WFParameter($component->params, '', 'preferences');
     $canUpdate = WFModelUpdates::canUpdate() && WFModel::authorize('installer');
     $options = array('feed' => (int) $params->get('feed', 0), 'updates' => (int) $params->get('updates', $canUpdate ? 1 : 0), 'labels' => array('feed' => WFText::_('WF_CPANEL_FEED_LOAD'), 'updates' => WFText::_('WF_UPDATES'), 'updates_available' => WFText::_('WF_UPDATES_AVAILABLE')));
     JHtml::_('behavior.modal');
     $this->addScript('components/com_jce/media/js/cpanel.js');
     $this->addScriptDeclaration('jQuery.jce.Cpanel.options = ' . json_encode($options) . ';');
     // load styles
     $this->addStyleSheet(JURI::root(true) . '/administrator/components/com_jce/media/css/cpanel.css');
     if (WFModel::authorize('preferences')) {
         WFToolbarHelper::preferences();
     }
     if (WFModel::authorize('installer')) {
         WFToolbarHelper::updates($canUpdate);
     }
     WFToolbarHelper::help('cpanel.about');
     $views = array('config', 'profiles', 'installer', 'browser', 'mediabox');
     $icons = array();
     foreach ($views as $view) {
         // check if its allowed...
         if (WFModel::authorize($view) === false) {
             continue;
         }
         $attribs = array('target="_self"');
         $title = 'WF_' . strtoupper($view);
         $description = 'WF_' . strtoupper($view) . '_DESC';
         $link = 'index.php?option=com_jce&amp;view=' . $view;
         if ($view == 'browser') {
             $link = WFModel::getBrowserLink();
             $component = WFExtensionHelper::getComponent();
             // get params definitions
             $params = new WFParameter($component->params, '', 'preferences');
             $width = (int) $params->get('browser_width', 790);
             $height = (int) $params->get('browser_height', 560);
             if (empty($link)) {
                 continue;
             }
             $attribs = array('target="_blank"', 'class="browser"', 'onclick="Joomla.modal(this, \'' . $link . '\', ' . $width . ', ' . $height . ');return false;"');
             $title = 'WF_' . strtoupper($view) . '_TITLE';
             $description = 'WF_CPANEL_' . strtoupper($view);
         }
         // if its mediabox, check the plugin is installed and enabled
         if ($view == 'mediabox' && !JPluginHelper::isEnabled('system', 'jcemediabox')) {
             continue;
         }
         $icons[] = '<li class="cpanel-icon wf-tooltip" title="' . WFText::_($title) . '::' . WFText::_($description) . '"><a id="wf-browser-link" href="' . $link . '"' . implode(' ', $attribs) . '><span class="' . $view . '"></span>' . WFText::_($title) . '</a></li>';
     }
     $this->assign('icons', $icons);
     $this->assign('model', $model);
     $this->assign('params', $params);
     $this->assign('version', $version);
     parent::display($tpl);
 }
Example #15
0
 public function comments()
 {
     $this->setHeading('COM_EASYBLOG_TITLE_SETTINGS_COMMENTS', '', 'fa-comments-o');
     //check if jomcomment installed.
     $jcInstalled = false;
     if (file_exists(JPATH_ROOT . '/administrator/components/com_jomcomment/config.jomcomment.php')) {
         $jcInstalled = true;
     }
     //check if jcomments installed.
     $jComment = false;
     $jCommentFile = JPATH_ROOT . '/components/com_jcomments/jcomments.php';
     if (JFile::exists($jCommentFile)) {
         $jComment = true;
     }
     //check if rscomments installed.
     $rsComment = false;
     $rsCommentFile = JPATH_ROOT . '/components/com_rscomments/rscomments.php';
     if (JFile::exists($rsCommentFile)) {
         $rsComment = true;
     }
     // @task: Check if easydiscuss plugin is installed and enabled.
     $easydiscuss = JPluginHelper::isEnabled('content', 'easydiscuss');
     $komento = JPluginHelper::isEnabled('content', 'komento');
     $this->set('easydiscuss', $easydiscuss);
     $this->set('komento', $komento);
     $this->set('jcInstalled', $jcInstalled);
     $this->set('jComment', $jComment);
     $this->set('rsComment', $rsComment);
     $this->set('namespace', 'settings/comments/default');
     parent::display('settings/form');
 }
Example #16
0
 protected function getInput()
 {
     if (version_compare(JVERSION, '3.0.0') == -1) {
         $app = JFactory::getApplication();
         $doc = JFactory::getDocument();
         if (version_compare(PHP_VERSION, '5.2.4') == -1) {
             $app->enqueueMessage(JText::sprintf('MOD_PWEBCONTACT_CONFIG_MSG_PHP_VERSION', '5.2.4'), 'error');
         }
         // jQuery and Bootstrap in Joomla 2.5
         if (!class_exists('JHtmlJquery')) {
             $error = null;
             if (!is_file(JPATH_PLUGINS . '/system/pwebj3ui/pwebj3ui.php')) {
                 $error = JText::sprintf('MOD_PWEBCONTACT_CONFIG_INSTALL_PWEBLEGACY', '<a href="http://www.perfect-web.co/blog/joomla/62-jquery-bootstrap-in-joomla-25" target="_blank">', '</a>');
             } elseif (!JPluginHelper::isEnabled('system', 'pwebj3ui')) {
                 $error = JText::sprintf('MOD_PWEBCONTACT_CONFIG_ENABLE_PWEBLEGACY', '<a href="index.php?option=com_plugins&amp;view=plugins&amp;filter_search=' . urlencode('Perfect Joomla! 3 User Interface') . '" target="_blank">', '</a>');
             } else {
                 JLoader::import('cms.html.jquery', JPATH_PLUGINS . DIRECTORY_SEPARATOR . 'system' . DIRECTORY_SEPARATOR . 'pwebj3ui' . DIRECTORY_SEPARATOR . 'libraries');
             }
             if ($error) {
                 $app->enqueueMessage($error, 'error');
                 $doc->addScriptDeclaration('window.addEvent("domready", function(){' . 'new Element("div", {class: "pweb-fields-tip", html: \'<span class="badge badge-important">' . $error . '</span>\'}).inject(document.id("jform_params_fields"),"top");' . '});');
             }
         }
         $doc->addStyleSheet(JUri::root(true) . '/media/mod_pwebcontact/css/admin_j25.css');
     }
     return null;
 }
Example #17
0
 public function html(EasyBlogPost &$blog)
 {
     // Determines if the comment plugin is enabled
     $enabled = JPluginHelper::isEnabled('content', 'easydiscuss');
     if (!$enabled) {
         return;
     }
     // Determines if EasyDiscuss exists
     if (!EB::easydiscuss()->exists()) {
         return;
     }
     $articleParams = new stdClass();
     $this->app = JFactory::getApplication();
     $result = $this->app->triggerEvent('onDisplayComments', array(&$blog, &$articleParams));
     if (isset($result[0]) || isset($result[1])) {
         // There could be komento running on the site
         if (isset($result[1]) && $result[1]) {
             $output = $result[1];
         } else {
             $output = $result[0];
         }
         return $output;
     }
     return;
 }
Example #18
0
 public function checkLanguagePlugins()
 {
     // Check that the language filter plugin is disabled
     if (JPluginHelper::isEnabled('system', 'languagefilter')) {
         JError::raiseWarning(0, JText::sprintf('COM_SEF_WARNING_LANGUAGEFILTER_ENABLED', '<a href="index.php?option=com_plugins&amp;filter_folder=system">' . JText::_('COM_SEF_PLUG_IN_MANAGER') . '</a>'));
     }
 }
Example #19
0
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     $this->assignRef('user', JFactory::getUser());
     $login_option = RSTicketsProHelper::isJ16() ? 'com_users' : 'com_user';
     $Itemid = JRequest::getInt('Itemid');
     $return = base64_encode(RSTicketsProHelper::route('index.php?option=com_rsticketspro&view=dashboard' . ($Itemid ? '&Itemid=' . $Itemid : ''), false));
     $login_link = JRoute::_('index.php?option=' . $login_option . '&view=login' . ($Itemid ? '&Itemid=' . $Itemid : '') . '&return=' . $return);
     $this->assignRef('login_link', $login_link);
     $this->assignRef('categories', $this->get('categories'));
     $this->assignRef('tickets', $this->get('tickets'));
     $params = $mainframe->getParams('com_rsticketspro');
     $this->assignRef('params', $params);
     JHTML::_('behavior.mootools');
     $doc =& JFactory::getDocument();
     if (RSTicketsProHelper::isJ16() || JPluginHelper::isEnabled('system', 'mtupgrade')) {
         $doc->addScript(JURI::root(true) . '/components/com_rsticketspro/assets/js/more.js');
     }
     if (RSTicketsProHelper::isJ16()) {
         // Description
         if ($params->get('menu-meta_description')) {
             $this->document->setDescription($params->get('menu-meta_description'));
         }
         // Keywords
         if ($params->get('menu-meta_keywords')) {
             $this->document->setMetadata('keywords', $params->get('menu-meta_keywords'));
         }
         // Robots
         if ($params->get('robots')) {
             $this->document->setMetadata('robots', $params->get('robots'));
         }
     }
     parent::display($tpl);
 }
Example #20
0
 /**
  * Render uploaded image
  *
  * @param   object  &$model   Element model
  * @param   object  &$params  Element params
  * @param   string  $file     Row data for this element
  * @param   object  $thisRow  All row's data
  *
  * @return  void
  */
 public function render(&$model, &$params, $file, $thisRow = null)
 {
     $src = str_replace("\\", "/", COM_FABRIK_LIVESITE . $file);
     $ext = JString::strtolower(JFile::getExt($file));
     if (!JPluginHelper::isEnabled('content', 'jw_allvideos')) {
         $this->output = JText::_('PLG_ELEMENT_FILEUPLOAD_INSTALL_ALL_VIDEOS');
         return;
     }
     $extra = array();
     $extra[] = $src;
     if ($this->inTableView || $params->get('fu_show_image') < 2) {
         $extra[] = $params->get('thumb_max_width');
         $extra[] = $params->get('thumb_max_height');
     } else {
         $extra[] = $params->get('fu_main_max_width');
         $extra[] = $params->get('fu_main_max_height');
     }
     $src = implode('|', $extra);
     switch ($ext) {
         case 'flv':
             $this->output = "{flvremote}{$src}{/flvremote}";
             break;
         case '3gp':
             $this->output = "{3gpremote}{$src}{/3gpremote}";
             break;
         case 'divx':
             $this->output = "{divxremote}{$src}{/divxremote}";
             break;
     }
 }
Example #21
0
 function display($tmp = null)
 {
     // Load assets
     JSNUniformHelper::addAssets();
     $lang = JFactory::getLanguage();
     $input = JFactory::getApplication()->input;
     $extensionId = $input->getInt('extension_id', 0);
     $model = $this->getModel();
     $extension = $model->getExtensionInfo($extensionId);
     if (!count($extension)) {
         $html = '<br/> <div class="alert alert-danger">' . JText::_('JSN_UNIFORM_EXTENSION_NOT_FOUND') . '</div>';
         echo $html;
         return;
     }
     $this->extension_name = (string) $extension->element;
     if (JPluginHelper::isEnabled('uniform', (string) $this->extension_name) !== true) {
         $html = '<br/> <div class="alert alert-danger">' . JText::sprintf('JSN_UNIFORM_PLUGIN_IS_NOT_EXISTED_OR_ENABLED', strtoupper(str_replace('_', ' ', (string) $this->extension_name))) . '</div>';
         echo $html;
         return;
     }
     parent::display($tmp);
     // Load assets
     JSNUniformHelper::addAssets();
     $this->addAssets();
 }
 /**
  * "onContentAfterSave" event handler
  *
  * @param     string     $context    The item context
  * @param     object     $table      The item table object
  * @param     boolean    $is_new     New item indicator (True is new, False is update)
  *
  * @return    boolean                True
  */
 public function onContentAfterSave($context, $table, $is_new = false)
 {
     // Do nothing if the plugin is disabled
     if (!JPluginHelper::isEnabled('content', 'pfprojects')) {
         return true;
     }
     // Check if the context is supported
     if (!in_array($context, $this->contexts)) {
         return true;
     }
     // Do nothing if this is a new project
     if ($is_new) {
         $app = JFactory::getApplication();
         $context = $app->isAdmin() ? "com_pfprojects.copy.project.id" : "com_pfprojects.copy.form.id";
         $copy_id = (int) $app->getUserState($context);
         if (!$copy_id) {
             return true;
         }
         $app->setUserState($context, 0);
         $old_table = JTable::getInstance('Project', 'PFtable');
         if (!$old_table->load($copy_id)) {
             return true;
         }
         $this->copyContent($old_table, $table);
         return true;
     }
     $start_changed = $table->start_date != $this->prev_start;
     $end_changed = $table->end_date != $this->prev_end;
     // Update start and end dates on milestones and tasks
     if ($start_changed || $end_changed) {
         $this->updateTimeline($table->id, $table->start_date, $table->end_date);
     }
     return true;
 }
Example #23
0
 /**
  * Detect is this page are frontpage?
  *
  * @return  boolean Is frontpage?
  */
 public static function isHome()
 {
     $langPath = null;
     $tag = null;
     $lang = \JFactory::getLanguage();
     // For multi language
     if (\JPluginHelper::isEnabled('system', 'languagefilter')) {
         $tag = $lang->getTag();
         $langCodes = \JLanguageHelper::getLanguages('lang_code');
         $langPath = $langCodes[$tag]->sef;
     }
     $uri = \JUri::getInstance();
     $root = $uri::root(true);
     // Get site route
     $route = StringHelper::substr($uri->getPath(), StringHelper::strlen($root));
     // Remove index.php
     $route = str_replace('index.php', '', $route);
     // If Multiple language enabled, we check first part of URI is language code or not.
     if ($langPath) {
         $params = ExtensionHelper::getParams('plg_system_languagefilter');
         if ($tag == $lang->getDefault() && $params->get('remove_default_prefix', 0)) {
             $langPath = '';
         }
         // If route equals lang path, means it is home route.
         if (trim($route, '/') == $langPath && !$uri->getVar('option')) {
             return true;
         }
     } else {
         if (!trim($route, '/') && !$uri->getVar('option')) {
             return true;
         }
     }
     return false;
 }
Example #24
0
 public function preflight($type, $installer)
 {
     global $installer_manifest, $installer_source;
     $return = true;
     $errors = array();
     if (!class_exists('Koowa') || !class_exists('ComExtmanDatabaseRowExtension')) {
         if (file_exists(JPATH_ADMINISTRATOR . '/components/com_extman/extman.php') && !JPluginHelper::isEnabled('system', 'koowa')) {
             $link = version_compare(JVERSION, '1.6.0', '>=') ? '&view=plugins&filter_folder=system' : '&filter_type=system';
             $errors[] = sprintf(JText::_('This component requires System - Joomlatools Framework plugin to be installed and enabled. Please go to <a href=%s>Plugin Manager</a>, enable <strong>System - Joomlatools Framework</strong> and try again'), JRoute::_('index.php?option=com_plugins' . $link));
         } else {
             $errors[] = JText::_('This component requires EXTman to be installed on your site. Please download this component from <a href=http://joomlatools.com target=_blank>joomlatools.com</a> and install it');
         }
         $return = false;
     }
     // Check EXTman version.
     if ($return === true) {
         if (version_compare($this->getExtmanVersion(), '1.0.0RC5', '<')) {
             $errors[] = sprintf(JText::_('This component requires a newer EXTman version. Please upgrade it first and try again.'));
             $return = false;
         }
     }
     if ($return == true && $type == 'update') {
         if ($current = $this->getCurrentVersion()) {
             require_once JPATH_ADMINISTRATOR . '/components/com_extman/install/helper.php';
             $helper = new ComExtmanInstallerHelper();
             if ($failed = $helper->checkDatabasePrivileges(array('ALTER'))) {
                 $errors[] = JText::sprintf('The following MySQL privileges are missing: %s. Please make them available to your MySQL user and try again.', htmlspecialchars(implode(', ', $failed), ENT_QUOTES));
                 $return = false;
             } elseif ($failed = $this->_dbUpdate(array('from_ver' => $current))) {
                 $errors[] = JText::_('DB schema update failed while processing queries:');
                 foreach ($failed as $query) {
                     $errors[] = htmlspecialchars($query, ENT_QUOTES);
                 }
                 $return = false;
             }
             // Old system plugin needs to be un-installed.
             if (version_compare($current, '1.0.0RC4', '<')) {
                 $extension = KService::get('com://admin/extman.model.extension')->identifier('plg:system.logman')->getItem();
                 if (!$extension->isNew()) {
                     $extension->delete();
                 }
             }
         } else {
             $errors[] = JText::_('Update failed. Unable to determine previous installed version of LOGman.');
             $return = false;
         }
     }
     // J1.5 does not remove menu items on unsuccessful installs
     if ($return === false && $type !== 'update' && version_compare(JVERSION, '1.6', '<')) {
         $db = JFactory::getDBO();
         $db->setQuery(sprintf("DELETE FROM #__components WHERE `option` = 'com_%s'", $this->component));
         $db->query();
     }
     if ($return == false && $errors) {
         $error = implode('<br />', $errors);
         JError::raiseWarning(null, $error);
     }
     return $return;
 }
Example #25
0
 public function isEnabled()
 {
     $jce = WFEditorPlugin::getInstance();
     if (JPluginHelper::isEnabled('system', 'jcemediabox') && $jce->getParam('popups.jcemediabox.enable', 1) == 1) {
         return true;
     }
     return false;
 }
 function isEnabled()
 {
     $wf = WFEditorPlugin::getInstance();
     if (JPluginHelper::isEnabled('system', 'rokbox') && $wf->getParam('popups.rokbox.enable', 1) == 1) {
         return true;
     }
     return false;
 }
Example #27
0
	function isEnabled(){
		if (version_compare(JVERSION, '1.5', '>=') && version_compare(JVERSION, '1.6', '<')){
            if (JPluginHelper::isEnabled('system', 'mtupgrade')) return true;
			else return false;
		} else {
			return false;
		}
	}
Example #28
0
 public function isEnabled()
 {
     $wf = WFEditorPlugin::getInstance();
     if (JPluginHelper::isEnabled('system', 'widgetkit_system') && $wf->getParam('popups.widgetkit.enable', 1) == 1) {
         return true;
     }
     return false;
 }
 protected function testPatch($component)
 {
     if (JFile::exists(JPATH_ROOT . '/plugins/system/' . $component . '/' . $component . '.php') && JPluginHelper::isEnabled('system', $component)) {
         $this->element['icon'] = 'accept.png';
         return JText::_('PLG_SLIDESHOWCKHIKASHOP_SPACER_' . strtoupper($component) . '_PATCH_INSTALLED');
     }
     return false;
 }
Example #30
0
 public static function getLanguage()
 {
     if (JPluginHelper::isEnabled('system', 'koowa') && method_exists(JFactory::getLanguage(), 'getObject')) {
         return JFactory::getLanguage()->getObject()->get('tag');
     } else {
         return JFactory::getLanguage()->get('tag');
     }
 }