File: sectionTabs.js.php

package info (click to toggle)
gallery 1.5.4-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 26,712 kB
  • ctags: 6,567
  • sloc: php: 33,824; sh: 446; xml: 96; makefile: 88; perl: 61
file content (62 lines) | stat: -rw-r--r-- 1,608 bytes parent folder | download
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
<?php
/**
 * Gallery SVN info
 * $Id: sectionTabs.js.php 13580 2006-05-02 10:22:26Z jenst $
*/

function insertSectionToggle() {
?>

<!-- This Javascript and the Tabs are inspired by the Horde Forms code -->

        function configSection(inittab) {

                this.toggle = function(id) {
                        document.getElementById(this.oldtab).style.display 	= 'none';
                        document.getElementById('tab_' + this.oldtab).className = 'tab';
                        document.getElementById(id).style.display 		= 'inline';
                        document.getElementById('tab_' + id).className 		= 'tab-hi';

                        this.oldtab=id;
			document.getElementById('initialtab').value = id;
			this.currentSectionNr= this.getTabByName(id);
                }

		this.getTabByNr = function(nr) {
			for (var itemNr=0; itemNr <= Sections.length; itemNr++) {
				if (Sections[itemNr] == Sections[nr]) {
					return (Sections[itemNr]);
				}
			}
		}

		this.getTabByName = function(name) {
			for (var itemNr=0; itemNr <= Sections.length; itemNr++) {
				if (Sections[itemNr] == name) {
					return (itemNr);
				}
			}
		}

		this.nextTab = function() {
			if (this.currentSectionNr < Sections.length-1) {
				nextTab=this.getTabByNr(this.currentSectionNr+1);
				this.toggle(nextTab);
			}
		}

		this.prevTab = function() {
			if (this.currentSectionNr >0) {
				prevTab=this.getTabByNr(this.currentSectionNr-1);
				this.toggle(prevTab);
			}
		}

		// Init Values

                this.oldtab=inittab;
		this.currentSectionNr= this.getTabByName(inittab);

	}
<?php
}