本文整理汇总了PHP中JParameter类的典型用法代码示例。如果您正苦于以下问题:PHP JParameter类的具体用法?PHP JParameter怎么用?PHP JParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: onContentSearch
/**
* Tags Search method
*
* The sql must return the following fields that are
* used in a common display routine: href, title, section, created, text,
* browsernav
* @param string Target search string
* @param string mathcing option, exact|any|all
* @param string ordering option, newest|oldest|popular|alpha|category
* @param mixed An array if restricted to areas, null if search all
*/
function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
{
$searchText = $text;
if (is_array($areas)) {
if (!array_intersect($areas, array_keys(plgSearchTagsAreas()))) {
return array();
}
}
// load plugin params info
$plugin = JPluginHelper::getPlugin('search', 'cedtags');
$pluginParams = new JParameter($plugin->params);
$limit = $pluginParams->def('search_limit', 50);
$text = trim($text);
if ($text == '') {
return array();
}
$rows = $this->searchForText($text, $limit);
$count = count($rows);
for ($i = 0; $i < $count; $i++) {
$link = 'index.php?option=com_cedtag&task=tag&tag=' . CedTagsHelper::urlTagname($rows[$i]->name);
$rows[$i]->href = JRoute::_($link);
$rows[$i]->section = JText::_('TAG');
}
$return = array();
foreach ($rows as $key => $tag) {
if (searchHelper::checkNoHTML($tag, $searchText, array('name', 'title', 'text'))) {
$return[] = $tag;
}
}
return $return;
}
示例3: display
/**
* Display function
*
* @since 1.5
*/
function display($tpl = null)
{
jimport('joomla.html.html');
$mainframe =& JFactory::getApplication();
// Get the page/component configuration
$params =& $mainframe->getParams();
$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::_('FORGOT_YOUR_USERNAME'));
}
} else {
$params->set('page_title', JText::_('FORGOT_YOUR_USERNAME'));
}
$document =& JFactory::getDocument();
$document->setTitle($params->get('page_title'));
// Load the form validation behavior
JHTML::_('behavior.formvalidation');
// Add the tooltip behavior
JHTML::_('behavior.tooltip');
$this->assignRef('params', $params);
parent::display($tpl);
}
示例4: plgcontentloadozio
function plgcontentloadozio($galleriaozio)
{
$db =& JFactory::getDBO();
$query = 'SELECT published, link, id, access, params' . ' FROM #__menu' . ' WHERE id=' . (int) $galleriaozio;
$db->setQuery($query);
$codice = $db->loadObject();
$query = 'SELECT *' . ' FROM #__menu' . ' WHERE (link LIKE "index.php?option=com_oziogallery2&view=01tilt3d"
OR link LIKE "index.php?option=com_oziogallery2&view=02flashgallery"
OR link LIKE "index.php?option=com_oziogallery2&view=03imagin"
OR link LIKE "index.php?option=com_oziogallery2&view=04carousel"
OR link LIKE "index.php?option=com_oziogallery2&view=05imagerotator"
OR link LIKE "index.php?option=com_oziogallery2&view=06accordion"
OR link LIKE "index.php?option=com_oziogallery2&view=07flickrslidershow"
OR link LIKE "index.php?option=com_oziogallery2&view=08flickrphoto"
OR link LIKE "index.php?option=com_oziogallery2&view=09mediagallery"
OR link LIKE "index.php?option=com_oziogallery2&view=10cooliris"
)';
$db->setQuery($query);
$cp = $db->loadObject();
$document =& JFactory::getDocument();
if ($cp->id = $galleriaozio) {
@($gall = JURI::root() . $codice->link . '&Itemid=' . (int) $galleriaozio);
$parametar = new JParameter($codice->params);
// alexred
if (@$codice->published != 0 && @$codice->access != 1 && @$codice->access != 2) {
$document->addScript(JURI::root(true) . '/components/com_oziogallery2/assets/js/autoHeight.js');
$contents = '';
$contents .= '<div class="clr"></div>';
$contents .= '<iframe src="' . $gall . '&tmpl=component" width="' . $parametar->get("width") . '" marginwidth="0px" allowtransparency="true" frameborder="0" scrolling="no" class="autoHeight">';
$contents .= '</iframe>';
$contents .= '<div class="clr"></div>';
return $contents;
}
}
}
示例5: _prepareDocument
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app =& JFactory::getApplication();
$pathway =& $app->getPathway();
$menus =& JSite::getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
if ($menu = $menus->getActive()) {
if (isset($menu->query['view']) && $menu->query['view'] == 'form') {
$menuParams = new JParameter($menu->params);
$title = $menuParams->get('page_title');
}
}
if (empty($title)) {
$title = JText::_('Content_Form_Edit_Article');
}
$this->document->setTitle($title);
$this->params->set('page_title', $title);
$pathway =& $app->getPathWay();
$pathway->addItem($title, '');
// If there is a pagebreak heading or title, add it to the page title
if (!empty($this->item->page_title)) {
$article->title = $article->title . ' - ' . $article->page_title;
$this->document->setTitle($article->page_title . ' - ' . JText::sprintf('Page %s', $this->state->get('page.offset') + 1));
}
}
示例6: renderItem
function renderItem(&$item, &$params, &$access)
{
global $mainframe;
$user =& JFactory::getUser();
$item->text = $item->introtext;
$item->groups = '';
$item->readmore = trim($item->fulltext) != '';
$item->metadesc = '';
$item->metakey = '';
$item->created = '';
$item->modified = '';
if ($params->get('readmore') || $params->get('link_titles')) {
if ($params->get('intro_only')) {
// Check to see if the user has access to view the full article
if ($item->access <= $user->get('aid', 0)) {
$itemparams = new JParameter($item->attribs);
$readmoretxt = $itemparams->get('readmore', JText::_('Read more text'));
$item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
$item->linkText = $readmoretxt;
} else {
$item->linkOn = JRoute::_('index.php?option=com_user&view=login');
$item->linkText = JText::_('Login To Read More');
}
}
}
if (!$params->get('image')) {
$item->text = preg_replace('/<img[^>]*>/', '', $item->text);
}
$results = $mainframe->triggerEvent('onAfterDisplayTitle', array(&$item, &$params, 1));
$item->afterDisplayTitle = trim(implode("\n", $results));
$results = $mainframe->triggerEvent('onBeforeDisplayContent', array(&$item, &$params, 1));
$item->beforeDisplayContent = trim(implode("\n", $results));
require JModuleHelper::getLayoutPath('mod_newsflash', '_item');
}
示例7: onContentPrepare
/**
* prepare content method
*
* Method is called by the view
*
* @param string The context of the content being passed to the plugin.
* @param object The article object. Note $article->text is also available
* @param object The article params
* @param int The 'page' number
*/
public function onContentPrepare($context, &$row, &$params, $page = 0)
{
jimport('joomla.html.parameter');
jimport('joomla.filesystem.file');
//load fabrik language
$lang =& JFactory::getLanguage();
$lang->load('com_fabrik', JPATH_BASE . DS . 'components' . DS . 'com_fabrik');
if (!defined('COM_FABRIK_FRONTEND')) {
JError::raiseError(400, JText::_('COM_FABRIK_SYSTEM_PLUGIN_NOT_ACTIVE'));
}
// Get plugin info
$plugin =& JPluginHelper::getPlugin('content', 'fabrik');
// $$$ hugh had to rename this, it was stomping on com_content and friends $params
// $$$ which is passed by reference to us!
$fparams = new JParameter($plugin->params);
// simple performance check to determine whether bot should process further
$botRegex = $fparams->get('Botregex') != '' ? $fparams->get('Botregex') : 'fabrik';
if (JString::strpos($row->text, $botRegex) === false) {
return true;
}
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'parent.php';
// $$$ hugh - having to change this to use {[]}
$regex = "/{" . $botRegex . "\\s*.*?}/i";
$row->text = preg_replace_callback($regex, array($this, 'replace'), $row->text);
}
示例8: load
function load($id = null)
{
parent::load($id);
jimport('joomla.html.parameter');
$params = new JParameter($this->settings);
$this->settings = $params->toArray();
}
示例9: display
function display($tpl = null)
{
// Get the url of the Alfresco repository from the Joosco plugin
// That's why the Joosco plugin needs to be installed and configured before the component
$plugin =& JPluginHelper::getPlugin('authentication', 'joosco');
$pluginParams = new JParameter($plugin->params);
// Here we connect to the Repository
$repositoryUrl = $pluginParams->get('alf-url');
$repository = new Repository($repositoryUrl);
// The ticket is created by the plugin when a user connects
$ticket = $_SESSION["ticket"];
$session = $repository->createSession($ticket);
$store = new SpacesStore($session);
$currentNode = null;
$uuid = null;
$uuid =& JRequest::getVar('uuid');
if (!isset($uuid)) {
$currentNode = $store->companyHome;
$path = 'Company Home';
} else {
$currentNode = $session->getNode($store, JRequest::getVar('uuid'));
$path = JRequest::getVar('path') . '|' . JRequest::getVar('uuid') . '|' . JRequest::getVar('name');
}
// Pass the values to the rest of the template
$this->assignRef('path', $path);
$this->assignRef('session', $session);
$this->assignRef('store', $store);
$this->assignRef('currentNode', $currentNode);
$this->assignRef('option', JRequest::getVar('option'));
$this->assignRef('view', JRequest::getVar('view'));
$this->assignRef('itemid', JRequest::getVar('Itemid'));
parent::display($tpl);
}
示例10: display
function display($tpl = null)
{
// redirect guests to login page
$mainframe =& JFactory::getApplication();
$user =& JFactory::getUser();
if ($user->id != 0) {
$Lists = $this->get('Lists');
$this->assignRef('lists', $Lists);
//--Creating a link to the edit form
$this->assignRef('editlink', JRoute::_('index.php?option=com_joomailermailchimpintegration&view=subscriptions&task=edit'));
// retrieve page title from the menuitem
$menus =& JSite::getMenu();
$menu = $menus->getActive();
$menu_params = new JParameter($menu->params);
$this->assignRef('page_title', $menu_params->get('page_title'));
parent::display($tpl);
} else {
// Redirect to login
$uri = JFactory::getURI();
$return = $uri->toString();
if (version_compare(JVERSION, '1.6.0', 'ge')) {
$url = 'index.php?option=com_users&view=login';
} else {
$url = 'index.php?option=com_user&view=login';
}
$url .= '&return=' . base64_encode($return);
$mainframe->redirect($url, JText::_('JM_ONLY_LOGGED_IN_USERS_CAN_VIEW_SUBSCRIPTIONS'));
}
}
示例11: bindSetValues
function bindSetValues($ext_params = null)
{
if (!empty($this->_menuid)) {
if (is_array($this->_menuid)) {
$menuid = $this->_menuid[0];
} else {
$menuid = $this->_menuid;
}
$db =& JFactory::getDBO();
$query = "SELECT params FROM #__menu WHERE id = " . $menuid;
$db->setQuery($query);
$row = $db->loadObject();
if (!empty($row)) {
$params = new JParameter($row->params);
$list_params = $ext_params->renderToArray("params", "params");
foreach ($list_params as $key => $value) {
if (!empty($key) && strpos($key, "ytext_") !== false) {
$tmp_value = $params->get($key, "");
if (is_array($tmp_value)) {
$tmp_value = implode("|", $tmp_value);
}
$ext_params->set($key, $tmp_value);
}
}
}
}
return $ext_params;
}
示例12: up
/**
* Up
**/
public function up()
{
$query = "CREATE TABLE IF NOT EXISTS `jos_announcements` (\n\t\t\t\t\t\t`id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t`scope` varchar(100) DEFAULT NULL,\n\t\t\t\t\t\t`scope_id` int(11) DEFAULT NULL,\n\t\t\t\t\t\t`content` text,\n\t\t\t\t\t\t`priority` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`created_by` int(11) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`state` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\t`publish_up` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`publish_down` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n\t\t\t\t\t\t`sticky` tinyint(2) NOT NULL DEFAULT '0',\n\t\t\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$this->db->setQuery($query);
$this->db->query();
$params = array('plugin_access' => 'members', 'display_tab' => 1);
$this->addPluginEntry('groups', 'announcements', 1, $params);
//get citation params
if ($this->db->tableExists('#__extensions')) {
$sql = "SELECT `params` FROM `#__extensions` WHERE `type`='plugin' AND `element`='messages' AND `folder` = 'groups'";
} else {
$sql = "SELECT `params` FROM `#__plugins` WHERE `element`='messages' AND `folder`='groups'";
}
$this->db->setQuery($sql);
$p = $this->db->loadResult();
//load params object
$params = new \JParameter($p);
//set param to hide messages tab
$params->set('display_tab', 0);
//save new params
if ($this->db->tableExists('#__extensions')) {
$query = "UPDATE `#__extensions` SET `params`=" . $this->db->quote(json_encode($params->toArray())) . " WHERE `element`='messages' AND `folder`='groups'";
} else {
$query = "UPDATE `#__plugins` SET `params`='" . $params->toString() . "' WHERE `element`='messages' AND `folder`='groups'";
}
$this->db->setQuery($query);
$this->db->query();
}
示例13: render
public function render()
{
$model = $this->getModel();
$module = $model->getRow();
if ($this->getLayout() == 'modal') {
$this->menus = $this->getObject('com:pages.model.menus')->sort('title')->getRowset();
$this->pages = $this->getObject('com:pages.model.pages')->application('site')->getRowset();
$this->modules = $this->getObject('com:pages.model.modules')->application('site')->getRowset();
}
if ($this->getModel()->getState()->isUnique()) {
if ($module->isNew()) {
$module->application = $model->application;
$module->name = $model->name;
}
$path = Library\ClassLoader::getInstance()->getApplication($module->application);
JFactory::getLanguage()->load(substr($module->extension_name, 4), $module->name, $path);
}
// Build path to module config file
$path = Library\ClassLoader::getInstance()->getApplication('site');
$path .= '/component/' . substr($module->extension_name, 4) . '/module/' . substr($module->name, 4) . '/config.xml';
$params = new \JParameter(null, $path);
$params->loadArray($module->params->toArray());
$this->params = $params;
return parent::render();
}
示例14: display
function display($tpl = null)
{
global $mainframe;
$db =& JFactory::getDBO();
$client = JRequest::getWord('client', 'site');
$plugin =& JPluginHelper::getPlugin('editors', 'jce');
$params = new JParameter($plugin->params);
$num = intval($params->get('layout_rows', 5));
$rows = array();
for ($i = 1; $i <= $num; $i++) {
$query = "SELECT id, title, name, type, layout, icon" . "\n FROM #__jce_plugins" . "\n WHERE row = " . $i . "" . "\n AND published = 1" . "\n AND icon != ''" . "\n ORDER BY ordering ASC";
$db->setQuery($query);
$rows[] = $db->loadObjectList();
}
$dimensions['width'] = $params->get('width', '600');
$dimensions['height'] = $params->get('height', '600');
if ($client == 'admin') {
$client_id = 1;
} else {
$client_id = 0;
}
$this->assignRef('dimensions', $dimensions);
$this->assignRef('client', $client_id);
$this->assignRef('items', $rows);
parent::display($tpl);
}
示例15: display
public function display($cachable = false, $urlparams = false)
{
// Redirect profile to integrated component if profile integration is turned on
$redirect = 1;
$active = $this->app->getMenu()->getActive();
if (!empty($active)) {
if (version_compare(JVERSION, '1.6', '>')) {
// Joomla 1.6+
$params = $active->params;
} else {
// Joomla 1.5
$params = new JParameter($active->params);
}
$redirect = $params->get('integration', 1);
}
if ($redirect && JRequest::getCmd('format') == 'html') {
$profileIntegration = KunenaFactory::getProfile();
if ($profileIntegration instanceof KunenaProfileKunena) {
// Continue
} elseif (JRequest::getCmd('layout', 'default') == 'default') {
$url = $this->me->getUrl(false);
} elseif (JRequest::getCmd('layout') == 'list') {
$url = $profileIntegration->getUserListURL('', false);
}
if (!empty($url)) {
$this->setRedirect($url);
return;
}
}
parent::display();
}