<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>
<div class="settings">
  <?php echo $this->form->render($this); ?>
</div>
<script type="text/javascript">

  en4.core.runonce.add(function() {
    showHideEmail("<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('user.signup.adminemail', 0); ?>");
    showUserName("<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('user.signup.username', 1); ?>");

		accountSuspend("<?php echo Engine_Api::_()->getApi('settings', 'core')->getSetting('user.signup.autoaccountsuspend', 0); ?>");
  });

	function accountSuspend(value) {
    if(value == 1) {
      if(document.getElementById('autoaccountsuspendday-wrapper'))
      document.getElementById('autoaccountsuspendday-wrapper').style.display = 'flex';
    } else {
      if(document.getElementById('autoaccountsuspendday-wrapper'))
      document.getElementById('autoaccountsuspendday-wrapper').style.display = 'none';
    }
  }
  
  function showHideEmail(value) {
    if(value == 1) {
      scriptJquery('#adminemailaddress-wrapper').show();
    } else {
      scriptJquery('#adminemailaddress-wrapper').hide();
    }
  }
  
  function showUserName(value) {
    if(value == 1) {
      scriptJquery('#showusername-wrapper').show();
    } else {
      scriptJquery('#showusername-wrapper').hide();
    }
  }

  scriptJquery('.core_admin_main_settings').parent().addClass('active');
  scriptJquery('.core_admin_main_signup').addClass('active');
</script>
