forked from science-ation/science-ation
Shrink the summarytable headers a bit in size
Add the content management front-end file Add the content management back-end file - its not quite done yet
This commit is contained in:
parent
7e84ab0222
commit
8b5fc1c905
@ -124,7 +124,7 @@ else $wherestatus="";
|
||||
");
|
||||
echo mysql_error();
|
||||
|
||||
echo "<table class=\"summarytable\">";
|
||||
echo "<table class=\"tableview\">";
|
||||
echo "<tr>";
|
||||
if($showstatus) $stat="&showstatus=".$showstatus;
|
||||
echo "<th><a href=\"registration_list.php?sort=status$stat\">".i18n("Status")."</a></th>";
|
||||
|
26
cms.php
Normal file
26
cms.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?
|
||||
/*
|
||||
This file is part of the 'Science Fair In A Box' project
|
||||
SFIAB Website: http://www.sfiab.ca
|
||||
|
||||
Copyright (C) 2008 James Grant <james@lightbox.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation, version 2.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
include "common.inc.php";
|
||||
output_page_cms($_GET['f']);
|
||||
?>
|
136
config/cms.php
Normal file
136
config/cms.php
Normal file
@ -0,0 +1,136 @@
|
||||
<?
|
||||
/*
|
||||
This file is part of the 'Science Fair In A Box' project
|
||||
SFIAB Website: http://www.sfiab.ca
|
||||
|
||||
Copyright (C) 2008 James Grant <james@lightbox.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
License as published by the Free Software Foundation, version 2.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require("../common.inc.php");
|
||||
require_once("../user.inc.php");
|
||||
user_auth_required('committee', 'config');
|
||||
|
||||
//make sure storage folder exists
|
||||
if(!file_exists("../data/userfiles"))
|
||||
mkdir("../data/userfiles");
|
||||
|
||||
|
||||
send_header("Website Content Manager",
|
||||
array('Committee Main' => 'committee_main.php',
|
||||
'SFIAB Configuration' => 'config/index.php')
|
||||
);
|
||||
|
||||
if($_POST['action']=="save")
|
||||
{
|
||||
|
||||
echo happy(i18n("Page text successfully saved"));
|
||||
echo "no, actually its not saving yet, im not done!<br />";
|
||||
|
||||
}
|
||||
|
||||
if($_GET['filename'] || $_GET['id'] || $_GET['action']=="create")
|
||||
{
|
||||
echo "<a href=\"cms.php\"><< Back to file list</a><br />\n";
|
||||
echo "<form method=\"post\" action=\"cms.php\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\n";
|
||||
if($_GET['filename'])
|
||||
echo "<input type=\"hidden\" name=\"filename\" value=\"".htmlspecialchars($r->textname)."\">\n";
|
||||
else
|
||||
echo "Choose filename to create: /web/<input type=\"text\" name=\"filename\" size=\"15\">.html<hr />";
|
||||
|
||||
echo "<table width=\"100%\" cellpadding=\"3\">";
|
||||
foreach($config['languages'] AS $lang=>$langname) {
|
||||
echo "<tr><td>";
|
||||
echo "<table class=\"tableview\" width=\"100%\">";
|
||||
echo "<tr><th>";
|
||||
$q=mysql_query("SELECT * FROM cms WHERE filename='".mysql_escape_string($_GET['filename'])."' AND lang='$lang' ORDER BY dt DESC LIMIT 1");
|
||||
if($r=mysql_fetch_object($q)) {
|
||||
if($r->dt=="0000-00-00 00:00:00" || !$r->dt) $dt="Never";
|
||||
else $dt=$r->dt;
|
||||
echo "<b>".htmlspecialchars($_GET['filename'])." - $langname</b> ".i18n("Last updated").": $dt<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<b>$langname</b><br />"; // ".i18n("Last updated").": $dt<br />";
|
||||
}
|
||||
echo "</th></tr>\n";
|
||||
echo "<tr><td>";
|
||||
require_once("../fckeditor/fckeditor.php");
|
||||
|
||||
$oFCKeditor = new FCKeditor("text_$lang") ;
|
||||
$oFCKeditor->BasePath = "../fckeditor/";
|
||||
$oFCKeditor->Value = $r->text;
|
||||
$oFCKeditor->Width="100%";
|
||||
$oFCKeditor->Height=400;
|
||||
$oFCKeditor->Create() ;
|
||||
|
||||
echo "</td></tr></table>\n";
|
||||
|
||||
echo "</td><td width=\"130\" valign=\"top\">";
|
||||
echo "<table class=\"tableview\" width=\"130\">";
|
||||
|
||||
if($_GET['historylimit']) $historylimit=$_GET['historylimit'];
|
||||
else $historylimit=30;
|
||||
|
||||
echo "<tr><th>".i18n("File History")."</th></tr>\n";
|
||||
$q=mysql_query("SELECT id,dt FROM cms WHERE filename='".$_GET['filename']."' ORDER BY dt DESC LIMIT $historylimit");
|
||||
if(mysql_num_rows($q)) {
|
||||
echo "<tr><td><a href=\"cms.php?filename=".rawurlencode($_GET['filename'])."&id=$r->id\" style=\"font-size: 0.75em;\">$r->dt</a></td></tr>\n";
|
||||
|
||||
}
|
||||
else
|
||||
echo "<tr><td><i>No History</i></td></tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</td></tr>\n";
|
||||
echo "<tr><td colspan=\"2\"><hr /></td></tr>\n";
|
||||
}
|
||||
echo "<tr><td>";
|
||||
echo "<table><tr><td>";
|
||||
echo "<input type=\"submit\" value=\"".i18n("Save Page")."\" />\n";
|
||||
echo "</form>";
|
||||
echo "</td><td>";
|
||||
echo "<form method=\"get\" action=\"cms.php\">";
|
||||
echo "<input type=\"submit\" value=\"".i18n("Cancel Changes")."\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</td></tr></table>\n";
|
||||
|
||||
echo "</td></tr></table>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo i18n("Choose a web page filename to edit");
|
||||
echo "<table class=\"summarytable\">";
|
||||
|
||||
$q=mysql_query("SELECT DISTINCT(filename) AS filename, dt FROM cms ORDER BY filename");
|
||||
echo "<tr><th>".i18n("Filename")."</th><th>".i18n("Last Update")."</th></tr>";
|
||||
while($r=mysql_fetch_object($q))
|
||||
{
|
||||
echo "<tr><td><a href=\"cms.php?filename=".rawurlencode($r->filename)."\">/web/$r->filename</a></td>";
|
||||
if($r->dt=="0000-00-00 00:00:00") $dt="Never";
|
||||
else $dt=$r->dt;
|
||||
echo "<td>$dt</td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
|
||||
send_footer();
|
||||
?>
|
@ -4,7 +4,7 @@
|
||||
SFIAB Website: http://www.sfiab.ca
|
||||
|
||||
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
|
||||
Copyright (C) 2005 James Grant <james@lightbox.org>
|
||||
Copyright (C) 2008 James Grant <james@lightbox.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
|
@ -176,13 +176,13 @@ a:hover {
|
||||
background-color: #5C6F90;
|
||||
padding: 5px;
|
||||
margin: 0px;
|
||||
font-size: 1.1em;
|
||||
font-size: 1.0em;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.summarytable th a{
|
||||
font-size: 1.1em;
|
||||
font-size: 1.0em;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user