This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

View File

@@ -0,0 +1,167 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('modules/Administration/Common.php');
class DropDownHelper{
var $modules = array();
function getDropDownModules(){
$dir = dir('modules');
while($entry = $dir->read()){
if(file_exists('modules/'. $entry . '/EditView.php')){
$this->scanForDropDowns('modules/'. $entry . '/EditView.php', $entry);
}
}
}
function scanForDropDowns($filepath, $module){
$contents = file_get_contents($filepath);
$matches = array();
preg_match_all('/app_list_strings\s*\[\s*[\'\"]([^\]]*)[\'\"]\s*]/', $contents, $matches);
if(!empty($matches[1])){
foreach($matches[1] as $match){
$this->modules[$module][$match] = $match;
}
}
}
/**
* Allow for certain dropdowns to be filtered when edited by pre 5.0 studio (eg. Rename Tabs)
*
* @param string name
* @param array dropdown
* @return array Filtered dropdown list
*/
function filterDropDown($name,$dropdown)
{
$results = array();
switch ($name)
{
//When renaming tabs ensure that the modList dropdown is filtered properly.
case 'moduleList':
$hiddenModList = array_flip($GLOBALS['modInvisList']);
$moduleList = array_flip($GLOBALS['moduleList']);
foreach ($dropdown as $k => $v)
{
if( isset($moduleList[$k]) && !$hiddenModList[$k])
$results[$k] = $v;
}
break;
default: //By default perform no filtering
$results = $dropdown;
}
return $results;
}
/**
* Takes in the request params from a save request and processes
* them for the save.
*
* @param REQUEST params $params
*/
function saveDropDown($params){
$count = 0;
$dropdown = array();
$dropdown_name = $params['dropdown_name'];
$selected_lang = (!empty($params['dropdown_lang'])?$params['dropdown_lang']:$_SESSION['authenticated_user_language']);
$my_list_strings = return_app_list_strings_language($selected_lang);
while(isset($params['slot_' . $count])){
$index = $params['slot_' . $count];
$key = (isset($params['key_' . $index]))?$params['key_' . $index]: 'BLANK';
$value = (isset($params['value_' . $index]))?$params['value_' . $index]: '';
if($key == 'BLANK'){
$key = '';
}
$key = trim($key);
$value = trim($value);
if(empty($params['delete_' . $index])){
$dropdown[$key] = $value;
}
$count++;
}
if($selected_lang == $GLOBALS['current_language']){
$GLOBALS['app_list_strings'][$dropdown_name] = $dropdown;
}
$contents = return_custom_app_list_strings_file_contents($selected_lang);
//get rid of closing tags they are not needed and are just trouble
$contents = str_replace("?>", '', $contents);
if(empty($contents))$contents = "<?php";
//add new drop down to the bottom
if(!empty($params['use_push'])){
//this is for handling moduleList and such where nothing should be deleted or anything but they can be renamed
foreach($dropdown as $key=>$value){
//only if the value has changed or does not exist do we want to add it this way
if(!isset($my_list_strings[$dropdown_name][$key]) || strcmp($my_list_strings[$dropdown_name][$key], $value) != 0 ){
//clear out the old value
$pattern_match = '/\s*\$app_list_strings\s*\[\s*\''.$dropdown_name.'\'\s*\]\[\s*\''.$key.'\'\s*\]\s*=\s*[\'\"]{1}.*?[\'\"]{1};\s*/ism';
$contents = preg_replace($pattern_match, "\n", $contents);
//add the new ones
$contents .= "\n\$app_list_strings['$dropdown_name']['$key']=" . var_export_helper($value) . ";";
}
}
}else{
//clear out the old value
$pattern_match = '/\s*\$app_list_strings\s*\[\s*\''.$dropdown_name.'\'\s*\]\s*=\s*array\s*\([^\)]*\)\s*;\s*/ism';
$contents = preg_replace($pattern_match, "\n", $contents);
//add the new ones
$contents .= "\n\$app_list_strings['$dropdown_name']=" . var_export_helper($dropdown) . ";";
}
save_custom_app_list_strings_contents($contents, $selected_lang);
sugar_cache_reset();
}
}
?>

View File

@@ -0,0 +1,142 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $app_list_strings, $app_strings, $mod_strings;
require_once('modules/Studio/DropDowns/DropDownHelper.php');
require_once('modules/Studio/parsers/StudioParser.php');
$dh = new DropDownHelper();
$dh->getDropDownModules();
$smarty = new Sugar_Smarty();
$smarty->assign('MOD', $GLOBALS['mod_strings']);
$title=get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_RENAME_TABS'], true);
$smarty->assign('title', $title);
$selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']);
if(empty($selected_lang)){
$selected_lang = $GLOBALS['sugar_config']['default_language'];
}
if($selected_lang == $GLOBALS['current_language']){
$my_list_strings = $GLOBALS['app_list_strings'];
}else{
$my_list_strings = return_app_list_strings_language($selected_lang);
}
foreach($my_list_strings as $key=>$value){
if(!is_array($value)){
unset($my_list_strings[$key]);
}
}
$modules = array_keys($dh->modules);
$dropdown_modules = array(''=>$GLOBALS['mod_strings']['LBL_DD_ALL']);
foreach($modules as $module){
$dropdown_modules[$module] = (!empty($app_list_strings['moduleList'][$module]))?$app_list_strings['moduleList'][$module]: $module;
}
$smarty->assign('dropdown_modules',$dropdown_modules);
if(!empty($_REQUEST['dropdown_module']) && !empty($dropdown_modules[$_REQUEST['dropdown_module']]) ){
$smarty->assign('dropdown_module',$_REQUEST['dropdown_module']);
$dropdowns = (!empty($dh->modules[$_REQUEST['dropdown_module']]))?$dh->modules[$_REQUEST['dropdown_module']]: array();
foreach($dropdowns as $ok=>$dk){
if(!isset($my_list_strings[$dk]) || !is_array($my_list_strings[$dk])){
unset($dropdowns[$ok]);
}
}
}else{
if(!empty($_REQUEST['dropdown_module'])){
$smarty->assign('error', 'Module does not have any known dropdowns');
}
$dropdowns = array_keys($my_list_strings);
}
asort($dropdowns);
if(!empty($_REQUEST['newDropdown'])){
$smarty->assign('newDropDown',true);
}else{
$keys = array_keys($dropdowns);
$first_string = $dropdowns[$keys[0]];
$smarty->assign('dropdowns',$dropdowns);
if(empty($_REQUEST['dropdown_name']) || !in_array($_REQUEST['dropdown_name'], $dropdowns)){
$_REQUEST['dropdown_name'] = $first_string;
}
$selected_dropdown = $my_list_strings[$_REQUEST['dropdown_name']];
foreach($selected_dropdown as $key=>$value){
if($selected_lang != $_SESSION['authenticated_user_language'] && !empty($app_list_strings[$_REQUEST['dropdown_name']]) && isset($app_list_strings[$_REQUEST['dropdown_name']][$key])){
$selected_dropdown[$key]=array('lang'=>$value, 'user_lang'=> '['.$app_list_strings[$_REQUEST['dropdown_name']][$key] . ']');
}else{
$selected_dropdown[$key]=array('lang'=>$value);
}
}
$selected_dropdown = $dh->filterDropDown($_REQUEST['dropdown_name'], $selected_dropdown);
$smarty->assign('dropdown', $selected_dropdown);
$smarty->assign('dropdown_name',$_REQUEST['dropdown_name']);
}
$smarty->assign('dropdown_languages', get_languages());
if(strcmp($_REQUEST['dropdown_name'], 'moduleList') == 0){
$smarty->assign('disable_remove', true);
$smarty->assign('disable_add', true);
$smarty->assign('use_push', 1);
}else{
$smarty->assign('use_push', 0);
}
$imageSave = SugarThemeRegistry::current()->getImage( 'studio_save', '');
$imageUndo = SugarThemeRegistry::current()->getImage('studio_undo', '');
$imageRedo = SugarThemeRegistry::current()->getImage('studio_redo', '');
$buttons = array();
$buttons[] = array('text'=>$mod_strings['LBL_BTN_UNDO'],'actionScript'=>"onclick='jstransaction.undo()'" );
$buttons[] = array('text'=>$mod_strings['LBL_BTN_REDO'],'actionScript'=>"onclick='jstransaction.redo()'" );
$buttons[] = array('text'=>$mod_strings['LBL_BTN_SAVE'],'actionScript'=>"onclick='if(check_form(\"editdropdown\")){document.editdropdown.submit();}'");
$buttonTxt = StudioParser::buildImageButtons($buttons);
$smarty->assign('buttons', $buttonTxt);
$smarty->assign('dropdown_lang', $selected_lang);
$editImage = SugarThemeRegistry::current()->getImage( 'edit_inline', '');
$smarty->assign('editImage',$editImage);
$deleteImage = SugarThemeRegistry::current()->getImage( 'delete_inline', '');
$smarty->assign('deleteImage',$deleteImage);
$smarty->display("modules/Studio/DropDowns/EditView.tpl");
?>

View File

@@ -0,0 +1,377 @@
{*
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* 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 Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
*}
{literal}
<br>
<style type='text/css'>
.slot {
border-width:1px;border-color:#999999;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
}
.slotB {
border-width:0;cursor:move;
}
</style>
{/literal}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h2 style='margin-bottom:10px;'>{$title}</h2>
<p>{$MOD.LBL_RENAME_TAB_WELCOME}</p><br/>
<table cellspacing="2">
<tr>
<td valign="center">
<input type="button" value="{$MOD.LBL_BTN_UNDO}" onclick="jstransaction.undo()" name="{$MOD.LBL_BTN_UNDO}" />
</td>
<td valign="center">
<input type="button" value="{$MOD.LBL_BTN_REDO}" onclick="jstransaction.redo()" name="{$MOD.LBL_BTN_REDO}" />
</td>
<td valign="center">
<input type="button" value="{$MOD.LBL_BTN_SAVE}"
onclick='{literal}if(check_form("editdropdown")){document.editdropdown.submit();}{/literal}'
name="{$MOD.LBL_BTN_SAVE}" />
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class='edit view'>
<tr><td>
<span class='error'>{$error}</span>
<table >
<tr><td colspan='2'>
{if empty($newDropDown)}
<form method='post' action='index.php' name='dropdownsform'>
<input type='hidden' name='action' value='wizard'>
<input type='hidden' name='wizard' value='EditDropDownWizard'>
<input type='hidden' name='option' value='EditDropdown'>
<input type='hidden' name='module' value='Studio'>
<input type='hidden' name='dropdown_name' value='{$dropdown_name}'>
{html_options name='dropdown_lang' options=$dropdown_languages selected=$dropdown_lang onchange="document.dropdownsform.submit();"}
</form>
{/if}
</td></tr>
</table>
</td></tr><tr><td>
{if !empty($dropdown) || !empty($newDropDown)}
<form method='post' action='index.php' name='editdropdown'>
<input type='hidden' name='action' value='wizard'>
<input type='hidden' name='wizard' value='EditDropDownWizard'>
<input type='hidden' name='option' value='SaveDropDown'>
<input type='hidden' name='module' value='Studio'>
<input type='hidden' name='dropdown_lang' value='{$dropdown_lang}'>
{if empty($newDropDown)}
<input type='hidden' name='dropdown_name' value='moduleList'>
{else}
<table><tr><td>
{$MOD.LBL_DROPDOWN_NAME}
</td><td>{$MOD.COLUMN_TITLE_NAME}<input type='text' name='dropdown_name' value='{$dropdown_name}'>
</td></tr><tr><td>
{$MOD.LBL_DROPDOWN_LANGUAGE}</td><td>{html_options name='dropdown_lang' options=$dropdown_languages selected=$dropdown_lang}
</td></tr></table>
{/if}
<table name='tabDropdown' id='tabDropdown'>
<tr><td>{$MOD.LBL_DD_DATABASEVALUE}<hr></td><td>{$MOD.LBL_DD_DISPALYVALUE}<hr></td></tr>
{counter start=0 name="rowCounter" print=false assign="rowCounter"}
{foreach from=$dropdown item="value" key="key"}
<tr><td>
<span id='slot{$rowCounter}' class='slot' style='cursor: move'>
<span id='slot{$rowCounter}_key'>{$key}</span>
</span>
</td><td>
<span id='slot{$rowCounter}b' >
{if empty($disable_remove)}
<span onclick='deleteDropDownValue({$rowCounter}, document.getElementById("delete_{$rowCounter}"), true);'>
{$deleteImage}
</span>
{/if}
<span onclick='prepChangeDropDownValue({$rowCounter}, document.getElementById("slot{$rowCounter}_value"));'>{$editImage}</span>
&nbsp;
<span id ='slot{$rowCounter}_value' onclick='prepChangeDropDownValue({$rowCounter}, this);'>{$value.lang}</span>
<span id='slot{$rowCounter}_textspan' style='display:none'>
<input id='slot{$rowCounter}_text' value='' type='text' onchange='setDropDownValue({$rowCounter}, this.value, true)' >
{$value.user_lang}
</span>
<input name='slot_{$rowCounter}' id='slot_{$rowCounter}' value='{$rowCounter}' type = 'hidden'>
<input name='value_{$rowCounter}' id='value_{$rowCounter}' value='{$value.lang}' type = 'hidden'>
<input type='hidden' name='key_{$rowCounter}' id='key_{$rowCounter}' value='{$key|default:"BLANK"}'>
<input type='hidden' id='delete_{$rowCounter}' name='delete_{$rowCounter}' value='0'>
</span>
</td></tr>
{counter name="rowCounter"}
{/foreach}
{if empty($disable_add)}
<tr><td><input type='text' name='addKey' id='addKey' value=''></td><td><input type='text' name='addValue' id='addValue' value=''><input type='button' onclick='addDropDown();' value='+' class='button'></td>
{/if}
</table>
</table>
{literal}
<script type="text/javascript" src="modules/Studio/JSTransaction.js" ></script>
<script>
var jstransaction = new JSTransaction();
</script>
<script src = "include/javascript/yui/dragdrop.js" ></script>
<script type="text/javascript" src="modules/Studio/studiodd.js" ></script>
<script type="text/javascript" src="modules/Studio/studio.js" ></script>
<script>
var lastField = '';
var lastRowCount = -1;
var undoDeleteDropDown = function(transaction){
deleteDropDownValue(transaction['row'], document.getElementById(transaction['id']), false);
}
jstransaction.register('deleteDropDown', undoDeleteDropDown, undoDeleteDropDown);
function deleteDropDownValue(rowCount, field, record){
if(record){
jstransaction.record('deleteDropDown',{'row':rowCount, 'id': field.id });
}
//We are deleting if the value is 0
if(field.value == '0'){
field.value = '1';
document.getElementById('slot' + rowCount + '_key').style.textDecoration = 'line-through';
document.getElementById('slot' + rowCount + '_value').style.textDecoration = 'line-through';
}else{
field.value = '0';
document.getElementById('slot' + rowCount + '_key').style.textDecoration = 'none';
document.getElementById('slot' + rowCount + '_value').style.textDecoration = 'none';
}
}
function prepChangeDropDownValue(rowCount, field){
var tempLastField = lastField;
if(lastRowCount != -1){
setDropDownValue(lastRowCount, lastField.innerHTML, true);
}
if(tempLastField == field)return;
lastField = field;
lastRowCount = rowCount;
field.style.display="none";
var textspan = document.getElementById('slot' + rowCount + '_textspan');
var text = document.getElementById("slot" + rowCount + "_text");
text.value=field.innerHTML;
textspan.style.display='inline'
text.focus();
}
var undoDropDownChange = function(transaction){
setDropDownValue(transaction['row'], transaction['old'], false);
}
var redoDropDownChange = function(transaction){
setDropDownValue(transaction['row'], transaction['new'], false);
}
jstransaction.register('changeDropDownValue', undoDropDownChange, redoDropDownChange);
function setDropDownValue(rowCount, val, record){
var key = document.getElementById('slot' + rowCount + '_key').innerHTML;
if(key == ''){
key = 'BLANK';
}
if(record){
jstransaction.record('changeDropDownValue', {'row':rowCount, 'new':val, 'old':document.getElementById('value_'+ rowCount).value});
}
document.getElementById('value_' + rowCount).value = val;
var text = document.getElementById('slot' + rowCount + '_text');
var textspan = document.getElementById('slot' + rowCount + '_textspan');
var span = document.getElementById('slot' + rowCount + '_value');
span.innerHTML = val;
textspan.style.display = 'none';
text.value = '';
span.style.display = 'inline';
lastField = '';
lastRowCount = -1;
}
function addDropDown(){
var addKey = document.getElementById('addKey');
var keyValue = addKey.value;
if(trim(keyValue) == ''){
keyValue = 'BLANK';
}
//Check for the single quote value
//Comment out this if block in case you don't want validation
//or add other rules as needed (e.g. isDBName() from sugar_3.js)
if(/[\']/.test(keyValue)) {
alert("{/literal}{$MOD.ERROR_INVALID_KEY_VALUE}{literal}");
return false;
}
var addValue = document.getElementById('addValue')
for(var i = 0; i < slotCount ; i++){
if(typeof(document.getElementById('key_' + i)) != 'undefined'){
if(document.getElementById('key_' + i).value == keyValue){
alert('key already exists');
return;
}
}
}
var table = document.getElementById('tabDropdown');
var row = table.insertRow(table.rows.length - 1);
var cell = row.insertCell(0);
var cell2 = row.insertCell(1);
var span1 = document.createElement('span');
span1.id = 'slot' + slotCount;
span1.className = 'slot';
var keyspan = document.createElement('span');
keyspan.id = 'slot' + slotCount + '_key'
keyspan.innerHTML = addKey.value;
span1.appendChild(keyspan);
var span2 = document.createElement('span');
span2.id = 'slot' + slotCount + 'b';
var delimage = document.createElement('span');
delimage.innerHTML = '{/literal}{$deleteImage}{literal}&nbsp;';
delimage.slotCount = slotCount
delimage.recordKey = keyValue;
delimage.onclick = function(){
deleteDropDownValue(this.slotCount, document.getElementById( 'delete_' + this.slotCount), true);
};
var span2image = document.createElement('span');
span2image.innerHTML = '{/literal}{$editImage}{literal}&nbsp;';
span2image.slotCount = slotCount
span2image.onclick = function(){
prepChangeDropDownValue(this.slotCount, document.getElementById('slot' + this.slotCount + '_value'));
};
var span2inner = document.createElement('span');
span2inner.innerHTML = addValue.value;
span2inner.id = 'slot' + slotCount + '_value';
span2inner.slotCount = slotCount
span2inner.onclick = function(){
prepChangeDropDownValue(this.slotCount, this);
};
var text2span = document.createElement('span');
text2span.id = 'slot' + slotCount + '_textspan'
text2span.style.display = 'none';
var text2 = document.createElement('input');
text2.type = 'text';
text2.id = 'slot' + slotCount + '_text'
text2.slotCount = slotCount;
text2.onchange = function(){
setDropDownValue(this.slotCount, this.value, true);
}
var text3 = document.createElement('input');
text3.type = 'hidden';
text3.id = 'value_' + slotCount;
text3.name = 'value_' + slotCount;
text3.value = addValue.value;
var text4 = document.createElement('input');
text4.type = 'hidden';
text4.id = 'key_' + slotCount;
text4.name = 'key_' + slotCount;
text4.value = keyValue;
var text5 = document.createElement('input');
text5.type = 'hidden';
text5.id = 'delete_' + slotCount ;
text5.name = 'delete_' + slotCount ;
text5.value = '0';
var text6 = document.createElement('input');
text6.type = 'hidden';
text6.id = 'slot_' + slotCount;
text6.name = 'slot_' + slotCount;
text6.value = slotCount;
cell.appendChild(span1);
span2.appendChild(delimage);
span2.appendChild(span2image);
span2.appendChild(span2inner);
cell2.appendChild(span2);
text2span.appendChild(text2);
span2.appendChild(text2span);
cell2.appendChild(text3);
cell2.appendChild(text4);
cell2.appendChild(text5);
cell2.appendChild(text6);
addKey.value = '';
addValue.value = '';
yahooSlots["slot" + slotCount] = new ygDDSlot("slot" + slotCount, "studio");
slotCount++;
}
var slotCount = {/literal}{$rowCounter}{literal};
var yahooSlots = [];
function dragDropInit(){
YAHOO.util.DDM.mode = YAHOO.util.DDM.POINT;
for(mj = 0; mj <= slotCount; mj++){
yahooSlots["slot" + mj] = new ygDDSlot("slot" + mj, "studio");
}
// initPointMode();
}
YAHOO.util.Event.addListener(window, "load", dragDropInit);
</script>
{/literal}
<div id='logDiv' style='display:none'>
</div>
{/if}
<input type='hidden' name='use_push' value='{$use_push}'>
</form>
</td></tr>
</table>
{if !empty($newDropDown)}
{literal}
<script type="text/javascript">
addToValidate('editdropdown', 'dropdown_name', 'DBName', true, '{/literal}{$MOD.LBL_DROPDOWN_NAME}{literal} [a-zA-Z_0-9]' );
</script>
{/literal}
{/if}