Updated to latest version of CMS
This commit is contained in:
parent
ccdf8fbb81
commit
edf41b1198
76 changed files with 465 additions and 1162 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /inc/admin.class.php
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /inc/admin.class.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -17,16 +17,16 @@
|
|||
* 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.astat.org SVN: $URL: http://svn.astat.org/astat/trunk/inc/admin.class.php $
|
||||
* @copyright 2009 becast.at
|
||||
* @link http://www.becast.at
|
||||
* @copyright 2009-2025 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package astat core
|
||||
* @package BcWe core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id: admin.class.php 57 2009-07-10 19:34:56Z genuineparts $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
$module["admin"]["name"]="Admin Class";
|
||||
$module["admin"]["ver"]="0.2.4";
|
||||
$module["admin"]["ver"]="0.2.5";
|
||||
class admin {
|
||||
|
||||
var $module_=array();
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
$module["cache"]["name"]="Cache Class";
|
||||
$module["cache"]["ver"]="0.9.10";
|
||||
/**
|
||||
* Project: beFramed
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /inc/cache.class.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -17,13 +19,13 @@
|
|||
* 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.jaud.be
|
||||
* @copyright 2025 becast.at
|
||||
* @link http://www.becast.at
|
||||
* @copyright 2009-2025 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package beFramed Core
|
||||
* @package BcWe core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
*/
|
||||
/*
|
||||
Already defined by PHP. I'll leave it here for Info
|
||||
define("LOG_EMERG", 0);
|
||||
|
@ -34,8 +36,7 @@ define("LOG_WARNING", 4);
|
|||
define("LOG_INFO", 6);
|
||||
define("LOG_DEBUG", 7);
|
||||
*/
|
||||
$module["cache"]["name"]="Cache Class";
|
||||
$module["cache"]["ver"]="0.9.10";
|
||||
|
||||
class cache {
|
||||
var $server;
|
||||
var $prefix;
|
||||
|
@ -85,12 +86,15 @@ class cache {
|
|||
$this->obj->quit();
|
||||
}
|
||||
|
||||
function set($key,$var,$expiration=null){
|
||||
if($expriation=null){
|
||||
$expriation=$this->exp;
|
||||
function set($key,$var,$exp=null): void
|
||||
{
|
||||
if($exp==null){
|
||||
$expiration = $this->exp;
|
||||
}else{
|
||||
$expiration = $exp;
|
||||
}
|
||||
$this->obj->set($this->prefix.$key,$var,$expiration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get($key){
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /inc/core.class.php
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /inc/core.class.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -17,16 +17,16 @@
|
|||
* 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.astat.org SVN: $URL: http://svn.becast.at/astat/trunk/inc/core.class.php $
|
||||
* @copyright 2025 becast.at
|
||||
* @link http://www.becast.at
|
||||
* @copyright 2009 - 2025 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package astat core
|
||||
* @package BcWe core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id: core.class.php 154 2012-03-27 21:50:46Z genuineparts $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
$module['core']['name']='Core Class';
|
||||
$module['core']['ver']='0.9.81';
|
||||
$module['core']['ver']='1.0.0';
|
||||
|
||||
class Core{
|
||||
|
||||
|
@ -84,7 +84,7 @@ class Core{
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
var $ver_minor='0';
|
||||
var $ver_minor='1';
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -100,7 +100,7 @@ class Core{
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
var $ver_codename='Antiochos';
|
||||
var $ver_codename='Tim';
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -516,7 +516,7 @@ class Core{
|
|||
* Renders the Page
|
||||
*
|
||||
* @param string $content The content for the page
|
||||
* @param bool $minimal Render the Page in a minaml mode (e.g. for redirect)
|
||||
* @param bool $minimal Render the Page in a minmal mode (e.g. for redirect)
|
||||
* @param string $minimal_tpl Custom minimal template
|
||||
* @param string $header_tpl Custom header template
|
||||
* @param string $footer_tpl Custom footer template
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
$module["datacache"]["name"]="Datacache Module";
|
||||
$module["datacache"]["ver"]="0.1.0";
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /inc/datacache.class.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -19,13 +19,13 @@ $module["datacache"]["ver"]="0.1.0";
|
|||
* 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.astat.org SVN: $URL$
|
||||
* @copyright 2010 becast.at
|
||||
* @link http://www.becast.at
|
||||
* @copyright 2009-2025 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package astat core
|
||||
* @package BcWe core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
*/
|
||||
class datacache {
|
||||
|
||||
var $data = array();
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
$module["functions"]["name"]="Functions Module";
|
||||
$module["functions"]["ver"]="1.0.0";
|
||||
$module["functions"]["ver"]="1.0.1";
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /inc/sessions.class.php
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /inc/functions.class.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -19,12 +19,12 @@ $module["functions"]["ver"]="1.0.0";
|
|||
* 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.astat.org SVN: $URL: http://svn.astat.org/astat/trunk/inc/sessions.class.php $
|
||||
* @copyright 2010 becast.at
|
||||
* @link http://www.becast.at
|
||||
* @copyright 2010-2025 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package astat core
|
||||
* @package BcWe core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id: sessions.class.php 129 2010-02-21 22:04:51Z genuineparts $
|
||||
* @version $Id$
|
||||
*/
|
||||
class functions {
|
||||
|
||||
|
@ -120,7 +120,9 @@ class functions {
|
|||
function get_ip(){
|
||||
global $config;
|
||||
$ip = strtolower($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if(empty($config['ip_forwarded_check'])){
|
||||
$config['ip_forwarded_check'] = false;
|
||||
}
|
||||
if($config['ip_forwarded_check'])
|
||||
{
|
||||
$addresses = array();
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
$module["lang"]["name"]="Language Class";
|
||||
$module["lang"]["ver"]="0.1.2";
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* File: /inc/lang.class.php
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /inc/lang.class.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -17,30 +19,30 @@
|
|||
* 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.astat.org SVN: $URL: $
|
||||
* @copyright 2025 becast.at
|
||||
* @link http://www.becast.at
|
||||
* @copyright 2009-2025 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package astat core
|
||||
* @package BcWe core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
$module["lang"]["name"]="Language Class";
|
||||
$module["lang"]["ver"]="0.1.1";
|
||||
*/
|
||||
|
||||
|
||||
class lang{
|
||||
var $langname=array('de'=>'Deutsch','en'=>'English');
|
||||
var $language;
|
||||
var $languagedir;
|
||||
var $lf;
|
||||
var array $langdata;
|
||||
|
||||
function __construct($languagedir='/languages/'){
|
||||
$this->languagedir = dirname(dirname(__FILE__)).'/languages/';
|
||||
}
|
||||
|
||||
function setlang($language){
|
||||
global $config, $error, $db, $log, $core, $plugin, $lang;
|
||||
function setlang($language): void
|
||||
{
|
||||
global $config;
|
||||
unset($this->language);
|
||||
unset($this->lf);
|
||||
unset($this->langdata);
|
||||
if(!$language || $language==''){
|
||||
$language=$config['lang'];
|
||||
if(!$language){
|
||||
|
@ -51,8 +53,10 @@ class lang{
|
|||
}else{
|
||||
$this->language=$language;
|
||||
}
|
||||
include_once $this->languagedir.$this->language.'.lang.php';
|
||||
$this->lf=$lf;
|
||||
require_once $this->languagedir.$this->language.'.lang.php';
|
||||
if (isset($lf)) {
|
||||
$this->langdata = $lf;
|
||||
}
|
||||
}
|
||||
|
||||
function getlanguages(){
|
||||
|
@ -71,8 +75,8 @@ class lang{
|
|||
}
|
||||
|
||||
function _($string){
|
||||
if(isset($this->lf[$string])){
|
||||
return($this->lf[$string]);
|
||||
if(isset($this->langdata[$string])){
|
||||
return($this->langdata[$string]);
|
||||
}else{
|
||||
return($string);
|
||||
}
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -25,9 +25,9 @@ $module["module"]["name"]="Plugin Class";
|
|||
$module["module"]["ver"]="0.1.1";
|
||||
class plugins{
|
||||
|
||||
var $hooks;
|
||||
var $current_hook;
|
||||
var $plugin_=array();
|
||||
var array $hooks;
|
||||
var string $current_hook;
|
||||
var array $plugin_=array();
|
||||
|
||||
function load_plugins($region='G'){
|
||||
global $config, $db;
|
||||
|
@ -63,6 +63,9 @@ class plugins{
|
|||
|
||||
|
||||
function run_hook($name,$variables=array()) {
|
||||
if(empty($this->hooks)){
|
||||
return false;
|
||||
}
|
||||
if(array_key_exists($name,$this->hooks)){
|
||||
if(!is_array($this->hooks[$name]))
|
||||
{
|
||||
|
@ -92,6 +95,7 @@ class plugins{
|
|||
$this->current_hook = '';
|
||||
return $return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
$module["session"]["name"]="Sessionmanagement Module";
|
||||
$module["session"]["ver"]="0.9.1";
|
||||
$module["session"]["ver"]="0.9.2";
|
||||
/**
|
||||
* Project: astat - simple site engine
|
||||
* Project: BeCast WebEngine - simple site engine
|
||||
* File: /inc/sessions.class.php
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
|
@ -19,13 +19,13 @@ $module["session"]["ver"]="0.9.1";
|
|||
* 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.astat.org SVN: $URL: http://svn.astat.org/astat/trunk/inc/sessions.class.php $
|
||||
* @copyright 2010 becast.at
|
||||
* @link http://www.becast.at
|
||||
* @copyright 2009-2025 becast.at
|
||||
* @author Bernhard Jaud <bernhard at becast dot at>
|
||||
* @package astat core
|
||||
* @package BcWe core
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
* @version $Id: sessions.class.php 129 2010-02-21 22:04:51Z genuineparts $
|
||||
*/
|
||||
* @version $Id$
|
||||
*/
|
||||
class session {
|
||||
|
||||
var $sid = 0;
|
||||
|
@ -38,7 +38,7 @@ class session {
|
|||
function page_begin($page = "UNDEFINED", $needlogin = TRUE){
|
||||
global $config, $db, $log, $core, $lang, $plugin, $functions;
|
||||
$plugin->run_hook('page_begin_start',array('page'=>$page,'needlogin'=>$needlogin));
|
||||
if($this->userdata['uid']==0 || !$this->userdata['uid']){
|
||||
if(!isset($this->userdata['uid']) || $this->userdata['uid']==0){
|
||||
$this->ip = $functions->get_ip();
|
||||
$this->packip = $functions->my_inet_pton($this->ip);
|
||||
$this->useragent = $_SERVER["HTTP_USER_AGENT"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue