Sugar Community Edition 5.2 Documentation
Sugar Developer Guide
Version 5.2
Chapter 1 SugarCRM Overview : Application Framework Overview
SugarCRM code resides in various directories within the Sugar installation. The structure of the directories within the Sugar application consists of the following root level directories:
|
•
|
cache: Various cache files written to the file system to minimize database accesses and store user interface templates created from metadata. Also files uploaded into the application such as Note Attachments or Documents reside in this directory (refer to ‘upload_dir’ parameter in the config.php file) which means that this is an active cache directory and not all files can be deleted from this directory.
|
|
•
|
custom: Stores upgrade-safe customizations such as custom field definitions, user interface layouts and business logic hooks.
|
|
•
|
data: Key system files are located here, most notably the SugarBean base class which controls the default application logic for all business objects in Sugar.
|
|
•
|
include: Many Sugar utility functions are located here as well as other libraries that Sugar utilizes as part of its operations. Most notably in this directory is the utils.php file that contains all of the most widely used utility functions.
|
|
•
|
metadata: This file contains relationship metadata for all many-to-many data relationships between the business objects.
|
|
•
|
modules: This folder contains all modules in the system. Custom modules installed through the Module Loader exist here as well.
|
|
•
|
Controller: Directs all incoming page requests. It can be overridden in each module to change the default behavior. It relies on Entry point parameters - described below - to serve the appropriate page.
|
|
•
|
Views: A set of user interface actions managed by the Controller, the default views in Sugar include the DetailView, EditView and ListView.
|
|
•
|
Display Strings: SugarCRM is fully internationalized and localizable. Every language pack has its own set of display strings which is the basis of language localization. There are two types of display strings in the Sugar application: application strings and module strings. Application strings contain the user interface labels displayed globally throughout the application. The $GLOBALS[‘app_strings’] array contains these labels. There is also the $GLOBALS[‘app_list_strings’] array which contains the system-wide dropdown list values. Each language has its own application strings variables. The $GLOBALS[‘mod_strings’] array contains strings specific to the current, or in-focus, module..
|
|
•
|
Dropdown Lists: Dropdown lists are represented as ‘name’ => ‘value’ array pairs located in the application strings as mentioned above. The ‘name’ value is stored in the database where the ‘value’ is displayed to the user in the UI. You are able to create and edit dropdowns and their values via the UI in the admin Studio tool. For working with dropdown lists in EditViews use the handy get_select_options_with_id() utility function to help render the <select> input options. Also use the handy translate() utility function for translating whatever string key you are working with into the user’s currently selected display language.
|
|
•
|
SugarBean.php: This file located under the ‘<sugar root>/data’ folder contains the SugarBean base class used by all business entity or module objects. Any module that reads, writes or displays data will extend this class. The SugarBean performs all of the heavy lifting for data interactions, relationship handling, etc.
|
|
•
|
modules.php: The modules.php file is a critical file in Sugar. It contains several variables that define which modules are active and usable in the application.
|
|
•
|
$dictionary: The $dictionary array contains all module field variable definitions (vardefs), as well as the relationship metadata for all tables in the database. This array is dynamically built based upon the vardefs.php definitions.
|
The primary user interface entry point for Sugar is through index.php located in the root Sugar folder. There are three main parameters for most calls within Sugar, they are:
|
•
|
module: The module to be accessed as part of the call
|
|
•
|
action: The action to be taken by the application within the module
|
|
•
|
record: The record id to be accessed
|
Note: For version 5.1 most entry points were consolidated into index.php. Previous versions had other files as entry points into the application.
Copyright 2004-2009 SugarCRM Inc.
Product License


| 







