[Mapbender-commits] r2237 - branches/2.5/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Mar 13 10:23:06 EDT 2008
Author: christoph
Date: 2008-03-13 10:23:05 -0400 (Thu, 13 Mar 2008)
New Revision: 2237
Removed:
branches/2.5/http/javascripts/mod_tab_translation.php
Log:
obsolete
Deleted: branches/2.5/http/javascripts/mod_tab_translation.php
===================================================================
--- branches/2.5/http/javascripts/mod_tab_translation.php 2008-03-13 12:44:28 UTC (rev 2236)
+++ branches/2.5/http/javascripts/mod_tab_translation.php 2008-03-13 14:23:05 UTC (rev 2237)
@@ -1,179 +0,0 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_tab.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/********** Configuration*************************************************/
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__).'/../extensions/JSON.php');
-require_once(dirname(__FILE__).'/../include/dyn_js.php');
-
-$tab_ids = array();
-require_once(dirname(__FILE__).'/../include/dyn_php.php');
-
-
-echo "var tab_titles = [];\n";
-for ($i=0; $i < count($tab_ids); $i++) {
- $sql = "SELECT gettext(e_title) AS e_title FROM gui_element WHERE fkey_gui_id = $1 AND e_id = $2";
- $v = array($gui_id, $tab_ids[$i]);
- $t = array("s", "s");
- $res = db_prep_query($sql, $v, $t);
- $row = db_fetch_array($res);
- echo "tab_titles[" . $i . "] = '" . $row["e_title"] . "';\n";
-}
-
-$json = new Services_JSON();
-$output = $json->encode($tab_ids);
-
-echo "var tab_ids = " . $output . ";";
-
-?>
-var tab_height = false;
-var tab_width = false;
-var tab_topOffset = false;
-var tab_leftOffset = false;
-var tab_active = -1;
-var tab_check = new Array();
-var tab_iv1 = false;
-var tab_wait = false;
-
-try{
- if (open_tab){}
-}
-catch(e){
- open_tab = false;
-}
-
-/********** Configuration*************************************************/
-mb_registerInitFunctions('tab_init()');
-function tab_init(){
- var obj = document.getElementById("tabs").style;
- tab_topOffset = parseInt(obj.top);
- tab_leftOffset = parseInt(obj.left);
- tab_width = parseInt(obj.width);
- tab_height = parseInt(obj.height);
- var str = "";
-
- for(var i = 0; i<tab_ids.length; i++){
- document.getElementById(tab_ids[i]).style.visibility = 'hidden';
- tab_titles[i] = tab_prefix + tab_titles[i];
- var newId = "tab_" + i;
- str += "<div id='"+newId+"' ";
- str += "style='";
- str += tab_style;
- str += "width:"+tab_width+"px;";
- str += "height:"+tab_height+"px;";
- str += "top:" + ((i * tab_height)) + "px;";
- str += "'";
- str += " onclick='tab_set("+i+")'>";
- str += tab_titles[i];
- str += "</div>";
- }
- document.getElementById("tabs").innerHTML = str;
-
- if (open_tab != 'false'){
- tab_set(open_tab);
- }
-}
-function tab_set(ind){
- if(tab_wait){
- return;
- }
- tab_unsetFrame();
- if(ind == tab_active){
- tab_wait = true;
- tab_active = -1;
- tab_check = new Array();
- tab_iv1 = setInterval("tab_move("+tab_active+")",1);
- return;
- }
- else{
- tab_wait = true;
- tab_active = ind;
- tab_check = new Array();
- tab_iv1 = setInterval("tab_move("+tab_active+")",1);
- return;
- }
-}
-function tab_setFrame(ind){
- for(var i = 0; i<tab_ids.length; i++){
- if(i == ind){
- var obj = document.getElementById(tab_ids[i]).style;
- var newpos = ((i+1) * tab_height) + parseInt(tab_topOffset);
- obj.top = (newpos + 1) + "px";
- obj.left = (tab_leftOffset) + "px";
- obj.width = tab_width;
- obj.height = (parseInt(tab_frameHeight[ind]) - 2);
- obj.visibility = 'visible';
- }
- }
-}
-function tab_unsetFrame(){
- for(var i = 0; i<tab_ids.length; i++){
- var obj = document.getElementById(tab_ids[i]).style;
- obj.visibility = 'hidden';
- }
-}
-function tab_open(tabid){
- var t = false;
- for(var i = 0; i<tab_ids.length; i++){
- if(tab_ids[i] == tabid){
- t = i;
- }
- }
- if(tab_active != t){
- tab_set(t);
- }
-}
-function tab_move(ind){
- for(var i = 0; i<tab_ids.length; i++){
- var newpos = (i * tab_height);
- if(i > ind && tab_active >= 0){
- newpos += parseInt(tab_frameHeight[ind]);
- }
- var myid = "tab_" + i;
- var pos = parseInt(document.getElementById(myid).style.top);
- if(pos == newpos){
- tab_check[i] = true;
- }
- else if(pos < newpos){
- document.getElementById(myid).style.top = (pos + 10) + "px";
- tab_check[i] = false;
- }
- else if(pos > newpos){
- document.getElementById(myid).style.top = (pos - 10) + "px";
- tab_check[i] = false;
- }
- }
-
- var check = true;
- for(var j=0; j<tab_check.length; j++){
- if(tab_check[j] == false){
- check = false;
- }
- }
- if(check == true){
- clearInterval(tab_iv1);
- tab_check = new Array();
- tab_wait = false;
- if(ind >= 0){
- tab_setFrame(ind);
- }
- return;
- }
-}
\ No newline at end of file
More information about the Mapbender_commits
mailing list