public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Prepare $link = ''; $html = ''; $text = ''; if ($value) { $app = JFactory::getApplication(); $menu = $app->getMenu()->getItem($value); if (is_object($menu)) { $link = JRoute::_('index.php?Itemid=' . $value); $text = $menu->title; $html = '<a href="' . $link . '">' . $text . '</a>'; } else { $value = ''; } } // Set $field->html = $html; $field->link = $link; $field->linked = true; $field->text = $text; $field->typo_target = 'text'; $field->value = $value; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); $html = ''; if ($value || ($config['client'] == 'list' || $config['client'] == 'item')) { $location = isset($config['location']) && $config['location'] ? $config['location'] : 'joomla_article'; $properties = array('context'); $properties = JCck::callFunc('plgCCK_Storage_Location' . $location, 'getStaticProperties', $properties); /* temporary fix for content categories */ if ($properties['context'] == 'com_categories.category') { $properties['context'] = 'com_content.category'; // todo: dynamic context per extension (#__categories) } /* temporary fix for content categories */ if (is_object($value) && isset($value->tags)) { $value = $value->tags; } $tags = new JHelperTags(); $tags->getItemTags($properties['context'], $config['pk']); $tagLayout = new JLayoutFile('joomla.content.tags'); $html = $tagLayout->render($tags->itemTags); } // Set $field->value = $value; $field->html = $html; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $options2 = JCckDev::fromJSON($field->options2); $divider = ''; $lang_code = ''; $value2 = ''; /* tmp */ $jtext = $config['doTranslation']; $config['doTranslation'] = 0; /* tmp */ // Prepare self::_languageDetection($lang_code, $value2, $options2); if ($field->bool3) { $divider = $field->divider != '' ? $field->divider : ','; } $options_2 = self::_getOptionsList($options2, $field->bool2, $lang_code, true); $field->options = $field->options ? $field->options . '||' . $options_2 : $options_2; // Set $field->text = parent::g_getOptionText($value, $field->options, $divider, $config); $field->value = $value; $field->typo_target = 'text'; /* tmp */ $config['doTranslation'] = $jtext; /* tmp */ }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $id = $field->name; // Prepare // Prepare $html = ''; if ($field->state) { $group_id = $field->location != '' ? $field->location : 'cck_tabs1'; if ($field->bool == 2) { $html = JCckDevTabs::end(); } elseif ($field->bool == 1) { $html = JCckDevTabs::open($group_id, $id, $field->label); } else { $html = JCckDevTabs::start($group_id, $id, $field->label, array('active' => $id)); } } // Set $field->html = $html; $field->value = $field->label; $field->label = ''; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $html = ''; // Prepare if ($field->bool == 2) { $html = '</div>'; } elseif ($field->bool == 1) { $class = $field->markup_class ? ' class="' . trim($field->markup_class) . '"' : ''; $attr = $class . ($field->attributes ? ' ' . $field->attributes : ''); $html = '</div><div' . $attr . '>'; } else { $class = $field->markup_class ? ' class="' . trim($field->markup_class) . '"' : ''; $attr = $class . ($field->attributes ? ' ' . $field->attributes : ''); $html = '<div' . $attr . '>'; } // Set $field->html = $html; $field->value = ''; $field->label = ''; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); $name = $field->name; $dispatcher = JDispatcher::getInstance(); $f = self::_getChild($field, $config); $xn = $value; $content = array(); if ($xn > 0 && is_object($f)) { for ($xi = 0; $xi < $xn; $xi++) { $f_value = ''; $inherit = array('parent' => $field->name, 'xi' => $xi); $content[$xi] = clone $f; // $table = $f->storage_table; if ($table && !isset($config['storages'][$table])) { $config['storages'][$table] = ''; $dispatcher->trigger('onCCK_Storage_LocationPrepareForm', array(&$f, &$config['storages'][$table], $config['pk'])); } $dispatcher->trigger('onCCK_StoragePrepareForm_Xi', array(&$f, &$f_value, &$config['storages'][$table], $name, $xi)); // $dispatcher->trigger('onCCK_FieldPrepareContent', array(&$content[$xi], $f_value, &$config, $inherit, true)); } if ($content[0]) { $field->display = $content[0]->display; } } $field->value = $content; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $doTranslation = $config['doTranslation']; if ($config['doTranslation']) { $config['doTranslation'] = $field->bool8; } // Prepare $divider = $field->divider != '' ? $field->divider : ','; if (is_array($value)) { $value = implode($divider, $value); } // Set $field->text = parent::g_getOptionText($value, $field->options, $divider, $config); $field->value = $value; $texts = explode($divider, $field->text); $values = explode($divider, $field->value); if (count($values)) { $field->values = array(); foreach ($values as $k => $v) { $field->values[$k] = (object) array('text' => $texts[$k], 'typo_target' => 'text', 'value' => $v); } } $field->typo_target = 'text'; $config['doTranslation'] = $doTranslation; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $id = $field->name; $form_id = $field->name . '_form'; $name = $field->name; $value = $field->label; $field->label = ''; // Prepare $pre_task = ''; $options2 = JCckDev::fromJSON($field->options2); $task = isset($options2['task']) && $options2['task'] ? $options2['task'] : 'save'; $task_auto = isset($options2['task_auto']) && $options2['task_auto'] == '0' ? 0 : 1; $task_id = isset($options2['task_id']) && $options2['task_id'] ? $options2['task_id'] : 0; if ($task_id) { $pre_task = htmlspecialchars('jQuery("#' . $form_id . '").append(\'<input type="hidden" name="tid" value="' . $task_id . '">\');'); } $class = 'button btn' . ($field->css ? ' ' . $field->css : ''); if ($task == 'export' || $task == 'process') { $click = ''; } else { echo 'This task is not supported on the Content view.'; $field->html = ''; $field->value = ''; return; } $attr = 'class="' . $class . '"' . $click . ($field->attributes ? ' ' . $field->attributes : ''); if ($field->bool) { $label = $value; if (JCck::on()) { if ($field->bool6 == 3) { $label = '<span class="icon-' . $options2['icon'] . '"></span>'; $attr .= ' title="' . $value . '"'; } elseif ($field->bool6 == 2) { $label = $value . "\n" . '<span class="icon-' . $options2['icon'] . '"></span>'; } elseif ($field->bool6 == 1) { $label = '<span class="icon-' . $options2['icon'] . '"></span>' . "\n" . $value; } } $type = $field->bool7 == 1 || !$click ? 'submit' : 'button'; $form = '<button type="' . $type . '" id="' . $id . '" name="' . $name . '" ' . $attr . '>' . $label . '</button>'; $tag = 'button'; } else { $form = '<input type="submit" id="' . $id . '" name="' . $name . '" value="' . $value . '" ' . $attr . ' />'; $tag = 'input'; } if ($form != '') { $form = '<form action="' . JRoute::_('index.php?option=com_cck') . '" autocomplete="off" enctype="multipart/form-data" method="post" id="' . $form_id . '" name="' . $form_id . '">' . $form . '<input type="hidden" name="task" value="' . $task . '" />' . '<input type="hidden" name="cid" value="' . $config['id'] . '">' . '<input type="hidden" name="tid" value="' . $task_id . '">' . JHtml::_('form.token') . '</form>'; } // Set $field->html = $form; $field->value = ''; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); $field->value = $value; $field->text = JCckDatabase::loadResult('SELECT title FROM #__usergroups WHERE id = ' . (int) $value); $field->typo_target = 'text'; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } self::$path = parent::g_getPath(self::$type . '/'); parent::g_onCCK_FieldPrepareContent($field, $config); /* if ( !$field->state ) { $field->value = ''; return; } // TODO: SEBLOD 3.7 while checking for all Restriction plug-in behaviors.. */ // Prepare $name = $field->name; $dispatcher = JDispatcher::getInstance(); $fields = self::_getChildren($field, $config); $xn = 1; $content = array(); for ($xi = 0; $xi < $xn; $xi++) { foreach ($fields as $f) { if (is_object($f)) { $f_name = $f->name; $f_value = ''; $inherit = array(); $content[$f_name] = clone $f; $table = $f->storage_table; if ($table && !isset($config['storages'][$table])) { $config['storages'][$table] = ''; $dispatcher->trigger('onCCK_Storage_LocationPrepareForm', array(&$f, &$config['storages'][$table], $config['pk'])); } $dispatcher->trigger('onCCK_StoragePrepareForm_Xi', array(&$f, &$f_value, &$config['storages'][$table], $name, $xi)); // $dispatcher->trigger('onCCK_FieldPrepareContent', array(&$content[$f_name], $f_value, &$config, $inherit, true)); $target = $content[$f_name]->typo_target; if ($content[$f_name]->link != '') { $dispatcher->trigger('onCCK_Field_LinkPrepareContent', array(&$content[$f_name], &$config)); if ($content[$f_name]->link && !@$content[$f_name]->linked) { JCckPluginLink::g_setHtml($content[$f_name], $target); } } if (@$content[$f_name]->typo && $content[$f_name]->{$target} != '' && $config['doTypo']) { $dispatcher->trigger('onCCK_Field_TypoPrepareContent', array(&$content[$f_name], $content[$f_name]->typo_target, &$config)); } else { $content[$f_name]->typo = ''; } $config['fields'][$f->name] = $content[$f_name]; } } } // Set $field->value = $content; }
public function onCCK_FieldPrepareContentDebug(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Set $field->value = $value; $field->text = plgCCK_StorageLipsum::getLipsum(2); $field->typo_target = 'text'; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); $value = $field->bool3 ? self::_bn2clear($value) : $value; if ($value) { $value = $field->bool2 ? $field->bool2 == 2 ? self::_bn2br_in_p($value) : self::_bn2p($value) : self::_bn2br($value); } $field->value = $value; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } self::$path = parent::g_getPath(self::$type . '/'); parent::g_onCCK_FieldPrepareContent($field, $config); // Prepare $name = $field->name; $dispatcher = JDispatcher::getInstance(); $fields = self::_getChildren($field, $config); // TODO: call storage plugin. $xn = $field->storage == 'xml' ? is_object($value) ? count($value->children()) : count($value) : $value; $content = array(); for ($xi = 0; $xi < $xn; $xi++) { foreach ($fields as $f) { if (is_object($f)) { $f_name = $f->name; $f_value = ''; $inherit = array('parent' => $field->name, 'xi' => $xi); $content[$xi][$f_name] = clone $f; // if ($field->storage == 'custom') { $f->storage = $field->storage; $f->storage_table = $field->storage_table; $f->storage_field = $field->storage_field; } $table = $f->storage_table; if ($table && !isset($config['storages'][$table])) { $config['storages'][$table] = ''; $dispatcher->trigger('onCCK_Storage_LocationPrepareForm', array(&$f, &$config['storages'][$table], $config['pk'])); } $dispatcher->trigger('onCCK_StoragePrepareForm_Xi', array(&$f, &$f_value, &$config['storages'][$table], $name, $xi, $field)); // $f_value2 = (string) $f_value; $dispatcher->trigger('onCCK_FieldPrepareContent', array(&$content[$xi][$f_name], $f_value2, &$config, $inherit, true)); $target = $content[$xi][$f_name]->typo_target; if ($content[$xi][$f_name]->link != '') { $dispatcher->trigger('onCCK_Field_LinkPrepareContent', array(&$content[$xi][$f_name], &$config)); if ($content[$xi][$f_name]->link && !@$content[$xi][$f_name]->linked) { JCckPluginLink::g_setHtml($content[$xi][$f_name], $target); } } if (@$content[$xi][$f_name]->typo && $content[$xi][$f_name]->{$target} != '' && $config['doTypo']) { $dispatcher->trigger('onCCK_Field_TypoPrepareContent', array(&$content[$xi][$f_name], $content[$xi][$f_name]->typo_target, &$config)); } else { $content[$xi][$f_name]->typo = ''; } } } } $field->value = $content; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Set $value_json = JCckDev::fromJSON($value); $options2 = JCckDev::fromJSON($field->options2); if (is_array($value_json) && !empty($value_json)) { $value = trim($value_json['image_location']) == '' ? trim($field->defaultvalue) : trim($value_json['image_location']); $file_name = $value == '' ? '' : substr(strrchr(JFile::stripExt($value), '/'), 1); $img_title = self::_getTitle(trim($value_json['image_title']), $file_name); $img_title = htmlspecialchars($img_title, ENT_QUOTES); $img_desc = isset($value_json['image_description']) ? trim($value_json['image_description']) : (isset($value_json['image_descr']) ? trim($value_json['image_descr']) : ''); $img_desc = self::_getAlt($img_desc, $img_title, $file_name); $img_desc = htmlspecialchars($img_desc, ENT_QUOTES); } else { $value = trim($value) == '' ? trim($field->defaultvalue) : trim($value); $file_name = $value == '' ? '' : substr(strrchr(JFile::stripExt($value), '/'), 1); $img_title = $file_name; $img_desc = $file_name; } if (@$options2['storage_format']) { $value = $options2['path'] . (@$options2['path_content'] ? $config['pk'] . '/' : '') . $value; } if ($value && JFile::exists(JPATH_SITE . '/' . $value)) { $path = substr($value, 0, strrpos($value, '/')) . '/'; for ($i = 1; $i < 11; $i++) { $thumb = $path . '_thumb' . $i . '/' . substr(strrchr($value, '/'), 1); $field->{'thumb' . $i} = JFile::exists(JPATH_SITE . '/' . $thumb) ? $thumb : ''; } self::_addThumbs($field, $options2, $value, $path); if (isset($options2['content_preview']) && $options2['content_preview']) { $i = (int) $options2['content_preview']; $field->html = $field->{'thumb' . $i} ? '<img src="' . $field->{'thumb' . $i} . '" title="' . $img_title . '" alt="' . $img_desc . '" />' : '<img src="' . $value . '" title="' . $img_title . '" alt="' . $img_desc . '" />'; } else { $field->html = '<img src="' . $value . '" title="' . $img_title . '" alt="' . $img_desc . '" />'; } $field->value = $value; $field->image_title = $img_title; $field->image_alt = $img_desc; } else { $field->value = ''; $field->html = ''; $field->image_title = ''; $field->image_alt = ''; } $field->typo_target = 'html'; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Prepare $options2 = JCckDev::fromJSON($field->options2); if (isset($options2['preparecontent']) && $options2['preparecontent'] != '') { $value = self::_eval($options2['preparecontent'], 'value', $field, $value, $field->name, $field->id, $config); } // Set $field->value = $value; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Process if ($field->state) { $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $postpone = false; if (count($doc->_links)) { foreach ($doc->_links as $k => $link) { if ($link['relation'] == 'canonical') { unset($doc->_links[$k]); } } } if ($field->options2 != '') { $fieldname = ''; $fieldname2 = ''; $options2 = new JRegistry($field->options2); $location = $config['location'] ? $config['location'] : 'joomla_article'; if ($options2->get('content') == '2') { $postpone = true; $fieldname = $options2->get('content_fieldname'); } if ($options2->get('itemid') == '-2') { $fieldname2 = $options2->get('itemid_fieldname'); $itemId = $config['Itemid']; $postpone = true; } else { $itemId = $options2->get('itemid', $config['Itemid']); } if ($postpone !== false) { parent::g_addProcess('beforeRenderContent', self::$type, $config, array('name' => $field->name, 'fieldname' => $fieldname, 'itemId' => $itemId, 'fieldname2' => $fieldname2, 'location' => $location, 'sef' => $options2->get('sef', JCck::getConfig_Param('sef')))); } elseif ($config['pk']) { $uri = JUri::getInstance(); $domain = $uri->toString(array('scheme', 'host', 'port')); $link = JCck::callFunc_Array('plgCCK_Storage_Location' . $location, 'getRoute', array($config['pk'], $options2->get('sef', JCck::getConfig_Param('sef')), $options2->get('itemid', $config['Itemid']), $config)); $doc->addHeadLink($domain . $link, 'canonical'); $app->cck_canonical_url = $link; } } $app->cck_canonical = true; } $field->display = 0; $field->value = ''; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array(), $inherit = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); if (isset($inherit['parent'])) { $collection = $inherit['parent']; $xi = $inherit['xi']; $link_more = '&collection=' . $collection . '&xi=' . $xi; } else { $collection = ''; $xi = 0; $link_more = ''; } // Set $field->html = ''; $value_json = JCckDev::fromJSON($value); $options2 = JCckDev::fromJSON($field->options2); if (is_array($value_json) && !empty($value_json)) { $value = trim($value_json['file_location']) == '' ? trim($field->defaultvalue) : trim($value_json['file_location']); $file_name = $value == '' ? '' : substr(strrchr($value, '/'), 1); $file_title = trim($value_json['file_title']); $file_title = htmlspecialchars($file_title, ENT_QUOTES); } else { $value = trim($value) == '' ? trim($field->defaultvalue) : trim($value); $file_name = $value == '' ? '' : substr(strrchr($value, '/'), 1); $file_title = ''; } // Set More $file = $value; $path = @$options2['path']; if (@$options2['storage_format']) { $path .= @$options2['path_content'] ? $config['pk'] . '/' : ''; $file = $path . $value; } $field->file_folder = $path; if ($value) { $link_more = ($config['client'] == 'intro' ? '&client=' . $config['client'] : '') . $link_more; $field->text = $file_title != '' ? $file_title : (@$options2['storage_format'] ? $value : substr($value, strrpos($value, '/') + 1)); $field->hits = self::_getHits($config['id'], $field->name, $collection, $xi); $field->file_size = file_exists($file) ? self::_formatBytes(filesize($file)) : self::_formatBytes(0); $field->link = 'index.php?option=com_cck&task=download' . $link_more . '&file=' . $field->name . '&id=' . $config['id']; $field->linked = true; $field->html = '<a href="' . $field->link . '" title="' . $file_title . '">' . $field->text . '</a>'; $field->typo_target = 'text'; } $field->value = $value; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $html = ''; $value = $field->location; $html = '<span class="icon-' . $value . '"></span>'; // Set $field->text = $html; $field->typo_target = 'text'; $field->value = $value; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Set $field->value = $value; if ($field->storage == 'standard' && isset($config['storages'][$field->storage_table]->category_title)) { $field->text = $config['storages'][$field->storage_table]->category_title; } else { $field->text = JCckDatabase::loadResult('SELECT title FROM #__categories WHERE id = ' . (int) $value); } $field->typo_target = 'text'; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Prepare if ($field->defaultvalue) { $mode = $field->bool ? 'module' : 'position'; $style = $field->style ? ',' . $field->style : ''; $value = '{load' . $mode . ' ' . $field->defaultvalue . $style . '}'; } // Set $field->value = $value; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $doTranslation = $config['doTranslation']; if ($config['doTranslation']) { $config['doTranslation'] = $field->bool8; } // Set $field->text = parent::g_getOptionText($value, $field->options, '', $config); $field->value = $value; $field->typo_target = 'text'; $config['doTranslation'] = $doTranslation; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Prepare $options2 = JCckDev::fromJSON($field->options2); $width = isset($options2['video_width']) ? $options2['video_width'] : '300'; $height = isset($options2['video_height']) ? $options2['video_height'] : '300'; if (strpos($value, 'playlist?list=') !== false) { $v_int = preg_match('/\\?list=.*/i', $value, $v_value); if ($v_int > 0) { $v_tag = str_replace('?list=', 'videoseries?list=', $v_value[0]); } } else { $v_int = preg_match('/\\?v=.*/i', $value, $v_value); if ($v_int > 0) { $v_tag = str_replace('?v=', '', $v_value[0]); } else { $v_tag = $value; } } if (isset($v_tag) && $v_tag != '') { if ($field->bool2 == 0) { $video = '<iframe width="' . $width . '" height="' . $height . '" '; $video .= 'frameborder="0" allowfullscreen src="'; $video .= 'http://www.youtube.com/embed/' . $v_tag; $video .= '" ></iframe>'; } else { $video = '<object width="' . $width . '" height="' . $height . '">'; $video .= '<param value="' . $value . '" name="movie"><param value="transparent" name="wmode">'; $video .= '<embed width="' . $width . '" height="' . $height . '" wmode="transparent" type="application/x-shockwave-flash" src="'; $video .= 'http://www.youtube.com/v/' . $v_tag; $video .= '"></object>'; } } // Set $field->value = $value; $field->html = isset($video) ? $video : $value; $field->linked = true; //$field->typo_target = 'text'; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Set $value = trim($value); if ($value == '' || $value == '0000-00-00 00:00:00') { $field->value = ''; $field->text = ''; } else { $field->value = $value; $options2 = JCckDev::fromJSON($field->options2); $options2['storage_format'] = isset($options2['storage_format']) ? $options2['storage_format'] : '0'; $value = trim($value) == '' ? '' : ($options2['storage_format'] == '0' ? strtotime($value) : $value); $field->text = $value == '' ? '' : self::_getDateByLang(@$options2['format'], $value); } $field->typo_target = 'text'; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Prepare $text = ''; if (is_array($value)) { $value = implode(',', $value); } if ($value != '') { $text = JCckDatabase::loadColumn('SELECT a.title FROM #__usergroups AS a WHERE id IN (' . $value . ') ORDER BY FIELD(id, ' . $value . ')'); $text = implode(',', $text); } // Set $field->text = $text; $field->value = $value; $field->typo_target = 'text'; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $id = $field->name; $value = (int) $field->defaultvalue; $value = $value ? $value - 1 : 0; $group_id = $field->location != '' ? $field->location : 'cck_tabs1'; // Prepare $html = ''; if ($field->state) { parent::g_addProcess('beforeRenderContent', self::$type, $config, array('name' => $field->name, 'group_id' => $group_id, 'id' => $id, 'identifier' => $field->bool3, 'label' => $field->label, 'url_actions' => $field->bool2, 'value' => $value)); } // Set $field->html = $html; $field->value = $field->label; $field->label = ''; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $value = $field->defaultvalue; // Prepare if ($field->bool8) { $field->bool8 = $config['doTranslation']; } if ($field->bool8) { $value = trim(preg_replace('/[^A-Za-z0-9_ ]/', '', strip_tags($value))); if ($value) { $value = JText::_('COM_CCK_' . str_replace(' ', '_', $value)); } } // Set $field->value = $value; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } // Prepare parent::g_onCCK_FieldPrepareContent($field, $config); // Set $field->value = $value; $field->html = ''; // Set More if ($value != '') { $options2 = JCckDev::fromJSON($field->options2); $default_link = @$options2['def_link'] != '' ? $options2['def_link'] : ''; $default_text = @$options2['def_text'] != '' ? $options2['def_text'] : ''; $default_class = @$options2['class'] != '' ? $options2['class'] : ''; $default_target = @$options2['target'] != '' ? $options2['target'] : ''; $default_rel = @$options2['rel'] != '' ? $options2['rel'] : ''; $value = JCckDev::fromJSON($value); $link = @$value['link'] != '' ? $value['link'] : $default_link; $text = @$value['text'] != '' ? $value['text'] : ($default_text ? $default_text : $link); $class = @$value['class'] != '' ? $value['class'] : $default_class; $target = @$value['target'] != '' ? $value['target'] : $default_target; $rel = @$value['rel'] != '' ? $value['rel'] : $default_rel; $extension = array('.png', '.PNG', '.jpg', '.JPG', '.gif', '.GIF'); foreach ($extension as $ext) { $text = strpos($text, $ext) !== false ? '<img src="' . JURI::base() . $text . '" title="' . $link . '" />' : $text; } $field->text = $text; $field->link = strpos($link, 'index.php') === 0 || $link[0] == '/' ? $link : (strpos($link, 'http://') === false && strpos($link, 'https://') === false ? 'http://' . $link : $link); $field->link_target = $target; $field->link_class = $class; $field->link_rel = $rel; $field->linked = true; $class = $class != '' ? 'class="' . $class . '" ' : ''; $rel = $rel != '' ? ' rel="' . $rel . '"' : ''; $field->html = '<a href="' . $field->link . '" ' . $class . 'target="' . $field->link_target . '"' . $rel . '>' . $field->text . '</a>'; $field->typo_target = 'text'; } }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $doTranslation = $config['doTranslation']; if ($config['doTranslation']) { $config['doTranslation'] = $field->bool8; } // Set $divider = $field->divider != '' ? $field->divider : ','; if (is_array($value)) { $value = implode($divider, $value); } $field->text = parent::g_getOptionText($value, $field->options, $divider, $config); $field->value = $value; // todo: $field->values $field->typo_target = 'text'; $config['doTranslation'] = $doTranslation; }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); // Init $id = $field->name; $value = (int) $field->defaultvalue; $value = $value ? $value - 1 : 0; $group_id = $field->location != '' ? $field->location : 'cck_tabs1'; static $groups = array(); if (!isset($groups[$group_id])) { $groups[$group_id] = array('active' => $value, 'current' => 0); } // Prepare $html = ''; if ($field->state) { $group_id = $field->location != '' ? $field->location : 'cck_tabs1'; if ($field->bool == 2) { $html = JCckDevTabs::end(); } elseif ($field->bool == 1) { $html = JCckDevTabs::open($group_id, $id, $field->label); if ($groups[$group_id]['current'] == $groups[$group_id]['active']) { $js = '(function($){ $(document).ready(function() { $("#' . $group_id . 'Tabs > li,#' . $group_id . 'Content > div").removeClass("active"); $("#' . $group_id . 'Tabs > li:eq(' . (int) $groups[$group_id]['active'] . '),#' . $id . '").addClass("active"); }); })(jQuery);'; JFactory::getDocument()->addScriptDeclaration($js); } } else { $html = JCckDevTabs::start($group_id, $id, $field->label, array('active' => $id)); } $groups[$group_id]['current']++; } // Set $field->html = $html; $field->value = $field->label; $field->label = ''; }