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


PHP ArrayHelper::clean_r方法代码示例

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


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

示例1: getInput

 public function getInput()
 {
     $app = JFactory::getApplication();
     $model = JModelLegacy::getInstance('Form', 'CobaltModel');
     $type = $model->getRecordType($app->input->getInt('type_id'));
     if (!$this->value) {
         $value = array();
     } else {
         $value = json_decode($this->value, 1);
         if (empty($value)) {
             $value = $this->value;
         }
     }
     if (!is_array($value) && !empty($value)) {
         $value = explode(',', $this->value);
     }
     ArrayHelper::clean_r($value);
     $default = array();
     foreach ($value as $tag) {
         $default[$tag] = $tag;
     }
     /*$query = $db->getQuery(true);
     		$query->select('tag');
     		$query->from('#__js_res_tags');
     		$query->order('tag ASC');
     		$db->setQuery($query);
     		$list = $db->loadColumn();
     		*/
     $this->params = new JRegistry();
     $options['coma_separate'] = 0;
     $options['only_values'] = 0;
     $options['min_length'] = 1;
     $options['max_result'] = 10;
     $options['case_sensitive'] = 0;
     $options['unique'] = 1;
     $options['highlight'] = 1;
     $options['max_width'] = $this->params->get('params.max_width', 500);
     $options['min_width'] = $this->params->get('params.min_width', 400);
     $options['max_items'] = $type->params->get('general.item_tags_max', 25);
     $options['ajax_url'] = 'index.php?option=com_cobalt&task=ajax.tags_list&tmpl=component';
     $options['ajax_data'] = '';
     return JHtml::_('mrelements.listautocomplete', "jform[tags]", "tags", $default, NULL, $options);
 }
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:43,代码来源:metags.php

示例2: getGroups

 protected function getGroups()
 {
     static $groups = array();
     static $nums = 0;
     if (empty($groups)) {
         $db = JFactory::getDBO();
         $query = "SELECT sp.id AS value,\n\t\t\t\t\t\t sp.name AS text,\n\t\t\t\t\t\t sp.group_id,\n\t\t\t\t\t\t g.name AS cat_title\n\t\t\t\t    FROM #__jcs_plans  AS sp\n\t\t\t   LEFT JOIN #__jcs_groups AS g ON g.id = sp.group_id\n\t\t\t   \t   WHERE sp.published = 1\n\t\t\t\tORDER BY g.id, sp.name";
         $db->setQuery($query);
         $plans = $db->loadObjectList();
         ArrayHelper::clean_r($plans);
         foreach ($plans as $plan) {
             $groups[$plan->cat_title][] = JHtml::_('select.option', $plan->value, $plan->text, 'value', 'text');
             $nums++;
         }
         $nums += count($groups);
         $groups = array_merge(parent::getGroups(), $groups);
     }
     $this->num = $nums;
     ArrayHelper::clean_r($groups);
     return $groups;
 }
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:21,代码来源:emeraldplans.php

示例3: defined

/**
 * Cobalt by MintJoomla
 * a component for Joomla! 1.7 - 2.5 CMS (http://www.joomla.org)
 * Author Website: http://www.mintjoomla.com/
 * @copyright Copyright (C) 2012 MintJoomla (http://www.mintjoomla.com). All rights reserved.
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 */
defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();
$document->addStyleDeclaration('
.catselect{
	width:' . $params->get('select_width') . 'px;
}
');
$levels = explode("\r\n", $params->get('levels'));
ArrayHelper::clean_r($levels);
$max_level = count($levels);
?>

<script type="text/javascript">
	var max_level = <?php 
echo $max_level;
?>
;

	!(function($){

		}).jQuery;
			
	function redirectToCategory(cat_id)
	{
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:31,代码来源:select.php

示例4: onContentSearch

 function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
 {
     $out = array();
     $text = trim($text);
     if ($text == '') {
         return $out;
     }
     $db = JFactory::getDbo();
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $groups = implode(',', $user->getAuthorisedViewLevels());
     $tag = JFactory::getLanguage()->getTag();
     require_once JPATH_SITE . '/components/com_cobalt/library/php/helpers/helper.php';
     require_once JPATH_SITE . '/components/com_content/helpers/route.php';
     require_once JPATH_SITE . '/administrator/components/com_search/helpers/search.php';
     $searchText = $text;
     $intersect = array_keys($this->onContentSearchAreas());
     if (is_array($areas)) {
         $intersect = array_intersect($areas, array_keys($this->onContentSearchAreas()));
     }
     if (!$intersect) {
         return $out;
     }
     JArrayHelper::toInteger($intersect);
     $sArchived = $this->params->get('search_archived', 1);
     $limit = $this->params->def('search_limit', 50);
     $nullDate = $db->getNullDate();
     $date = JFactory::getDate();
     $now = $date->toSql();
     $query = $db->getQuery(TRUE);
     $query->select('*');
     $query->from('#__js_res_record');
     $query->where('published = 1');
     $query->where('section_id IN (' . implode(',', $intersect) . ')');
     $search_mode = NULL;
     $scount = explode(" ", $text);
     ArrayHelper::clean_r($scount);
     $search = $db->quote($db->escape($text));
     if (count($scount) > 2) {
         $search_mode = ' IN NATURAL LANGUAGE MODE';
         foreach ($scount as $word) {
             if (in_array(substr($word, 0, 1), array('+', '-'))) {
                 $search_mode = ' IN BOOLEAN MODE';
                 break;
             }
         }
         $query->where("MATCH (fieldsdata) AGAINST ({$search}{$search_mode})");
     } elseif (count($scount) == 1) {
         $query->where("fieldsdata LIKE '%{$text}%'");
     }
     //$query->select("MATCH (fieldsdata) AGAINST ({$search}{$search_mode}) AS searchresult");
     if ($app->isSite() && $app->getLanguageFilter()) {
         $query->where('langs IN (' . $db->Quote($tag) . ',' . $db->Quote('*') . ')');
     }
     switch ($ordering) {
         case 'oldest':
             $order = 'ctime ASC';
             break;
         case 'popular':
             $order = 'hits DESC';
             break;
         case 'alpha':
             $order = 'title ASC';
             break;
         case 'category':
             $order = 'title ASC';
             break;
         case 'newest':
         default:
             $order = 'ctime DESC';
     }
     $query->order($order);
     //echo $query;
     $db->setQuery($query, 0, $limit);
     $result = $db->loadObjectList();
     settype($result, 'array');
     $out = array();
     foreach ($result as $key => $record) {
         $out[$key] = new stdClass();
         $out[$key]->title = $record->title;
         $out[$key]->text = $record->fieldsdata;
         $out[$key]->created = $record->ctime;
         $out[$key]->href = Url::record($record);
         $areas = $this->onContentSearchAreas();
         $out[$key]->section = $areas[$record->section_id . '_section'];
         $out[$key]->browsernav = 0;
     }
     return $out;
 }
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:89,代码来源:cobalt.php


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