Source for file view.html.php
Documentation is available at view.html.php
* @package Joomla.Administrator
* @subpackage com_content
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* View to edit an article.
* @package Joomla.Administrator
* @subpackage com_content
public function display($tpl =
null)
// TODO: This is really dogy - should change this one day.
$document->setTitle(JText::_('COM_CONTENT_PAGEBREAK_DOC_TITLE'));
if (count($errors =
$this->get('Errors')))
$this->form->setFieldAttribute('language', 'readonly', 'true');
$this->form->setFieldAttribute('catid', 'readonly', 'true');
* Add the page title and toolbar.
$userId =
$user->get('id');
$isNew =
($this->item->id ==
0);
$checkedOut =
!($this->item->checked_out ==
0 ||
$this->item->checked_out ==
$userId);
// Built the actions for new and existing records.
JToolbarHelper::title(JText::_('COM_CONTENT_PAGE_' .
($checkedOut ?
'VIEW_ARTICLE' :
($isNew ?
'ADD_ARTICLE' :
'EDIT_ARTICLE'))), 'pencil-2 article-add');
// For new records, check the create permission.
if ($isNew &&
(count($user->getAuthorisedCategories('com_content', 'core.create')) >
0))
// Can't save the record if it's checked out.
// Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
if ($canDo->get('core.edit') ||
($canDo->get('core.edit.own') &&
$this->item->created_by ==
$userId))
// We can save this record, but check the create permission to see if we can return to make a new one.
if ($canDo->get('core.create'))
// If checked out, we can still save
if ($canDo->get('core.create'))
if ($this->state->params->get('save_history', 0) &&
$user->authorise('core.edit'))
Documentation generated on Tue, 19 Nov 2013 15:16:52 +0100 by phpDocumentor 1.4.3