<?php

/**
 * The admin-specific functionality of the plugin.
 *
 * @link       https://example.com
 * @since      1.0.0
 *
 * @package    Instant_Popup_Builder
 * @subpackage Instant_Popup_Builder/admin
 */

/**
 * The admin-specific functionality of the plugin.
 *
 * Renders popup settings sections.
 *
 * @package    Instant_Popup_Builder
 * @subpackage Instant_Popup_Builder/admin
 * @author     7th Sky Software’s <example@gmail.com>
 */

namespace InstantPopup\Settings;

if (!defined('ABSPATH')) {
    exit;
}

if (!class_exists('class_instant_setting')) {

    class class_instant_setting
    {

         protected static $tabs = [

            "general" => 'General',
            "design" => 'Design',
            "advance" => 'Advanced'
         ];

        /**
         * General Setting for all popups
         *
         * @since 1.0.0
         * @package category
         * @param mixed $name
         * @return string
         */

        public static function general_setting($name = 'name')
        {

            if (isset($name)) {

                return  require_once plugin_dir_path(__FILE__) . 'general/setting-'.$name.'.php';

            } else {

                return false;

            }
        }

        /**
         * Design Setting for all popups
         *
         * @since 1.0.0
         * @package category
         * @param mixed $name
         * @return string
         */

        public static function design_setting($name = 'name')
        {

            if (isset($name)) {

                return require_once plugin_dir_path(__FILE__) . 'design/setting-'.$name.'.php';

            } else {

                return false;
            }
        }

        /**
         * Advance Setting for all popups
         *
         * @since 1.0.0
         * @package category
         * @param mixed $name
         * @return string
         */

         public static function advance_setting($name = 'name')
         {

             if (isset($name)) {

                 return require_once plugin_dir_path(__FILE__) . 'advance/setting-'.$name.'.php';
             } else {

                 return false;
             }
        }

        /**
         * Set tabs
         *
         * @param array
         * @return void
         *
         */
        public static function setting_set_tabs( $tabs=[]){

            self::$tabs= $tabs;
        }

         /**
         * Get setting tabs
         *
         * @return array
         *
         */
        public static function setting_get_tabs(){

            return self::$tabs;
        }

        /**
         * Conditions Setting for all popups
         *
         * @since 1.0.0
         * @package category
         * @param mixed $name
         * @return string
         */

         public static function condition_setting($name = 'name')
         {

             if (isset($name)) {
                 return require_once plugin_dir_path(__FILE__) . 'conditions/setting-'.$name.'.php';
             } else {

                 return false;
             }
        }

    }
}
