Welcome to the PacMass Documentation!

This document is meant to be the documentation for www.pacmass.org. It will contain information about the web site and it’s outward facing functionality, as well as internal information about adminstrating the web site.

Administrators will have access to another, external file containing other pertinent information about the site, including credentials and protected data.

Table of Contents

PacMass Web Site Basics

The PacMass web site is built with HTML, CSS, PHP and JavaScript. The backend, server-side code is written in PHP and the front end styling is done by CSS. Some validation, images, buttons, etc are spiced up with JavaScript.

The key here is that while JavaScript is used, it should not be required on the site, as some users don’t use JavaScript or have it turned off. Therefore, all form validation is also validated with PHP on the server.

Images used for Buttons

The images used for the navigation buttons were created in Illustrator and are saved as vectors, eg *.ai files. These are attached to this documentation repository. You can download them here.

You will need a vector image editor to change the images, but otherwise, the PNG files are what the site uses. Then, JavaScript is used to make them change colors on hover. Note, this can be accomplished with CSS, as well, and is probably better than JS for this task.

Notes on JavaScript (JS), jQuery and fancyBox

As mentioned, the site uses JS in a variety of places, including some jQuery. An additional library, called fancyBox (a lightbox-like app), is also employed for photo pop up windows. It has very cool options, so in the future it can be used for much, much more.

For example, the page http://www.pacmass.org/past-meetings/ use FancyBox to roll open each past meeting.

Currently, only a subset of total past meetings are listed here, so this is a task that needs to be completed in the future.

PHP Classes in PacMass Development

PHP has complete Object Oriented Programming support, and using PHP classes are a useful way to create powerful web applications. In the case of PacMass, the site uses classes to handle repeated, shared functions throughout the site.

For example, for the validation on the server-side, a PHP class is used:

class Validation {

    // Check for topic choice
    pubic function check_topic($field) {

        if ($field == 'default_option') {
            $error = "Please select a topic.<br />";
            return $error;
        }

        else {
            $error = '';
            return $error;
        }
    }

    . . . // more functions

}

This makes writting code quicker, and these classes can be used throughout the site. Other classes include Utility, Naviagtion, etc. Each class has a set of functionality that can be used to do work. The format to use these classes in the site code might look like this:

require_once($includes_dir . $ds . 'Navigation.php');
$navigation = new Navigation();
$navigation -> print_navigation($image_dir, $ds, $page_nav_dk, $page_nav_lt);

This would create an instance of the Navigation class and then run it’s print_navigation method with the arguments supplied as PHP variables.

Source Code Control and Version Control - Bitbucket

This project uses Bitbucket for mercurial source control hosting. For further reading on source control, vist Wikipedia.

For a mercurial tutorial, visit this cool intro written by Joel Spolsky.

Basically, once you understand how this works, you will need to keep your local environment synchronized with the repository on Bitbucket. This makes it easy for multiple developers to work on the same code base.

If you come on as a developer with this project, the repository will be made available to you and any further questions answered.

Indices and tables