Хранилища Subversion ant

Сравнить редакции

Не учитывать пробелы Редакция 237 → Редакция 238

/trunk/oops.php
39,6 → 39,7
$smarty->assign('error',$errmsg);
$smarty->assign('antversion',$core->getSetting('version',$db));
$smarty->assign('title',$core->getSetting('codename',$db));
$smarty->assign('theme',$theme->getThemeName($core,$db));
 
$smarty->display('oops.tpl');
 
/trunk/lib/theme.php
Новый файл
0,0 → 1,46
<?php
 
/**
* Project: Ant: sources.list generator
* File: theme.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
 
class Theme {
 
function getThemesList() {
$result = array();
$handler = opendir('./themes/');
while ($file = readdir($handler)) {
if ($file != '.' && $file != '..' && $file != '.svn') // && is_dir($file)
if (file_exists('./themes/'.$file.'/style.css')) $result[] = $file;
}
closedir($handler);
return($result);
}
function getThemeName($link,$dblink) { //TODO remove links
$result=$link->getSetting('theme',$dblink);
if (!file_exists('./themes/'.$result.'/style.css')) $result='default';
return $result;
}
function setTheme($newtheme,$dblink){
$req =& $dblink->query("UPDATE settings SET optvalue='$newtheme' WHERE opt='theme'");
}
}
?>
/trunk/lib/init.php
26,6 → 26,7
require dirname(__FILE__)."/Smarty.class.php";
require dirname(__FILE__)."/core.php";
require dirname(__FILE__)."/security.php";
require dirname(__FILE__)."/theme.php";
 
$dsn = "mysql://".$DBuser.":".$DBpass."@".$DBhost."/".$DBname;
$options = array(
42,7 → 43,7
 
$core = new Core;
$secure = new Security;
 
$theme = new Theme;
$smarty = new Smarty;
$smarty->compile_check = true;
 
/trunk/classic.php
97,6 → 97,7
$smarty->assign('title',$core->getSetting('codename',$db));
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
$smarty->assign('style',$core->getCSSList($db));
$smarty->assign('theme',$theme->getThemeName($core,$db));
 
$smarty->display('classic.tpl');
 
/trunk/modern.php
136,6 → 136,7
$smarty->assign('title',$core->getSetting('codename',$db));
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
$smarty->assign('style',$core->getCSSList($db));
$smarty->assign('theme',$theme->getThemeName($core,$db));
 
$smarty->display('modern.tpl');
 
/trunk/signin.php
25,6 → 25,7
 
$smarty->assign('antversion',$core->getSetting('version',$db));
$smarty->assign('title',$core->getSetting('codename',$db));
$smarty->assign('theme',$theme->getThemeName($core,$db));
 
$smarty->display('signin.tpl');
 
/trunk/admin.php
57,6 → 57,7
20 => array ( "title" => $menu_title[2], "item" => "Опции" ),
21 => array ( "title" => $menu_title[2], "item" => "Интерфейсы" ),
22 => array ( "title" => $menu_title[2], "item" => "Пароль" ),
23 => array ( "title" => $menu_title[2], "item" => "Тема" ),
);
 
$menu = "
76,6 → 77,7
<div class='menuitem'><a class='dashed' href='".$admin."?mode=20'>".$menu_item[20]["item"]."</a></div>
<div class='menuitem'><a class='dashed' href='".$admin."?mode=21'>".$menu_item[21]["item"]."</a></div>
<div class='menuitem'><a class='dashed' href='".$admin."?mode=22'>".$menu_item[22]["item"]."</a></div>
<div class='menuitem'><a class='dashed' href='".$admin."?mode=23'>".$menu_item[23]["item"]."</a></div>
</div>
<div id='main'>
";
829,6 → 831,29
break;
}
break;
case '23':
// Управление темами
$display = "<div class='modulename'>".$menu_item[$mode]["title"]." :: <a href='admin.php?mode=".$mode."'>".$menu_item[$mode]["item"]."</a></div>";
if (isset($_GET['chtheme'])){
$chtheme = $secure->wrapStr($_GET["chtheme"]);
$theme->SetTheme($chtheme,$db);
$display.='<p style="color:red;">Тема измененна</p>';
}
$themename = $theme->getThemeName($core,$db); // TODO нарисавать интерфейс поюзабельнее
$display.= '<b>Текущая тема: '.$themename.'</b><br>';
$display.= '<form action="admin.php" method="GET">';
$display.= '<input type="hidden" name="mode" value="23">';
$display.= '<select name="chtheme">';
$dis=$theme->getThemesList();
foreach ($dis as $thm){
$display.= '<option>'.$thm.'</option>';//TODO add 'selected' to theme
}
$display.= '</select><br>';
$display.= '<button type="submit">Сменить тему</button>';
$display.= '</form>';
break;
// }
break;
}
 
 
843,6 → 868,8
$smarty->assign('antversion',$core->getSetting('version',$db));
$smarty->assign('title',$core->getSetting('codename',$db));
$smarty->assign('style',$core->getCSSList($db));
$smarty->assign('theme',$theme->getThemeName($core,$db));
$smarty->display('admin.tpl');
 
 
?>
/trunk/themes/testtheme/style.css
Новый файл
0,0 → 1,67
 
a
{
text-decoration: none;
}
 
a.dashed:hover
{
color: #ffffff;
background-color: #154ead;
background-image: none;
background-repeat: repeat;
background-attachment: scroll;
background-position: 0% 0%;
}
a.dashed
{
border-bottom-width: 1px;
border-bottom-style: dashed;
border-bottom-color: #007799;
}
 
body
{
background-color: #DBE8F9;
font: 11px/24px "Lucida Grande", "Trebuchet MS", Arial, Helvetica, sans-serif;
color: #5A698B;
margin:3px;
}
 
img {
border: 0;
}
 
pre {
font: 10pt Arial;
border: 1px solid #000;
margin: 10px 0;
padding: 10px;
background-color: #dcdcdc;
}
 
pre#replist,pre#reps, p#getfile {
display: none;
}
 
#sourceslist {
font-family: Arial;
padding: 1px 3px;
}
 
#steps{
font: bold 14px serif;
margin: 20px auto;
}
.sllink{
margin-right: 40px;
margin-top: 10px;
text-align: right;
}
 
 
 
 
 
 
 
Изменения свойств:
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: themes/default/style.css
===================================================================
--- themes/default/style.css (revision 0)
+++ themes/default/style.css (revision 238)
@@ -0,0 +1,58 @@
+
+a
+{
+ text-decoration: none;
+}
+
+a.dashed:hover
+{
+ color: #ffffff;
+ background-color: #154ead;
+ background-image: none;
+ background-repeat: repeat;
+ background-attachment: scroll;
+ background-position: 0% 0%;
+}
+a.dashed
+{
+ border-bottom-width: 1px;
+ border-bottom-style: dashed;
+ border-bottom-color: #007799;
+}
+
+body
+{
+ background: #fff url(../img/bg.gif) top left repeat;
+ margin:3px;
+}
+
+img {
+ border: 0;
+}
+
+pre {
+ font: 10pt Arial;
+ border: 1px solid #000;
+ margin: 10px 0;
+ padding: 10px;
+ background-color: #dcdcdc;
+}
+
+pre#replist,pre#reps, p#getfile {
+ display: none;
+}
+
+#sourceslist {
+ font-family: Arial;
+ padding: 1px 3px;
+}
+
+#steps{
+ font: bold 14px serif;
+ margin: 20px auto;
+}
+.sllink{
+ margin-right: 40px;
+ margin-top: 10px;
+ text-align: right;
+}
\ No newline at end of file
/themes/default/style.css
Изменения свойств:
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: telepathy.php
===================================================================
--- telepathy.php (revision 237)
+++ telepathy.php (revision 238)
@@ -56,6 +56,7 @@
$smarty->assign('antversion',$core->getSetting('version',$db));
$smarty->assign('title',$core->getSetting('codename',$db));
$smarty->assign('interface'," &bull; <a href='./changelog.php'>Изменения</a> &bull; ".$core->getInterfacesList($_SERVER["REQUEST_URI"],$db));
+$smarty->assign('theme',$theme->getThemeName($core,$db));
$smarty->display('modern.tpl');
/trunk/css/ant.css
78,61 → 78,3
font: 10pt tahoma;
text-indent: 5px;
}
 
a
{
text-decoration: none;
}
 
a.dashed:hover
{
color: #ffffff;
background-color: #154ead;
background-image: none;
background-repeat: repeat;
background-attachment: scroll;
background-position: 0% 0%;
}
a.dashed
{
border-bottom-width: 1px;
border-bottom-style: dashed;
border-bottom-color: #007799;
}
 
body
{
background: #fff url(../img/bg.gif) top left repeat;
margin:3px;
}
 
img {
border: 0;
}
 
pre {
font: 10pt Arial;
border: 1px solid #000;
margin: 10px 0;
padding: 10px;
background-color: #dcdcdc;
}
 
pre#replist,pre#reps, p#getfile {
display: none;
}
 
#sourceslist {
font-family: Arial;
padding: 1px 3px;
}
 
#steps{
font: bold 14px serif;
margin: 20px auto;
}
.sllink{
margin-right: 40px;
margin-top: 10px;
text-align: right;
}
/trunk/templates/header.tpl
7,6 → 7,7
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://{$feedaddr}/feed.php">
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="http://{$feedaddr}/feed.php?atom=1">
<link rel="stylesheet" type="text/css" href="./css/ant.css">
<link rel="stylesheet" type="text/css" href="./themes/{$theme}/style.css">
{$style}
</head>
<body>