📄 admin.modules.html.php
字号:
<?php
/**
* @version $Id: admin.modules.html.php 8577 2007-08-26 22:45:22Z eddieajau $
* @package Joomla
* @subpackage Modules
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
/**
* @package Joomla
* @subpackage Modules
*/
class HTML_modules
{
/**
* Writes a list of the defined modules
* @param array An array of category objects
*/
function view( &$rows, &$client, &$page, &$lists )
{
$user =& JFactory::getUser();
//Ordering allowed ?
$ordering = (($lists['order'] == 'm.position'));
JHTML::_('behavior.tooltip');
?>
<form action="index.php?option=com_modules" method="post" name="adminForm">
<table>
<tr>
<td align="left" width="100%">
<?php echo JText::_( 'Filter' ); ?>:
<input type="text" name="search" id="search" value="<?php echo $lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />
<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
<button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
</td>
<td nowrap="nowrap">
<?php
echo $lists['assigned'];
echo $lists['position'];
echo $lists['type'];
echo $lists['state'];
?>
</td>
</tr>
</table>
<table class="adminlist" cellspacing="1">
<thead>
<tr>
<th width="20">
<?php echo JText::_( 'NUM' ); ?>
</th>
<th width="20">
<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows );?>);" />
</th>
<th class="title">
<?php echo JHTML::_('grid.sort', 'Module Name', 'm.title', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="7%">
<?php echo JHTML::_('grid.sort', 'Published', 'm.published', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="80" nowrap="nowrap">
<?php echo JHTML::_('grid.sort', 'Order', 'm.position', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th width="1%">
<?php echo JHTML::_('grid.order', $rows ); ?>
</th>
<?php
if ( $client->id == 0 ) {
?>
<th nowrap="nowrap" width="7%">
<?php echo JHTML::_('grid.sort', 'Access', 'groupname', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<?php
}
?>
<th nowrap="nowrap" width="7%">
<?php echo JHTML::_('grid.sort', 'Position', 'm.position', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="5%">
<?php echo JHTML::_('grid.sort', 'Pages', 'pages', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="10%" class="title">
<?php echo JHTML::_('grid.sort', 'Type', 'm.module', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="1%">
<?php echo JHTML::_('grid.sort', 'ID', 'm.id', @$lists['order_Dir'], @$lists['order'] ); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="12">
<?php echo $page->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i=0, $n=count( $rows ); $i < $n; $i++) {
$row = &$rows[$i];
$link = JRoute::_( 'index.php?option=com_modules&client='. $client->id .'&task=edit&cid[]='. $row->id );
$access = JHTML::_('grid.access', $row, $i );
$checked = JHTML::_('grid.checkedout', $row, $i );
$published = JHTML::_('grid.published', $row, $i );
?>
<tr class="<?php echo "row$k"; ?>">
<td align="right">
<?php echo $page->getRowOffset( $i ); ?>
</td>
<td width="20">
<?php echo $checked; ?>
</td>
<td>
<?php
if ( JTable::isCheckedOut($user->get ('id'), $row->checked_out ) ) {
echo $row->title;
} else {
?>
<a href="<?php echo $link; ?>">
<?php echo $row->title; ?>
</a>
<?php
}
?>
</td>
<td align="center">
<?php echo $published;?>
</td>
<td class="order" colspan="2">
<span><?php echo $page->orderUpIcon( $i, ($row->position == @$rows[$i-1]->position), 'orderup', 'Move Up', $ordering ); ?></span>
<span><?php echo $page->orderDownIcon( $i, $n, ($row->position == @$rows[$i+1]->position),'orderdown', 'Move Down', $ordering ); ?></span>
<?php $disabled = $ordering ? '' : 'disabled="disabled"'; ?>
<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
</td>
<?php
if ( $client->id == 0 ) {
?>
<td align="center">
<?php echo $access;?>
</td>
<?php
}
?>
<td align="center">
<?php echo $row->position; ?>
</td>
<td align="center">
<?php
if (is_null( $row->pages )) {
echo JText::_( 'None' );
} else if ($row->pages > 0) {
echo JText::_( 'Varies' );
} else {
echo JText::_( 'All' );
}
?>
</td>
<td>
<?php echo $row->module ? $row->module : JText::_( 'User' );?>
</td>
<td>
<?php echo $row->id;?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</tbody>
</table>
<input type="hidden" name="option" value="com_modules" />
<input type="hidden" name="client" value="<?php echo $client->id;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="" />
</form>
<?php
}
/**
* Writes the edit form for new and existing module
*
* A new record is defined when <var>$row</var> is passed with the <var>id</var>
* property set to 0.
* @param JTableCategory The category object
* @param array <p>The modules of the left side. The array elements are in the form
* <var>$leftorder[<i>order</i>] = <i>label</i></var>
* where <i>order</i> is the module order from the db table and <i>label</i> is a
* text label associciated with the order.</p>
* @param array See notes for leftorder
* @param array An array of select lists
* @param object Parameters
*/
function edit( &$model, &$row, &$orders2, &$lists, &$params, $client )
{
JRequest::setVar( 'hidemainmenu', 1 );
// clean item data
jimport('joomla.filter.output');
JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'content' );
// Check for component metadata.xml file
//$path = JApplicationHelper::getPath( 'mod'.$client->id.'_xml', $row->module );
//$params = new JParameter( $row->params, $path );
$document =& JFactory::getDocument();
JHTML::_('behavior.combobox');
jimport('joomla.html.pane');
$pane =& JPane::getInstance('sliders');
$editor =& JFactory::getEditor();
JHTML::_('behavior.tooltip');
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
if ( ( pressbutton == 'save' || pressbutton == 'apply' ) && ( document.adminForm.title.value == "" ) ) {
alert("<?php echo JText::_( 'Module must have a title', true ); ?>");
} else {
<?php
if ($row->module == '' || $row->module == 'custom') {
echo $editor->save( 'content' );
}
?>
submitform(pressbutton);
}
}
<!--
var originalOrder = '<?php echo $row->ordering;?>';
var originalPos = '<?php echo $row->position;?>';
var orders = new Array(); // array in the format [key,value,text]
<?php $i = 0;
foreach ($orders2 as $k=>$items) {
foreach ($items as $v) {
echo "\n orders[".$i++."] = new Array( \"$k\",\"$v->value\",\"$v->text\" );";
}
}
?>
//-->
</script>
<form action="index.php" method="post" name="adminForm">
<div class="col50">
<fieldset class="adminform">
<legend><?php echo JText::_( 'Details' ); ?></legend>
<table class="admintable" cellspacing="1">
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Module Type' ); ?>:
</td>
<td>
<strong>
<?php echo JText::_($row->module); ?>
</strong>
</td>
</tr>
<tr>
<td class="key">
<label for="title">
<?php echo JText::_( 'Title' ); ?>:
</label>
</td>
<td>
<input class="text_area" type="text" name="title" id="title" size="35" value="<?php echo $row->title; ?>" />
</td>
</tr>
<tr>
<td width="100" class="key">
<?php echo JText::_( 'Show title' ); ?>:
</td>
<td>
<?php echo $lists['showtitle']; ?>
</td>
</tr>
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Published' ); ?>:
</td>
<td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -