Updated to latest version of CMS

This commit is contained in:
genuineparts 2025-06-23 20:45:15 +02:00
parent ccdf8fbb81
commit edf41b1198
76 changed files with 465 additions and 1162 deletions

View file

@ -1,8 +1,8 @@
<?php
/**
* Project: BeCast Webengine - simple site engine
* File: /inc/panel.class.php
*
* File: /inc/panel.class.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
@ -18,31 +18,31 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @link http://www.becast.at
* @copyright 2009 becast.at
* @copyright 2009-2025 becast.at
* @author Bernhard Jaud <bernhard at becast dot at>
* @package BeCast Webengine core
* @package BcWe core
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: panel.class.php 128 2010-02-21 22:03:37Z genuineparts $
* @version $Id$
*/
$module["panel"]["name"]="Panel Class";
$module["panel"]["ver"]="0.3.4";
$module["panel"]["ver"]="0.3.6";
class panel {
var $sidebar="";
var $page="";
var $bodyext="";
var $title="";
var $content="";
var $meta="";
var $form="";
var $foot="";
var $head="";
var $menu_items ="";
var string $sidebar="";
var string $page="";
var string $bodyext="";
var string $title="";
var string $content="";
var string $meta="";
var string $form="";
var string $foot="";
var string $head="";
var string $menu_items ="";
function page($additional_title="",$meta=""){
global $config,$db,$core;
return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
return '<!DOCTYPE html>
<html lang="de">
<head>
<title>'.$config['sitetitle'].'</title>
<link rel="stylesheet" type="text/css" href="admin.css" />
@ -77,24 +77,26 @@ class panel {
exit();
}
function menu_item($panel,$text, $img=""){
function menu_item($panel,$text, $img=""): void
{
global $config, $userdata, $userinfo, $session, $meta;
if($panel=="group_only"){
$this->menu_items.="<li><strong>".$text."</strong></li>";
}elseif($panel=="admin_home"){
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" /> ".$text."</a></li>";
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" alt='".$img."'> ".$text."</a></li>";
}elseif($panel=="page_home"){
$this->menu_items.="<li><a href=\"".$config["path"]."/index.php\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" /> ".$text."</a></li>";
$this->menu_items.="<li><a href=\"".$config["path"]."/index.php\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" alt='".$img."'> ".$text."</a></li>";
}else{
if($img!=""){
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php?panel=".$panel."\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" /> ".$text."</a></li>";
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php?panel=".$panel."\"><img src=\"".$config["path"]."/admin/images/icons/".$img.".png\" alt='".$img."'> ".$text."</a></li>";
}else{
$this->menu_items.="<li><a href=\"".$config["path"]."/admin/index.php?panel=".$panel."\">".$text."</a></li>";
}
}
}
function admin_message($title,$message,$redirect=FALSE,$panel="",$time="4"){
function admin_message($title,$message,$redirect=FALSE,$panel="",$time="4"): void
{
global $config,$session,$lang;
$session->page_begin("Admin Message", True);
if($panel!="" && $redirect){
@ -111,7 +113,8 @@ class panel {
}
function menu(){
function menu(): string
{
return '<div id="menu">
<ul>'.$this->menu_items.'</ul></div>';
@ -120,8 +123,8 @@ class panel {
function form ($args = array(),$return=FALSE,$extra=""){
$method = $args["method"] ? $args["method"] : 'post';
$action = $args["action"] ? $args["action"] : $_SERVER['PHP_SELF'];
$method = $args["method"] ?? 'POST';
$action = $args["action"] ?? $_SERVER['PHP_SELF'];
$form = '<form action="' .$action. '" method="' .$method. '"' .$extra. '>';
if(!$return){
$this->content .= $form;
@ -129,7 +132,7 @@ class panel {
return $form;
}
}
function formClose ()
function formClose ($return=FALSE)
{
$form = '</form>';
@ -200,7 +203,7 @@ class panel {
}
function submit ($args=array(),$extra="",$return=FALSE)
{
$name = $args["name"] ? $args["name"] : 'submit';
$name = $args["name"] ?? 'submit';
$fld = '<input type="submit" name="'.$name.'" ' .$extra. ' />'; // html: form submit button
if(!$return){
$this->content .= $fld;
@ -214,10 +217,10 @@ class panel {
*/
function textarea ($args = array(),$extra="",$return=FALSE)
{
$name = $args["name"] ? $args["name"] : 'field';
$rows = $args["rows"] ? $args["rows"] : '3';
$cols = $args["cols"] ? $args["cols"] : '30';
$text = $args["value"] ? $args["value"] : '';
$name = $args["name"] ?? 'field';
$rows = $args["rows"] ?? '3';
$cols = $args["cols"] ?? '30';
$text = $args["value"] ?? '';
$fld = '<textarea name="' .$name. '" rows="' .$rows. '" cols="' .$cols. '"' .$extra. '>' .$text. '</textarea>';
if(!$return){