function Confirm_Deletion_Of_The_Object(The_Input_Object_Type, The_Input_Object_ID, The_Input_Div_Name, The_Input_Parent_ID_Name) { var The_Parent_Object_ID; var The_URL_Parameter_String = ''; if (The_Input_Parent_ID_Name != undefined) { The_Parent_Object_ID = document.getElementById(The_Input_Parent_ID_Name).value; } Highlight_The_Div_To_Be_Deleted(The_Input_Div_Name); switch (The_Input_Object_Type) { case 'Value' : The_URL_Parameter_String += 'delete_value&value_id=' + The_Input_Object_ID; The_URL_Parameter_String += '&form_id=' + The_Parent_Object_ID; The_Global_Ajax_Target_ID = 'values_displayer'; break; case 'Field' : The_URL_Parameter_String += 'delete_field&field_id=' + The_Input_Object_ID; The_URL_Parameter_String += '&form_id=' + The_Parent_Object_ID; The_Global_Ajax_Target_ID = 'fields_displayer'; break; case 'User Custom Field' : The_URL_Parameter_String += 'delete_user_custom_field&field_id=' + The_Input_Object_ID; The_Global_Ajax_Target_ID = 'user_custom_fields_displayer'; break; case 'Form' : The_URL_Parameter_String += 'delete_form&form_id=' + The_Input_Object_ID; The_Global_Ajax_Target_ID = 'forms_displayer'; break; case 'Group' : The_URL_Parameter_String += 'delete_group&group_id=' + The_Input_Object_ID; The_Global_Ajax_Target_ID = 'groups_displayer'; break; case 'Submission' : The_URL_Parameter_String += 'delete_submission&submission_id=' + The_Input_Object_ID; The_URL_Parameter_String += '&form_id=' + The_Parent_Object_ID; The_Global_Ajax_Target_ID = 'submissions_displayer'; break; case 'User' : The_URL_Parameter_String += 'delete_user&user_id=' + The_Input_Object_ID; The_Global_Ajax_Target_ID = 'users_displayer'; break; case 'View' : The_URL_Parameter_String += 'delete_view&view_id=' + The_Input_Object_ID; The_Global_Ajax_Target_ID = 'views_displayer'; break; } if (confirm('Are you sure you want to delete the ' + The_Input_Object_Type + '?\nThis cannot be recovered.')) { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function='; url += The_URL_Parameter_String; url += '&random=' + Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } Unhighlight_All_Children_Of_The_Div(The_Global_Ajax_Target_ID); return false; } function Create_The_Field_For_The_Form_ID( The_Field_Name_Div_Name, The_Field_Type_Div_Name, The_Input_Control_Width_Div_Name, The_Character_Limit_Div_Name, The_Relational_Table_ID, The_Relational_Field_Name_1, The_Relational_Field_Name_2, The_Relational_Field_Name_3, The_Display_Div_Name, The_Input_Form_ID, The_Input_Start_Year_ID, The_Input_End_Year_ID, The_Public_Facing_Div_Name, The_Input_Is_Required_Div_Name, The_Input_Is_Modifiable_By_User_Div_Name, The_Input_Explanatory_Text_Div_Name, The_Input_Options_Text_Div_Name, The_Input_Is_User_Field_Div_Name, The_Input_Is_Group_Field_Div_Name, The_Input_Target_Div_ID) { var The_Field_Name = document.getElementById(The_Field_Name_Div_Name).value; var The_Field_Type = document.getElementById(The_Field_Type_Div_Name).value; var The_Input_Control_Width = document.getElementById(The_Input_Control_Width_Div_Name).value; var The_Character_Limit = document.getElementById(The_Character_Limit_Div_Name).value; var The_Explanatory_Text = escape(document.getElementById(The_Input_Explanatory_Text_Div_Name).value); var The_Options_Text = escape(document.getElementById(The_Input_Options_Text_Div_Name).value); var The_Form_ID = The_Input_Form_ID; if (The_Field_Type == 'Dynamic Select' || The_Field_Type == 'Dynamic Radio') { var The_Relational_Table_ID = document.getElementById(The_Relational_Table_ID).options[document.getElementById(The_Relational_Table_ID).selectedIndex].value; var The_Relational_Field_ID_1 = document.getElementById(The_Relational_Field_Name_1).options[document.getElementById(The_Relational_Field_Name_1).selectedIndex].value; var The_Relational_Field_ID_2 = document.getElementById(The_Relational_Field_Name_2).options[document.getElementById(The_Relational_Field_Name_2).selectedIndex].value; var The_Relational_Field_ID_3 = document.getElementById(The_Relational_Field_Name_3).options[document.getElementById(The_Relational_Field_Name_3).selectedIndex].value; } if (The_Field_Type == 'Date') { var The_Start_Year = document.getElementById(The_Input_Start_Year_ID).value; var The_End_Year = document.getElementById(The_Input_End_Year_ID).value; if (!IsNumeric(The_Start_Year)) { alert('Start Year must be a four-digit number.'); return true; } if (!IsNumeric(The_End_Year)) { alert('End Year must be a four-digit number.'); return true; } if (The_End_Year <= The_Start_Year) { alert('Start Year must be before End Year.'); return true; } } var The_Display_Flag = 'off'; if (document.getElementById(The_Display_Div_Name).checked) { The_Display_Flag = 'on'; } var The_Public_Flag = 'off'; if (document.getElementById(The_Public_Facing_Div_Name) != null) { if (document.getElementById(The_Public_Facing_Div_Name).checked) { The_Public_Flag = 'on'; } } var The_Required_Flag = 'off'; if (document.getElementById(The_Input_Is_Required_Div_Name).checked) { The_Required_Flag = 'on'; } var Is_User_Field = document.getElementById(The_Input_Is_User_Field_Div_Name).value; var Is_Group_Field = document.getElementById(The_Input_Is_Group_Field_Div_Name).value; var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; if (Is_User_Field == true || Is_User_Field == '1' || Is_User_Field == 'true' || Is_User_Field == 1) { var The_Modifiable_By_User_Flag = 'off'; if (document.getElementById(The_Input_Is_Modifiable_By_User_Div_Name).checked) { The_Modifiable_By_User_Flag = 'on'; } url += '?support_function=create_user_custom_field'; url += '&is_modifiable_by_user=' + The_Modifiable_By_User_Flag; } else { if (Is_Group_Field == true || Is_Group_Field == '1' || Is_Group_Field == 'true' || Is_Group_Field == 1) { url += '?support_function=create_group_custom_field'; } else { url += '?support_function=create_field'; url += '&form_id=' + The_Form_ID; url += '&is_public_facing=' + The_Public_Flag; } } url += '&field_name=' + The_Field_Name; url += '&field_type=' + The_Field_Type; url += '&input_control_width=' + The_Input_Control_Width; url += '&character_limit=' + The_Character_Limit; url += '&relational_table_id=' + The_Relational_Table_ID; url += '&relational_field_id_1=' + The_Relational_Field_ID_1; url += '&relational_field_id_2=' + The_Relational_Field_ID_2; url += '&relational_field_id_3=' + The_Relational_Field_ID_3; url += '&start_year=' + The_Start_Year; url += '&end_year=' + The_End_Year; url += '&display=' + The_Display_Flag; url += '&is_required=' + The_Required_Flag; url += '&explanatory_text=' + The_Explanatory_Text; url += '&options_text=' + The_Options_Text; url += '&random=' + Math.random(); xmlHttp = GetXmlHttpObject(); The_Global_Ajax_Target_ID = The_Input_Target_Div_ID; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Create_The_Form(The_Input_List, The_Input_Form_Name, The_Input_Form_Type, The_Input_Form_Filename, The_Input_Group_Permissions_Prefix, The_Input_Target_Div_ID, The_Input_Audience_Node_List, The_Input_Confirmation_Message, The_Input_Limit_Access_Node_List, The_Input_Email_Notification_Node_List, The_Input_Email_Recipients) { xmlHttp = GetXmlHttpObject(); var The_New_Form_Name = document.getElementById(The_Input_Form_Name).value; var The_New_Form_Type = document.getElementById(The_Input_Form_Type).value; var The_New_Form_Filename = document.getElementById(The_Input_Form_Filename).value.replace('C:\\fakepath\\',''); var The_Audience = The_Checked_Value_Of_The_Node_List(The_Input_Audience_Node_List); var Limit_Access = The_Checked_Value_Of_The_Node_List(The_Input_Limit_Access_Node_List); var Email_Notification = The_Checked_Value_Of_The_Node_List(The_Input_Email_Notification_Node_List); var The_Group_Permissions = The_Elements_Within_The_Div_Tagged_As(The_Input_List, The_Input_Group_Permissions_Prefix); var The_Group_String = ''; if (The_Group_Permissions != null) { for (i=0; i 0) { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_relational_fields'; url += '&table_id=' + The_Input_Table_ID; url += '&submit_tag=' + The_Input_Submit_Tag; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = The_Input_Div_ID; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } else { document.getElementById(The_Input_Div_ID).innerHTML = ''; } } function Display_The_Tables_For_A_Relational_Selection_In_The_Div(The_Input_Field_Type, The_Input_Div_ID, The_Input_Submit_Tag) { if (The_Input_Field_Type == 'Dynamic Select' || The_Input_Field_Type == 'Dynamic Radio') { if (document.getElementById(The_Input_Div_ID).innerHTML == '') { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_relational_tables'; url += '&submit_tag=' + The_Input_Submit_Tag; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = The_Input_Div_ID; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } } else { document.getElementById(The_Input_Div_ID).innerHTML = ''; document.getElementById('fields_for_relational_selection').innerHTML = ''; } } function Display_The_Year_Fields_For_A_Date_Selection_In_The_Div(The_Input_Field_Type, The_Input_Start_Year_Div_ID, The_Input_End_Year_Div_ID) { if (The_Input_Field_Type == 'Date') { document.getElementById(The_Input_Start_Year_Div_ID).innerHTML = '
Start Year:
' + '
'; document.getElementById(The_Input_End_Year_Div_ID).innerHTML = '
End Year:
' + '
'; } else { document.getElementById(The_Input_Start_Year_Div_ID).innerHTML = ''; document.getElementById(The_Input_End_Year_Div_ID).innerHTML = ''; } } function Initialize_The_Upload(The_Input_Field_ID) { document.getElementById('submission_modification_form').onsubmit=function() { document.getElementById('submission_modification_form').target = 'upload_target'; // iframe } } function Load_The_Fields_Displayer_For_The_Form(The_Input_Form_ID) { var The_Form_ID = The_Input_Form_ID; xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_fields&form_id=' + The_Form_ID; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = 'fields_displayer'; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Load_The_Forms_Displayer() { xmlHttp = GetXmlHttpObject(); if (document.getElementById('current_form') != undefined) { The_Current_Form_Control = document.getElementById('current_form'); The_Current_Form_Control.parentNode.removeChild(The_Current_Form_Control); } var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_forms'; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = 'forms_displayer'; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Load_The_Groups_Displayer() { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_groups'; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = 'groups_displayer'; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Remove_File_From_The_Submission(The_Input_Form_ID, The_Input_Submission_ID, The_Input_Field_Name, The_Input_Div_ID) { if (confirm('Are you sure you want to remove this file?')) { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=remove_file'; url += '&form_id=' + The_Input_Form_ID; url += '&submission_id=' + The_Input_Submission_ID; url += '&field_name=' + The_Input_Field_Name; url += '&upload_area=' + The_Input_Div_ID; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = The_Input_Div_ID; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } } function Remove_Temp_File_From_The_Submission(The_Input_File_Path, The_Input_Secure, The_Input_Div_ID) { if (confirm('Are you sure you want to remove this file?')) { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=remove_temp_file'; url += '&file_path=' + The_Input_File_Path; url += '&is_secure=' + The_Input_Secure; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = The_Input_Div_ID; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } } function Show_The_Editor_For_The_Account() { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_account_editor'; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = 'account_editor'; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Show_The_Editor_For_The_Settings() { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_settings_editor'; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = 'settings_editor'; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Load_The_Users_Displayer() { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_users'; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = 'users_displayer'; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Load_The_Views_Displayer() { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_views'; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = 'views_displayer'; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Modify_The_Account_With_The_Tagged_Items_In_The_Div(The_User_ID, The_Prefix_Name, The_Div_Name) { var The_Div = document.getElementById(The_Div_Name); var The_Tagged_Children = The_Elements_Within_The_Div_Tagged_As(The_Div, The_Prefix_Name); var The_Fields_To_Submit = new Array(); var The_Values_To_Submit = new Array(); if (The_Tagged_Children != null) { for (i=0; iNo Form Selected'); break; case 'Gallery': $('#image_field_container,#title_field_container').css('display','block'); $('#title_field option').remove(); $('#title_field').prepend(''); $('#calendar_width_container').css('display','none'); $('#view_width').val(''); break; default: $('#calendar_width_container').css('display','none'); $('#view_width').val(''); $('#sort_field option').remove(); $('#sort_field').prepend(''); $('#sort_order').removeAttr('selectedIndex'); $('#sort_order').removeAttr('disabled'); $('#title_field_container').css('display','none'); $('#title_field option').remove(); $('#image_field_container').css('display','none'); $('#image_field option').remove(); $('#title_field').prepend(''); break; } } function Show_The_User_Custom_Fields_Displayer_Div() { xmlHttp = GetXmlHttpObject(); var url = '../mimik_includes/ivy-mimik_support_utilities.inc.php'; url += '?support_function=load_user_custom_fields_displayer'; url += '&random=' + Math.random(); The_Global_Ajax_Target_ID = 'user_custom_fields_displayer'; xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function Update_The_Sort_Field_Select_For_The_Form_In_The_Div(The_Input_Form_ID, The_Input_Field_Div_ID, The_Input_Select_Name) { if($('#view_type').val() == 'Gallery'){ $('#image_field_wrapper').load('../mimik_includes/ivy-mimik_support_utilities.inc.php',{ 'support_function':'load_image_fields', 'form_id':The_Input_Form_ID, 'select_name':'image_field', 'view_type':$('#view_type').val()}); } $.post('../mimik_includes/ivy-mimik_support_utilities.inc.php',{ 'support_function':'get_form_type', 'form_id':parseInt($('#view_form').val())}, function(form_type){ if(form_type == 'Image_Map' && $('#view_type').val() == 'Normal'){ $('#sort_field').val(''); $('#sort_field').attr('disabled',true); $('#sort_order').attr('disabled',true); }else{ $('#sort_field').removeAttr('disabled'); if($('#view_type').val()!='Calendar'){ $('#sort_order').removeAttr('disabled'); } $('#'+The_Input_Field_Div_ID).load('../mimik_includes/ivy-mimik_support_utilities.inc.php',{ 'support_function':'load_sort_fields', 'form_id':The_Input_Form_ID, 'select_name':The_Input_Select_Name, 'view_type':$('#view_type').val()}); $('#title_field_wrapper').load('../mimik_includes/ivy-mimik_support_utilities.inc.php',{ 'support_function':'load_sort_fields', 'form_id':The_Input_Form_ID, 'select_name':'title_field', 'view_type':'Normal'}); } }); } function Display_The_Controls_For_The_Text_Field(The_Input_Field_Type) { if(The_Input_Field_Type == 'Text') { $('#input_control_width_container').css('display','block'); }else{ $('#input_control_width_container').css('display','none'); } if (The_Input_Field_Type == 'Text' || The_Input_Field_Type == 'Text Area') { $('#character_limit_container').css('display','block'); }else { $('#character_limit_container').css('display','none'); } } function Display_The_Options_Textarea_For_The_Field_Type(The_Input_Field_Type) { if(The_Input_Field_Type == 'Static Select' || The_Input_Field_Type == 'Static Radio'){ $('#options_text_container').css('display','block'); }else{ $('#options_text_container').css('display','none'); } }