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


PHP JParameter::getValue方法代码示例

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


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

示例1: load

 public function load($config)
 {
     if (!array_key_exists('component', $config)) {
         self::$component = $config['extensionName'];
     } else {
         self::$component = $config['component'];
     }
     if (!array_key_exists('key', $config)) {
         self::$key = 'liveupdate';
     } else {
         self::$key = $config['key'];
     }
     jimport('joomla.html.parameter');
     jimport('joomla.application.component.helper');
     // Not using JComponentHelper to avoid conflicts ;)
     $db = JFactory::getDbo();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $sql = $db->getQuery(true)->select($db->nq('params'))->from($db->nq('#__extensions'))->where($db->nq('type') . ' = ' . $db->q('component'))->where($db->nq('element') . ' = ' . $db->q(self::$component));
     } else {
         $sql = 'SELECT ' . $db->nameQuote('params') . ' FROM ' . $db->nameQuote('#__components') . ' WHERE ' . $db->nameQuote('option') . ' = ' . $db->Quote(self::$component) . " AND `parent` = 0 AND `menuid` = 0";
     }
     $db->setQuery($sql);
     $rawparams = $db->loadResult();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $params = new JRegistry();
         $params->loadJSON($rawparams);
     } else {
         $params = new JParameter($rawparams);
     }
     $data = $params->getValue(self::$key, '');
     jimport('joomla.registry.registry');
     self::$registry = new JRegistry('update');
     self::$registry->loadINI($data);
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:34,代码来源:component.php

示例2: getUserState

 /**
  * Get user state from database.
  *
  * @param string $param property name
  * @return string
  */
 public static function getUserState($param)
 {
     if (isset($_COOKIE['joomdoc'])) {
         $db = JFactory::getDbo();
         $db->setQuery('SELECT `params` FROM `#__joomdoc_userstate` WHERE `session` = ' . (int) $_COOKIE['joomdoc']);
         $params = new JParameter($db->loadResult());
         return $params->getValue($param);
     }
     return null;
 }
开发者ID:abdullah929,项目名称:bulletin,代码行数:16,代码来源:user.php

示例3: display

 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     JHTML::_('behavior.tooltip');
     //get vars
     $cid = JRequest::getVar('cid');
     $field_type = JRequest::getVar('field_type', 0);
     //Get data from the model
     $model = $this->getModel();
     if (FLEXI_J16GE) {
         $form = $this->get('Form');
     } else {
         $row =& $this->get('Field');
         //Import File system
         jimport('joomla.filesystem.file');
         // Create the form
         $pluginpath = JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . $field_type . '.xml';
         if (JFile::exists($pluginpath)) {
             $form = new JParameter('', $pluginpath);
         } else {
             $form = new JParameter('', JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . 'core.xml');
         }
         $form->loadINI($row->attribs);
     }
     $isnew = FLEXI_J16GE ? !$form->getValue('id') : !$row->id;
     // fail if checked out not by 'me'
     if (!$isnew) {
         if ($model->isCheckedOut($user->get('id'))) {
             JError::raiseWarning('SOME_ERROR_CODE', $row->name . ' ' . JText::_('FLEXI_EDITED_BY_ANOTHER_ADMIN'));
             $app->redirect('index.php?option=com_flexicontent&view=fields');
         }
     }
     if ($field_type) {
         if (!FLEXI_J16GE) {
             echo $form->render('params', 'group-' . $field_type);
         } else {
             foreach ($form->getFieldset('group-' . $field_type) as $field) {
                 echo '<fieldset class="panelform">' . $field->label . $field->input . '</fieldset>' . "\n";
             }
         }
     } else {
         echo "<br /><span style=\"padding-left:25px;\"'>" . JText::_('FLEXI_APPLY_TO_SEE_THE_PARAMETERS') . "</span><br /><br />";
     }
     //parent::display($tpl);
 }
开发者ID:jakesyl,项目名称:flexicontent,代码行数:46,代码来源:view.raw.php

示例4: routeJFRule

function routeJFRule($router, &$uri)
{
    $registry = JFactory::getConfig();
    $multilingual_support = $registry->getValue("config.multilingual_support", false);
    $jfLang = $registry->getValue("joomfish.language", false);
    if ($multilingual_support && $jfLang) {
        if ($uri->getVar("lang", "") == "") {
            $uri->setVar("lang", $jfLang->shortcode != '' ? $jfLang->shortcode : $jfLang->iso);
        }
        // this is dependent on Joomfish router being first!!
        $lang = $uri->getVar("lang", "");
        $conf = JFactory::getConfig();
        // This may not ready at this stage
        $params = $conf->getValue("jfrouter.params");
        // so load plugin parameters directly
        if (is_null($params)) {
            $params = JPluginHelper::getPlugin("system", "jfrouter");
            $params = new JParameter($params->params);
        }
        $sefordomain = $params->get("sefordomain", "sefprefix");
        if ($sefordomain == "domain") {
            // If I set config_live_site I actually don't need this function at all let alone this logic ?  Apart from language switcher.
            // TODO cache the indexed array
            $rawsubdomains = $params->getValue("sefsubdomain", array());
            $subdomains = array();
            $jfm = JoomFishManager::getInstance();
            $langs = $jfm->getLanguagesIndexedById();
            foreach ($rawsubdomains as $domain) {
                list($langid, $domain) = explode("::", $domain, 2);
                $domain = strtolower(str_replace("http://", "", $domain));
                $domain = str_replace("https://", "", $domain);
                $domain = preg_replace("#/\$#", "", $domain);
                //$domain = str_replace("/","",$domain);
                $subdomains[$langs[$langid]->shortcode] = $domain;
            }
            if (array_key_exists($lang, $subdomains)) {
                $uri->setHost($subdomains[$lang]);
                $uri->delVar("lang");
                $registry->setValue("joomfish.sef_host", $subdomains[$lang]);
                plgSystemJFRouter::procesCustomBuildRule($router, $uri);
                return;
            }
        } else {
            // Get the path data
            $route = $uri->getPath();
            //Add the suffix to the uri
            if ($router->_mode == JROUTER_MODE_SEF && $route && !$lang !== "") {
                $jfm = JoomFishManager::getInstance();
                $jfLang = $jfm->getLanguageByShortcode($lang);
                if (!$jfLang) {
                    return;
                }
                $sefprefixes = $params->getValue("sefprefixes", array());
                // Workaround if some language prefixes are missing
                $langs = $jfm->getLanguagesIndexedById();
                if (!is_array($sefprefixes)) {
                    $sefprefixes = array();
                }
                if (count($sefprefixes) < count($langs)) {
                    foreach ($sefprefixes as $prefix) {
                        list($langid, $prefix) = explode("::", $prefix, 2);
                        if (array_key_exists($langid, $langs)) {
                            $langs[$langid]->hasprefix = true;
                        }
                    }
                    foreach ($langs as $lang) {
                        if (!isset($lang->hasprefix)) {
                            $sefprefixes[] = $lang->lang_id . "::" . $lang->sef;
                        }
                    }
                }
                foreach ($sefprefixes as $prefix) {
                    list($langid, $prefix) = explode("::", $prefix, 2);
                    if ($jfLang->lang_id == $langid) {
                        $uri->setPath($uri->getPath() . "/" . $prefix);
                        $uri->delVar("lang");
                        plgSystemJFRouter::procesCustomBuildRule($router, $uri);
                        return;
                    }
                }
            }
        }
    }
    return;
}
开发者ID:JoomFish,项目名称:joomfish-2.2,代码行数:85,代码来源:jfrouter.php

示例5: renderInstalledPaymentPlugins

 function renderInstalledPaymentPlugins($selected)
 {
     if (JVM_VERSION === 1) {
         $table = '#__plugins';
         $ext_id = 'id';
         $enable = 'published';
     } else {
         $table = '#__extensions';
         $ext_id = 'extension_id';
         $enable = 'enabled';
     }
     $db = JFactory::getDBO();
     //Todo speed optimize that, on the other hand this function is NOT often used and then only by the vendors
     //		$q = 'SELECT * FROM #__plugins as pl JOIN `#__virtuemart_payment_method` AS pm ON `pl`.`id`=`pm`.`payment_jplugin_id` WHERE `folder` = "vmpayment" AND `published`="1" ';
     //		$q = 'SELECT * FROM #__plugins as pl,#__virtuemart_payment_method as pm  WHERE `folder` = "vmpayment" AND `published`="1" AND pl.id=pm.payment_jplugin_id';
     $q = 'SELECT * FROM `' . $table . '` WHERE `folder` = "vmpayment" and `state`="0" AND `element`<>"moneybookers" ORDER BY `ordering`,`name` ASC';
     $db->setQuery($q);
     $result = $db->loadAssocList($ext_id);
     if (empty($result)) {
         $app = JFactory::getApplication();
         $app->enqueueMessage(JText::_('COM_VIRTUEMART_NO_PAYMENT_PLUGINS_INSTALLED'));
     }
     $listHTML = '<select id="payment_jplugin_id" name="payment_jplugin_id" style= "width: 300px;">';
     if (!class_exists('JParameter')) {
         require JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'html' . DS . 'parameter.php';
     }
     foreach ($result as $paym) {
         $params = new JParameter($paym['params']);
         if ($paym[$ext_id] == $selected) {
             $checked = 'selected="selected"';
         } else {
             $checked = '';
         }
         // Get plugin info
         $pType = $params->getValue('pType');
         if ($pType == 'Y' || $pType == 'C') {
             $id = 'pam_type_CC_on';
         } else {
             $id = 'pam_type_CC_off';
         }
         $listHTML .= '<option id="' . $id . '" ' . $checked . ' value="' . $paym[$ext_id] . '">' . JText::_($paym['name']) . '</option>';
     }
     $listHTML .= '</select>';
     return $listHTML;
 }
开发者ID:spiridonov-oa,项目名称:SheinCandles,代码行数:45,代码来源:view.html.php

示例6: display

    function display($tpl = null)
    {
        //initialise variables
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        //JHTML::_('behavior.tooltip');
        //get vars
        $cid = JRequest::getVar('cid');
        $field_type = JRequest::getVar('field_type', 0);
        //Get data from the model
        $model = $this->getModel();
        $form = $this->get('Form');
        if (!FLEXI_J16GE) {
            $row =& $this->get('Field');
            //Import File system
            jimport('joomla.filesystem.file');
            // Create the form
            $pluginpath = JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . $field_type . '.xml';
            if (JFile::exists($pluginpath)) {
                $form = new JParameter('', $pluginpath);
            } else {
                $form = new JParameter('', JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . 'core.xml');
            }
            $form->loadINI($row->attribs);
        }
        $isnew = FLEXI_J16GE ? !$form->getValue('id') : !$row->id;
        // fail if checked out not by 'me'
        if (!$isnew) {
            if ($model->isCheckedOut($user->get('id'))) {
                JError::raiseWarning('SOME_ERROR_CODE', $row->name . ' ' . JText::_('FLEXI_EDITED_BY_ANOTHER_ADMIN'));
                $app->redirect('index.php?option=com_flexicontent&view=fields');
            }
        }
        /*if ($field_type)
        		{
        			if (!FLEXI_J16GE) {
        				echo $form->render('params', 'group-' . $field_type );
        			} else {
        				foreach ($form->getFieldset('group-' . $field_type) as $field) {
        					echo '<fieldset class="panelform">' . $field->label . $field->input . '</fieldset>' . "\n";
        				}
        			}
        		} else {
        			echo "<br /><span style=\"padding-left:25px;\"'>" . JText::_( 'FLEXI_APPLY_TO_SEE_THE_PARAMETERS' ) . "</span><br /><br />";
        		}*/
        ?>
			<div class="fctabber fields_tabset" id="field_specific_props_tabset">
			<?php 
        $fieldSets = $form->getFieldsets('attribs');
        $prefix_len = strlen('group-' . $field_type . '-');
        foreach ($fieldSets as $name => $fieldSet) {
            if ($name != 'basic' && $name != 'standard' && (substr($name, 0, $prefix_len) != 'group-' . $field_type . '-' || $name === 'group-' . $field_type)) {
                continue;
            }
            if ($fieldSet->label) {
                $label = JText::_($fieldSet->label);
            } else {
                $label = $name == 'basic' || $name == 'standard' ? JText::_('FLEXI_BASIC') : ucfirst(str_replace("group-", "", $name));
            }
            if (@$fieldSet->label_prefix) {
                $label = JText::_($fieldSet->label_prefix) . ' - ' . $label;
            }
            $icon = @$fieldSet->icon_class ? 'data-icon-class="' . $fieldSet->icon_class . '"' : '';
            $prepend = @$fieldSet->prepend_text ? 'data-prefix-text="' . JText::_($fieldSet->prepend_text) . '"' : '';
            $description = $fieldSet->description ? JText::_($fieldSet->description) : '';
            ?>
				<div class="tabbertab" id="fcform_tabset_<?php 
            echo $name;
            ?>
_tab" <?php 
            echo $icon;
            ?>
 <?php 
            echo $prepend;
            ?>
>
					<h3 class="tabberheading hasTooltip" title="<?php 
            echo $description;
            ?>
"><?php 
            echo $label;
            ?>
 </h3>
					<?php 
            $i = 0;
            ?>
					<?php 
            foreach ($form->getFieldset($name) as $field) {
                $_depends = FLEXI_J30GE ? $field->getAttribute('depend_class') : $form->getFieldAttribute($field->__get('fieldname'), 'depend_class', '', 'attribs');
                echo '
						<fieldset class="panelform' . ($i ? '' : ' fc-nomargin') . ' ' . ($_depends ? ' ' . $_depends : '') . '" id="' . $field->id . '-container">
							' . ($field->label ? '
								<span class="label-fcouter">' . str_replace('class="', 'class="label label-fcinner ', $field->label) . '</span>
								<div class="container_fcfield">' . $field->input . '</div>
							' : $field->input) . '
						</fieldset>
						';
                $i++;
            }
            ?>
//.........这里部分代码省略.........
开发者ID:khetsothea,项目名称:flexicontent-cck,代码行数:101,代码来源:view.raw.php

示例7: removeOnePhotoActivity

 function removeOnePhotoActivity($app, $uniqueId, $datetime, $photoId, $thumbnail)
 {
     $db = JFactory::getDBO();
     $query = 'SELECT * FROM ' . $db->nameQuote('#__community_activities') . ' ' . 'WHERE ' . $db->nameQuote('app') . '=' . $db->Quote($app) . ' ' . 'AND ' . $db->nameQuote('cid') . '=' . $db->Quote($uniqueId) . ' ' . 'AND ( ' . $db->nameQuote('created') . ' BETWEEN ' . $db->Quote($datetime) . ' ' . 'AND ( ADDTIME(' . $db->Quote($datetime) . ', ' . $db->Quote('00:00:05') . ' ) ) ) ';
     $db->setQuery($query);
     $result = $db->loadObjectList();
     if ($db->getErrorNum()) {
         JError::raiseError(500, $db->stderr());
     }
     $activityId = null;
     $handler = new JParameter(null);
     // the activity data contains photoid and the photo thumbnail
     // which can be useful for us to find the correct activity id
     foreach ($result as $activity) {
         $handler->loadINI($activity->params);
         if ($handler->getValue('photoid') == $photoId) {
             $activityId = $activity->id;
             break;
         }
         if (JString::strpos($activity->content, $thumbnail) !== false) {
             $activityId = $activity->id;
             break;
         }
     }
     if (is_null($activityId)) {
         return $this->removeOneActivity($app, $uniqueId);
     }
     $query = 'DELETE FROM ' . $db->nameQuote('#__community_activities') . ' ' . 'WHERE ' . $db->nameQuote('id') . '=' . $db->Quote($activityId) . ' ' . 'LIMIT 1 ';
     $db->setQuery($query);
     $status = $db->query();
     if ($db->getErrorNum()) {
         JError::raiseError(500, $db->stderr());
     }
     return $status;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:35,代码来源:activities.php

示例8: populateAuthorization

 /**
  * Fetch username/password and Download ID from the component's configuration.
  */
 private function populateAuthorization()
 {
     if (!$this->_requiresAuthorization) {
         return;
     }
     if (substr($this->_extensionName, 0, 3) != 'com') {
         return;
     }
     jimport('joomla.html.parameter');
     jimport('joomla.application.component.helper');
     // Not using JComponentHelper to avoid conflicts ;)
     $db = JFactory::getDbo();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $sql = $db->getQuery(true)->select($db->nq('params'))->from($db->nq('#__extensions'))->where($db->nq('type') . ' = ' . $db->q('component'))->where($db->nq('element') . ' = ' . $db->q($this->_extensionName));
     } else {
         $sql = 'SELECT ' . $db->nameQuote('params') . ' FROM ' . $db->nameQuote('#__components') . ' WHERE ' . $db->nameQuote('option') . ' = ' . $db->Quote($this->_extensionName) . " AND `parent` = 0 AND `menuid` = 0";
     }
     $db->setQuery($sql);
     $rawparams = $db->loadResult();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $params = new JRegistry();
         $params->loadJSON($rawparams);
     } else {
         $params = new JParameter($rawparams);
     }
     $this->_username = $params->getValue('username', '');
     $this->_password = $params->getValue('password', '');
     $this->_downloadID = $params->getValue('downloadid', '');
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:32,代码来源:abstractconfig.php

示例9: populateAuthorization

 /**
  * Fetch username/password and Download ID from the component's configuration.
  */
 private function populateAuthorization()
 {
     if (!$this->_requiresAuthorization) {
         return;
     }
     if (substr($this->_extensionName, 0, 3) != 'com') {
         return;
     }
     jimport('joomla.html.parameter');
     jimport('joomla.application.component.helper');
     $component =& JComponentHelper::getComponent($this->_extensionName);
     $params = new JParameter($component->params);
     $this->_username = $params->getValue('username', '');
     $this->_password = $params->getValue('password', '');
     $this->_downloadID = $params->getValue('downloadid', '');
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:19,代码来源:abstractconfig.php


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