diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index c38c16b5d5293..9efb41156ed6c 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -206,9 +206,14 @@ protected function getListQuery() ->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Join over the categories. - $query->select('c.title AS category_title') + $query->select('c.title AS category_title, c.created_user_id AS category_uid, c.level AS category_level') ->join('LEFT', '#__categories AS c ON c.id = a.catid'); + // Join over the parent categories. + $query->select('parent.title AS parent_category_title, parent.id AS parent_category_id, + parent.created_user_id AS parent_category_uid, parent.level AS parent_category_level') + ->join('LEFT', '#__categories AS parent ON parent.id = c.parent_id'); + // Join over the users for the author. $query->select('ua.name AS author_name') ->join('LEFT', '#__users AS ua ON ua.id = a.created_by'); diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php index 81af7d7f57f5d..ba976f33ea4a9 100644 --- a/administrator/components/com_content/models/featured.php +++ b/administrator/components/com_content/models/featured.php @@ -104,9 +104,14 @@ protected function getListQuery() ->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Join over the categories. - $query->select('c.title AS category_title') + $query->select('c.title AS category_title, c.created_user_id AS category_uid, c.level AS category_level') ->join('LEFT', '#__categories AS c ON c.id = a.catid'); + // Join over the parent categories. + $query->select('parent.title AS parent_category_title, parent.id AS parent_category_id, + parent.created_user_id AS parent_category_uid, parent.level AS parent_category_level') + ->join('LEFT', '#__categories AS parent ON parent.id = c.parent_id'); + // Join over the users for the author. $query->select('ua.name AS author_name') ->join('LEFT', '#__users AS ua ON ua.id = a.created_by'); diff --git a/administrator/components/com_content/views/articles/tmpl/default.php b/administrator/components/com_content/views/articles/tmpl/default.php index 14d5f48f0c6b9..df423febbc20d 100644 --- a/administrator/components/com_content/views/articles/tmpl/default.php +++ b/administrator/components/com_content/views/articles/tmpl/default.php @@ -137,6 +137,10 @@ $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; $canEditOwn = $user->authorise('core.edit.own', 'com_content.article.' . $item->id) && $item->created_by == $userId; $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin; + $canEditCat = $user->authorise('core.edit', 'com_content.category.' . $item->catid); + $canEditOwnCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->catid) && $item->category_uid == $userId; + $canEditParCat = $user->authorise('core.edit', 'com_content.category.' . $item->parent_category_id); + $canEditOwnParCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->parent_category_id) && $item->parent_category_uid == $userId; ?> @@ -190,7 +194,61 @@ escape($item->alias)); ?>
- escape($item->category_title); ?> + parent_category_id . '&extension=com_content'); + $CurrentCatUrl = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . $item->catid . '&extension=com_content'); + $EditCatTxt = JText::_('JACTION_EDIT') . ' ' . JText::_('JCATEGORY'); + + echo JText::_('JCATEGORY') . ': '; + + if ($item->category_level != '1') : + if ($item->parent_category_level != '1') : + echo ' » '; + endif; + endif; + + if (JFactory::getLanguage()->isRtl()) + { + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + echo $this->escape($item->category_title); + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + + if ($item->category_level != '1') : + echo ' « '; + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo $this->escape($item->parent_category_title); + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + endif; + } + else + { + if ($item->category_level != '1') : + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo $this->escape($item->parent_category_title); + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo ' » '; + endif; + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + echo $this->escape($item->category_title); + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + } + ?>
diff --git a/administrator/components/com_content/views/featured/tmpl/default.php b/administrator/components/com_content/views/featured/tmpl/default.php index b6124c6e38a45..110ed7ace501f 100644 --- a/administrator/components/com_content/views/featured/tmpl/default.php +++ b/administrator/components/com_content/views/featured/tmpl/default.php @@ -120,12 +120,16 @@ items); ?> items as $i => $item) : $item->max_ordering = 0; - $ordering = ($listOrder == 'fp.ordering'); - $assetId = 'com_content.article.' . $item->id; - $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid); - $canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id); - $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; - $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin; + $ordering = ($listOrder == 'fp.ordering'); + $assetId = 'com_content.article.' . $item->id; + $canCreate = $user->authorise('core.create', 'com_content.category.' . $item->catid); + $canEdit = $user->authorise('core.edit', 'com_content.article.' . $item->id); + $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $userId || $item->checked_out == 0; + $canChange = $user->authorise('core.edit.state', 'com_content.article.' . $item->id) && $canCheckin; + $canEditCat = $user->authorise('core.edit', 'com_content.category.' . $item->catid); + $canEditOwnCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->catid) && $item->category_uid == $userId; + $canEditParCat = $user->authorise('core.edit', 'com_content.category.' . $item->parent_category_id); + $canEditOwnParCat = $user->authorise('core.edit.own', 'com_content.category.' . $item->parent_category_id) && $item->parent_category_uid == $userId; ?> @@ -180,7 +184,61 @@ escape($item->alias)); ?>
- escape($item->category_title); ?> + parent_category_id . '&extension=com_content'); + $CurrentCatUrl = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . $item->catid . '&extension=com_content'); + $EditCatTxt = JText::_('JACTION_EDIT') . ' ' . JText::_('JCATEGORY'); + + echo JText::_('JCATEGORY') . ': '; + + if ($item->category_level != '1') : + if ($item->parent_category_level != '1') : + echo ' » '; + endif; + endif; + + if (JFactory::getLanguage()->isRtl()) + { + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + echo $this->escape($item->category_title); + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + + if ($item->category_level != '1') : + echo ' « '; + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo $this->escape($item->parent_category_title); + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + endif; + } + else + { + if ($item->category_level != '1') : + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo $this->escape($item->parent_category_title); + if ($canEditParCat || $canEditOwnParCat) : + echo ''; + endif; + echo ' » '; + endif; + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + echo $this->escape($item->category_title); + if ($canEditCat || $canEditOwnCat) : + echo ''; + endif; + } + ?>