Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ncphp
/
mcClasses
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bfe40597
authored
Mar 13, 2012
by
Frederick d. Maus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getestet mit losp
1 parent
1137964a
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
151 additions
and
21 deletions
D/class_D.inc.php
class_mcArray.inc.php
config.php
doOnTheStart.php
include.php
mcPUIX/class_mcPUIX.inc.php
mcPUIX/class_mcPUIX_DOM.inc.php
mcPUIX/mcPUIX.xsl
oop/class_mcObjectStatistic.inc.php
oop/if_mcClass.inc.php
D/class_D.inc.php
View file @
bfe4059
...
@@ -258,7 +258,7 @@ class D {
...
@@ -258,7 +258,7 @@ class D {
$i
=
2
;
$i
=
2
;
if
(
$param_onlyFunction
)
{
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
{
}
else
{
if
(
is_array
(
$array
)
&&
array_key_exists
(
$i
,
$array
)){
if
(
is_array
(
$array
)
&&
array_key_exists
(
$i
,
$array
)){
...
...
class_mcArray.inc.php
View file @
bfe4059
...
@@ -7,12 +7,14 @@
...
@@ -7,12 +7,14 @@
class
mcArray
{
class
mcArray
{
const
ARRAY_MIDDLE
=
'
=
'
;
const
ARRAY_MIDDLE
=
'
1M1
'
;
const
ARRAY_START
=
'
|_
'
;
const
ARRAY_START
=
'
1S1
'
;
const
ARRAY_STOP
=
'
_|
'
;
const
ARRAY_STOP
=
'
1E1
'
;
/**
/**
* transform a array to a string ... in example for SEOLink
* transform a array to a string ... in example for SEOLink
*
*
* @todo evt. serialize()/unserialize()+str_replace Lösungsweg versuchen, weil vllt. schneller
*
* @phpunit
* @phpunit
*
*
* @param array $param_Array -- array( key1=>var1, key2=>var2, ...)
* @param array $param_Array -- array( key1=>var1, key2=>var2, ...)
...
@@ -48,6 +50,28 @@ class mcArray {
...
@@ -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
* check if key path is in array and value is not emtpy array
*
*
...
@@ -189,5 +213,26 @@ class mcArray {
...
@@ -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
;
}
}
}
}
?>
?>
config.php
View file @
bfe4059
...
@@ -43,7 +43,7 @@ if(!isset($__mc_PDO_LOGFILE)) {
...
@@ -43,7 +43,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.
log
'
;
$__mc_PDO_LOGFILE
=
$__BASEPATH_EX
.
'log/mc.'
.
$string
.
'.DEV_PDO.
sql
'
;
}
}
if
(
!
isset
(
$__mc_PDO_LOGFILE_RESET
))
{
if
(
!
isset
(
$__mc_PDO_LOGFILE_RESET
))
{
...
...
doOnTheStart.php
View file @
bfe4059
...
@@ -38,16 +38,16 @@ if($_LOSP_DEV) {
...
@@ -38,16 +38,16 @@ if($_LOSP_DEV) {
if
(
$__mc_PDO_LOGFILE
)
{
if
(
$__mc_PDO_LOGFILE
)
{
if
(
$__mc_PDO_LOGFILE_RESET
)
{
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
);
unlink
(
$__mc_PDO_LOGFILE
);
mcFile
::
write
(
$__mc_PDO_LOGFILE
,
$var_message
,
'w'
);
mcFile
::
write
(
$__mc_PDO_LOGFILE
,
$var_message
,
'w'
);
}
else
{
}
else
{
$var_message
=
mcCONST
::
LINEBREAK
.
mcCONST
::
LINEBREAK
.
mcCONST
::
LINEBREAK
.
mcCONST
::
LINEBREAK
.
mcCONST
::
LINEBREAK
.
mcCONST
::
LINEBREAK
$var_message
=
mcCONST
::
LINEBREAK
.
mcCONST
::
LINEBREAK
.
mcCONST
::
LINEBREAK
.
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
.
'
--
# ['
.
date
(
'd. m. Y G:i'
)
.
'] DEVMODE #'
.
mcCONST
::
LINEBREAK
.
'################################################'
.
mcCONST
::
LINEBREAK
;
.
'
--
################################################'
.
mcCONST
::
LINEBREAK
;
mcFile
::
write
(
$__mc_PDO_LOGFILE
,
$var_message
,
'a'
);
mcFile
::
write
(
$__mc_PDO_LOGFILE
,
$var_message
,
'a'
);
}
}
...
...
include.php
View file @
bfe4059
...
@@ -29,10 +29,12 @@ require_once $__PATH_to_mcClasses . 'class_mcArray.inc.php';
...
@@ -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_mcDate.inc.php'
;
require_once
$__PATH_to_mcClasses
.
'class_mcQRCode.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
.
'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_mcSort.inc.php'
;
//require_once $__PATH_to_mcClasses . 'class_.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'
;
require_once
$__PATH_to_mcClasses
.
'ReportHandling/class_mcMessageReport.inc.php'
;
...
...
mcPUIX/class_mcPUIX.inc.php
View file @
bfe4059
<?php
<?php
class
mcPUIX
{
class
mcPUIX
extends
mcClass
{
const
DBUIConfig
=
'DBUIConfig'
;
const
DBUIConfig
=
'DBUIConfig'
;
const
PDOValues
=
'PDOValues'
;
const
PDOValues
=
'PDOValues'
;
...
@@ -41,9 +41,17 @@ class mcPUIX {
...
@@ -41,9 +41,17 @@ class mcPUIX {
* @var aBasisElementAddon
* @var aBasisElementAddon
*/
*/
protected
$BasisElementAddon
=
null
;
protected
$BasisElementAddon
=
null
;
public
function
__construct
(
aBasisElementAddon
$BasisElementAddon
)
{
public
function
__construct
(
aBasisElementAddon
$BasisElementAddon
)
{
$this
->
mcID
=
mcObjectStatistic
::
getCount__construct
(
$this
);
$this
->
BasisElementAddon
=
$BasisElementAddon
;
$this
->
BasisElementAddon
=
$BasisElementAddon
;
}
}
private
function
setTableValues
(
$param_tablename
,
$param_tablevalues
)
{
private
function
setTableValues
(
$param_tablename
,
$param_tablevalues
)
{
$this
->
DBTab
[
$param_tablename
]
=
$param_tablevalues
;
$this
->
DBTab
[
$param_tablename
]
=
$param_tablevalues
;
}
}
...
@@ -105,12 +113,13 @@ class mcPUIX {
...
@@ -105,12 +113,13 @@ class mcPUIX {
}
}
protected
static
$unsetCONFIG
=
true
;
protected
static
$unsetCONFIG
=
true
;
public
static
function
setmcPUIX_CONFIG
()
{
public
static
function
setmcPUIX_CONFIG
(
array
$param_Configs
)
{
if
(
Category2mcPUIX
::
$unsetCONFIG
)
{
if
(
mcPUIX
::
$unsetCONFIG
)
{
foreach
(
Category2mcPUIX
::
$Tables
as
$tablename
=>
$values
)
{
foreach
(
$param_Configs
as
$tablename
=>
$values
)
{
// D::show($values, $tablename);
mcPUIX_CONFIG
::
setTableConfig
(
$tablename
,
$values
);
mcPUIX_CONFIG
::
setTableConfig
(
$tablename
,
$values
);
}
}
Category2
mcPUIX
::
$unsetCONFIG
=
false
;
mcPUIX
::
$unsetCONFIG
=
false
;
}
}
}
}
protected
static
$Tables
=
array
();
protected
static
$Tables
=
array
();
...
...
mcPUIX/class_mcPUIX_DOM.inc.php
View file @
bfe4059
...
@@ -95,7 +95,7 @@ class mcPUIX_DOM {
...
@@ -95,7 +95,7 @@ class mcPUIX_DOM {
*/
*/
else
{
else
{
$value
=
$row_val
;
$value
=
$row_val
;
//D::show($value, '$value '.$row_key);
if
(
array_key_exists
(
$row_key
,
$param_ConfigArray
[
mcPUIX
::
DBUIArray
][
mcPUIX
::
DBUIConfig
][
$param_tablename
]))
{
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
];
$row_val
=
$param_ConfigArray
[
mcPUIX
::
DBUIArray
][
mcPUIX
::
DBUIConfig
][
$param_tablename
][
$row_key
];
unset
(
$copy_ConfigArray
[
$row_key
]);
unset
(
$copy_ConfigArray
[
$row_key
]);
...
@@ -115,7 +115,9 @@ class mcPUIX_DOM {
...
@@ -115,7 +115,9 @@ class mcPUIX_DOM {
}
}
}
}
$row_val
[
'value'
]
=
$value
;
$row_val
[
'value'
]
=
$value
;
//D::show($row_val, '$row_val '.$row_key);
}
}
}
}
...
@@ -190,7 +192,7 @@ class mcPUIX_DOM {
...
@@ -190,7 +192,7 @@ class mcPUIX_DOM {
$return
[
mcPUIX
::
DBUIArray
][
mcPUIX
::
DOMValues
][
'NEW_ROW'
][
mcPUIX
::
FORM_DO_ROW
][
'value'
]
=
mcPUIX
::
FORM_DO_NEW
;
$return
[
mcPUIX
::
DBUIArray
][
mcPUIX
::
DOMValues
][
'NEW_ROW'
][
mcPUIX
::
FORM_DO_ROW
][
'value'
]
=
mcPUIX
::
FORM_DO_NEW
;
}
}
// D::show($return, '$return');
return
$return
;
return
$return
;
}
}
return
false
;
return
false
;
...
@@ -228,6 +230,7 @@ class mcPUIX_DOM {
...
@@ -228,6 +230,7 @@ class mcPUIX_DOM {
if
(
$column_name
===
'TABLE'
)
{
if
(
$column_name
===
'TABLE'
)
{
}
else
if
(
$column_name
===
mcPUIX
::
FORM_DO_ROW
)
{
}
else
if
(
$column_name
===
mcPUIX
::
FORM_DO_ROW
)
{
}
else
{
}
else
{
// D::show($column_value, '$column_name'.$column_name);
$DOMElement_Row
->
appendChild
(
mcPUIX_DOM
::
getDOMElement_Element
(
$param_DOMDocument
,
$column_name
,
$column_value
));
$DOMElement_Row
->
appendChild
(
mcPUIX_DOM
::
getDOMElement_Element
(
$param_DOMDocument
,
$column_name
,
$column_value
));
}
}
}
}
...
@@ -273,7 +276,7 @@ class mcPUIX_DOM {
...
@@ -273,7 +276,7 @@ class mcPUIX_DOM {
$value
=
''
;
$value
=
''
;
$values_Select_List_values
=
null
;
$values_Select_List_values
=
null
;
$values_DBUArray
=
null
;
$values_DBUArray
=
null
;
//D::show($param_ValuesAttributes, '$param_ValuesAttributes');
if
(
array_key_exists
(
'value'
,
$param_ValuesAttributes
))
{
if
(
array_key_exists
(
'value'
,
$param_ValuesAttributes
))
{
$value
=
$param_ValuesAttributes
[
'value'
];
$value
=
$param_ValuesAttributes
[
'value'
];
unset
(
$param_ValuesAttributes
[
'value'
]);
unset
(
$param_ValuesAttributes
[
'value'
]);
...
@@ -307,6 +310,14 @@ class mcPUIX_DOM {
...
@@ -307,6 +310,14 @@ class mcPUIX_DOM {
if
(
$param_ValuesAttributes
[
'type'
]
==
mcPUIX
::
DBUIArray
)
{
if
(
$param_ValuesAttributes
[
'type'
]
==
mcPUIX
::
DBUIArray
)
{
$DOM_Reference
=
mcPUIX_DOM
::
getDOMElement_DBUIArray
(
$param_DOMDocument
,
$values_DBUArray
);
$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'
)
{
}
else
if
(
$param_ValuesAttributes
[
'type'
]
==
'text'
)
{
$DOMElement
->
nodeValue
=
Converter
::
encodeString
(
$value
);
$DOMElement
->
nodeValue
=
Converter
::
encodeString
(
$value
);
...
...
mcPUIX/mcPUIX.xsl
View file @
bfe4059
...
@@ -238,7 +238,7 @@
...
@@ -238,7 +238,7 @@
<xsl:value-of
select=
"."
disable-output-escaping=
"yes"
/>
<xsl:value-of
select=
"."
disable-output-escaping=
"yes"
/>
</xsl:when>
</xsl:when>
<xsl:when
test=
"@type='FORM_TYPE_SEOLINK'"
>
<xsl:when
test=
"@type='FORM_TYPE_SEOLINK'"
>
<
a
href=
"{@value}"
>
SEOL
</a
>
<
xsl:apply-templates
select=
"SEOLink"
/
>
</xsl:when>
</xsl:when>
<xsl:when
test=
"@ID"
>
<xsl:when
test=
"@ID"
>
<a
href=
"{$param_url}"
><xsl:value-of
select=
"@value"
/><xsl:text
disable-output-escaping=
"no"
>
 
</xsl:text></a>
<a
href=
"{$param_url}"
><xsl:value-of
select=
"@value"
/><xsl:text
disable-output-escaping=
"no"
>
 
</xsl:text></a>
...
...
oop/class_mcObjectStatistic.inc.php
0 → 100644
View file @
bfe4059
<?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
;
}
}
?>
oop/if_mcClass.inc.php
0 → 100644
View file @
bfe4059
<?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
;
}
}
?>
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment