Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
795f69050a | ||
|
|
1c5bb8aebe | ||
|
|
36f19e64d0 | ||
|
|
19a1081197 | ||
|
|
45974a9e30 | ||
|
|
f1247efd34 | ||
|
|
c38346b97c | ||
|
|
3c26adb493 | ||
|
|
4458f366f9 | ||
|
|
805330638a | ||
|
|
86cd04f862 | ||
|
|
a182834985 | ||
|
|
0ce1432513 | ||
|
|
a447fc2ef6 | ||
|
|
8160d05d25 | ||
|
|
647dd52c92 | ||
|
|
b2fdbc0571 |
@@ -15,10 +15,8 @@
|
||||
// session_name(EDIT_SESSION_NAME);
|
||||
// session_start();
|
||||
// basic class test file
|
||||
// require(LIBS."Class.Basic.inc");
|
||||
// require(LIBS."Class.DB.IO.inc");
|
||||
require(LIBS."Class.Login.inc");
|
||||
require(LIBS."Class.Admin.Backend.inc");
|
||||
foreach (array ('Login', 'Admin.Backend') as $class)
|
||||
_spl_autoload('Class.'.$class.'.inc');
|
||||
|
||||
$lang = 'en_utf8';
|
||||
|
||||
|
||||
@@ -230,6 +230,8 @@
|
||||
$elements[] = $form->form_create_element("password");
|
||||
$elements[] = $form->form_create_element("password_change_interval");
|
||||
$elements[] = $form->form_create_element("email");
|
||||
$elements[] = $form->form_create_element("last_name");
|
||||
$elements[] = $form->form_create_element("first_name");
|
||||
$elements[] = $form->form_create_element("edit_group_id");
|
||||
$elements[] = $form->form_create_element("edit_access_right_id");
|
||||
$elements[] = $form->form_create_element("strict");
|
||||
|
||||
@@ -24,12 +24,9 @@
|
||||
require("config.inc");
|
||||
// set the session name
|
||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||
// login class
|
||||
require(LIBS."Class.Login.inc");
|
||||
// DB connection & work time class
|
||||
require(LIBS.'Class.Admin.Backend.inc');
|
||||
// Smarty: and the small extend for l10n calls
|
||||
require(LIBS.'Class.Smarty.Extend.inc');
|
||||
// login class, DB connections & Admin class, Smarty extension
|
||||
foreach (array ('Login', 'Admin.Backend', 'Smarty.Extend') as $class)
|
||||
_spl_autoload('Class.'.$class.'.inc');
|
||||
//------------------------------ library include end
|
||||
|
||||
//------------------------------ basic variable settings start
|
||||
@@ -42,7 +39,7 @@
|
||||
elseif (!$lang)
|
||||
$lang = DEFAULT_LANG;
|
||||
// end the stop of the output flow, but only if we didn't request a csv file download
|
||||
if ($_POST['action'] != 'download_csv')
|
||||
if (array_key_exists('action', $_POST) && $_POST['action'] != 'download_csv')
|
||||
{
|
||||
header("Content-type: text/html; charset=".$encoding);
|
||||
ob_end_flush();
|
||||
|
||||
@@ -35,7 +35,9 @@
|
||||
|
||||
// set include & template names
|
||||
$CONTENT_INCLUDE = str_replace(".php", ".tpl", $cms->page_name);
|
||||
$FORM_NAME = !$FORM_NAME ? str_replace(".php", "", $cms->page_name) : $FORM_NAME;
|
||||
$FORM_NAME = !isset($FORM_NAME) || !$FORM_NAME ? str_replace(".php", "", $cms->page_name) : $FORM_NAME;
|
||||
// set local page title
|
||||
$L_TITLE = ucfirst(str_replace('_', ' ', $cms->get_page_name(1))).' - '.$G_TITLE;
|
||||
// strip tpl and replace it with inc
|
||||
// php include file per page
|
||||
$cms->INC_TEMPLATE_NAME = str_replace(".tpl", ".inc", $CONTENT_INCLUDE);
|
||||
@@ -44,9 +46,9 @@
|
||||
// css per page
|
||||
$cms->CSS_TEMPLATE_NAME = str_replace(".tpl", ".css", $CONTENT_INCLUDE);
|
||||
// special CSS file
|
||||
$cms->CSS_SPECIAL_TEMPLATE_NAME = $CSS_NAME;
|
||||
$cms->CSS_SPECIAL_TEMPLATE_NAME = @$CSS_NAME;
|
||||
// special JS file
|
||||
$cms->JS_SPECIAL_TEMPLATE_NAME = $JS_NAME;
|
||||
$cms->JS_SPECIAL_TEMPLATE_NAME = @$JS_NAME;
|
||||
|
||||
// set basic template path (tmp)
|
||||
$smarty->setTemplateDir(LAYOUT.$TEMPLATE_DIR.TEMPLATES.'/');
|
||||
|
||||
@@ -24,21 +24,25 @@
|
||||
include($cms->includes.$cms->INC_TEMPLATE_NAME);
|
||||
}
|
||||
// additional per page Javascript include
|
||||
$cms->JS_INCLUDE = '';
|
||||
if (file_exists($cms->javascript.$cms->JS_TEMPLATE_NAME) && is_file($cms->javascript.$cms->JS_TEMPLATE_NAME))
|
||||
{
|
||||
$cms->JS_INCLUDE = $cms->javascript.$cms->JS_TEMPLATE_NAME;
|
||||
}
|
||||
// per page css file
|
||||
$cms->CSS_INCLUDE = '';
|
||||
if (file_exists($cms->css.$cms->CSS_TEMPLATE_NAME) && is_file($cms->css.$cms->CSS_TEMPLATE_NAME))
|
||||
{
|
||||
$cms->CSS_INCLUDE = $cms->css.$cms->CSS_TEMPLATE_NAME;
|
||||
}
|
||||
// optional CSS file
|
||||
$cms->CSS_SPECIAL_INCLUDE = '';
|
||||
if (file_exists($cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME) && is_file($cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME))
|
||||
{
|
||||
$cms->CSS_SPECIAL_INCLUDE = $cms->css.$cms->CSS_SPECIAL_TEMPLATE_NAME;
|
||||
}
|
||||
// optional JS file
|
||||
$cms->JS_SPECIAL_INCLUDE = '';
|
||||
if (file_exists($cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME) && is_file($cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME))
|
||||
{
|
||||
$cms->JS_SPECIAL_INCLUDE = $cms->javascript.$cms->JS_SPECIAL_TEMPLATE_NAME;
|
||||
@@ -64,7 +68,7 @@
|
||||
$cms->HEADER['STYLESHEET'] = $EDIT_STYLESHEET;
|
||||
$cms->HEADER['JAVASCRIPT'] = $EDIT_JAVASCRIPT;
|
||||
// html title
|
||||
$cms->HEADER['HTML_TITLE'] = ((!$L_TITLE) ? $cms->l->__($G_TITLE) : $cms->l->__($L_TITLE));
|
||||
$cms->HEADER['HTML_TITLE'] = (!isset($L_TITLE) || !$L_TITLE) ? $cms->l->__($G_TITLE) : $cms->l->__($L_TITLE);
|
||||
$cms->DATA['table_width'] = $PAGE_WIDTH ? $PAGE_WIDTH : PAGE_WIDTH;
|
||||
|
||||
// messages = array('msg' =>, 'class' => 'error/warning/...')
|
||||
@@ -85,7 +89,7 @@
|
||||
|
||||
// debug data, if DEBUG flag is on, this data is print out
|
||||
$cms->DEBUG_DATA['debug_error_msg'] = $cms->running_time();
|
||||
$cms->DEBUG_DATA['DEBUG'] = $DEBUG_TMPL;
|
||||
$cms->DEBUG_DATA['DEBUG'] = @$DEBUG_TMPL;
|
||||
|
||||
// create main data array
|
||||
$cms->CONTENT_DATA = array_merge($cms->HEADER, $cms->DATA, $cms->DEBUG_DATA);
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
<?
|
||||
$DEBGU_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$ENABLE_ERROR_HANDLING = 0;
|
||||
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
$PRINT_ALL = 1;
|
||||
$DB_DEBUG = 1;
|
||||
|
||||
if ($DEBUG_ALL)
|
||||
error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
|
||||
|
||||
define('USE_DATABASE', true);
|
||||
require("config.inc");
|
||||
require("header.inc");
|
||||
$MASTER_TEMPLATE_NAME = 'main_body.tpl';
|
||||
$TEMPLATE_NAME = 'smarty_test.tpl';
|
||||
|
||||
@@ -2,24 +2,24 @@
|
||||
$edit_users = array (
|
||||
"table_array" => array (
|
||||
"edit_user_id" => array (
|
||||
"value" => $GLOBALS["edit_user_id"],
|
||||
"value" => $GLOBALS["edit_user_id"],
|
||||
"type" => "hidden",
|
||||
"pk" => 1,
|
||||
"int" => 1
|
||||
),
|
||||
"username" => array (
|
||||
"value" => $GLOBALS["username"],
|
||||
"output_name" => "Username",
|
||||
"mandatory" => 1,
|
||||
"value" => $GLOBALS["username"],
|
||||
"output_name" => "Username",
|
||||
"mandatory" => 1,
|
||||
"error_check" => "unique|alphanumericextended",
|
||||
"type" => "text"
|
||||
),
|
||||
"password" => array (
|
||||
"value" => $GLOBALS["password"],
|
||||
"value" => $GLOBALS["password"],
|
||||
"HIDDEN_value" => $GLOBALS["HIDDEN_password"],
|
||||
"CONFIRM_value" => $GLOBALS["CONFIRM_password"],
|
||||
"output_name" => "Password",
|
||||
"mandatory" => 1,
|
||||
"output_name" => "Password",
|
||||
"mandatory" => 1,
|
||||
"type" => "password", // later has to be password for encryption in database
|
||||
'update' => array ( // connected field updates, and update data
|
||||
'password_change_date' => array ( // db row to update
|
||||
@@ -34,17 +34,18 @@
|
||||
'output_name' => 'Password change interval',
|
||||
'error_check' => 'intervalshort', // can be any date length format. n Y/M/D [not H/M/S], only one set, no combination
|
||||
'type' => 'text',
|
||||
'interval' => 1, // interval needs NULL write for empty
|
||||
'size' => 5, // make it 5 chars long
|
||||
'length' => 5
|
||||
),
|
||||
// password reset force interval, if set, user needs to reset password after X time period
|
||||
"enabled" => array (
|
||||
"value" => $GLOBALS["enabled"],
|
||||
"output_name" => "Enabled",
|
||||
"type" => "binary",
|
||||
"value" => $GLOBALS["enabled"],
|
||||
"output_name" => "Enabled",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
)
|
||||
),
|
||||
@@ -79,28 +80,38 @@
|
||||
)
|
||||
),
|
||||
"debug" => array (
|
||||
"value" => $GLOBALS["debug"],
|
||||
"output_name" => "Debug",
|
||||
"type" => "binary",
|
||||
"value" => $GLOBALS["debug"],
|
||||
"output_name" => "Debug",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
)
|
||||
),
|
||||
"db_debug" => array (
|
||||
"value" => $GLOBALS["db_debug"],
|
||||
"output_name" => "DB Debug",
|
||||
"type" => "binary",
|
||||
"value" => $GLOBALS["db_debug"],
|
||||
"output_name" => "DB Debug",
|
||||
"type" => "binary",
|
||||
"int" => 1,
|
||||
"element_list" => array (
|
||||
"1" => "Yes",
|
||||
"1" => "Yes",
|
||||
"0" => "No"
|
||||
)
|
||||
),
|
||||
"email" => array (
|
||||
"value" => $GLOBALS["email"],
|
||||
"output_name" => "E-Mail",
|
||||
"value" => $GLOBALS["email"],
|
||||
"output_name" => "E-Mail",
|
||||
"type" => "text"
|
||||
),
|
||||
"last_name" => array (
|
||||
"value" => $GLOBALS["last_name"],
|
||||
"output_name" => "Last Name",
|
||||
"type" => "text"
|
||||
),
|
||||
"first_name" => array (
|
||||
"value" => $GLOBALS["first_name"],
|
||||
"output_name" => "First Name",
|
||||
"type" => "text"
|
||||
),
|
||||
"edit_language_id" => array (
|
||||
|
||||
@@ -19,7 +19,18 @@
|
||||
DEFINE('DEFAULT_ENCODING', "UTF-8");
|
||||
|
||||
/************* PATHS *********************/
|
||||
// path to document root
|
||||
// ** NEW/BETTER DIR DECLARATIONS **
|
||||
// path to original file (if symlink)
|
||||
DEFINE('DIR', __DIR__."/");
|
||||
// libs base path based on DIR
|
||||
DEFINE('LIBDIR', DIR.'libs/');
|
||||
// SMARTY path based on DIR
|
||||
DEFINE('SMARTYDIR', DIR.'Smarty/');
|
||||
// table arrays for Class Form
|
||||
DEFINE('TABLEARRAYDIR', DIR.'table_arrays/');
|
||||
|
||||
// ** OLD DIR DECLARATIONS **
|
||||
// path to document root of file called
|
||||
DEFINE('ROOT', getcwd()."/");
|
||||
// libs path
|
||||
DEFINE('LIBS', "libs/");
|
||||
@@ -238,16 +249,34 @@
|
||||
$DB_DEBUG = 0;
|
||||
$ENABLE_ERROR_HANDLING = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$ECHO_ALL = 1;
|
||||
$DEBUG_ALL = 1;
|
||||
$PRINT_ALL = 1;
|
||||
$DB_DEBUG = 1;
|
||||
$ENABLE_ERROR_HANDLING = 1;
|
||||
}
|
||||
|
||||
// any other global definitons here
|
||||
// DEFINE('SOME_ID', <SOME VALUE>);
|
||||
|
||||
|
||||
// function that will be called on top of each class include to load the class
|
||||
function _spl_autoload($include_file)
|
||||
{
|
||||
// where to search for the files to include
|
||||
$dirs = array (
|
||||
LIBDIR,
|
||||
SMARTYDIR,
|
||||
TABLEARRAYDIR,
|
||||
'',
|
||||
LIBS,
|
||||
SMARTY,
|
||||
TABLE_ARRAYS,
|
||||
__DIR__.'/'.LIBS,
|
||||
__DIR__.'/'.SMARTY
|
||||
);
|
||||
// try to find and load the class ifle
|
||||
foreach ($dirs as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
{
|
||||
require_once($folder.$include_file);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<?
|
||||
/********************************************************************
|
||||
* $HeadURL: svn://svn/development/core_data/php/www/configs/config.template.inc $
|
||||
* $LastChangedBy: gullevek $
|
||||
* $LastChangedDate: 2013-02-18 16:27:24 +0900 (Mon, 18 Feb 2013) $
|
||||
* $LastChangedRevision: 4382 $
|
||||
*********************************************************************
|
||||
* AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org)
|
||||
* CREATED: 2003/06/10
|
||||
* SHORT DESCRIPTION:
|
||||
@@ -24,6 +19,17 @@
|
||||
DEFINE('DEFAULT_ENCODING', "UTF-8");
|
||||
|
||||
/************* PATHS *********************/
|
||||
// ** NEW/BETTER DIR DECLARATIONS **
|
||||
// path to original file (if symlink)
|
||||
DEFINE('DIR', __DIR__."/");
|
||||
// libs base path based on DIR
|
||||
DEFINE('LIBDIR', DIR.'libs/');
|
||||
// SMARTY path based on DIR
|
||||
DEFINE('SMARTYDIR', DIR.'Smarty/');
|
||||
// table arrays for Class Form
|
||||
DEFINE('TABLEARRAYDIR', DIR.'table_arrays/');
|
||||
|
||||
// ** OLD DIR DECLARATIONS **
|
||||
// path to document root
|
||||
DEFINE('ROOT', getcwd()."/");
|
||||
// libs path
|
||||
@@ -230,6 +236,31 @@
|
||||
|
||||
// any other global definitons here
|
||||
// DEFINE('SOME_ID', <SOME VALUE>);
|
||||
|
||||
// $Id: config.template.inc 4382 2013-02-18 07:27:24Z gullevek $
|
||||
|
||||
// function that will be called on top of each class include to load the class
|
||||
function _spl_autoload($include_file)
|
||||
{
|
||||
// where to search for the files to include
|
||||
$dirs = array (
|
||||
LIBDIR,
|
||||
SMARTYDIR,
|
||||
TABLEARRAYDIR,
|
||||
'',
|
||||
LIBS,
|
||||
SMARTY,
|
||||
TABLE_ARRAYS,
|
||||
__DIR__.'/'.LIBS,
|
||||
__DIR__.'/'.SMARTY
|
||||
);
|
||||
// try to find and load the class ifle
|
||||
foreach ($dirs as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
{
|
||||
require_once($folder.$include_file);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -21,5 +21,3 @@
|
||||
<input type="submit" name="new" value="{$new.new_name}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{* $Id: edit_new.tpl 4897 2014-02-06 08:16:56Z gullevek $ *}
|
||||
|
||||
@@ -26,12 +26,7 @@
|
||||
*********************************************************************/
|
||||
|
||||
// try to include file from LIBS path, or from normal path
|
||||
$include_file = 'Class.DB.IO.inc';
|
||||
foreach (array('', LIBS, __DIR__.'/') as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
require_once($folder.$include_file);
|
||||
}
|
||||
_spl_autoload('Class.DB.IO.inc');
|
||||
|
||||
class AdminBackend extends db_io
|
||||
{
|
||||
@@ -72,7 +67,7 @@
|
||||
public function __construct($db_config, $lang, $debug = 0, $db_debug = 0, $echo = 1, $print = 0)
|
||||
{
|
||||
// get the language sub class & init it
|
||||
require_once(LIBS."Class.l10n.inc");
|
||||
_spl_autoload('Class.l10n.inc');
|
||||
|
||||
$this->l = new l10n($lang);
|
||||
|
||||
@@ -144,8 +139,8 @@
|
||||
$q .= "ip, user_agent, referer, script_name, query_string, server_name, http_host, http_accept, http_accept_charset, http_accept_encoding, session_id, ";
|
||||
$q .= "action, action_id, action_yes, action_flag, action_menu, action_loaded, action_value, action_error) ";
|
||||
$q .= "VALUES ";
|
||||
$q .= "(".$_SESSION['EUID'].", NOW(), '".$this->db_escape_string($event)."', '".$data."', '".$data_binary."', '".$this->page_name."', ";
|
||||
$q .= "'".$_SERVER["REMOTE_ADDR"]."', '".$this->db_escape_string($_SERVER['HTTP_USER_AGENT'])."', '".$this->db_escape_string($_SERVER['HTTP_REFERER'])."', '".$this->db_escape_string($_SERVER['SCRIPT_FILENAME'])."', '".$this->db_escape_string($_SERVER['QUERY_STRING'])."', '".$this->db_escape_string($_SERVER['SERVER_NAME'])."', '".$this->db_escape_string($_SERVER['HTTP_HOST'])."', '".$this->db_escape_string($_SERVER['HTTP_ACCEPT'])."', '".$this->db_escape_string($_SERVER['HTTP_ACCEPT_CHARSET'])."', '".$this->db_escape_string($_SERVER['HTTP_ACCEPT_ENCODING'])."', '".session_id()."', ";
|
||||
$q .= "(".@$_SESSION['EUID'].", NOW(), '".$this->db_escape_string($event)."', '".$data."', '".$data_binary."', '".$this->page_name."', ";
|
||||
$q .= "'".@$_SERVER["REMOTE_ADDR"]."', '".$this->db_escape_string(@$_SERVER['HTTP_USER_AGENT'])."', '".$this->db_escape_string(@$_SERVER['HTTP_REFERER'])."', '".$this->db_escape_string(@$_SERVER['SCRIPT_FILENAME'])."', '".$this->db_escape_string(@$_SERVER['QUERY_STRING'])."', '".$this->db_escape_string(@$_SERVER['SERVER_NAME'])."', '".$this->db_escape_string(@$_SERVER['HTTP_HOST'])."', '".$this->db_escape_string(@$_SERVER['HTTP_ACCEPT'])."', '".$this->db_escape_string(@$_SERVER['HTTP_ACCEPT_CHARSET'])."', '".$this->db_escape_string(@$_SERVER['HTTP_ACCEPT_ENCODING'])."', '".session_id()."', ";
|
||||
$q .= "'".$this->db_escape_string($this->action)."', '".$this->db_escape_string($this->action_id)."', '".$this->db_escape_string($this->action_yes)."', '".$this->db_escape_string($this->action_flag)."', '".$this->db_escape_string($this->action_menu)."', '".$this->db_escape_string($this->action_loaded)."', '".$this->db_escape_string($this->action_value)."', '".$this->db_escape_string($this->action_error)."')";
|
||||
$this->db_exec($q, 'edit_log_id');
|
||||
}
|
||||
@@ -340,5 +335,71 @@
|
||||
$this->db_exec($q);
|
||||
}
|
||||
|
||||
// METHOD: adbPrintDateTime
|
||||
// PARAMS: year, month, day, hour, min: the date and time values
|
||||
// suffix: additional info printed after the date time variable in the drop down, also used for ID in the on change JS call
|
||||
// minute steps, can be 1 (default), 5, 10, etc, if invalid (outside 1h range, it falls back to 1min)
|
||||
// RETURN: HTML formated strings for drop down lists of date and time
|
||||
// DESC: print the date/time drop downs, used in any queue/send/insert at date/time place
|
||||
public function adbPrintDateTime($year, $month, $day, $hour, $min, $suffix = '', $min_steps = 1)
|
||||
{
|
||||
// if suffix given, add _ before
|
||||
if ($suffix)
|
||||
$suffix = '_'.$suffix;
|
||||
if ($min_steps < 1 || $min_steps > 59)
|
||||
$min_steps = 1;
|
||||
|
||||
$on_change_call = 'dt_list(\''.$suffix.'\');';
|
||||
|
||||
// always be 1h ahead (for safety)
|
||||
$timestamp = time() + 3600; // in seconds
|
||||
|
||||
// the max year is this year + 1;
|
||||
$max_year = date("Y", $timestamp) + 1;
|
||||
|
||||
// preset year, month, ...
|
||||
$year = (!$year) ? date("Y", $timestamp) : $year;
|
||||
$month = (!$month) ? date("m", $timestamp) : $month;
|
||||
$day = (!$day) ? date("d", $timestamp) : $day;
|
||||
$hour = (!$hour) ? date("H", $timestamp) : $hour;
|
||||
$min = (!$min) ? date("i", $timestamp) : $min; // add to five min?
|
||||
// max days in selected month
|
||||
$days_in_month = date("t", strtotime($year."-".$month."-".$day." ".$hour.":".$min.":0"));
|
||||
|
||||
// from now to ?
|
||||
$string = $this->l->__('Year').' ';
|
||||
$string .= '<select id="year'.$suffix.'" name="year'.$suffix.'" onChange="'.$on_change_call.'">';
|
||||
for ($i = date("Y"); $i <= $max_year; $i ++)
|
||||
{ $string .= '<option value="'.$i.'" '.(($year == $i) ? 'selected' : '').'>'.$i.'</option>';
|
||||
}
|
||||
$string .= '</select> '.$this->l->__('Month').' ';
|
||||
$string .= '<select id="month'.$suffix.'" name="month'.$suffix.'" onChange="'.$on_change_call.'">';
|
||||
for ($i = 1; $i <= 12; $i ++)
|
||||
{
|
||||
$string .= '<option value="'.(($i < 10) ? '0'.$i : $i).'" '.(($month == $i) ? 'selected' : '').'>'.$i.'</option>';
|
||||
}
|
||||
$string .= '</select> '.$this->l->__('Day').' ';
|
||||
$string .= '<select id="day'.$suffix.'" name="day'.$suffix.'" onChange="'.$on_change_call.'">';
|
||||
for ($i = 1; $i <= $days_in_month; $i ++)
|
||||
{
|
||||
// set weekday text based on current month ($month) and year ($year)
|
||||
$string .= '<option value="'.(($i < 10) ? '0'.$i : $i).'" '.(($day == $i) ? 'selected' : '').'>'.$i.' ('.$this->l->__(date('D', mktime(0, 0, 0, $month, $i, $year))).')</option>';
|
||||
}
|
||||
$string .= '</select> '.$this->l->__('Hour').' ';
|
||||
$string .= '<select id="hour'.$suffix.'" name="hour'.$suffix.'" onChange="'.$on_change_call.'">';
|
||||
for ($i = 0; $i <= 23; $i ++)
|
||||
{
|
||||
$string .= '<option value="'.(($i < 10) ? '0'.$i : $i).'" '.(($hour == $i) ? 'selected' : '').'>'.$i.'</option>';
|
||||
}
|
||||
$string .= '</select> '.$this->l->__('Minute').' ';
|
||||
$string .= '<select id="min'.$suffix.'" name="min'.$suffix.'" onChange="'.$on_change_call.'">';
|
||||
for ( $i = 0; $i <= 59; $i += $min_steps)
|
||||
{
|
||||
$string .= '<option value="'.(( $i < 10) ? '0'.$i : $i).'" '.(($min == $i) ? 'selected' : '').'>'.$i.'</option>';
|
||||
}
|
||||
$string .= '</select>';
|
||||
// return the datetime select string
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -247,23 +247,68 @@
|
||||
);
|
||||
// the array with the mobile types that are valid
|
||||
$this->mobile_email_type = array (
|
||||
'.*@docomo\.ne\.jp$' => 'docomo',
|
||||
'.*@([a-z0-9]{2}\.)?ezweb\.ne\.jp$' => 'kddi_ezweb', # correct are a[2-4], b2, c[1-9], e[2-9], h[2-4], t[1-9]
|
||||
'.*@(ez[a-j]{1}\.)?ido\.ne\.jp$' => 'kddi', # ez[a-j] or nothing
|
||||
'.*@([a-z]{2}\.)?sky\.tu-ka\.ne\.jp$' => 'kddi_tu-ka', # (sky group)
|
||||
'.*@([a-z]{2}\.)?sky\.tk[kc]{1}\.ne\.jp$' => 'kddi_sky', # (sky group) [tkk,tkc only]
|
||||
'.*@([a-z]{2}\.)?sky\.dtg\.ne\.jp$' => 'kddi', # dtg (sky group)
|
||||
'.*@[tkdhcrnsq]{1}\.vodafone\.ne\.jp$' => 'softbank', # old vodafone [t,k,d,h,c,r,n,s,q]
|
||||
'.*@jp-[dhtkrsnqc]{1}\.ne\.jp$' => 'softbank', # very old j-phone (pre vodafone) [d,h,t,k,r,s,n,q,c]
|
||||
'.*@([dhtcrknsq]{1}\.)?softbank\.ne\.jp$' => 'softbank', # add i for iphone also as keitai, others similar to the vodafone group
|
||||
'.*@i{1}\.softbank(\.ne)?\.jp$' => 'softbank_iphone', # add iPhone also as keitai and not as pc
|
||||
'.*@disney\.ne\.jp$' => 'softbank_disney', # (kids)
|
||||
'.*@willcom\.ne\.jp$' => 'willcom',
|
||||
'.*@willcom\.com$' => 'willcom', # new for pdx.ne.jp address
|
||||
'.*@pdx\.ne\.jp$' => 'willcom', # old pdx address for willcom
|
||||
'.*@bandai\.jp$' => 'willcom', # willcom paipo! (kids)
|
||||
'.*@pipopa\.ne\.jp$' => 'willcom', # willcom paipo! (kids)
|
||||
'.*@([a-z0-9]{2,4}\.)?pdx\.ne\.jp$' => 'willcom' # actually only di,dj,dk,wm -> all others are "wrong", but none also allowed?
|
||||
'.*@docomo\.ne\.jp$' => 'keitai_docomo',
|
||||
'.*@([a-z0-9]{2}\.)?ezweb\.ne\.jp$' => 'keitai_kddi_ezweb', # correct are a[2-4], b2, c[1-9], e[2-9], h[2-4], t[1-9]
|
||||
'.*@(ez[a-j]{1}\.)?ido\.ne\.jp$' => 'keitai_kddi_ido', # ez[a-j] or nothing
|
||||
'.*@([a-z]{2}\.)?sky\.tu-ka\.ne\.jp$' => 'keitai_kddi_tu-ka', # (sky group)
|
||||
'.*@([a-z]{2}\.)?sky\.tk[kc]{1}\.ne\.jp$' => 'keitai_kddi_sky', # (sky group) [tkk,tkc only]
|
||||
'.*@([a-z]{2}\.)?sky\.dtg\.ne\.jp$' => 'keitai_kddi_dtg', # dtg (sky group)
|
||||
'.*@[tkdhcrnsq]{1}\.vodafone\.ne\.jp$' => 'keitai_softbank_vodafone', # old vodafone [t,k,d,h,c,r,n,s,q]
|
||||
'.*@jp-[dhtkrsnqc]{1}\.ne\.jp$' => 'keitai_softbank_j-phone', # very old j-phone (pre vodafone) [d,h,t,k,r,s,n,q,c]
|
||||
'.*@([dhtcrknsq]{1}\.)?softbank\.ne\.jp$' => 'keitai_softbank', # add i for iphone also as keitai, others similar to the vodafone group
|
||||
'.*@i{1}\.softbank(\.ne)?\.jp$' => 'smartphone_softbank_iphone', # add iPhone also as keitai and not as pc
|
||||
'.*@disney\.ne\.jp$' => 'keitai_softbank_disney', # (kids)
|
||||
'.*@willcom\.ne\.jp$' => 'keitai_willcom',
|
||||
'.*@willcom\.com$' => 'keitai_willcom', # new for pdx.ne.jp address
|
||||
'.*@wcm\.ne\.jp$' => 'keitai_willcom', # old willcom wcm.ne.jp
|
||||
'.*@pdx\.ne\.jp$' => 'keitai_willcom_pdx', # old pdx address for willcom
|
||||
'.*@bandai\.jp$' => 'keitai_willcom_bandai', # willcom paipo! (kids)
|
||||
'.*@pipopa\.ne\.jp$' => 'keitai_willcom_pipopa', # willcom paipo! (kids)
|
||||
'.*@([a-z0-9]{2,4}\.)?pdx\.ne\.jp$' => 'keitai_willcom_pdx', # actually only di,dj,dk,wm -> all others are "wrong", but none also allowed?
|
||||
'.*@ymobile([1]{1})?\.ne\.jp$' => 'keitai_willcom_ymobile', # ymobile, ymobile1 techincally not willcom, but I group them there
|
||||
'.*@y-mobile\.ne\.jp$' => 'keitai_willcom_ymobile', # y-mobile techincally not willcom, but I group them there
|
||||
'.*@emnet\.ne\.jp$' => 'keitai_willcom_emnet', # e-mobile, group will willcom
|
||||
'.*@emobile\.ne\.jp$' => 'keitai_willcom_emnet', # e-mobile, group will willcom
|
||||
'.*@emobile-s\.ne\.jp$' => 'keitai_willcom_emnet' # e-mobile, group will willcom
|
||||
);
|
||||
// short list for mobile email types
|
||||
$this->mobile_email_type_short = array (
|
||||
'keitai_docomo' => 'docomo',
|
||||
'keitai_kddi_ezweb' => 'kddi',
|
||||
'keitai_kddi' => 'kddi',
|
||||
'keitai_kddi_tu-ka' => 'kddi',
|
||||
'keitai_kddi_sky' => 'kddi',
|
||||
'keitai_softbank' => 'softbank',
|
||||
'smartphone_softbank_iphone' => 'iphone',
|
||||
'keitai_softbank_disney' => 'softbank',
|
||||
'keitai_softbank_vodafone' => 'softbank',
|
||||
'keitai_softbank_j-phone' => 'softbank',
|
||||
'keitai_willcom' => 'willcom',
|
||||
'keitai_willcom_pdx' => 'willcom',
|
||||
'keitai_willcom_bandai' => 'willcom',
|
||||
'keitai_willcom_pipopa' => 'willcom',
|
||||
'keitai_willcom_ymobile' => 'willcom',
|
||||
'keitai_willcom_emnet' => 'willcom',
|
||||
'pc_html' => 'pc',
|
||||
// old sets -> to be removed later
|
||||
'docomo' => 'docomo',
|
||||
'kddi_ezweb' => 'kddi',
|
||||
'kddi' => 'kddi',
|
||||
'kddi_tu-ka' => 'kddi',
|
||||
'kddi_sky' => 'kddi',
|
||||
'softbank' => 'softbank',
|
||||
'keitai_softbank_iphone' => 'iphone',
|
||||
'softbank_iphone' => 'iphone',
|
||||
'softbank_disney' => 'softbank',
|
||||
'softbank_vodafone' => 'softbank',
|
||||
'softbank_j-phone' => 'softbank',
|
||||
'willcom' => 'willcom',
|
||||
'willcom_pdx' => 'willcom',
|
||||
'willcom_bandai' => 'willcom',
|
||||
'willcom_pipopa' => 'willcom',
|
||||
'willcom_ymobile' => 'willcom',
|
||||
'willcom_emnet' => 'willcom',
|
||||
'pc' => 'pc'
|
||||
);
|
||||
|
||||
// initial the session if there is no session running already
|
||||
@@ -1397,6 +1442,19 @@
|
||||
return $this->_crc32b($string);
|
||||
}
|
||||
|
||||
// METHOD: _hash
|
||||
// PARAMS: string, type of hash to use
|
||||
// RETURN: hashed string
|
||||
// DESC : replacemend for _crc32b call (alternate)
|
||||
// defaults to adler 32, fnv132, fnv1a32, joaat
|
||||
// all that create 8 char long hashes
|
||||
public function _hash($string, $hash_type = 'adler32')
|
||||
{
|
||||
if (!in_array($hash_type, array('adler32', 'fnv132', 'fnv1a32', 'joaat')))
|
||||
$hash_type = 'adler32';
|
||||
return hash($hash_type, $string);
|
||||
}
|
||||
|
||||
// METHOD: checkPHPVersion
|
||||
// PARAMS: $min_version: minimum version. in format x, x.y or x.y.z
|
||||
// $max_version: default empty, else in same format as min version
|
||||
@@ -1792,10 +1850,11 @@
|
||||
}
|
||||
|
||||
// METHOD: getEmailType
|
||||
// PARAMS: email
|
||||
// PARAMS: email, short == false
|
||||
// RETURN: string for email type, eg "pc", "docomo", etc
|
||||
// DESC: guesses the email type (mostly for mobile) from the domain
|
||||
public function getEmailType($email)
|
||||
// if second is set to true, it will return short naming scheme (only provider)
|
||||
public function getEmailType($email, $short = false)
|
||||
{
|
||||
// trip if there is no email address
|
||||
if (!$email)
|
||||
@@ -1804,10 +1863,27 @@
|
||||
foreach ($this->mobile_email_type as $email_regex => $email_type)
|
||||
{
|
||||
if (preg_match("/$email_regex/", $email))
|
||||
return $email_type;
|
||||
{
|
||||
if ($short)
|
||||
return $this->getShortEmailType($email_type);
|
||||
else
|
||||
return $email_type;
|
||||
}
|
||||
}
|
||||
// if no previous return we assume this is a pc address
|
||||
return "pc";
|
||||
if ($short)
|
||||
return "pc";
|
||||
else
|
||||
return "pc_html";
|
||||
}
|
||||
|
||||
// METHOD: getShortEmailType
|
||||
// PARAMS: long email type (not email)
|
||||
// RETURN: short email type
|
||||
// DESC : gets the short email type from a long email type
|
||||
public function getShortEmailType($email_type)
|
||||
{
|
||||
return $this->mobile_email_type_short[$email_type];
|
||||
}
|
||||
|
||||
// METHOD: printDateTime
|
||||
|
||||
@@ -39,12 +39,7 @@
|
||||
// put into separete function in this class)
|
||||
|
||||
// try to include file from LIBS path, or from normal path
|
||||
$include_file = 'Class.DB.IO.inc';
|
||||
foreach (array('', LIBS, __DIR__.'/') as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
require_once($folder.$include_file);
|
||||
}
|
||||
_spl_autoload('Class.DB.IO.inc');
|
||||
|
||||
// subclass for one array handling
|
||||
class db_array_io extends db_io
|
||||
@@ -434,6 +429,13 @@ $this->debug('write_check', "[$column][".$this->table_array[$column]["value"]."]
|
||||
$_value = $this->table_array[$column]["value"];
|
||||
$q_data .= $_value;
|
||||
}
|
||||
elseif ($this->table_array[$column]["interval"])
|
||||
{
|
||||
// for interval we check if no value, then we set null
|
||||
if (!$this->table_array[$column]["value"])
|
||||
$_value = 'NULL';
|
||||
$q_data .= $_value;
|
||||
}
|
||||
else
|
||||
// normal string
|
||||
{
|
||||
@@ -505,7 +507,10 @@ $this->debug('write_check', "[$column][".$this->table_array[$column]["value"]."]
|
||||
}
|
||||
// set primary key
|
||||
if ($insert)
|
||||
$this->ok = $this->table_array[$this->pk_name]["value"] = $this->insert_id;
|
||||
{
|
||||
$this->table_array[$this->pk_name]["value"] = $this->insert_id;
|
||||
$this->ok = $this->insert_id;
|
||||
}
|
||||
// return the table if needed
|
||||
return $this->table_array;
|
||||
}
|
||||
|
||||
@@ -241,12 +241,7 @@
|
||||
*********************************************************************/
|
||||
|
||||
// try to include file from LIBS path, or from normal path
|
||||
$include_file = 'Class.Basic.inc';
|
||||
foreach (array('', LIBS, __DIR__.'/') as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
require_once($folder.$include_file);
|
||||
}
|
||||
_spl_autoload('Class.Basic.inc');
|
||||
|
||||
class db_io extends basic
|
||||
{
|
||||
@@ -258,7 +253,7 @@
|
||||
// only inside
|
||||
// basic vars
|
||||
private $dbh; // the dbh handler
|
||||
private $db_debug; // DB_DEBUG ... (if set prints out debug msgs)
|
||||
public $db_debug; // DB_DEBUG ... (if set prints out debug msgs)
|
||||
private $db_name; // the DB connected to
|
||||
private $db_user; // the username used
|
||||
private $db_pwd; // the password used
|
||||
@@ -358,7 +353,7 @@
|
||||
$this->db_debug = $GLOBALS['DB_DEBUG'];
|
||||
|
||||
// includes sub class for db type
|
||||
include_once(LIBS.$this->db_type.'.inc');
|
||||
_spl_autoload($this->db_type.'.inc');
|
||||
$this->db_functions = new $this->db_type();
|
||||
|
||||
// connect to DB
|
||||
@@ -528,7 +523,8 @@
|
||||
// msg -> optional message
|
||||
// RETURN none
|
||||
// DESC if error_id set, writes long error string into error_msg
|
||||
private function _db_error($cursor = '', $msg = '')
|
||||
// MARK: needed to make public so it can be called from DB.Array.IO too
|
||||
public function _db_error($cursor = '', $msg = '')
|
||||
{
|
||||
$where_called = $this->get_caller_method();
|
||||
if ($cursor)
|
||||
|
||||
@@ -213,12 +213,7 @@
|
||||
*********************************************************************/
|
||||
|
||||
// try to include file from LIBS path, or from normal path
|
||||
$include_file = 'Class.DB.Array.IO.inc';
|
||||
foreach (array('', LIBS, __DIR__.'/') as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
require_once($folder.$include_file);
|
||||
}
|
||||
_spl_autoload('Class.DB.Array.IO.inc');
|
||||
|
||||
class form extends db_array_io
|
||||
{
|
||||
@@ -260,10 +255,12 @@
|
||||
{
|
||||
$this->my_page_name = $this->get_page_name(1);
|
||||
// init the language class
|
||||
require_once(LIBS."Class.l10n.inc");
|
||||
_spl_autoload('Class.l10n.inc');
|
||||
$this->l = new l10n($lang);
|
||||
// load config array
|
||||
// get table array definitions for current page name
|
||||
// WARNING: auto spl load does not work with this as it is an array and not a function/object
|
||||
// $flag = _spl_autoload('array_'.$this->my_page_name.'.inc');
|
||||
include(TABLE_ARRAYS."array_".$this->my_page_name.".inc");
|
||||
|
||||
$config_array = ${$this->my_page_name};
|
||||
@@ -326,6 +323,8 @@
|
||||
// dumps all values into output (for error msg)
|
||||
public function form_dump_table_array()
|
||||
{
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
$string .= "<b>TABLE ARRAY DUMP:</b> ".$this->table_name."<br>";
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
@@ -388,6 +387,8 @@
|
||||
// if multiple gets only FIRST
|
||||
public function form_get_col_name_from_key($want_key, $key_value = "")
|
||||
{
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
{
|
||||
@@ -405,6 +406,8 @@
|
||||
public function form_get_col_name_array_from_key($want_key, $key_value = "")
|
||||
{
|
||||
$key_array = array();
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
{
|
||||
@@ -685,7 +688,7 @@
|
||||
// for drop down, as data comes from a reference table
|
||||
// for drop_down_text it has to be an array with $key->$value
|
||||
// RETURN element in HTML
|
||||
public function form_create_element ($element_name, $query = "")
|
||||
public function form_create_element($element_name, $query = "")
|
||||
{
|
||||
// special 2nd color for "binary" attribut
|
||||
if ($this->table_array[$element_name]["type"] == "binary" && !$this->table_array[$element_name]["value"])
|
||||
@@ -872,6 +875,8 @@
|
||||
// $error=1;
|
||||
public function form_error_check()
|
||||
{
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
{
|
||||
@@ -922,13 +927,13 @@
|
||||
break;
|
||||
case "alphanumeric":
|
||||
//$this->debug('edit', 'IN Alphanumeric');
|
||||
if (!preg_match("/^[0-9A-Za-z_-]+$/", $this->table_array[$key]["value"]))
|
||||
if (!preg_match("/^[0-9A-Za-z_\-]+$/", $this->table_array[$key]["value"]))
|
||||
$this->msg .= sprintf($this->l->__("Please enter a valid alphanumeric (Numbers and Letters only also - and _, no spaces) value for the <b>%s</b> Field!<br>"), $this->table_array[$key]["output_name"]);
|
||||
break;
|
||||
// this one also allows @ and .
|
||||
case "alphanumericextended":
|
||||
//$this->debug('edit', 'IN Alphanumeric');
|
||||
if (!preg_match("/^[0-9A-Za-z_-@\.]+$/", $this->table_array[$key]["value"]))
|
||||
if (!preg_match("/^[0-9A-Za-z_\-@\.]+$/", $this->table_array[$key]["value"]))
|
||||
$this->msg .= sprintf($this->l->__("Please enter a valid alphanumeric extended (Numbers, Letters, -, _, @ and . only, no spaces) value for the <b>%s</b> Field!<br>"), $this->table_array[$key]["output_name"]);
|
||||
break;
|
||||
case "password":
|
||||
@@ -977,6 +982,8 @@
|
||||
if (is_array($this->reference_array))
|
||||
{
|
||||
// do check for reference tables
|
||||
if (!is_array($this->reference_array))
|
||||
$this->reference_array = array ();
|
||||
reset($this->reference_array);
|
||||
while (list($key, $value) = each($this->reference_array))
|
||||
{
|
||||
@@ -1111,6 +1118,8 @@
|
||||
public function form_unset_table_array()
|
||||
{
|
||||
unset($this->pk_id);
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
{
|
||||
@@ -1122,6 +1131,8 @@
|
||||
}
|
||||
if (is_array($this->reference_array))
|
||||
{
|
||||
if (!is_array($this->reference_array))
|
||||
$this->reference_array = array ();
|
||||
reset($this->reference_array);
|
||||
while (list($key, $value) = each($this->reference_array))
|
||||
{
|
||||
@@ -1143,6 +1154,8 @@
|
||||
$this->table_array = $this->db_read(1);
|
||||
|
||||
// reset all temp fields
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
unset($this->table_array[$key]["input_value"]);
|
||||
@@ -1150,6 +1163,8 @@
|
||||
if (is_array($this->reference_array))
|
||||
{
|
||||
// load each reference_table
|
||||
if (!is_array($this->reference_array))
|
||||
$this->reference_array = array ();
|
||||
reset($this->reference_array);
|
||||
while (list($key, $value) = each($this->reference_array))
|
||||
{
|
||||
@@ -1172,6 +1187,8 @@
|
||||
// global $_FILES;
|
||||
// for drop_down_db_input check if text field is filled and if, if not yet in db ...
|
||||
// and upload files
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
{
|
||||
@@ -1194,7 +1211,7 @@
|
||||
{
|
||||
// if a where was given, set this key also [dangerous!]
|
||||
|
||||
// posgres compatible insert
|
||||
// postgreSQL compatible insert
|
||||
$q = "INSERT INTO ".$this->table_array[$key]["table_name"]." (".$this->table_array[$key]["input_name"].") VALUES ('".addslashes($this->table_array[$key]["input_value"])."')";
|
||||
$this->db_exec($q);
|
||||
if ($this->table_array[$key]["where"])
|
||||
@@ -1297,6 +1314,8 @@
|
||||
// write reference array(s) if necessary
|
||||
if (is_array($this->reference_array))
|
||||
{
|
||||
if (!is_array($this->reference_array))
|
||||
$this->reference_array = array ();
|
||||
reset($this->reference_array);
|
||||
foreach ($this->reference_array AS $reference_array)
|
||||
{
|
||||
@@ -1313,8 +1332,9 @@
|
||||
// write element list
|
||||
if (is_array($this->element_list))
|
||||
{
|
||||
if (!is_array($this->element_list))
|
||||
$this->element_list = array ();
|
||||
reset($this->element_list);
|
||||
|
||||
while (list($table_name, $reference_array) = each($this->element_list))
|
||||
{
|
||||
// get the number of keys from the elements array
|
||||
@@ -1436,6 +1456,8 @@ $this->debug('edit_error', "I: $i | EL Name: $prfx$el_name | Data: ".$_POST[$prf
|
||||
// remove any reference arrays
|
||||
if (is_array($this->reference_array))
|
||||
{
|
||||
if (!is_array($this->reference_array))
|
||||
$this->reference_array = array ();
|
||||
reset($this->reference_array);
|
||||
foreach ($this->reference_array AS $reference_array)
|
||||
{
|
||||
@@ -1446,6 +1468,8 @@ $this->debug('edit_error', "I: $i | EL Name: $prfx$el_name | Data: ".$_POST[$prf
|
||||
// remove any element list references
|
||||
if (is_array($this->element_list))
|
||||
{
|
||||
if (!is_array($this->element_list))
|
||||
$this->element_list = array ();
|
||||
reset($this->element_list);
|
||||
while (list($table_name, $data_array) = each($this->element_list))
|
||||
{
|
||||
@@ -1454,6 +1478,8 @@ $this->debug('edit_error', "I: $i | EL Name: $prfx$el_name | Data: ".$_POST[$prf
|
||||
}
|
||||
}
|
||||
// unlink ALL files
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
{
|
||||
@@ -1471,7 +1497,10 @@ $this->debug('edit_error', "I: $i | EL Name: $prfx$el_name | Data: ".$_POST[$prf
|
||||
// creates HTML hidden input fields out of an hash array
|
||||
public function form_create_hidden_fields($hidden_array = "")
|
||||
{
|
||||
reset ($this->table_array);
|
||||
$hidden = array ();
|
||||
if (!is_array($this->table_array))
|
||||
$this->table_array = array ();
|
||||
reset($this->table_array);
|
||||
while (list($key, $value) = each($this->table_array))
|
||||
{
|
||||
if ($this->table_array[$key]["type"] == "hidden")
|
||||
@@ -1479,9 +1508,9 @@ $this->debug('edit_error', "I: $i | EL Name: $prfx$el_name | Data: ".$_POST[$prf
|
||||
$hidden_array[$key] = $this->table_array[$key]["value"];
|
||||
}
|
||||
}
|
||||
if ($hidden_array)
|
||||
if (is_array($hidden_array))
|
||||
{
|
||||
reset ($hidden_array);
|
||||
reset($hidden_array);
|
||||
while (list($key, $value) = each($hidden_array))
|
||||
{
|
||||
$hidden[] = array('key' => $key, 'value' => $value);
|
||||
@@ -1535,6 +1564,8 @@ $this->debug('edit_error', "I: $i | EL Name: $prfx$el_name | Data: ".$_POST[$prf
|
||||
$data['table_name'] = $table_name;
|
||||
$pos = 0; // position in while for overwrite if needed
|
||||
// build the select part
|
||||
if (!is_array($this->element_list[$table_name]["elements"]))
|
||||
$this->element_list[$table_name]["elements"] = array ();
|
||||
reset($this->element_list[$table_name]["elements"]);
|
||||
// generic data read in (counts for all rows)
|
||||
while (list($el_name, $data_array) = each($this->element_list[$table_name]["elements"]))
|
||||
|
||||
@@ -60,12 +60,7 @@
|
||||
*********************************************************************/
|
||||
|
||||
// try to include file from LIBS path, or from normal path
|
||||
$include_file = 'Class.DB.IO.inc';
|
||||
foreach (array('', LIBS, __DIR__.'/') as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
require_once($folder.$include_file);
|
||||
}
|
||||
_spl_autoload('Class.DB.IO.inc');
|
||||
|
||||
class login extends db_io
|
||||
{
|
||||
@@ -118,7 +113,7 @@
|
||||
$this->file_name_ext = '_login_'.date('Y-m-d').'.log';
|
||||
|
||||
// get the language sub class & init it
|
||||
require_once(LIBS."Class.l10n.inc");
|
||||
_spl_autoload('Class.l10n.inc');
|
||||
$this->l = new l10n($lang);
|
||||
|
||||
// if we have a search path we need to set it, to use the correct DB to login
|
||||
|
||||
@@ -11,12 +11,7 @@
|
||||
// read in the Smarty class for definition
|
||||
// use smarty BC for backwards compability
|
||||
// try to include file from LIBS path, or from normal path
|
||||
$include_file = 'SmartyBC.class.php';
|
||||
foreach (array('', SMARTY, __DIR__.'/../'.SMARTY) as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
require_once($folder.$include_file);
|
||||
}
|
||||
_spl_autoload('SmartyBC.class.php');
|
||||
|
||||
class SmartyML extends SmartyBC
|
||||
{
|
||||
@@ -26,7 +21,7 @@
|
||||
public function __construct($lang)
|
||||
{
|
||||
SmartyBC::__construct();
|
||||
require_once(LIBS."Class.l10n.inc");
|
||||
_spl_autoload('Class.l10.inc');
|
||||
$this->l10n = new l10n($lang);
|
||||
// variable variable register
|
||||
$this->register_modifier('getvar', array(&$this, 'get_template_vars'));
|
||||
|
||||
@@ -26,12 +26,7 @@
|
||||
*********************************************************************/
|
||||
|
||||
// try to include file from LIBS path, or from normal path
|
||||
$include_file = 'Class.Basic.inc';
|
||||
foreach (array('', LIBS, __DIR__.'/') as $folder)
|
||||
{
|
||||
if (file_exists($folder.$include_file))
|
||||
require_once($folder.$include_file);
|
||||
}
|
||||
_spl_autoload('Class.Basic.inc');
|
||||
|
||||
class l10n extends basic
|
||||
{
|
||||
@@ -42,8 +37,8 @@
|
||||
|
||||
public function __construct($lang = '', $path = '')
|
||||
{
|
||||
require_once(LIBS.'streams.php');
|
||||
require_once(LIBS.'gettext.php');
|
||||
foreach (array('streas.php', 'gettext.php') as $include_file)
|
||||
_spl_autoload($include_file);
|
||||
|
||||
if (!$lang)
|
||||
$this->lang = 'en';
|
||||
@@ -109,6 +104,4 @@
|
||||
return $this->l10n->ngettext($single, $plural, $number);
|
||||
}
|
||||
}
|
||||
|
||||
//require(LIBS.'locale.php');
|
||||
?>
|
||||
|
||||
@@ -98,7 +98,7 @@ class gettext_reader {
|
||||
* @param object Reader the StreamReader object
|
||||
* @param boolean enable_cache Enable or disable caching of strings (default on)
|
||||
*/
|
||||
function gettext_reader($Reader, $enable_cache = true) {
|
||||
function __construct($Reader, $enable_cache = true) {
|
||||
// If there isn't a StreamReader, turn on short circuit mode.
|
||||
if (! $Reader || isset($Reader->error) ) {
|
||||
$this->short_circuit = true;
|
||||
|
||||
@@ -49,7 +49,7 @@ class StringReader {
|
||||
var $_pos;
|
||||
var $_str;
|
||||
|
||||
function StringReader($str='') {
|
||||
function __construct($str='') {
|
||||
$this->_str = $str;
|
||||
$this->_pos = 0;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class FileReader {
|
||||
var $_fd;
|
||||
var $_length;
|
||||
|
||||
function FileReader($filename) {
|
||||
function __construct($filename) {
|
||||
if (file_exists($filename)) {
|
||||
|
||||
$this->_length=filesize($filename);
|
||||
@@ -143,7 +143,7 @@ class FileReader {
|
||||
// Preloads entire file in memory first, then creates a StringReader
|
||||
// over it (it assumes knowledge of StringReader internals)
|
||||
class CachedFileReader extends StringReader {
|
||||
function CachedFileReader($filename) {
|
||||
function __construct($filename) {
|
||||
if (file_exists($filename)) {
|
||||
|
||||
$length=filesize($filename);
|
||||
|
||||
@@ -183,7 +183,7 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c
|
||||
$idx ++;
|
||||
} else {
|
||||
$_idx = 0;
|
||||
$_html_result = smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? ($id . '-' . $idx) : null, $class, $_idx);
|
||||
$_html_result = smarty_function_html_options_optgroup($key, $value, $selected, !empty($id) ? ($id . '-' . $idx) : null, $class, $label, $_idx);
|
||||
$idx ++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user