本文整理汇总了PHP中JPluginHelper::isEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP JPluginHelper::isEnabled方法的具体用法?PHP JPluginHelper::isEnabled怎么用?PHP JPluginHelper::isEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPluginHelper
的用法示例。
在下文中一共展示了JPluginHelper::isEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterRoute
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);
}
}
示例2: checkDebugPluginDisabled
/**
* 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;
}
示例3: onAfterInitialise
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;
}
示例4: display
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();
}
示例5: getList
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;
}
示例6: getInput
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;
}
示例7: comments
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');
}
示例8: getLabel
protected function getLabel()
{
if (JPluginHelper::isEnabled('system', 'wow')) {
return parent::getLabel();
}
return '';
}
示例9: getInput
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&view=plugins&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;
}
示例10: display
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&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);
}
示例11: _getJoomla15Info
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[] = '';
}
示例12: watch
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);
}
示例13: render
/**
* 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;
}
}
示例14: loadMootools
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');
}
}
示例15: verify
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;
}