<?php
/*
* Plugin-Name: Product Designer App
* Plugin-URI: https://productdesignerapp.com
* Author: productdesignerapp
* Backend
*/

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

if(!class_exists('PDAPP_Admin'))
{
	class PDAPP_Admin
	{
		public function __construct()
		{
			require PDAPP_ADMIN_PLUGIN_DIR .'includes/class-productdesignerapp-admin-menus.php';
			require PDAPP_ADMIN_PLUGIN_DIR .'includes/class-productdesignerapp-admin-fields.php';
			require PDAPP_ADMIN_PLUGIN_DIR .'includes/productdesignerapp-admin-functions.php';
			add_action('admin_init', array(&$this, 'pdapp_init_admin'));
		}

		public function pdapp_init_admin()
		{
			$admin_role = get_role('administrator');
			$admin_role->add_cap(PDAPP_CAP_ACCESS, true);
			$admin_role->add_cap(PDAPP_CAP_ORDERS, true);
			$admin_role->add_cap(PDAPP_CAP_QUOTES, true);
			$admin_role->add_cap(PDAPP_CAP_PRODUCTS, true);
			$admin_role->add_cap(PDAPP_CAP_ARTS, true);
			$admin_role->add_cap(PDAPP_CAP_PRINTINGS, true);
			$admin_role->add_cap(PDAPP_CAP_TEMPLATES, true);
			$admin_role->add_cap(PDAPP_CAP_ADDONS, true);
			$admin_role->add_cap(PDAPP_CAP_THEMES, true);
			$admin_role->add_cap(PDAPP_CAP_UPGRADE, true);
			$admin_role->add_cap(PDAPP_CAP_SETTINGS, true);
		}
	}
	
	new PDAPP_Admin();
}
?>