本文整理汇总了PHP中JComponentHelper::isEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP JComponentHelper::isEnabled方法的具体用法?PHP JComponentHelper::isEnabled怎么用?PHP JComponentHelper::isEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JComponentHelper
的用法示例。
在下文中一共展示了JComponentHelper::isEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enabled
public static function enabled() {
if (!JComponentHelper::isEnabled ( 'com_kunena', true )) {
return false;
}
$config = KunenaFactory::getConfig ();
return !$config->board_offline;
}
示例2: __construct
public function __construct()
{
self::$enabled = JComponentHelper::isEnabled('com_jevents');
if (self::$enabled) {
require_once JPATH_SITE . '/components/com_jevents/jevents.defines.php';
}
}
示例3: index
protected function index(FinderIndexerResult $item, $format = 'html')
{
// Check if the extension is enabled
if (JComponentHelper::isEnabled($this->extension) == false) {
return;
}
$item->body = FinderIndexerHelper::prepareContent($item->getElement('body'));
$item->summary = FinderIndexerHelper::prepareContent($item->getElement('body'));
$item->addTaxonomy('Type', 'FSF_FINDER_GLOSSARY');
$word = $item->title;
$anchor = strtolower(preg_replace("/[^A-Za-z0-9]/", '-', $word));
$letter = strtolower(substr($word, 0, 1));
$item->url = 'index.php?option=com_fsf&view=glossary&letter=' . $letter . '#' . $anchor;
$item->route = $item->url;
$item->state = $item->published;
$item->access = 1;
// Get content extras.
FinderIndexerHelper::getContentExtras($item);
// Index the item.
if (FSFJ3Helper::IsJ3()) {
$this->indexer->index($item);
} else {
FinderIndexer::index($item);
}
}
示例4: cutText
function cutText($text, $limit_value, $limit_type, $at_end)
{
// solved problem from: https://www.gavick.com/support/forums/47/12309.html?p=57464#p57464
$cck_path = JPATH_BASE . DS . 'components' . DS . 'com_cck';
if (file_exists($cck_path)) {
if (JComponentHelper::isEnabled('com_cck', true)) {
// Force parsing plugin if SEBLOD is used
if ($this->config['parse_plugins'] == FALSE) {
$text = JHtml::_('content.prepare', $text);
}
$text = trim(substr(strip_tags($text, "<br /><br><strong></strong><p></p><i></i><b></b><span></span><ul></ul><li></li><blockquote></blockquote>"), 0));
}
}
if ($limit_type == 'words' && $limit_value > 0) {
$temp = explode(' ', $text);
if (count($temp) > $limit_value) {
for ($i = 0; $i < $limit_value; $i++) {
$cutted[$i] = $temp[$i];
}
$cutted = implode(' ', $cutted);
$text = $cutted . $at_end;
}
} elseif ($limit_type == 'words' && $limit_value == 0) {
return '';
} else {
if (JString::strlen($text) > $limit_value) {
$text = JString::substr($text, 0, $limit_value) . $at_end;
}
}
// replace unnecessary entities at end of the cutted text
$toReplace = array('&&', '&a&', '&am&', '&&', '&q&', '&qu&', '&quo&', '"&', '&ap&', '&apo&', '&apos&');
$text = str_replace($toReplace, '&', $text);
//
return $text;
}
示例5: onBeforeCompileHead
/**
* Include a script that initialize vote buttons.
*
* @return void
*/
public function onBeforeCompileHead()
{
$app = JFactory::getApplication();
/** @var $app JApplicationSite */
if ($app->isAdmin()) {
return;
}
$document = JFactory::getDocument();
/** @var $document JDocumentHTML */
$type = $document->getType();
if (strcmp("html", $type) != 0) {
return;
}
// Check component enabled
if (!JComponentHelper::isEnabled('com_userideas', true)) {
return;
}
// Check for right extension.
$option = $app->input->get("option");
if (strcmp("com_userideas", $option) != 0) {
return null;
}
// Check for view. The extensions will work only on view "items"
$allowedViews = array("items", "details", "category");
$view = $app->input->getCmd("view");
if (!in_array($view, $allowedViews)) {
return;
}
jimport("itprism.init");
JHtml::_('itprism.ui.joomla_helper');
$document->addScript('plugins/system/userideasvote/votebutton.js');
}
示例6: __construct
function __construct(& $subject, $config) {
// Check if Kunena API exists
$api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
if (! is_file ( $api ))
return false;
jimport ( 'joomla.application.component.helper' );
// Check if Kunena component is installed/enabled
if (! JComponentHelper::isEnabled ( 'com_kunena', true )) {
return false;
}
// Load Kunena API
require_once $api;
// Fix Joomla 1.5 bugs and bad performance
$version = new JVersion();
if ($version->RELEASE == '1.5') {
$lang = JFactory::getLanguage();
if (JFactory::getApplication()->isAdmin()) {
$lang->load('com_kunena.menu', JPATH_ADMINISTRATOR);
} else {
$filename = JLanguage::getLanguagePath( JPATH_BASE, $lang->_lang)."/{$lang->_lang}.com_kunena.ini";
$lang->_paths['com_kunena'][$filename] = 1;
}
}
parent::__construct ( $subject, $config );
}
示例7: __construct
/**
* @param object $subject
* @param array $config
*/
function __construct(&$subject, $config)
{
// Check if Kunena API exists
$api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php';
if (!is_file ($api))
{
return;
}
jimport ( 'joomla.application.component.helper' );
// Check if Kunena component is installed/enabled
if (!JComponentHelper::isEnabled ( 'com_kunena', true ))
{
return;
}
// Load Kunena API
require_once $api;
// Do not load if Kunena version is not supported or Kunena is not installed
if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('4.0') && KunenaForum::installed()))
{
return;
}
parent::__construct ( $subject, $config );
// ! Always load language after parent::construct else the name of plugin isn't yet set
$this->loadLanguage('plg_system_kunena.sys');
}
示例8: onAfterInitialise
/**
* onAfterInitialise handler
*
* Adds ZOO event listeners
*
* @access public
* @return null
*/
public function onAfterInitialise()
{
// Make sure ZOO exists
jimport('joomla.filesystem.file');
if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_zoo/config.php')) {
return;
}
// load ZOO config
if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_zoo/config.php')) {
if (!JComponentHelper::isEnabled('com_zoo', true)) {
return;
}
}
require_once JPATH_ADMINISTRATOR . '/components/com_zoo/config.php';
// make sure App class exists
if (!class_exists('App')) {
return;
}
// Get the ZOO App instance
$zoo = App::getInstance('zoo');
$zoo->path->register(JPATH_SITE . '/plugins/system/qtc_zoo/qtc_zoo/', 'fields');
$zoo->event->register('plgSystemQtc_zoo');
$zoo->event->dispatcher->connect('application:configparams', array('plgSystemQtc_zoo', 'configParams'));
$zoo->event->register('ItemEvent');
$zoo->event->dispatcher->connect('item:init', array('plgSystemQtc_zoo', 'init'));
$zoo->event->dispatcher->connect('item:saved', array('plgSystemQtc_zoo', 'saved'));
}
示例9: __construct
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config = array());
$easyblog = JPATH_ROOT . '/administrator/components/com_easyblog/easyblog.php';
if (!JFile::exists($easyblog) || !JComponentHelper::isEnabled('com_easysocial', true)) {
ApiError::raiseError(404, 'Easyblog not installed');
return;
}
// Load Easyblog language & bootstrap files
$language = JFactory::getLanguage();
$language->load('com_easyblog');
require_once JPATH_ROOT . '/components/com_easyblog/constants.php';
require_once EBLOG_HELPERS . '/helper.php';
// Set resources & access
ApiResource::addIncludePath(dirname(__FILE__) . '/easyblog');
$this->setResourceAccess('latest', 'public', 'get');
$this->setResourceAccess('category', 'public', 'get');
$this->setResourceAccess('blog', 'public', 'get');
$this->setResourceAccess('blog', 'public', 'post');
$this->setResourceAccess('comments', 'public', 'get');
$this->setResourceAccess('easyblog_users', 'public', 'get');
$config = EasyBlogHelper::getConfig();
if ($config->get('main_allowguestcomment')) {
$this->setResourceAccess('comments', 'public', 'post');
}
}
示例10: onBeforeCompileHead
/**
* Include a script that initialize vote buttons.
*
* @return void
*/
public function onBeforeCompileHead()
{
$app = JFactory::getApplication();
/** @var $app JApplicationSite */
if ($app->isAdmin()) {
return;
}
$document = JFactory::getDocument();
/** @var $document JDocumentHTML */
$type = $document->getType();
if (strcmp('html', $type) !== 0) {
return;
}
// Check component enabled
if (!JComponentHelper::isEnabled('com_userideas')) {
return;
}
// Check for right extension.
$option = $app->input->get('option');
if (strcmp('com_userideas', $option) !== 0) {
return null;
}
// Check for view. The extensions will work only on view 'items'
$allowedViews = array('items', 'details', 'category');
$view = $app->input->getCmd('view');
if (!in_array($view, $allowedViews, true)) {
return;
}
JHtml::_('Prism.ui.joomlaHelper');
JHtml::_('Userideas.loadVoteScript');
}
示例11: onAfterDispatch
public function onAfterDispatch()
{
$app = JFactory::getApplication();
/** @var $app JApplicationSite */
if ($app->isAdmin()) {
return;
}
$document = JFactory::getDocument();
/** @var $document JDocumentHtml */
$type = $document->getType();
if (strcmp("html", $type) != 0) {
return;
}
// It works only for GET and POST requests.
$method = JString::strtolower($app->input->getMethod());
if (!in_array($method, array("get", "post"))) {
return;
}
// Check component enabled
if (!JComponentHelper::isEnabled('com_crowdfunding', true)) {
return;
}
$view = $app->input->getCmd("view");
$option = $app->input->getCmd("option");
$isCrowdfundingComponent = strcmp($option, "com_crowdfunding") == 0;
$isDetailsPage = (strcmp($option, "com_crowdfunding") == 0 and strcmp($view, "details") == 0);
// Allowed views for the module Crowdfunding Details
$allowedViewsModuleDetails = array("backing", "embed", "report");
$allowedViewsModuleFilters = array("discover", "category");
// Hide some modules if it is not details page.
if (!$isDetailsPage) {
$this->hideModule("mod_crowdfundinginfo");
$this->hideModule("mod_crowdfundingprofile");
$this->hideModule("mod_crowdfundingreporting");
}
// Module Crowdfunding Rewards (mod_crowdfundingrewards).
if (!$isDetailsPage) {
$this->hideModule("mod_crowdfundingrewards");
} else {
// Check project type. If the rewards are disable, hide the module.
$projectId = $app->input->getInt("id");
if (!empty($projectId)) {
$project = Crowdfunding\Project::getInstance(JFactory::getDbo(), $projectId);
$type = $project->getType();
// Hide the module Crowdfunding Rewards, if rewards are disabled for this type.
if (!is_null($type) and !$type->isRewardsEnabled()) {
$this->hideModule("mod_crowdfundingrewards");
}
}
}
// Module Crowdfunding Details (mod_crowdfundingdetails) on backing and embed pages.
if (!$isCrowdfundingComponent or strcmp($option, "com_crowdfunding") == 0 and !in_array($view, $allowedViewsModuleDetails)) {
$this->hideModule("mod_crowdfundingdetails");
}
// Module Crowdfunding Filters (mod_crowdfundingfilters).
if (!$isCrowdfundingComponent or strcmp($option, "com_crowdfunding") == 0 and !in_array($view, $allowedViewsModuleFilters)) {
$this->hideModule("mod_crowdfundingfilters");
}
}
示例12: onAfterDispatch
public function onAfterDispatch()
{
$app = JFactory::getApplication();
/** @var $app JApplicationSite */
if ($app->isAdmin()) {
return;
}
$document = JFactory::getDocument();
/** @var $document JDocumentHtml */
$type = $document->getType();
if (strcmp('html', $type) !== 0) {
return;
}
// It works only for GET and POST requests.
$method = strtolower($app->input->getMethod());
if (!in_array($method, array('get', 'post'), true)) {
return;
}
// Check component enabled
if (!JComponentHelper::isEnabled('com_crowdfunding')) {
return;
}
$view = $app->input->getCmd('view');
$option = $app->input->getCmd('option');
$isCrowdfundingComponent = strcmp($option, 'com_crowdfunding') === 0;
$isDetailsPage = (strcmp($option, 'com_crowdfunding') === 0 and strcmp($view, 'details') === 0);
// Allowed views for the module Crowdfunding Details
$allowedViewsModuleDetails = array('backing', 'embed', 'report', 'friendmail');
$allowedViewsModuleFilters = array('discover', 'category');
// Hide some modules if it is not details page.
if (!$isDetailsPage) {
$this->hideModule('mod_crowdfundinginfo');
$this->hideModule('mod_crowdfundingprofile');
$this->hideModule('mod_crowdfundingreporting');
}
// Module Crowdfunding Rewards (mod_crowdfundingrewards).
if (!$isDetailsPage) {
$this->hideModule('mod_crowdfundingrewards');
} else {
// Check project type. If the rewards are disable, hide the module.
$projectId = $app->input->getInt('id');
if ($projectId > 0 and !CrowdfundingHelper::isRewardsEnabled($projectId)) {
// Hide the module Crowdfunding Rewards, if rewards are disabled.
$this->hideModule('mod_crowdfundingrewards');
}
}
// Module Crowdfunding Details (mod_crowdfundingdetails) on backing and embed pages.
if (!$isCrowdfundingComponent or strcmp($option, 'com_crowdfunding') === 0 and !in_array($view, $allowedViewsModuleDetails, true)) {
$this->hideModule('mod_crowdfundingdetails');
}
// Module Crowdfunding Filters (mod_crowdfundingfilters).
if (!$isCrowdfundingComponent or strcmp($option, 'com_crowdfunding') === 0 and !in_array($view, $allowedViewsModuleFilters, true)) {
$this->hideModule('mod_crowdfundingfilters');
}
// Module Crowdfunding Filters (mod_crowdfundingsearch).
if (!$isCrowdfundingComponent or strcmp($option, 'com_crowdfunding') === 0 and !in_array($view, $allowedViewsModuleFilters, true)) {
$this->hideModule('mod_crowdfundingsearch');
}
}
示例13: checkComponent
/**
* Method to check whether a specific component is there
*
* @param string $component
* @return bool
*/
protected function checkComponent($component)
{
jimport('joomla.application.component.helper');
if (is_dir(JPATH_ADMINISTRATOR . '/components/' . $component) && JComponentHelper::isEnabled($component) == true) {
return true;
} else {
return false;
}
}
示例14: isEnabled
public function isEnabled()
{
jimport('joomla.application.component.helper');
if (is_dir(JPATH_ADMINISTRATOR . '/components/com_community') && JComponentHelper::isEnabled('com_community') == true) {
return true;
} else {
return false;
}
}
示例15: getUsers
public function getUsers()
{
if (!JComponentHelper::isEnabled('com_kunena')) {
JFactory::getApplication()->enqueueMessage(JText::sprintf('PLG_SYSTEM_MEMBERMAP_SOURCE_NOT_ENABLED', 'Kunena'), 'error');
return false;
}
$db = JFactory::getDbo();
$query = $db->getQuery(true)->select('DISTINCT u.id')->from('#__kunena_users AS ku')->join('INNER', '#__users AS u ON(u.id = ku.userid)')->where('u.block = ' . $db->quote(0))->where('ku.location != ' . $db->quote(''));
if ($usergroups = $this->params->get('usergroup')) {
$query->join('INNER', '#__user_usergroup_map AS g ON(u.id = g.user_id)');
$query->where('g.group_id IN(' . implode(',', $usergroups) . ')');
}
switch ($this->params->get('order', 'name')) {
default:
case 'name':
$query->order('u.name');
break;
case 'username':
$query->order('u.username');
break;
case 'userid':
$query->order('u.id');
break;
case 'location':
$query->order('ku.location');
break;
case 'random':
$query->order('RAND()');
break;
}
$db->setQuery($query);
$members = $db->loadColumn();
if (empty($members)) {
return null;
}
$users = array();
foreach ($members as $key => &$member) {
$member = KunenaFactory::getUser($member);
$users[$key] = new stdClass();
$users[$key]->address = $member->location;
$users[$key]->requests = 0;
$users[$key]->ready = false;
if ($this->params->get('avatar', 1)) {
$users[$key]->avatar = $member->getAvatarURL();
if (!filter_var($users[$key]->avatar, FILTER_VALIDATE_URL)) {
$users[$key]->avatar = JUri::root() . $users[$key]->avatar;
}
}
$users[$key]->name = $member->getName();
$users[$key]->url = $member->getURL();
}
#domix($users, 1);
return $users;
}