Browse Source

added test SystemObjects in Storage route

Piotr Labudda 9 years ago
parent
commit
03789dcf35
1 changed files with 68 additions and 3 deletions
  1. 68 3
      SE/se-lib/Route/Storage.php

+ 68 - 3
SE/se-lib/Route/Storage.php

@@ -67,6 +67,17 @@ class Route_Storage extends RouteBase {
 				// TODO: $menuItem['xsd'] = '<a href="index.php?_route=Storage&_task=xsd&idStorage=' . $id . '" target="_blank">' . "xsd" . '</a>';
 				$storageMenu[] = $menuItem;
 			}
+			{// core object list
+				$menuItem = array();
+				//$menuItem['id'] = 'Obiekty';
+				$menuItem['nazwa'] = 'SystemObjects';
+				$menuItem['typ'] = 'OBJECTS';
+				$menuItem['tabele i widoki'] = '<a href="index.php?_route=Storage&_task=systemObjects">' . "SystemObjects" . '</a>';
+				//$menuItem['views'] = '<a href="index.php?_route=Storage&_task=viewList&idStorage=' . $id . '">' . "views" . '</a>';
+				// $menuItem['raw info'] = '<a href="index.php?_route=Storage&_task=coreObjectParseAll">' . "parse All" . '</a>';
+				// TODO: $menuItem['xsd'] = '<a href="index.php?_route=Storage&_task=xsd&idStorage=' . $id . '" target="_blank">' . "xsd" . '</a>';
+				$storageMenu[] = $menuItem;
+			}
 			DBG::table("storageMenu", $storageMenu, __CLASS__, __FUNCTION__, __LINE__);
 		} catch (Exception $e) {
 			UI::alert('danger', "Error #" . $e->getCode() .  "|" . $e->getLine() .  ": " . $e->getMessage());
@@ -726,7 +737,7 @@ jQuery(document).on('p5UIBtnAjax:Storage:addTableToZasoby:ajaxLoaded', function(
 				return ($a < $b) ? -1 : 1;
 			});
 			DBG::table("tableList", $tableList, __CLASS__, __FUNCTION__, __LINE__);
-			?>
+?>
 <script>
 jQuery(document).on('p5UIBtnAjax:Storage:addCellToZasoby:click', function(e, n, payload) {
 	console.log('event p5UIBtnAjax:Storage:addCellToZasoby:click', n, payload);
@@ -741,10 +752,8 @@ jQuery(document).on('p5UIBtnAjax:Storage:addCellToZasoby:ajaxLoaded', function(e
 	}
 	jQuery.notify(payload.msg, payload.type);
 });
-
 </script>
 <?php
-
 		} catch (Exception $e) {
 			UI::alert('danger', "Error #" . $e->getCode() .  "|" . $e->getLine() .  ": " . $e->getMessage());
 		}
@@ -1199,4 +1208,60 @@ jQuery(document).on('p5UIBtnAjax:Storage:addCellToZasoby:ajaxLoaded', function(e
 		return null;
 	}
 
+	public function systemObjectsStructAction() {
+		UI::gora();
+		UI::menu();
+		$this->navView();
+		try {
+			throw new Exception("TODO: F." . __FUNCTION__ . ' L.' . __LINE__);
+	// 		$coreObjlist = OBJXSD::getSystemObjectsStruct();
+	// 		$objectList = array();
+	// 		foreach ($coreObjlist as $objName) {
+	// 			$objItem = array();
+	// 			$objItem['name'] = $objName;
+	// 			$objItem['struktura'] = '<a href="index.php?_route=Storage&_task=systemObjectsStruct&object=' . $objName . '">' . "struct" . '</a>';
+	// 			// $objItem['label'] = "";// TODO: read from json
+	// 			$objectList[] = $objItem;
+	// 		}
+	// 		usort($objectList, function($rowA, $rowB) {
+	// 			$a = $rowA['nazwa']; $b = $rowB['nazwa'];
+	// 			if ($a == $b) return 0;
+	// 			return ($a < $b) ? -1 : 1;
+	// 		});
+	//
+	// 		DBG::table("objectList", $objectList, __CLASS__, __FUNCTION__, __LINE__);
+		} catch (Exception $e) {
+			UI::alert('danger', "Error #" . $e->getCode() .  "|" . $e->getLine() .  ": " . $e->getMessage());
+		}
+		UI::dol();
+	}
+
+	public function systemObjectsAction() {
+		UI::gora();
+		UI::menu();
+		$this->navView();
+		try {
+			throw new Exception("TODO: F." . __FUNCTION__ . ' L.' . __LINE__);
+	// 		$coreObjlist = OBJXSD::getSystemObjectsList();
+	// 		$objectList = array();
+	// 		foreach ($coreObjlist as $objName) {
+	// 			$objItem = array();
+	// 			$objItem['name'] = $objName;
+	// 			$objItem['struktura'] = '<a href="index.php?_route=Storage&_task=systemObjectsStruct&object=' . $objName . '">' . "struct" . '</a>';
+	// 			// $objItem['label'] = "";// TODO: read from json
+	// 			$objectList[] = $objItem;
+	// 		}
+	// 		usort($objectList, function($rowA, $rowB) {
+	// 			$a = $rowA['nazwa']; $b = $rowB['nazwa'];
+	// 			if ($a == $b) return 0;
+	// 			return ($a < $b) ? -1 : 1;
+	// 		});
+	//
+	// 		DBG::table("objectList", $objectList, __CLASS__, __FUNCTION__, __LINE__);
+		} catch (Exception $e) {
+			UI::alert('danger', "Error #" . $e->getCode() .  "|" . $e->getLine() .  ": " . $e->getMessage());
+		}
+		UI::dol();
+	}
+
 }