AlkantarClanX12

Your IP : 216.73.217.24


Current Path : /www/capitalgmcbuickregina_830/public/wp-content/plugins/ninja-forms/includes/Abstracts/
Upload File :
Current File : /www/capitalgmcbuickregina_830/public/wp-content/plugins/ninja-forms/includes/Abstracts/Action.php

<?php if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * Class NF_Abstracts_Action
 */
abstract class NF_Abstracts_Action
{
    /**
     * @var string
     */
    protected $_name  = '';

    /**
     * @var string
     */
    protected $_nicename = '';

    /**
     * @var string
     */
    protected $_section = 'installed';

    /**
     * @var string
     */
    protected $_group = '';

    /**
     * @var string
     */
    protected $_image = '';

    /**
     * @var string
     */
    protected $_documentation_url = '';

    /**
     * @var array
     */
    protected $_tags = array();

    /**
     * @var string
     */
    protected $_timing = 'normal';

    /** @var int */
    public $timing;

    /**
     * @var int
     */
    protected $_priority = '10';
    /** @var int */
    public $priority;

    /**
     * @var array
     */
    protected $_settings = array();

    /**
     * @var array
     */
    protected $_settings_all = array( 'label', 'active' );

    /**
     * @var array
     */
    protected $_settings_exclude = array();

    /**
     * @var array
     */
    protected $_settings_only = array();

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->_settings_all = apply_filters( 'ninja_forms_actions_settings_all', $this->_settings_all );

        if( ! empty( $this->_settings_only ) ){

            $this->_settings = array_merge( $this->_settings, $this->_settings_only );
        } else {

            $this->_settings = array_merge( $this->_settings_all, $this->_settings );
            $this->_settings = array_diff( $this->_settings, $this->_settings_exclude );
        }

        $this->_settings = $this->load_settings( $this->_settings );
    }

    //-----------------------------------------------------
    // Public Methods
    //-----------------------------------------------------

    /**
     * Save
     */
    public function save( $action_settings )
    {
        // This section intentionally left blank.
    }

    /**
     * Process
     */
    public abstract function process( $action_id, $form_id, $data );

    /**
     * Get Timing
     *
     * Returns the timing for an action.
     *
     * @return mixed
     */
    public function get_timing()
    {
        $timing = array( 'early' => -1, 'normal' => 0, 'late' => 1 );

        return intval( $timing[ $this->_timing ] );
    }

    /**
     * Get Priority
     *
     * Returns the priority for an action.
     *
     * @return int
     */
    public function get_priority()
    {
        return intval( $this->_priority );
    }

    /**
     * Get Name
     *
     * Returns the name of an action.
     *
     * @return string
     */
    public function get_name()
    {
        return $this->_name;
    }

    /**
     * Get Nicename
     *
     * Returns the nicename of an action.
     *
     * @return string
     */
    public function get_nicename()
    {
        return $this->_nicename;
    }

    /**
     * Get Section
     *
     * Returns the drawer section for an action.
     *
     * @return string
     */
    public function get_section()
    {
        return $this->_section;
    }

    /**
     * Get Group
     *
     * Returns the drawer group for an action.
     *
     * @return string
     */
    public function get_group()
    {
        return $this->_group;
    }

    /**
     * Get Image
     *
     * Returns the url of a branded action's image.
     *
     * @return string
     */
    public function get_image()
    {
        return $this->_image;
    }

    /**
     * Get Documentation URL
     *
     * Returns the action's documentation URL.
     *
     * @return string
     */
    public function get_doc_url()
    {
        return $this->_documentation_url;
    }

    /**
     * Get Settings
     *
     * Returns the settings for an action.
     *
     * @return array|mixed
     */
    public function get_settings()
    {
        return $this->_settings;
    }

    /**
     * Sort Actions
     *
     * A static method for sorting two actions by timing, then priority.
     *
     * @param $a
     * @param $b
     * @return int
     */
    public static function sort_actions( $a, $b )
    {
        if( ! isset( Ninja_Forms()->actions[ $a->get_setting( 'type' ) ] ) ) return 1;
        if( ! isset( Ninja_Forms()->actions[ $b->get_setting( 'type' ) ] ) ) return 1;

        $aTiming   = Ninja_Forms()->actions[ $a->get_setting( 'type' ) ]->get_timing();
        $aPriority = Ninja_Forms()->actions[ $a->get_setting( 'type' ) ]->get_priority();

        $bTiming   = Ninja_Forms()->actions[ $b->get_setting( 'type' ) ]->get_timing();
        $bPriority = Ninja_Forms()->actions[ $b->get_setting( 'type' ) ]->get_priority();

        // Compare Priority if Timing is the same
        if( $aTiming == $bTiming)
            return $aPriority > $bPriority ? 1 : -1;

        // Compare Timing
        return $aTiming < $bTiming ? 1 : -1;
    }

    protected function load_settings( $only_settings = array() )
    {
        $settings = array();

        // Loads a settings array from the FieldSettings configuration file.
        $all_settings = Ninja_Forms::config( 'ActionSettings' );

        foreach( $only_settings as $setting ){

            if( isset( $all_settings[ $setting ]) ){

                $settings[ $setting ] = $all_settings[ $setting ];
            }
        }

        return $settings;
    }

} // END CLASS NF_Abstracts_Action

Home - Capital GMC Buick Regina

No data

Welcome to Capital GMC BUICK – REGINA

Thank you for choosing Capital GMC Buick | Regina, your premier certified Buick and GMC dealership proudly serving drivers in Regina and the surrounding communities. Whether you’re searching for a brand-new Buick or GMC vehicle or a meticulously inspected pre-owned model, we have a diverse selection to match your needs and lifestyle.

Beyond our impressive inventory, we offer a seamless and stress-free financing experience through our well-connected finance centre, where our team of experts is dedicated to securing the best loan or lease options for you, quickly, transparently, and hassle-free.

But our commitment to you doesn’t stop at the sale. Our state-of-the-art service centre is staffed with skilled Buick and GMC technicians who use the latest equipment and genuine OEM parts to keep your vehicle running at its best. From routine maintenance to complex repairs, we’ve got you covered.

Experience top-tier customer service, quality vehicles, and expert care, all in one place. Visit Capital GMC Buick | Regina today or call us at 306-205-8072 with any questions. We’re here to help!

Ask a Question