</div> <div class="width-30 <?php echo $bar; ?> active" id="seblod-sidebar"> <div class="seblod" id="seblod-sideblock"> <div class="fltlft seblod-toolbar"><?php Helper_Workshop::displayToolbar('search', $this->item->master, $this->item->client, $this->uix, ''); ?> </div> <?php if (count($this->fieldsAv)) { echo '<div class="legend top center">' . $this->lists['af_t'] . $this->lists['af_a'] . '<br />' . $this->lists['af_c'] . $this->lists['af_f'] . '</div>'; echo '<div id="scroll"><ul class="sortable connected" id="sortable2" myid="2">'; $style = array('1' => ' hide', '2' => ' hide', '3' => ' hide', '4' => ' hide', '5' => ' hide', '6' => ' hide'); foreach ($this->fieldsAv as $field) { $type_field = ''; if (isset($this->type_fields[$field->id])) { $type_field = ' c-' . $this->type_fields[$field->id]->cc; } JCck::callFunc_Array('plgCCK_Field' . $field->type, 'onCCK_FieldConstruct_Search' . $this->item->master, array(&$field, $style, $data)); Helper_Workshop::displayField($field, $type_field); } echo '</ul></div><div id="sortable_original" style="display: none;"></div>'; } ?> </div> </div> </div> <div class="clr" id="seblod-cleaner"></div>
function prepareDisplay() { $app = JFactory::getApplication(); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->option = $app->input->get('option', ''); $this->state = $this->get('State'); // Check Errors if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->item->cck_type = $this->state->get('content_type', ''); $this->item->skip = $this->state->get('skip'); if (@$this->item->id > 0) { $this->isNew = 0; $this->panel_class = 'closed'; $this->panel_style = 'display:none; '; $name = $this->item->name; $app->setUserState(CCK_COM . '.edit.search.client', NULL); } else { $this->isNew = 1; $this->panel_class = 'open'; $this->panel_style = ''; $name = ''; if ($this->item->cck_type != '') { $this->item->storage_location = JCckDatabase::loadResult('SELECT storage_location FROM #__cck_core_types WHERE name = "' . $this->item->cck_type . '"'); if ($this->item->storage_location == 'none') { $this->item->storage_location = ''; } } $this->tpl_list = $this->state->get('tpl.list'); } $this->item->folder = Helper_Admin::getSelected($this->vName, 'folder', $this->item->folder, 1); $this->item->published = Helper_Admin::getSelected($this->vName, 'state', $this->item->published, 1); if ($this->item->skip != '') { $this->item->client = $this->item->skip; $this->item->master = $this->item->client == 'list' || $this->item->client == 'item' ? 'content' : ($this->item->client == 'order' ? 'order' : 'search'); $this->item->layer = $app->input->getString('layer', 'fields'); $P = 'template_' . $this->item->client; $force_template = $this->item->client == 'list' ? $this->state->get('tpl.list') : Helper_Workshop::getDefaultTemplate(); } else { $this->item->client = $this->isNew ? 'search' : $this->state->get('client', $app->input->cookie->getString('cck_search' . $name . '_client', 'search')); $this->item->master = $this->item->client == 'list' || $this->item->client == 'item' ? 'content' : ($this->item->client == 'order' ? 'order' : 'search'); $this->item->layer = $app->input->getString('layer', 'fields'); $P = 'template_' . $this->item->client; $force_template = $this->item->client == 'list' ? '' : Helper_Workshop::getDefaultTemplate(); } $this->style = $this->item->client != 'order' ? Helper_Workshop::getTemplateStyle($this->vName, $this->item->{$P}, $this->state->get('tpl.' . $this->item->client, $force_template)) : ''; $this->item->template = isset($this->style->template) ? $this->style->template : ''; $this->insidebox = Helper_Admin::addInsidebox($this->isNew); Helper_Admin::addToolbarEdit($this->vName, 'COM_CCK_' . _C4_TEXT, array('isNew' => $this->isNew, 'folder' => $this->state->get('filter.folder'), 'checked_out' => $this->item->checked_out), array('template' => $this->item->template)); }
public function duplicate($pk) { $app = JFactory::getApplication(); $db = $this->getDbo(); $title = $app->input->getString('duplicate_title', ''); $user = JFactory::getUser(); if (!$user->authorise('core.create', COM_CCK)) { throw new Exception(JText::_('JERROR_CORE_CREATE_NOT_PERMITTED')); } $table = $this->getTable(); $table->load($pk, true); if ($table->id) { $table->id = 0; if ($title) { $table->title = $title; } else { $table->title .= ' (2)'; } $table->name = ''; if (!$table->check()) { throw new Exception($table->getError()); } $prefix = JCck::getConfig_Param('development_prefix', ''); if ($prefix) { $table->name = $prefix . '_' . $table->name; } // Template Styles $clients = array('search', 'filter', 'list', 'item'); $styles = JCckDatabase::loadObjectList('SELECT * FROM #__template_styles WHERE id IN (' . (int) $table->template_search . ',' . (int) $table->template_filter . ',' . (int) $table->template_list . ',' . (int) $table->template_item . ')', 'id'); foreach ($clients as $client) { $property = 'template_' . $client; $style = $styles[$table->{$property}]; if (!(is_object($style) && $style->id)) { $style = Helper_Workshop::getDefaultStyle($client == 'list' ? 'seb_table' : 'seb_one'); } $table->{$property} = Helper_Workshop::getTemplateStyleInstance($style->id, $style->template, $style->template, $style->params, $table->name . ' (' . $client . ')', true); } if (!$table->store()) { throw new Exception($table->getError()); } if (!$table->id) { return 0; } // Fields $query = 'SELECT a.*, b.storage_table FROM #__cck_core_search_field AS a LEFT JOIN #__cck_core_fields AS b ON b.id = a.fieldid WHERE a.searchid = ' . (int) $pk; $string = $this->_table_no_key_batch('query', $query, '#__cck_core_search_field', 'searchid', $table->id, array('storage_table')); // Positions $string = $this->_table_no_key_batch('where', 'searchid = ' . (int) $pk, '#__cck_core_search_position', 'searchid', $table->id); } }
<div class="legend top left"><?php echo JText::_('COM_CCK_RENDERING') . '<span class="mini">(' . JText::_('COM_CCK_FOR_VIEW_' . $this->item->client) . ')</span>'; ?> </div> <ul class="adminformlist adminformlist-2cols"> <?php echo JCckDev::renderForm($cck['core_template'], $this->style->template, $config); echo '<input type="hidden" name="template2" value="' . $this->style->template . '" />'; $style_title = strlen($this->style->title) > 32 ? substr($this->style->title, 0, 32) . '...' : $this->style->title; echo '<li><label>' . JText::_('COM_CCK_STYLE') . '</label><span class="variation_value adminformlist-maxwidth" title="' . $this->style->title . '">' . $style_title . '</span>' . '<input class="inputbox" type="hidden" id="template_' . $this->item->client . '" name="template_' . $this->item->client . '" value="' . $this->style->id . '" /></li>'; ?> </ul> </div> <div class="seblod"> <div class="legend top left"><?php echo '⇒ ' . JText::_('COM_CCK_CSS'); ?> </div> <ul class="adminformlist adminformlist-2cols"> <?php echo JCckDev::renderForm('core_dev_text', @$this->style->params['rendering_css_class'], $config, array('label' => 'Root Class', 'size' => '16', 'storage_field' => 'params[rendering_css_class]')); ?> </ul> </div> <?php if (is_object($this->style)) { Helper_Workshop::getTemplateParams($this->style->xml, '//config', 'params', $this->style->params); } ?> </div> <div class="clr"></div>
var encoded = $.toJSON(data); parent.jQuery("#"+elem).val(encoded); this.close(); return; } } $(document).ready(function(){ var elem = "pos-' . $this->item->id . '_variation_options"; var encoded = parent.jQuery("#"+elem).val(); var data = (encoded != "") ? $.evalJSON(encoded) : ""; $.each(data, function(k, v) { $("#"+k).val( v ); }); }); })(jQuery); '; $doc->addScriptDeclaration($js); require_once JPATH_ADMINISTRATOR . '/components/' . CCK_COM . '/helpers/helper_workshop.php'; Helper_Include::addTooltip('label[title]', 'top left', 'bottom left'); JFactory::getLanguage()->load('files_var_cck_' . $this->item->name . '.sys', JPATH_SITE); JFactory::getLanguage()->load('files_var_cck_seb_css3.sys', JPATH_SITE); $template = isset($this->item->type) && $this->item->type != '' ? $this->item->type : 'seb_one'; $path = JPATH_SITE . '/templates/' . $template . '/variations/' . $this->item->name . '/options.xml'; if (!file_exists($path)) { $path = JPATH_LIBRARIES_CCK . '/rendering/variations/' . $this->item->name . '/options.xml'; } else { JFactory::getLanguage()->load('tpl_' . $template, JPATH_SITE); } $xml = JPath::clean($path); Helper_Workshop::getTemplateParams($xml, '//form');
} $item = new stdClass(); $item->client = $elem == 'type' ? 'site' : 'search'; $item->id = JCckDatabase::loadResult('SELECT id FROM #__cck_core_' . $elem . 's WHERE name = "' . (string) $name . '"'); if (!$item->id) { return; } $live = $app->input->getString('live', ''); $variat = $app->input->getString('variat', ''); $values = getOptions($live); $variations = getOptions($variat); // Variations $opts = array(JHtml::_('select.option', '', '- ' . JText::_('COM_CCK_INHERITED') . ' -'), JHtml::_('select.option', 'clear', JText::_('COM_CCK_CLEAR')), JHtml::_('select.option', 'hidden', JText::_('COM_CCK_HIDDEN')), JHtml::_('select.option', 'value', JText::_('COM_CCK_VALUE')), JHtml::_('select.option', '<OPTGROUP>', JText::_('COM_CCK_FORM')), JHtml::_('select.option', 'form', JText::_('COM_CCK_DEFAULT')), JHtml::_('select.option', 'form_filter', JText::_('COM_CCK_FORM_FILTER')), JHtml::_('select.option', 'disabled', JText::_('COM_CCK_FORM_DISABLED')), JHtml::_('select.option', '</OPTGROUP>', '')); // Process require_once JPATH_ADMINISTRATOR . '/components/' . CCK_COM . '/helpers/helper_workshop.php'; $fields = Helper_Workshop::getFields($elem, $item, 'AND (( c.live = "" AND c.live_value = "" ) OR ( c.live = "" AND c.live_value != "" AND c.variation != "hidden" ) OR ( c.live != "" AND c.live != "stage" ))', false, true); if (count($fields)) { foreach ($fields as $pos) { foreach ($pos as $field) { $value = isset($values[$field->name]) ? htmlspecialchars($values[$field->name]) : ''; $variat = isset($variations[$field->name]) ? $variations[$field->name] : ''; $variat = $variat == 'none' ? $variat = 'hidden' : $variat; // TODO: FIX TO REMOVE AFTER GA $variation = Jhtml::_('select.genericlist', $opts, 'variation_' . $field->name, 'size="1" class="inputbox variation_values" onchange="CCK_setOptions(\'variation\');"', 'value', 'text', $variat); $html .= '<label style="padding-left: 10px;">' . $field->title . '</label>' . '<input class="live_values inputbox" type="text" id="live_' . $field->name . '" name="live_' . $field->name . '" value="' . $value . '" onchange="CCK_setOptions(\'live\');" />' . $variation . '<div class="clear"></div>'; } } } echo $html; ?>
function setPosition($name, $title = '') { $title = !empty($title) ? $title : $name; $legend = '<input class="thin blue" type="text" name="ffp[pos-' . $name . '][legend]" value="' . htmlspecialchars(@$this->positions[$name]->legend) . '" size="22" />'; $variat = Jhtml::_('select.genericlist', $this->variations, 'ffp[pos-' . $name . '][variation]', 'size="1" class="thin blue c_var_ck"', 'value', 'text', $this->positions[$name]->variation, 'pos-' . $name . '_variation'); $variat .= '<input type="hidden" id="pos-' . $name . '_variation_options" name="ffp[pos-' . $name . '][variation_options]" value="' . htmlspecialchars(@$this->positions[$name]->variation_options) . '" />'; $width = '<input class="thin blue" type="text" name="ffp[pos-' . $name . '][width]" value="' . @$this->positions[$name]->width . '" size="8" style="text-align:center;" /> x '; $height = '<input class="thin blue" type="text" name="ffp[pos-' . $name . '][height]" value="' . @$this->positions[$name]->height . '" size="8" style="text-align:center;" />'; $css = ''; Helper_Workshop::displayPosition($this->p, $name, '# ' . $title, $legend, $variat, @$this->positions[$name]->variation, $width, $height, $css); $this->p++; return $name; }
public function ajax_field_li($field = NULL, $client = '') { $app = JFactory::getApplication(); $lang = JFactory::getLanguage(); if (is_object($field)) { $return = true; $element = 'type'; $master = $client == 'content' || $client == 'intro' ? 'content' : 'form'; require_once JPATH_COMPONENT . '/helpers/helper_admin.php'; } else { $return = false; $fieldname = $app->input->get('fieldname', ''); $element = $app->input->get('element', 'type'); $client = $app->input->get('client', 'admin'); if ($element == 'search') { $master = $client == 'order' ? 'order' : ($client == 'list' || $client == 'item' ? 'content' : 'search'); $lang->load('plg_cck_field_field_x'); $lang->load('plg_cck_field_group_x'); } else { $master = $client == 'content' || $client == 'intro' ? 'content' : 'form'; } $field = JCckDatabase::loadObject('SELECT a.id, a.title, a.name, a.folder, a.type, a.label FROM #__cck_core_fields AS a WHERE a.name="' . $fieldname . '"'); if (!is_object($field)) { return; } require_once JPATH_COMPONENT . '/helpers/helper_admin.php'; require_once JPATH_COMPONENT . '/helpers/helper_workshop.php'; } require_once JPATH_SITE . '/plugins/cck_field/' . $field->type . '/' . $field->type . '.php'; $lang->load('plg_cck_field_' . $field->type); $style = array('1' => '', '2' => ' hide', '3' => ' hide', '4' => ' hide', '5' => ' hide', '6' => ' hide', '7' => ' hide'); $data = Helper_Workshop::getParams($element, $master, $client); JCck::callFunc_Array('plgCCK_Field' . $field->type, 'onCCK_FieldConstruct_' . $element . $master, array(&$field, $style, $data)); $json = array(); ob_start(); Helper_Workshop::displayField($field); $json["id"] = (int) $field->id; $json["html"] = ob_get_clean(); if ($return !== false) { return JCckDev::toJSON($json); } echo JCckDev::toJSON($json); }
function prepareDisplay() { $app = JFactory::getApplication(); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->option = $app->input->get('option', ''); $this->state = $this->get('State'); // Check Errors if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } if (@$this->item->id > 0) { $this->isNew = 0; $this->panel_class = 'closed'; $this->panel_style = 'display:none; '; $name = $this->item->name; $app->setUserState(CCK_COM . '.edit.type.client', NULL); } else { $this->isNew = 1; $this->panel_class = 'open'; $this->panel_style = ''; $name = ''; $featured = $this->state->get('skeleton_id', 0); if ($featured == 11) { $this->item->storage_location = 'joomla_category'; } elseif ($featured == 13) { $this->item->storage_location = 'joomla_user'; } elseif ($featured == 14) { $this->item->storage_location = 'joomla_user_group'; } } $this->item->folder = Helper_Admin::getSelected($this->vName, 'folder', $this->item->folder, 1); $this->item->published = Helper_Admin::getSelected($this->vName, 'state', $this->item->published, 1); $this->item->client = $this->isNew ? 'admin' : $this->state->get('client', $app->input->cookie->getString('cck_type' . $name . '_client', 'admin')); $this->item->master = $this->item->client == 'content' || $this->item->client == 'intro' ? 'content' : 'form'; $this->item->layer = $app->input->getString('layer', 'fields'); $P = 'template_' . $this->item->client; $this->style = Helper_Workshop::getTemplateStyle($this->vName, $this->item->{$P}, $this->state->get('tpl.' . $this->item->client, 'seb_one')); $this->item->template = $this->style->template; $this->insidebox = Helper_Admin::addInsidebox($this->isNew); Helper_Admin::addToolbarEdit($this->vName, 'COM_CCK_' . _C2_TEXT, array('isNew' => $this->isNew, 'folder' => $this->state->get('filter.folder'), 'checked_out' => $this->item->checked_out), array('template' => $this->style->template)); }
public static function getPositionVariations($template = '', $default = true) { $path = JPATH_SITE . '/libraries/cck/rendering/variations'; $variations = $default !== false ? array('' => '- ' . JText::_('COM_CCK_DEFAULT') . ' -', 'empty' => '- ' . JText::_('COM_CCK_EMPTY') . ' -', 'none' => '- ' . JText::_('COM_CCK_NONE') . ' -') : array('none' => '- ' . JText::_('COM_CCK_NONE') . ' -'); jimport('joomla.filesystem.folder'); $list = JFolder::folders($path, '.', false, false, array('empty')); if (is_array($list) && count($list)) { $variations[] = JHtml::_('select.option', '<OPTGROUP>', JText::_('COM_CCK_LIBRARY')); $list = array_combine(array_values($list), $list); $variations = array_merge($variations, $list); } if (!self::$template && $template) { self::$template = $template; } if (self::$template != '') { $path = JPATH_SITE . '/templates/' . self::$template . '/variations'; $list = JFolder::folders($path, '.', false, false); if (is_array($list) && count($list)) { $variations[] = JHtml::_('select.option', '<OPTGROUP>', JText::_('COM_CCK_TEMPLATE')); $list = array_combine(array_values($list), $list); $variations = array_merge($variations, $list); } } return $variations; }
<?php for (; $i < $n; $i++) { $this->setPosition($positions[$i]); } ?> </ul> </div> </div> <div class="width-30 <?php echo $bar; ?> active" id="seblod-sidebar"> <div class="seblod" id="seblod-sideblock"> <div class="fltlft seblod-toolbar"><?php Helper_Workshop::displayToolbar('type', $this->item->master, $this->item->client, $this->uix, $clone); ?> </div> </div> </div> </div> <div class="clr" id="seblod-cleaner"></div> <script type="text/javascript"> jQuery(document).ready(function($){ $("div#scroll").slideToggle(); $("#more_positions").live("click", function() { $("ul.more_pos").slideToggle(); }); $("#more_fields").live("click", function() { $("div#scroll").slideToggle();
public function getItemsSelect() { $items = array(); $template = Helper_Workshop::getDefaultTemplate(); $options = JCckDatabase::loadObjectList('SELECT a.name AS value, a.title AS text FROM #__cck_core_templates AS a WHERE a.mode = 1 AND a.published = 1 ORDER BY a.title asc'); $items['admin'] = Jhtml::_('select.genericlist', $options, 'template_admin', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template); $items['site'] = Jhtml::_('select.genericlist', $options, 'template_site', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template); $options = JCckDatabase::loadObjectList('SELECT a.name AS value, a.title AS text FROM #__cck_core_templates AS a WHERE a.mode = 0 AND a.published = 1 ORDER BY a.title asc'); $items['content'] = Jhtml::_('select.genericlist', $options, 'template_content', 'class="inputbox" size="1" style="margin-bottom: 8px;"', 'value', 'text', $template); return $items; }