本文整理汇总了PHP中JComponentHelper::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP JComponentHelper::getParams方法的具体用法?PHP JComponentHelper::getParams怎么用?PHP JComponentHelper::getParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JComponentHelper
的用法示例。
在下文中一共展示了JComponentHelper::getParams方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInput
public function getInput()
{
jimport('joomla.filesystem.file');
$mainframe = JFactory::getApplication();
if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_joomailermailchimpintegration/libraries/MCAPI.class.php')) {
$mainframe->enqueueMessage(JText::_('JM_PLEASE_INSTALL_JOOMLAMAILER'), 'error');
$mainframe->redirect('index.php');
}
$listId = $this->form->getValue('listid', 'params');
require_once JPATH_ADMINISTRATOR . '/components/com_joomailermailchimpintegration/libraries/MCAPI.class.php';
$params = JComponentHelper::getParams('com_joomailermailchimpintegration');
$MCapi = $params->get('params.MCapi');
$api = new joomlamailerMCAPI($MCapi);
$interests = $api->listInterestGroupings($listId);
$options = array();
if ($interests) {
foreach ($interests as $interest) {
if ($interest['form_field'] != 'hidden') {
$groups = array();
foreach ($interest['groups'] as $ig) {
$groups[] = $ig['name'];
}
$groups = implode('####', $groups);
$options[] = array('id' => $interest['id'] . ';' . $interest['form_field'] . ';' . $interest['name'] . ';' . $groups, 'name' => $interest['name']);
}
}
}
if (count($options)) {
return JHtml::_('select.genericlist', $options, 'jform[params][interests][]', 'multiple="multiple"', 'id', 'name', $this->value, $this->id);
} else {
return JText::_('JM_NO_INTEREST_GROUPS');
}
}
示例2: display
/**
* Generates a list of JSON items.
*
* @return void
*/
public function display($tpl = null)
{
$model = $this->getModel();
$this->item = $this->get('Item');
$this->component = $model->getState($model->getName() . '.component');
$this->section = $model->getState($model->getName() . '.section');
$this->asset_id = $model->getState($model->getName() . '.asset_id');
$this->project_id = $model->getState($model->getName() . '.project_id');
$this->inherit = $model->getState($model->getName() . '.inherit');
if (!$this->asset_id && $this->inherit) {
$this->asset_id = $this->getComponentProjectAssetId($this->component, $this->project_id);
}
$this->rules = $this->getAssetRules();
$this->public_groups = array('1', JComponentHelper::getParams('com_users')->get('guest_usergroup', 1));
$user = JFactory::getUser();
if (!$user->authorise('core.admin', $this->component) && !$user->authorise('core.manage', $this->component)) {
JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
return false;
}
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
parent::display($tpl);
}
示例3: __construct
/**
* constructor (registers additional tasks to methods)
* @return void
*/
function __construct()
{
parent::__construct();
// Set reference to parameters
$this->params = JComponentHelper::getParams('com_chessvn');
//$dummy = $this->params->get('parm_text');
}
示例4: display
function display($tpl = null)
{
global $mainframe;
// Check if registration is allowed
$usersConfig =& JComponentHelper::getParams('com_users');
if (!$usersConfig->get('allowUserRegistration')) {
JError::raiseError(403, JText::_('Access Forbidden'));
return;
}
$pathway =& $mainframe->getPathway();
$document =& JFactory::getDocument();
$params =& $mainframe->getParams();
// Page Title
$menus =& JSite::getMenu();
$menu = $menus->getActive();
// because the application sets a default page title, we need to get it
// right from the menu item itself
if (is_object($menu)) {
$menu_params = new JParameter($menu->params);
if (!$menu_params->get('page_title')) {
$params->set('page_title', JText::_('Registration'));
}
} else {
$params->set('page_title', JText::_('Registration'));
}
$document->setTitle($params->get('page_title'));
$pathway->addItem(JText::_('New'));
// Load the form validation behavior
JHTML::_('behavior.formvalidation');
$user =& JFactory::getUser();
$this->assignRef('user', $user);
$this->assignRef('params', $params);
parent::display($tpl);
}
示例5: __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'));
}
示例6: 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);
}
示例7: display
/**
* Display
*
* @param string $tmpl Template
*
* @return void
*/
public function display($tmpl = 'default')
{
$srcs = FabrikHelperHTML::framework();
$app = JFactory::getApplication();
$input = $app->input;
FabrikHelperHTML::script($srcs);
$model = $this->getModel();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model->setId($input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))));
$visualization = $model->getVisualization();
$pluginParams = $model->getPluginParams();
$pluginManager = JModelLegacy::getInstance('Pluginmanager', 'FabrikModel');
$plugin = $pluginManager->getPlugIn($visualization->plugin, 'visualization');
$plugin->_row = $visualization;
if ($visualization->published == 0) {
return JError::raiseWarning(500, FText::_('COM_FABRIK_SORRY_THIS_VISUALIZATION_IS_UNPUBLISHED'));
}
// Plugin is basically a model
$pluginTask = $input->get('plugintask', 'render', 'request');
// @FIXME cant set params directly like this, but I think plugin model setParams() is not right
$plugin->_params = $pluginParams;
$tmpl = $plugin->getParams()->get('calendar_layout', $tmpl);
$plugin->{$pluginTask}($this);
$this->plugin = $plugin;
$viewName = $this->getName();
$this->addTemplatePath($this->_basePath . '/plugins/' . $this->_name . '/' . $plugin->_name . '/tmpl/' . $tmpl);
$root = $app->isAdmin() ? JPATH_ADMINISTRATOR : JPATH_SITE;
$this->addTemplatePath($root . '/templates/' . $app->getTemplate() . '/html/com_fabrik/visualization/' . $plugin->_name . '/' . $tmpl);
$ab_css_file = JPATH_SITE . '/plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/template.css';
if (JFile::exists($ab_css_file)) {
JHTML::stylesheet('template.css', 'plugins/fabrik_visualization/' . $plugin->_name . '/tmpl/' . $tmpl . '/', true);
}
echo parent::display();
}
示例8: onAfterRoute
public function onAfterRoute()
{
$app = JFactory::getApplication();
if($app->isAdmin()){
return;
}
$menus = $app->getMenu('site');
$menu = $menus->getActive();
if(!$menu || $menu->home != 1) return;
$doc = JFactory::getDocument();
if($doc->getType() != 'html') return;
$params = JComponentHelper::getParams('com_xmlrpc');
if($params->get('show_rsd', 1)){
class_exists('XMLRPCHelperRoute') or require(JPATH_SITE.'/components/com_xmlrpc/helpers/route.php');
$link = JRoute::_(XMLRPCHelperRoute::getRsdRoute());
$doc->addHeadLink($link, 'EditURI', 'rel', array('type' => 'application/rsd+xml', 'title'=>'RSD'));
}
if($params->get('show_manifest', 1)){
class_exists('XMLRPCHelperRoute') or require(JPATH_SITE.'/components/com_xmlrpc/helpers/route.php');
$link = JRoute::_(XMLRPCHelperRoute::getManifestRoute());
$doc->addHeadLink($link, 'wlwmanifest', 'rel', array('type'=>'application/wlwmanifest+xml'));
}
}
示例9: populateState
protected function populateState($ordering = null, $direction = null)
{
// Load the component parameters.
$params = JComponentHelper::getParams($this->option);
$this->setState('params', $params);
// Load filter search.
$value = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $value);
// Load filter state.
$value = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string');
$this->setState('filter.state', $value);
// Load filter approved state.
$value = $this->getUserStateFromRequest($this->context . '.filter.approved', 'filter_approved', '', 'string');
$this->setState('filter.approved', $value);
// Load filter featured state.
$value = $this->getUserStateFromRequest($this->context . '.filter.featured', 'filter_featured', '', 'string');
$this->setState('filter.featured', $value);
// Load filter category.
$value = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', 0, 'int');
$this->setState('filter.category_id', $value);
// Load filter type.
$value = $this->getUserStateFromRequest($this->context . '.filter.type_id', 'filter_type_id', 0, 'int');
$this->setState('filter.type_id', $value);
// List state information.
parent::populateState('a.created', 'asc');
}
示例10: upload
/**
* @brief Accion que se encarga de manipular el proceso de guardar
* un archivo en el servidor
* @param array $allowedExtensions Arreglo de extensiones validas para el archivo
* @param int $sizeLimit Tamaño maximo permitido del fichero que se sube
*/
function upload($allowedExtensions, $sizeLimit = 10485760)
{
jimport('Amadeus.Util.Uploader');
$media =& JComponentHelper::getParams('com_media');
$postSize = $this->toBytes(ini_get('post_max_size'));
$uploadSize = $this->toBytes(ini_get('upload_max_filesize'));
$mediaSize = (int) $media->get('upload_maxsize');
// Se selecciona el minimo tamaño válido para un fichero, de acuerdo
// a los valores configurados en el php, el joomla y el componente.
$sizeLimit = min($postSize, $uploadSize, $mediaSize, $sizeLimit);
// Se alamacena la imagen en la ruta especificada
$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);
$result = $uploader->handleUpload(JPATH_SITE . '/tmp/', true);
if (!isset($result['error'])) {
jimport('Amadeus.Util.Validation');
$file = $uploader->getName();
$result = AmadeusUtilValidation::isValidFile($file, $only_image);
if (isset($result['error'])) {
jimport('joomla.filesystem.file');
if (!JFile::delete($file)) {
$result = array('error' => JText::_('DELETEERROR'));
}
} else {
$this->_file = $file;
}
}
return $result;
}
示例11: display
public function display($tpl = null)
{
$this->option = JFactory::getApplication()->input->get('option');
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
// Get parameters of com_crowdfunding.
/** @var $cParams Joomla\Registry\Registry */
$cParams = JComponentHelper::getParams('com_crowdfunding');
$this->cfParams = $cParams;
$currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->cfParams->get('project_currency'));
$this->amount = new Crowdfunding\Amount($this->cfParams);
$this->amount->setCurrency($currency);
// Get rewards number
$projectsIds = array();
foreach ($this->items as $item) {
$projectsIds[] = $item->id;
}
$projects = new Crowdfunding\Projects(JFactory::getDbo());
$this->transactions = $projects->getTransactionsNumber($projectsIds);
// Prepare sorting data
$this->prepareSorting();
// Prepare actions
$this->addToolbar();
$this->addSidebar();
$this->setDocument();
parent::display($tpl);
}
示例12: save
function save()
{
// Check for request forgeries
JRequest::checkToken() or die('COM_JOOMLEAGUE_GLOBAL_INVALID_TOKEN');
$cid = JRequest::getInt("cid", 0);
$post = JRequest::get('post');
if ($cid > 0) {
$club =& JTable::getInstance("Club", "Table");
$club->load($cid);
$club->bind($post);
$params =& JComponentHelper::getParams('com_joomleague');
if ($club->store() && $params->get('cfg_edit_club_info_update_notify') == "1") {
$db = JFactory::getDBO();
$user = JFactory::getUser();
$query = "SELECT email\n FROM #__users \n WHERE usertype = 'Super Administrator' \n OR usertype = 'Administrator'";
$db->setQuery($query);
$to = $db->loadResultArray();
$subject = addslashes(sprintf(JText::_("COM_JOOMLEAGUE_ADMIN_EDIT_CLUB_INFO_SUBJECT"), $club->name));
$message = addslashes(sprintf(JText::_("COM_JOOMLEAGUE_ADMIN_EDIT_CLUB_INFO_MESSAGE"), $user->name, $club->name));
$message .= $this->_getShowClubInfoLink();
JUtility::sendMail('', '', $to, $subject, $message);
}
}
$this->setRedirect($this->_getShowClubInfoLink());
}
示例13: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @param string $ordering An optional ordering field.
* @param string $direction An optional direction (asc|desc).
*
* @return void
* @since 3.1
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
$context = $this->context;
$search = $this->getUserStateFromRequest($context . '.search', 'filter_search');
$this->setState('filter.search', $search);
$level = $this->getUserStateFromRequest($context . '.filter.level', 'filter_level', 0, 'int');
$this->setState('filter.level', $level);
$access = $this->getUserStateFromRequest($context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$published = $this->getUserStateFromRequest($context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$language = $this->getUserStateFromRequest($context . '.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);
// Load the parameters.
$params = JComponentHelper::getParams('com_tags');
$this->setState('params', $params);
// List state information.
parent::populateState('a.lft', 'asc');
}
示例14: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*/
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search = $app->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $app->getUserStateFromRequest($this->context . '.filter.state', 'filter_published', '', 'string');
$this->setState('filter.state', $published);
//Filtering catid
$this->setState('filter.catid', $app->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid', '', 'string'));
//Filtering access
$this->setState('filter.access', $app->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', '', 'string'));
//Filtering language
//Language filters for all languages is a * make it empty
if (JFactory::getApplication()->input->getVar('filter_language') == '*') {
JFactory::getApplication()->input->set('filter_language', '');
}
$this->setState('filter.language', $app->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '', 'string'));
// Load the parameters.
$params = JComponentHelper::getParams('com_db8download');
$this->setState('params', $params);
// List state information.
parent::populateState('a.name', 'asc');
}
示例15: display
public function display($tpl = null)
{
$app = JFactory::getApplication();
$jinput = $app->input;
$option = $jinput->getCmd('option');
if ($this->getLayout() == 'form') {
$this->_displayForm($tpl);
return;
}
if ($this->getLayout() == 'info') {
$this->_displayInfo($tpl);
return;
}
if ($this->getLayout() == 'selectpage') {
$this->_displaySelectpage($tpl);
return;
}
// Set toolbar items for the page
JToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_XML_IMPORT_TITLE_1_3'), 'generic.png');
JToolBarHelper::help('screen.joomleague', true);
$uri = JFactory::getURI();
$config = JComponentHelper::getParams('com_media');
$post = JRequest::get('post');
$files = JRequest::get('files');
$this->request_url = $uri->toString();
$this->config = $config;
parent::display($tpl);
}