PageRenderTime 51ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 1ms

/form.php

https://bitbucket.org/izubizarreta/https-bitbucket.org-bityvip
PHP | 1358 lines | 1287 code | 32 blank | 39 comment | 305 complexity | 28a60e90acf1e8fd0c21e6f29697fe8c MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.0, JSON, GPL-2.0, BSD-3-Clause, LGPL-2.1, MIT

Large files files are truncated, but you can click here to view the full file

  1. <script src="/media/system/js/mootools-core.js" type="text/javascript"></script>
  2. <script src="/media/system/js/core.js" type="text/javascript"></script>
  3. <script src="/media/system/js/mootools-more.js" type="text/javascript"></script>
  4. <script src="/components/com_breezingforms/libraries/jquery/jq.min.js" type="text/javascript"></script>
  5. <script src="/components/com_breezingforms/libraries/jquery/tooltip.js" type="text/javascript"></script>
  6. <script src="/templates/beez5/javascript/md_stylechanger.js" type="text/javascript" defer="defer"></script>
  7. <script type="text/javascript">
  8. <!--
  9. var inlineErrorElements = new Array();
  10. var bfSummarizers = new Array();
  11. var bfDeactivateField = new Array();
  12. var bfDeactivateSection = new Array();
  13. var toggleFieldsArray = [{ action: "turn", state: "off", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value0" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value1" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value2" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value3" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value4" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value5" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value6" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value7" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "off", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value8" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "off", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value9" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "off", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value10" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "off", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value11" },{ action: "turn", state: "on", tCat: "section", tName: "socio1", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio2", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio3", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio4", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio5", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio6", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio7", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio8", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio9", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio10", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio11", statement: "if", sName: "numero_socios", condition: "is", value: "value12" },{ action: "turn", state: "on", tCat: "section", tName: "socio12", statement: "if", sName: "numero_socios", condition: "is", value: "value12" }];
  14. String.prototype.beginsWith = function(t, i) { if (i==false) { return
  15. (t == this.substring(0, t.length)); } else { return (t.toLowerCase()
  16. == this.substring(0, t.length).toLowerCase()); } }
  17. function bfDeactivateSectionFields(){
  18. for( var i = 0; i < bfDeactivateSection.length; i++ ){
  19. bfSetFieldValue(bfDeactivateSection[i], "off");
  20. JQuery("#"+bfDeactivateSection[i]+" .ff_elem").each(function(i){
  21. if( JQuery(this).get(0).name && JQuery(this).get(0).name.beginsWith("ff_nm_", true) ){
  22. bfDeactivateField[JQuery(this).get(0).name] = true;
  23. }
  24. });
  25. }
  26. for( var i = 0; i < toggleFieldsArray.length; i++ ){
  27. if(toggleFieldsArray[i].state == "turn"){
  28. bfSetFieldValue(toggleFieldsArray[i].tName, "off");
  29. }
  30. }
  31. }
  32. function bfToggleFields(state, tCat, tName, thisBfDeactivateField){
  33. // maybe a little to harsh, but currently no other workaround
  34. // file uploads will be removed for the complete form if a rule is executed
  35. // make sure you offer file uploads at the end of your form if you have visibility rules!
  36. if(typeof bfFlashUploadInterval != "undefined"){
  37. window.clearInterval( bfFlashUploadInterval );
  38. for(qID in bfFlashUploadAll){
  39. try{
  40. JQuery(bfFlashUploadAll[qID]).uploadifyCancel(qID);
  41. }catch(e){}
  42. }
  43. bfFlashUploadTooLarge = {};
  44. bfFlashUploadAll = {};
  45. JQuery("#bfFileQueue").html("")
  46. JQuery(".bfFlashFileQueueClass").html("");
  47. }
  48. if(state == "on"){
  49. if(tCat == "element"){
  50. if( typeof JQuery("[name=\"ff_nm_"+tName+"[]\"]") != "undefined" && JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().attr("class").substr(0, 10) == "bfElemWrap" ){
  51. JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().css("display", "");
  52. } else if(JQuery("[name=\"ff_nm_"+tName+"[]\"]").get(0).type == "checkbox" || JQuery("[name=\"ff_nm_"+tName+"[]\"]").get(0).type == "radio"){
  53. JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().parent().css("display", "");
  54. }
  55. thisBfDeactivateField["ff_nm_"+tName+"[]"] = false;
  56. bfSetFieldValue(tName, "on");
  57. } else {
  58. JQuery("#"+tName).css("display", "");
  59. bfSetFieldValue(tName, "on");
  60. JQuery("#"+tName).find(".ff_elem").each(function(i){
  61. if( JQuery(this).get(0).name && JQuery(this).get(0).name.beginsWith("ff_nm_", true) ){
  62. thisBfDeactivateField[JQuery(this).get(0).name] = false;
  63. }
  64. });
  65. }
  66. } else {
  67. if(tCat == "element"){
  68. if( typeof JQuery("[name=\"ff_nm_"+tName+"[]\"]") != "undefined" && JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().attr("class").substr(0, 10) == "bfElemWrap" ){
  69. JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().css("display", "none");
  70. } else if(JQuery("[name=\"ff_nm_"+tName+"[]\"]").get(0).type == "checkbox" || JQuery("[name=\"ff_nm_"+tName+"[]\"]").get(0).type == "radio"){
  71. JQuery("[name=\"ff_nm_"+tName+"[]\"]").parent().parent().css("display", "none");
  72. }
  73. thisBfDeactivateField["ff_nm_"+tName+"[]"] = true;
  74. bfSetFieldValue(tName, "off");
  75. } else {
  76. JQuery("#"+tName).css("display", "none");
  77. bfSetFieldValue(tName, "off");
  78. JQuery("#"+tName+" .ff_elem").each(function(i){
  79. if( JQuery(this).get(0).name && JQuery(this).get(0).name.beginsWith("ff_nm_", true) ){
  80. thisBfDeactivateField[JQuery(this).get(0).name] = true;
  81. }
  82. });
  83. }
  84. }
  85. }
  86. function bfSetFieldValue(name, condition){
  87. for( var i = 0; i < toggleFieldsArray.length; i++ ){
  88. if( toggleFieldsArray[i].action == "if" ) {
  89. if(name == toggleFieldsArray[i].tCat && condition == toggleFieldsArray[i].statement){
  90. var element = JQuery("[name=\"ff_nm_"+toggleFieldsArray[i].condition+"[]\"]");
  91. switch(element.get(0).type){
  92. case "text":
  93. case "textarea":
  94. if(toggleFieldsArray[i].value == "!empty"){
  95. element.val("");
  96. } else {
  97. element.val(toggleFieldsArray[i].value);
  98. }
  99. break;
  100. case "select-multiple":
  101. case "select-one":
  102. if(toggleFieldsArray[i].value == "!empty"){
  103. for(var j = 0; j < element.get(0).options.length; j++){
  104. element.get(0).options[j].selected = false;
  105. }
  106. }
  107. for(var j = 0; j < element.get(0).options.length; j++){
  108. if(element.get(0).options[j].value == toggleFieldsArray[i].value){
  109. element.get(0).options[j].selected = true;
  110. }
  111. }
  112. break;
  113. case "radio":
  114. case "checkbox":
  115. var radioLength = element.size();
  116. if(toggleFieldsArray[i].value == "!empty"){
  117. for(var j = 0; j < radioLength; j++){
  118. element.get(j).checked = false;
  119. }
  120. }
  121. for(var j = 0; j < radioLength; j++){
  122. if( element.get(j).value == toggleFieldsArray[i].value ){
  123. element.get(j).checked = true;
  124. }
  125. }
  126. break;
  127. }
  128. }
  129. }
  130. }
  131. }
  132. function bfRegisterToggleFields(){
  133. var offset = 0;
  134. var last_offset = 0;
  135. var limit = 10;
  136. var limit_cnt = 0;
  137. if( arguments.length == 1 ){
  138. offset = arguments[0];
  139. }
  140. var thisToggleFieldsArray = toggleFieldsArray;
  141. var thisBfDeactivateField = bfDeactivateField;
  142. var thisBfToggleFields = bfToggleFields;
  143. for( var i = offset; limit_cnt < limit && i < toggleFieldsArray.length; i++ ){
  144. // for( var i = 0; i < toggleFieldsArray.length; i++ ){
  145. if( toggleFieldsArray[i].action == "turn" && (toggleFieldsArray[i].tCat == "element" || toggleFieldsArray[i].tCat == "section") ){
  146. var toggleField = toggleFieldsArray[i];
  147. var element = JQuery("[name=\"ff_nm_"+toggleFieldsArray[i].sName+"[]\"]");
  148. if(element.get(0)){
  149. switch(element.get(0).type){
  150. case "text":
  151. case "textarea":
  152. JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").unbind("blur");
  153. JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").blur(
  154. function(){
  155. for( var k = 0; k < thisToggleFieldsArray.length; k++ ){
  156. var regExp = "";
  157. if(thisToggleFieldsArray[k].value.beginsWith("!", true) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"){
  158. regExp = thisToggleFieldsArray[k].value.substring(1, thisToggleFieldsArray[k].value.length);
  159. }
  160. if(thisToggleFieldsArray[k].condition == "isnot"){
  161. if(
  162. ( ( regExp != "" && JQuery(this).val().test(regExp) <= 0 ) || JQuery(this).val() != thisToggleFieldsArray[k].value ) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
  163. ){
  164. var names = thisToggleFieldsArray[k].tName.split(",");
  165. for(var n = 0; n < names.length; n++){
  166. thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
  167. }
  168. //break;
  169. }
  170. } else if(thisToggleFieldsArray[k].condition == "is"){
  171. if(
  172. ( ( regExp != "" && JQuery(this).val().test(regExp) > 0 ) || JQuery(this).val() == thisToggleFieldsArray[k].value ) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
  173. ){
  174. var names = thisToggleFieldsArray[k].tName.split(",");
  175. for(var n = 0; n < names.length; n++){
  176. thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
  177. }
  178. //break;
  179. }
  180. }
  181. }
  182. }
  183. );
  184. break;
  185. case "select-multiple":
  186. case "select-one":
  187. JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").unbind("change");
  188. JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").change(
  189. function(){
  190. var res = JQuery.isArray( JQuery(this).val() ) == false ? [ JQuery(this).val() ] : JQuery(this).val();
  191. for( var k = 0; k < thisToggleFieldsArray.length; k++ ){
  192. // The or-case in lists
  193. var found = false;
  194. var chkGrpValues = new Array();
  195. if(thisToggleFieldsArray[k].value.beginsWith("#", true) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"){
  196. chkGrpValues = thisToggleFieldsArray[k].value.substring(1, thisToggleFieldsArray[k].value.length).split("|");
  197. for(var l = 0; l < chkGrpValues.length; l++){
  198. if( JQuery.inArray(chkGrpValues[l], res) != -1 ){
  199. found = true;
  200. break;
  201. }
  202. }
  203. }
  204. // the and-case in lists
  205. var foundCount = 0;
  206. chkGrpValues2 = new Array();
  207. if(thisToggleFieldsArray[k].value.beginsWith("#", true) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"){
  208. chkGrpValues2 = thisToggleFieldsArray[k].value.substring(1, thisToggleFieldsArray[k].value.length).split(";");
  209. for(var l = 0; l < res.length; l++){
  210. if( JQuery.inArray(res[l], chkGrpValues2) != -1 ){
  211. foundCount++;
  212. }
  213. }
  214. }
  215. if(thisToggleFieldsArray[k].condition == "isnot"){
  216. if(
  217. (
  218. !JQuery.isArray(res) && JQuery(this).val() != thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
  219. )
  220. ||
  221. (
  222. JQuery.isArray(res) && ( JQuery.inArray(thisToggleFieldsArray[k].value, res) == -1 || !found || ( foundCount == 0 || foundCount != chkGrpValues2.length ) ) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
  223. )
  224. ){
  225. var names = thisToggleFieldsArray[k].tName.split(",");
  226. for(var n = 0; n < names.length; n++){
  227. thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
  228. }
  229. //break;
  230. }
  231. } else if(thisToggleFieldsArray[k].condition == "is"){
  232. if(
  233. (
  234. !JQuery.isArray(res) && JQuery(this).val() == thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
  235. )
  236. ||
  237. (
  238. JQuery.isArray(res) && ( JQuery.inArray(thisToggleFieldsArray[k].value, res) != -1 || found || ( foundCount != 0 && foundCount == chkGrpValues2.length ) ) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
  239. )
  240. ){
  241. var names = thisToggleFieldsArray[k].tName.split(",");
  242. for(var n = 0; n < names.length; n++){
  243. thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
  244. }
  245. //break;
  246. }
  247. }
  248. }
  249. }
  250. );
  251. break;
  252. case "radio":
  253. case "checkbox":
  254. var radioLength = JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").size();
  255. for(var j = 0; j < radioLength; j++){
  256. JQuery("#" + JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").get(j).id ).unbind("click");
  257. JQuery("#" + JQuery("[name=\"ff_nm_"+toggleField.sName+"[]\"]").get(j).id ).click(
  258. function(){
  259. // NOT O(n^2) since its ony executed on click event!
  260. for( var k = 0; k < thisToggleFieldsArray.length; k++ ){
  261. // used for complex checkbox group case below
  262. var chkGrpValues = new Array();
  263. if(JQuery(this).get(0).checked && thisToggleFieldsArray[k].value.beginsWith("#", true) && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"){
  264. chkGrpValues = thisToggleFieldsArray[k].value.substring(1, thisToggleFieldsArray[k].value.length).split("|");
  265. }
  266. if(thisToggleFieldsArray[k].condition == "isnot"){
  267. if(
  268. // simple radio case for selected value
  269. ( JQuery(this).get(0).type == "radio" && JQuery(this).get(0).checked && JQuery(this).val() != thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]" )
  270. ||
  271. // single checkbox case for checked/unchecked
  272. (
  273. JQuery(this).get(0).type == "checkbox" &&
  274. JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]" &&
  275. ( JQuery(this).get(0).checked && thisToggleFieldsArray[k].value != "!checked"
  276. ||
  277. JQuery(this).get(0).checked && thisToggleFieldsArray[k].value == "!unchecked"
  278. )
  279. )
  280. ||
  281. // complex checkbox/radio group case by multiple values
  282. (
  283. JQuery(this).get(0).checked && JQuery.inArray(JQuery(this).val(), chkGrpValues) == -1 && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
  284. )
  285. ||
  286. // simple checkbox group case by single value
  287. (
  288. JQuery(this).get(0).type == "checkbox" && JQuery(this).get(0).checked && JQuery(this).val() != thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]"
  289. )
  290. ){
  291. var names = thisToggleFieldsArray[k].tName.split(",");
  292. for(var n = 0; n < names.length; n++){
  293. thisBfToggleFields(thisToggleFieldsArray[k].state, thisToggleFieldsArray[k].tCat, JQuery.trim(names[n]), thisBfDeactivateField);
  294. }
  295. //break;
  296. }
  297. }
  298. else
  299. if(thisToggleFieldsArray[k].condition == "is"){
  300. if(
  301. // simple radio case for selected value
  302. ( JQuery(this).get(0).type == "radio" && JQuery(this).get(0).checked && JQuery(this).val() == thisToggleFieldsArray[k].value && JQuery(this).get(0).name == "ff_nm_"+thisToggleFieldsArray[k].sName+"[]" )
  303. ||
  304. // single checkbox case fo…

Large files files are truncated, but you can click here to view the full file