本文整理汇总了PHP中JUDirectoryHelper::getCategoryOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDirectoryHelper::getCategoryOptions方法的具体用法?PHP JUDirectoryHelper::getCategoryOptions怎么用?PHP JUDirectoryHelper::getCategoryOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUDirectoryHelper
的用法示例。
在下文中一共展示了JUDirectoryHelper::getCategoryOptions方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOptions
protected function getOptions()
{
$app = JFactory::getApplication();
$view = $app->input->getCmd('view', '');
$parentId = $app->input->getInt('parent_id', 1);
$catId = $app->input->getInt('id', 0);
$options = array();
$_options = array();
foreach ($this->element->children() as $option) {
if ($option->getName() != 'option') {
continue;
}
$tmp = JHtml::_('select.option', (string) $option['value'], JText::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\\-]/', '_', $this->fieldname)), 'value', 'text', (string) $option['disabled'] == 'true');
$tmp->class = (string) $option['class'];
$tmp->onclick = (string) $option['onclick'];
$options[] = $tmp;
}
JLoader::register('JUDirectoryFrontHelperCategory', JPATH_SITE . '/components/com_judirectory/helpers/category.php', false);
JLoader::register('JUDirectoryHelper', JPATH_ADMINISTRATOR . '/components/com_judirectory/helpers/judirectory.php', false);
$checkPublished = $this->element['checkpublished'] == 'true' || $this->element['checkpublished'] == '1' ? true : false;
$checkCreatePermission = false;
if (isset($this->element['checkcreatepermissiononcat'])) {
if ($this->element['checkcreatepermissiononcat'] == 'true' || $this->element['checkcreatepermissiononcat'] == '1') {
$checkCreatePermission = 'category';
}
} elseif ($this->element['checkcreatepermissiononlisting'] == 'true' || $this->element['checkcreatepermissiononlisting'] == '1') {
$checkCreatePermission = 'listing';
}
$getSelf = $this->element['fetchself'] == 'true' || $this->element['fetchself'] == '1' ? true : false;
$startLevel = $this->element['startlevel'] ? $this->element['startlevel'] : 0;
$separation = $this->element['separation'] ? $this->element['separation'] : '|—';
$ignorecat = $this->element['ignorecat'] ? explode(',', $this->element['ignorecat']) : array();
if ($view == 'category') {
if ($catId) {
$_options = JUDirectoryHelper::getCategoryOptions(1, $getSelf, $checkCreatePermission, $checkPublished, array($catId), $startLevel, $separation);
} elseif ($parentId) {
$_options = JUDirectoryHelper::getCategoryOptions(1, $getSelf, $checkCreatePermission, $checkPublished, $ignorecat, $startLevel, $separation);
if ($this->value == "") {
$this->value = $parentId;
}
}
} else {
$_options = JUDirectoryHelper::getCategoryOptions(1, $getSelf, $checkCreatePermission, $checkPublished, $ignorecat, $startLevel, $separation);
}
reset($options);
$options = array_merge($options, $_options);
return $options;
}
示例2:
$optionsStatus[] = JHtml::_('select.option', '1', 'JPUBLISHED');
$optionsStatus[] = JHtml::_('select.option', '0', 'JUNPUBLISHED');
$optionsStatus[] = JHtml::_('select.option', '*', 'JALL');
?>
<?php
echo JHtml::_('select.options', $optionsStatus, 'value', 'text', $this->state->get('filter.state'), true);
?>
</select>
<select name="filter_category" class="inputbox" onchange="this.form.submit()">
<option value=""><?php
echo JText::_('JOPTION_SELECT_CATEGORY');
?>
</option>
<?php
$options = JUDirectoryHelper::getCategoryOptions();
echo JHtml::_('select.options', $options, 'value', 'text', $this->state->get('filter.category'));
?>
</select>
<select name="filter_access" class="inputbox" onchange="this.form.submit()">
<option value=""><?php
echo JText::_('JOPTION_SELECT_ACCESS');
?>
</option>
<?php
echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));
?>
</select>
<select name="filter_language" class="inputbox" onchange="this.form.submit()">
<option value=""><?php
示例3: isset
echo JText::_('COM_JUDIRECTORY_ANY');
?>
</option>
</select>
</div>
</div>
<div class="control-group">
<label id="jform_categories-lbl" for="categories" class="control-label"
title=""><?php
echo JText::_('COM_JUDIRECTORY_CATEGORIES');
?>
</label>
<div class="controls">
<?php
$options = JUDirectoryHelper::getCategoryOptions(1, true, false, true);
$defaultValue = isset($dataSearch['categories']) ? $dataSearch['categories'] : 1;
echo JHtml::_('select.genericList', $options, 'categories[]', 'multiple size="10"', 'value', 'text', $defaultValue);
?>
</div>
</div>
<div class="control-group">
<label id="jform_subcategories-lbl" for="search-sub-categories" class="control-label"
title=""><?php
echo JText::_('COM_JUDIRECTORY_SUBCATEGORIES');
?>
</label>
<div class="controls">
<?php
$defaultValue = isset($dataSearch['search_sub_categories']) ? $dataSearch['search_sub_categories'] : "1";
示例4:
$optionUnFeatured->value = 0;
$optionUnFeatured->text = JText::_("COM_JUDIRECTORY_UNFEATURED");
$featuredArr[] = $optionUnFeatured;
?>
<?php
echo JHtml::_('select.options', $featuredArr, 'value', 'text', $this->state->get('filter.featured'));
?>
</select>
<select name="filter_catid" class="input-medium" onchange="this.form.submit()">
<option value=""><?php
echo JText::_('COM_JUDIRECTORY_SELECT_CATEGORY');
?>
</option>
<?php
$categoryArr = JUDirectoryHelper::getCategoryOptions();
?>
<?php
echo JHtml::_('select.options', $categoryArr, 'value', 'text', $this->state->get('filter.catid'));
?>
</select>
</div>
</fieldset>
<?php
if (empty($this->items)) {
?>
<div class="alert alert-no-items">
<?php
echo JText::_('COM_JUDIRECTORY_NO_MATCHING_RESULTS');
?>
</div>
示例5:
<legend><?php
echo JText::_('COM_JUDIRECTORY_MOVE_CATEGORIES');
?>
</legend>
<div class="span6">
<div class="form-horizontal">
<div class="control-group">
<div class="control-label">
<label><?php
echo JText::_('COM_JUDIRECTORY_MOVE_TO_CATEGORY');
?>
</label>
</div>
<div class="controls">
<?php
$options = JUDirectoryHelper::getCategoryOptions(1, true, "category", false, $ignored_cat_id);
echo JHtml::_('select.genericList', $options, 'categories', '', 'value', 'text', "");
?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<label class="<?php
echo $classTooltip;
?>
" for="extra_fields" title="<?php
echo JText::_('COM_JUDIRECTORY_KEEP_EXTRA_FIELDS') . $separator . JText::_('COM_JUDIRECTORY_KEEP_EXTRA_FIELDS_DESC');
?>
"><?php
echo JText::_('COM_JUDIRECTORY_KEEP_EXTRA_FIELDS');
?>
示例6:
<div class="form-horizontal">
<div class="control-group">
<div class="control-label">
<label for="categories"><?php
echo JText::_('COM_JUDIRECTORY_MOVE_TO_CATEGORY');
?>
</label>
</div>
<div class="controls">
<?php
$fetchSelf = true;
$params = JUDirectoryHelper::getParams();
if (!$params->get('allow_add_listing_to_root', 0)) {
$fetchSelf = false;
}
$options = JUDirectoryHelper::getCategoryOptions(1, $fetchSelf, "listing");
echo JHtml::_('select.genericList', $options, 'categories', '', 'value', 'text', '', 'categories');
?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<label class="<?php
echo $classTooltip;
?>
" for="keep_extra_fields" title="<?php
echo JText::_('COM_JUDIRECTORY_KEEP_EXTRA_FIELDS') . $separator . JText::_('COM_JUDIRECTORY_KEEP_EXTRA_FIELDS_DESC');
?>
"><?php
echo JText::_('COM_JUDIRECTORY_KEEP_EXTRA_FIELDS');
?>
示例7:
echo JText::_('COM_JUDIRECTORY_COPY_CATEGORIES');
?>
</legend>
<div class="form-horizontal">
<div class="row-fluid">
<div class="span6">
<div class="control-group ">
<div class="control-label">
<label for="categories"><?php
echo JText::_('COM_JUDIRECTORY_COPY_TO_CATEGORIES');
?>
</label>
</div>
<div class="controls">
<?php
$options = JUDirectoryHelper::getCategoryOptions(1, true, "category");
echo JHtml::_('select.genericList', $options, 'categories[]', 'class="inputbox" multiple size="6"', 'value', 'text', 1, 'categories');
?>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<div class="control-group ">
<div class="control-label">
<label class="<?php
echo $classTooltip;
?>
" for="subcategories" title="<?php
echo JText::_('COM_JUDIRECTORY_COPY_SUB_CATEGORIES') . $separator . JText::_('COM_JUDIRECTORY_COPY_SUB_CATEGORIES_DESC');
?>