[icinga-checkins] icinga.org: icinga-web/mhein/default: * Added iconCls to url view params

git at icinga.org git at icinga.org
Tue Jan 18 16:03:27 CET 2011


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Jan 18 16:02:57 2011 +0100

* Added iconCls to url view params

---

 app/config/routing.xml                             |    1 +
 app/modules/Cronks/lib/js/Tabhelper.js             |    5 +++--
 app/modules/Cronks/lib/js/grid/GridPanel.js        |    7 ++++++-
 app/modules/Cronks/validate/System/CronkPortal.xml |    7 +++++++
 .../views/System/CronkPortalSuccessView.class.php  |    5 ++---
 5 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/app/config/routing.xml b/app/config/routing.xml
index 713c88c..dd7e4cd 100755
--- a/app/config/routing.xml
+++ b/app/config/routing.xml
@@ -99,6 +99,7 @@
 					<route name=".crbase" pattern="/cr_base=(cr_base:[^/]*)" stop="false"/>
 					<route name=".groupDir" pattern="/groupDir=(groupDir:(ASC|DESC))" stop="false"/>
 					<route name=".groupField" pattern="/groupField=(groupField:[^/]*)" stop="false"/>
+					<route name=".iconCls" pattern="/iconCls=(iconCls:[^/]*)" stop="false"/>
 					<route name=".template" pattern="/template=(template:[^/]*)" stop="false"/>
 					<route name=".crname" pattern="/crname=(crname:[^/]*)" stop="false"/>
 					<route name=".title" pattern="/title=(title:[^/]*)" stop="false"/>
diff --git a/app/modules/Cronks/lib/js/Tabhelper.js b/app/modules/Cronks/lib/js/Tabhelper.js
index de12f9e..851eea8 100755
--- a/app/modules/Cronks/lib/js/Tabhelper.js
+++ b/app/modules/Cronks/lib/js/Tabhelper.js
@@ -196,11 +196,12 @@ Cronk.util.CronkTabHelper = Ext.extend(Object, {
 	},
 	
 	createURLCronk: function(data) {
-		console.log(data);
+		
 		var urlCronk =  Cronk.factory({
 			title: data.title,
 			crname: data.crname,
 			closable: true,
+			iconCls: data.iconCls || 'icinga-cronk-icon-go-out',
 			
 			params: {
 				'template': data.template
@@ -216,7 +217,7 @@ Cronk.util.CronkTabHelper = Ext.extend(Object, {
 			c.store.groupField = data.groupField;
 			
 			c.store.sort(data.groupField,data.groupDir);
-			AppKit.log(c);
+			
 			if(c.parentCmp.sort_array)  {
 				c.parentCmp.sort_array[0]['direction'] = data.groupDir;
 				c.parentCmp.sort_array[0]['field'] = data.groupField;
diff --git a/app/modules/Cronks/lib/js/grid/GridPanel.js b/app/modules/Cronks/lib/js/grid/GridPanel.js
index f4d8c11..26d0b0e 100755
--- a/app/modules/Cronks/lib/js/grid/GridPanel.js
+++ b/app/modules/Cronks/lib/js/grid/GridPanel.js
@@ -142,10 +142,15 @@ Cronk.grid.GridPanel = Ext.extend(Ext.grid.GridPanel, {
 				"groupField=instance/";
 		}
 		
+		if (Ext.isDefined(cronk.iconCls)) {
+			urlParams +=
+				"iconCls=" + cronk.iconCls + "/";
+		}
+		
 		urlParams +=
 			"template="+this.initialConfig.meta.params.template+"/"+
 			"crname="+cronk.crname+"/"+
-			"title="+cronk.title;
+			"title="+cronk.title+"/";
 
 		return urlParams;		
 	},
diff --git a/app/modules/Cronks/validate/System/CronkPortal.xml b/app/modules/Cronks/validate/System/CronkPortal.xml
index 66f8331..9bc2067 100755
--- a/app/modules/Cronks/validate/System/CronkPortal.xml
+++ b/app/modules/Cronks/validate/System/CronkPortal.xml
@@ -53,6 +53,13 @@
 			</errors>
 		</validator>
 		
+		<validator class="string" name="iconCls" required="false">
+			<argument>iconCls</argument>
+			<errors>
+				<error>Validation of 'iconCls' failed</error>
+			</errors>
+		</validator>
+		
 		<validator class="string" name="template" required="false">
 			<argument>template</argument>
 			<errors>
diff --git a/app/modules/Cronks/views/System/CronkPortalSuccessView.class.php b/app/modules/Cronks/views/System/CronkPortalSuccessView.class.php
index 6a5ae30..ffd4664 100755
--- a/app/modules/Cronks/views/System/CronkPortalSuccessView.class.php
+++ b/app/modules/Cronks/views/System/CronkPortalSuccessView.class.php
@@ -13,12 +13,11 @@ class Cronks_System_CronkPortalSuccessView extends CronksBaseView
 			"crname"=>false,
 			"title"=>false
 		);
-
+		
 		$rd->setParameter("isURLView",true);
 		foreach($customViewFields as $name=>&$val) {
 			$val = $rd->getParameter($name,null);
 			if($val == null) {
-
 				$rd->setParameter("isURLView",false);
 				break;
 			}
@@ -28,7 +27,7 @@ class Cronks_System_CronkPortalSuccessView extends CronksBaseView
 			$this->formatFields($customViewFields);
 			$rd->setParameter("URLData",json_encode($customViewFields));
 		}
-
+		
 		$this->setupHtml($rd);		
 		$this->setAttribute('_title', 'Icinga.Cronks.CronkPortal');
 	}





More information about the icinga-checkins mailing list