diff --git a/cfg/.gitignore b/cfg/.gitignore new file mode 100644 index 0000000000..00853a568b --- /dev/null +++ b/cfg/.gitignore @@ -0,0 +1 @@ +custom*.inc.php diff --git a/cfg/const.inc.php b/cfg/const.inc.php index 6e6394c36f..483bf79cf1 100644 --- a/cfg/const.inc.php +++ b/cfg/const.inc.php @@ -15,21 +15,23 @@ /* [GLOBAL SETTINGS] */ - define('TL_SMARTY_VERSION',3); // @since 1.9.8 +define('TL_JQUERY','third_party/jquery/jquery-3.4.1.min.js'); + /** TestLink Release version (MUST BE changed before the release day) */ -define('TL_VERSION_NUMBER', '1.9.20'); +define('TL_VERSION_NUMBER', '2.0.0'); define('TL_VERSION', TL_VERSION_NUMBER . ' [DEV] '); -define('TL_FACE_DIR', 'prague'); +define('TL_FACE_DIR', 'buenosaires'); /** Latest Database version that is used to give users feedback * about necesssary upgrades * if you set this parameter also upgrade * lib/functions/configCheck.php - checkSchemaVersion() */ -define('TL_LATEST_DB_VERSION', 'DB ' . '1.9.20'); +define('TL_LATEST_DB_VERSION', 'DB ' . '2.0.0'); -// needed to avoid problems in install scripts that do not include config.inc.php +// needed to avoid problems in install scripts +// that do not include config.inc.php // want to point to root install dir, need to remove fixed part if (!defined('TL_ABS_PATH')) { define('TL_ABS_PATH', str_replace('cfg','',dirname(__FILE__))); @@ -60,7 +62,7 @@ } -// -------------------------------------------------------------------------------- +// ----------------------------------------------------------------- /* [GENERAL MAGIC NUMBERS] */ /** PHPMAILER */ @@ -81,15 +83,9 @@ define('ERROR', 0 ); /** More Descriptive constant names */ -define('HIGH', 3 ); -define('MEDIUM', 2 ); -define('LOW', 1 ); - -/** user for notes - see BUGID 0002469: $tlCfg->exec_cfg->expand_collapse - very important do not change values, logic depends on values*/ -define('LAST_USER_CHOICE',2); -define('COLLAPSE', 0); -define('EXPAND',1 ); +define('HIGH', 3); +define('MEDIUM', 2); +define('LOW',1); // used in several functions instead of MAGIC NUMBERS - Don't change define('ALL_PRODUCTS', 0); @@ -962,6 +958,4 @@ define('USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS', 1); define('USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS',2); define('USE_LATEST_EXEC_ON_TESTPLAN_PLAT_FOR_COUNTERS',3); - - // END diff --git a/custom_config.inc.php.example b/cfg/samples/custom_config.inc.php.example similarity index 100% rename from custom_config.inc.php.example rename to cfg/samples/custom_config.inc.php.example diff --git a/custom_config.inc.php.example.github_oauth b/cfg/samples/custom_config.inc.php.example.github_oauth similarity index 100% rename from custom_config.inc.php.example.github_oauth rename to cfg/samples/custom_config.inc.php.example.github_oauth diff --git a/custom_config.inc.php.github.testlinkOauthProvider b/cfg/samples/custom_config.inc.php.github.testlinkOauthProvider similarity index 100% rename from custom_config.inc.php.github.testlinkOauthProvider rename to cfg/samples/custom_config.inc.php.github.testlinkOauthProvider diff --git a/custom_config.inc.php.google_oauth b/cfg/samples/custom_config.inc.php.google_oauth similarity index 100% rename from custom_config.inc.php.google_oauth rename to cfg/samples/custom_config.inc.php.google_oauth diff --git a/cfg/custom_reports.cfg.php.example b/cfg/samples/custom_reports.cfg.php.example similarity index 100% rename from cfg/custom_reports.cfg.php.example rename to cfg/samples/custom_reports.cfg.php.example diff --git a/config.inc.php b/config.inc.php index 30ea042637..16a6730c13 100644 --- a/config.inc.php +++ b/config.inc.php @@ -123,10 +123,11 @@ /** Include constants and magic numbers (users should not change it)*/ -require_once(TL_ABS_PATH . 'cfg' . DIRECTORY_SEPARATOR . 'const.inc.php'); +$cfgPath = TL_ABS_PATH . 'cfg' . DIRECTORY_SEPARATOR; +require_once($cfgPath . 'const.inc.php'); -// ---------------------------------------------------------------------------- +// -------------------------------------------------------------- /** @var string used to have (when needed) a possibility to identify different TL instances @since 1.9.4 used on mail subject when mail logger is used */ @@ -148,7 +149,7 @@ * @see $tlCfg->cookie->path * @global string $tlCfg->cookie->prefix */ -$tlCfg->cookie->prefix = 'TESTLINK1920'; +$tlCfg->cookie->prefix = 'TESTLINK200'; /** * @link http://php.net/function.setcookie @@ -1138,15 +1139,23 @@ // 'latest' => latest execution notes. $tlCfg->exec_cfg->steps_exec_status_default = 'empty'; -// Parameters to show notes/details when entering test execution feature -// EXPAND: show expanded/open -// COLLAPSE: show collapsed/closede -// LAST_USER_CHOICE: get status from cookie that holds last user choice.[STANDARD BEHAVIOUR] +// Parameters to show notes/details +// when entering test execution feature +// 'EXPAND': show expanded/open +// 'COLLAPSE': show collapsed/closed +// 'LAST_USER_CHOICE': +// get status from cookie that holds +// latest user choice. +// This is the [STANDARD BEHAVIOUR] $tlCfg->exec_cfg->expand_collapse = new stdClass(); -$tlCfg->exec_cfg->expand_collapse->testplan_notes = LAST_USER_CHOICE; -$tlCfg->exec_cfg->expand_collapse->platform_description = LAST_USER_CHOICE; -$tlCfg->exec_cfg->expand_collapse->build_description = LAST_USER_CHOICE; -$tlCfg->exec_cfg->expand_collapse->testsuite_details = LAST_USER_CHOICE; +$tlCfg->exec_cfg->expand_collapse + ->testplan_notes = 'LAST_USER_CHOICE'; +$tlCfg->exec_cfg->expand_collapse + ->platform_description = 'LAST_USER_CHOICE'; +$tlCfg->exec_cfg->expand_collapse + ->build_description = 'LAST_USER_CHOICE'; +$tlCfg->exec_cfg->expand_collapse + ->testsuite_details = 'LAST_USER_CHOICE'; @@ -2045,7 +2054,7 @@ -// ---------------------------------------------------------------------------- +// ------------------------------------------------------------- /* [PROXY] */ /* Used only */ /* mantissoapInterface.class.php */ @@ -2060,22 +2069,23 @@ /** Plugins feature */ define('TL_PLUGIN_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR); -// ----- End of Config ------------------------------------------------------------------ -// -------------------------------------------------------------------------------------- +// ----- End of Config ---------------------------------------- + +// ------------------------------------------------------------ // DO NOT DO CHANGES BELOW -// -------------------------------------------------------------------------------------- +// ------------------------------------------------------------ /** Functions for check request status */ require_once('configCheck.php'); - -if( !defined('TL_JQUERY') ) -{ - define('TL_JQUERY','jquery-2.2.4.min.js' ); +/** + * @see also cfg/const.inc.php + */ +if (!defined('TL_JQUERY')) { + define('TL_JQUERY','third_party/jquery/jquery-3.4.1.min.js'); } -if( !defined('TL_DATATABLES_DIR') ) -{ +if (!defined('TL_DATATABLES_DIR')) { define('TL_DATATABLES_DIR','DataTables-1.10.4' ); } @@ -2085,9 +2095,8 @@ define('TL_BASE_HREF', get_home_url(array('force_https' => $tlCfg->force_https))); clearstatcache(); -if ( file_exists( TL_ABS_PATH . 'custom_config.inc.php' ) ) -{ - require_once( TL_ABS_PATH . 'custom_config.inc.php' ); +if ( file_exists( $cfgPath . 'custom_config.inc.php' ) ) { + require_once( $cfgPath . 'custom_config.inc.php' ); } diff --git a/error.php b/error.php index 4a93506362..ae17c98847 100644 --- a/error.php +++ b/error.php @@ -6,53 +6,41 @@ * General purpose error page. * * @package TestLink - * @copyright 2012,2019 TestLink community + * @copyright 2012 TestLink community * * @internal revisions - * @used by: kinow - TICKET 4977 - CSRF - Advisory ID: HTB23088 + * @since 1.9.4 + * 20120703 - kinow - TICKET 4977 - CSRF - Advisory ID: HTB23088 * **/ require_once('config.inc.php'); require_once('common.php'); -/** - * - */ -function init_args() { - - $args = new stdClass(); - $args->message = 'Rocket Raccoon is watching You'; - $code = isset($_REQUEST['code']) ? $_REQUEST['code'] : 0; - - switch($code) { - case 1: - $args->message = 'No CSRFName found, probable invalid request.'; - break; - - case 2: - $args->message = 'Invalid CSRF token'; - break; - - default: - break; - } - - return $args; +function init_args() +{ + $iParams = array( + 'message' => array(tlInputParameter::STRING_N,0,255) + ); + $pParams = R_PARAMS($iParams); + $args = new stdClass(); + if(isset($pParams['message'])) { + $args->message = $pParams['message']; + } + return $args; } -/** - * - */ -function init_gui($args) { - $gui = new stdClass(); - $gui->message = ''; - - if(isset($args->message) { - $gui->message = $args->message; - } - - return $gui; +function init_gui($args) +{ + $gui = new stdClass(); + if(isset($args->message)) + { + $gui->message = $args->message; + } else { + $gui->message = ''; + } + + return $gui; } $templateCfg = templateConfiguration(); @@ -61,4 +49,6 @@ function init_gui($args) { $smarty = new TLSmarty(); $smarty->assign('gui', $gui); -$smarty->display($templateCfg->default_template); \ No newline at end of file +$smarty->display($templateCfg->default_template); + +?> diff --git a/firstLogin.php b/firstLogin.php index a7febf3842..b0053fe74d 100644 --- a/firstLogin.php +++ b/firstLogin.php @@ -5,9 +5,10 @@ * * @filesource firstLogin.php * @package TestLink - * @copyright 2004-2019, TestLink community + * @copyright 2004-2016, TestLink community * @link http://www.testlink.org * + * */ require_once('config.inc.php'); require_once('common.php'); @@ -20,7 +21,8 @@ $args = init_args(); $gui = $args; -if (!config_get('user_self_signup')) { +if (!config_get('user_self_signup')) +{ $smarty = new TLSmarty(); $smarty->assign('title', lang_get('fatal_page_title')); $smarty->assign('content', lang_get('error_self_signup_disabled')); @@ -32,15 +34,21 @@ doDBConnect($db,database::ONERROREXIT); $message = ''; //lang_get('your_info_please'); -if( !is_null($args->doEditUser) ) { - if(strcmp($args->password,$args->password2)) { +if( !is_null($args->doEditUser) ) +{ + if(strcmp($args->password,$args->password2)) + { $message = lang_get('passwd_dont_match'); - } else { + } + else + { $user = new tlUser(); $rx = $user->checkPasswordQuality($args->password); - if( $rx['status_ok'] >= tl::OK ) { + if( $rx['status_ok'] >= tl::OK ) + { $result = $user->setPassword($args->password); - if ($result >= tl::OK) { + if ($result >= tl::OK) + { $user->login = $args->login; $user->emailAddress = $args->email; $user->firstName = $args->firstName; @@ -48,7 +56,8 @@ $result = $user->writeToDB($db); $cfg = config_get('notifications'); - if($cfg->userSignUp->enabled) { + if($cfg->userSignUp->enabled) + { notifyGlobalAdmins($db,$user); } logAuditEvent(TLS("audit_users_self_signup",$args->login),"CREATE",$user->dbID,"users"); @@ -56,10 +65,14 @@ $url2go = "login.php?viewer={$gui->viewer}¬e=first"; redirect(TL_BASE_HREF . $url2go); exit(); - } else { + } + else + { $message = getUserErrorMessage($result); } - } else { + } + else + { $message = $rx['msg']; } } @@ -72,11 +85,11 @@ $gui->message = $message; $smarty->assign('gui',$gui); -$tpl = str_replace('.php','.tpl',basename($_SERVER['SCRIPT_NAME'])); +// $tpl = str_replace('.php','.tpl',basename($_SERVER['SCRIPT_NAME'])); if( $args->viewer == 'new' ) { - $tpl='firstLogin-model-marcobiedermann.tpl'; + $tpl='login/firstLogin-model-marcobiedermann.tpl'; } -$tpl = 'login/' . $tpl; + $smarty->display($tpl); diff --git a/gui/drag_and_drop/css/context-menu.css b/gui/drag_and_drop/css/context-menu.css deleted file mode 100644 index 160c2a11ac..0000000000 --- a/gui/drag_and_drop/css/context-menu.css +++ /dev/null @@ -1,57 +0,0 @@ -/************************************************************************************************************ - - DHTML Suite for Applications - (C) www.dhtmlgoodies.com, August 2006 - - CSS for the context menu class. - - Terms of use: - Look at the terms of use at http://www.dhtmlgoodies.com/index.html?page=termsOfUse - - Thank you! - - www.dhtmlgoodies.com - Alf Magne Kalleland - -************************************************************************************************************/ - -.DHTMLSuite_contextMenu{ /* The bar that is parent of the menu strip */ - position:absolute; - background-color:#FFF; - border:1px solid #000; - padding:1px; -} - -.DHTMLSuite_contextMenu li{ - list-style-type:none; - padding:1px; /* Equal to border + padding of .DHTMLSuite_item_mouseover */ - border:0px; - cursor: pointer; - background-repeat:no-repeat; - background-position:left center; -} -.DHTMLSuite_contextMenu .DHTMLSuite_item_mouseover{ - border:1px solid #000; - background-color:#EEE; - padding:0px; /* Padding + border of this element should be equal to padding of li element (see above ) */ -} -.DHTMLSuite_contextMenu ul{ - margin:0px; - padding:0px; -} - -.DHTMLSuite_contextMenu a{ - text-decoration:none; - color:#000; - padding-left:25px; -} - -.DHTMLSuite_contextMenu div.DHTMLSuite_contextMenu_separator{ /* Css for the separator line */ - height:1px; - line-height:1px; - padding:0px; - background-color: #AAA; - overflow:hidden; - margin-top:1px; - margin-bottom:1px; -} diff --git a/gui/drag_and_drop/css/drag-drop-folder-tree.css b/gui/drag_and_drop/css/drag-drop-folder-tree.css deleted file mode 100644 index 64d68628dd..0000000000 --- a/gui/drag_and_drop/css/drag-drop-folder-tree.css +++ /dev/null @@ -1,56 +0,0 @@ - p{ - font-family:arial; - - } - a{ - color:#000; - font-family:arial; - font-size:0.8em; - } - - .dhtmlgoodies_tree,#floatingContainer{ - margin:0px; - padding:0px; - } - .dhtmlgoodies_tree ul{ /* Sub menu groups */ - margin-left:20px; /* Left spacing */ - padding-left:0px; - display:none; /* Initially hide sub nodes */ - } - - #floatingContainer ul{ - margin-left:20px; /* Left spacing */ - padding-left:0px; - } - .dhtmlgoodies_tree li,#floatingContainer li{ /* Nodes */ - list-style-type:none; - vertical-align:middle; - - } - .dhtmlgoodies_tree li a,#floatingContainer li a{ /* Node links */ - color:#000; - text-decoration:none; - font-family:arial; - font-size:0.8em; - padding-left:1px; - line-height:13px; - margin-left:2px; - - } - .dhtmlgoodies_tree li a.highlightedNodeItem{ - color:#FFF; - background-color:#009; - } - - - body{ - margin:0px; - padding:0px; - } - - .dhtmlgoodies_tree input.folderTreeTextBox{ /* Css for the text input - rename item */ - font-size:10px; - margin:0px; - padding:0px; - height:12px; - } \ No newline at end of file diff --git a/gui/drag_and_drop/images/context-menu-gradient.gif b/gui/drag_and_drop/images/context-menu-gradient.gif deleted file mode 100644 index fe9681ae46..0000000000 Binary files a/gui/drag_and_drop/images/context-menu-gradient.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/dhtmlgoodies_folder.gif b/gui/drag_and_drop/images/dhtmlgoodies_folder.gif deleted file mode 100644 index d953eda310..0000000000 Binary files a/gui/drag_and_drop/images/dhtmlgoodies_folder.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/dhtmlgoodies_minus.gif b/gui/drag_and_drop/images/dhtmlgoodies_minus.gif deleted file mode 100644 index bd770fab5d..0000000000 Binary files a/gui/drag_and_drop/images/dhtmlgoodies_minus.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/dhtmlgoodies_plus.gif b/gui/drag_and_drop/images/dhtmlgoodies_plus.gif deleted file mode 100644 index 112cd60059..0000000000 Binary files a/gui/drag_and_drop/images/dhtmlgoodies_plus.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/dhtmlgoodies_sheet.gif b/gui/drag_and_drop/images/dhtmlgoodies_sheet.gif deleted file mode 100644 index b938d1329d..0000000000 Binary files a/gui/drag_and_drop/images/dhtmlgoodies_sheet.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/dragDrop_ind1.gif b/gui/drag_and_drop/images/dragDrop_ind1.gif deleted file mode 100644 index 2f9bf5a658..0000000000 Binary files a/gui/drag_and_drop/images/dragDrop_ind1.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/dragDrop_ind2.gif b/gui/drag_and_drop/images/dragDrop_ind2.gif deleted file mode 100644 index a1da63108a..0000000000 Binary files a/gui/drag_and_drop/images/dragDrop_ind2.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/folder_close.gif b/gui/drag_and_drop/images/folder_close.gif deleted file mode 100644 index bba11d3901..0000000000 Binary files a/gui/drag_and_drop/images/folder_close.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/folder_dots.gif b/gui/drag_and_drop/images/folder_dots.gif deleted file mode 100644 index db93fd9279..0000000000 Binary files a/gui/drag_and_drop/images/folder_dots.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/folder_folder.gif b/gui/drag_and_drop/images/folder_folder.gif deleted file mode 100644 index ef555b7aee..0000000000 Binary files a/gui/drag_and_drop/images/folder_folder.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/folder_lastsub.gif b/gui/drag_and_drop/images/folder_lastsub.gif deleted file mode 100644 index 6e12244578..0000000000 Binary files a/gui/drag_and_drop/images/folder_lastsub.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/folder_open.gif b/gui/drag_and_drop/images/folder_open.gif deleted file mode 100644 index b6d60b84b2..0000000000 Binary files a/gui/drag_and_drop/images/folder_open.gif and /dev/null differ diff --git a/gui/drag_and_drop/images/folder_sub.gif b/gui/drag_and_drop/images/folder_sub.gif deleted file mode 100644 index e3c8e44ec1..0000000000 Binary files a/gui/drag_and_drop/images/folder_sub.gif and /dev/null differ diff --git a/gui/drag_and_drop/js/ajax.js b/gui/drag_and_drop/js/ajax.js deleted file mode 100644 index f93f2a429c..0000000000 --- a/gui/drag_and_drop/js/ajax.js +++ /dev/null @@ -1,193 +0,0 @@ -/* Simple AJAX Code-Kit (SACK) v1.6.1 */ -/* ©2005 Gregory Wild-Smith */ -/* www.twilightuniverse.com */ -/* Software licenced under a modified X11 licence, - see documentation or authors website for more details */ - -function sack(file) { - this.xmlhttp = null; - - this.resetData = function() { - this.method = "POST"; - this.queryStringSeparator = "?"; - this.argumentSeparator = "&"; - this.URLString = ""; - this.encodeURIString = true; - this.execute = false; - this.element = null; - this.elementObj = null; - this.requestFile = file; - this.vars = new Object(); - this.responseStatus = new Array(2); - }; - - this.resetFunctions = function() { - this.onLoading = function() { }; - this.onLoaded = function() { }; - this.onInteractive = function() { }; - this.onCompletion = function() { }; - this.onError = function() { }; - this.onFail = function() { }; - }; - - this.reset = function() { - this.resetFunctions(); - this.resetData(); - }; - - this.createAJAX = function() { - try { - this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e1) { - try { - this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (e2) { - this.xmlhttp = null; - } - } - - if (! this.xmlhttp) { - if (typeof XMLHttpRequest != "undefined") { - this.xmlhttp = new XMLHttpRequest(); - } else { - this.failed = true; - } - } - }; - - this.setVar = function(name, value){ - this.vars[name] = Array(value, false); - }; - - this.encVar = function(name, value, returnvars) { - if (true == returnvars) { - return Array(encodeURIComponent(name), encodeURIComponent(value)); - } else { - this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true); - } - } - - this.processURLString = function(string, encode) { - encoded = encodeURIComponent(this.argumentSeparator); - regexp = new RegExp(this.argumentSeparator + "|" + encoded); - varArray = string.split(regexp); - for (i = 0; i < varArray.length; i++){ - urlVars = varArray[i].split("="); - if (true == encode){ - this.encVar(urlVars[0], urlVars[1]); - } else { - this.setVar(urlVars[0], urlVars[1]); - } - } - } - - this.createURLString = function(urlstring) { - if (this.encodeURIString && this.URLString.length) { - this.processURLString(this.URLString, true); - } - - if (urlstring) { - if (this.URLString.length) { - this.URLString += this.argumentSeparator + urlstring; - } else { - this.URLString = urlstring; - } - } - - // prevents caching of URLString - this.setVar("rndval", new Date().getTime()); - - urlstringtemp = new Array(); - for (key in this.vars) { - if (false == this.vars[key][1] && true == this.encodeURIString) { - encoded = this.encVar(key, this.vars[key][0], true); - delete this.vars[key]; - this.vars[encoded[0]] = Array(encoded[1], true); - key = encoded[0]; - } - - urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0]; - } - if (urlstring){ - this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator); - } else { - this.URLString += urlstringtemp.join(this.argumentSeparator); - } - } - - this.runResponse = function() { - eval(this.response); - } - - this.runAJAX = function(urlstring) { - if (this.failed) { - this.onFail(); - } else { - this.createURLString(urlstring); - if (this.element) { - this.elementObj = document.getElementById(this.element); - } - if (this.xmlhttp) { - var self = this; - if (this.method == "GET") { - totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString; - this.xmlhttp.open(this.method, totalurlstring, true); - } else { - this.xmlhttp.open(this.method, this.requestFile, true); - try { - this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") - } catch (e) { } - } - - this.xmlhttp.onreadystatechange = function() { - switch (self.xmlhttp.readyState) { - case 1: - self.onLoading(); - break; - case 2: - self.onLoaded(); - break; - case 3: - self.onInteractive(); - break; - case 4: - self.response = self.xmlhttp.responseText; - self.responseXML = self.xmlhttp.responseXML; - self.responseStatus[0] = self.xmlhttp.status; - self.responseStatus[1] = self.xmlhttp.statusText; - - if (self.execute) { - self.runResponse(); - } - - if (self.elementObj) { - elemNodeName = self.elementObj.nodeName; - elemNodeName.toLowerCase(); - if (elemNodeName == "input" - || elemNodeName == "select" - || elemNodeName == "option" - || elemNodeName == "textarea") { - self.elementObj.value = self.response; - } else { - self.elementObj.innerHTML = self.response; - } - } - if (self.responseStatus[0] == "200") { - self.onCompletion(); - } else { - self.onError(); - } - - self.URLString = ""; - break; - } - }; - - this.xmlhttp.send(this.URLString); - } - } - }; - - this.reset(); - this.createAJAX(); -} diff --git a/gui/drag_and_drop/js/context-menu.js b/gui/drag_and_drop/js/context-menu.js deleted file mode 100644 index 8bcbb84cc4..0000000000 --- a/gui/drag_and_drop/js/context-menu.js +++ /dev/null @@ -1,419 +0,0 @@ -DHTMLGoodies_menuModel = function() -{ - var menuItems; - this.menuItems = new Array(); - - -} - -/************************************************************************************************************ -* DHTML menu model class -* -* Created: October, 30th, 2006 -* @class Purpose of class: Saves menu item data -* -* -* Demos of this class: demo-menu-strip.html -* -* Update log: -* -************************************************************************************************************/ - - -/** -* @constructor -* @class Purpose of class: Organize menu items for different menu widgets. demos of menus: (Demo) -* @version 1.0 -* @author Alf Magne Kalleland(www.dhtmlgoodies.com) -*/ - - -DHTMLGoodies_menuModel.prototype = { - // {{{ addItem() - /** - * Add separator (special type of menu item) - * - * @param int id of menu item - * @param string itemText = text of menu item - * @param string itemIcon = file name of menu icon(in front of menu text. Path will be imagePath for the DHTMLSuite + file name) - * @param string url = Url of menu item - * @param int parent id of menu item - * @param String jsFunction Name of javascript function to execute. It will replace the url param. The function with this name will be called and the element triggering the action will be - * sent as argument. Name of the element which triggered the menu action may also be sent as a second argument. That depends on the widget. The context menu is an example where - * the element triggering the context menu is sent as second argument to this function. - * - * @public - */ - addItem : function(id,itemText,itemIcon,url,parentId,jsFunction) - { - this.menuItems[id] = new Array(); - this.menuItems[id]['id'] = id; - this.menuItems[id]['itemText'] = itemText; - this.menuItems[id]['itemIcon'] = itemIcon; - this.menuItems[id]['url'] = url; - this.menuItems[id]['parentId'] = parentId; - this.menuItems[id]['separator'] = false; - this.menuItems[id]['jsFunction'] = jsFunction; - - } - , - // {{{ addSeparator() - /** - * Add separator (special type of menu item) - * - * @param int id of menu item - * @param int parent id of menu item - * @public - */ - addSeparator : function(id,parentId) - { - this.menuItems[id] = new Array(); - this.menuItems[id]['parentId'] = parentId; - this.menuItems[id]['separator'] = true; - } - , - // {{{ init() - /** - * Initilizes the menu model. This method should be called when all items has been added to the model. - * - * - * @public - */ - init : function() - { - this.__getDepths(); - - } - // }}} - , - // {{{ __getDepths() - /** - * Create variable for the depth of each menu item. - * - * - * @private - */ - getItems : function() - { - return this.menuItems; - } - - , - // {{{ __getDepths() - /** - * Create variable for the depth of each menu item. - * - * - * @private - */ - __getDepths : function() - { - for(var no in this.menuItems){ - this.menuItems[no]['depth'] = 1; - if(this.menuItems[no]['parentId']){ - this.menuItems[no]['depth'] = this.menuItems[this.menuItems[no]['parentId']]['depth']+1; - } - } - } - , - // {{{ __hasSubs() - /** - * Does a menu item have sub elements ? - * - * - * @private - */ - // }}} - __hasSubs : function(id) - { - for(var no in this.menuItems){ // Looping through menu items - if(this.menuItems[no]['parentId']==id)return true; - } - return false; - } - - -} - - - -var referenceToDHTMLSuiteContextMenu; - - -DHTMLGoodies_contextMenu = function() -{ - var menuModels; - var menuItems; - var menuObject; // Reference to context menu div - var layoutCSS; - var menuUls; // Array of