本文整理汇总了PHP中flexicontent_db::getTypeAttribs方法的典型用法代码示例。如果您正苦于以下问题:PHP flexicontent_db::getTypeAttribs方法的具体用法?PHP flexicontent_db::getTypeAttribs怎么用?PHP flexicontent_db::getTypeAttribs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flexicontent_db
的用法示例。
在下文中一共展示了flexicontent_db::getTypeAttribs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
//.........这里部分代码省略.........
// Add the templates css files if availables
if (isset($themes->category->{$clayout}->css)) {
foreach ($themes->category->{$clayout}->css as $css) {
$document->addStyleSheet($this->baseurl . '/' . $css);
}
}
// Add the templates js files if availables
if (isset($themes->category->{$clayout}->js)) {
foreach ($themes->category->{$clayout}->js as $js) {
$document->addScript($this->baseurl . '/' . $js);
}
}
// Set the template var
$tmpl = $themes->category->{$clayout}->tmplvar;
} else {
$tmpl = '.category.default';
}
// @TODO trigger the plugin selectively
// and delete the plugins tags if not active
if ($params->get('trigger_onprepare_content_cat')) {
JPluginHelper::importPlugin('content');
// Allow to trigger content plugins on category description
// NOTE: for J2.5, we will trigger the plugins as if description text was an article text, using ... 'com_content.article'
$category->text = $category->description;
$results = $dispatcher->trigger('onContentPrepare', array('com_content.article', &$category, &$params, 0));
JRequest::setVar('layout', $layout);
// Restore LAYOUT variable should some plugin have modified it
$category->description = $category->text;
}
// Maybe here not to import all plugins but just those for description field or add a parameter for this
// Anyway these events are usually not very time consuming as is the the event onPrepareContent(J1.5)/onContentPrepare(J1.6+)
JPluginHelper::importPlugin('content');
$noroute_cats = array_flip($globalnoroute);
$type_attribs = flexicontent_db::getTypeAttribs($force = true, $typeid = 0);
$type_params = array();
foreach ($items as $item) {
$item->event = new stdClass();
if (!isset($type_params[$item->type_id])) {
$type_params[$item->type_id] = new JRegistry($type_attribs[$item->type_id]);
}
$item->params = clone $type_params[$item->type_id];
$item->params->merge(new JRegistry($item->attribs));
//$item->cats = isset($item->cats) ? $item->cats : array();
// !!! The triggering of the event onPrepareContent(J1.5)/onContentPrepare(J1.6+) of content plugins
// !!! for description field (maintext) along with all other flexicontent
// !!! fields is handled by flexicontent.fields.php
// !!! Had serious performance impact
// CODE REMOVED
// We must check if the current category is in the categories of the item ..
$item_in_category = false;
if ($item->catid == $category->id) {
$item_in_category = true;
} else {
foreach ($item->cats as $cat) {
if ($cat->id == $category->id) {
$item_in_category = true;
break;
}
}
}
// ADVANCED CATEGORY ROUTING (=set the most appropriate category for the item ...)
// CHOOSE APPROPRIATE category-slug FOR THE ITEM !!! ( )
if ($item_in_category && !isset($noroute_cats[$category->id])) {
// 1. CATEGORY SLUG: CURRENT category
// Current category IS a category of the item and ALSO routing (creating links) to this category is allowed
$item->categoryslug = $category->slug;