예제 #1
0
 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');
 }
예제 #2
0
파일: new.php 프로젝트: hamby/SEBLOD
<?php

/**
* @version 			SEBLOD 3.x Core ~ $Id: new.php sebastienheraud $
* @package			SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url				http://www.seblod.com
* @editor			Octopoos - www.octopoos.com
* @copyright		Copyright (C) 2009 - 2016 SEBLOD. All Rights Reserved.
* @license 			GNU General Public License version 2 or later; see _LICENSE.php
**/
defined('_JEXEC') or die;
$elem = JText::_('COM_CCK_' . _C2_TEXT);
Helper_Include::addDependencies($this->getName(), $this->getLayout());
$options = array();
$options[] = JHtml::_('select.option', 0, '- ' . JText::_('COM_CCK_NONE') . ' -', 'value', 'text');
$options2 = Helper_Admin::getFolderOptions(false, false, true, true, '', true);
if (count($options2)) {
    $options = array_merge($options, $options2);
}
$template = Helper_Admin::getDefaultTemplate();
$lists['featured'] = JHtml::_('select.genericlist', $options, 'featured', 'class="inputbox" size="1"', 'value', 'text', 10, 'featured');
$doc = JFactory::getDocument();
$js = '
			(function ($){
				JCck.Dev = {
					submit: function() {
						var skeleton_id = $("#featured").val();
						var tpl_a = $("#tpl_admin").val();
						var tpl_s = $("#tpl_site").val();
						var tpl_c = $("#tpl_content").val();
						var tpl_i = $("#tpl_intro").val();
예제 #3
0
 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');
 }