* Minimum supported verscon of PHP
 */
define('SC_SUPPORTED_PHP_VERSCON', version_compare(phpversion(), '5.2.4', '>='));
/**
 * Load plugin
 */
require_once SC_PATH . '/load.php';
/**
 * Compatibility check
 */
if (!SC_SUPPORTED_WP_VERSCON || !SC_SUPPORTED_PHP_VERSCON) {
    /**
     * Disable SC and add fail notices if compatibility check fails
     * @return string inserted within the WP dashboard
     */
    sc_deactivate_plugin();
    add_action('admin_head', 'sc_compatibility_check_fail_notices');
    return;
}
/**
 * Load it up!
 */
add_action('plugins_loaded', 'sprout_clients_load', 110);
// load up after Sprout Invoices
/**
 * do_action when plugin is activated.
 * @package Sprout_Clients
 * @ignore
 */
register_activation_hook(__FILE__, 'sc_plugin_activated');
function sc_plugin_activated()
Exemplo n.º 2
0
/**
 * Load the SC application
 *
 * @package Sprout_Clients
 * @return void
 */
function sprout_clients_load()
{
    if (class_exists('Sprout_Client')) {
        sc_deactivate_plugin();
        return;
        // already loaded, or a name collision
    }
    do_action('sprout_clients_preload');
    //////////
    // Load //
    //////////
    /**
     * Master class
     */
    require_once SC_PATH . '/Sprout_Clients.php';
    // models
    require_once SC_PATH . '/models/_Model.php';
    require_once SC_PATH . '/models/Client.php';
    require_once SC_PATH . '/models/Message.php';
    require_once SC_PATH . '/models/Record.php';
    // controllers
    require_once SC_PATH . '/controllers/_Controller.php';
    require_once SC_PATH . '/languages/Sprout_Clients_l10n.php';
    if (!class_exists('Sprout_Invoices')) {
        require_once SC_PATH . '/controllers/admin/_Settings.php';
    }
    require_once SC_PATH . '/controllers/admin/Settings.php';
    // controllers -- clients
    require_once SC_PATH . '/controllers/clients/Clients.php';
    require_once SC_PATH . '/controllers/clients/Clients_Users.php';
    require_once SC_PATH . '/controllers/clients/Clients_Admin_Meta_Boxes.php';
    require_once SC_PATH . '/controllers/clients/Clients_Admin_Table.php';
    require_once SC_PATH . '/controllers/clients/Clients_AJAX.php';
    // controllers -- history
    require_once SC_PATH . '/controllers/history/Client_History.php';
    require_once SC_PATH . '/controllers/history/SI_History.php';
    // controllers -- messages
    require_once SC_PATH . '/controllers/messages/Messages.php';
    require_once SC_PATH . '/controllers/messages/Message_Triggers.php';
    require_once SC_PATH . '/controllers/messages/Messages_Admin_Meta_Boxes.php';
    require_once SC_PATH . '/controllers/messages/Messages_Admin_Settings.php';
    require_once SC_PATH . '/controllers/messages/Messages_Admin_Table.php';
    require_once SC_PATH . '/controllers/messages/Messages_Route.php';
    require_once SC_PATH . '/controllers/messages/Messages_Shortcodes.php';
    require_once SC_PATH . '/controllers/messages/Messages_Templates.php';
    require_once SC_PATH . '/controllers/records/Internal_Records.php';
    require_once SC_PATH . '/controllers/records/Records_Admin_Table.php';
    require_once SC_PATH . '/controllers/updates/Updates.php';
    // template-tags
    require_once SC_PATH . '/template-tags/sprout-clients.php';
    require_once SC_PATH . '/template-tags/forms.php';
    require_once SC_PATH . '/template-tags/ui.php';
    require_once SC_PATH . '/template-tags/users.php';
    require_once SC_PATH . '/template-tags/utility.php';
    /**
     * Master Model
     */
    SC_Post_Type::init();
    /**
     * Client Model
     */
    Sprout_Client::init();
    /**
     * Messages Model
     */
    SC_Message::init();
    /**
     * Shared Models
     */
    SC_Record::init();
    /**
     * Master Controller
     */
    SC_Controller::init();
    /**
     * Records is shared with Sprout Invoices
     */
    SC_Internal_Records::init();
    /**
     * l10n
     */
    SC_l10n::init();
    /**
     * Settings
     */
    if (!class_exists('Sprout_Invoices')) {
        SA_Settings_API::init();
    }
    SC_Settings::init();
    /**
     * Clients
     */
    SC_Clients::init();
    SC_Users::init();
    SC_Clients_Admin_Meta_Boxes::init();
    SC_Clients_Admin_Table::init();
    SC_Clients_AJAX::init();
    SC_Client_History::init();
    SC_Invoices_History::init();
    /**
     * Messaging
     */
    /*/
    	SC_Messages::init();
    	SC_Messages_Meta::init();
    	SC_Messages_Admin_Settings::init();
    	SC_Messages_Route::init();
    	SC_Message_Shortcodes::init();
    	SC_Templates::init();
    	SC_Message_Triggers::init();
    	/**/
    SC_Updates::init();
    do_action('sprout_clients_loaded');
}