Commit 1d210739 by Frederick d. Maus

local - not interesting

1 parent bc356bfb
...@@ -83,8 +83,8 @@ class D { ...@@ -83,8 +83,8 @@ class D {
if(trim($param_string)) { if(trim($param_string)) {
if($param_htmlentities) // if($param_htmlentities)
$param_string=htmlentities($param_string); // $param_string=htmlentities($param_string);
self::$echo_lines[self::$echo_count] = array( self::$echo_lines[self::$echo_count] = array(
'line' => $param_string, 'line' => $param_string,
'print' => $param_print, 'print' => $param_print,
......
...@@ -94,3 +94,11 @@ class mcErrorEvent extends mcEvent { ...@@ -94,3 +94,11 @@ class mcErrorEvent extends mcEvent {
mcErrorEvent::$count++; mcErrorEvent::$count++;
} }
} }
class mcXSLErrorEvent extends mcEvent {
public static $count =0;
public static function handle($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext) {
self::add(new mcXSLErrorEvent($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext));
mcXSLErrorEvent::$count++;
}
}
\ No newline at end of file
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
*/ */
function mcErrorHandler($param_typ, $param_notice, $param_file, $param_row, $param_More) { function mcErrorHandler($param_typ, $param_notice, $param_file, $param_row, $param_More) {
if(strpos($param_notice, 'XSLTProcessor') !== false) {
mcXSLErrorEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
} else {
switch ($param_typ) { switch ($param_typ) {
case E_ERROR: // 1 case E_ERROR: // 1
mcErrorEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More); mcErrorEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
...@@ -67,6 +72,10 @@ function mcErrorHandler($param_typ, $param_notice, $param_file, $param_row, $par ...@@ -67,6 +72,10 @@ function mcErrorHandler($param_typ, $param_notice, $param_file, $param_row, $par
D::ulli('Datei: '.$param_file); D::ulli('Datei: '.$param_file);
D::ulli('Zeile: '.$param_row); D::ulli('Zeile: '.$param_row);
} }
}
// return FALSE; // return FALSE;
......
...@@ -88,7 +88,8 @@ class mcArray { ...@@ -88,7 +88,8 @@ class mcArray {
*/ */
public static function checkKeyHasFullArray($param_Array, $param_key, $param_key2=null, $param_key3=null, $param_key4=null, $param_key5=null, $param_key6=null) { public static function checkKeyHasFullArray($param_Array, $param_key, $param_key2=null, $param_key3=null, $param_key4=null, $param_key5=null, $param_key6=null) {
if(is_array($param_Array)) { if(is_array($param_Array)) {
if(array_key_exists($param_key, $param_Array) if( (is_string($param_key) || is_integer($param_key))
&& array_key_exists($param_key, $param_Array)
&& is_array($param_Array[$param_key]) && is_array($param_Array[$param_key])
&& !empty($param_Array[$param_key]) && !empty($param_Array[$param_key])
) { ) {
......
...@@ -7,8 +7,14 @@ if(!isset($_LOSP_DEV)) { ...@@ -7,8 +7,14 @@ if(!isset($_LOSP_DEV)) {
* @var boolean -- activate the dev modus * @var boolean -- activate the dev modus
*/ */
$_LOSP_DEV = true; $_LOSP_DEV = true;
}
}
if($_LOSP_DEV) {
$__THIS_SCRIPT_INFO = pathinfo($_SERVER['SCRIPT_FILENAME']);
// echo $__THIS_SCRIPT_INFO['filename'];
}
/** /**
* @todo @since 20110325 die vars müssen eigentlich hier aus __mc raus ... da sie freeSN abhängig sind @author f@mensch.coop * @todo @since 20110325 die vars müssen eigentlich hier aus __mc raus ... da sie freeSN abhängig sind @author f@mensch.coop
*/ */
...@@ -24,7 +30,7 @@ if(!isset($__mc_D_LOGFILE)) { ...@@ -24,7 +30,7 @@ if(!isset($__mc_D_LOGFILE)) {
/** /**
* @var string -- file for the D Output * @var string -- file for the D Output
*/ */
$__mc_D_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_D.log'; $__mc_D_LOGFILE = $__BASEPATH_EX.'log/mc.'.$__THIS_SCRIPT_INFO['filename'].'.'.$string.'.DEV_D.log';
if(!isset($__mc_D_LOGFILE_RESET)) { if(!isset($__mc_D_LOGFILE_RESET)) {
/** /**
...@@ -48,7 +54,7 @@ if(!isset($__mc_INPUT_LOGFILE)) { ...@@ -48,7 +54,7 @@ if(!isset($__mc_INPUT_LOGFILE)) {
/** /**
* @var string -- file for the D Output * @var string -- file for the D Output
*/ */
$__mc_INPUT_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_INPUT.log'; $__mc_INPUT_LOGFILE = $__BASEPATH_EX.'log/mc.'.$__THIS_SCRIPT_INFO['filename'].'.'.$string.'.DEV_INPUT.log';
if(!isset($__mc_INPUT_LOGFILE_RESET)) { if(!isset($__mc_INPUT_LOGFILE_RESET)) {
/** /**
...@@ -64,7 +70,7 @@ if(!isset($__mc_PDO_LOGFILE)) { ...@@ -64,7 +70,7 @@ if(!isset($__mc_PDO_LOGFILE)) {
/** /**
* @var string -- file for the D Output * @var string -- file for the D Output
*/ */
$__mc_PDO_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_PDO.sql'; $__mc_PDO_LOGFILE = $__BASEPATH_EX.'log/mc.'.$__THIS_SCRIPT_INFO['filename'].'.'.$string.'.DEV_PDO.sql';
if(!isset($__mc_PDO_LOGFILE_RESET)) { if(!isset($__mc_PDO_LOGFILE_RESET)) {
/** /**
...@@ -110,12 +116,24 @@ if(!isset($__mc_Report)) { ...@@ -110,12 +116,24 @@ if(!isset($__mc_Report)) {
$__mc_Report = array( $__mc_Report = array(
'mcNoticeEvent' => array( 'mcNoticeEvent' => array(
'toScreen' => array(), 'toScreen' => array(),
'toFile' => array('file' => 'log/NoticeEvent.log') 'toFile' => array('file' => 'log/NoticeEvent.'.$__THIS_SCRIPT_INFO['filename'].'.log')
), ),
'mcErrorEvent' => array( 'mcErrorEvent' => array(
'toScreen' => array(), 'toScreen' => array(),
'toFile' => array( 'toFile' => array(
'file' => 'log/ErrorEvent.log', 'file' => 'log/ErrorEvent.'.$__THIS_SCRIPT_INFO['filename'].'.log',
'writemode' => 'a',
'reset' => false,
),
// 'toMail' => array(
// 'mail' => 'mail@localhost.tld',
// 'subject' => 'Error:'
// )
),
'mcXSLErrorEvent' => array(
'toScreen' => array(),
'toFile' => array(
'file' => 'log/XSLErrorEvent.'.$__THIS_SCRIPT_INFO['filename'].'.log',
'writemode' => 'a', 'writemode' => 'a',
'reset' => false, 'reset' => false,
), ),
...@@ -127,7 +145,7 @@ if(!isset($__mc_Report)) { ...@@ -127,7 +145,7 @@ if(!isset($__mc_Report)) {
'mcException' => array( 'mcException' => array(
'toScreen' => array(), 'toScreen' => array(),
'toFile' => array( 'toFile' => array(
'file' => 'log/Exception.log', 'file' => 'log/Exception.'.$__THIS_SCRIPT_INFO['filename'].'.log',
'writemode' => 'a', 'writemode' => 'a',
'reset' => false, 'reset' => false,
), ),
...@@ -139,7 +157,7 @@ if(!isset($__mc_Report)) { ...@@ -139,7 +157,7 @@ if(!isset($__mc_Report)) {
'Error' => array( 'Error' => array(
'toScreen' => array('text' => 'ERROR Error ERROR Error ERROR'), 'toScreen' => array('text' => 'ERROR Error ERROR Error ERROR'),
'toFile' => array( 'toFile' => array(
'file' => 'log/Error.config.log', 'file' => 'log/Error.'.$__THIS_SCRIPT_INFO['filename'].'.config.log',
'writemode' => 'a', 'writemode' => 'a',
'reset' => false, 'reset' => false,
), ),
......
...@@ -80,7 +80,9 @@ if($_LOSP_DEV) { ...@@ -80,7 +80,9 @@ if($_LOSP_DEV) {
foreach($Report as $kindofDistribute => $params) { foreach($Report as $kindofDistribute => $params) {
if($kindofDistribute == 'toFile') { if($kindofDistribute == 'toFile') {
if(array_key_exists('reset', $params) && $params['reset']) { if(array_key_exists('reset', $params) && $params['reset']) {
unlink ( $params['file'] ); if(is_file($params['file'])) {
unlink($params['file']);
}
mcFile::write($params['file'], $var_message, 'w'); mcFile::write($params['file'], $var_message, 'w');
} }
} }
......
...@@ -40,26 +40,27 @@ class Converter{ ...@@ -40,26 +40,27 @@ class Converter{
* @return string * @return string
*/ */
public static function encodeString($param_string, $param_encode = true){ public static function encodeString($param_string, $param_encode = true){
if(is_string($param_string)) {
// $param_string = strip_tags($param_string); // $param_string = strip_tags($param_string);
// $param_string = htmlentities($param_string, 1,"UTF-8"); // $param_string = htmlentities($param_string, 1,"UTF-8");
// $param_string = trim($param_string); // $param_string = trim($param_string);
$param_string = stripslashes($param_string); $param_string = stripslashes($param_string);
// D::show($param_string,"encode",1); if($param_encode){
$param_string = htmlspecialchars($param_string, 2,"UTF-8");
}
} else {
D::li('$param_string has to be string and is '. gettype($param_string));
}
// if(!is_numeric($param_string)){ // if(!is_numeric($param_string)){
// $param_string = "'" . mysql_real_escape_string($param_string) . "'"; // $param_string = "'" . mysql_real_escape_string($param_string) . "'";
// } // }
if($param_encode){
return htmlspecialchars($param_string, 2,"UTF-8");
}
else{
return $param_string; return $param_string;
} }
}
public static function StringToUrl($param_Url) { public static function StringToUrl($param_Url) {
return htmlentities($param_Url); return htmlentities($param_Url);
......
...@@ -3,22 +3,37 @@ interface imcPUIX { ...@@ -3,22 +3,37 @@ interface imcPUIX {
public function getDOMElement_edit(Account &$param_HostAccount, iStorable &$param_iStorable, DOMDocument $param_DOMDocument, DOMElement &$param_DOMElement, $param_KindOf=null, array $param_DOMElemente=null); public function getDOMElement_edit(Account &$param_HostAccount, iStorable &$param_iStorable, DOMDocument $param_DOMDocument, DOMElement &$param_DOMElement, $param_KindOf=null, array $param_DOMElemente=null);
public function getDOMElement_show(Account &$param_HostAccount, iStorable &$param_iStorable, DOMDocument $param_DOMDocument, DOMElement &$param_DOMElement, $param_KindOf=null, array $param_DOMElemente=null); public function getDOMElement_show(Account &$param_HostAccount, iStorable &$param_iStorable, DOMDocument $param_DOMDocument, DOMElement &$param_DOMElement, $param_KindOf=null, array $param_DOMElemente=null);
public function manipulatePost_Data(Account &$param_HostAccount, iStorable &$param_iStorable, array &$param_Data); public function manipulatePost_Data(Account &$param_HostAccount, iStorable &$param_iStorable, array &$param_Data);
public function getDOMElement_editSpecial(Account &$param_HostAccount, iStorable &$param_iStorable, DOMDocument $param_DOMDocument, DOMElement &$param_DOMElement, $param_KindOf=null, array $param_DOMElemente=null);
public function setRootTable(); public function setRootTable();
} }
abstract class mcPUIX extends mcClass implements imcPUIX { abstract class mcPUIX extends mcClass implements imcPUIX {
const DBUIConfig = 'DBUIConfig'; const DBUIConfig = 'DBUIConfig';
const PUIX_SUB_REFERENCELIST = 'PUIX_SUB_REFERENCELIST'; // mcPUIX::PUIX_SUB_REFERENCELIST const PUIX_SUB_REFERENCELIST = 'PUIX_SUB_REFERENCELIST';
const PDOValues = 'PDOValues'; const PDOValues = 'PDOValues';
const PDOToSaveValues = 'PDOToSaveValues'; const PDOToSaveValues = 'PDOToSaveValues';
const PDO_OR = 'OR';
const PDO_AND = 'AND';
const PDO_XOR = 'XOR';
const PDO_NEW = 'PDO_NEW';
const PDO_NEWID = 'PDO_NEWID';
const PDO_Operator = 'PDO_Operator';
const PDO_Special = 'PDO_Special';
const PDO_Operand = 'PDO_Operand';
const PDO_bindValueArray = 'PDO_bindValueArray';
const PDOLoadDepth = 'PDOLoadDepth'; const PDOLoadDepth = 'PDOLoadDepth';
const PDOLoadDepth_OnlyNew = 'PDOLoadDepth_OnlyNew';
const ERRORMESSAGE ='ERRORMESSAGE';
const DOMmcPUIX = 'mcPUIX'; const DOMmcPUIX = 'mcPUIX';
const DOMmcPUIX_edit = 'DOMmcPUIX_edit'; const DOMmcPUIX_edit = 'DOMmcPUIX_edit';
const DOMmcPUIX_edit_special = 'DOMmcPUIX_edit_special';
const DOMmcPUIX_show = 'DOMmcPUIX_show'; const DOMmcPUIX_show = 'DOMmcPUIX_show';
const DOMRow = 'DBUIRow'; const DOMRow = 'DBUIRow';
const DOMList = 'DBUIList'; const DOMList = 'DBUIList';
...@@ -87,40 +102,38 @@ abstract class mcPUIX extends mcClass implements imcPUIX { ...@@ -87,40 +102,38 @@ abstract class mcPUIX extends mcClass implements imcPUIX {
return $this->DBTab[$param_tablename]; return $this->DBTab[$param_tablename];
} }
public function loadPDOTable(Account &$param_HostAccount, iStorable &$param_iStorable, $param_SQLWhere='', $param_depth=null) { public function loadPDOTable(Account &$param_HostAccount, iStorable &$param_iStorable, $param_SQLWhere='', $param_depth=null) {
$param_tablename = $this->RootTable; $DBTable = mcPUIX_PDO::getTableAsDBUIArray($param_HostAccount, $param_iStorable, $this->RootTable, $this->SearchAttributes, $param_SQLWhere, $param_depth);
if(is_array($DBTable)) {
if($param_SQLWhere==='' && !is_null($this->SearchAttributes)) { // D::show($DBTable, '$DBTable');
$param_SQLWhere = ' where '; $this->setTableValues($this->RootTable, $DBTable);
$bool_AND = false; $this->DBTab_State[$this->RootTable] = mcPUIX::STATE_LOADED;
foreach($this->SearchAttributes as $col => $val) {
if($col === mcPUIX::PDOLoadDepth) {
$param_depth = $val;
}
else if($col !== mcPUIX::PUIX_SUB_REFERENCELIST) {
if($bool_AND) {
$param_SQLWhere .= ' AND ';
} else {
$bool_AND = true;
}
$param_SQLWhere .= ' '.$col.'="'.$val.'" ';
}
} }
} }
if(is_null($param_depth)) {
$param_depth = 0;
}
$DBTable = mcPUIX_PDO::getTableAsDBUIArray($param_HostAccount, $param_iStorable, $param_tablename, $param_SQLWhere, $param_depth); public function __toString() {
// D::show($DBTable, '$DBTable '.$this->PUIXHostObject); $var_string = parent::__toString();
$this->setTableValues($param_tablename, $DBTable); $var_string .= '-['.$this->PUIXHostObject.']';
$this->DBTab_State[$param_tablename] = mcPUIX::STATE_LOADED; return $var_string;
} }
/**
public function setData(Account &$param_HostAccount, iStorable &$param_iStorable, $param_values) { *
* @param Account $param_HostAccount
* @param iStorable $param_iStorable
* @param array $param_values -- array(
* get_class($this->PUIXHostObject) => array( // not necessary if $this->PUIXHostObject not exists
* get_class($this) => array(
* mcPUIX::PUIXArray => array(
* mcPUIX::FORM_POST_VALUES => array()
* )
* )
* )
* )
* @return boolean
*/
public function setData(Account &$param_HostAccount, iStorable &$param_iStorable, array $param_values) {
$param_tablename = $this->RootTable; $param_tablename = $this->RootTable;
D::ulli(__CLASS__.'::'.__FUNCTION__.': ' . $param_tablename.' ## '.mcPUIX::STATE_CHANGED);
if(is_object($this->PUIXHostObject)) { if(is_object($this->PUIXHostObject)) {
if(mcArray::checkKeyHasFullArray($param_values, get_class($this->PUIXHostObject))) { if(mcArray::checkKeyHasFullArray($param_values, get_class($this->PUIXHostObject))) {
...@@ -142,6 +155,7 @@ abstract class mcPUIX extends mcClass implements imcPUIX { ...@@ -142,6 +155,7 @@ abstract class mcPUIX extends mcClass implements imcPUIX {
} }
public function savePDOTable(Account &$param_HostAccount, iStorable &$param_iStorable) { public function savePDOTable(Account &$param_HostAccount, iStorable &$param_iStorable) {
D::cf(get_class($this).' '.$this->RootTable);
$param_tablename = $this->RootTable; $param_tablename = $this->RootTable;
$DBUIArray_Values = $this->getTableValues($param_tablename); $DBUIArray_Values = $this->getTableValues($param_tablename);
...@@ -187,13 +201,17 @@ abstract class mcPUIX extends mcClass implements imcPUIX { ...@@ -187,13 +201,17 @@ abstract class mcPUIX extends mcClass implements imcPUIX {
$DOMElement->setAttribute('class', get_class($this)); $DOMElement->setAttribute('class', get_class($this));
$DOMElement->setAttribute('label', Language::getWord(get_class($this))); $DOMElement->setAttribute('label', Language::getWord(get_class($this)));
if($param_KindOf=='form') { if($param_KindOf==='form') {
$DOMElement_edit = $param_DOMDocument->createElement(mcPUIX::DOMmcPUIX_edit); $DOMElement_edit = $param_DOMDocument->createElement(mcPUIX::DOMmcPUIX_edit);
$DOMElement_edit->setAttribute('edit', true); $DOMElement_edit->setAttribute('edit', true);
$DOMElement_edit->setAttribute('formpath', $this->getFormPathToThis()); $DOMElement_edit->setAttribute('formpath', $this->getFormPathToThis());
$DOMElement->appendChild($DOMElement_edit); $DOMElement->appendChild($DOMElement_edit);
$this->getDOMElement_edit($param_HostAccount, $param_iStorable, $param_DOMDocument, $DOMElement_edit, $param_KindOf, $param_DOMElemente); $this->getDOMElement_edit($param_HostAccount, $param_iStorable, $param_DOMDocument, $DOMElement_edit, $param_KindOf, $param_DOMElemente);
$DOMElement_edit_special = $param_DOMDocument->createElement(mcPUIX::DOMmcPUIX_edit_special);
$this->getDOMElement_editSpecial($param_HostAccount, $param_iStorable, $param_DOMDocument, $DOMElement_edit_special, $param_KindOf, $param_DOMElemente);
$DOMElement_edit->appendChild($DOMElement_edit_special);
} }
$DOMElement_show = $param_DOMDocument->createElement(mcPUIX::DOMmcPUIX_show); $DOMElement_show = $param_DOMDocument->createElement(mcPUIX::DOMmcPUIX_show);
...@@ -218,7 +236,7 @@ abstract class mcPUIX extends mcClass implements imcPUIX { ...@@ -218,7 +236,7 @@ abstract class mcPUIX extends mcClass implements imcPUIX {
public function walk_ListElements(Account &$param_HostAccount, iStorable &$param_iStorable, $param_tablename, array $param_callbackfncForList=null, array $param_callbackfncForListElements=null) { public function walk_ListElements(Account &$param_HostAccount, iStorable &$param_iStorable, $param_tablename, array $param_callbackfncForList=null, array $param_callbackfncForListElements=null) {
if(mcArray::checkKeyHasFullArray($this->DBTab, $param_tablename, mcPUIX::PUIXArray, mcPUIX::PDOValues) ) { if(mcArray::checkKeyHasFullArray($this->DBTab, $param_tablename, mcPUIX::PUIXArray, mcPUIX::PDOValues) ) {
//D::show($this->DBTab[$param_tablename][mcPUIX::PUIXArray][mcPUIX::PDOValues], $this);
$callbackfncForList = false; $callbackfncForList = false;
if(is_array($param_callbackfncForList) && !empty ($param_callbackfncForList)) { if(is_array($param_callbackfncForList) && !empty ($param_callbackfncForList)) {
$callbackfncForList = true; $callbackfncForList = true;
......
...@@ -7,7 +7,7 @@ class mcPUIX_DOM { ...@@ -7,7 +7,7 @@ class mcPUIX_DOM {
self::$double[] = $param_key; self::$double[] = $param_key;
return false; return false;
} else { } else {
D::cf('dobule key: '.$param_key); // D::cf('dobule key: '.$param_key);
return true; return true;
} }
} }
...@@ -33,6 +33,9 @@ class mcPUIX_DOM { ...@@ -33,6 +33,9 @@ class mcPUIX_DOM {
*/ */
public static function prepareArrayForDOMElement($param_tablename, array $param_ConfigArray, array $param_ValueArray=null, $param_formpath=null, array $param_SetDefault=null) { public static function prepareArrayForDOMElement($param_tablename, array $param_ConfigArray, array $param_ValueArray=null, $param_formpath=null, array $param_SetDefault=null) {
// D::show(array($param_ConfigArray, $param_ValueArray ) ,$param_tablename); // D::show(array($param_ConfigArray, $param_ValueArray ) ,$param_tablename);
$copy_ValueArray = $param_ValueArray;
if(mcArray::checkKeyHasFullArray($param_ConfigArray, mcPUIX::PUIXArray, mcPUIX::DBUIConfig, $param_tablename)) { if(mcArray::checkKeyHasFullArray($param_ConfigArray, mcPUIX::PUIXArray, mcPUIX::DBUIConfig, $param_tablename)) {
if(mcArray::checkKeyHasFullArray($param_ValueArray, mcPUIX::PUIXArray, mcPUIX::PDOValues)) { if(mcArray::checkKeyHasFullArray($param_ValueArray, mcPUIX::PUIXArray, mcPUIX::PDOValues)) {
/** /**
...@@ -91,15 +94,30 @@ class mcPUIX_DOM { ...@@ -91,15 +94,30 @@ class mcPUIX_DOM {
); );
if(mcArray::checkKeyHasFullArray($value_row, mcPUIX::PUIXArray, mcPUIX::PDOValues)) { if(mcArray::checkKeyHasFullArray($value_row, mcPUIX::PUIXArray, mcPUIX::PDOValues)) {
$ReferenceValues = array(mcPUIX::PUIXArray => array(mcPUIX::PDOValues => $value_row[mcPUIX::PUIXArray][mcPUIX::PDOValues])); $ReferenceValues = array(
mcPUIX::PUIXArray => array(
mcPUIX::PDOValues => $value_row[mcPUIX::PUIXArray][mcPUIX::PDOValues]
)
);
if(mcArray::checkKeyHasFullArray($value_row[mcPUIX::PUIXArray], mcPUIX::PDO_Special)) {
$ReferenceValues[mcPUIX::PUIXArray][mcPUIX::PDO_Special] = $value_row[mcPUIX::PUIXArray][mcPUIX::PDO_Special];
}
$Reference_DOMValues = mcPUIX_DOM::prepareArrayForDOMElement($Reference_TableName, $Reference_Config, $ReferenceValues, $Reference_formpath, $Reference_SetDefault); $Reference_DOMValues = mcPUIX_DOM::prepareArrayForDOMElement($Reference_TableName, $Reference_Config, $ReferenceValues, $Reference_formpath, $Reference_SetDefault);
// $value_row[mcPUIX::PUIXArray][mcPUIX::DOMValues] = $Reference_DOMValues[mcPUIX::PUIXArray][mcPUIX::DOMValues]; // $value_row[mcPUIX::PUIXArray][mcPUIX::DOMValues] = $Reference_DOMValues[mcPUIX::PUIXArray][mcPUIX::DOMValues];
unset($value_row[mcPUIX::PUIXArray]); unset($value_row[mcPUIX::PUIXArray]);
} else { } else {
if(mcArray::checkKeyHasFullArray($value_row, mcPUIX::PUIXArray, mcPUIX::PDO_Special)) {
$Reference_DOMValues = mcPUIX_DOM::prepareArrayForDOMElement($Reference_TableName, $Reference_Config, null, $Reference_formpath, $Reference_SetDefault); $ReferenceValues = array(
mcPUIX::PUIXArray => array(
mcPUIX::PDO_Special => $value_row[mcPUIX::PUIXArray][mcPUIX::PDO_Special]
)
);
} else {
$ReferenceValues = null;
}
$Reference_DOMValues = mcPUIX_DOM::prepareArrayForDOMElement($Reference_TableName, $Reference_Config, $ReferenceValues, $Reference_formpath, $Reference_SetDefault);
} }
if(array_key_exists($row_key, $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename])) { if(array_key_exists($row_key, $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename])) {
$row_val = $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename][$row_key]; $row_val = $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename][$row_key];
...@@ -193,46 +211,33 @@ class mcPUIX_DOM { ...@@ -193,46 +211,33 @@ class mcPUIX_DOM {
&& array_key_exists(mcPUIX::FORM_NEW_ROW, $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]['TABLE']) && array_key_exists(mcPUIX::FORM_NEW_ROW, $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]['TABLE'])
&& $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]['TABLE'][mcPUIX::FORM_NEW_ROW] && $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]['TABLE'][mcPUIX::FORM_NEW_ROW]
) { ) {
$BOOL_NEW_ROW=true;
if(mcArray::checkKeyHasFullArray($copy_ValueArray, mcPUIX::PUIXArray, mcPUIX::PDO_Special)) {
if(mcArray::checkKeyHasFullArray($copy_ValueArray[mcPUIX::PUIXArray][mcPUIX::PDO_Special], mcPUIX::PDO_NEW)) {
if($copy_ValueArray[mcPUIX::PUIXArray][mcPUIX::PDO_Special][mcPUIX::PDO_NEW][mcPUIX::PDO_Operator] === mcPUIX::PDO_XOR) {
if(mcArray::checkKeyHasFullArray($return, mcPUIX::PUIXArray, mcPUIX::DOMValues)) {
$BOOL_NEW_ROW = false;
}
} else if($copy_ValueArray[mcPUIX::PUIXArray][mcPUIX::PDO_Special][mcPUIX::PDO_NEW][mcPUIX::PDO_Operator] === mcPUIX::PDO_OR) {
} else if($copy_ValueArray[mcPUIX::PUIXArray][mcPUIX::PDO_Special][mcPUIX::PDO_NEW][mcPUIX::PDO_Operator] === mcPUIX::PDO_AND) {
if(!mcArray::checkKeyHasFullArray($return, mcPUIX::PUIXArray, mcPUIX::DOMValues)) {
$BOOL_NEW_ROW = false;
}
}
}
}
if($BOOL_NEW_ROW) {
$return_NEW_ROW = mcPUIX_DOM::prepareArrayNEWROWForDOMElement($param_tablename, $param_ConfigArray, $param_formpath, $param_SetDefault); $return_NEW_ROW = mcPUIX_DOM::prepareArrayNEWROWForDOMElement($param_tablename, $param_ConfigArray, $param_formpath, $param_SetDefault);
// D::show($return_NEW_ROW, '$return_NEW_ROW');
$return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW] = $return_NEW_ROW[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW]; $return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW] = $return_NEW_ROW[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW];
}
}
// $return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW] = $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename];
// $formpath = $param_formpath.'['.mcPUIX::FORM_NEW_ROW.']';
// foreach($return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW] as $NEW_key => &$NEW_values) {
// if(array_key_exists('type', $NEW_values) && $NEW_values['type'] === mcPUIX::PUIXArray) {
// unset($return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][$NEW_key]);
// }
//
// if(array_key_exists('edit', $NEW_values) && $NEW_values['edit']) {
// $NEW_values['formpath'] = $formpath.'['.$NEW_key.']';
// if(self::checkDouble($NEW_values['formpath'])) {
// D::show($NEW_values, '$NEW_values');
// }
// }
// /**
// * copy default values into mcPUIX::FORM_NEW_ROW
// */
// if(is_array($param_SetDefault)) {
// if(mcArray::checkKeyHasFullArray($param_SetDefault, $NEW_key)) {
// $NEW_values = array_merge ( $NEW_values, $param_SetDefault[$NEW_key]);
// }
// }
// }
// if($param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]['TABLE']['ELEMENTID']) {
// if($param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]['TABLE']['KINDOF'] === 'LIST') {
// unset($return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][$param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]['TABLE']['ELEMENTID']]);
//
// } else if($param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]['TABLE']['KINDOF'] === 'RELATION') {
//
// }
//
// }
//
// $return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][mcPUIX::FORM_DO_ROW]['value'] = mcPUIX::FORM_DO_NEW;
}
// D::show($return, '$return');
return $return; return $return;
} }
return false; return false;
...@@ -254,7 +259,7 @@ class mcPUIX_DOM { ...@@ -254,7 +259,7 @@ class mcPUIX_DOM {
$return = array(mcPUIX::PUIXArray => array(mcPUIX::DOMValues => array())); $return = array(mcPUIX::PUIXArray => array(mcPUIX::DOMValues => array()));
$return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW] = $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename]; $return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW] = $param_ConfigArray[mcPUIX::PUIXArray][mcPUIX::DBUIConfig][$param_tablename];
$formpath = $param_formpath.'['.mcPUIX::FORM_NEW_ROW.']'; $formpath = $param_formpath.'['.mcPUIX::FORM_NEW_ROW.'][0]';
foreach($return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW] as $NEW_key => &$NEW_values) { foreach($return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW] as $NEW_key => &$NEW_values) {
if(array_key_exists('type', $NEW_values) && $NEW_values['type'] === mcPUIX::PUIXArray) { if(array_key_exists('type', $NEW_values) && $NEW_values['type'] === mcPUIX::PUIXArray) {
unset($return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][$NEW_key]); unset($return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][$NEW_key]);
...@@ -263,7 +268,8 @@ class mcPUIX_DOM { ...@@ -263,7 +268,8 @@ class mcPUIX_DOM {
if(array_key_exists('edit', $NEW_values) && $NEW_values['edit']) { if(array_key_exists('edit', $NEW_values) && $NEW_values['edit']) {
$NEW_values['formpath'] = $formpath.'['.$NEW_key.']'; $NEW_values['formpath'] = $formpath.'['.$NEW_key.']';
if(self::checkDouble($NEW_values['formpath'])) { if(self::checkDouble($NEW_values['formpath'])) {
D::show($NEW_values, 'self::checkDouble $NEW_values'); // D::show($NEW_values, 'self::checkDouble $NEW_values');
// D::cf('self::checkDouble $NEW_values');
} }
} }
/** /**
...@@ -285,8 +291,12 @@ class mcPUIX_DOM { ...@@ -285,8 +291,12 @@ class mcPUIX_DOM {
} }
unset($return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][mcPUIX::FORM_DO_ROW]['values']);
$return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][mcPUIX::FORM_DO_ROW]['values'] = array(
mcPUIX::FORM_DO_NEW => mcPUIX::FORM_DO_NEW
);
$return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][mcPUIX::FORM_DO_ROW]['value'] = mcPUIX::FORM_DO_NEW; $return[mcPUIX::PUIXArray][mcPUIX::DOMValues][mcPUIX::FORM_NEW_ROW][mcPUIX::FORM_DO_ROW]['value'] = mcPUIX::FORM_DO_NEW;
//D::show($return, '$return');
return $return; return $return;
} }
...@@ -394,9 +404,9 @@ class mcPUIX_DOM { ...@@ -394,9 +404,9 @@ class mcPUIX_DOM {
$DOMElement =$param_DOMDocument->createElement($param_ElementName); $DOMElement =$param_DOMDocument->createElement($param_ElementName);
if(is_string($value)) {
$DOMElement->nodeValue = Converter::encodeString($value); $DOMElement->nodeValue = Converter::encodeString($value);
}
if(array_key_exists('type', $param_ValuesAttributes)) { if(array_key_exists('type', $param_ValuesAttributes)) {
if($param_ValuesAttributes['type'] == mcPUIX::PUIXArray) { if($param_ValuesAttributes['type'] == mcPUIX::PUIXArray) {
...@@ -411,8 +421,12 @@ class mcPUIX_DOM { ...@@ -411,8 +421,12 @@ class mcPUIX_DOM {
// D::show($value, '$param_ValuesAttributes') ; // D::show($value, '$param_ValuesAttributes') ;
// $var_BCLink = SEOLink::getSEOLink($param_HostAccount, $param_iStorable, $PartOfObj, null, $param_EdgeName); // $var_BCLink = SEOLink::getSEOLink($param_HostAccount, $param_iStorable, $PartOfObj, null, $param_EdgeName);
// $var_labelarray = Language::getClassLinks($param_EdgeName, CONSTKindOf::LINK_SHOWBASISCLIPBOARD); // $var_labelarray = Language::getClassLinks($param_EdgeName, CONSTKindOf::LINK_SHOWBASISCLIPBOARD);
if(is_array($value)) {
$DOMSEOLink = DOMElementHelper::getSEOLinkDOMElement($param_DOMDocument, $value['Host'], $value['SEOLink'], $value['Language'], $value['OptionalValues']); $DOMSEOLink = DOMElementHelper::getSEOLinkDOMElement($param_DOMDocument, $value['Host'], $value['SEOLink'], $value['Language'], $value['OptionalValues']);
$DOMElement->appendChild($DOMSEOLink); $DOMElement->appendChild($DOMSEOLink);
}
} else if($param_ValuesAttributes['type'] == 'text') { } else if($param_ValuesAttributes['type'] == 'text') {
$DOMElement->nodeValue = Converter::encodeString($value); $DOMElement->nodeValue = Converter::encodeString($value);
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
<xsl:template match="mcPUIX" mode="dev"> <xsl:template match="mcPUIX" mode="dev">
<xsl:param name="param_inputBE">0</xsl:param> <xsl:param name="param_inputBE">0</xsl:param>
<h2><xsl:value-of select="@label" /></h2> <h2><xsl:value-of select="@label" /></h2>
<!-- <b><xsl:value-of select="$param_inputBE" /></b>-->
<table border="1"> <table border="1">
<!-- <tr><td>show</td></tr>--> <xsl:if test="DOMmcPUIX_show/PUIXArray">
<tr> <tr>
<td> <td>
<xsl:apply-templates select="DOMmcPUIX_show/PUIXArray" mode="dev"> <xsl:apply-templates select="DOMmcPUIX_show/PUIXArray" mode="dev">
...@@ -28,7 +28,17 @@ ...@@ -28,7 +28,17 @@
<br/> <br/>
</td> </td>
</tr> </tr>
<!-- <tr><td>edit</td></tr>--> </xsl:if>
<xsl:if test="DOMmcPUIX_edit/PUIXArray">
<xsl:if test="DOMmcPUIX_edit/DOMmcPUIX_edit_special">
<tr>
<td>
<xsl:apply-templates select="DOMmcPUIX_edit/DOMmcPUIX_edit_special/." mode="dev">
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" /></xsl:with-param>
</xsl:apply-templates>
</td>
</tr>
</xsl:if>
<tr> <tr>
<td> <td>
<xsl:apply-templates select="DOMmcPUIX_edit/PUIXArray" mode="dev"> <xsl:apply-templates select="DOMmcPUIX_edit/PUIXArray" mode="dev">
...@@ -37,7 +47,11 @@ ...@@ -37,7 +47,11 @@
<br/> <br/>
</td> </td>
</tr> </tr>
</xsl:if>
<tr><td><xsl:value-of select="$space"/></td></tr>
</table> </table>
</xsl:template> </xsl:template>
...@@ -48,9 +62,9 @@ ...@@ -48,9 +62,9 @@
<xsl:choose> <xsl:choose>
<xsl:when test="@edit=1 and $param_noform=0"> <xsl:when test="@edit=1 and $param_noform=0">
<div class="row"><span class="element"><xsl:value-of select="@label" /> count(<xsl:value-of select="@count" />) </span> </div> <div class="row"><span class="element"><xsl:value-of select="@label" /> count(<xsl:value-of select="@count" />) </span></div>
<xsl:for-each select="DBUIRow"> <xsl:for-each select="DBUIRow">
<div class="row"><span class="element"><xsl:value-of select="@label" /> i(<xsl:value-of select="@i" />) </span> </div> <div class="row"><span class="element"><xsl:value-of select="@label" /> i(<xsl:value-of select="@i" />) </span></div>
<xsl:apply-templates select="DBUIElement" mode="dev"> <xsl:apply-templates select="DBUIElement" mode="dev">
<xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" /></xsl:with-param> <xsl:with-param name="param_inputBE" ><xsl:value-of select="$param_inputBE" /></xsl:with-param>
</xsl:apply-templates> </xsl:apply-templates>
...@@ -59,6 +73,7 @@ ...@@ -59,6 +73,7 @@
<xsl:otherwise> <xsl:otherwise>
<!--<xsl:value-of select="count(DBUIRow[@i=mcPUIX::FORM_NEW_ROW])" />/<xsl:value-of select="count(DBUIRow)" />--> <!--<xsl:value-of select="count(DBUIRow[@i=mcPUIX::FORM_NEW_ROW])" />/<xsl:value-of select="count(DBUIRow)" />-->
<xsl:if test="count(DBUIRow[@i='FORM_NEW_ROW'])!=count(DBUIRow)"> <xsl:if test="count(DBUIRow[@i='FORM_NEW_ROW'])!=count(DBUIRow)">
<xsl:if test="DBUIRow">
<table border="1"> <table border="1">
<xsl:for-each select="DBUIRow"> <xsl:for-each select="DBUIRow">
...@@ -103,9 +118,11 @@ ...@@ -103,9 +118,11 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:for-each> </xsl:for-each>
<xsl:value-of select="$space"/>
</table> </table>
</xsl:if> </xsl:if>
</xsl:if>
<xsl:if test="DBUIRow">
<table border="1"> <table border="1">
<xsl:for-each select="DBUIRow[@i='FORM_NEW_ROW']"> <xsl:for-each select="DBUIRow[@i='FORM_NEW_ROW']">
<xsl:choose> <xsl:choose>
...@@ -143,7 +160,9 @@ ...@@ -143,7 +160,9 @@
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:for-each> </xsl:for-each>
<xsl:value-of select="$space"/>
</table> </table>
</xsl:if>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
...@@ -309,6 +328,7 @@ ...@@ -309,6 +328,7 @@
</xsl:choose> </xsl:choose>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
<xsl:value-of select="$space"/>
</span> </span>
</div> </div>
</span> </span>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!