PageRenderTime 47ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/promotor.php

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

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