From e55474c652add389d35aaa079b4fb240df1eb1a2 Mon Sep 17 00:00:00 2001
From: deva <deva>
Date: Tue, 23 Feb 2010 13:01:41 +0000
Subject: Add navicon size parameters.

---
 utils/modules/gallery.php | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'utils')

diff --git a/utils/modules/gallery.php b/utils/modules/gallery.php
index d2b751c..0f82c05 100644
--- a/utils/modules/gallery.php
+++ b/utils/modules/gallery.php
@@ -246,6 +246,8 @@ class Gallery {
   private $albums = array();
 
 	// Local attributes
+	private $maxwidth_navicon;
+	private $maxheight_navicon;
 	private $maxwidth_icon;
 	private $maxheight_icon;
 	private $maxwidth_rand;
@@ -289,6 +291,8 @@ class Gallery {
   {
     switch($action) {
 		case "store":
+			$this->maxwidth_navicon = $vars['maxwidth_navicon'];
+			$this->maxheight_navicon = $vars['maxheight_navicon'];
 			$this->maxwidth_icon = $vars['maxwidth_icon'];
 			$this->maxheight_icon = $vars['maxheight_icon'];
 			$this->maxwidth_rand = $vars['maxwidth_rand'];
@@ -298,6 +302,8 @@ class Gallery {
 			$this->write();
     default:
 			$form = new Form("store");
+			$form->addWidget(new LineEdit("NavIcon maxwidth:", "maxwidth_navicon", $this->maxwidth_navicon));
+			$form->addWidget(new LineEdit("NavIcon maxheight:", "maxheight_navicon", $this->maxheight_navicon));
 			$form->addWidget(new LineEdit("Icon maxwidth:", "maxwidth_icon", $this->maxwidth_icon));
 			$form->addWidget(new LineEdit("Icon maxheight:", "maxheight_icon", $this->maxheight_icon));
 			$form->addWidget(new LineEdit("Random maxwidth:", "maxwidth_rand", $this->maxwidth_rand));
@@ -416,7 +422,7 @@ class Gallery {
 		case "randomimage":
 			return new ImageSize($this->maxwidth_rand, $this->maxheight_rand);
 		case "navicon":
-			return new ImageSize($this->maxwidth_icon * 0.7, $this->maxheight_icon * 0.7);
+			return new ImageSize($this->maxwidth_navicon, $this->maxheight_navicon);
 		default:
 		case "albumicon":
 			return new ImageSize($this->maxwidth_icon, $this->maxheight_icon);
@@ -428,7 +434,9 @@ class Gallery {
     $fp = fopen($this->file, "w");
     fwrite($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
 
-    fwrite($fp, "<gallery maxwidth_icon=\"".$this->maxwidth_icon."\"\n");
+    fwrite($fp, "<gallery maxwidth_navicon=\"".$this->maxwidth_navicon."\"\n");
+		fwrite($fp, "         maxheight_navicon=\"".$this->maxheight_navicon."\"\n");
+    fwrite($fp, "         maxwidth_icon=\"".$this->maxwidth_icon."\"\n");
 		fwrite($fp, "         maxheight_icon=\"".$this->maxheight_icon."\"\n");
 		fwrite($fp, "         maxwidth_rand=\"".$this->maxwidth_rand."\"\n");
 		fwrite($fp, "         maxheight_rand=\"".$this->maxheight_rand."\"\n");
@@ -452,6 +460,9 @@ class Gallery {
 		
 		$gallery = $dom->documentElement;
 
+		$this->maxwidth_navicon = $gallery->getAttribute('maxwidth_navicon');
+		$this->maxheight_navicon = $gallery->getAttribute('maxheight_navicon');
+
 		$this->maxwidth_icon = $gallery->getAttribute('maxwidth_icon');
 		$this->maxheight_icon = $gallery->getAttribute('maxheight_icon');
 
-- 
cgit v1.2.3