📄 admin.templates.html.php
字号:
</tr>
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Description' ); ?>:
</td>
<td>
<?php echo JText::_($row->description); ?>
</td>
</tr>
</table>
</fieldset>
<fieldset class="adminform">
<legend><?php echo JText::_( 'Menu Assignment' ); ?></legend>
<script type="text/javascript">
function allselections() {
var e = document.getElementById('selections');
e.disabled = true;
var i = 0;
var n = e.options.length;
for (i = 0; i < n; i++) {
e.options[i].disabled = true;
e.options[i].selected = true;
}
}
function disableselections() {
var e = document.getElementById('selections');
e.disabled = true;
var i = 0;
var n = e.options.length;
for (i = 0; i < n; i++) {
e.options[i].disabled = true;
e.options[i].selected = false;
}
}
function enableselections() {
var e = document.getElementById('selections');
e.disabled = false;
var i = 0;
var n = e.options.length;
for (i = 0; i < n; i++) {
e.options[i].disabled = false;
}
}
</script>
<table class="admintable" cellspacing="1">
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Menus' ); ?>:
</td>
<td>
<?php if ($client->id == 1) {
echo JText::_('Cannot assign administrator template');
} elseif ($row->pages == 'all') {
echo JText::_('Cannot assign default template');
echo '<input type="hidden" name="default" value="1" />';
} elseif ($row->pages == 'none') { ?>
<label for="menus-none"><input id="menus-none" type="radio" name="menus" value="none" onclick="disableselections();" checked="checked" /><?php echo JText::_( 'None' ); ?></label>
<label for="menus-select"><input id="menus-select" type="radio" name="menus" value="select" onclick="enableselections();" /><?php echo JText::_( 'Select From List' ); ?></label>
<?php } else { ?>
<label for="menus-none"><input id="menus-none" type="radio" name="menus" value="none" onclick="disableselections();" /><?php echo JText::_( 'None' ); ?></label>
<label for="menus-select"><input id="menus-select" type="radio" name="menus" value="select" onclick="enableselections();" checked="checked" /><?php echo JText::_( 'Select From List' ); ?></label>
<?php } ?>
</td>
</tr>
<?php if ($row->pages != 'all' && $client->id != 1) : ?>
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Menu Selection' ); ?>:
</td>
<td>
<?php echo $lists['selections']; ?>
<?php if ($row->pages == 'none') { ?>
<script type="text/javascript">disableselections();</script>
<?php } ?>
</td>
</tr>
<?php endif; ?>
</table>
</fieldset>
</div>
<div class="col width-50">
<fieldset class="adminform">
<legend><?php echo JText::_( 'Parameters' ); ?></legend>
<?php $templatefile = DS.'templates'.DS.$template.DS.'params.ini';
echo is_writable($client->path.$templatefile) ? JText::sprintf('PARAMSWRITABLE', $templatefile):JText::sprintf('PARAMSUNWRITABLE', $templatefile); ?>
<table class="admintable">
<tr>
<td>
<?php
if (!is_null($params)) {
echo $params->render();
} else {
echo '<i>' . JText :: _('No Parameters') . '</i>';
}
?>
</td>
</tr>
</table>
</fieldset>
</div>
<div class="clr"></div>
<input type="hidden" name="id" value="<?php echo $row->directory; ?>" />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="client" value="<?php echo $client->id;?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
function editTemplateSource($template, & $content, $option, & $client, & $ftp)
{
JRequest::setVar( 'hidemainmenu', 1 );
$template_path = $client->path .DS. 'templates' .DS. $template .DS. 'index.php';
?>
<form action="index.php" method="post" name="adminForm">
<?php if($ftp): ?>
<fieldset title="<?php echo JText::_('DESCFTPTITLE'); ?>">
<legend><?php echo JText::_('DESCFTPTITLE'); ?></legend>
<?php echo JText::_('DESCFTP'); ?>
<?php if(JError::isError($ftp)): ?>
<p><?php echo JText::_($ftp->message); ?></p>
<?php endif; ?>
<table class="adminform nospace">
<tbody>
<tr>
<td width="120">
<label for="username"><?php echo JText::_('Username'); ?>:</label>
</td>
<td>
<input type="text" id="username" name="username" class="input_box" size="70" value="" />
</td>
</tr>
<tr>
<td width="120">
<label for="password"><?php echo JText::_('Password'); ?>:</label>
</td>
<td>
<input type="password" id="password" name="password" class="input_box" size="70" value="" />
</td>
</tr>
</tbody>
</table>
</fieldset>
<?php endif; ?>
<table class="adminform">
<tr>
<th>
<?php echo $template_path; ?>
</th>
</tr>
<tr>
<td>
<textarea style="width:100%;height:500px" cols="110" rows="25" name="filecontent" class="inputbox"><?php echo $content; ?></textarea>
</td>
</tr>
</table>
<div class="clr"></div>
<input type="hidden" name="id" value="<?php echo $template; ?>" />
<input type="hidden" name="cid[]" value="<?php echo $template; ?>" />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="client" value="<?php echo $client->id;?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
function chooseCSSFiles($template, $t_dir, $t_files, $option, & $client)
{
JRequest::setVar( 'hidemainmenu', 1 );
?>
<form action="index.php" method="post" name="adminForm">
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr>
<td width="220">
<span class="componentheading"> </span>
</td>
</tr>
</table>
<table class="adminlist">
<tr>
<th width="5%" align="left">
<?php echo JText::_( 'Num' ); ?>
</th>
<th width="85%" align="left">
<?php echo $t_dir; ?>
</th>
<th width="10%">
<?php echo JText::_( 'Writable' ); ?>/<?php echo JText::_( 'Unwritable' ); ?>
</th>
</tr>
<?php
$k = 0;
for ($i = 0, $n = count($t_files); $i < $n; $i++) {
$file = & $t_files[$i];
?>
<tr class="<?php echo 'row'. $k; ?>">
<td width="5%">
<input type="radio" id="cb<?php echo $i;?>" name="filename" value="<?php echo htmlspecialchars( $file, ENT_COMPAT, 'UTF-8' ); ?>" onClick="isChecked(this.checked);" />
</td>
<td width="85%">
<?php echo $file; ?>
</td>
<td width="10%">
<?php echo is_writable($t_dir.DS.$file) ? '<font color="green"> '. JText::_( 'Writable' ) .'</font>' : '<font color="red"> '. JText::_( 'Unwritable' ) .'</font>' ?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</table>
<input type="hidden" name="id" value="<?php echo $template; ?>" />
<input type="hidden" name="cid[]" value="<?php echo $template; ?>" />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="client" value="<?php echo $client->id;?>" />
</form>
<?php
}
/**
* @param string Template name
* @param string Source code
* @param string The option
*/
function editCSSSource($template, $filename, & $content, $option, & $client, & $ftp)
{
JRequest::setVar( 'hidemainmenu', 1 );
$css_path = $client->path . $filename;
?>
<form action="index.php" method="post" name="adminForm">
<?php if($ftp): ?>
<fieldset title="<?php echo JText::_('DESCFTPTITLE'); ?>">
<legend><?php echo JText::_('DESCFTPTITLE'); ?></legend>
<?php echo JText::_('DESCFTP'); ?>
<?php if(JError::isError($ftp)): ?>
<p><?php echo JText::_($ftp->message); ?></p>
<?php endif; ?>
<table class="adminform nospace">
<tbody>
<tr>
<td width="120">
<label for="username"><?php echo JText::_('Username'); ?>:</label>
</td>
<td>
<input type="text" id="username" name="username" class="input_box" size="70" value="" />
</td>
</tr>
<tr>
<td width="120">
<label for="password"><?php echo JText::_('Password'); ?>:</label>
</td>
<td>
<input type="password" id="password" name="password" class="input_box" size="70" value="" />
</td>
</tr>
</tbody>
</table>
</fieldset>
<?php endif; ?>
<table class="adminform">
<tr>
<th>
<?php echo $css_path; ?>
</th>
</tr>
<tr>
<td>
<textarea style="width:100%;height:500px" cols="110" rows="25" name="filecontent" class="inputbox"><?php echo $content; ?></textarea>
</td>
</tr>
</table>
<input type="hidden" name="id" value="<?php echo $template; ?>" />
<input type="hidden" name="cid[]" value="<?php echo $template; ?>" />
<input type="hidden" name="filename" value="<?php echo $filename; ?>" />
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="client" value="<?php echo $client->id;?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -