本文整理汇总了PHP中JParameter::get方法的典型用法代码示例。如果您正苦于以下问题:PHP JParameter::get方法的具体用法?PHP JParameter::get怎么用?PHP JParameter::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JParameter
的用法示例。
在下文中一共展示了JParameter::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
static function &geTtoolbarParams($editor, $args = array())
{
if (count($args) > 1) {
$row = $args[1];
}
if (is_a($args[0], 'JParameter')) {
$params = $args[0];
} else {
if ($row) {
$params = new JParameter($row->params);
} else {
$row =& JCKHelper::getTable('toolbar');
// load the row from the db table
$row->load($args[0]);
//get toolbar parameter
$params = new JParameter($row->params);
}
}
$editor_params = new JParameter($editor->params);
$toolbar = $params->get('toolbar', $row->name);
$skins = $params->get('skin', $editor_params->def('skin', 'office2003'));
$width = $params->get('wwidth', $editor_params->def('wwidth', '100%'));
$editor_params->set('toolbar', $toolbar);
$editor_params->set('skin', $skins);
$editor_params->set('wwidth', $width);
$editor_params->Set('hheight', 300);
return $editor_params;
}
示例2: onPrepareContent
/**
* prepare content method
*
* Method is called by the view
*
* @param object The article object. Note $article->text is also available
* @param object The article params
* @param int The 'page' number
*/
function onPrepareContent(&$article, &$params, $limitstart = 0)
{
//load fabrik language
$lang =& JFactory::getLanguage();
$lang->load('com_fabrik');
// 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($article->text, $botRegex) === false) {
return true;
}
jimport('joomla.filesystem.file');
$defines = JFile::exists(JPATH_SITE . DS . 'components' . DS . 'com_fabrik' . DS . 'user_defines.php') ? JPATH_SITE . DS . 'components' . DS . 'com_fabrik' . DS . 'user_defines.php' : JPATH_SITE . DS . 'components' . DS . 'com_fabrik' . DS . 'defines.php';
require_once $defines;
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'parent.php';
require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'json.php';
// $$$ hugh - having to change this to use {[]}
//regex to get nested { {} } string - one layer deep e.g. you cant do { {{}} }
/*
$regex = "/{" .$botRegex ."\s*.*{*.*}*.*?}/i";
$article->text = preg_replace_callback( $regex, array($this, 'parse'), $article->text);
*/
$regex = "/{" . $botRegex . "\\s*.*?}/i";
$res = preg_replace_callback($regex, array($this, 'replace'), $article->text);
if (!JError::isError($res)) {
$article->text = $res;
}
}
示例3: rehashFiles
/**
*
* @param $filenames
* @return unknown_type
*/
function rehashFiles($files, $useFilter = false)
{
if (empty($files)) {
return;
}
settype($files, 'array');
$filter = null;
// Create the filesystem filter.
if ($useFilter) {
// Fetch component config
$confModel =& JModel::getInstance('Configuration', 'JDefenderModel');
$config = new JParameter($confModel->getIni());
$fileExts = explode("\n", trim($config->get('scan_file_patterns', '*'), "\r\n "));
$fileExts = str_replace(array("\n", "\r\n", "\n\r"), '', $fileExts);
$excludedDirs = explode("\n", trim($config->get('scan_excluded_directories', JPATH_ROOT . DS . 'cache' . "\n" . JPATH_ROOT . DS . 'tmp'), "\r\n "));
$excludedDirs = str_replace(array("\n", "\r\n", "\n\r"), '', $excludedDirs);
for ($i = 0, $count = count($excludedDirs); $i < $count; $i++) {
$excludedDirs[$i] = JPath::clean(JPATH_ROOT . DS . $excludedDirs[$i]);
}
$filter = new JD_Filesystem_Filter($fileExts, $excludedDirs);
}
$this->deleteFiles($files);
$count = $this->addFiles($files, $filter);
return $count;
}
示例4: JParameter
function _showMenuDetail($row, $level = 0)
{
$_temp = null;
$title = "title=\"{$row->title}\"";
$menu_params = new JParameter($row->params);
if ($menu_params->get('menu_image') && $menu_params->get('menu_image') != -1) {
$str = '<img src="' . JURI::base(true) . '/' . $menu_params->get('menu_image') . '" alt="' . $row->title . '" /><span class="menusys_name">' . $row->title . '</span>';
} else {
$str = '<span class="menusys_name">' . $row->title . '</span>';
}
$Class = $this->activeClass($row, $level);
$id = 'id="menusys' . $row->id . '"';
if (@$row->url != null) {
if ($row->browserNav == 0) {
$menuItem = '<a href="' . $row->url . '" ' . $Class . ' ' . $id . ' ' . $title . '>' . $str . '</a>';
} elseif ($row->browserNav == 1) {
$menuItem = '<a target="_blank" href="' . $row->url . '" ' . $Class . ' ' . $id . ' ' . $title . '>' . $str . '</a>';
} elseif ($row->browserNav == 2) {
$url = str_replace('index.php', 'index2.php', $tmp->url);
$atts = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=350';
$menuItem = '<a href="' . $url . '" onclick="window.open("' . $url . '",\'targetWindow\',\'' . $atts . '\'); return false;" ' . $Class . ' ' . $id . ' ' . $title . '>' . $str . '</a>';
}
} else {
$menuItem = '<a ' . $id . ' ' . $title . '>' . $str . '</a>';
}
echo $menuItem;
}
示例5: run
function run($form, $actiondata)
{
$events = unserialize(base64_decode($form->form_details->events_actions_map));
$params = new JParameter($actiondata->params);
$targetEvent = $params->get('target_event', '_form_actions_events_map[myform][events][load]');
if (empty($targetEvent)) {
$targetEvent = '_form_actions_events_map[myform][events][load]';
}
$targetEvent = str_replace(array('_form_actions_events_map[', ']'), '', $targetEvent);
$path = explode('[', $targetEvent);
unset($path[0]);
foreach ($path as $k => $v) {
if ($k == count($path)) {
break;
}
$events = $events[$v];
}
$actionsArray = array();
if (isset($form->form_actions)) {
foreach ($form->form_actions as $action_index => $action_data) {
$actionsArray['cfaction_' . $action_data->type . '_' . $action_data->order] = $action_data;
}
}
$form->_processEvents($path[count($path)], $events, $actionsArray);
if ($params->get('quit_next', 1)) {
//halt any future scheduled actions processing (exit the main actions loop)
$form->stop = true;
}
}
示例6: run
function run($form, $actiondata)
{
$mainframe =& JFactory::getApplication();
$params = new JParameter($actiondata->params);
if (isset($form->data['redirect_url']) && $form->data['redirect_url']) {
$redirect_url = $form->data['redirect_url'];
} else {
$redirect_url = $params->get('target_url');
}
if (!$redirect_url) {
$form->debug['redirect_user'][] = 'Error: No Redirect URL found';
return false;
}
$form->debug['redirect_user'][] = 'redirect_user_target_url: ' . $params->get('target_url');
//$mainframe->enqueuemessage('$form: '.print_r($form, true).'<hr />');
//if ( filter_var($redirect_url, FILTER_VALIDATE_URL) ) {
$debug = false;
foreach ($form->form_actions as $a) {
if ($a->type == 'debugger' && $a->enabled) {
$debug = true;
break;
}
}
if ($debug) {
$form->debug['redirect_user'][] = "Redirect URL (click to continue):<br /><a href='{$redirect_url}'>{$redirect_url}</a>";
} else {
$mainframe->redirect($redirect_url);
}
/*} else {
$form->debug['redirect_user'][] = 'Error: Invalid URL';
}*/
}
示例7: run
function run($form, $actiondata)
{
$params = new JParameter($actiondata->params);
$skipped = $params->get('skipped', '');
if (!empty($skipped)) {
$skipped = explode(',', $skipped);
} else {
$skipped = array();
}
$del = $params->get('delimiter', ",");
//handle specific fields only ?
if (strlen($params->get('fields_list', ''))) {
$fields_list = explode(',', $params->get('fields_list', ''));
foreach ($fields_list as $field) {
$field = trim($field);
//get field value
$field_value = $form->get_array_value($form->data, explode('.', $field));
if (is_array($field_value)) {
$form->data = $form->set_array_value($form->data, explode('.', $field), implode($del, $field_value));
}
}
} else {
$form->data = $this->array_handler($form->data, $skipped, $del);
}
}
示例8: run
function run($form, $actiondata)
{
$params = new JParameter($actiondata->params);
$rules = array('required', 'not_empty', 'empty', 'alpha', 'alphanumeric', 'digit', 'nodigit', 'number', 'email', 'phone', 'phone_inter', 'url');
foreach ($rules as $rule) {
$fields_string = trim($params->get($rule, ''));
if (!empty($fields_string)) {
$fields = explode(",", $fields_string);
foreach ($fields as $field) {
$function = 'validate_' . $rule;
$result = $this->{$function}(trim($field), $form);
if (!$result) {
$this->events['fail'] = 1;
if (!isset($form->validation_errors[trim($field)])) {
$form->validation_errors[trim($field)] = $params->get($rule . '_error');
} else {
if (is_array($form->validation_errors[trim($field)])) {
$form->validation_errors[trim($field)][] = $params->get($rule . '_error');
} else {
$form->validation_errors[trim($field)] = array($form->validation_errors[trim($field)], $params->get($rule . '_error'));
}
}
//return false;
}
}
}
}
if ($this->events['fail'] == 0) {
$this->events['success'] = 1;
}
}
示例9: run
function run($form, $actiondata)
{
$params = new JParameter($actiondata->params);
$mainframe = JFactory::getApplication();
//settings, vars
$doc = JFactory::getDocument();
//description
$doc->setDescription($params->get('description', 'Our Contact Page.'));
//keywords
$doc->setMetaData('keywords', $params->get('keywords', ''));
//robots
$doc->setMetaData('robots', $params->get('robots', 'index, follow'));
//generator
$doc->setMetaData('generator', $params->get('generator', 'Joomla! - Chronoforms!'));
//title
$title = $params->get('title', '');
if (trim($title)) {
$doc->setTitle($title);
}
//custom
if (!empty($actiondata->content1)) {
$list = explode("\n", trim($actiondata->content1));
foreach ($list as $item) {
$fields_data = explode("=", $item);
$doc->setMetaData(trim($fields_data[0]), trim($fields_data[1]));
}
}
}
示例10: formatNumber
/**
* Format a number
*
* @param float|int $number
* @param int $decimals
* @return string
*/
function formatNumber($number = 0, $decimals = 0)
{
//verify if we need to represent decimal (ex : 2.00 = 2)
$temp = intval($number);
if ($temp - $number == 0.0) {
$decimals = 0;
}
//decode charset before using number_format
jimport('joomla.utilities.string');
if (function_exists('iconv')) {
$decimal_separator = JString::transcode($this->params->get('decimals_separator', ','), $this->_charset, 'ISO-8859-1');
$thousands_separator = JString::transcode($this->params->get('thousands_separator', ' '), $this->_charset, 'ISO-8859-1');
} else {
$decimal_separator = utf8_decode($this->params->get('decimals_separator', ','));
$thousands_separator = utf8_decode($this->params->get('thousands_separator', ' '));
}
$number = number_format($number, $decimals, $decimal_separator, $thousands_separator);
//re-encode
if (function_exists('iconv')) {
$number = JString::transcode($number, 'ISO-8859-1', $this->_charset);
} else {
$number = utf8_encode($number);
}
return $number;
}
示例11: 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 - hacky fix for nasty issue with IE, which (for gory reasons) doesn't like having our JS content
// wrapped in P tags. But the default WYSIWYG editor in J! will automagically wrap P tags around everything.
// So let's just look for obvious cases of <p>{fabrik ...}</p>, and replace the P's with DIV's.
// Yes, it's hacky, but it'll save us a buttload of support work.
$pregex = "/<p>\\s*{" . $botRegex . "\\s*.*?}\\s*<\\/p>/i";
$row->text = preg_replace_callback($pregex, array($this, 'preplace'), $row->text);
// $$$ hugh - having to change this to use {[]}
$regex = "/{" . $botRegex . "\\s*.*?}/i";
$row->text = preg_replace_callback($regex, array($this, 'replace'), $row->text);
}
示例12: run
function run($form, $actiondata)
{
$mainframe =& JFactory::getApplication();
$session =& JFactory::getSession();
$params = new JParameter($actiondata->params);
//get secret
$secret = $mainframe->getCfg('secret');
$fields = array();
if (strlen(trim($params->get('fields', '')))) {
$fields = explode(',', trim($params->get('fields', '')));
}
$hashed_values = array();
foreach ($fields as $k => $field) {
$hashed_values[$field] = $form->get_array_value($form->data, explode('.', $field));
}
$form->debug['Check Fields Hash'][$actiondata->order] = $hashed_values;
$hash = serialize($hashed_values);
$hash = md5($hash);
$hash = md5($hash . ':' . $secret);
$hash_field_name = trim($params->get('hash_field_name', 'cf_fields_hash'));
if (!empty($form->data[$hash_field_name]) && $form->data[$hash_field_name] == $hash) {
$this->events['success'] = 1;
return true;
} else {
$this->events['fail'] = 1;
return false;
}
}
示例13: update_mod
/**
* Function used to update
*
* @param INT $called_frm //Mundhe complet this
*
* @return Array
*
* @since 1.0.0
*/
public function update_mod($called_frm = '0')
{
$lang = JFactory::getLanguage();
$lang->load('mod_quick2cart', JPATH_ROOT);
$comquick2cartHelper = new comquick2cartHelper();
jimport('joomla.application.module.helper');
if (JModuleHelper::getModule('mod_quick2cart')) {
$module = JModuleHelper::getModule('mod_quick2cart');
if (JVERSION < '1.6.0') {
$moduleParams = new JParameter($module->params);
$layout = $moduleParams->get('viewtype');
$ckout_text = $moduleParams->get('checkout_text');
} else {
$moduleParams = json_decode($module->params);
if (!empty($moduleParams)) {
$layout = $moduleParams->viewtype;
$ckout_text = $moduleParams->checkout_text;
}
}
}
if (isset($layout) && isset($ckout_text)) {
$data = $comquick2cartHelper->get_module($layout, $ckout_text);
} else {
$data = $comquick2cartHelper->get_module();
}
echo $data;
jexit();
}
示例14: getCategoryData
/**
* get all events_categories to use category color
* @return object
*/
function getCategoryData()
{
static $cats;
if (!isset($cats)) {
$db =& JFactory::getDBO();
if (JVersion::isCompatible("1.6.0")) {
$sql = "SELECT c.* FROM #__categories as c WHERE extension='" . JEV_COM_COMPONENT . "' order by c.lft asc";
$db->setQuery($sql);
$cats = $db->loadObjectList('id');
foreach ($cats as &$cat) {
$cat->name = $cat->title;
$params = new JParameter($cat->params);
$cat->color = $params->get("catcolour", "");
$cat->overlaps = $params->get("overlaps", 0);
}
unset($cat);
} else {
$sql = "SELECT c.*, e.color FROM #__jevents_categories AS e LEFT JOIN #__categories as c ON c.id=e.id";
$db->setQuery($sql);
$cats = $db->loadObjectList('id');
}
$dispatcher =& JDispatcher::getInstance();
$dispatcher->trigger('onGetCategoryData', array(&$cats));
}
$dispatcher =& JDispatcher::getInstance();
$dispatcher->trigger('onGetAccessibleCategories', array(&$cats));
return $cats;
}
示例15: run
function run($form, $actiondata)
{
$params = new JParameter($actiondata->params);
$mainframe = JFactory::getApplication();
$vendorid = $params->get('sid');
$secretword = $params->get('secret');
$md5hash = strtoupper(md5($form->data['sale_id'] . $vendorid . $form->data['invoice_id'] . $secretword));
//if the hash is ok
if ($md5hash == $form->data['md5_hash']) {
//switch messages types
switch ($form->data['message_type']) {
case 'ORDER_CREATED':
$this->events['new_order'] = 1;
break;
case 'FRAUD_STATUS_CHANGED':
$this->events['fraud_status'] = 1;
break;
case 'REFUND_ISSUED':
$this->events['refund'] = 1;
break;
default:
$this->events['other'] = 1;
break;
}
} else {
//$this->events['hack'] = 1;
}
}