remove call of setFocus as currently not provided

This commit is contained in:
Klaus Leithoff 2013-04-18 13:00:41 +00:00
parent 8ffea421d2
commit 38e5f6e29e

View File

@ -1,13 +1,13 @@
<?php <?php
/** /**
* PHPGWAPI Dragdrop - generates javascript for Walter Zorns dragdrop class * PHPGWAPI Dragdrop - generates javascript for Walter Zorns dragdrop class
* *
* @link www.egroupware.org * @link www.egroupware.org
* @author Christian Binder <christian.binder@freakmail.de> * @author Christian Binder <christian.binder@freakmail.de>
* @copyright (c) 2006 by Christian Binder <christian.binder@freakmail.de> * @copyright (c) 2006 by Christian Binder <christian.binder@freakmail.de>
* @package phpgwapi * @package phpgwapi
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$ * @version $Id$
*/ */
require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.browser.inc.php'); require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.browser.inc.php');
@ -24,46 +24,46 @@ class dragdrop
{ {
/** /**
* draggable Objects * draggable Objects
* *
* @var array * @var array
*/ */
var $draggables; var $draggables;
/** /**
* droppable Objects * droppable Objects
* *
* @var array * @var array
*/ */
var $droppables; var $droppables;
/** /**
* custom DHTML Objects * custom DHTML Objects
* *
* @var array * @var array
*/ */
var $customs; var $customs;
/** /**
* ensures that function setJSCode is only run once * ensures that function setJSCode is only run once
* *
* @var boolean * @var boolean
*/ */
var $setCodeDone = false; var $setCodeDone = false;
/** /**
* JavaScript(s) to include which contains the actions while dragging or dropping * JavaScript(s) to include which contains the actions while dragging or dropping
* *
* @var array * @var array
*/ */
var $actionScripts; var $actionScripts;
/** /**
* enables class for all browsers - use this for testing still not validated browsers * enables class for all browsers - use this for testing still not validated browsers
* *
* @var boolean * @var boolean
*/ */
var $browserTestMode = false; var $browserTestMode = false;
function dragdrop() function dragdrop()
{ {
} }
@ -121,7 +121,7 @@ class dragdrop
/** /**
* generates the appropriate JSCode for all defined objects * generates the appropriate JSCode for all defined objects
* *
* @return boolean true if all actions succeed or false if the function was called more than once * @return boolean true if all actions succeed or false if the function was called more than once
*/ */
function setJSCode() function setJSCode()
{ {
@ -139,7 +139,7 @@ class dragdrop
error_log('phpgwapi.dragdrop::setJSCode called more than once - aborting'); error_log('phpgwapi.dragdrop::setJSCode called more than once - aborting');
return false; return false;
} }
$GLOBALS['egw_info']['flags']['need_footer'] .= "<!-- BEGIN JavaScript for wz_dragdrop.js -->\n"; $GLOBALS['egw_info']['flags']['need_footer'] .= "<!-- BEGIN JavaScript for wz_dragdrop.js -->\n";
// include wz_dragdrop once // include wz_dragdrop once
@ -148,7 +148,7 @@ class dragdrop
$GLOBALS['egw_info']['flags']['need_footer'] .= '<script language="JavaScript" type="text/javascript" src="'.$GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/wz_dragdrop/wz_dragdrop.js"></script>'."\n"; $GLOBALS['egw_info']['flags']['need_footer'] .= '<script language="JavaScript" type="text/javascript" src="'.$GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/wz_dragdrop/wz_dragdrop.js"></script>'."\n";
$GLOBALS['egw_info']['flags']['wz_dragdrop_included'] = true; $GLOBALS['egw_info']['flags']['wz_dragdrop_included'] = true;
} }
// include actionScripts // include actionScripts
if(is_array($this->actionScripts)) if(is_array($this->actionScripts))
{ {
@ -157,7 +157,7 @@ class dragdrop
$GLOBALS['egw_info']['flags']['need_footer'] .= '<script language="JavaScript" type="text/javascript" src="'.$actionScript['file'].'"></script>'."\n"; $GLOBALS['egw_info']['flags']['need_footer'] .= '<script language="JavaScript" type="text/javascript" src="'.$actionScript['file'].'"></script>'."\n";
} }
} }
// register all elements to wz_dragdrop // register all elements to wz_dragdrop
if(is_array($this->draggables)) if(is_array($this->draggables))
{ {
@ -187,7 +187,7 @@ class dragdrop
$GLOBALS['egw_info']['flags']['need_footer'] .= $this->DHTMLcommand().'('.$element_names.')'."\n"; $GLOBALS['egw_info']['flags']['need_footer'] .= $this->DHTMLcommand().'('.$element_names.')'."\n";
$GLOBALS['egw_info']['flags']['need_footer'] .= '</script>'."\n"; $GLOBALS['egw_info']['flags']['need_footer'] .= '</script>'."\n";
} }
// set special params for draggable elements // set special params for draggable elements
if(is_array($this->draggables)) if(is_array($this->draggables))
{ {
@ -206,7 +206,7 @@ class dragdrop
} }
if($element['dragAction']) { $GLOBALS['egw_info']['flags']['need_footer'] .= 'dd.elements.'.$element['name'].'.setDragFunc('.$element['dragAction'].');'."\n"; } if($element['dragAction']) { $GLOBALS['egw_info']['flags']['need_footer'] .= 'dd.elements.'.$element['name'].'.setDragFunc('.$element['dragAction'].');'."\n"; }
if($element['dropAction']) { $GLOBALS['egw_info']['flags']['need_footer'] .= 'dd.elements.'.$element['name'].'.setDropFunc('.$element['dropAction'].');'."\n"; } if($element['dropAction']) { $GLOBALS['egw_info']['flags']['need_footer'] .= 'dd.elements.'.$element['name'].'.setDropFunc('.$element['dropAction'].');'."\n"; }
if($element['focus']) { $GLOBALS['egw_info']['flags']['need_footer'] .= 'dd.elements.'.$element['name'].'.setFocus('.$element['focus'].');'."\n"; } //if($element['focus']) { $GLOBALS['egw_info']['flags']['need_footer'] .= 'dd.elements.'.$element['name'].'.setFocus('.$element['focus'].');'."\n"; }
} }
$GLOBALS['egw_info']['flags']['need_footer'] .= '</script>'."\n"; $GLOBALS['egw_info']['flags']['need_footer'] .= '</script>'."\n";
} }
@ -255,10 +255,10 @@ class dragdrop
} }
$GLOBALS['egw_info']['flags']['need_footer'] .= "<!-- END JavaScript for wz_dragdrop.js -->\n"; $GLOBALS['egw_info']['flags']['need_footer'] .= "<!-- END JavaScript for wz_dragdrop.js -->\n";
return $this->setCodeDone = true; return $this->setCodeDone = true;
} }
/** /**
* checks if the given name of an object is unique in all draggable,droppable and custom objects * checks if the given name of an object is unique in all draggable,droppable and custom objects
* *
@ -318,7 +318,7 @@ class dragdrop
{ {
error_log('dragdrop::validateBrowser, agent: ' . $clientBrowser->get_agent()); error_log('dragdrop::validateBrowser, agent: ' . $clientBrowser->get_agent());
} }
foreach(array('MOZILLA') as $id=>$validatedBrowser) foreach(array('MOZILLA') as $id=>$validatedBrowser)
{ {
if($this->browserTestMode || $clientBrowser->get_agent() == $validatedBrowser) if($this->browserTestMode || $clientBrowser->get_agent() == $validatedBrowser)
@ -326,10 +326,10 @@ class dragdrop
egw_framework::validate_file('wz_dragdrop', 'wz_dragdrop'); egw_framework::validate_file('wz_dragdrop', 'wz_dragdrop');
return true; return true;
} }
return false; return false;
} }
} }
/** /**
@ -345,7 +345,7 @@ class dragdrop
$script = $appname.'.'.$scriptname; $script = $appname.'.'.$scriptname;
$serverFile = EGW_INCLUDE_ROOT.'/'.$appname.'/js/'.$scriptname.'.js'; $serverFile = EGW_INCLUDE_ROOT.'/'.$appname.'/js/'.$scriptname.'.js';
$browserFile = $GLOBALS['egw_info']['server']['webserver_url'].'/'.$appname.'/js/'.$scriptname.'.js'; $browserFile = $GLOBALS['egw_info']['server']['webserver_url'].'/'.$appname.'/js/'.$scriptname.'.js';
// check if file exists otherwise exit // check if file exists otherwise exit
if(!file_exists($serverFile)) if(!file_exists($serverFile))
{ {
@ -359,7 +359,7 @@ class dragdrop
if($actionScript['script'] == $script) { return $functionname; } if($actionScript['script'] == $script) { return $functionname; }
} }
} }
$this->actionScripts[] = array('script' => $script,'file' => $browserFile); $this->actionScripts[] = array('script' => $script,'file' => $browserFile);
return $functionname; return $functionname;
} }