当前位置: 首页>>代码示例>>PHP>>正文


PHP JFactory::getConfig方法代码示例

本文整理汇总了PHP中JFactory::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP JFactory::getConfig方法的具体用法?PHP JFactory::getConfig怎么用?PHP JFactory::getConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JFactory的用法示例。


在下文中一共展示了JFactory::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

	function __construct() {
		
		$app	= JFactory::getApplication();
		
		parent::__construct();
		
		$config = JFactory::getConfig();		
		
		$paramsC 			= JComponentHelper::getParams('com_phocadownload') ;
		$defaultPagination	= $paramsC->get( 'default_pagination', '20' );
		$file_ordering		= $paramsC->get( 'file_ordering', 1 );
		$context			= $this->_context.'.';
		
		// Get the pagination request variables
		$this->setState('limit', $app->getUserStateFromRequest($context.'limit', 'limit', $defaultPagination, 'int'));
		$this->setState('limitstart', $app->input->get('limitstart', 0, 'int'));

		// In case limit has been changed, adjust limitstart accordingly
		$this->setState('limitstart', ($this->getState('limit') != 0 ? (floor($this->getState('limitstart') / $this->getState('limit')) * $this->getState('limit')) : 0));
		
		$this->setState('filter.language',$app->getLanguageFilter());
		
		$this->setState('fileordering', $app->getUserStateFromRequest($context .'fileordering', 'fileordering', $file_ordering, 'int'));

		// Get the filter request variables
		$this->setState('filter_order', JRequest::getCmd('filter_order', 'ordering'));
		$this->setState('filter_order_dir', JRequest::getCmd('filter_order_Dir', 'ASC'));
		
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:29,代码来源:category.php

示例2: chosen

 /**
  * Method to load the Chosen JavaScript framework and supporting CSS into the document head
  *
  * If debugging mode is on an uncompressed version of Chosen is included for easier debugging.
  *
  * @param   string  $selector  Class for Chosen elements.
  * @param   mixed   $debug     Is debugging mode on? [optional]
  * @param   array   $options   the possible Chosen options as name => value [optional]
  *
  * @return  void
  *
  * @since   3.0
  */
 public static function chosen($selector = '.advancedSelect', $debug = null, $options = array())
 {
     if (isset(static::$loaded[__METHOD__][$selector])) {
         return;
     }
     // If no debugging value is set, use the configuration setting
     if ($debug === null) {
         $config = JFactory::getConfig();
         $debug = (bool) $config->get('debug');
     }
     // Default settings
     if (!isset($options['disable_search_threshold'])) {
         $options['disable_search_threshold'] = 10;
     }
     // Allow searching contains space in query
     if (!isset($options['search_contains'])) {
         $options['search_contains'] = true;
     }
     if (!isset($options['allow_single_deselect'])) {
         $options['allow_single_deselect'] = true;
     }
     if (!isset($options['placeholder_text_multiple'])) {
         $options['placeholder_text_multiple'] = JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS');
     }
     if (!isset($options['placeholder_text_single'])) {
         $options['placeholder_text_single'] = JText::_('JGLOBAL_SELECT_AN_OPTION');
     }
     if (!isset($options['no_results_text'])) {
         $options['no_results_text'] = JText::_('JGLOBAL_SELECT_NO_RESULTS_MATCH');
     }
     $displayData = array('debug' => $debug, 'options' => $options, 'selector' => $selector);
     JLayoutHelper::render('joomla.html.formbehavior.chosen', $displayData);
     static::$loaded[__METHOD__][$selector] = true;
     return;
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:48,代码来源:formbehavior.php

示例3: addEvForm

 function addEvForm()
 {
     $listid = JRequest::getInt('listid');
     $viewName = 'calendar';
     $usersConfig = JComponentHelper::getParams('com_fabrik');
     $model =& $this->getModel($viewName);
     $id = JRequest::getInt('visualizationid', $usersConfig->get('visualizationid', 0));
     $model->setId($id);
     $model->setupEvents();
     if (array_key_exists($listid, $model->_events)) {
         $datefield = $model->_events[$listid][0]['startdate'];
     } else {
         $config = JFactory::getConfig();
         $prefix = $config->getValue('config.dbprefix');
         $datefield = $prefix . 'fabrik_calendar_events___start_date';
     }
     $rowid = JRequest::getInt('rowid');
     $listModel = JModel::getInstance('list', 'FabrikFEModel');
     $listModel->setId($listid);
     $table = $listModel->getTable();
     JRequest::setVar('view', 'form');
     JRequest::setVar('formid', $table->form_id);
     JRequest::setVar('tmpl', 'component');
     JRequest::setVar('ajax', '1');
     $link = 'index.php?option=com_fabrik&view=form&formid=' . $table->form_id . '&rowid=' . $rowid . '&tmpl=component&ajax=1';
     $link .= '&jos_fabrik_calendar_events___visualization_id=' . JRequest::getInt('jos_fabrik_calendar_events___visualization_id');
     $start_date = JRequest::getVar('start_date', '');
     if (!empty($start_date)) {
         $link .= "&{$datefield}=" . $start_date;
     }
     // $$$ rob have to add this to stop the calendar filtering itself after adding an new event?
     $link .= '&clearfilters=1';
     $this->setRedirect($link);
 }
开发者ID:romuland,项目名称:khparts,代码行数:34,代码来源:calendar.php

示例4: sendMail

 /**
  * Send email whith user data from form
  *
  * @param   array  $params An object containing the module parameters
  *
  * @access public
  */
 public static function sendMail($params)
 {
     $sender = $params->get('sender');
     $recipient = $params->get('recipient');
     $subject = $params->get('subject');
     // Getting the site name
     $sitename = JFactory::getApplication()->get('sitename');
     // Getting user form data-------------------------------------------------
     $name = JFilterInput::getInstance()->clean(JRequest::getVar('name'));
     $phone = JFilterInput::getInstance()->clean(JRequest::getVar('phone'));
     $email = JFilterInput::getInstance()->clean(JRequest::getVar('email'));
     $message = JFilterInput::getInstance()->clean(JRequest::getVar('message'));
     // Set the massage body vars
     $nameLabel = JText::_('MOD_JCALLBACK_FORM_NAME_LABEL_VALUE');
     $phoneLabel = JText::_('MOD_JCALLBACK_FORM_PHONE_LABEL_VALUE');
     $emailLabel = JText::_('MOD_JCALLBACK_FORM_EMAIL_LABEL_VALUE');
     $messageLabel = JText::_('MOD_JCALLBACK_FORM_MESSAGE_LABEL_VALUE');
     $emailLabel = $email ? "<b>{$emailLabel}:</b> {$email}" : "";
     $messageLabel = $message ? "<b>{$messageLabel}:</b> {$message}" : "";
     // Get the JMail ogject
     $mailer = JFactory::getMailer();
     // Set JMail object params------------------------------------------------
     $mailer->setSubject($subject);
     $params->get('useSiteMailfrom') ? $mailer->setSender(JFactory::getConfig()->get('mailfrom')) : $mailer->setSender($sender);
     $mailer->addRecipient($recipient);
     // Get the mail message body
     require JModuleHelper::getLayoutPath('mod_jcallback', 'default_email_message');
     $mailer->isHTML(true);
     $mailer->Encoding = 'base64';
     $mailer->setBody($body);
     $mailer->Send();
     // The mail sending errors will be shown in the Joomla Warning Message from JMail object..
 }
开发者ID:WhiskeyMan-Tau,项目名称:JCallback,代码行数:40,代码来源:helper.php

示例5: display

 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $model = tmsModel::getModel();
     $config = JFactory::getConfig();
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $cid = vRequest::getInt('cid');
         $task = vRequest::getCmd('task', 'add');
         if ($task != 'add' && !empty($cid) && !empty($cid[0])) {
             $cid = (int) $cid[0];
         } else {
             $cid = 0;
         }
         $model->setId($cid);
         $this->item = $model->getItem();
         $this->SetViewTitle('', $this->item->title);
         $this->addStandardEditViewCommandsPopup();
     } else {
         $this->SetViewTitle();
         $this->addStandardDefaultViewCommandsEditInline();
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $this->items = $model->getItemList(vRequest::getCmd('search', false));
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:30,代码来源:view.html.php

示例6: __construct

 /**
  * constructs a VmModel
  * setMainTable defines the maintable of the model
  * @author Max Milbers
  */
 function __construct()
 {
     parent::__construct('virtuemart_manufacturercategories_id');
     $this->setMainTable('manufacturercategories');
     $this->addvalidOrderingFieldName(array('mf_category_name'));
     $config = JFactory::getConfig();
 }
开发者ID:Arturogcalleja,项目名称:herbolario,代码行数:12,代码来源:manufacturercategories.php

示例7: postflight

 public function postflight($type, $parent)
 {
     // Clear Joomla system cache.
     /** @var JCache|JCacheController $cache */
     $cache = JFactory::getCache();
     $cache->clean('_system');
     // Clear Gantry5 cache.
     $path = JFactory::getConfig()->get('cache_path', JPATH_SITE . '/cache') . '/gantry5';
     if (is_dir($path)) {
         JFolder::delete($path);
     }
     // Make sure that PHP has the latest data of the files.
     clearstatcache();
     // Remove all compiled files from opcode cache.
     if (function_exists('opcache_reset')) {
         @opcache_reset();
     } elseif (function_exists('apc_clear_cache')) {
         @apc_clear_cache();
     }
     if ($type == 'uninstall') {
         return true;
     }
     /** @var JInstallerAdapter $parent */
     $manifest = $parent->getManifest();
     // Enable and lock extensions to prevent uninstalling them individually.
     $this->prepareExtensions($manifest, 1);
     // Make sure that all file formats used by Gantry 5 are editable from template manager.
     $this->adjustTemplateSettings();
     return true;
 }
开发者ID:legutierr,项目名称:gantry5,代码行数:30,代码来源:install.php

示例8: plgSystemmyApiOpenGraph

	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);
	}
开发者ID:rhumme,项目名称:myApi,代码行数:30,代码来源:myApiOpenGraph.php

示例9: loadConfiguration

 /**
  * Loads the configuration from the Joomla! global configuration itself. The component's options are loaded into
  * the options key. For example, an option called foobar is accessible as $config->get('options.foobar');
  *
  * @param string  $filePath Ignored
  * @param Phpfunc $phpfunc  Ignored
  *
  * @return  void
  */
 public function loadConfiguration($filePath = null, Phpfunc $phpfunc = null)
 {
     // Get the Joomla! configuration object
     $jConfig = \JFactory::getConfig();
     // Create the basic configuration data
     $data = array('timezone' => $jConfig->get('offset', 'UTC'), 'fs' => array('driver' => 'file'), 'dateformat' => \JText::_('DATE_FORMAT_LC2'), 'base_url' => \JUri::base() . '/index.php?option=com_' . strtolower($this->container->application_name), 'live_site' => \JUri::base() . '/index.php?option=com_' . strtolower($this->container->application_name), 'cms_url' => \JUri::base(), 'options' => array());
     // Get the Joomla! FTP layer options
     if (!class_exists('JClientHelper')) {
         \JLoader::import('joomla.client.helper');
     }
     $ftpOptions = \JClientHelper::getCredentials('ftp');
     // If the FTP layer is enabled, enable the Hybrid filesystem engine
     if ($ftpOptions['enabled'] == 1) {
         $data['fs'] = array('driver' => 'hybrid', 'host' => $ftpOptions['host'], 'port' => empty($ftpOptions['port']) ? '21' : $ftpOptions['port'], 'directory' => rtrim($ftpOptions['root'], '/\\'), 'ssl' => false, 'passive' => true, 'username' => $ftpOptions['user'], 'password' => $ftpOptions['pass']);
     }
     // Populate the options key with the component configuration
     $db = $this->container->db;
     $sql = $db->getQuery(true)->select($db->qn('params'))->from($db->qn('#__extensions'))->where($db->qn('element') . " = " . $db->q('com_' . strtolower($this->container->application_name)));
     try {
         $configJson = $db->setQuery($sql)->loadResult();
     } catch (\Exception $e) {
         $configJson = null;
     }
     if (!empty($configJson)) {
         $data['options'] = json_decode($configJson, true);
     }
     // Finally, load the data to the registry class
     $this->data = new \stdClass();
     $this->loadArray($data);
 }
开发者ID:edrdesigner,项目名称:awf,代码行数:39,代码来源:Configuration.php

示例10: display

 public function display($tpl = null)
 {
     $this->params = $this->get('Params');
     $this->formId = $this->get('FormId');
     $this->document = JFactory::getDocument();
     $title = $this->params->get('page_title', '');
     if (empty($title)) {
         $title = JFactory::getConfig()->get('sitename');
     } elseif (JFactory::getConfig()->get('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', JFactory::getConfig()->get('sitename'), $title);
     } elseif (JFactory::getConfig()->get('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, JFactory::getConfig()->get('sitename'));
     }
     $this->document->setTitle($title);
     if ($this->params->get('robots')) {
         $this->document->setMetadata('robots', $this->params->get('robots'));
     }
     if ($this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
     }
     parent::display($tpl);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:25,代码来源:view.html.php

示例11: getTableCreate

 public static function getTableCreate($tables)
 {
     $res = JFactory::getDbo()->getTableCreate($tables);
     $res = str_replace(JFactory::getConfig()->get('dbprefix'), '#__', $res);
     $res = str_replace('CREATE TABLE `#__', 'CREATE TABLE IF NOT EXISTS `#__', $res);
     return $res;
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:7,代码来源:database.php

示例12: chosen

 /**
  * Method to load the Chosen JavaScript framework and supporting CSS into the document head
  *
  * If debugging mode is on an uncompressed version of Chosen is included for easier debugging.
  *
  * @param   string  $selector  Class for Chosen elements.
  * @param   mixed   $debug     Is debugging mode on? [optional]
  * @param   array   $options   the possible Chosen options as name => value [optional]
  *
  * @return  void
  *
  * @since   3.0
  */
 public static function chosen($selector = '.advancedSelect', $debug = null, $options = array())
 {
     if (isset(static::$loaded[__METHOD__][$selector])) {
         return;
     }
     // Include jQuery
     JHtml::_('jquery.framework');
     // If no debugging value is set, use the configuration setting
     if ($debug === null) {
         $config = JFactory::getConfig();
         $debug = (bool) $config->get('debug');
     }
     // Default settings
     $options['disable_search_threshold'] = isset($options['disable_search_threshold']) ? $options['disable_search_threshold'] : 10;
     $options['allow_single_deselect'] = isset($options['allow_single_deselect']) ? $options['allow_single_deselect'] : true;
     $options['placeholder_text_multiple'] = isset($options['placeholder_text_multiple']) ? $options['placeholder_text_multiple'] : JText::_('JGLOBAL_SELECT_SOME_OPTIONS');
     $options['placeholder_text_single'] = isset($options['placeholder_text_single']) ? $options['placeholder_text_single'] : JText::_('JGLOBAL_SELECT_AN_OPTION');
     $options['no_results_text'] = isset($options['no_results_text']) ? $options['no_results_text'] : JText::_('JGLOBAL_SELECT_NO_RESULTS_MATCH');
     // Options array to json options string
     $options_str = json_encode($options, $debug && defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false);
     JHtml::_('script', 'jui/chosen.jquery.min.js', false, true, false, false, $debug);
     JHtml::_('stylesheet', 'jui/chosen.css', false, true);
     JFactory::getDocument()->addScriptDeclaration("\r\n\t\t\t\tjQuery(document).ready(function (){\r\n\t\t\t\t\tjQuery('" . $selector . "').chosen(" . $options_str . ");\r\n\t\t\t\t});\r\n\t\t\t");
     static::$loaded[__METHOD__][$selector] = true;
     return;
 }
开发者ID:01J,项目名称:skazkipronebo,代码行数:39,代码来源:formbehavior.php

示例13: __construct

 public function __construct($component)
 {
     if (!defined('SOBIPRO')) {
         define('SOBIPRO', true);
         defined('SOBI_CMS') || version_compare(JVERSION, '1.6.0', 'ge') ? define('SOBI_CMS', 'joomla16') : define('SOBI_CMS', 'joomla15');
         defined('SOBI_TASK') || define('SOBI_TASK', 'task');
         defined('SOBI_DEFLANG') || define('SOBI_DEFLANG', JFactory::getConfig()->get('config.language'));
         defined('SOBI_ACL') || define('SOBI_ACL', 'front');
         defined('SOBI_ROOT') || define('SOBI_ROOT', JPATH_ROOT);
         defined('SOBI_MEDIA') || define('SOBI_MEDIA', implode(DIRECTORY_SEPARATOR, array(JPATH_ROOT, 'media', 'sobipro')));
         defined('SOBI_MEDIA_LIVE') || define('SOBI_MEDIA_LIVE', JURI::root() . '/media/sobipro');
         defined('SOBI_PATH') || define('SOBI_PATH', SOBI_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_sobipro');
         defined('SOBI_LIVE_PATH') || define('SOBI_LIVE_PATH', 'components/com_sobipro');
         $this->addFile(SOBI_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'base' . DIRECTORY_SEPARATOR . 'fs' . DIRECTORY_SEPARATOR . 'loader.php');
     }
     SPLoader::loadController('interface');
     SPLoader::loadClass('base.filter');
     SPLoader::loadClass('base.request');
     SPLoader::loadClass('base.const');
     SPLoader::loadClass('base.factory');
     SPLoader::loadClass('base.object');
     SPLoader::loadClass('base.filter');
     SPLoader::loadClass('base.request');
     SPLoader::loadClass('sobi');
     SPLoader::loadClass('base.config');
     SPLoader::loadClass('base.exception');
     SPLoader::loadClass('cms.base.lang');
     SPLoader::loadClass('mlo.input');
     parent::__construct($component);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:30,代码来源:com_sobipro.php

示例14: setTitle

function setTitle()
{
    $easyset = AKEasyset::getInstance();
    $doc = JFactory::getDocument();
    $config = JFactory::getConfig();
    $siteName = $config->get('sitename');
    $view = JRequest::getVar('view');
    $title = $doc->getTitle();
    // fix for YOOTheme
    $title = explode('|', $title);
    $title = $title[0];
    if (AKHelper::isHome()) {
        $easyset->_siteTitle = $config->get('sitename');
    } else {
        $separator = trim($easyset->params->get('titleSeparator'));
        $replace['{%SITE%}'] = $siteName;
        $replace['{%TITLE%}'] = $title;
        if ('category' == $view || 'categories' == $view) {
            $replace['{%CATEGORY%}'] = '';
        } else {
            $replace['{%CATEGORY%}'] = $easyset->_catName;
        }
        $siteTitle = strtr($easyset->params->get('titleFix'), $replace);
        $siteTitle = explode('|', $siteTitle);
        foreach ($siteTitle as $k => $v) {
            if (!trim($v)) {
                unset($siteTitle[$k]);
                continue;
            }
            $siteTitle[$k] = trim($siteTitle[$k]);
        }
        $siteTitle = implode(" {$separator} ", $siteTitle);
        $easyset->_siteTitle = $siteTitle;
    }
}
开发者ID:ForAEdesWeb,项目名称:AEW3,代码行数:35,代码来源:setTitle.php

示例15: parseValue

 public function parseValue($value)
 {
     if (!$this->isPublished()) {
         return null;
     }
     $config = JFactory::getConfig();
     $user = JFactory::getUser();
     $filter = strtoupper((string) $this->getFilter());
     switch ($filter) {
         case 'SERVER_UTC':
             if (intval($value)) {
                 $date = JFactory::getDate($value, 'UTC');
                 $date->setTimezone(new DateTimeZone($config->get('offset')));
                 $value = $date->format('Y-m-d H:i:s', true, false);
             }
             break;
         case 'USER_UTC':
             if (intval($value)) {
                 $date = JFactory::getDate($value, 'UTC');
                 $date->setTimezone(new DateTimeZone($user->getParam('timezone', $config->get('offset'))));
                 $value = $date->format('Y-m-d H:i:s', true, false);
             }
             break;
     }
     return $value;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:26,代码来源:datetime.php


注:本文中的JFactory::getConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。