funchat/admin/config.apnl.php

119 lines
4.7 KiB
PHP

<?php global $session;
/**
* Project: BeCast WebEngine - simple site engine
* File: /admin/config.apnl.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
*
* @link http://www.becast.at
* @copyright 2009-2025 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @package BcWe core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: 46136c7b3c8b92ef759a6cae6baa72c7332ee3ff $
*/
If (!defined("IN_BCWE_ADMIN")) {
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
}
$addnav["right"]=FALSE;
$session->page_begin("config", True);
class config_panel extends admin_module{
function output(){
global $module,$config,$db,$panel,$admin,$module,$root,$firephp,$log,$lang;
if(isset($_POST["send"]) && $_POST["send"]==1){
foreach($_POST as $post=>$value){
if($post!="send" and $config[$post]!=$value){
$field=$db->escape($post);
$update=$db->escape($value);
$db->query("UPDATE " . $config["prefix"] . "config SET `value`='".$update."' WHERE `name`='".$field."'");
}
}
$result = $db->query("SELECT name, value FROM " . $config["prefix"] . "config");
while ($row = $db->fetch_array($result)){
$config[$row["name"]] = $row["value"];
}
}
$result = $db->query("SELECT * FROM `" . $config["prefix"] . "config` v LEFT JOIN `" . $config["prefix"] . "config_categories` c ON v.`category`=c.`cid`");
while ($row = $db->fetch_array($result)){
$data[$row["categoryname"]][]=$row;
}
$panel->title="Konfiguration";
$panel->form(array("action"=>$config["path"]."/admin/index.php?panel=config"));
$panel->content.="<div id=\"vertical_container\">";
foreach($data as $key=>$val){
$panel->content.="<h2 class=\"accordion_toggle\">".$key."</h2>
<div class=\"accordion_content\"><table width=\"700px\">";
foreach($val as $v){
$panel->content.="<tr><td><strong>".$v["title"]."</strong><br /><span style=\"font-size:small;\">".$v["description"]."</span><br />".$panel->get_option($v["option"],$v["name"],$config[$v["name"]])."</td></tr>";
}
$panel->content.="</table></div>";
}
$panel->content.="</div><br /><br />";
$panel->field(array("typ"=>"hidden","name"=>"send","value"=>1));
$panel->submit();
$panel->formClose();
$panel->foot.='<script type="text/javascript">
var bottomAccordion = new accordion(\'vertical_container\');
//bottomAccordion.activate($$(\'vertical_container .accordion_toggle\')[0]);
</script>';
}
function meta() {
global $module,$config,$db,$panel,$userinfo,$admin,$root;
$meta='<script type="text/javascript" src="/thirdparty/tiny/tiny_mce_gzip.js"></script>
<script type="text/javascript">
tinyMCE_GZ.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
disk_cache : true,
debug : false
});
</script>
<script type="text/javascript" src="/thirdparty/tiny/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
language : "de",
plugins : "table,advhr,advimage,advlink,insertdatetime,searchreplace",
theme_advanced_disable : "styleselect,formatselect ",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "seperator,forecolor,removeformat,advhr",
theme_advanced_buttons3 : "tablecontrols,seperator",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
remove_linebreaks : false,
convert_urls : false,
editor_selector : "mceEditor",
editor_deselector : "mceNoEditor"
});
</script>
<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/prototype.js"></script>
<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/effects.js"></script>
<script type="text/javascript" src="'.$config["path"].'/js/scriptaculous/accordion.js"></script>';
return $meta;
}
}
?>