function prepareDisplay_Ajax() { $featured = $this->state->get('skeleton_id', 0); // Fields $objects = ''; $pos = isset($this->style->positions[0]->value) ? $this->style->positions[0]->value : 'mainbody'; $this->fields = Helper_Workshop::getFields('type', $this->item, 'a.folder = ' . (int) $featured, false, false, $pos); $this->fieldsAv = Helper_Workshop::getFieldsAv('type', $this->item, $objects, 'a.folder != ' . (int) $featured); $this->type_fields = JCckDatabase::loadObjectList('SELECT fieldid, GROUP_CONCAT(DISTINCT typeid separator " c-") AS cc FROM #__cck_core_type_field group by fieldid', 'fieldid'); // Positions $positions = Helper_Workshop::getPositions('type', $this->item); if (count($this->style->positions)) { $this->positions = array(); foreach ($this->style->positions as $p) { if ($p->value) { $this->positions[$p->value] = new stdClass(); $this->positions[$p->value]->title = $p->text; $this->positions[$p->value]->name = $p->value; $this->positions[$p->value]->disable = false; $this->positions[$p->value]->legend = @$positions[$p->value]->legend; $this->positions[$p->value]->variation = @$positions[$p->value]->variation; $this->positions[$p->value]->variation_options = @$positions[$p->value]->variation_options; $this->positions[$p->value]->width = @$positions[$p->value]->width; $this->positions[$p->value]->height = @$positions[$p->value]->height; } } } $this->positions_nb = count($this->positions); $this->variations = Helper_Workshop::getPositionVariations($this->style->template); // Filters $max_width = JCck::on() ? '' : ' style="max-width:180px;"'; $default_f = $this->item->id > 0 ? $this->item->folder : ''; $options = Helper_Admin::getPluginOptions('field', 'cck_', true, false, true); $this->lists['af_t'] = JHtml::_('select.genericlist', $options, 'filter_type', 'class="inputbox filter input-medium" prefix="t-"' . $max_width, 'value', 'text', '', 'filter1'); $options = Helper_Admin::getAlphaOptions(true); $this->lists['af_a'] = JHtml::_('select.genericlist', $options, 'filter_alpha', 'class="inputbox filter input-medium" prefix="a-"', 'value', 'text', '', 'filter3'); $options = Helper_Admin::getTypeOptions(true, false); $this->lists['af_c'] = JHtml::_('select.genericlist', $options, 'filter_type', 'class="inputbox filter input-medium" prefix="c-"' . $max_width, 'value', 'text', '', 'filter4'); $options = Helper_Admin::getFolderOptions(true, true, false, true, 'field'); $this->lists['af_f'] = JHtml::_('select.genericlist', $options, 'filter_folder', 'class="inputbox filter input-medium" prefix="f-"' . $max_width, 'value', 'text', $default_f, 'filter2'); }
function prepareDisplay_Ajax() { // Fields if ($this->item->cck_type != '' && !$this->item->skip) { $pos = isset($this->style->positions[0]->value) ? $this->style->positions[0]->value : 'mainbody'; $this->fields = Helper_Workshop::getFields('search', $this->item, 'a.name = "cck"', false, false, $pos); $this->fields[$pos][0]->variation = 'hidden'; $this->fields[$pos][0]->match_mode = 'exact'; $this->fields[$pos][0]->live_value = $this->item->cck_type; $this->fieldsAv = Helper_Workshop::getFieldsAv('search', $this->item, '', 'a.name != "cck"'); } else { $this->fields = Helper_Workshop::getFields('search', $this->item); $this->fieldsAv = Helper_Workshop::getFieldsAv('search', $this->item, ''); } $this->type_fields = JCckDatabase::loadObjectList('SELECT fieldid, GROUP_CONCAT(DISTINCT typeid separator " c-") AS cc FROM #__cck_core_type_field group by fieldid', 'fieldid'); // Positions $positions = Helper_Workshop::getPositions('search', $this->item); if (is_object($this->style) && count($this->style->positions)) { $this->positions = array(); foreach ($this->style->positions as $p) { if ($p->value) { $this->positions[$p->value] = new stdClass(); $this->positions[$p->value]->title = $p->text; $this->positions[$p->value]->name = $p->value; $this->positions[$p->value]->disable = false; $this->positions[$p->value]->legend = @$positions[$p->value]->legend; $this->positions[$p->value]->variation = @$positions[$p->value]->variation; $this->positions[$p->value]->variation_options = @$positions[$p->value]->variation_options; $this->positions[$p->value]->width = @$positions[$p->value]->width; $this->positions[$p->value]->height = @$positions[$p->value]->height; $this->positions[$p->value]->css = @$positions[$p->value]->css; } } } else { $this->positions = array('mainbody' => (object) array('title' => '(mainbody)', 'name' => 'mainbody', 'disable' => false, 'legend' => '', 'variation' => '', 'variation_options' => '', 'width' => '', 'height' => '')); } $this->positions_nb = count($this->positions); $this->variations = Helper_Workshop::getPositionVariations($this->item->template); // Filters $max_width = JCck::on() ? '' : ' style="max-width:180px;"'; $default_f = $this->item->id > 0 ? $this->item->folder : ''; $options = Helper_Admin::getPluginOptions('field', 'cck_', true, false, true); $this->lists['af_t'] = JHtml::_('select.genericlist', $options, 'filter_type', 'class="inputbox filter" size="1" prefix="t-"' . $max_width, 'value', 'text', '', 'filter1'); $options = Helper_Admin::getAlphaOptions(true); $this->lists['af_a'] = JHtml::_('select.genericlist', $options, 'filter_alpha', 'class="inputbox filter" size="1" prefix="a-"', 'value', 'text', '', 'filter3'); $options = Helper_Admin::getTypeOptions(true, false); $this->lists['af_c'] = JHtml::_('select.genericlist', $options, 'filter_type', 'class="inputbox filter" size="1" prefix="c-"' . $max_width, 'value', 'text', '', 'filter4'); $options = Helper_Admin::getFolderOptions(true, true, false, true, 'field'); $this->lists['af_f'] = JHtml::_('select.genericlist', $options, 'filter_folder', 'class="inputbox filter" size="1" prefix="f-"' . $max_width, 'value', 'text', $default_f, 'filter2'); }