skipv1_0_0Checkbox

The Facebook Fanpage Import skip v1 0 Checkbox class.

Defined (1)

The class is defined in the following location(s).

/includes/skip/elements/forms/checkbox.php  
  1. class Checkbox extends Form_Element{ 
  2.  
  3. /** 
  4. * Constructor 
  5. * @since 1.0 
  6. * @param string $name The name of the checkbox field. 
  7. * @param string $value The value of the checkbox element which will be saved if box is checked. 
  8. * @param array/string $args List of Arguments. 
  9. */ 
  10. function __construct( $name, $value, $label = FALSE, $args = array() ) { 
  11. global $skip_hidden_elements; 
  12.  
  13. $defaults = array( 
  14. 'checked' => FALSE,  
  15. ); 
  16. $args = wp_parse_args( $args, $defaults ); 
  17. $args[ 'label' ] = $label; 
  18. $args[ 'close_tag' ] = FALSE; // No Close tag for Input type Button 
  19.  
  20. parent::__construct( 'input', $name, $args ); 
  21.  
  22. $this->add_param( 'type', 'checkbox' ); 
  23. $this->add_param( 'value', $value ); // Overwriting value from DB 
  24.  
  25. if( '' != $this->value || $this->value == 'checked' || $args[ 'checked' ] ) 
  26. $this->add_param( 'checked', 'checked' ); 
  27.  
  28. }