- md5
- ae636054794676ef1c74e0b665d04e6c
- sha1
- 055cd2e90f50ccb614f74bf8dca68d10f9d2f3c8
- sha256
- 035d735be62c0ab5d0b8537e81263793a0aa8a136d4a2f6f5b23075b19c77aaa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
<?php
/**
* @version $Id: admin.templates.html.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @subpackage Templates
* @copyright Copyright (C) 2005 - 2010 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 Templates
*/
class TemplatesView
{
/**
* @param array An array of data objects
* @param object A page navigation object
* @param string The option
*/
function showTemplates(& $rows, & $lists, & $page, $option, & $client)
{
global $mainframe;
$limitstart = JRequest :: getVar('limitstart', '0', '', 'int');
$user = & JFactory :: getUser();
if (isset ($row->authorUrl) && $row->authorUrl != '') {
$row->authorUrl = str_replace('http://', '', $row->authorUrl);
}
JHTML::_('behavior.tooltip');
?>
<form action="index.php" method="post" name="adminForm">
<table class="adminlist">
<thead>
<tr>
<th width="5" class="title">
<?php echo JText::_( 'Num' ); ?>
</th>
<th class="title" colspan="2">
<?php echo JText::_( 'Template Name' ); ?>
</th>
<?php
if ($client->id == 1) {
?>
<th width="5%">
<?php echo JText::_( 'Default' ); ?>
</th>
<?php
} else {
?>
<th width="5%">
<?php echo JText::_( 'Default' ); ?>
</th>
<th width="5%">
<?php echo JText::_( 'Assigned' ); ?>
</th>
<?php
}
?>
<th width="10%" align="center">
<?php echo JText::_( 'Version' ); ?>
</th>
<th width="15%" class="title">
<?php echo JText::_( 'Date' ); ?>
</th>
<th width="25%" class="title">
<?php echo JText::_( 'Author' ); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="8">
<?php echo $page->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i = 0, $n = count($rows); $i < $n; $i++) {
$row = & $rows[$i];
$author_info = @ $row->authorEmail . '<br />' . @ $row->authorUrl;
?>
<tr class="<?php echo 'row'. $k; ?>">
<td>
<?php echo $page->getRowOffset( $i ); ?>
</td>
<td width="5">
<?php
if ( JTable::isCheckedOut($user->get ('id'), $row->checked_out )) {
?>
<?php
} else {
?>
<input type="radio" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row->directory; ?>" onclick="isChecked(this.checked);" />
<?php
}
?>
</td>
<td><?php $img_path = ($client->id == 1 ? JURI::root().'administrator' : $mainframe->getSiteURL() ).'/templates/'.$row->directory.'/template_thumbnail.png'; ?>
<span class="editlinktip hasTip" title="<?php echo $row->name;?>::
<img border="1" src="<?php echo $img_path; ?>" name="imagelib" alt="<?php echo JText::_( 'No preview available' ); ?>" width="206" height="145" />"><a href="index.php?option=com_templates&task=edit&cid[]=<?php echo $row->directory;?>&client=<?php echo $client->id;?>">
<?php echo $row->name;?></a></span>
</td>
<?php
if ($client->id == 1) {
?>
<td align="center">
<?php
if ($row->published == 1) {
?>
<img src="templates/khepri/images/menu/icon-16-default.png" alt="<?php echo JText::_( 'Published' ); ?>" />
<?php
} else {
?>
<?php
}
?>
</td>
<?php
} else {
?>
<td align="center">
<?php
if ($row->published == 1) {
?>
<img src="templates/khepri/images/menu/icon-16-default.png" alt="<?php echo JText::_( 'Default' ); ?>" />
<?php
} else {
?>
<?php
}
?>
</td>
<td align="center">
<?php
if ($row->assigned == 1) {
?>
<img src="images/tick.png" alt="<?php echo JText::_( 'Assigned' ); ?>" />
<?php
} else {
?>
<?php
}
?>
</td>
<?php
}
?>
<td align="center">
<?php echo $row->version; ?>
</td>
<td>
<?php echo $row->creationdate; ?>
</td>
<td>
<span class="editlinktip hasTip" title="<?php echo JText::_( 'Author Information' );?>::<?php echo $author_info; ?>">
<?php echo @$row->author != '' ? $row->author : ' '; ?>
</span>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="client" value="<?php echo $client->id;?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php
}
function previewTemplate($template, $showPositions, $client, $option)
{
global $mainframe;
$tp = intval($showPositions);
$url = $client->id ? JURI::base() : $mainframe->getSiteURL();
?>
<style type="text/css">
.previewFrame {
border: none;
width: 95%;
height: 600px;
padding: 0px 5px 0px 10px;
}
</style>
<table class="adminform">
<tr>
<th width="50%" class="title">
<?php echo JText::_( 'Site Preview' ); ?>
</th>
<th width="50%" style="text-align:right">
<?php echo JHTML::_('link', $url.'index.php?tp='.$tp.'&template='.$template, JText::_( 'Open in new window' ), array('target' => '_blank')); ?>
</th>
</tr>
<tr>
<td width="100%" valign="top" colspan="2">
<?php echo JHTML::_('iframe', $url.'index.php?tp='.$tp.'&template='.$template,'previewFrame', array('class' => 'previewFrame')) ?>
</td>
</tr>
</table>
<?php
}
/**
* @param string Template name
* @param string Source code
* @param string The option
*/
function editTemplate($row, $lists, & $params, $option, & $client, & $ftp, & $template)
{
JRequest::setVar( 'hidemainmenu', 1 );
JHTML::_('behavior.tooltip');
?>
<form action="index.php" method="post" name="adminForm">
<?php if($ftp): ?>
<fieldset title="<?php echo JText::_('DESCFTPTITLE'); ?>" class="adminform">
<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; ?>
<div class="col width-50">
<fieldset class="adminform">
<legend><?php echo JText::_( 'Details' ); ?></legend>
<table class="admintable">
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Name' ); ?>:
</td>
<td>
<strong>
<?php echo JText::_($row->name); ?>
</strong>
</td>
</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.DS.'templates'.DS.$template.DS.'css'.DS.$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
}
}
The same content is in 11 releases, Joomla 1.5.16 to 1.5.26. See them all, or every version of this file.