SciCrunch / SciCrunch-Portal

SciCrunch Portal
Other
3 stars 0 forks source link

SciCrunch UI Code

The SciCrunch UI is done in PHP using the Unify Templating as the guide for designing the site.

Requirements

Configuration Files

The following files will need to be modified to make SciCrunch work

Folder Descriptions

Commonly used variables

Common Class Functions

Interface DB Model

The interface composed of HTML, CSS, and Javascript. These are clientside code in that the server passes the code to a User's browser to interpret (hence differences in how things look across browsers). Client side code can be viewed and altered by the user, while server side code is never shown to the user. PHP is server side code in that the server runs the PHP code on the server and the result of the run should be HTML or a response telling the server where to go instead. You can use PHP code and HTML code within each other, but PHP code will be executed before the page is shown to the user and will not run after the page loads. JS and CSS handle the postpage load interactions like opening and closing dialogs.

Forms are created by PHP/HTML and filled out by users. Forms have a "method" and an "action". The method is usually either post or get. Get will show the user entered data as a parameter in the URL while the POST will pass it as data silently. GET is used more for search forms while POST is used for user data. The action determines where the browser will go after submission. Most SciCrunch data forms will go to the /forms folder, where those scripts will handle the user data and push that data into the Database/perform actions and then tell the server to go somewhere to show the result.

The /form scripts access a $_POST global variable that holds post data in a key:value array. The script will pull the data from that variable and pass that into the appropriate Class for what is being submitted and calls the classes Class::insertDB or Class::updateDB depending on what the action is. The class functions use the Connection class to talk to the Database if needed.

External frameworks and libraries used:

Unify is located in the directory assets. All the other plugins are located in assets/plugins