(root)/setup.php - Rev 259
Rev 184 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
<?PHP
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This file is part of Travelsized CMS
* A content management system with modules, based on wiki syntax
*
* Author: Dan Jensen <admin@leinir.dk>
* Copyright 2003/2004
*
* 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; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License is available at: http://www.gnu.org/copyleft/
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
$page_author = $creator_name;
$page_author_email = $creator_email;
$page_menu = 1;
$page_date = formatTime
( time() );
$page_title = i18n
("Setup");
if (!auth
($_REQUEST['username'], $_REQUEST['password']))
$page_content = loginform
($language, siteURL
(true) . "setup/?globalID=setup", $auth_messages);
else if (!isAllowed
("global_setup"))
$page_content = "<p>" . i18n
("You are not allowed to setup the site") . "</p>";
else
{
$setupPage = new setupPage
;
if( isAllowed
("global_admin") )
$setupPage->addCommand( i18n
("System options"), i18n
("The options important to the entire system"), globalIDtoURL
("setup/options") );
$setupPage->contents = "
<table class=\"setup\">
<tr class=\"setup\">
<td width=\"25%\" class=\"setup\">
<div align=\"left\"><em>" . i18n
("Your profile") . "</em></div>
</td>
<td class=\"setup\">
<div align=\"right\">
" . drawCommand
( i18n
("View"), i18n
("View your profile"), globalIDtoURL
( "user/" . currentUser
() ) );
foreach( $profilemodules as $key => $value )
$setupPage->contents .= "
" . drawCommand
( i18n
(substr($value, 14)), i18n
(substr($value, 14)), globalIDtoURL
("user/" . currentUser
() . "/" . substr($value, 14) ) );
$setupPage->contents .= "
" . drawCommand
( i18n
("Edit"), i18n
("Edit your profile information"), globalIDtoURL
( "user/" . currentUser
() . "/edit" ) ) . "
</div>
</td>
</tr>";
if( isAllowed
("global_pages_edit") )
{
$setupPage->contents .= "
<tr class=\"setup\">
<td width=\"25%\" class=\"setup\">
<div align=\"left\"><em><a href=\"" . globalIDtoURL
("setup/pagesetup") . "\">" . i18n
("Pages") . "</a></em></div>
</td>
<td class=\"setup\">
<div align=\"right\">
" . drawCommand
( i18n
("Rebuild page index"), i18n
("Rebuild page index"), globalIDtoURL
("setup/pagesetup/rebuild") ) . "
" . drawCommand
( i18n
("New"), i18n
("Create a new page"), globalIDtoURL
("setup/editpage/$language/") ) . "
</div>
</td>
</tr>";
}
if( isAllowed
("global_menus") )
{
$setupPage->contents .= "
<tr class=\"setup\">
<td width=\"25%\" class=\"setup\">
<div align=\"left\"><em><a href=\"" . globalIDtoURL
("setup/menusetup") . "\">" . i18n
("Menus") . "</a></em></div>
</td>
<td class=\"setup\">
<div align=\"right\">
" . drawCommand
( i18n
("New"), i18n
("Create a new menu"), globalIDtoURL
("setup/editmenu/" . i18n
("New menu") ) ) . "
</div>
</td>
</tr>";
}
if( isAllowed
("global_users_edit") )
{
$setupPage->contents .= "
<tr class=\"setup\">
<td width=\"25%\" class=\"setup\">
<div align=\"left\"><em><a href=\"" . globalIDtoURL
("setup/users") . "\">" . i18n
("Users") . "</a></em></div>
</td>
<td class=\"setup\">
<div align=\"right\">
" . drawCommand
( i18n
("Profile options"), i18n
("Profile options"), globalIDtoURL
("setup/users/profile_options") ) . "
" . drawCommand
( i18n
("Set permission defaults"), i18n
("Set permission defaults"), globalIDtoURL
("setup/users/default_permissions") ) . "
" .drawCommand
( i18n
("New"), i18n
("Create a new user"), globalIDtoURL
("user/" . i18n
("username") . "/new") ) . "
</div>
</td>
</tr>";
}
if( isAllowed
("global_themes") )
{
$setupPage->contents .= "
<tr class=\"setup\">
<td width=\"25%\" class=\"setup\">
<div align=\"left\"><em><a href=\"" . globalIDtoURL
("setup/themesetup") ."\">" . i18n
("Themes") . "</a></em></div>
</td>
<td class=\"setup\">
<div align=\"right\">
" . drawCommand
( i18n
("Options"), i18n
("Theme options") , globalIDtoURL
("setup/themesetup/options") ) . "
</div>
</td>
</tr>";
}
if( isAllowed
("global_files") )
{
$setupPage->contents .= "
<tr class=\"setup\">
<td width=\"25%\" class=\"setup\">
<div align=\"left\"><em><a href=\"" . globalIDtoURL
("setup/filesetup") . "\">" . i18n
("Files") . "</a></em></div>
</td>
<td class=\"setup\">
<div align=\"right\">
" . drawCommand
( i18n
("Upload file"), i18n
("Upload a new file"), globalIDtoURL
("setup/filesetup/upload") ) . "
</div>
</td>
</tr>";
}
$setupPage->contents .= "
<tr class=\"setup\">
<td width=\"25%\" class=\"setup\">
<div align=\"left\"><em><a href=\"" . globalIDtoURL
("setup/modulesetup") . "\">" . i18n
("Modules") . "</a></em></div>
</td>
<td class=\"setup\">
<div align=\"right\">
" . i18n
("Found modules:") . "<br />";
foreach( $modules_setup as $key => $value )
$setupPage->contents .= "
<a href=\"" . globalIDtoURL
("setup/modulesetup/" . substr( $value, 12 ) ) . "\">{$modules_names[$key]}</a><br />";
$setupPage->contents .= "
</div>
</td>
</tr>";
$setupPage->contents .= "
</table>";
$page_content = $setupPage->render();
}
?>