本文整理汇总了PHP中JHelperTags类的典型用法代码示例。如果您正苦于以下问题:PHP JHelperTags类的具体用法?PHP JHelperTags怎么用?PHP JHelperTags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JHelperTags类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display the view.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$section = $this->state->get('category.section') ? $this->state->get('category.section') . '.' : '';
$this->canDo = JHelperContent::getActions($this->state->get('category.component'), $section . 'category', $this->item->id);
$this->assoc = $this->get('Assoc');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
// Check for tag type
$this->checkTags = JHelperTags::getTypes('objectList', array($this->state->get('category.extension') . '.category'), true);
JFactory::getApplication()->input->set('hidemainmenu', true);
if ($this->getLayout() == 'modal') {
// If we are forcing a language in modal (used for associations).
if ($forcedLanguage = JFactory::getApplication()->input->get('forcedLanguage', '', 'cmd')) {
// Set the language field to the forcedLanguage and disable changing it.
$this->form->setValue('language', null, $forcedLanguage);
$this->form->setFieldAttribute('language', 'readonly', 'true');
// Only allow to select categories with All language or with the forced language.
$this->form->setFieldAttribute('parent_id', 'language', '*,' . $forcedLanguage);
// Only allow to select tags with All language or with the forced language.
$this->form->setFieldAttribute('tags', 'language', '*,' . $forcedLanguage);
}
} elseif ($this->item->id && $this->form->getValue('language', null, '*') != '*' && JLanguageAssociations::isEnabled() && count($this->item->associations) > 0) {
$this->form->setFieldAttribute('language', 'readonly', 'true');
}
$this->addToolbar();
return parent::display($tpl);
}
开发者ID:eshiol,项目名称:joomla-cms,代码行数:40,代码来源:view.html.php
示例2: onCCK_FieldPrepareContent
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;
}
开发者ID:densem-2013,项目名称:exikom,代码行数:29,代码来源:jform_tag.php
示例3: getItem
/**
* Method to get an object.
*
* @param integer $id The id of the object to get.
*
* @return mixed Object on success, false on failure.
*/
public function getItem($id = null)
{
if (!$id) {
$id = $this->getState($this->getName() . '.id');
}
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('a.id, a.title, a.description, a.votes, a.record_date, a.catid, a.user_id, a.status_id, a.hits, a.params, ' . $query->concatenate(array('a.id', 'a.alias'), '-') . ' AS slug, ' . 'b.name, b.username, ' . 'c.title AS category, ' . $query->concatenate(array('c.id', 'c.alias'), '-') . ' AS catslug, ' . 'd.name AS status_name, d.params AS status_params, d.default AS status_default');
$query->from($db->quoteName('#__uideas_items', 'a'));
$query->leftJoin($db->quoteName('#__users', 'b') . ' ON a.user_id = b.id');
$query->leftJoin($db->quoteName('#__categories', 'c') . ' ON a.catid = c.id');
$query->leftJoin($db->quoteName('#__uideas_statuses', 'd') . ' ON a.status_id = d.id');
$query->where('a.id = ' . (int) $id);
$db->setQuery($query);
$this->item = $db->loadObject();
// Prepare status object
if ($this->item !== null and (int) $this->item->id > 0) {
$this->prepareStatus($this->item);
$tags = new JHelperTags();
$this->item->tags = $tags->getItemTags('com_userideas.item', $this->item->id);
$registry = new Joomla\Registry\Registry();
$registry->loadString($this->item->params);
$this->item->params = $registry;
}
return $this->item;
}
开发者ID:bellodox,项目名称:UserIdeas,代码行数:33,代码来源:details.php
示例4: getContentList
public static function getContentList($params)
{
$db = JFactory::getDbo();
$app = JFactory::getApplication();
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
//$matchtype = $params->get('matchtype', 'all');
$maximum = $params->get('maximum', 5);
$tagsHelper = new JHelperTags();
$option = $app->input->get('option');
$view = $app->input->get('view');
$prefix = $option . '.' . $view;
$id = (array) $app->input->getObject('id');
$selectedTag = $params->get('selected_tag');
// Strip off any slug data.
foreach ($id as $id) {
if (substr_count($id, ':') > 0) {
$idexplode = explode(':', $id);
$id = $idexplode[0];
}
}
$tagsToMatch = $selectedTag;
if (!$tagsToMatch || is_null($tagsToMatch)) {
return $results = false;
}
$query = $tagsHelper->getTagItemsQuery($tagsToMatch, $typesr = null, $includeChildren = false, $orderByOption = 'c.core_title', $orderDir = 'ASC', $anyOrAll = true, $languageFilter = 'all', $stateFilter = '0,1');
$db->setQuery($query, 0, $maximum);
$results = $db->loadObjectList();
foreach ($results as $result) {
$explodedAlias = explode('.', $result->type_alias);
$result->link = 'index.php?option=' . $explodedAlias[0] . '&view=' . $explodedAlias[1] . '&id=' . $result->content_item_id . '-' . $result->core_alias;
}
return $results;
}
开发者ID:AaronTRUngerboeck,项目名称:JoomlaTest,代码行数:34,代码来源:helper.php
示例5: getList
/**
* Get a list of tags
*
* @param JRegistry &$params Module parameters
*
* @return mixed Results array / null
*/
public static function getList(&$params)
{
$app = JFactory::getApplication();
$option = $app->input->get('option');
$view = $app->input->get('view');
// For now assume com_tags and com_users do not have tags.
// This module does not apply to list views in general at this point.
if ($option == 'com_tags' || $view == 'category' || $option == 'com_users') {
return;
}
$db = JFactory::getDbo();
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$matchtype = $params->get('matchtype', 'all');
$maximum = $params->get('maximum', 5);
$tagsHelper = new JHelperTags();
$prefix = $option . '.' . $view;
$id = $app->input->getInt('id');
$tagsToMatch = $tagsHelper->getTagIds($id, $prefix);
if (!$tagsToMatch || is_null($tagsToMatch)) {
return;
}
$tagCount = substr_count($tagsToMatch, ',') + 1;
$query = $db->getQuery(true)->select(array($db->quoteName('m.tag_id'), $db->quoteName('m.core_content_id'), $db->quoteName('m.content_item_id'), $db->quoteName('m.type_alias'), 'COUNT( ' . $db->quoteName('tag_id') . ') AS ' . $db->quoteName('count'), $db->quoteName('t.access'), $db->quoteName('t.id'), $db->quoteName('ct.router'), $db->quoteName('cc.core_title'), $db->quoteName('cc.core_alias'), $db->quoteName('cc.core_catid'), $db->quoteName('cc.core_language')));
$query->from($db->quoteName('#__contentitem_tag_map', 'm'));
$query->join('INNER', $db->quoteName('#__tags', 't') . ' ON m.tag_id = t.id')->join('INNER', $db->quoteName('#__ucm_content', 'cc') . ' ON m.core_content_id = cc.core_content_id')->join('INNER', $db->quoteName('#__content_types', 'ct') . ' ON m.type_alias = ct.type_alias');
$query->where($db->quoteName('m.tag_id') . ' IN (' . $tagsToMatch . ')');
$query->where('t.access IN (' . $groups . ')');
$query->where('(cc.core_access IN (' . $groups . ') OR cc.core_access = 0)');
// Don't show current item
$query->where('(' . $db->quoteName('m.content_item_id') . ' <> ' . $id . ' OR ' . $db->quoteName('m.type_alias') . ' <> ' . $db->quote($prefix) . ')');
// Only return published tags
$query->where($db->quoteName('cc.core_state') . ' = 1 ');
// Optionally filter on language
$language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all');
if ($language != 'all') {
if ($language == 'current_language') {
$language = JHelperContent::getCurrentLanguage();
}
$query->where($db->quoteName('cc.core_language') . ' IN (' . $db->quote($language) . ', ' . $db->quote('*') . ')');
}
$query->group($db->quoteName(array('m.core_content_id')));
if ($matchtype == 'all' && $tagCount > 0) {
$query->having('COUNT( ' . $db->quoteName('tag_id') . ') = ' . $tagCount);
} elseif ($matchtype == 'half' && $tagCount > 0) {
$tagCountHalf = ceil($tagCount / 2);
$query->having('COUNT( ' . $db->quoteName('tag_id') . ') >= ' . $tagCountHalf);
}
$query->order($db->quoteName('count') . ' DESC');
$db->setQuery($query, 0, $maximum);
$results = $db->loadObjectList();
foreach ($results as $result) {
$explodedAlias = explode('.', $result->type_alias);
$result->link = 'index.php?option=' . $explodedAlias[0] . '&view=' . $explodedAlias[1] . '&id=' . $result->content_item_id . '-' . $result->core_alias;
}
return $results;
}
开发者ID:01J,项目名称:topm,代码行数:64,代码来源:helper.php
示例6: onAfterDelete
/**
* The event which runs after deleting a record
*
* @param DataModel &$model The model which calls this event
* @param integer $oid The PK value of the record which was deleted
*
* @return boolean True to allow the deletion without errors
*/
public function onAfterDelete(&$model, $oid)
{
// If this resource has tags, delete the tags first
if ($model->hasTags()) {
$tagsHelper = new \JHelperTags();
$tagsHelper->typeAlias = $model->getContentType();
if (!$tagsHelper->deleteTagData($model, $oid)) {
throw new \Exception('Error deleting Tags');
}
}
}
开发者ID:Joal01,项目名称:fof,代码行数:19,代码来源:Tags.php
示例7: onAfterDelete
/**
* The event which runs after deleting a record
*
* @param FOFTable &$table The table which calls this event
* @param integer $oid The PK value of the record which was deleted
*
* @return boolean True to allow the deletion without errors
*/
public function onAfterDelete(&$table, $oid)
{
// If this resource has tags, delete the tags first
if ($table->hasTags()) {
$tagsHelper = new JHelperTags();
$tagsHelper->typeAlias = $table->getAssetKey();
if (!$tagsHelper->deleteTagData($table, $oid)) {
$table->setError('Error deleting Tags');
return false;
}
}
}
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:20,代码来源:tags.php
示例8: getTags
/**
* This method returns category description.
*
* <code>
* $categoryId = 1;
*
* $category = new Userideas\Category\Category(\JFactory::getDbo());
* $category->load($categoryId);
*
* $category->setTagsHelper(new \JHelperTags);
* </code>
*
* @param bool $getTagData If true, data from the tags table will be included, defaults to true.
*
* @return null|array
*/
public function getTags($getTagData = true)
{
if ($this->tags === null and $this->tagsHelper instanceof \JHelperTags) {
$this->tags = $this->tagsHelper->getItemTags($this->contentAlias, $this->id, $getTagData);
}
return $this->tags;
}
开发者ID:bellodox,项目名称:UserIdeas,代码行数:23,代码来源:Category.php
示例9: display
public function display($tpl = null)
{
//Get User Objects
$user = JFactory::getUser();
$canDo = PlayJoomHelper::getActions();
// get the Data
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->script = $script = $this->get('Script');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode('<br />', $errors));
return false;
}
if ($canDo->get('core.edit') || $canDo->get('core.create') && !JRequest::getVar('id') || JAccess::check($user->get('id'), 'core.admin') == 1) {
// Set the toolbar
$this->addToolBar();
// Display the template
parent::display($tpl);
} else {
JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
// Check for tag type
$this->checkTags = JHelperTags::getTypes('objectList', array('com_playjoom.track'), true);
// Set the document
$this->setDocument();
}
开发者ID:TFToto,项目名称:playjoom-builds,代码行数:27,代码来源:view.html.php
示例10: display
/**
* Display the view.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return void
*/
public function display($tpl = null)
{
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$section = $this->state->get('category.section') ? $this->state->get('category.section') . '.' : '';
$this->canDo = JHelperContent::getActions($this->state->get('category.component'), $section . 'category', $this->item->id);
$this->assoc = $this->get('Assoc');
$input = JFactory::getApplication()->input;
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
// Check for tag type
$this->checkTags = JHelperTags::getTypes('objectList', array($this->state->get('category.extension') . '.category'), true);
$input->set('hidemainmenu', true);
if ($this->getLayout() == 'modal') {
$this->form->setFieldAttribute('language', 'readonly', 'true');
$this->form->setFieldAttribute('parent_id', 'readonly', 'true');
}
$this->addToolbar();
DigiComHelperDigiCom::addSubmenu('categories');
$this->sidebar = DigiComHelperDigiCom::renderSidebar();
parent::display($tpl);
}
开发者ID:Shtier,项目名称:digicom,代码行数:33,代码来源:view.html.php
示例11: getOptions
/**
* Method to get a list of tags
*
* @return array The field option objects.
*
* @since 3.1
*/
protected function getOptions()
{
$options = array();
$published = $this->element['published'] ? $this->element['published'] : array(0, 1);
$name = (string) $this->element['name'];
$db = F0FPlatform::getInstance()->getDbo();
$query = $db->getQuery(true)->select('a.id AS value, a.path, a.title AS text, a.level, a.published')->from('#__tags AS a')->join('LEFT', $db->quoteName('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
$item = $this->form->getModel()->getItem();
if ($item instanceof F0FTable) {
// Fake value for selected tags
$keyfield = $item->getKeyName();
$content_id = $item->{$keyfield};
$type = $item->getContentType();
$selected_query = $db->getQuery(true);
$selected_query->select('tag_id')->from('#__contentitem_tag_map')->where('content_item_id = ' . (int) $content_id)->where('type_alias = ' . $db->quote($type));
$db->setQuery($selected_query);
$this->value = $db->loadColumn();
}
// Ajax tag only loads assigned values
if (!$this->isNested()) {
// Only item assigned values
$values = (array) $this->value;
F0FUtilsArray::toInteger($values);
$query->where('a.id IN (' . implode(',', $values) . ')');
}
// Filter language
if (!empty($this->element['language'])) {
$query->where('a.language = ' . $db->quote($this->element['language']));
}
$query->where($db->quoteName('a.alias') . ' <> ' . $db->quote('root'));
// Filter to only load active items
// Filter on the published state
if (is_numeric($published)) {
$query->where('a.published = ' . (int) $published);
} elseif (is_array($published)) {
F0FUtilsArray::toInteger($published);
$query->where('a.published IN (' . implode(',', $published) . ')');
}
$query->group('a.id, a.title, a.level, a.lft, a.rgt, a.parent_id, a.published, a.path')->order('a.lft ASC');
// Get the options.
$db->setQuery($query);
try {
$options = $db->loadObjectList();
} catch (RuntimeException $e) {
return false;
}
// Prepare nested data
if ($this->isNested()) {
$this->prepareOptionsNested($options);
} else {
$options = JHelperTags::convertPathsToNames($options);
}
return $options;
}
开发者ID:01J,项目名称:topm,代码行数:61,代码来源:tag.php
示例12: searchAjax
/**
* Method to search tags with AJAX
*
* @return void
*/
public function searchAjax()
{
// Required objects
$app = JFactory::getApplication();
// Receive request data
$filters = array('like' => trim($app->input->get('like', null)), 'title' => trim($app->input->get('title', null)), 'flanguage' => $app->input->get('flanguage', null), 'published' => $app->input->get('published', 1, 'integer'), 'parent_id' => $app->input->get('parent_id', null));
if ($results = JHelperTags::searchTags($filters)) {
// Output a JSON object
echo json_encode($results);
}
$app->close();
}
开发者ID:01J,项目名称:skazkipronebo,代码行数:17,代码来源:tags.php
示例13: getOptions
/**
* Method to get a list of tags
*
* @return array The field option objects.
*
* @since 3.1
*/
protected function getOptions()
{
$published = $this->element['published'] ? $this->element['published'] : array(0, 1);
$db = JFactory::getDbo();
$query = $db->getQuery(true)->select('DISTINCT a.id AS value, a.path, a.title AS text, a.level, a.published, a.lft')->from('#__tags AS a')->join('LEFT', $db->qn('#__tags') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
// Filter language
if (!empty($this->element['language'])) {
$query->where('a.language = ' . $db->q($this->element['language']));
}
$query->where($db->qn('a.lft') . ' > 0');
// Filter on the published state
if (is_numeric($published)) {
$query->where('a.published = ' . (int) $published);
} elseif (is_array($published)) {
JArrayHelper::toInteger($published);
$query->where('a.published IN (' . implode(',', $published) . ')');
}
$query->order('a.lft ASC');
// Get the options.
$db->setQuery($query);
try {
$options = $db->loadObjectList();
} catch (RuntimeException $e) {
return array();
}
// Block the possibility to set a tag as it own parent
if ($this->form->getName() == 'com_tags.tag') {
$id = (int) $this->form->getValue('id', 0);
foreach ($options as $option) {
if ($option->value == $id) {
$option->disable = true;
}
}
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
// Prepare nested data
if ($this->isNested()) {
$this->prepareOptionsNested($options);
} else {
$options = JHelperTags::convertPathsToNames($options);
}
return $options;
}
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:51,代码来源:tag.php
示例14: getList
public static function getList(&$params)
{
$list = array();
$show_tag = $params->get('item_tags_display', 0);
$show_description = $params->get('item_desc_display', 1);
$maxlength_desc = $params->get('item_desc_maxlength', 200);
$show_title = $params->get('title_display');
$maxlength_title = $params->get('item_title_maxlength', 25);
$articles = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true));
$db = JFactory::getDbo();
$app = JFactory::getApplication();
$appParams = $app->getParams();
$articles->setState('params', $appParams);
$articles->setState('list.start', 0);
$articles->setState('list.limit', (int) $params->get('count', 0));
$articles->setState('filter.published', 1);
$access = !JComponentHelper::getParams('com_content')->get('show_noauth');
$authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id'));
$articles->setState('filter.access', $access);
$catids = $params->get('catid');
if ($catids) {
if ($params->get('show_child_category_articles', 0) && (int) $params->get('levels', 0) > 0) {
$categories = JModelLegacy::getInstance('Categories', 'ContentModel', array('ignore_request' => true));
$categories->setState('params', $appParams);
$levels = $params->get('levels', 1) ? $params->get('levels', 1) : 9999;
$categories->setState('filter.get_children', $levels);
$categories->setState('filter.published', 1);
$categories->setState('filter.access', $access);
$additional_catids = array();
foreach ($catids as $catid) {
$categories->setState('filter.parentId', $catid);
$recursive = true;
$items = $categories->getItems($recursive);
if ($items) {
foreach ($items as $category) {
$condition = $category->level - $categories->getParent()->level <= $levels;
if ($condition) {
$additional_catids[] = $category->id;
}
}
}
}
$catids = array_unique(array_merge($catids, $additional_catids));
}
$articles->setState('filter.category_id', $catids);
}
$articles->setState('list.ordering', $params->get('article_ordering', 'a.ordering'));
$articles->setState('list.direction', $params->get('article_ordering_direction', 'ASC'));
$articles->setState('filter.featured', $params->get('show_front', 'show'));
$articles->setState('filter.language', $app->getLanguageFilter());
$items = $articles->getItems();
if (!empty($items)) {
foreach ($items as &$item) {
$item->slug = $item->id . ':' . $item->alias;
$item->catslug = $item->catid ? $item->catid . ':' . $item->category_alias : $item->catid;
if ($access || in_array($item->access, $authorised)) {
$item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug));
} else {
$app = JFactory::getApplication();
$menu = $app->getMenu();
$menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login');
if (isset($menuitems[0])) {
$Itemid = $menuitems[0]->id;
} elseif ($app->input->getInt('Itemid') > 0) {
$Itemid = $app->input->getInt('Itemid');
}
$item->link = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $Itemid);
}
$item->_introtext = self::_cleanText($item->introtext);
$item->_description = self::_trimEncode($item->_introtext) != '' && $show_description ? self::truncate($item->_introtext, $maxlength_desc) : '';
$item->tags = '';
if ($show_tag && class_exists('JHelperTags')) {
$tagLayout = new JLayoutFile('joomla.content.tags');
$tags = new JHelperTags();
$tags->getItemTags('com_content.article', $item->id);
$item->tags = $tagLayout->render($tags->itemTags);
}
$item->sub_title = $show_title ? self::truncate($item->title, $maxlength_title) : '';
$image = self::createThumbs($item, $params, 'imgf');
$attr = ' ';
$attr .= isset($image['title']) ? ' title = "' . $image['title'] . '"' : '';
$attr .= isset($image['alt']) ? ' alt = "' . $image['alt'] . '"' : '';
$attr .= isset($image['class']) ? ' class = "' . $image['class'] . '"' : '';
$item->image_src = isset($image['src']) ? $image['src'] : '';
$item->image_attr = $attr;
$item->link_target = self::linkTarget($params->get('link_target'));
$list[] = $item;
}
}
return $list;
}
开发者ID:johngrange,项目名称:wookeyholeweb,代码行数:91,代码来源:helper.php
示例15: getListQuery
/**
* Method to build an SQL query to load the list data of all items with a given tag.
*
* @return string An SQL query
*
* @since 3.1
*/
protected function getListQuery()
{
$tagId = $this->getState('tag.id') ?: '';
$typesr = $this->getState('tag.typesr');
$orderByOption = $this->getState('list.ordering', 'c.core_title');
$includeChildren = $this->state->params->get('include_children', 0);
$orderDir = $this->getState('list.direction', 'ASC');
$matchAll = $this->getState('params')->get('return_any_or_all', 1);
$language = $this->getState('tag.language');
$stateFilter = $this->getState('tag.state');
// Optionally filter on language
if (empty($language)) {
$language = JComponentHelper::getParams('com_tags')->get('tag_list_language_filter', 'all');
}
$listQuery = new JHelperTags();
$query = $listQuery->getTagItemsQuery($tagId, $typesr, $includeChildren, $orderByOption, $orderDir, $matchAll, $language, $stateFilter);
if ($this->state->get('list.filter')) {
$query->where($this->_db->quoteName('c.core_title') . ' LIKE ' . $this->_db->quote('%' . $this->state->get('list.filter') . '%'));
}
return $query;
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:28,代码来源:tag.php
示例16: fetchHead
/**
* Generates the head HTML and return the results as a string
*
* @param JDocumentHtml $document The document for which the head will be created
*
* @return string The head hTML
*
* @since 3.5
* @deprecated 4.0 Method code will be moved into the render method
*/
public function fetchHead($document)
{
// Convert the tagids to titles
if (isset($document->_metaTags['name']['tags'])) {
$tagsHelper = new JHelperTags();
$document->_metaTags['name']['tags'] = implode(', ', $tagsHelper->getTagNames($document->_metaTags['name']['tags']));
}
// Trigger the onBeforeCompileHead event
$app = JFactory::getApplication();
$app->triggerEvent('onBeforeCompileHead');
// Get line endings
$lnEnd = $document->_getLineEnd();
$tab = $document->_getTab();
$tagEnd = ' />';
$buffer = '';
// Generate charset when using HTML5 (should happen first)
if ($document->isHtml5()) {
$buffer .= $tab . '<meta charset="' . $document->getCharset() . '" />' . $lnEnd;
}
// Generate base tag (need to happen early)
$base = $document->getBase();
if (!empty($base)) {
$buffer .= $tab . '<base href="' . $base . '" />' . $lnEnd;
}
// Generate META tags (needs to happen as early as possible in the head)
foreach ($document->_metaTags as $type => $tag) {
foreach ($tag as $name => $content) {
if ($type == 'http-equiv' && !($document->isHtml5() && $name == 'content-type')) {
$buffer .= $tab . '<meta http-equiv="' . $name . '" content="' . htmlspecialchars($content, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd;
} elseif ($type != 'http-equiv' && !empty($content)) {
$buffer .= $tab . '<meta ' . $type . '="' . $name . '" content="' . htmlspecialchars($content, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd;
}
}
}
// Don't add empty descriptions
$documentDescription = $document->getDescription();
if ($documentDescription) {
$buffer .= $tab . '<meta name="description" content="' . htmlspecialchars($documentDescription, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd;
}
// Don't add empty generators
$generator = $document->getGenerator();
if ($generator) {
$buffer .= $tab . '<meta name="generator" content="' . htmlspecialchars($generator, ENT_COMPAT, 'UTF-8') . '" />' . $lnEnd;
}
$buffer .= $tab . '<title>' . htmlspecialchars($document->getTitle(), ENT_COMPAT, 'UTF-8') . '</title>' . $lnEnd;
// Generate link declarations
foreach ($document->_links as $link => $linkAtrr) {
$buffer .= $tab . '<link href="' . $link . '" ' . $linkAtrr['relType'] . '="' . $linkAtrr['relation'] . '"';
if (is_array($linkAtrr['attribs'])) {
if ($temp = ArrayHelper::toString($linkAtrr['attribs'])) {
$buffer .= ' ' . $temp;
}
}
$buffer .= ' />' . $lnEnd;
}
$defaultCssMimes = array('text/css');
// Generate stylesheet links
foreach ($document->_styleSheets as $strSrc => $strAttr) {
$buffer .= $tab . '<link rel="stylesheet" href="' . $strSrc . '"';
if (!is_null($strAttr['mime']) && (!$document->isHtml5() || !in_array($strAttr['mime'], $defaultCssMimes))) {
$buffer .= ' type="' . $strAttr['mime'] . '"';
}
if (!is_null($strAttr['media'])) {
$buffer .= ' media="' . $strAttr['media'] . '"';
}
if (is_array($strAttr['attribs'])) {
if ($temp = ArrayHelper::toString($strAttr['attribs'])) {
$buffer .= ' ' . $temp;
}
}
$buffer .= $tagEnd . $lnEnd;
}
// Generate stylesheet declarations
foreach ($document->_style as $type => $content) {
$buffer .= $tab . '<style';
if (!is_null($type) && (!$document->isHtml5() || !in_array($type, $defaultCssMimes))) {
$buffer .= ' type="' . $type . '"';
}
$buffer .= '>' . $lnEnd;
// This is for full XHTML support.
if ($document->_mime != 'text/html') {
$buffer .= $tab . $tab . '/*<![CDATA[*/' . $lnEnd;
}
$buffer .= $content . $lnEnd;
// See above note
if ($document->_mime != 'text/html') {
$buffer .= $tab . $tab . '/*]]>*/' . $lnEnd;
}
$buffer .= $tab . '</style>' . $lnEnd;
}
//.........这里部分代码省略.........
开发者ID:kshitijSharma2014,项目名称:joomla-cms,代码行数:101,代码来源:head.php
示例17: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$categoryId = $this->state->get('filter.category_id');
$component = $this->state->get('filter.component');
$section = $this->state->get('filter.section');
$canDo = null;
$user = JFactory::getUser();
$extension = JFactory::getApplication()->input->get('extension', '', 'word');
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
// Avoid nonsense situation.
if ($component == 'com_categories') {
return;
}
// Need to load the menu language file as mod_menu hasn't been loaded yet.
$lang = JFactory::getLanguage();
$lang->load($component, JPATH_BASE, null, false, false) || $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component, null, false, false) || $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load($component, JPATH_ADMINISTRATOR . '/components/' . $component, $lang->getDefault(), false, false);
// Load the category helper.
require_once JPATH_COMPONENT . '/helpers/categories.php';
// Get the results for each action.
$canDo = CategoriesHelper::getActions($component, $categoryId);
// If a component categories title string is present, let's use it.
if ($lang->hasKey($component_title_key = strtoupper($component . ($section ? "_{$section}" : '')) . '_CATEGORIES_TITLE')) {
$title = JText::_($component_title_key);
} elseif ($lang->hasKey($component_section_key = strtoupper($component . ($section ? "_{$section}" : '')))) {
$title = JText::sprintf('COM_CATEGORIES_CATEGORIES_TITLE', $this->escape(JText::_($component_section_key)));
} else {
$title = JText::_('COM_CATEGORIES_CATEGORIES_BASE_TITLE');
}
// Load specific css component
JHtml::_('stylesheet', $component . '/administrator/categories.css', array(), true);
// Prepare the toolbar.
JToolbarHelper::title($title, 'categories ' . substr($component, 4) . ($section ? "-{$section}" : '') . '-categories');
if ($canDo->get('core.create') || count($user->getAuthorisedCategories($component, 'core.create')) > 0) {
JToolbarHelper::addNew('category.add');
}
if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) {
JToolbarHelper::editList('category.edit');
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('categories.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('categories.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::archiveList('categories.archive');
}
if (JFactory::getUser()->authorise('core.admin')) {
JToolbarHelper::checkin('categories.checkin');
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete', $component)) {
JToolbarHelper::deleteList('', 'categories.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('categories.trash');
}
// Add a batch button
if ($user->authorise('core.create', $extension) & $user->authorise('core.edit', $extension) && $user->authorise('core.edit.state', $extension)) {
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::custom('categories.rebuild', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false);
JToolbarHelper::preferences($component);
}
// Compute the ref_key if it does exist in the component
if (!$lang->hasKey($ref_key = strtoupper($component . ($section ? "_{$section}" : '')) . '_CATEGORIES_HELP_KEY')) {
$ref_key = 'JHELP_COMPONENTS_' . strtoupper(substr($component, 4) . ($section ? "_{$section}" : '')) . '_CATEGORIES';
}
// Get help for the categories view for the component by
// -remotely searching in a language defined dedicated URL: *component*_HELP_URL
// -locally searching in a component help file if helpURL param exists in the component and is set to ''
// -remotely searching in a component URL if helpURL param exists in the component and is NOT set to ''
if ($lang->hasKey($lang_help_url = strtoupper($component) . '_HELP_URL')) {
$debug = $lang->setDebug(false);
$url = JText::_($lang_help_url);
$lang->setDebug($debug);
} else {
$url = null;
}
JToolbarHelper::help($ref_key, JComponentHelper::getParams($component)->exists('helpURL'), $url);
JHtmlSidebar::setAction('index.php?option=com_categories&view=categories');
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_MAX_LEVELS'), 'filter_level', JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
if (JHelperTags::getTypes('objectList', array($extension . '.category'), true)) {
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_TAG'), 'filter_tag', JHtml::_('select.options', JHtml::_('tag.options', true, true), 'value', 'text', $this->state->get('filter.tag')));
}
}
开发者ID:fur81,项目名称:zofaxiopeu,代码行数:95,代码来源:view.html.php
示例18: fetchHead
/**
* Generates the head HTML and return the results as a string
*
* @param JDocument $document The document for which the head will be created
*
* @return string The head hTML
*
* @since 11.1
*/
public function fetchHead($document)
{
// Convert the tagids to titles
if (isset($document->_metaTags['standard']['tags'])) {
$tagsHelper = new JHelperTags();
$document->_metaTags['standard']['tags'] = implode(', ', $tagsHelper->getTagNames($document->_metaTags['standard']['tags']));
}
// Trigger the onBeforeCompileHead event
$app = JFactory::getApplication();
$app->triggerEvent('onBeforeCompileHead');
// Get line endings
$lnEnd = $document->_getLineEnd();
$tab = $document->_getTab();
$tagEnd = ' />';
$buffer = '';
// Generate charset when using HTML5 (should happen first)
if ($document->isHtml5()) {
$buffer .= $tab . '<meta charset="' . $document->getCharset() . '&q
|
请发表评论