예제 #1
0
 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('JUDownloadFrontHelperCategory', JPATH_SITE . '/components/com_judownload/helpers/category.php', false);
     JLoader::register('JUDownloadHelper', JPATH_ADMINISTRATOR . '/components/com_judownload/helpers/judownload.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';
         }
     } else {
         if ($this->element['checkcreatepermissionondoc'] == 'true' || $this->element['checkcreatepermissionondoc'] == '1') {
             $checkCreatePermission = 'document';
         }
     }
     $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 = JUDownloadHelper::getCategoryOptions(1, $getSelf, $checkCreatePermission, $checkPublished, array($catId), $startLevel, $separation);
         } elseif ($parentId) {
             $_options = JUDownloadHelper::getCategoryOptions(1, $getSelf, $checkCreatePermission, $checkPublished, $ignorecat, $startLevel, $separation);
             if ($this->value == "") {
                 $this->value = $parentId;
             }
         }
     } else {
         $_options = JUDownloadHelper::getCategoryOptions(1, $getSelf, $checkCreatePermission, $checkPublished, $ignorecat, $startLevel, $separation);
     }
     reset($options);
     $options = array_merge($options, $_options);
     return $options;
 }
예제 #2
0
$optionUnFeatured->value = 0;
$optionUnFeatured->text = JText::_("COM_JUDOWNLOAD_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_JUDOWNLOAD_SELECT_CATEGORY');
?>
</option>
					<?php 
$categoryArr = JUDownloadHelper::getCategoryOptions();
?>
					<?php 
echo JHtml::_('select.options', $categoryArr, 'value', 'text', $this->state->get('filter.catid'));
?>
				</select>

				<select name="filter_licenseid" class="input-medium" onchange="this.form.submit()">
					<option value=""><?php 
echo JText::_('COM_JUDOWNLOAD_SELECT_LICENSE');
?>
</option>
					<?php 
$licenseArr = JUDownloadHelper::getLicenseOptions();
?>
					<?php 
예제 #3
0
						?>
						<select name="condition" id="condition">
							<option
								value="1" <?php echo $defaultValue == 1 ? "selected" : "" ?>><?php echo JText::_('COM_JUDOWNLOAD_ALL'); ?></option>
							<option
								value="2" <?php echo $defaultValue == 2 ? "selected" : "" ?>><?php echo JText::_('COM_JUDOWNLOAD_ANY'); ?></option>
						</select>
					</div>
				</div>
				<div class="control-group">
					<label id="jform_categories-lbl" for="categories" class="control-label"
					       title=""><?php echo JText::_('COM_JUDOWNLOAD_CATEGORIES'); ?></label>

					<div class="controls">
						<?php
						$options = JUDownloadHelper::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_JUDOWNLOAD_SUBCATEGORIES'); ?></label>

					<div class="controls">
						<?php
						$defaultValue = isset($dataSearch['search_sub_categories']) ? $dataSearch['search_sub_categories'] : "1";
						?>
						<select name="search_sub_categories" id="search-sub-categories">
							<option
예제 #4
0
						<option value="0" <?php 
echo $this->state->get('filter.featured') === '0' ? "selected" : "";
?>
><?php 
echo JText::_('COM_JUDOWNLOAD_UNFEATURED');
?>
</option>
					</select>

					<select name="filter_catid" class="input-medium" onchange="this.form.submit()">
						<option value=""><?php 
echo JText::_('COM_JUDOWNLOAD_SELECT_CATEGORY');
?>
</option>
						<?php 
$options = JUDownloadHelper::getCategoryOptions();
echo JHtml::_('select.options', $options, 'value', 'text', $this->state->get('filter.catid'));
?>
					</select>

					<select name="filter_licenseid" class="input-medium" onchange="this.form.submit()">
						<option value=""><?php 
echo JText::_('COM_JUDOWNLOAD_SELECT_LICENSE');
?>
</option>
						<?php 
$options = JUDownloadHelper::getLicenseOptions();
echo JHtml::_('select.options', $options, 'value', 'text', $this->state->get('filter.license'));
?>
					</select>
예제 #5
0
			<legend><?php 
echo JText::_('COM_JUDOWNLOAD_MOVE_CATEGORIES');
?>
</legend>
			<div class="span6">
				<div class="form-horizontal">
					<div class="control-group">
						<div class="control-label">
								<label><?php 
echo JText::_('COM_JUDOWNLOAD_MOVE_TO_CATEGORY');
?>
</label>
						</div>
						<div class="controls">
							<?php 
$options = JUDownloadHelper::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_JUDOWNLOAD_KEEP_EXTRA_FIELDS') . $separator . JText::_('COM_JUDOWNLOAD_KEEP_EXTRA_FIELDS_DESC');
?>
"><?php 
echo JText::_('COM_JUDOWNLOAD_KEEP_EXTRA_FIELDS');
?>
예제 #6
0
?>
</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_JUDOWNLOAD_COPY_TO_CATEGORIES');
?>
</label>
							</div>
							<div class="controls">
								<?php 
$options = JUDownloadHelper::getCategoryOptions(1, true, "document");
$params = JUDownloadHelper::getParams();
if (!$params->get('allow_add_doc_to_root', 0)) {
    $rootCat = JUDownloadFrontHelperCategory::getRootCategory();
    foreach ($options as $key => $option) {
        if ($option->value == $rootCat->id) {
            unset($options[$key]);
            break;
        }
    }
}
echo JHtml::_('select.genericList', $options, 'categories[]', 'multiple size="10"', 'value', 'text', '', 'categories');
?>
							</div>
						</div>
예제 #7
0
echo JText::_('COM_JUDOWNLOAD_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_JUDOWNLOAD_COPY_TO_CATEGORIES');
?>
</label>
							</div>
							<div class="controls">
								<?php 
$options = JUDownloadHelper::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_JUDOWNLOAD_COPY_SUB_CATEGORIES') . $separator . JText::_('COM_JUDOWNLOAD_COPY_SUB_CATEGORIES_DESC');