我想拥有它,以便登录到我的 Joomla 网站前端的用户可以在新窗口中编辑他们的文章,而无需在按下编辑按钮后立即应用任何模板,这样只有编辑器(在这种情况下为 JCE ) 显示。
我在 components/com_content/helpers/Icon.php 中找到了源代码,但不知道它是否可能或我必须如何重新编码。任何想法?
// Show checked_out icon if the article is checked out by a different user
if (property_exists($article, 'checked_out') && property_exists($article, 'checked_out_time') && $article->checked_out > 0 && $article->checked_out != $user->get('id')) {
$checkoutUser = JFactory::getUser($article->checked_out);
$button = JHtml::_('image', 'system/checked_out.png', NULL, NULL, true);
$date = JHtml::_('date', $article->checked_out_time);
$tooltip = JText::_('JLIB_HTML_CHECKED_OUT').' :: '.JText::sprintf('COM_CONTENT_CHECKED_OUT_BY', $checkoutUser->name).' <br /> '.$date;
return '<span class="hasTip" title="'.htmlspecialchars($tooltip, ENT_COMPAT, 'UTF-8').'">'.$button.'</span>';
}
$url = 'index.php?option=com_content&task=article.edit&a_id='.$article->id.'&return='.base64_encode(urlencode($uri));
$icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
$text = JHtml::_('image', 'system/'.$icon, JText::_('JGLOBAL_EDIT'), NULL, true);
if ($article->state == 0) {
$overlib = JText::_('JUNPUBLISHED');
}
else {
$overlib = JText::_('JPUBLISHED');
}
$date = JHtml::_('date', $article->created);
$author = $article->created_by_alias ? $article->created_by_alias : $article->author;
$overlib .= '<br />';
$overlib .= $date;
$overlib .= '<br />';
$overlib .= JText::sprintf('COM_CONTENT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8'));
$button = JHtml::_('link', JRoute::_($url), $text);
$output = '<span class="hasTip" title="'.JText::_('COM_CONTENT_EDIT_ITEM').' :: '.$overlib.'">'.$button.'</span>';
return $output;