Commit bfe40597 by Frederick d. Maus

getestet mit losp

1 parent 1137964a
......@@ -258,7 +258,7 @@ class D {
$i=2;
if($param_onlyFunction) {
self::new_echo(''.$array[$i-1]["line"].':'.$array[$i]["class"].$array[$i]["type"].$array[$i]["function"].'(): '.$param_string);
self::new_echo(''.$array[$i]["class"].$array[$i]["type"].$array[$i]["function"].'(Z'.$array[$i-1]["line"].'): '.$param_string);
} else {
if(is_array($array) && array_key_exists($i,$array)){
......
......@@ -7,12 +7,14 @@
class mcArray {
const ARRAY_MIDDLE = '=';
const ARRAY_START = '|_';
const ARRAY_STOP = '_|';
const ARRAY_MIDDLE = '1M1';
const ARRAY_START = '1S1';
const ARRAY_STOP = '1E1';
/**
* transform a array to a string ... in example for SEOLink
*
* @todo evt. serialize()/unserialize()+str_replace Lösungsweg versuchen, weil vllt. schneller
*
* @phpunit
*
* @param array $param_Array -- array( key1=>var1, key2=>var2, ...)
......@@ -48,6 +50,28 @@ class mcArray {
}
public static function transformStringToArray($param_string, $param_StartSeperator=SEOLink::ARRAY_START, $param_MiddleSeperator=SEOLink::ARRAY_MIDDLE, $param_StopSeperator=SEOLink::ARRAY_STOP) {
//D::cf($param_string) ;
$pos_APS = strpos($param_string, $param_StartSeperator);
$param_string = substr($param_string, $pos_APS+ strlen($param_StartSeperator));
//D::cf($param_string) ;
$param_string = substr($param_string, 0, strpos($param_string, $param_StopSeperator));
//D::cf($param_string) ;
$AddonArray_Before = explode($param_MiddleSeperator, $param_string);
//D::show($AddonArray_Before, '$AddonArray_Before');
$AddonArray = array();
$AddonArray_Before_count = count($AddonArray_Before);
for($i=0; $i<$AddonArray_Before_count; $i++) {
if ($i%2 === 0) {
$j = $i+1;
$AddonArray[$AddonArray_Before[$i]] = $AddonArray_Before[$j];
}
}
//D::show($AddonArray, '$AddonArray');
return $AddonArray;
}
/**
* check if key path is in array and value is not emtpy array
*
......@@ -189,5 +213,26 @@ class mcArray {
}
}
/**
* vergleicht 2 arrays und gibt true zurück wenn positiv
*
* @param array $param_array1
* @param array $param_array2
* @return bool
*/
public static function compare(array $param_array1, array $param_array2) {
$serialize1 = serialize($param_array1);
$serialize2 = serialize($param_array2);
if(strcmp($serialize1, $serialize2) === 0) {
// D::cf($serialize2);
return true;
} else {
// D::cf($serialize1.' != '.$serialize2);
return false;
}
}
}
?>
......@@ -43,7 +43,7 @@ if(!isset($__mc_PDO_LOGFILE)) {
/**
* @var string -- file for the D Output
*/
$__mc_PDO_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_PDO.log';
$__mc_PDO_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_PDO.sql';
}
if(!isset($__mc_PDO_LOGFILE_RESET)) {
......
......@@ -38,16 +38,16 @@ if($_LOSP_DEV) {
if($__mc_PDO_LOGFILE) {
if($__mc_PDO_LOGFILE_RESET) {
$var_message = '['.date('d. m. Y G:i').'] DEVMODE: logfile wurde zurvor geloescht';
$var_message = '-- ['.date('d. m. Y G:i').'] DEVMODE: logfile wurde zurvor geloescht';
unlink ( $__mc_PDO_LOGFILE );
mcFile::write($__mc_PDO_LOGFILE, $var_message, 'w');
} else {
$var_message = mcCONST::LINEBREAK.mcCONST::LINEBREAK.mcCONST::LINEBREAK.mcCONST::LINEBREAK.mcCONST::LINEBREAK.mcCONST::LINEBREAK
.'################################################'.mcCONST::LINEBREAK
.'################################################'.mcCONST::LINEBREAK
.'################################################'.mcCONST::LINEBREAK
.'# ['.date('d. m. Y G:i').'] DEVMODE #'.mcCONST::LINEBREAK
.'################################################'.mcCONST::LINEBREAK;
.'-- ################################################'.mcCONST::LINEBREAK
.'-- ################################################'.mcCONST::LINEBREAK
.'-- ################################################'.mcCONST::LINEBREAK
.'-- # ['.date('d. m. Y G:i').'] DEVMODE #'.mcCONST::LINEBREAK
.'-- ################################################'.mcCONST::LINEBREAK;
mcFile::write($__mc_PDO_LOGFILE, $var_message, 'a');
}
......
......@@ -29,10 +29,12 @@ require_once $__PATH_to_mcClasses . 'class_mcArray.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcDate.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcQRCode.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcInputHandler.inc.php';
require_once $__PATH_to_mcClasses . 'oop/class_mcObjectStatistic.inc.php';
require_once $__PATH_to_mcClasses . 'oop/if_mcClass.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcSort.inc.php';
//require_once $__PATH_to_mcClasses . 'class_.inc.php';
//require_once $__PATH_to_mcClasses . 'class_.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_mcMessageReport.inc.php';
......
<?php
class mcPUIX {
class mcPUIX extends mcClass {
const DBUIConfig = 'DBUIConfig';
const PDOValues = 'PDOValues';
......@@ -41,9 +41,17 @@ class mcPUIX {
* @var aBasisElementAddon
*/
protected $BasisElementAddon = null;
public function __construct(aBasisElementAddon $BasisElementAddon) {
$this->mcID = mcObjectStatistic::getCount__construct($this);
$this->BasisElementAddon = $BasisElementAddon;
}
private function setTableValues($param_tablename, $param_tablevalues) {
$this->DBTab[$param_tablename] = $param_tablevalues;
}
......@@ -105,14 +113,15 @@ class mcPUIX {
}
protected static $unsetCONFIG = true;
public static function setmcPUIX_CONFIG() {
if(Category2mcPUIX::$unsetCONFIG) {
foreach(Category2mcPUIX::$Tables as $tablename => $values) {
public static function setmcPUIX_CONFIG(array $param_Configs) {
if(mcPUIX::$unsetCONFIG) {
foreach($param_Configs as $tablename => $values) {
// D::show($values, $tablename);
mcPUIX_CONFIG::setTableConfig($tablename, $values);
}
Category2mcPUIX::$unsetCONFIG = false;
mcPUIX::$unsetCONFIG = false;
}
}
protected static $Tables = array ();
}
?>
?>
\ No newline at end of file
......@@ -95,7 +95,7 @@ class mcPUIX_DOM {
*/
else {
$value = $row_val;
//D::show($value, '$value '.$row_key);
if(array_key_exists($row_key, $param_ConfigArray[mcPUIX::DBUIArray][mcPUIX::DBUIConfig][$param_tablename])) {
$row_val = $param_ConfigArray[mcPUIX::DBUIArray][mcPUIX::DBUIConfig][$param_tablename][$row_key];
unset($copy_ConfigArray[$row_key]);
......@@ -115,7 +115,9 @@ class mcPUIX_DOM {
}
}
$row_val['value'] = $value;
//D::show($row_val, '$row_val '.$row_key);
}
}
......@@ -190,7 +192,7 @@ class mcPUIX_DOM {
$return[mcPUIX::DBUIArray][mcPUIX::DOMValues]['NEW_ROW'][mcPUIX::FORM_DO_ROW]['value'] = mcPUIX::FORM_DO_NEW;
}
// D::show($return, '$return');
return $return;
}
return false;
......@@ -228,6 +230,7 @@ class mcPUIX_DOM {
if($column_name === 'TABLE') {
} else if ($column_name === mcPUIX::FORM_DO_ROW) {
} else {
// D::show($column_value, '$column_name'.$column_name);
$DOMElement_Row->appendChild(mcPUIX_DOM::getDOMElement_Element($param_DOMDocument, $column_name, $column_value));
}
}
......@@ -273,7 +276,7 @@ class mcPUIX_DOM {
$value = '';
$values_Select_List_values = null;
$values_DBUArray = null;
//D::show($param_ValuesAttributes, '$param_ValuesAttributes');
if(array_key_exists('value', $param_ValuesAttributes)) {
$value = $param_ValuesAttributes['value'];
unset($param_ValuesAttributes['value']);
......@@ -306,7 +309,15 @@ class mcPUIX_DOM {
if(array_key_exists('type', $param_ValuesAttributes)) {
if($param_ValuesAttributes['type'] == mcPUIX::DBUIArray) {
$DOM_Reference = mcPUIX_DOM::getDOMElement_DBUIArray($param_DOMDocument, $values_DBUArray);
$DOMElement->appendChild($DOM_Reference);
$DOMElement->appendChild($DOM_Reference);
} else if($param_ValuesAttributes['type'] == mcPUIX::FORM_TYPE_SEOLINK) {
// D::show($value, '$param_ValuesAttributes') ;
// $var_BCLink = SEOLink::getSEOLink($param_HostAccount, $param_iStorable, $PartOfObj, null, $param_EdgeName);
// $var_labelarray = Language::getClassLinks($param_EdgeName, CONSTKindOf::LINK_SHOWBASISCLIPBOARD);
$DOMSEOLink = DOMElementHelper::getSEOLinkDOMElement($param_DOMDocument, $value['Host'], $value['SEOLink'], $value['Language'], $value['OptionalValues']);
$DOMElement->appendChild($DOMSEOLink);
} else if($param_ValuesAttributes['type'] == 'text') {
$DOMElement->nodeValue = Converter::encodeString($value);
......
......@@ -238,7 +238,7 @@
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:when>
<xsl:when test="@type='FORM_TYPE_SEOLINK'">
<a href="{@value}">SEOL</a>
<xsl:apply-templates select="SEOLink" />
</xsl:when>
<xsl:when test="@ID">
<a href="{$param_url}"><xsl:value-of select="@value" /><xsl:text disable-output-escaping="no">&#160;</xsl:text></a>
......
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of class_mcObjectStatistic
*
* @author Frederick <frederick at mensch.coop>
*/
class mcObjectStatistic {
private static $statistics = array();
public static function getCount__construct($param_Object) {
$obj_classname = get_class($param_Object);
if(!mcArray::checkKeyHasFullArray(mcObjectStatistic::$statistics, $obj_classname)) {
mcObjectStatistic::$statistics[$obj_classname] = array();
}
if(!array_key_exists('__construct', mcObjectStatistic::$statistics[$obj_classname])) {
mcObjectStatistic::$statistics[$obj_classname]['__construct'] = 0;
}
mcObjectStatistic::$statistics[$obj_classname]['__construct']++;
return mcObjectStatistic::$statistics[$obj_classname]['__construct'];
}
public static function get__toString($param_Object) {
$obj_classname = get_class($param_Object);
$var_string = "obj(".$obj_classname." i[".mcObjectStatistic::$statistics[$obj_classname]['__construct']."])";
return $var_string;
}
}
?>
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of class_mcClass
*
* @author Frederick <frederick at mensch.coop>
*/
interface mciClass {
//put your code here
}
class mcClass {
protected $mcID;
public function __toString() {
$var_string = mcObjectStatistic::get__toString($this);
$var_string .= '['.$this->mcID.']';
return $var_string;
}
}
?>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!