class_Controller.inc.php 77.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620
<?php
/**
 * @file	Controller.inc.php
 * @category freeSN
 * @mailto	code [at] netz.coop
 * @version 0.4.200901
 * @link http://netz.coop
 * 
 *  @copyright Copyright by netz.coop e.G. 2015
 *  
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
/**
 *	Diese Klasse repräsentiert die losp Software nach aussen
 *   	Muster (Pattern): Controller
 * 		Name: 	"Steuerung" bzw. "controller"
 * 		Regel: 	Die Verantwortung zur Entgegennahme von
 *				* äußeren Anstößen des Systems ("Systemoperationen")
 *				* Ereignissen von außerhalb soll einer Klasse der folgenden Art übertragen werden:
 *				* einer Klasse, die das gesamte System nach außen repräsentiert (Fassadenklasse),
 *
 *	@static			Diese Klasse besitzt nur statische Funktionen
 */
class Controller	{

	public static function fromIndexInitTree(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument $param_DOMDocument, DOMElement $param_Display, array $param_GET, array $param_Tree) {

		if(array_key_exists('p', $param_GET) && is_array($param_GET['p'])) {
			$var_initAvailable = array('showSingle'=> 'ForShowSingle', 'edit'=>'Edit');
			$var_RequestProfileID = $param_HostAccount->getActiveProfileID();

			$var_url= array('start');

			$var_PartOfBE = $var_Action= null;
			$var_GET_i = 0;
			$var_BasisClipboardname = $var_BEClassname= null;
			/**
			 * @if p[0]=showSingle&p[1]=ID&p[2]=16
			 */
			if(array_key_exists($param_GET['p'][0], $var_initAvailable) && $param_GET['p'][1]=='ID'  && is_numeric($param_GET['p'][2])) {
				$var_Action = $param_GET['p'][0];
				$var_ID = $param_GET['p'][2];
				$var_i = 0;
				/**
				 * http://servername/lospdir/TopicName
				 * @elseif p[0]=TopicBC&p[1]=showSingle&p[2]=Name&p[]={TopicName}
				 */
			} else if( count($param_GET['p'])>2 && $param_GET['p'][0] && array_key_exists($param_GET['p'][1], $var_initAvailable) && $param_GET['p'][2]) {
				$FncVar_BasisClipboardnameArray = CONFIG::transformStringToArray($param_GET['p'][0], 'category');
				if(is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard')) {
					$var_BasisClipboardname = $param_GET['p'][0];
					$var_Action = $param_GET['p'][1];
					$var_ID = $param_GET['p'][2];
					$var_i = 1;
					$var_BEClassname = CONFIG::getBC_MultimediaText($var_BasisClipboardname);
				} else {
					$var_i = 0;
					$var_Action =  false;
				}
			} else {
				return false;
			}

			if($var_Action==='showSingle') {
				$var_ConditionArray = null;

				self::showSingleBasisElement($param_HostAccount, $param_Storable, $param_DOMDocument, $var_BasisClipboardname, $var_ConditionArray, $var_BEClassname, $param_Display, $var_PartOfBE, $var_GET_i, $param_GET, $var_i, $param_Tree, $var_RequestProfileID, $var_url, $param_BCLoadLevels=null, $param_BELoadLevelDefaulView=false);
			} else if($var_Action==='edit') {
				$var_MaxDetph=null;
				self::getBasisElementFormular($param_HostAccount, $param_Storable, $param_DOMDocument,$var_BasisClipboardname, $var_BEClassname, $param_Display, $var_PartOfBE, $var_GET_i, $var_url, $param_GET, $param_Tree, $var_MaxDetph);
			}

		}
	}


	public static function showAccountManagement(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument $param_DOMDocument, DOMElement &$param_MenuLink, DOMElement &$param_Display, array $param_GET, array $param_POST){
		$XMLButtonGroup = $param_MenuLink->appendChild($param_DOMDocument->createElement('XMLButtonGroup'));

		if(GlobalData::getLoggedIn()) {
			$XMLButtonGroup->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', 'p[0]=logout', array('label'=>Language::getWord('logout'))));
			$XMLButtonGroup->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', 'p[0]='.CONSTKindOf::LINK_CHANGEPASSWORD, array('label'=>Language::getWord(CONSTKindOf::LINK_CHANGEPASSWORD))));
			$param_MenuLink->appendChild($param_HostAccount->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument));

			if(array_key_exists('p', $param_GET) && array_key_exists(0, $param_GET['p'])) {
				$XMLButtonAccountManagement = $param_Display->appendChild($param_DOMDocument->createElement('AccountManagement'));
				if($param_GET['p'][0]==CONSTKindOf::LINK_CHANGEPASSWORD){
					if($param_POST['oldpassword'] && $param_POST['newpassword1'] && $param_POST['newpassword2']){
						if($param_POST['newpassword1'] == $param_POST['newpassword2']){
							$param_HostAccount->changePassword($param_POST['oldpassword'], $param_POST['newpassword1']);
							$DisplayMessage ='Passwort wurde geändert';
							$XMLButtonAccountManagement->appendChild($param_DOMDocument->createElement('DisplayMessage',$DisplayMessage));
							Message::newMessage('changePassword');
						} else {
							$ErrorDisplay .= Error::newError('UserError','Fehler Die neuen Passw&ouml;rter stimmen nicht &uuml;ber ein','256');
						}
					} else  {
						$XMLButtonAccountManagement->appendChild($param_HostAccount->getFormularPasswordXML($param_DOMDocument))->setAttribute('function', 'changePassword');
					}
				}
			}
		} else {
			$XMLButtonGroup->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', CONSTKindOf::LINK_ACCOUNTMANAGEMENT, array('label'=>Language::getWord('createAccount'))));
			$param_MenuLink->appendChild($param_HostAccount->getFormularLoginXML($param_DOMDocument))->setAttribute('function', 'login');
		}
	}

	public static function login(Account &$HostAccount, iStorable &$param_Storable, DOMDocument $DOMDocument, &$MenuLink=null,  &$Display=null, &$ErrorDisplay=null){
// 		D::show($_GET,'GET',1,1);
//                D::show($_POST,'POST',1,1);

                if(LospAuth::login($HostAccount, $param_Storable)){
			/**
			 * @deprecated XML flieg raus und kommt in showAccountManagement, der login wird sozusagen gelöst vom XML Account Gedöns 100324  @f
			 */
			$MenuLink->appendChild(DOMElementHelper::getLinkDOMElement($DOMDocument, 'index.php', 'p[0]=logout', array('label'=>Language::getWord('logout'))))->setAttribute('deprecated', '100324@f');
		} else {
//			$MenuLink->appendChild(DOMElementHelper::getLinkDOMElement($DOMDocument, 'index.php', CONSTKindOf::LINK_ACCOUNTMANAGEMENT, array('label'=>Language::getWord('createAccount'))));
			$Form = $Display->appendChild($HostAccount->getFormularLoginXML($DOMDocument))->setAttribute('function', 'login');
		}
	}



	/**
	 * @deprecated 100324 @f
	 * Function generate xml to choose the profile
	 */
	public static function showDisplayGroupProfile(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument $DOMDocument, &$MenuLink,  &$Display, &$ErrorDisplay){
		if(!$param_HostAccount->getMainProfile()){
			return FALSE;
		}

		$Display->setAttribute('action', $_SERVER['PHP_SELF']);
		$Display->setAttribute('deprecated', '100324@f');
		$Display->appendChild($DOMDocument->createElement('HostProfileID', $param_HostAccount->getActiveProfileID()))->setAttribute('deprecated', '100324@f');
		$Display->appendChild($param_HostAccount->getSwitchProfileListDOMElement($param_HostAccount, $param_Storable, $DOMDocument, 'List'))->setAttribute('deprecated', '100324@f');

	}




	private static function generateBasisClipboardMenuDOMElement(Account $param_HostAccount, iStorable &$param_Storable, DOMDocument $param_DOMDocument, DOMElement &$param_XMLElement,  $param_PartOf, $param_BasisClipboardname, $param_GET, $param_countAID  = null, $param_showDefault=0, $param_GET_index=0, $param_ShowMenu=true) {

		$FncVar_BasisClipboardnameArray = CONFIG::transformStringToArray($param_BasisClipboardname, 'category');
		$FncVar_BasisClipboardLink = CONFIG::getLinkForBC($param_BasisClipboardname);
		$count_GET_p = count($param_GET['p']);

		if($var_Menu = CONFIG::getMultimediaTextPreferencs($param_BasisClipboardname, 'Menu')) {
		} else if($var_Menu = CONFIG::getMultimediaTextPreferencs($FncVar_BasisClipboardnameArray[0], 'Menu')) {
		} else if($var_Menu = CONFIG::getBasisClipboardPreferencs($param_BasisClipboardname, 'Menu')) {
		} else if($var_Menu = CONFIG::getBasisClipboardPreferencs($FncVar_BasisClipboardnameArray[0], 'Menu')) {
		}

		if(is_array($var_Menu) && $param_ShowMenu) {
			$XMLMenuElement = $param_XMLElement->appendChild($param_DOMDocument->createElement('Menu'));
			Controller::generateBCMServiceDOMElement($param_DOMDocument, $XMLMenuElement, $param_PartOf->getObjVar('ID'), $param_BasisClipboardname);
			$var_i=0;
//D::show($var_Menu,$param_PartOf.'->'.$param_BasisClipboardname,1,1);
			for($i=$count_GET_p; ($i==$count_GET_p && !array_key_exists($i, $param_GET['p'])) || $param_GET['p'][$i]!=$FncVar_BasisClipboardLink; $i-- ) {
				$var_i=$i;
			}

			$var_GET['p'] = array_slice($param_GET['p'],0,$var_i);
			$var_parameter = urldecode(http_build_query($var_GET));

			$countGET=count($var_GET['p']);
			$var_pArray['p']=$param_GET['p'];

			$var_pOld = urldecode(http_build_query($var_pArray));
			if($param_showDefault==1){
				array_pop($var_pArray['p']);
			}

			$var_pParameter = urldecode(http_build_query($var_pArray));
			$var_cParameter='';
			$var_partOfID=$param_PartOf->getID();
			$var_cCurrent = $var_cArray = $tmp_cCurrent = $tmp_direction = $tmp_partOfID = null;
			$tmp_limit = CONFIG::getDisplayLimits('Display');
			$tmp_limitOf=0;

			if(array_key_exists('c',$param_GET)){
				$var_cArray['c']=$param_GET['c'];

				if(array_key_exists($var_partOfID,$var_cArray['c'])
					&& array_key_exists($param_BasisClipboardname,$var_cArray['c'][$var_partOfID])
				){
					$var_cCurrent = $var_cArray['c'][$var_partOfID][$param_BasisClipboardname];
					$tmp_cCurrent = $var_cCurrent;
					$tmp_l_d = explode('-', key($var_cCurrent));
					$tmp_limitOf = $tmp_l_d[0];

					if(array_key_exists(1,$tmp_l_d)){
						$tmp_direction = '-'.$tmp_l_d[1];
					}
					if(array_key_exists(2,$tmp_l_d)){
						$tmp_partOfID = '-'.$tmp_l_d[2];
					}
					unset($var_cArray['c'][$var_partOfID][$param_BasisClipboardname][$tmp_limitOf]);
					if($tmp_direction){
						unset($var_cArray['c'][$var_partOfID][$param_BasisClipboardname][$tmp_limitOf.$tmp_direction]);
						if($tmp_partOfID)
							unset($var_cArray['c'][$var_partOfID][$param_BasisClipboardname][$tmp_limitOf.$tmp_direction.$tmp_partOfID]);
					}

					$var_cArray['c']=array_filter($var_cArray['c']);

					//back button
					if($tmp_limitOf >= $tmp_limit){

						$tmp_ccb[($tmp_limitOf - $tmp_limit).$tmp_direction.$tmp_partOfID] = $var_cCurrent[$tmp_limitOf.$tmp_direction.$tmp_partOfID];
						$tmp_cab = $var_cArray;
						$tmp_cab['c'][$var_partOfID][$param_BasisClipboardname] = $tmp_ccb;

						$tmp_c=urldecode(http_build_query($tmp_cab));
						if(substr($tmp_c, -1) == '='){
							$tmp_c=substr($tmp_c, 0, -1);
						}

						$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', $var_pParameter.'&'.$tmp_c, Language::getGeneralLinks('BACK'), null));
					}


					if($var_cCurrent[$tmp_limitOf.$tmp_direction.$tmp_partOfID]){
						$var_cCurrent=ListCondition::tranformToListArray($var_cCurrent[$tmp_limitOf.$tmp_direction.$tmp_partOfID]);
					}
				}
			}

			//next button
			if($param_countAID == $tmp_limit){

				if($tmp_cCurrent){
					$tmp_ccn[($tmp_limitOf + $tmp_limit).$tmp_direction.$tmp_partOfID] = $tmp_cCurrent[$tmp_limitOf.$tmp_direction.$tmp_partOfID];
				}
				else{
					$tmp_ccn[$tmp_limitOf + $tmp_limit] = '';
				}
				$tmp_can = $var_cArray;
				$tmp_can['c'][$var_partOfID][$param_BasisClipboardname] = $tmp_ccn;

				$tmp_c=urldecode(http_build_query($tmp_can));
				if(substr($tmp_c, -1) == '='){
					$tmp_c=substr($tmp_c, 0, -1);
				}

				$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', $var_pParameter.'&'.$tmp_c, Language::getGeneralLinks('NEXT'), null));

			}
			//direction button
			if(!$tmp_direction){
				if($param_BE = CONFIG::getBC_MultimediaText($param_BasisClipboardname)){
					$tmp_def=CONFIG::getSQL_Data($param_BE, 'OrderByDefault');
					if($tmp_def && array_key_exists('direction', $tmp_def)){
						$tmp_direction='-'.$tmp_def['direction'];
					}
					else{
						$tmp_direction='-asc';
					}
				}

			}
			if($tmp_direction == '-asc'){
				$tmp_direction_new = '-desc';
			} else{
				$tmp_direction_new = '-asc';
			}
			if($tmp_cCurrent){
				$tmp_ccd['0'.$tmp_direction_new.$tmp_partOfID] = current($tmp_cCurrent);
			} else{
				$tmp_ccd['0'.$tmp_direction_new.$tmp_partOfID] = '';
			}
			$tmp_cad = $var_cArray;
			$tmp_cad['c'][$var_partOfID][$param_BasisClipboardname] = $tmp_ccd;

			$tmp_c=urldecode(http_build_query($tmp_cad));
			if(substr($tmp_c, -1) == '='){
				$tmp_c=substr($tmp_c, 0, -1);
			}
			$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', $var_pParameter.'&'.$tmp_c, Language::getGeneralLinks($tmp_direction_new), null));



			//button changePartOfID
			if(array_key_exists(CONSTKindOf::LINK_CHANGEPARTOFID, $var_Menu) && $param_HostAccount->getLoginState()){
				$tmp_cAdd = '';
				if($tmp_cCurrent){
					foreach($tmp_cCurrent as $key => $value)
						$tmp_cAdd = $value;
				}
				foreach($var_Menu[CONSTKindOf::LINK_CHANGEPARTOFID] as $key => $value){

					if($key == 'singlePossibleIDs'){
						foreach($param_HostAccount->getPossibleProfileIDArray() as $ID => $profile){
							$tmp_ccpoi = array();
							$tmp_ccpoi['c'][$var_partOfID][$param_BasisClipboardname]['0'.$tmp_direction.'-'.$ID] = $tmp_cAdd;
							$tmp_c=urldecode(http_build_query($tmp_ccpoi));
							if(substr($tmp_c, -1) == '='){
								$tmp_c=substr($tmp_c, 0, -1);
							}
							if(substr($tmp_partOfID,1) == $ID){
								$selected=true;
							}
							else{
								$selected=false;
							}
							$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', $var_pParameter.'&'.$tmp_c, Language::getGeneralLinks(CONSTKindOf::LINK_CHANGEPARTOFID), null,$profile['NickName'],$selected));
						}
					}
					else{
						$tmp_ccpoi = array();
						$tmp_ccpoi['c'][$var_partOfID][$param_BasisClipboardname]['0'.$tmp_direction.'-'.$key] = $tmp_cAdd;
						$tmp_c=urldecode(http_build_query($tmp_ccpoi));
						if(substr($tmp_c, -1) == '='){
							$tmp_c=substr($tmp_c, 0, -1);
						}
						if(substr($tmp_partOfID,1) == $key){
							$selected=true;
						}
						else{
							$selected=false;
						}
						$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', $var_pParameter.'&'.$tmp_c, Language::getGeneralLinks(CONSTKindOf::LINK_CHANGEPARTOFID), null, null,$selected));
					}
				}
			}




			if(count($var_cArray,  COUNT_RECURSIVE)>3){
				$var_cParameter=urldecode('&'.http_build_query($var_cArray));
			}

			foreach ($var_Menu as $fnc_key => $fnc) {

				if($fnc_key=='ListCondition'){
					$var_cLinks=ListCondition::getConditionUrl($var_partOfID,$param_BasisClipboardname,$fnc, $var_cCurrent,$tmp_direction,$tmp_partOfID);
					//erstelle Domelemente
					$var_Language = Language::getClassLinks($param_BasisClipboardname, 'ListCondition');
					foreach($var_cLinks as $key => $value){
						$tmp_c='';
						foreach($value as $value){
							$tmp_c	.= $value;
						}
						if(array_key_exists($key,$var_Language) && is_array($var_Language[$key])) {
							$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', $var_pParameter.$var_cParameter.$tmp_c, $var_Language[$key], null));
						} else{
							D::show('Error, in languageDat fehlt link');
						}
					}
				}
				else if($fnc_key == CONSTKindOf::LINK_JS_FUNCTION){
					foreach($fnc as $key => $value){
						$XMLMenuElement->appendChild(DOMElementHelper::getJsLinkDOMElement($param_DOMDocument, Language::getGeneralLinks(CONSTKindOf::LINK_JS_FUNCTION), $key, $value));
					}

				}

				/**
				 * generate url
				 */
				else if ((($fnc_key != CONSTKindOf::LINK_MAKENEW && $fnc_key !=CONSTKindOf::LINK_EDITBC )
					||
//						(is_object($param_PartOf->getObjVar('RightManagement')) && $param_PartOf->getObjVar('RightManagement')->getObjVar('RightManagementBC')->checkWriteBC($param_BasisClipboardname, $param_PartOf->getObjVar('RequestProfileID'))))
						(is_object($param_PartOf->getObjVar('RightManagement')) && $param_PartOf->getObjVar('RightManagement')->getObjVar('RightManagementBC')->checkIfPossibleAddToBC($param_HostAccount, $param_Storable, $param_BasisClipboardname)))
					&& $fnc_key !=CONSTKindOf::LINK_CHANGEPARTOFID

				){
					/**
					 * @if fnc of a sub BasisClipboard Object
					 */
					if(strpos($fnc_key,CONFIG::getDelimiter('ObjFnc'))!==false) {
						$var_ObjFncArray = CONFIG::transformStringToArray($fnc_key, 'ObjFnc');
						++$countGET;
						$var_parameter = XSLPHPLinkGenerator::getLinkBasisClipboard($var_parameter, $var_ObjFncArray[0]);
						$fnc_key = $var_ObjFncArray[1];
					}

					{
						/**
					 	*
						 */
						if(is_subclass_of($param_PartOf, $param_BasisClipboardname)) {
							$var_Language = Language::getClassLinks($param_PartOf->getObjVar('ThisClassName'), $fnc_key);
						} else {
							$var_Language = Language::getClassLinks($param_BasisClipboardname, $fnc_key);
						}
						$var_parameterTemp = $var_parameter;
						if($fnc==='PartOfID' && is_object($param_PartOf)) {
							$var_tmpcountGet = $countGET;
							$var_parameterTemp .= '&p['.$countGET.']='.$fnc_key.'&p['.++$countGET.']='.CONSTKindOf::LINK_ID.'&p['.++$countGET.']='.$param_PartOf->getObjVar('ID');
							$countGET = $var_tmpcountGet;
							/**
							 *
							 */
						} else if($fnc==='ProfileID' && is_object($param_HostAccount->getMainProfile())) {
							$var_tmpcountGet = $countGET;
							$var_parameterTemp .= '&p['.$countGET.']='.$fnc_key.'&p['.++$countGET.']='.CONSTKindOf::LINK_ID.'&p['.++$countGET.']='.$param_HostAccount->getActiveProfile()->getObjVar('ID');
							$countGET = $var_tmpcountGet;
						} else {
							$var_parameterTemp .= '&p['.$countGET.']='.$fnc_key;
						}
						$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php',  $var_parameterTemp.$var_cParameter, $var_Language, null, $fnc_key));
					}
				}
			}

//			$var_result = & $param_PartOf->getObjVar('RightManagement')->getObjVar('RightManagementBC')->getMakeNewMenuArray($param_HostAccount, $param_Storable);
//			foreach($var_result as $var_key => $var_value) {
//
//				$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php',  $var_parameterTemp.$var_cParameter, $var_Language, null, $fnc_key));
//			}
//			D::show($var_result, $param_PartOf,1,1);

		}
	}

	/**
	 *	śearchCodeAuthorisationList
	 *
	 *	@todo .. Funktion sollte eigentlich gar nicht exisitieren, da die Formulardaten am besten gleich richtig abgeschickt werden müssen ...
	 *			hierfür muss aber alle Designformulare und das Testsystem angeglichen werden, sollte zeitnah mit Absprache stattfinden @f
	 *  @since 100612
	 */
	private static function doUebergangFormAuthorisationListManipulation(array &$param_FormData) {
		$the_BasisElementName = key($param_FormData);
//		D::show($param_FormData[$the_BasisElementName]);

		$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList'] = array();

		if(array_key_exists('AuthorProfileID', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorProfileID'] = $param_FormData[$the_BasisElementName]['AuthorProfileID'];
			/**
			 * @todo bleibt derzeit noch doppelt vorhanden .... sollte noch mal überlegt werden wo AuthorProfileID dazu gehört
			 */
//			unset($param_FormData[$the_BasisElementName]['AuthorProfileID']);
		}

		if(array_key_exists('ReadKind', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['ReadKind'] = $param_FormData[$the_BasisElementName]['ReadKind'];
			unset($param_FormData[$the_BasisElementName]['ReadKind']);
		}


		if(array_key_exists('WriteNickName', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList']['WriteNickName'] = $param_FormData[$the_BasisElementName]['WriteNickName'];
			unset($param_FormData[$the_BasisElementName]['WriteNickName']);
		}
		if(array_key_exists('WriteFriends', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList']['WriteFriends'] = $param_FormData[$the_BasisElementName]['WriteFriends'];
			unset($param_FormData[$the_BasisElementName]['WriteFriends']);
		}
		if(array_key_exists('WriteSelected', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList']['WriteSelected'] = $param_FormData[$the_BasisElementName]['WriteSelected'];
			unset($param_FormData[$the_BasisElementName]['WriteSelected']);
		}
		if(array_key_exists('WriteGroups', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList']['WriteGroups'] = $param_FormData[$the_BasisElementName]['WriteGroups'];
			unset($param_FormData[$the_BasisElementName]['WriteGroups']);
		}

		if(array_key_exists('ReadNickName', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList']['ReadNickName'] = $param_FormData[$the_BasisElementName]['ReadNickName'];
			unset($param_FormData[$the_BasisElementName]['ReadNickName']);
		}
		if(array_key_exists('ReadFriends', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList']['ReadFriends'] = $param_FormData[$the_BasisElementName]['ReadFriends'];
			unset($param_FormData[$the_BasisElementName]['ReadFriends']);
		}
		if(array_key_exists('ReadGroups', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList']['ReadGroups'] = $param_FormData[$the_BasisElementName]['ReadGroups'];
			unset($param_FormData[$the_BasisElementName]['ReadGroups']);
		}
		if(array_key_exists('ReadSelected', $param_FormData[$the_BasisElementName])) {
			$param_FormData[$the_BasisElementName]['RightManagement']['AuthorisationList']['ReadSelected'] = $param_FormData[$the_BasisElementName]['ReadSelected'];
			unset($param_FormData[$the_BasisElementName]['ReadSelected']);
		}

	}

	public static function doGeneralBefore(Account &$param_HostAccount, iStorable &$param_Storable, array $param_Tree) {
//		if($param_Display) {

//			D::show($_FILES);
		$result = array(
			'makeNew' => array(),
			'edit' => 0,
			'function' => 0,
		);
			if($_POST){

				Form::clearDataFromTags($_POST,TreeConfig::WHITELIST);

				$makeNewID = false;

				if (array_key_exists('makeNew', $_POST) ){
					foreach($_POST['makeNew'] as $key => $value){
						if($_FILES && array_key_exists($key, $_FILES)){

							if(array_key_exists('tmp_name',$_FILES[$key]) && array_key_exists('type',$_FILES[$key]) && array_key_exists('AuthorProfileID',$value['BEName'][key($value['BEName'])])
							  && FileBE::checkUpload($_FILES[$key]['tmp_name'], $_FILES[$key]['type'],$value['BEName'][key($value['BEName'])]['AuthorProfileID'])
							 ){
								$value['BEName'][key($_POST['makeNew'][$key]['BEName'])]['files']['FileBE'] = $_FILES[$key];
							}
							else{
								unset($_POST);
								unset($_FILES);
								return;
							}
						}

						if(array_key_exists('AddToLinkList', $value) && array_key_exists('BEName', $value)){
							if(array_key_exists('function', $value)){
								$tmp_function = $value['function'];
							}
							else{
								$tmp_function = null;
							}
							self::doUebergangFormAuthorisationListManipulation($value['BEName']);
							$makeNewID = PostController::makeNew($param_HostAccount,$param_Storable, $value['BEName'],$value['AddToLinkList'], $param_Tree, $tmp_function);
							if($makeNewID) {
								$result['makeNew'][] = $makeNewID;
							}
						}
					}
				}
				if (array_key_exists('edit', $_POST) && $param_HostAccount->getActiveProfile()){
					foreach($_POST['edit'] as $key => $value){
						if($_FILES && array_key_exists($key, $_FILES)){							
							if(array_key_exists('tmp_name',$_FILES[$key]) && array_key_exists('type',$_FILES[$key]) && array_key_exists('AuthorProfileID',$value['BEName'][key($value['BEName'])])
							  && FileBE::checkUpload($_FILES[$key]['tmp_name'], $_FILES[$key]['type'],$value['BEName'][key($value['BEName'])]['AuthorProfileID'],true)
							 ){
								$value['BEName'][key($_POST['edit'][$key]['BEName'])]['files']['FileBE'] = $_FILES[$key];
								$value['BEName'][key($_POST['edit'][$key]['BEName'])]['files']['FileBE']['edit'] = true;
							}
							else{
								unset($_POST);
								unset($_FILES);
								return;
							}
						}

						if(array_key_exists('BEName', $value) && array_key_exists('AddToLinkList', $value) ){
							if(array_key_exists('function', $value)){
								$tmp_function = $value['function'];
							}
							else{
								$tmp_function = null;
							}
							self::doUebergangFormAuthorisationListManipulation($value['BEName']);
							PostController::edit($param_HostAccount, $param_Storable, $value['BEName'],$value['AddToLinkList'], $param_Tree, $tmp_function);

							$result['edit']++;

						}
					}
				}
				if (array_key_exists('function', $_POST) &&  is_array($_POST['function'])  && $param_HostAccount->getActiveProfile()){
					foreach($_POST['function'] as $kind => $value){
						/**
						 * @todo gelten die Funktionen nur für neue BasisElemente wegen der makeNewID 100731|f
						 */
						PostController::post_fnc($param_HostAccount, $param_Storable,$kind, $value, $makeNewID);
						$result['function']++;
					}
				}

				/**
				 * @todo Achtung hier wird die globale Variable ge unsetet..... die wird aber noch in nachfolgenden Funktionen benötigt, bzw genutzt
				 *100407 @f
				 *
				 *DAS SOLL ABER NICHT DER FALL SEIN !!! @f
				 */
				unset($_POST);
			}

			return $result;
//		}
	}
	public static function doGeneralAfter(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument $param_DOMDocument=null, DOMElement &$param_Display=null, array $param_Tree) {
		if($param_Display) {
			$var_doLoadLevel = array('Always');
			self::loadLevel($param_HostAccount, $param_Storable, $var_doLoadLevel);
			$var_BEADOMElement = self::$AddonManager->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, $param_KindOf=null);
			if($var_BEADOMElement) {
				$param_Display->appendChild($var_BEADOMElement);
			}
		}
	}
	/**
	 * zusätzliche BasisClipborad's die geladen und angezeigt werden sollen
	 * CONFIG::$MultimediaTextPreferencs[get_class($param_PartOf)]['default']
	 */
	public static function &showDefaultBasisClipboard(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument &$param_DOMDocument, $param_LoadLevel, DOMElement &$param_DOMElement=null, $param_MultimediaTextPreferencClassname, BasisElement &$param_BasisElement, &$param_url, &$param_Tree, array $param_GET=null, $param_GET_setNull=false, $param_showDefault=0, $param_GETcount=null) {

		$var_BasisClipboardArray = CONFIG::getMultimediaTextPreferencs($param_MultimediaTextPreferencClassname, 'Config');

		if(is_array($var_BasisClipboardArray)&& array_key_exists('showParentBasisClipboards', $var_BasisClipboardArray) && $var_BasisClipboardArray['showParentBasisClipboards']) {
			$var_BasisClipboardArray = CONFIG::getMT_BasisClipboards($param_MultimediaTextPreferencClassname, 'BasisClipboards');
		} else {
			$var_BasisClipboardArray = CONFIG::getMultimediaTextPreferencs($param_MultimediaTextPreferencClassname, 'BasisClipboards');
		}

		$FncVar_LastBasisClipboard = self::doUebergangsFunktionURL( $param_url, $param_GET);
		if(is_array($var_BasisClipboardArray)) {
			{
				unset($param_GET['p']);
				$param_GET['p'] = array();
				$count_url = count($param_url);
				for($i=1; $i<$count_url; $i++) {
					$param_GET['p'][] = $param_url[$i];
				}
			}

			$var_BasisClipboardname = array_keys($var_BasisClipboardArray);
			if(!$param_GETcount) {
				$param_GETcount= count($param_GET['p']);
			}

			$var_DOMElementArray = array();
			$var_GETcount = count($param_GET['p']);
			$var_countBasisClipboardArray = count($var_BasisClipboardArray);


			for($i=0; $i< $var_countBasisClipboardArray; $i++) {
					if(	($FncVar_LastBasisClipboard != $var_BasisClipboardname[$i])
					&&
					is_array($var_BasisClipboardArray[$var_BasisClipboardname[$i]])
					&&
					array_key_exists('LoadLevel', $var_BasisClipboardArray[$var_BasisClipboardname[$i]])
					&&
					is_array(($var_BasisClipboardArray[$var_BasisClipboardname[$i]]['LoadLevel']))
					&&
					array_key_exists($param_LoadLevel, $var_BasisClipboardArray[$var_BasisClipboardname[$i]]['LoadLevel'])
					) {
						$null=null;
						$param_GET['p'][$var_GETcount] = $var_BasisClipboardname[$i];
						$var_DOMElementArray[] = self::runTree($param_HostAccount, $param_Storable, $param_DOMDocument, $var_BasisClipboardname[$i], $null, $param_DOMElement, $param_BasisElement,$param_GETcount, $param_url, $param_GET, $param_Tree,$param_showDefault=1, 0, $param_LoadLevel);
					}
				}
				if($param_GET_setNull) {
					$param_GET['p'][$var_GETcount] = null;
				}
			}

			return $var_DOMElementArray;
		}

		public static function initTree(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument $param_DOMDocument=null, DOMElement &$param_MenuLink=null, DOMElement &$param_Display=null, MultimediaText $param_PartOf, $param_GET, $param_Tree) {

			/**
			 * Management Settings (set default vars)
			 */
			if($param_PartOf){

				$param_url = array('start');

				if(array_key_exists('p', $param_GET)) {
					$FncVar_GETcount = count($param_GET['p']);
				} else {
					$FncVar_GETcount = 0;
				}

				$param_MenuLink->setAttribute('class', get_class($param_PartOf));
				$param_MenuLink->setAttribute('Subject', $param_PartOf->getObjVar('Subject'));
				$param_MenuLink->setAttribute('Text', $param_PartOf->getObjVar('Text'));

				$class_parents = class_parents($param_PartOf);
				$class_parents[$param_PartOf->getObjVar('ThisClassName')] = $param_PartOf->getObjVar('ThisClassName');

				$class_noparents = class_parents('MultimediaText');
				$class_noparents['MultimediaText'] ='MultimediaText';
				$class_parents = array_diff($class_parents, $class_noparents);

				$var_CONFIG_Data = $param_PartOf->getObjVar('CONFIG_Data');

				/**
				 * fill the $class_parents array with BasisClipboards
				 */
				foreach ($class_parents as $MTextname) {
					if($MTextname) {
						$class_parents[$MTextname]= CONFIG::getMultimediaTextPreferencs($MTextname, 'BasisClipboards');
					}
				}

				foreach ($class_parents as $MTextname => $Clipboards) {

					$var_TreePath_BE = $param_url;
					$var_TreePath_BE[] = $MTextname;
					$XMLButtonGroup = $param_MenuLink->appendChild($param_DOMDocument->createElement('XMLButtonGroup'));

					/**
					 * Main Menu:	direct Button's ... Inhalte laufen hierrüber !!!!
					 */
//                                        echo '<pre>ARRAY: ';
//                                        print_r($var_CONFIG_Data);
//                                        echo '</pre>';
                                        
					if(array_key_exists($MTextname, $var_CONFIG_Data['MainMenu']) && $var_CONFIG_Data['MainMenu'][$MTextname]) {
						if(array_key_exists('p', $param_GET)) {
							if(CONFIG::getLinkForBC($MTextname) == $param_GET['p'][0]) {
								$var_index = 0;
							} else {
								$var_index = $FncVar_GETcount;
							}
						} else {
							$var_index = 0;
						}

						$var_Language_BE =  Language::getClassLinks($param_PartOf->getObjVar('ThisClassName'), $MTextname);
						if(is_array($var_Language_BE)) {
							$var_UrlString = TreeManipulator::transformArrayToUrl($var_TreePath_BE);
							$XMLButtonGroup->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', $var_UrlString, $var_Language_BE));
						}


						if(array_key_exists('p', $param_GET)&& array_key_exists(0, $param_GET['p']) && array_key_exists($var_index, $param_GET['p']) && $param_GET['p'][$var_index]==CONFIG::getLinkForBC($MTextname)) {

							{
								$var_i = 0;
								$var_GET = array('p' => array());
								$var_GET['p'][$var_i] =CONSTKindOf::LINK_SHOWSINGLE;
								$var_GET['p'][$var_i+1] =CONSTKindOf::LINK_ID;
								$var_GET['p'][$var_i+2] =$param_PartOf->getObjVar('ID');

								$var_LoadLevels = array();

								$var_XMLBasisElement = Controller::showSingleBasisElement($param_HostAccount, $param_Storable, $param_DOMDocument, null,$param_ConditionArray=null, $param_PartOf->getObjVar('ThisClassName'), $param_Display, $param_PartOf, $param_GET_index=0, $var_GET, $var_i, $param_Tree, $param_HostAccount->getActiveProfileID(), $param_url, $var_LoadLevels, $param_BELoadLevelDefaulView=true);
							}
							self::runTree($param_HostAccount, $param_Storable, $param_DOMDocument, $MTextname, $XMLButtonGroup, $param_Display, $param_PartOf, $var_index, $param_url, $param_GET, $param_Tree,0);

						}
					}

					/**
					 * Main Menu: Sub-Button Generierung ... Inhalte laufen hierrüber nicht!!!!
					 */
					if(array_key_exists($MTextname, $var_CONFIG_Data['MainMenu']) && is_array($var_CONFIG_Data['MainMenu'][$MTextname])) {
						$XMLButtonContainer = $XMLButtonGroup->appendChild($param_DOMDocument->createElement('XMLButtonContainer'));

						foreach($var_CONFIG_Data['MainMenu'][$MTextname] as $Clipboardname => $var_ClipboardArray) {
							$var_Language_BC =  Language::getClassLinks($param_PartOf->getObjVar('ThisClassName'), $Clipboardname);

							if(is_array($var_Language_BC)) {
								$var_TreePath_BE_BC = $var_TreePath_BE;
								$var_TreePath_BE_BC[] = $Clipboardname;
								$var_UrlString_BC = TreeManipulator::transformArrayToUrl($var_TreePath_BE_BC);
								$XMLButtonContainer->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'index.php', $var_UrlString_BC, $var_Language_BC));
							}
						}
					}
				}

			} else {
				return Error::newError('', 'Fehler: es existiert kein param_PartOf');
			}
		}

		private static $AddonManager;
		public static function loadLevel(Account &$param_HostAccount, iStorable $param_Storable, array $param_LoadLevelArray) {
			if(!is_object(self::$AddonManager)) {
				self::$AddonManager  = new AddonManager($param_Storable);
			}
			$CONFIG_initTree = CONFIG::getConfig('General');
			if(array_key_exists('LoadLevel', $CONFIG_initTree)) {
				foreach($param_LoadLevelArray as $var_LoadLevel) {
					if(array_key_exists($var_LoadLevel, $CONFIG_initTree['LoadLevel'])) {
						foreach($CONFIG_initTree['LoadLevel'][$var_LoadLevel] as $var_key => $var_value) {
							if($var_key=='aBasisElementAddon') {
								foreach($var_value as $var_BasisElementAddon => $var_Parameter) {
									self::$AddonManager->loadAddon($param_HostAccount, $param_Storable, $var_BasisElementAddon, $var_Parameter);
								}
							}
						}
					}
				}
			}
		}

		private static function getBasisElementFormular(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument $param_DOMDocument, $param_BasisClipboardname, $param_MultimediaTextClassName, DOMElement &$param_Display, MultimediaText $param_PartOf=null, $param_GET_index=0, $param_url, $param_GET, $param_Tree, $param_MaxDetph=null) {

			if($param_GET['p'][$param_GET_index+1]==CONSTKindOf::LINK_ID && $param_GET['p'][$param_GET_index+2]) {
				$RequestProfileID = $param_HostAccount->getActiveProfileID();

			//	$BasisElement =& self::getBasisElement($param_HostAccount, $param_Storable, $param_GET['p'][$param_GET_index+2],$param_MultimediaTextClassName, $param_PartOf, $param_BasisClipboardname);
				$BasisElement =& BasisElement::loadElement($param_HostAccount, $param_Storable, $param_MultimediaTextClassName, $param_GET['p'][$param_GET_index+2]);



				if($BasisElement) {
					BasisElement::loadObjectLevel($param_HostAccount, $param_Storable, $BasisElement, 'Edit' );
					$var_DOMElementeArray = Form::getDOMElementsAddToLinkList($param_HostAccount, $param_Storable, $param_PartOf, $param_BasisClipboardname, $param_Tree, $param_DOMDocument, $BasisElement);
					$DOMBE = $param_Display->appendChild($BasisElement->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, 'form', $var_DOMElementeArray));
				} else {
					return Error::newError('NoLoadBE','Fehler BasisElement  konnte nicht geladen werden',"");
				}

				if($DOMBE) {
					if($param_MaxDetph===null) {
						self::showDefaultBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, 'Edit', $DOMBE, $BasisElement->ThisClassName, $BasisElement, $param_url, $param_Tree, $param_GET, true, 1);
					} else if($param_MaxDetph>0) {
						self::showDefaultBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, 'Edit', $DOMBE, $BasisElement->ThisClassName, $BasisElement, $param_url, $param_Tree, $param_GET, true, 1, null,$param_MaxDetph-1);
					}
				}
				return $DOMBE;
			}
		}

		public static $count_runTree= 0;
		/**
		 * Controller Funktion die die losp Software kontrolliert, ruft sich rekursiv auf und läuft den dynamischen Baum ab
		 *
		 * 	runTree => runTree und danach Uebergang_show2BasisClipbaord => showBasisClipbaord
		 *
		 * @param string param_BasisClipboardname
		 * @param Account param_HostAccount
		 * @param DOMDocument param_DOMDocument=null
		 * @param DOMElement param_MenuLink=null
		 * @param DOMElement param_Display=null
		 * @param MultimediaText param_PartOf=null
		 * @param int param_GET_index=0 für den rekursiven Aufruf
		 * @param boolean param_show_default = 0
		 */
		public static function &runTree(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument $param_DOMDocument=null, $param_BasisClipboardname, DOMElement &$param_MenuLink=null, DOMElement &$param_Display=null, MultimediaText $param_PartOf=null, $param_GET_index=0, $param_url, $param_GET, $param_Tree, $param_showDefault=0, $param_MaxDetph=null, $param_LoadLevel = false) {
			self::$count_runTree++;
			//$FncDevVar_i =self::$count_runTree;
			//D::li('+ '.$FncDevVar_i.' runTree(BasisClipboardname=<b>'.$param_BasisClipboardname.'</b>, '.$param_HostAccount.', DOMDocument, MenuLink, Display, PartOf='.$param_PartOf.', GET_index='.$param_GET_index.', url='.$param_url.', _GET='.$param_GET.', Tree='.$param_Tree.', showDefault='.$param_showDefault.', MaxDetph='.$param_MaxDetph.') ' .
			//		'checkBasisClipboardIfExists['.$param_PartOf->checkBasisClipboardIfExists($param_BasisClipboardname).']' .
			//				'['.CONFIG::getConfig('NOT_checkBasisClipboardIfExists').']');

			$Clipboard = null;
			$var_NOXMLOutput = false;
			$FncVar_BasisClipboardnameArray = CONFIG::transformStringToArray($param_BasisClipboardname, 'category');
			/**
			 * Management Settings (set default vars)
			 */
			if((is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard') || (is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisElement'))) && $param_PartOf && $param_DOMDocument
				&& (CONFIG::getConfig('NOT_checkBasisClipboardIfExists') || $param_PartOf->checkBasisClipboardIfExists($param_BasisClipboardname) ) ) {

				/**
				 * generate Url and Url var's
				 */
				{
					if(is_array($param_url)) {
						$param_url[] = $param_BasisClipboardname;
					} else {
						$param_url = array($param_BasisClipboardname);
					}
					if(!$FncVar_LastBasisClipboard = TreeManipulator::getLastBasisClipboardFromUrlArray($param_url)) {
						$FncVar_LastBasisClipboard = get_class($param_PartOf);
					}
				}
				if(array_key_exists('p', $param_GET)) {
					$FncVar_GETcount = count($param_GET['p']);
				} else {
					$FncVar_GETcount = 0;
				}

				$FncVar_LastBasisClipboard_MtextClass = CONFIG::getBC_MultimediaText($FncVar_LastBasisClipboard);
				$FncVar_BasisClipboardLink = CONFIG::getLinkForBC($param_BasisClipboardname);
				$RequestProfileID = $param_HostAccount->getActiveProfileID();
				$HostProfile = $param_HostAccount->getActiveProfile();
				$param_ConditionArray = array();

			} else {
				return false;
			}


			if(array_key_exists('p', $param_GET) && array_key_exists($param_GET_index, $param_GET['p']) && $param_GET['p'][$param_GET_index]==$FncVar_BasisClipboardLink){

				$param_State=null;
				$var_MultimediaTextClassName = CONFIG::getBasisClipboardPreferencs($param_BasisClipboardname, 'MultimediaText');

				/**
				 * @todo hier gibts kein _POST mehr ... wann trifft diese if überhaupt zu 100413 @f

				if(!$var_MultimediaTextClassName && is_array($_POST) && array_key_exists('losp_classname', $_POST) && array_key_exists($param_GET_index-1, $param_GET['p']) && $_POST['PartOfID']==$param_GET['p'][$param_GET_index-1]) {
					$var_MultimediaTextClassName = $_POST['losp_classname'];
				}
*/
				/**
				 * XML: generate BasisClipboard Tag with parameters
				 */
				{

					$var_XMLTag = CONFIG::getXMLTag('BasisClipboard');

					if(is_object($param_Display) && get_class($param_Display)=='DOMElement') {
						$XMLElement = $param_Display->appendChild($param_DOMDocument->createElement($var_XMLTag));
					} else {
						$XMLElement = $param_DOMDocument->createElement($var_XMLTag);
					}

					$XMLElement->setAttribute('BasisClipboard', $FncVar_BasisClipboardnameArray[0]);
					$XMLElement->setAttribute('PartOfID', $param_PartOf->getID());

					if((is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard') )) {
						$Clipboard =& $param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname);

						if(is_object($Clipboard)) {
							BasisClipboard::loadObjectLevel($param_HostAccount, $param_Storable, $Clipboard, 'Always' );
						}


						if(array_key_exists(1, $FncVar_BasisClipboardnameArray) && $FncVar_BasisClipboardnameArray[1]) {
							$XMLElement->setAttribute('Category', $FncVar_BasisClipboardnameArray[1]);
							$XMLElement->setAttribute('name', $FncVar_BasisClipboardnameArray[0].$FncVar_BasisClipboardnameArray[1]);
}
						else{
							$XMLElement->setAttribute('name', $FncVar_BasisClipboardnameArray[0]);
						}


					} else if(is_subclass_of($FncVar_BasisClipboardnameArray[0], 'iBasisElement'))  {
						$var_ConfigDesign = CONFIG::getConfig('DefaultDesign');
						if(array_key_exists($FncVar_BasisClipboardnameArray[0], $var_ConfigDesign)) {
							$var_BasisElementDesign =& BasisDesign::loadElement($param_HostAccount, $param_Storable, 'BasisElementDesign', $var_ConfigDesign[$FncVar_BasisClipboardnameArray[0]], $FncVar_BasisClipboardnameArray[0]);
							$XMLElement->appendChild($var_BasisElementDesign->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument));
						}
					}

					/**
					 * Language for XMLElement
					 */
					{
						if(class_exists($FncVar_LastBasisClipboard_MtextClass)  && !is_subclass_of($FncVar_LastBasisClipboard_MtextClass, $FncVar_LastBasisClipboard)) {
							$var_Language1 = Language::getClassLinks($FncVar_LastBasisClipboard_MtextClass, $param_BasisClipboardname);
						} else  if(is_subclass_of($param_PartOf, $FncVar_LastBasisClipboard)) {
							$var_Language1 = Language::getClassLinks($param_PartOf->getObjVar('ThisClassName'), $param_BasisClipboardname);
						} else {
							$var_Language1 = Language::getClassLinks($FncVar_LastBasisClipboard, $param_BasisClipboardname);
						}

						/**
						 * @attention
						 * wollen wir das ... falls keine Language existiert alle parents durch gehen ???
						 */
						if (!is_array($var_Language1)) {
							$var_Language1 = Language::getClassLinks(get_class($param_PartOf), $param_BasisClipboardname);
							$PartOf_class_parents = class_parents($param_PartOf);
							foreach($PartOf_class_parents as $parent_class) {
								if(is_array($var_Language1)) {
								} else {
									$var_Language1 = Language::getClassLinks($parent_class, $param_BasisClipboardname);
								}
							}
						}
						DOMElementHelper::setDOMElementLanguageParameter($XMLElement, $var_Language1);
					}
					//D::li($param_PartOf.'->'.$param_BasisClipboardname.' $param_url('.TreeManipulator::transformArrayToUrl($param_url).')');
					//D::show($param_url, $param_PartOf.'->'.$param_BasisClipboardname);
					//D::show($XMLElement, TreeManipulator::transformArrayToUrl($param_url, $param_PartOf, $param_BasisClipboardname));
					$XMLElement->setAttribute('parameter', TreeManipulator::transformArrayToUrl($param_url, $param_PartOf, $param_BasisClipboardname));
				}
				//D::show($XMLElement, ' eins '.$param_BasisClipboardname);
				{



					//ConditonArray erstellung
					if(array_key_exists('c',$param_GET) && array_key_exists($param_PartOf->getID(),$param_GET['c']) && array_key_exists($param_BasisClipboardname,$param_GET['c'][$param_PartOf->getID()]) ){
						$param_ConditionArray=ListCondition::getConditionArray($param_GET['c'][$param_PartOf->getID()][$param_BasisClipboardname], $param_BasisClipboardname);
					}
					//OrderByDefault
					if((boolean)$param_PartOf){
						if($tmp_obd=CONFIG::getLoadLevelOrderByDefault($param_PartOf->ThisClassName,$param_BasisClipboardname,$param_LoadLevel)){
							$param_ConditionArray['OrderByDefault']=$tmp_obd;
						}
					}
					$var_LastBasisClipboards = CONFIG::getMT_BasisClipboards($FncVar_LastBasisClipboard, 'BasisClipboards');

					if($param_GET['p']['0']=='FileManager'){
						$param_ConditionArray['FileManager']=TRUE;
					}
				}

				/**
				 * @if	default display without additional parameter/function
				 */
				$param_countAID=null;


				//unschöne ermittlung des letzten BCs sollte nochmal geändert werden @um 090702
				{
					$tmp_edit=false;
					if(array_key_exists($param_GET_index+1, $param_GET['p']) && $param_GET['p'][$param_GET_index+1]==CONSTKindOf::LINK_EDITBC){
						$tmp_edit=true;
					}

					if(		(count($_GET['p']) > 0)
					&&	($param_GET_index >= count($_GET['p'])-4)
					&&	($param_showDefault == 0)
					&&	(
					//(count($_GET['p'])-1>=$param_GET_index && $param_BasisClipboardname==$_GET['p'][$param_GET_index] && ($param_GET_index != 0 || count($_GET['p'])==1))
					(count($_GET['p'])-1==$param_GET_index && $param_BasisClipboardname==$_GET['p'][$param_GET_index] && ($param_GET_index != 0 || count($_GET['p'])==1))
					||	($tmp_edit and $param_BasisClipboardname==$_GET['p'][$param_GET_index-1])
					//							||	(count($_GET['p']) > 2 &&													  $_GET['p'][$param_GET_index-1] == 'ID' && $param_BasisClipboardname==$_GET['p'][$param_GET_index-3])
					||	(count($_GET['p']) > 2 && array_key_exists($param_GET_index-1, $_GET['p']) && $_GET['p'][$param_GET_index-1] == 'ID' && $param_BasisClipboardname==$_GET['p'][$param_GET_index-3])
					||  (count($_GET['p'])-4 == $param_GET_index && $param_BasisClipboardname == $_GET['p'][$param_GET_index] && $_GET['p'][$param_GET_index+1] == 'showList')
					//||  (count($_GET['p'])==5 && $param_BasisClipboardname==$_GET['p'][$param_GET_index] &&  $_GET['p'][$param_GET_index+2]=='ID') //new @100203
					||  ($param_BasisClipboardname==$_GET['p'][$param_GET_index] && ( !(array_key_exists($param_GET_index+4,$_GET['p'])) || !array_key_exists($_GET['p'][$param_GET_index+4],TreeCONFIG::$BasisClipboardPreferencs))) //new @100203
					)
					){
						//					D::show($_GET,$param_BasisClipboardname." ".$param_GET_index);
						$XMLElement->setAttribute('last', 1);
						GlobalData::setTitleBC(false, $param_BasisClipboardname, $tmp_edit);
					}
				}
				if(	$FncVar_GETcount == ($param_GET_index+1)
						||
						(($FncVar_GETcount==($param_GET_index+2)) && ($param_GET['p'][$param_GET_index+1] ==CONSTKindOf::LINK_SHOWBASISCLIPBOARD))
						||
						CONFIG::is_BCshowCondition($param_GET['p'][$param_GET_index+1])
				) {
					if(is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard')) {
						$param_countAID = Controller::showBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, $param_BasisClipboardname, $param_ConditionArray, $var_MultimediaTextClassName, $XMLElement, $param_PartOf, $param_Tree, $RequestProfileID, $HostProfile, $FncVar_LastBasisClipboard_MtextClass, null, $tmp_edit);
						$var_NOXMLOutput = true;
					} else if(is_subclass_of($FncVar_BasisClipboardnameArray[0], 'MultimediaText')) {
						/**
						 * zusätzliche BasisClipborad's die geladen und angezeigt werden sollen
						 * CONFIG::$MultimediaTextPreferencs[get_class($param_PartOf)]['default']
						 */
						self::showDefaultBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, 'RealSingleView', $XMLElement, $param_BasisClipboardname, $param_PartOf, $param_url, $param_Tree, $param_GET, true, 1, 1);
					}
				}

				if($param_MaxDetph===null) {
					self::showDefaultBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, 'ForShowSingle', $XMLElement, $param_BasisClipboardname, $param_PartOf, $param_url, $param_Tree, $param_GET, true, 1, 1);
				} else if($param_MaxDetph>0) {
					self::showDefaultBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, 'ForShowSingle', $XMLElement, $param_BasisClipboardname, $param_PartOf, $param_url, $param_Tree, $param_GET, true, 1, 1,$param_MaxDetph-1);
				}

				/**
				 * special display with additional parameter/function
				 */
			 $i = $param_GET_index+1;
			 {
			 	/**
			 	 * $param_GET parameter transfer to xml
			 	 */
			 	for($j=$param_GET_index; $j<$FncVar_GETcount && $param_GET['p'][$j]; $j++) {
			 		$var_p = $XMLElement->appendChild($param_DOMDocument->createElement('p'));
			 		$var_p->setAttribute('value', $param_GET['p'][$j]);
			 	}

			 	/**
			 	 *	if/elseif	Abfrage für weitere Parameter
			 	 */
			 	if(array_key_exists($i, $param_GET['p']))
			 	{
			 		/**
			 		 * @if direktes weiteres BasisClipboard
			 		 */
					 if($i!=$param_GET_index ) {
					 	$var_GET_BasisClipboardArray  = CONFIG::transformStringToArray($param_GET['p'][$i], 'category');
					 } else {
					 	$var_GET_BasisClipboardArray = null;
					 }
					 if($var_GET_BasisClipboardArray!=null
						&& class_exists($var_GET_BasisClipboardArray[0])
						&& is_subclass_of($var_GET_BasisClipboardArray[0], 'BasisClipboard')) {

							$null=null;

							/**
							 * @Clipboard
							 * 090523@f
							 */
							self::runTree($param_HostAccount, $param_Storable, $param_DOMDocument, $param_GET['p'][$i], $null, $XMLElement, $param_PartOf, $i, $param_url, $param_GET, $param_Tree);

							/**
							 * @elseif show Single BasisElement
							 */
						} else if($param_GET['p'][$i]==CONSTKindOf::LINK_SHOWSINGLE && $param_GET['p'][$i-1]==$FncVar_BasisClipboardLink){

							$var_LoadLevels = array('showSingleBasisElement');
							$XMLElement->setAttribute('view', $param_GET['p'][$i]);
							$tmp_XMLBE=Controller::showSingleBasisElement($param_HostAccount, $param_Storable, $param_DOMDocument, $param_BasisClipboardname,$param_ConditionArray, $var_MultimediaTextClassName, $XMLElement, $param_PartOf, $param_GET_index, $param_GET, $i, $param_Tree, $RequestProfileID, $param_url, $var_LoadLevels);
							if($tmp_XMLBE != null){
								$tmp_XMLBE->setAttribute("view",$param_GET['p'][$i]);
							}


							/**
							 * @elseif show Both BasisElement
							 */
						} else if($param_GET['p'][$i]==CONSTKindOf::LINK_SHOWBOTH && $param_GET['p'][$i-1]==$FncVar_BasisClipboardLink){
							$param_countAID=Controller::showBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, $param_BasisClipboardname, $param_ConditionArray, $var_MultimediaTextClassName, $XMLElement, $param_PartOf, $param_Tree, $RequestProfileID, $HostProfile, $FncVar_LastBasisClipboard_MtextClass);
							$var_NOXMLOutput = true;
							$var_LoadLevels = array();
							$XMLElement->setAttribute('view', $param_GET['p'][$i]);
							$tmp_XMLBE=Controller::showSingleBasisElement($param_HostAccount, $param_Storable, $param_DOMDocument, $param_BasisClipboardname,$param_ConditionArray, $var_MultimediaTextClassName, $XMLElement, $param_PartOf, $param_GET_index, $param_GET, $i, $param_Tree, $RequestProfileID, $param_url);
							if($tmp_XMLBE != null){
								$tmp_XMLBE->setAttribute("view",$param_GET['p'][$i]);
							}

							/**
							 * @elseif makeNew
							 */
						} else if(/*$HostProfile && */$param_GET['p'][$i]==CONSTKindOf::LINK_MAKENEW && $param_GET['p'][$i-1]==$FncVar_BasisClipboardLink){

							/**
							 * @else show formular
							 */
							{
								$var_DOMElementeArray = Form::getDOMElementsAddToLinkList($param_HostAccount, $param_Storable, $param_PartOf, $param_BasisClipboardname, $param_Tree, $param_DOMDocument);
								GlobalData::setTitleBE(TreeLanguage::$Words[CONFIG::getBC_MultimediaText($param_BasisClipboardname)],CONFIG::getBC_MultimediaText($param_BasisClipboardname),false, 2);
								if(is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard')) {
									/**
									 * @todo sag mal hier sind doch ein paar parameter zuviel !?! 100406|f
									 */

									$XMLElement->appendChild($param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname, $param_State, $param_ConditionArray)->getBlancoBasisElementObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, $var_DOMElementeArray));
								} else {
									$BasisElement = BasisElement::createNewInstance($param_Storable, $var_MultimediaTextClassName, null);
									BasisElement::loadObjectLevel($param_HostAccount, $param_Storable, $BasisElement, 'MakeNew' );
									$XMLElement->appendChild($BasisElement->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, 'form', $var_DOMElementeArray));
								}
							}

							/**
							 * @elseif	edit BasisElement
							 */
						} else if($HostProfile && $param_GET['p'][$i]==CONSTKindOf::LINK_EDIT && $param_GET['p'][$i-1]==$FncVar_BasisClipboardLink){
							$var_BEName = CONFIG::getBC_MultimediaText($param_BasisClipboardname);
							GlobalData::setTitleBE(TreeLanguage::$Words[CONFIG::getBC_MultimediaText($param_BasisClipboardname)],$var_BEName,false, 1);
							self::getBasisElementFormular($param_HostAccount, $param_Storable, $param_DOMDocument, $param_BasisClipboardname, $var_MultimediaTextClassName, $XMLElement, $param_PartOf, $i, $param_url, $param_GET, $param_Tree, $param_MaxDetph);

							/**
							 * @elseif show List ..... Content List for the Tags
							 */
						} else if($param_GET['p'][$i]==CONSTKindOf::LINK_SHOWLIST && $param_GET['p'][$i-1]==$FncVar_BasisClipboardLink){

							if(is_array($param_ConditionArray)) {
								$param_ConditionArray['_GET'] = $param_GET;
								$param_ConditionArray['_SHOWLIST_ID'] = $param_GET['p'][$i+2];
								$param_ConditionArray['_BASISCLIPBOARD'] = $param_GET['p'][$i-2];
							} else {
								$param_ConditionArray = array(
								'_GET' => $param_GET,
								'_SHOWLIST_ID' => $param_GET['p'][$i+2],
								'_BASISCLIPBOARD' => $param_GET['p'][$i-2],

								);
							}

							$param_PartOf->loadClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname, $param_State=null, $param_ConditionArray);
D::li($param_PartOf.'->'.$param_BasisClipboardname.' ## '.$param_PartOf->getClipboard($param_HostAccount, $param_Storable,  $param_BasisClipboardname));
//$XMLElement->appendChild($BasisElement->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, 'form', $var_DOMElementeArray));


							/**
							 *	@elseif	unlink BasisElement
							 */
						} else if($param_GET['p'][$i]==CONSTKindOf::LINK_REMOVEFROMLINKLIST){
							if($param_GET['p'][$i+1]==CONSTKindOf::LINK_ID && $param_GET['p'][$i+2]) {
								$XMLElement->appendChild($param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname)->get($param_HostAccount, $param_Storable, $param_GET['p'][$i+2])->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument));
								$param_PartOf->getClipboard($param_HostAccount, $param_iStorable, $param_BasisClipboardname)->remove($param_HostAccount, $param_Storable, $param_GET['p'][$i+2]);
							}

							/**
							 *	@elseif	request Aspirant to Write Right
							 */
						} else if(( $param_GET['p'][$i]==CONSTKindOf::LINK_REQUESTASPIRANT) && ($param_GET['p'][$i+1]==CONSTKindOf::LINK_ID && $param_GET['p'][$i+2])){
							$HostProfile->requestAspirantWrightRightToMText($param_HostAccount, $param_Storable, $param_GET['p'][$i+2]);

							/**
							 * 	@elseif	show Write Right Aspirants for BasisElement
							 */
						}else if(($param_GET['p'][$i]==CONSTKindOf::LINK_SHOWASPIRANT) && ($param_GET['p'][$i+1]==CONSTKindOf::LINK_ID && $param_GET['p'][$i+2])){
							$BasisElement =& self::getBasisElement($param_HostAccount, $param_Storable ,$param_GET['p'][$i+2], $var_MultimediaTextClassName, $param_PartOf, $param_BasisClipboardname, $param_State);
							$XMLElement->appendChild(MultimediaText::getListObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, $BasisElement->getClipboard($param_HostAccount, $param_Storable, 'AspirantWriteRight')->getAll($param_HostAccount, $param_Storable)));

							/**
							 * @elseif show Write Member Profile List
							 */
						} else if($param_GET['p'][$i]==CONSTKindOf::LINK_SHOWWRITEMEMBERS){
							$BasisElement =& self::getBasisElement($param_HostAccount, $param_Storable, $param_GET['p'][$i+2], $var_MultimediaTextClassName, $param_PartOf, $param_BasisClipboardname, $param_State);
							$XMLElement->appendChild(MultimediaText::getListObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, $BasisElement->getWriteRightMembers($param_HostAccount, $param_Storable)));

							/**
							 * @elseif	show All MultimediaText's
							 */
						} else if($param_GET['p'][$i]==CONSTKindOf::LINK_SHOWALL){

							$var_all = BasisElement::getAllObjects($param_HostAccount, $param_Storable,$var_MultimediaTextClassName, $param_BasisClipboardname,  $param_ConditionArray, $param_checkWrite=null, $param_group=null);
							if(is_array($var_all)) {
								$param_countAID = count($var_all);

								/**
								 * @todo SearchFix, check why no Clipboard and remove null
								 * $XMLElement->appendChild(MultimediaText::getListObjDOMElement($param_HostAccount, $param_Storable,$param_DOMDocument, $var_all, 'short', $Clipboard->getObjDOMElement($param_HostAccount, $param_Storable,$param_DOMDocument, 'short'))));
								 */
								$XMLElement->appendChild(MultimediaText::getListObjDOMElement($param_HostAccount, $param_Storable,$param_DOMDocument, $var_all, 'short', null, array('class' => $param_BasisClipboardname) ));//$Clipboard->getObjDOMElement($param_HostAccount, $param_Storable,$param_DOMDocument, 'short')));

							}

							/**
							 *	@elseif	special	MultimediaText function call
							 */
						} else if((is_subclass_of($FncVar_BasisClipboardnameArray[0], 'MultimediaText') && method_exists($param_PartOf, $param_GET['p'][$i]))) {
							$XMLElement->appendChild($param_PartOf->$param_GET['p'][$i]($param_DOMDocument));

							/**
							 *	@elseif	special	BasisClipboard function call
							 */
						} else if((is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard'))) {
							$var_BasisClipboard=$param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname);
							if(is_object($var_BasisClipboard) && method_exists($var_BasisClipboard, $param_GET['p'][$i])) {
								$XMLElement->appendChild($var_BasisClipboard->$param_GET['p'][$i]($param_DOMDocument));
							}

							/**
							 * @elseif show all from this clipboard type
							 */
						} else if($param_GET['p'][$i]==CONSTKindOf::LINK_ALLFROMTHISCLIPBOARDTYPE && $param_GET['p'][$i-1]==$FncVar_BasisClipboardLink) {
							$BasisClipboard = BasisClipboard::load($param_HostAccount, $param_Storable, $FncVar_BasisClipboardLink, $param_PartOfID=false, $param_State=null, $param_ConditionArray, $param_PartOfBasisClipboard=false);
							/*
							 * @dev @Clipboard @getObjDOMElement
							 */
							$XMLElement->appendChild($BasisClipboard->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument));

						}
			 	}
			 }

			 //			@new
			 if(	!is_array($var_LastBasisClipboards)
			 ||
				( !array_key_exists($FncVar_BasisClipboardLink, $var_LastBasisClipboards) || !is_array($var_LastBasisClipboards[$FncVar_BasisClipboardLink]) )
				||
				!array_key_exists('ShowNoMenu', $var_LastBasisClipboards[$FncVar_BasisClipboardLink])
				||
				!(boolean) $var_LastBasisClipboards[$FncVar_BasisClipboardLink]['ShowNoMenu']
				) {
					self::generateBasisClipboardMenuDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, $XMLElement, $param_PartOf, $param_BasisClipboardname, $param_GET, $param_countAID, $param_showDefault, $param_GET_index, $param_ShowMenu=true);
				} else {
					D::li('Noch mal überprüfen ob es immer so richtig ist ... das Menu für BasisClipboard ('.$FncVar_BasisClipboardLink.') !!!! ?');
					self::generateBasisClipboardMenuDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, $XMLElement, $param_PartOf, $param_BasisClipboardname, $param_GET, $param_countAID, $param_showDefault, $param_GET_index, $param_ShowMenu=false);

				}
			}
			if(!$var_NOXMLOutput && is_object($Clipboard) && $param_GET['p'][$i]!=CONSTKindOf::LINK_SHOWALL) {
				$XMLElement->appendChild($Clipboard->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, 'short'));
			}
			return $XMLElement;

		}

		private static function showBasisClipboard(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument &$param_DOMDocument, $param_BasisClipboardname, $param_ConditionArray, $param_MultimediaTextClassName, DOMElement &$param_Display, MultimediaText &$param_PartOf, $param_Tree, $param_RequestProfileID, $param_HostProfile, $param_FncVar_LastBasisClipboard_MtextClass, array $param_LoadLevels=null, $param_edit=false) {

			$FncVar_LastBasisClipboard_MtextClass=$param_FncVar_LastBasisClipboard_MtextClass;
			$HostProfile = $param_HostProfile;
			$XMLElement =&$param_Display;
			$var_MultimediaTextClassName = $param_MultimediaTextClassName;
			$RequestProfileID = $param_RequestProfileID;
			$param_State=null;

			if(!is_array($param_ConditionArray) || count($param_ConditionArray)<=1) {
				$var_BCConditionArray = CONFIG::getBasisClipboardPreferencs($param_BasisClipboardname, 'ConditionArray');
				if($var_BCConditionArray) {
					$param_ConditionArray= $var_BCConditionArray;
				}
				if(!array_key_exists('limit',$param_ConditionArray)){
					if(CONFIG::getDisplayLimits($param_BasisClipboardname)){
						$param_ConditionArray['limit']=CONFIG::getDisplayLimits($param_BasisClipboardname);
					}
					else{
						$param_ConditionArray['limit']=CONFIG::getDisplayLimits('Display');
					}
				}
				/*if(!array_key_exists('limit',$param_ConditionArray)){
					$param_ConditionArray['limit']=CONFIG::getDisplayLimits('Display');
				}*/
				if(!array_key_exists('limitOf',$param_ConditionArray)){
					$param_ConditionArray['limitOf']=0;
				}
			}

			/**
			 * @Clipboard
			 */
//D::show($param_BasisClipboardname,'$param_BasisClipboardname');
			$Clipboard =& $param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname);
/*if($Clipboard == null){
			return null;
		}*/
			$param_PartOf->loadClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname, $param_State, $param_ConditionArray);

			//	@new 090709 @REFERENZEN PROBLEM
			$Clipboard =& $param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname);
			if(is_object($Clipboard)) {
				BasisClipboard::loadObjectLevel($param_HostAccount, $param_Storable, $Clipboard, 'showBasisClipboard' );

				$var_class_BasisClipboard = CONFIG::getMultimediaTextPreferencs($FncVar_LastBasisClipboard_MtextClass, 'BasisClipboards');

				if(is_array($var_class_BasisClipboard)
				&& array_key_exists($param_BasisClipboardname, $var_class_BasisClipboard)
				&& is_array($var_class_BasisClipboard[$param_BasisClipboardname]) && array_key_exists('LastElementIsFormular', $var_class_BasisClipboard[$param_BasisClipboardname])
				&& $var_class_BasisClipboard[$param_BasisClipboardname]['LastElementIsFormular']
				) {

					/**
					 * @todo was soll das denn hier!!!!
					 * hier wird vom Prinzip her ein neues BE in die DB einggetragen, wird es  eingehängt ... ansich sollte es ja auch wenn schon in den PostController, etc
					 * .... war ich das ? 100612 @f
					 */
					if(Form::checkDataCompleteness($_POST, $var_MultimediaTextClassName)) {

						$BasisElement = Form::makeNewObjectFromFormData($param_HostAccount, $param_Storable, $_POST, $param_PartOf, $param_BasisClipboardname, $var_MultimediaTextClassName, $param_State, $param_ConditionArray, $param_Tree);
						D::h2('darf nicht sein : '.$param_PartOf.'->'.$param_BasisClipboardname.' - '.$BasisElement,1,1);
						$XMLElement->appendChild($BasisElement->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument));
					}

					$var_DOMElementeArray = Form::getDOMElementsAddToLinkList($param_HostAccount, $param_Storable, $param_PartOf, $param_BasisClipboardname, $param_Tree, $param_DOMDocument);
					/*
					 * @dev @Clipboard @getObjDOMElement
					 */

					$XMLElement->appendChild($Clipboard->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, null, $var_DOMElementeArray,null, true,$param_edit));
					$Clipboard->getObjDOMElementSpecial($param_HostAccount, $param_Storable, $param_DOMDocument, null, $var_DOMElementeArray,null, true,$param_edit,$XMLElement);

				} else {
					/*
					 * @dev @Clipboard @getObjDOMElement
					 */


					$XMLElement->appendChild($Clipboard->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument, null, null, null, false, $param_edit));
					$Clipboard->getObjDOMElementSpecial($param_HostAccount, $param_Storable, $param_DOMDocument, null, null, null, false, $param_edit, $XMLElement);

					if(array_key_exists($param_BasisClipboardname,$var_class_BasisClipboard) && array_key_exists('FormularBE',$var_class_BasisClipboard[$param_BasisClipboardname])){

						$XMLElement->appendChild($param_DOMDocument->createElement('FormularBE'))->appendChild($Clipboard->getBlancoBasisElementObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument));
					}
				}
				return  $Clipboard->countAttachIDList();
			}
		}

		/**
		 * ist für die Anzeige eines einzelnes BasisElement, wird aus der Controller::runTree aufgerufen
		 * @since 0.4 - 23.03.2009
		 */
		private static function showSingleBasisElement(Account &$param_HostAccount, iStorable &$param_Storable, DOMDocument &$param_DOMDocument, $param_BasisClipboardname, $param_ConditionArray, $param_MultimediaTextClassName, DOMElement &$param_Display, MultimediaText &$param_PartOf=null, $param_GET_index=0, array $param_GET, $param_i, $param_Tree,$param_RequestProfileID, $param_url, array $param_BCLoadLevels=null, $param_BELoadLevelDefaulView=false) {
			$param_State=null;
			/**
			 * @Clipboard
			 * @deprecated 091111 @author f
			 * @Fragwürdiger Ablauf, da
			 *	1. XML Ausgabe auskommentiert,
			 *	2. ConditionArray lädt komplettest BC was höchstwahrscheinlich schon geladen wurde,
			 *	3. es eh wenn nur mit LoadLevel showSingleBasisElement übergeben wird
			 *  4. laut CONFIG BasisClipboard::loadObjectLevel nie aufgerufen wird
			 *  5.  Objekt $Clipboard in dieser Funktion nicht mehr benötig wird
			 *  deshalb erstmal auf false gesetzt
			 *
			 *  @todo evt. mal BasisClipboard LoadLevel allgemein prüfen wo und ob die aufgerufen werden
			 *
			 * Wenn auf false gesetzt funkt kalender unter MyOffice nicht mehr
			 */
			if(true) {
				if($param_BasisClipboardname && is_object($param_PartOf)) {
					$Clipboard =& $param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname);

					if($Clipboard && !empty($param_BCLoadLevels)) {
						$param_PartOf->loadClipboard($param_HostAccount, $param_Storable, $param_BasisClipboardname, $param_State, $param_ConditionArray);
						foreach($param_BCLoadLevels as $var_LoadLevel) {
							BasisClipboard::loadObjectLevel($param_HostAccount, $param_Storable, $Clipboard, $var_LoadLevel);
						}
					}
				}
			}

			$XMLElement =&$param_Display;
			$RequestProfileID = $param_RequestProfileID;

			$FncVar_BasisClipboardLink = CONFIG::getLinkForBC($param_BasisClipboardname);

			if(array_key_exists('p', $param_GET)) {
				$FncVar_GETcount = count($param_GET['p']);
			} else {
				$FncVar_GETcount = 0;
			}
			$var_MultimediaTextClassName = $param_MultimediaTextClassName;
			$i = $param_i;

			if($i>=$param_GET_index) {
				if($param_GET['p'][$i+1]==CONSTKindOf::LINK_ID && $param_GET['p'][$i+2]){
					$var_Link_ID = $param_GET['p'][$i+2];
				} else if($param_MultimediaTextClassName) {
					$var_CONFIG_BE_MySql  = CONFIG::getMultimediaTextPreferencs($param_MultimediaTextClassName, 'MySql');
					if(strpos($var_CONFIG_BE_MySql['SelectColumns'],$param_GET['p'][$i+1])!==false) {
						$var_Link_ID = MultimediaText::getIDFromColumnValue($param_Storable, $var_CONFIG_BE_MySql['Tablename'], $param_GET['p'][$i+1], $param_GET['p'][$i+2]);
					}

				}
			}

			if($var_Link_ID) {
				$BasisElement =& self::getBasisElement($param_HostAccount, $param_Storable, $var_Link_ID , $var_MultimediaTextClassName, $param_PartOf, $param_BasisClipboardname, $param_State);
				if($BasisElement) {

					/**
					 * generate Url
					 */
					{
						if(!is_array($param_url)) {
							$param_url = array();
						}
						if(array_key_exists('0',$param_url) && $param_url[0] == $BasisElement->getPartOfObjVar()){
							$param_url[] = CONSTKindOf::LINK_SHOWSINGLE;
							$param_url[] = CONSTKindOf::LINK_ID;
							$param_url[] = $BasisElement->getPartOfID();
							$param_url[] = $BasisElement->getPartOfObjVar();
						}

						$showKind=CONSTKindOf::LINK_SHOWSINGLE;
						if($BasisElement->getPartOfObjVar()){
							$BC = $BasisElement->getPartOfObjVar();
							if($BasisElement->getObjVar('CategoryName')){
								$BC .=	'::'.$BasisElement->getObjVar('CategoryName');
							}
							$showKind=CONFIG::getBasisClipboardShowKind($BC,get_class($BasisElement->getPartOf()));
						}
						$param_url[] = $showKind;
						$param_url[] = CONSTKindOf::LINK_ID;
						$param_url[] = $BasisElement->getID();
					}


					$var_runTreeDOM = null;
					if(array_key_exists( $i+3, $param_GET['p'])) {
						$var_DefaultBasisClipboard_RSV=null;
						if( CONFIG::isLinkConfigBC($param_GET['p'][$i+3])) {
							$null=null;
							$var_runTreeDOM = &self::runTree($param_HostAccount, $param_Storable, $param_DOMDocument, $param_GET['p'][$i+3], $null, $var_XMLBasisElement, $BasisElement, $i+3, $param_url, $param_GET, $param_Tree);

						}
						/**
						 * @todo CONSTKindOf::LINK_CONFIRMASPIRANT wird doch gar nicht mehr benutzt oder ? 15.06.10 @um
						 */
						else if(($param_GET['p'][$i+3]==CONSTKindOf::LINK_CONFIRMASPIRANT) && ($param_GET['p'][$i+4]==CONSTKindOf::LINK_ID && $param_GET['p'][$i+5])) {
							$BasisElement->confirmWriteRightAspirantTo($param_HostAccount, $param_Storable, $param_GET['p'][$i+5]);

						} else if(($param_GET['p'][$i+3]==CONSTKindOf::LINK_DENYASPIRANT) && ($param_GET['p'][$i+4]==CONSTKindOf::LINK_ID && $param_GET['p'][$i+5])) {
							$BasisElement->denyWriteRightAspirantTo($param_HostAccount, $param_Storable, $param_GET['p'][$i+5]);
						}
						/**
						 * @else show Normal Single View
						 */
					} else {
						if(!$param_BELoadLevelDefaulView) {
							BasisElement::loadObjectLevel($param_HostAccount, $param_Storable, $BasisElement, 'RealSingleView' );
						} else {
							BasisElement::loadObjectLevel($param_HostAccount, $param_Storable, $BasisElement, 'DefaultView' );
						}
						/**
						 * LoadLevel
						 */
						{
							$var_DefaultBasisClipboard_RSV = &self::showDefaultBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, 'RealSingleView', $var_XMLBasisElement, get_class($BasisElement), $BasisElement, $param_url, $param_Tree, $param_GET);
						}
					}
					$var_DefaultBasisClipboard_FSV = &self::showDefaultBasisClipboard($param_HostAccount, $param_Storable, $param_DOMDocument, 'ForShowSingle', $var_XMLBasisElement, get_class($BasisElement), $BasisElement, $param_url, $param_Tree, $param_GET);


					{
						if(!$param_BELoadLevelDefaulView) {
							BasisElement::loadObjectLevel($param_HostAccount, $param_Storable, $BasisElement, 'ForShowSingle' );
						}

						//autoload DefaultBC von BasisElementDesign

						if(($param_GET['p'][0] == 'TopicBC'  && array_key_exists(2,$param_GET['p']) && $param_GET['p'][2] == 'Name')
						||	($param_GET['p'][count($param_GET['p'])-1] == $var_Link_ID && $BasisElement->getBasisElementDesign())){
								if($BasisElement->getBasisElementDesign()->getDefaultBC()){

									if( CONFIG::isLinkConfigBC($BasisElement->getBasisElementDesign()->getDefaultBC())) {
										$param_GET['p'][count($param_GET['p'])] = $BasisElement->getBasisElementDesign()->getDefaultBC();
										$null=null;
										$var_runTreeDOM = &self::runTree($param_HostAccount, $param_Storable, $param_DOMDocument, $param_GET['p'][count($param_GET['p'])-1], $null, $var_XMLBasisElement, $BasisElement, count($param_GET['p'])-1, $param_url, $param_GET, $param_Tree);

										//set BC as last
										$var_runTreeDOM->setAttribute('last', 1);

									}
								}
						}
						$var_XMLBasisElement = $BasisElement->getObjDOMElement($param_HostAccount, $param_Storable, $param_DOMDocument);

						if( (GlobalData::getTitleBE() == "" && GlobalData::getTitleBC()== "") || $param_BasisClipboardname == GlobalData::getTitleBCClass())
						GlobalData::setTitleBE($BasisElement->getObjVar( Config::getBC_XML($BasisElement->ThisClassName,'Headline')), Config::getBC_XML($BasisElement->ThisClassName,'Headline'),$BasisElement->getObjVar('Subject'));

						$XMLElement->appendChild($var_XMLBasisElement);

						{
							if(is_object($var_runTreeDOM)) {
								$var_XMLBasisElement->appendChild($var_runTreeDOM);

							}
							if(is_array($var_DefaultBasisClipboard_FSV)){
								//							D::show($var_DefaultBasisClipboard_FSV, '$var_DefaultBasisClipboard_FSV');
								$count_i = count($var_DefaultBasisClipboard_FSV);
								for($i=0; $i<$count_i; $i++) {
									$var_XMLBasisElement->appendChild($var_DefaultBasisClipboard_FSV[$i]);
								}
							}
							if(is_array($var_DefaultBasisClipboard_RSV))  {
								//							D::show($var_DefaultBasisClipboard_RSV, '$var_DefaultBasisClipboard_RSV ');
								$count_i = count($var_DefaultBasisClipboard_RSV);
								for($i=0; $i<$count_i; $i++) {
									$var_XMLBasisElement->appendChild($var_DefaultBasisClipboard_RSV[$i]);
								}
							}
						}
					}
					return $var_XMLBasisElement;
				} else {
					return Error::newError('UserError','NoLoadBE','Fehler Konnte Element('.$param_MultimediaTextClassName.') mit ID('.$var_Link_ID.') nicht laden');
				}
			}
			return Error::newError('UserError','NoLoadBE','Fehler Konnte Element('.$param_MultimediaTextClassName.') mit ID('.$var_Link_ID.') nicht laden');
		}


		private static function &getBasisElement(Account $param_HostAccount, iStorable &$param_Storable, $param_ID , $param_MultimediaTextClassName, $param_PartOf=null, $param_PartOfObjVar=null, $param_State=null){
			$FncVar_BasisClipboardnameArray = CONFIG::transformStringToArray($param_PartOfObjVar, 'category');

//			if(	$param_PartOf
//				&&	class_exists($FncVar_BasisClipboardnameArray[0])
//				&& 	is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard')
//				&&	$param_ID != $param_PartOf->getObjVar('ID')
//				&& 	($BasisElement =& $param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_PartOfObjVar)->get($param_HostAccount, $param_Storable,  $param_ID ))
//			) {
			if(	$param_PartOf
				&&	class_exists($FncVar_BasisClipboardnameArray[0])
				&& 	is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard')
				&&	$param_ID != $param_PartOf->getObjVar('ID')
				&& 	$param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_PartOfObjVar)
				&&  ($BasisElement =& $param_PartOf->getClipboard($param_HostAccount, $param_Storable, $param_PartOfObjVar)->get($param_HostAccount, $param_Storable,  $param_ID ))
			) {
			/**
			 * @todo evt. hier schauen ob $param_PartOfObjVar Rechte existieren, weil wenn keine rechte, wird BE (wenn public) direkt geladen, nicht unbedingt ziel
			 *	100409 @f
			 */
			} else {
				$BasisElement =& MultimediaText::loadElement($param_HostAccount, $param_Storable, $param_MultimediaTextClassName, $param_ID);
			}
			return $BasisElement;
		}

	private static function generateBCMServiceDOMElement(DOMDocument $param_DOMDocument, DOMElement &$param_XMLElement, $param_PartOfID, $param_BasisClipboardname=null) {

		if($param_BasisClipboardname) {
			$XMLMenuElement = $param_XMLElement->appendChild($param_DOMDocument->createElement('Services'));
			$var_Services = CONFIG::getConfigServices($param_BasisClipboardname);
			if(is_array($var_Services)) {
				foreach($var_Services as $var_KindOf => $var_value) {

					$XMLMenuElement->appendChild(DOMElementHelper::getLinkDOMElement($param_DOMDocument, 'service.php', LinkGenerator::getServiceLinkString($var_KindOf, $param_PartOfID, array($param_BasisClipboardname => true), null, null, $var_value), Language::getService($var_KindOf),null,null,$var_value));

				}
			}

		}
	}
	/**
	 *	vergleicht die Arrays und ignoriert gleiche Teile und gibt vom param_GET dann das nächste BC, wenn vorhanden zurück
	 * @param array $param_url
	 * @param array $param_GET
	 * @return string
	 */
	private static function doUebergangsFunktionURL(array $param_url=null, array $param_GET=null) {


		if( is_array($param_url) || is_array($param_GET) ) {

			$tmp_array = array();
			$count_url = count($param_url);
			for($i=1; $i<$count_url; $i++) {
				$tmp_array[] = $param_url[$i];
			}

			$tmp_array = array_diff ($param_GET['p'], $tmp_array );

			$var_BasisClipboard ='';
			$tmp_bool = true;
			foreach($tmp_array as $value) {
				$FncVar_BasisClipboardnameArray = CONFIG::transformStringToArray($value, 'category');
				if($tmp_bool && class_exists($FncVar_BasisClipboardnameArray[0]) && is_subclass_of($FncVar_BasisClipboardnameArray[0], 'BasisClipboard')) {
					$var_BasisClipboard = $value;
					$tmp_bool=false;
				}
			}

			return $var_BasisClipboard;
		} else {
			return false;
		}

	}
}
?>