diff --git a/administrator/language/en-GB/en-GB.com_content.ini b/administrator/language/en-GB/en-GB.com_content.ini index 696b31c48b44a..cf090f582722f 100644 --- a/administrator/language/en-GB/en-GB.com_content.ini +++ b/administrator/language/en-GB/en-GB.com_content.ini @@ -30,8 +30,8 @@ COM_CONTENT_CONFIG_LIST_SETTINGS_DESC="These settings apply for List Layouts Opt COM_CONTENT_CONFIGURATION="Articles: Options" COM_CONTENT_CREATE_ARTICLE_CANCEL_REDIRECT_MENU_DESC="Select the page the user will be redirected to after Canceling article submission. The default is to redirect to the same article submission page (cleaning form)." COM_CONTENT_CREATE_ARTICLE_CANCEL_REDIRECT_MENU_LABEL="Cancel Redirect" -COM_CONTENT_CREATE_ARTICLE_CATEGORY_LABEL="Default Category" COM_CONTENT_CREATE_ARTICLE_CATEGORY_DESC="If set to 'Yes', this page will only let you create articles in the category selected below." +COM_CONTENT_CREATE_ARTICLE_CATEGORY_LABEL="Specific Category" COM_CONTENT_CREATE_ARTICLE_CUSTOM_CANCEL_REDIRECT_DESC="If set to 'Yes', you can set a redirection page, distinct from above 'Submission/Cancel Redirect', to redirect to when user Cancels article submission.
If set to 'No', when user Cancels article submission, the user is redirected to the above 'Submission/Cancel Redirect' page." COM_CONTENT_CREATE_ARTICLE_CUSTOM_CANCEL_REDIRECT_LABEL="Custom Redirect on Cancel" COM_CONTENT_CREATE_ARTICLE_ERROR="When default category is enabled, a category should be selected." diff --git a/components/com_content/models/form.php b/components/com_content/models/form.php index a854141c70fee..03573c22f183f 100644 --- a/components/com_content/models/form.php +++ b/components/com_content/models/form.php @@ -206,9 +206,9 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') { $params = $this->getState()->get('params'); - if ($params && $params->get('enable_category') == 1) + if ($params && $params->get('enable_category') == 1 && $params->get('catid')) { - $form->setFieldAttribute('catid', 'default', $params->get('catid', 1)); + $form->setFieldAttribute('catid', 'default', $params->get('catid')); $form->setFieldAttribute('catid', 'readonly', 'true'); } diff --git a/components/com_content/views/form/view.html.php b/components/com_content/views/form/view.html.php index dfeb920660ce4..9feb7229d21fb 100644 --- a/components/com_content/views/form/view.html.php +++ b/components/com_content/views/form/view.html.php @@ -52,7 +52,16 @@ public function display($tpl = null) if (empty($this->item->id)) { - $authorised = $user->authorise('core.create', 'com_content') || count($user->getAuthorisedCategories('com_content', 'core.create')); + $catid = $this->state->params->get('catid'); + + if ($this->state->params->get('enable_category') == 1 && $catid) + { + $authorised = $user->authorise('core.create', 'com_content.category.' . $catid); + } + else + { + $authorised = $user->authorise('core.create', 'com_content') || count($user->getAuthorisedCategories('com_content', 'core.create')); + } } else {