📄 admin.content.html.php
字号:
{
var form = document.adminForm;
if ( pressbutton == 'menulink' ) {
if ( form.menuselect.value == "" ) {
alert( "<?php echo JText::_( 'Please select a Menu', true ); ?>" );
return;
} else if ( form.link_name.value == "" ) {
alert( "<?php echo JText::_( 'Please enter a Name for this menu item', true ); ?>" );
return;
}
}
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
var text = <?php echo $editor->getContent( 'text' ); ?>
if (form.title.value == ""){
alert( "<?php echo JText::_( 'Article must have a title', true ); ?>" );
} else if (form.sectionid.value == "-1"){
alert( "<?php echo JText::_( 'You must select a Section', true ); ?>" );
} else if (form.catid.value == "-1"){
alert( "<?php echo JText::_( 'You must select a Category', true ); ?>" );
} else if (form.catid.value == ""){
alert( "<?php echo JText::_( 'You must select a Category', true ); ?>" );
} else if (text == ""){
alert( "<?php echo JText::_( 'Article must have some text', true ); ?>" );
} else {
<?php
echo $editor->save( 'text' );
?>
submitform( pressbutton );
}
}
//-->
</script>
<form action="index.php" method="post" name="adminForm">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td valign="top">
<?php ContentView::_displayArticleDetails( $row, $lists ); ?>
<table class="adminform">
<tr>
<td>
<?php
// parameters : areaname, content, width, height, cols, rows
echo $editor->display( 'text', $row->text , '100%', '550', '75', '20' ) ;
?>
</td>
</tr>
</table>
</td>
<td valign="top" width="320" style="padding: 7px 0 0 5px">
<?php
ContentView::_displayArticleStats($row, $lists);
$title = JText::_( 'Parameters - Article' );
echo $pane->startPane("content-pane");
echo $pane->startPanel( $title, "detail-page" );
echo $form->render('details');
$title = JText::_( 'Parameters - Advanced' );
echo $pane->endPanel();
echo $pane->startPanel( $title, "params-page" );
echo $form->render('params', 'advanced');
$title = JText::_( 'Metadata Information' );
echo $pane->endPanel();
echo $pane->startPanel( $title, "metadata-page" );
echo $form->render('meta', 'metadata');
echo $pane->endPanel();
echo $pane->endPane();
?>
</td>
</tr>
</table>
<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
<input type="hidden" name="version" value="<?php echo $row->version; ?>" />
<input type="hidden" name="mask" value="0" />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
</form>
<?php
echo JHTML::_('behavior.keepalive');
}
/**
* Form to select Section/Category to move item(s) to
* @param array An array of selected objects
* @param int The current section we are looking at
* @param array The list of sections and categories to move to
*/
function moveSection( $cid, $sectCatList, $option, $sectionid, $items )
{
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
if (!getSelectedValue( 'adminForm', 'sectcat' )) {
alert( "<?php echo JText::_( 'Please select something', true ); ?>" );
} else {
submitform( pressbutton );
}
}
</script>
<form action="index.php" method="post" name="adminForm">
<table class="adminform">
<tr>
<td valign="top" width="40%">
<strong><?php echo JText::_( 'Move to Section/Category' ); ?>:</strong>
<br />
<?php echo $sectCatList; ?>
<br /><br />
</td>
<td valign="top">
<strong><?php echo JText::_( 'Items being Moved' ); ?>:</strong>
<br />
<?php
echo "<ol>";
foreach ( $items as $item ) {
echo "<li>". $item->title ."</li>";
}
echo "</ol>";
?>
</td>
</tr>
</table>
<br /><br />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="sectionid" value="<?php echo $sectionid; ?>" />
<input type="hidden" name="task" value="" />
<?php
foreach ($cid as $id) {
echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
}
?>
</form>
<?php
}
/**
* Form to select Section/Category to copys item(s) to
*/
function copySection( $option, $cid, $sectCatList, $sectionid, $items )
{
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
// do field validation
if (!getSelectedValue( 'adminForm', 'sectcat' )) {
alert( "<?php echo JText::_( 'VALIDSELECTSECTCATCOPYITEMS', true ); ?>" );
} else {
submitform( pressbutton );
}
}
</script>
<form action="index.php" method="post" name="adminForm">
<table class="adminform">
<tr>
<td valign="top" width="40%">
<strong><?php echo JText::_( 'Copy to Section/Category' ); ?>:</strong>
<br />
<?php echo $sectCatList; ?>
<br /><br />
</td>
<td valign="top">
<strong><?php echo JText::_( 'Items being copied' ); ?>:</strong>
<br />
<?php
echo "<ol>";
foreach ( $items as $item ) {
echo "<li>". $item->title ."</li>";
}
echo "</ol>";
?>
</td>
</tr>
</table>
<br /><br />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="sectionid" value="<?php echo $sectionid; ?>" />
<input type="hidden" name="task" value="" />
<?php
foreach ($cid as $id) {
echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
}
?>
</form>
<?php
}
function previewContent()
{
global $mainframe;
$editor =& JFactory::getEditor();
$document =& JFactory::getDocument();
$document->setLink($mainframe->getSiteURL());
JHTML::_('behavior.caption');
?>
<script>
var form = window.top.document.adminForm
var title = form.title.value;
var alltext = window.top.<?php echo $editor->getContent('text') ?>;
alltext = alltext.replace('<hr id=\"system-readmore\" \/>', '');
</script>
<table align="center" width="90%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td class="contentheading" colspan="2"><script>document.write(title);</script></td>
</tr>
<tr>
<script>document.write("<td valign=\"top\" height=\"90%\" colspan=\"2\">" + alltext + "</td>");</script>
</tr>
</table>
<?php
}
/**
* Renders pagebreak options
*
*/
function insertPagebreak()
{
?>
<script type="text/javascript">
function insertPagebreak()
{
// Get the pagebreak title
var title = document.getElementById("title").value;
if (title != '') {
title = "title=\""+title+"\" ";
}
// Get the pagebreak toc alias -- not inserting for now
// don't know which attribute to use...
var alt = document.getElementById("alt").value;
if (alt != '') {
alt = "alt=\""+alt+"\" ";
}
var tag = "<hr class=\"system-pagebreak\" "+title+" "+alt+"/>";
window.parent.jInsertEditorText(tag);
window.parent.document.getElementById('sbox-window').close();
return false;
}
</script>
<form>
<table width="100%" align="center">
<tr width="40%">
<td class="key" align="right">
<label for="title">
<?php echo JText::_( 'PGB PAGE TITLE' ); ?>
</label>
</td>
<td>
<input type="text" id="title" name="title" />
</td>
</tr>
<tr width="60%">
<td class="key" align="right">
<label for="alias">
<?php echo JText::_( 'PGB TOC ALIAS PROMPT' ); ?>
</label>
</td>
<td>
<input type="text" id="alt" name="alt" />
</td>
</tr>
</table>
</form>
<button onclick="insertPagebreak();"><?php echo JText::_( 'PGB INS PAGEBRK' ); ?></button>
<?php
}
function _displayArticleDetails(&$row, &$lists )
{
?>
<table class="adminform">
<tr>
<td>
<label for="title">
<?php echo JText::_( 'Title' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" name="title" id="title" size="40" maxlength="255" value="<?php echo $row->title; ?>" />
</td>
<td>
<label>
<?php echo JText::_( 'Published' ); ?>
</label>
</td>
<td>
<?php echo $lists['state']; ?>
</td>
</tr>
<tr>
<td>
<label for="alias">
<?php echo JText::_( 'Alias' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" name="alias" id="alias" size="40" maxlength="255" value="<?php echo $row->alias; ?>" />
</td>
<td>
<label>
<?php echo JText::_( 'Frontpage' ); ?>
</label>
</td>
<td>
<?php echo $lists['frontpage']; ?>
</td>
</tr>
<tr>
<td>
<label for="sectionid">
<?php echo JText::_( 'Section' ); ?>
</label>
</td>
<td>
<?php echo $lists['sectionid']; ?>
</td>
<td>
<label for="catid">
<?php echo JText::_( 'Category' ); ?>
</label>
</td>
<td>
<?php echo $lists['catid']; ?>
</td>
</tr>
</table>
<?php
}
function _displayArticleStats(&$row, &$lists )
{
$db =& JFactory::getDBO();
$create_date = null;
$nullDate = $db->getNullDate();
// used to hide "Reset Hits" when hits = 0
if ( !$row->hits ) {
$visibility = 'style="display: none; visibility: hidden;"';
} else {
$visibility = '';
}
?>
<table width="100%" style="border: 1px dashed silver; padding: 5px; margin-bottom: 10px;">
<?php
if ( $row->id ) {
?>
<tr>
<td>
<strong><?php echo JText::_( 'Article ID' ); ?>:</strong>
</td>
<td>
<?php echo $row->id; ?>
</td>
</tr>
<?php
}
?>
<tr>
<td>
<strong><?php echo JText::_( 'State' ); ?></strong>
</td>
<td>
<?php echo $row->state > 0 ? JText::_( 'Published' ) : ($row->state < 0 ? JText::_( 'Archived' ) : JText::_( 'Draft Unpublished' ) );?>
</td>
</tr>
<tr>
<td>
<strong><?php echo JText::_( 'Hits' ); ?></strong>
</td>
<td>
<?php echo $row->hits;?>
<span <?php echo $visibility; ?>>
<input name="reset_hits" type="button" class="button" value="<?php echo JText::_( 'Reset' ); ?>" onclick="submitbutton('resethits');" />
</span>
</td>
</tr>
<tr>
<td>
<strong><?php echo JText::_( 'Revised' ); ?></strong>
</td>
<td>
<?php echo $row->version;?> <?php echo JText::_( 'times' ); ?>
</td>
</tr>
<tr>
<td>
<strong><?php echo JText::_( 'Created' ); ?></strong>
</td>
<td>
<?php
if ( $row->created == $nullDate ) {
echo JText::_( 'New document' );
} else {
echo JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC2') );
}
?>
</td>
</tr>
<tr>
<td>
<strong><?php echo JText::_( 'Modified' ); ?></strong>
</td>
<td>
<?php
if ( $row->modified == $nullDate ) {
echo JText::_( 'Not modified' );
} else {
echo JHTML::_('date', $row->modified, JText::_('DATE_FORMAT_LC2'));
}
?>
</td>
</tr>
</table>
<?php
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -