<?php
/**
 * Sifency Theme Builder Module Loader
 *
 * Loads all components of the theme builder module.
 */

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

define( 'SIFENCY_TB_VERSION', '1.0.4' );
define( 'SIFENCY_TB_PATH', trailingslashit( __DIR__ ) );
define( 'SIFENCY_TB_URL', plugin_dir_url( __FILE__ ) );

/**
 * Files to load
 */
$sifency_tb_files = array(
	'includes/functions/assets-load.php',
	'includes/class-sifency-theme-builder-master.php',
	'includes/builder/class-sifency-cpt.php',
	'includes/builder/class-content-type.php',
	'includes/builder/class-new-template.php',
	'includes/admin/class-sifency-ajax.php',
	'includes/admin/class-themebuilder-navigation-registry.php',
	'includes/admin/themebuilder-navigation-filter-helpers.php',
	'includes/admin/class-navigation.php',
	'includes/admin/class-sifency-admin.php',
	'includes/classes/class-message.php',
	'includes/classes/class-condition.php',
	'includes/classes/class-upsell.php',
	'includes/base/class-sifency-assets.php',
	'includes/helpers/class-sifency-frontend-helper.php',
	'includes/functions/functions.php',
	'includes/classes/class-cpt-module-manager.php',
	'includes/admin/class-cpt-modules-settings.php',
	'post-type/post-type-init.php',
	'post-type/metabox-init.php',
	'profile/class-sifency-user-profile.php',
	'profile/user-profile-definitions.php',
	'nav/class-sifency-nav-menu-fields.php',
	'nav/nav-menu-definitions.php',
);

/**
 * Require files safely
 */
foreach ( $sifency_tb_files as $sifency_tb_file ) {
	$path = SIFENCY_TB_PATH . $sifency_tb_file;
	if ( file_exists( $path ) ) {
		require_once $path;
	}
}
/**
 * Initialize the master class
 */
if ( class_exists( 'Sifency_Addons_Theme_Builder_Master' ) ) {
	Sifency_Addons_Theme_Builder_Master::instance();

}
