По адресу templates\japyrite\html\com_content\article есть два файла : default.php и form.php в которых есть одна проблемка - пользователь с правами «АВТОР» не может редактировать свои материалы.
Содержание файла default.php :<?php // no direct access
/*------------------------------------------------------------------------
# $JA#PRODUCT_NAME$ - Version $JA#VERSION$ - Licence Owner $JA#OWNER$
# ------------------------------------------------------------------------
# Copyright (C) 2004-2008 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites: http://www.joomlart.com - http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access'); ?>
<?php if ($this->user->authorize('com_content', 'edit', 'content', 'all') && !$this->print) : ?>
<div class="contentpaneopen_edit<?php echo $this->params->get( 'pageclass_sfx' ); ?>" >
<?php echo JHTML::_('icon.edit', $this->article, $this->params, $this->access); ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_title')) : ?>
<h2 class="contentheading<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
<?php if ($this->params->get('link_titles') && $this->article->readmore_link != '') : ?>
<a href="<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
<?php echo $this->escape($this->article->title); ?>
</a>
<?php else : ?>
<?php echo $this->article->title; ?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php if (!$this->params->get('show_intro')) :
echo $this->article->event->afterDisplayTitle;
endif; ?>
<?php
if (
($this->params->get('show_create_date'))
|| (($this->params->get('show_author')) && ($this->article->author != ""))
|| (($this->params->get('show_section') && $this->article->sectionid) || ($this->params->get('show_category') && $this->article->catid))
|| ($this->params->get('show_pdf_icon') || $this->params->get('show_print_icon') || $this->params->get('show_email_icon'))
|| ($this->params->get('show_url') && $this->article->urls)
) :
?>
<div class="article-toolswrap">
<div class="article-tools clearfix">
<div class="article-meta">
<?php if ($this->params->get('show_create_date')) : ?>
<span class="createdate">
<?php echo JHTML::_('date', $this->article->created, JText::_('DATE_FORMAT_LC2'))?>
</span>
<?php endif; ?>
<?php if (($this->params->get('show_author')) && ($this->article->author != "")) : ?>
<span class="createby">
<?php JText::printf(($this->article->created_by_alias ? $this->article->created_by_alias : $this->article->author) ); ?>
</span>
<?php endif; ?>
<?php if (($this->params->get('show_section') && $this->article->sectionid) || ($this->params->get('show_category') && $this->article->catid)) : ?>
<?php if ($this->params->get('show_section') && $this->article->sectionid && isset($this->article->section)) : ?>
<span class="article-section">
<?php if ($this->params->get('link_section')) : ?>
<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getSectionRoute($this->article->sectionid)).'">'; ?>
<?php endif; ?>
<?php echo $this->article->section; ?>
<?php if ($this->params->get('link_section')) : ?>
<?php echo '</a>'; ?>
<?php endif; ?>
<?php if ($this->params->get('show_category')) : ?>
<?php echo ' - '; ?>
<?php endif; ?>
</span>
<?php endif; ?>
<?php if ($this->params->get('show_category') && $this->article->catid) : ?>
<span class="article-category">
<?php if ($this->params->get('link_category')) : ?>
<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->article->catslug, $this->article->sectionid)).'">'; ?>
<?php endif; ?>
<?php echo $this->article->category; ?>
<?php if ($this->params->get('link_section')) : ?>
<?php echo '</a>'; ?>
<?php endif; ?>
</span>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ($this->params->get('show_pdf_icon') || $this->params->get('show_print_icon') || $this->params->get('show_email_icon')) : ?>
<div class="buttonheading">
<?php if (!$this->print) : ?>
<?php if ($this->params->get('show_email_icon')) : ?>
<span>
<?php echo JHTML::_('icon.email', $this->article, $this->params, $this->access); ?>
</span>
<?php endif; ?>
<?php if ( $this->params->get( 'show_print_icon' )) : ?>
<span>
<?php echo JHTML::_('icon.print_popup', $this->article, $this->params, $this->access); ?>
</span>
<?php endif; ?>
<?php if ($this->params->get('show_pdf_icon')) : ?>
<span>
<?php echo JHTML::_('icon.pdf', $this->article, $this->params, $this->access); ?>
</span>
<?php endif; ?>
<?php else : ?>
<span>
<?php echo JHTML::_('icon.print_screen', $this->article, $this->params, $this->access); ?>
</span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_url') && $this->article->urls) : ?>
<span class="article-url">
<a href="http://<?php echo $this->article->urls ; ?>" target="_blank">
<?php echo $this->article->urls; ?></a>
</span>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php echo $this->article->event->beforeDisplayContent; ?>
<div class="article-content">
<?php if (isset ($this->article->toc)) : ?>
<?php echo $this->article->toc; ?>
<?php endif; ?>
<?php echo $this->article->text; ?>
</div>
<?php if ( intval($this->article->modified)!=0 && $this->params->get('show_modify_date')) : ?>
<span class="modifydate">
<?php echo JText::_( 'Last Updated' ); ?> ( <?php echo JHTML::_('date', $this->article->modified, JText::_('DATE_FORMAT_LC2')); ?> )
</span>
<?php endif; ?>
<span class="article_separator"> </span>
<?php echo $this->article->event->afterDisplayContent; ?>
Содержание файла form.php :<?php // no direct access
/*------------------------------------------------------------------------
# $JA#PRODUCT_NAME$ - Version $JA#VERSION$ - Licence Owner $JA#OWNER$
# ------------------------------------------------------------------------
# Copyright (C) 2004-2008 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites: http://www.joomlart.com - http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access'); ?>
<script language="javascript" type="text/javascript">
<!--
function setgood() {
// TODO: Put setGood back
return true;
}
var sectioncategories = new Array;
<?php
$i = 0;
foreach ($this->lists['sectioncategories'] as $k=>$items) {
foreach ($items as $v) {
echo "sectioncategories[".$i++."] = new Array( '$k','".addslashes( $v->id )."','".addslashes( $v->title )."' );\n\t\t";
}
}
?>
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
try {
form.onsubmit();
} catch(e) {
alert(e);
}
// do field validation
var text = <?php echo $this->editor->getContent( 'text' ); ?>
if (form.title.value == '') {
return alert ( "<?php echo JText::_( 'Article must have a title', true ); ?>" );
} else if (text == '') {
return alert ( "<?php echo JText::_( 'Article must have some text', true ); ?>");
} else if (parseInt('<?php echo $this->article->sectionid;?>')) {
// for articles
if (form.catid && getSelectedValue('adminForm','catid') < 1) {
return alert ( "<?php echo JText::_( 'Please select a category', true ); ?>" );
}
}
<?php echo $this->editor->save( 'text' ); ?>
submitform(pressbutton);
}
//-->
</script>
<?php if ($this->params->get('show_page_title', 1)) : ?>
<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>"><?php echo $this->escape($this->params->get('page_title')); ?></div>
<?php endif; ?>
<form action="<?php echo $this->action ?>" method="post" name="adminForm" onSubmit="setgood();">
<fieldset>
<legend><?php echo JText::_('Editor'); ?></legend>
<table class="adminform" width="100%">
<tr>
<td>
<div style="float: left;">
<label for="title">
<?php echo JText::_( 'Title' ); ?>:
</label>
<input class="inputbox" type="text" id="title" name="title" size="50" maxlength="100" value="<?php echo $this->escape($this->article->title); ?>" />
<input class="inputbox" type="hidden" id="alias" name="alias" value="<?php echo $this->escape($this->article->alias); ?>" />
</div>
<div style="float: right;">
<button type="button" onclick="submitbutton('save')">
<?php echo JText::_('Save')?>
</button>
<button type="button" onclick="submitbutton('cancel')">
<?php echo JText::_('Cancel')?>
</button>
</div>
</td>
</tr>
</table>
<?php
echo $this->editor->display('text', $this->article->text, '99%', '400', '70', '15');
?>
</fieldset>
<fieldset>
<legend><?php echo JText::_('Publishing'); ?></legend>
<table class="adminform" width="100%">
<tr>
<td class="key" width="30%">
<label for="sectionid">
<?php echo JText::_( 'Section' ); ?>:
</label>
</td>
<td width="70%">
<?php echo $this->lists['sectionid']; ?>
</td>
</tr>
<tr>
<td class="key">
<label for="catid">
<?php echo JText::_( 'Category' ); ?>:
</label>
</td>
<td>
<?php echo $this->lists['catid']; ?>
</td>
</tr>
<?php if ($this->user->authorize('com_content', 'publish', 'content', 'all')) : ?>
<tr>
<td class="key">
<label for="state">
<?php echo JText::_( 'Published' ); ?>:
</label>
</td>
<td>
<?php echo $this->lists['state']; ?>
</td>
</tr>
<?php endif; ?>
<tr>
<td width="120" class="key">
<label for="frontpage">
<?php echo JText::_( 'Show on Front Page' ); ?>:
</label>
</td>
<td>
<?php echo $this->lists['frontpage']; ?>
</td>
</tr>
<tr>
<td class="key">
<label for="created_by_alias">
<?php echo JText::_( 'Author Alias' ); ?>:
</label>
</td>
<td>
<input style="width: 99%" type="text" id="created_by_alias" name="created_by_alias" size="50" maxlength="100" value="<?php echo $this->article->created_by_alias; ?>" class="inputbox" />
</td>
</tr>
<tr>
<td class="key">
<label for="publish_up">
<?php echo JText::_( 'Start Publishing' ); ?>:
</label>
</td>
<td>
<?php echo JHTML::_('calendar', $this->article->publish_up, 'publish_up', 'publish_up', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25', 'maxlength'=>'19')); ?>
</td>
</tr>
<tr>
<td class="key">
<label for="publish_down">
<?php echo JText::_( 'Finish Publishing' ); ?>:
</label>
</td>
<td>
<?php echo JHTML::_('calendar', $this->article->publish_down, 'publish_down', 'publish_down', '%Y-%m-%d %H:%M:%S', array('class'=>'inputbox', 'size'=>'25', 'maxlength'=>'19')); ?>
</td>
</tr>
<tr>
<td valign="top" class="key">
<label for="access">
<?php echo JText::_( 'Access Level' ); ?>:
</label>
</td>
<td>
<?php echo $this->lists['access']; ?>
</td>
</tr>
<tr>
<td class="key">
<label for="ordering">
<?php echo JText::_( 'Ordering' ); ?>:
</label>
</td>
<td>
<?php echo $this->lists['ordering']; ?>
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo JText::_('Metadata'); ?></legend>
<table class="adminform" width="100%">
<tr>
<td valign="top" class="key" width="20%">
<label for="metadesc">
<?php echo JText::_( 'Description' ); ?>:
</label>
</td>
<td width="80%">
<textarea rows="5" cols="50" style="width:99%; height:120px" class="inputbox" id="metadesc" name="metadesc"><?php echo str_replace('&','&',$this->article->metadesc); ?></textarea>
</td>
</tr>
<tr>
<td valign="top" class="key">
<label for="metakey">
<?php echo JText::_( 'Keywords' ); ?>:
</label>
</td>
<td>
<textarea rows="5" cols="50" style="width:99%; height:50px" class="inputbox" id="metakey" name="metakey"><?php echo str_replace('&','&',$this->article->metakey); ?></textarea>
</td>
</tr>
</table>
</fieldset>
<input type="hidden" name="option" value="com_content" />
<input type="hidden" name="id" value="<?php echo $this->article->id; ?>" />
<input type="hidden" name="version" value="<?php echo $this->article->version; ?>" />
<input type="hidden" name="created_by" value="<?php echo $this->article->created_by; ?>" />
<input type="hidden" name="referer" value="<?php echo @$_SERVER['HTTP_REFERER']; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
<input type="hidden" name="task" value="" />
</form>
<?php echo JHTML::_('behavior.keepalive'); ?>
В принципе я решил эту проблему заменой файла default.php из стандартного шаблона по адресу
templates\ja_purity\html\com_content\article, но возникает проблема с отображением редактора.
Содержание файла default.php :
<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<?php if ($this->params->get('show_page_title', 1) && $this->params->get('page_title')!= $this->article->title) : ?>
<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>"><?php echo $this->escape($this->params->get('page_title')); ?></div>
<?php endif; ?>
<?php if (($this->user->authorize('com_content', 'edit', 'content', 'all') || $this->user->authorize('com_content', 'edit', 'content', 'own')) && !$this->print) : ?>
<div class="contentpaneopen_edit<?php echo $this->params->get( 'pageclass_sfx' ); ?>" >
<?php echo JHTML::_('icon.edit', $this->article, $this->params, $this->access); ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_title',1)) : ?>
<h2 class="contentheading<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
<?php if ($this->params->get('link_titles') && $this->article->readmore_link != '') : ?>
<a href="<?php echo $this->article->readmore_link; ?>" class="contentpagetitle<?php echo $this->params->get( 'pageclass_sfx' ); ?>">
<?php echo $this->escape($this->article->title); ?>
</a>
<?php else : ?>
<?php echo $this->article->title; ?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php if (!$this->params->get('show_intro')) :
echo $this->article->event->afterDisplayTitle;
endif; ?>
<?php
if (
($this->params->get('show_create_date'))
|| (($this->params->get('show_author')) && ($this->article->author != ""))
|| (($this->params->get('show_section') && $this->article->sectionid) || ($this->params->get('show_category') && $this->article->catid))
|| ($this->params->get('show_pdf_icon') || $this->params->get('show_print_icon') || $this->params->get('show_email_icon'))
|| ($this->params->get('show_url') && $this->article->urls)
) :
?>
<div class="article-tools">
<div class="article-meta">
<?php if ($this->params->get('show_create_date')) : ?>
<span class="createdate">
<?php echo JHTML::_('date', $this->article->created, JText::_('DATE_FORMAT_LC2'))?>
</span>
<?php endif; ?>
<?php if (($this->params->get('show_author')) && ($this->article->author != "")) : ?>
<span class="createby">
<?php JText::printf(($this->article->created_by_alias ? $this->article->created_by_alias : $this->article->author) ); ?>
</span>
<?php endif; ?>
<?php if (($this->params->get('show_section') && $this->article->sectionid) || ($this->params->get('show_category') && $this->article->catid)) : ?>
<?php if ($this->params->get('show_section') && $this->article->sectionid && isset($this->article->section)) : ?>
<span class="article-section">
<?php if ($this->params->get('link_section')) : ?>
<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getSectionRoute($this->article->sectionid)).'">'; ?>
<?php endif; ?>
<?php echo $this->article->section; ?>
<?php if ($this->params->get('link_section')) : ?>
<?php echo '</a>'; ?>
<?php endif; ?>
<?php if ($this->params->get('show_category')) : ?>
<?php echo ' - '; ?>
<?php endif; ?>
</span>
<?php endif; ?>
<?php if ($this->params->get('show_category') && $this->article->catid) : ?>
<span class="article-section">
<?php if ($this->params->get('link_category')) : ?>
<?php echo '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->article->catslug, $this->article->sectionid)).'">'; ?>
<?php endif; ?>
<?php echo $this->article->category; ?>
<?php if ($this->params->get('link_category')) : ?>
<?php echo '</a>'; ?>
<?php endif; ?>
</span>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ($this->params->get('show_pdf_icon') || $this->params->get('show_print_icon') || $this->params->get('show_email_icon')) : ?>
<div class="buttonheading">
<?php if (!$this->print) : ?>
<?php if ($this->params->get('show_email_icon')) : ?>
<span>
<?php echo JHTML::_('icon.email', $this->article, $this->params, $this->access); ?>
</span>
<?php endif; ?>
<?php if ( $this->params->get( 'show_print_icon' )) : ?>
<span>
<?php echo JHTML::_('icon.print_popup', $this->article, $this->params, $this->access); ?>
</span>
<?php endif; ?>
<?php if ($this->params->get('show_pdf_icon')) : ?>
<span>
<?php echo JHTML::_('icon.pdf', $this->article, $this->params, $this->access); ?>
</span>
<?php endif; ?>
<?php else : ?>
<span>
<?php echo JHTML::_('icon.print_screen', $this->article, $this->params, $this->access); ?>
</span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_url') && $this->article->urls) : ?>
<span class="article-url">
<a href="http://<?php echo $this->article->urls ; ?>" target="_blank">
<?php echo $this->article->urls; ?></a>
</span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php echo $this->article->event->beforeDisplayContent; ?>
<div class="article-content">
<?php if (isset ($this->article->toc)) : ?>
<?php echo $this->article->toc; ?>
<?php endif; ?>
<?php echo $this->article->text; ?>
</div>
<?php if ( intval($this->article->modified)!=0 && $this->params->get('show_modify_date')) : ?>
<span class="modifydate">
<?php echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->article->modified, JText::_('DATE_FORMAT_LC2'))); ?>
</span>
<?php endif; ?>
<span class="article_separator"> </span>
<?php echo $this->article->event->afterDisplayContent; ?>
Как говорится ПОМОЖИТЕ ПОЖАЛУЙСТА, сами мы не местные в php !