[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: * Portal custom cronk possible

git at icinga.org git at icinga.org
Sun Mar 20 11:26:09 CET 2011


Module: icinga-web
Branch: jmosshammer/default
Commit: 2f26a2fe9dc03f55f36c205801822c6be5618683
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=2f26a2fe9dc03f55f36c205801822c6be5618683

Author: Marius Hein <marius.hein at netways.de>
Date:   Fri Feb 11 12:02:12 2011 +0100

* Portal custom cronk possible

---

 .../Cronks/templates/System/PortalViewSuccess.php  |   14 ++--
 app/modules/Cronks/validate/System/PortalView.xml  |   62 +++++++++++---------
 2 files changed, 42 insertions(+), 34 deletions(-)

diff --git a/app/modules/Cronks/templates/System/PortalViewSuccess.php b/app/modules/Cronks/templates/System/PortalViewSuccess.php
index 658e0fa..69fd794 100755
--- a/app/modules/Cronks/templates/System/PortalViewSuccess.php
+++ b/app/modules/Cronks/templates/System/PortalViewSuccess.php
@@ -1,12 +1,8 @@
-<?php 
-	$parentid	= $rd->getParameter('parentid');
-	$stateuid	= $rd->getParameter('stateuid');
-?>
 <script type="text/javascript">
-Cronk.util.initEnvironment("<?php echo $parentid = $rd->getParameter('parentid'); ?>", function() {
+Cronk.util.initEnvironment(<?php CronksRequestUtil::echoJsonString($rd); ?>, function() {
 
 		var CE = this;
-
+		AppKit.log(CE);
 		var PortalHandler = function() {
 
 			var id = CE.cmpid;
@@ -231,7 +227,7 @@ Cronk.util.initEnvironment("<?php echo $parentid = $rd->getParameter('parentid')
 
 		portal_config.items = items_config;
 
-		var cmp = Ext.getCmp("<?php echo $parentid; ?>");
+		var cmp = Ext.getCmp("<?php echo $rd->getParameter('parentid'); ?>");
 
 		// We need a state id from the cronkmanager, the parent id
 		// is a good choice
@@ -305,6 +301,10 @@ Cronk.util.initEnvironment("<?php echo $parentid = $rd->getParameter('parentid')
 
 		var portal = new Ext.ux.Portal(portal_config);
 	
+		if (Ext.isDefined(CE.state)) {
+			portal.applyState(CE.state);
+		}
+	
 		CE.insert(0, portal);
 		CE.doLayout();
 
diff --git a/app/modules/Cronks/validate/System/PortalView.xml b/app/modules/Cronks/validate/System/PortalView.xml
index 817686c..00133d8 100755
--- a/app/modules/Cronks/validate/System/PortalView.xml
+++ b/app/modules/Cronks/validate/System/PortalView.xml
@@ -5,42 +5,50 @@
 	parent="%core.module_dir%/Web/config/validators.xml"
 >
 	<ae:configuration>
-		
-		<validators>
-		
+
+	<validators>
+
 		<validator class="string" name="cmpid" required="false">
-					<argument>cmpid</argument>
-					
-					<errors>
-						<error>Validation of htmlid failed!</error>
-					</errors>
+			<argument>cmpid</argument>
+
+			<errors>
+				<error>Validation of htmlid failed!</error>
+			</errors>
 		</validator>
-		
+
 		<validator class="string" name="parentid" required="false">
-					<argument>parentid</argument>
-					
-					<errors>
-						<error>Validation of parentid failed!</error>
-					</errors>
+			<argument>parentid</argument>
+
+			<errors>
+				<error>Validation of parentid failed!</error>
+			</errors>
 		</validator>
 
 		<validator class="string" name="stateuid" required="false">
-					<argument>stateuid</argument>
-					
-					<errors>
-						<error>Validation of stateuid failed!</error>
-					</errors>
+			<argument>stateuid</argument>
+
+			<errors>
+				<error>Validation of stateuid failed!</error>
+			</errors>
 		</validator>
-		
+
+		<validator class="string" name="state" required="false">
+			<argument>state</argument>
+
+			<errors>
+				<error>Validation initial state string failed!</error>
+			</errors>
+		</validator>
+
 		<validator class="number" name="columns" required="false">
-					<argument>columns</argument>
-					
-					<errors>
-						<error>Validation of columns failed!</error>
-					</errors>
+			<argument>columns</argument>
+
+			<errors>
+				<error>Validation of columns failed!</error>
+			</errors>
 		</validator>
-		
-		</validators>
+
+	</validators>
 		
 	</ae:configuration>
 </ae:configurations>





More information about the icinga-checkins mailing list