# Assets Folder/Files

The **assets** folder contains subfolders and files used across the site. The files are included in an assets folder of the project. The items listed below are subfolders within the **assets** folder.

##### <span style="color: #ba372a;">**Main Level Files**</span>

The main level assets files are those used on basically every page on the site. Files to set the configuration, navigation, header, and footer. See the section on *Page Structure* for more detail on some of these files.

##### <span style="color: #ba372a;">**Assets Subfolders**</span>

<span style="color: #000000;">Within the assets folder are several subfolders as detailed below.</span>

1. **ajax** - Ajax files are used to obtain records from tables in the database. The term ajax comes for the JavaScript method for obtaining records from a database. Files are named 'ajax\_*Module*.php' where *Module* generally identifies the associated database table.
2. **builds** - These files are used to concatenate specific multiple files into a single file. This provides for faster page loading for the site. Specific build routines include: 
    - **buildAllConfigPhp.php** - This *build* routine concatenates the following files in the *json* folder and places the output (i.e., common\_Config.php) in the *assets* folder. <span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400;">Only the output file is uploaded to the main server. Note: the *Name* indicated in the below file names indicates the County name (e.g., Fannin).</span>
        - County\_master.json
        - *Name*\_config.json
        - *Name*\_navbar.json
        - *Name*\_footer.json
    - **buildAllFunctionsJava.php** - This *build* routine concatenates the following files in the assets/functions\_java folder. The output file (e.g., allFunctionsJava.js) is placed in the *assets/functions\_java* folder. Only the output file is uploaded to the main server. Note: the *Name* indicated in the below files names indicates the County name (e.g., Fannin). 
        - *Name*\_config.js - various js configuration values used is js code.
        - *Name*\_article.js - various js values used in *articles*.
        - *Name*\_maps.js - various js valued used in maps.
        - \_functionName.js - various js functions used throughout the site.
    - **buildAllFunctionsPhp.php** - This *build* routine concatenates the following files in the assets/functions\_php folder. The output file (e.g., allFunctionsPhp.php) is placed in the *assets/functions\_php* folder. Only the output file is uploaded to the main server. Note: the *Name* indicated in the below files names indicates the County name (e.g., Fannin). 
        - \_functionName.php - various php functions used throughout the site. Note: some of the functions are used more than others and are thus included first.
    - **buildAllStylesCSS.php** - This *build* routine concatenates the following files in the scss/base folder. The output file (e.g., allStylesCSS.scss) is placed in the scss/base folder. Because of the nature of the 'variables' files they must be included first. This *build* routine is much more complicated that the previous *build* routine. 
        - common\_variables-root.scss - all css variables used throughout the site.
        - common\_variables-sass.scss - the sass variables used for media breaks.
        - \_common-nn-\*.scss - various 'base' style files based on category of use.
    - **IMPORTANT:** Given that these *build* routines concatenate multiple modules into one file, it is therefore *required* that if any one of the concatenated items is modified, then the *build* routine must be used to include the change into the built file.
    - **NOTE:** - Within the vsCode IDE are individual task used to invoke a specific build and also one that will invoke all builds.
3. **functions\_java** - JavaScript functions are used by JavaScript files across the site. All file names begin with an underscore character (\_). This prevents individual function files from being uploaded to the server when saved after an update. See 2. above for important information about these elements. 
    - **\_functionName.js** - individual function files used throughout the site.
    - **allFunctionsJava.js** - This is the output of the build routine mentioned above. *County* in these files would be the county name. 
        - *County*\_article.js - A js array detailing the elements used with article files
        - *County*\_co\_maps.js - A js array detailing the map elements used for headings and coordinates.
        - *County*\_config.js - A js array similar to the *County*\_config.php file.
4. **functions\_php** - PHP functions are used by PHP files across the site. All names begin with an underscore character (\_). As with the JavaScript functions the individual function files are combined into one file. 
    - **\_functionName.php** - individual php functions.
    - **allFunctionsPhp.php** - concatenated php functions combined with build routine mentioned above.
5. **json** - Several json files are used to specify various entities of the site. Except for the *County\_master.json* file, each file MUST begin with the name of the county (i.e., Delta, Fannin, Holmes, etc.). See the section on *Special Files* for more detail. See the Json chapter for more detail about these files. 
    - **geojson** - Included within the json folder is a folder for the geojson files. These files detail the coordinates of an entity, The files are of two varieties. See the section on *Special Files* for more detail. Files for both Counties and Towns are included in this subfolder. 
        - **geopoly\_cty\_*name*.json** - Provides the outline coordinates for the main county and the surrounding counties. The *name* part of the filename indicates the county name in lowercase letters.
        - **geopoly\_twn\_*name*.json** - Provides the outline coordinates for any towns within the area of the main county.
    - **County\_master.json** - Master information for the home county.
    - ***Name*\_config.json** - Configuration information for the county
    - ***Name*\_database.json** - Information needed to connect to the Database. This file MUST be included in the gitIgnore file to prohibit its being uploaded to the git Responsory. See the Git Chapter for more information on git.
    - ***Name*\_footer.json** - Configuration information for footer displays fields.
    - ***Name*\_navbar.json** - Configuration information for menu display fields.
    - ***Name*\_sitemap.json** - Configuration information for creation of sitemap records. See the sitemap chapter for more informaton.
    - ***Name*\_subnav.json** - Configuration information for creation of the dropdown menu items on a page.

The files listed below reside at the main level of the assets folder.

- **common\_Config.php** -
- **common\_CronReport.php** - Code used to display results of a manual CRON script run.
- **common\_Dbconn.php** - Code used to connect to the Database.
- **common\_Footer.php** - Code used to build the Footer.
- **common\_LoadCSS.php** - Code used to load the necessary CSS files.
- **common\_LoadJava.php** - Code used to load the necessary js files.
- **common\_LoadSite.php** - Code used to load the site specific files.
- **common\_Navbar.php** - Code used to build the Navbar.
- **common\_SiteSearch.php** - Code used to build the Site Search parameters.
- ***Name*\_config.js** -
- ***Name*\_search.js** -
- **reports\_cron.php** - Code used to display the results of a manual CRON script run.