original_string: public function set_value($value) {
  
          if (!empty($value) && !$this->field->isChecked()) {
  
              if (!$this->running_javascript()) {
                  $this->field->check();
                  return;
              }
  
              // Check it if it should be checked and it is not.
              $this->field->click();
  
              // Trigger the onchange event as triggered when 'checking' the checkbox.
              $this->trigger_on_change();
  
          } else if (empty($value) && $this->field->isChecked()) {
  
              if (!$this->running_javascript()) {
                  $this->field->uncheck();
                  return;
              }
  
              // Uncheck if it is checked and shouldn't.
              $this->field->click();
  
              // Trigger the onchange event as triggered when 'checking' the checkbox.
              $this->trigger_on_change();
          }
      }
code: public function set_value($value) {
  
          if (!empty($value) && !$this->field->isChecked()) {
  
              if (!$this->running_javascript()) {
                  $this->field->check();
                  return;
              }
  
              // Check it if it should be checked and it is not.
              $this->field->click();
  
              // Trigger the onchange event as triggered when 'checking' the checkbox.
              $this->trigger_on_change();
  
          } else if (empty($value) && $this->field->isChecked()) {
  
              if (!$this->running_javascript()) {
                  $this->field->uncheck();
                  return;
              }
  
              // Uncheck if it is checked and shouldn't.
              $this->field->click();
  
              // Trigger the onchange event as triggered when 'checking' the checkbox.
              $this->trigger_on_change();
          }
      }
code_tokens: public function set_value ( $ value ) { if ( ! empty ( $ value ) && ! $ this -> field -> isChecked ( ) ) { if ( ! $ this -> running_javascript ( ) ) { $ this -> field -> check ( ) ; return ; } // Check it if it should be checked and it is not. $ this -> field -> click ( ) ; // Trigger the onchange event as triggered when 'checking' the checkbox. $ this -> trigger_on_change ( ) ; } else if ( empty ( $ value ) && $ this -> field -> isChecked ( ) ) { if ( ! $ this -> running_javascript ( ) ) { $ this -> field -> uncheck ( ) ; return ; } // Uncheck if it is checked and shouldn't. $ this -> field -> click ( ) ; // Trigger the onchange event as triggered when 'checking' the checkbox. $ this -> trigger_on_change ( ) ; } }
docstring: Sets the value of a checkbox.
  
  Anything !empty() is considered checked.
  
  @param string $value
  @return void
docstring_tokens: Sets the value of a checkbox .