GRAYBYTE WORDPRESS FILE MANAGER1077

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/ninja-forms/includes/Fields/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/ninja-forms/includes/Fields//Checkbox.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * Class NF_Fields_Checkbox
 */
class NF_Fields_Checkbox extends NF_Abstracts_Input
{
    protected $_name = 'checkbox';

    protected $_nicename = 'Checkbox';

    protected $_section = 'common';

    protected $_icon = 'check-square-o';

    protected $_type = 'checkbox';

    protected $_templates = 'checkbox';

    protected $_test_value = 0;

    protected $_settings =  array( 'checkbox_default_value', 'checkbox_values', 'checked_calc_value', 'unchecked_calc_value' );

    protected $_settings_exclude = array( 'default', 'placeholder', 'input_limit_set' );

    /**
     * NF_Fields_Checkbox constructor.
     * @since 3.0
     */
    public function __construct()
    {
        parent::__construct();

        $this->_nicename = esc_html__( 'Single Checkbox', 'ninja-forms' );

        $this->_settings[ 'label_pos' ][ 'value' ] = 'right';

        add_filter( 'ninja_forms_custom_columns', array( $this, 'custom_columns' ), 10, 2 );

        add_filter( 'ninja_forms_merge_tag_value_' . $this->_name, array( $this, 'filter_merge_tag_value' ), 10, 2 );
        add_filter( 'ninja_forms_merge_tag_calc_value_' . $this->_name, array( $this, 'filter_merge_tag_value_calc' ), 10, 2 );
        add_filter( 'ninja_forms_subs_export_field_value_' . $this->_type, array( $this, 'export_value' ), 10, 2 );
    }

    /**
     * Admin Form Element
     * Display the checkbox on the edit submissions area.
     * @since 3.0
     *
     * @param $id Field ID.
     * @param $value Field value.
     * @return string HTML used for display of checkbox.
     */
    public function admin_form_element( $id, $value )
    {
        // If the checkboxes value is 1 or on...
        if( 'on' == $value || 1 == $value ) {
            // ...this variable to checked.
            $checked = 'checked';
        } else {
            // ...else leave the variable empty.
            $checked = '';
        }

        // Return HTML to be output to the submission edit page.
        return "<input type='hidden' name='fields[$id]' value='0' >
                <input type='checkbox' name='fields[$id]' id='' $checked>";
    }

    /**
     * Custom Columns
     * Creates what is displayed in the columns on the submissions page.
     * @since 3.0
     *nf_subs_export_pre_value
     * @param $value checkbox value
     * @param $field field model.
     * @return $value string|void
     */
    public function custom_columns( $value, $field )
    {
        // If the field type is equal to checkbox...
        if( 'checkbox' == $field->get_setting( 'type' ) ) {
            // Backwards compatibility check for the new checked value setting.
            if( null == $field->get_setting( 'checked_value' ) && 1 == $value || 'on' == $value ) {
                return esc_html__( 'Checked', 'ninja-forms' );
            } elseif( null == $field->get_setting( 'unchecked_value' ) && 0 == $value ) {
                return esc_html__( 'Unchecked', 'ninja-forms');
            }

            // If the field value is set to 1....
            if( 1 == $value || 'on' == $value ) {
                // Set the value to the checked value setting.
                $value = $field->get_setting( 'checked_value' );
            }
            // Unless we've somehow gotten the display value in here...
            elseif ( $field->get_setting( 'checked_value' ) != $value ) {
                // Set the value to the unchecked value setting.
                $value = $field->get_setting( 'unchecked_value' );
            }
        }
        return $value;
    }

    /**
     * Filter Merge Tag Value
     * This is what provides the merge tag with the fields value.
     * @since 3.0
     *
     * @param $value Field value
     * @param $field field model
     * @return string|void
     */
    public function filter_merge_tag_value( $value, $field )
    {
        // If value is true, return checked value setting.
        if( $field[ 'settings' ][ 'value' ] ) return $field[ 'settings' ][ 'checked_value' ];
        // Else return unchecked value setting.
        return $field[ 'settings' ][ 'unchecked_value' ];
    }

    /**
     * Filter Merge Tag Value Calc
     * Provides the calculation value when the merge tag is used.
     * @since 3.0
     *
     * @param $value checkbox value
     * @param $field field model
     * @return $field
     */
    public function filter_merge_tag_value_calc( $value, $field )
    {
        // If value is equal to 1...
        if ( 1 == $value ) {
            // ...return the checked calc value of the field model.
            return $field[ 'checked_calc_value' ];
        } else {
            // ...else return the unchecked calc value of the field model.
            return $field[ 'unchecked_calc_value' ];
        }
    }

    /**
     * Export Value
     * Determines the value to send to submission export.
     * @since 3.0
     *
     * @param $value checkbox field value
     * @param $field checkbox field model
     * @return string|void
     */
    public function export_value( $value, $field )
    {
        // @TODO: Why were these values translated in the first place?
        // If value is equal to checked or unchecked return the value
        if ( __( 'checked', 'ninja-forms' ) == $value ||
            __( 'unchecked', 'ninja-forms' ) == $value ) return $value;

        // Creating settings variables for our check.
        if( is_array( $field ) ) {
            // The email action sends teh field variable as an array
            $checked_setting    = $field[ 'setting' ][ 'checked_value' ];
            $unchecked_setting  = $field[ 'setting' ][ 'unchecked_value' ];
        } else {
            $checked_setting    = $field->get_setting( 'checked_value' );
            $unchecked_setting  = $field->get_setting( 'unchecked_value' );
        }

        // If the the value and check to see if we have checked and unchecked settings...
        if ( ( 1 == $value || 'on' == $value ) && ! empty( $checked_setting ) ) {
            // ...if we do return checked setting
            return $checked_setting;
        } elseif ( 0 == $value && ! empty( $unchecked_setting ) ) {
            // ...else return unchecked setting.
            return $unchecked_setting;
        /*
         * These checks are for checkbox fields that were created before version 3.2.7.
         */
        } elseif ( 1 == $value || 'on' == $value ) {
            return esc_html__( 'checked', 'ninja-forms' );
        } elseif ( 0 == $value ) {
            return esc_html__( 'unchecked', 'ninja-forms' );
        }
    }
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:23
giriqfky / giriqfky
0644
Address.php
0.678 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Address2.php
0.649 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Button.php
0.546 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Checkbox.php
6.439 KB
July 07 2025 22:00:20
giriqfky / giriqfky
0644
City.php
0.581 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Color.php
0.608 KB
March 15 2016 02:24:24
giriqfky / giriqfky
0644
Confirm.php
1.012 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
CreditCard.php
0.572 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
CreditCardCVC.php
0.803 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
CreditCardExpiration.php
0.975 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
CreditCardFullName.php
0.842 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
CreditCardNumber.php
0.844 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
CreditCardZip.php
0.776 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Date.php
9.434 KB
July 07 2025 22:00:20
giriqfky / giriqfky
0644
Email.php
1.603 KB
September 30 2024 22:20:16
giriqfky / giriqfky
0644
FirstName.php
1.134 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
HTML.php
2.262 KB
July 29 2024 13:30:44
giriqfky / giriqfky
0644
Hidden.php
0.954 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
LastName.php
1.126 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
ListCheckbox.php
2.09 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
ListCountry.php
4.855 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
ListImage.php
5.282 KB
October 24 2024 00:36:22
giriqfky / giriqfky
0644
ListModifier.php
0.468 KB
March 15 2016 02:24:24
giriqfky / giriqfky
0644
ListMultiSelect.php
2.031 KB
August 17 2021 13:06:24
giriqfky / giriqfky
0644
ListRadio.php
0.999 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
ListSelect.php
1.035 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
ListState.php
1.375 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Note.php
1.498 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Number.php
0.683 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Password.php
0.779 KB
February 08 2021 23:03:26
giriqfky / giriqfky
0644
PasswordConfirm.php
2.454 KB
March 12 2025 21:40:36
giriqfky / giriqfky
0644
Phone.php
0.61 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Product.php
8.379 KB
February 22 2023 23:20:58
giriqfky / giriqfky
0644
Quantity.php
0.673 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Recaptcha.php
3.26 KB
October 04 2023 20:07:10
giriqfky / giriqfky
0644
RecaptchaV3.php
0.422 KB
June 07 2021 21:40:12
giriqfky / giriqfky
0644
Repeater.php
8.702 KB
April 30 2024 21:16:06
giriqfky / giriqfky
0644
Shipping.php
2.505 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Spam.php
1.817 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
StarRating.php
0.771 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Submit.php
0.867 KB
July 29 2024 13:30:44
giriqfky / giriqfky
0644
Terms.php
6.291 KB
November 18 2024 20:55:28
giriqfky / giriqfky
0644
Textarea.php
1.597 KB
February 09 2023 21:52:18
giriqfky / giriqfky
0644
Textbox.php
1.011 KB
February 09 2023 21:52:18
giriqfky / giriqfky
0644
TimedSubmit.php
0.537 KB
March 15 2016 02:24:24
giriqfky / giriqfky
0644
Total.php
1.192 KB
February 22 2023 23:20:58
giriqfky / giriqfky
0644
Unknown.php
2.835 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
Zip.php
0.596 KB
February 04 2020 21:17:42
giriqfky / giriqfky
0644
hr.php
0.88 KB
July 29 2024 13:30:44
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF