MDL-18375 calendar: only display the YUI2 calendar when the Gregorian type is used
MDL-18375 calendar: moved the location of the calendar type select box when editing a course
MDL-18375 calendar: added the userdate and usergetdate functions to the calendar type
MDL-18375 calendar: edited the calendartype column in the course and user table in the install.xml file and created an upgrade path
MDL-18375 calendar: refactored the datetime user field so that it now uses the calendar type system
MDL-18375 calendar: implemented the usage of the recently introduced automatic class loading
MDL-18375 calendar: created a test calendar type to use for PHPUnit tests and added initial PHPUnit tests
MDL-18375 calendar: changed the order of the parameters passed to conform to other core functions
MDL-18375 calendar: removed uses of PHP date functions not present on all PHP installs

Changed the logic of the test calendar so that it does not use the
Julian date calendar as the PHP date conversion functions (eg. jdtogregorian)
are not always present on all PHP installs. Also split the unit test
into multiple tests and rearranged the order parameters were passed to
certain functions as they were changed in the previous commit.
MDL-18375 calendar: added a PHPUnit test to ensure the datetime user profile field settings are saved correctly
MDL-18375 calendar: made userdate and usergetdate abstract to ensure developers implement this functionality in their calendar type
MDL-18375 calendar: added '\' before each use of the core_calendar namespace
MDL-18375 calendar: removed unnecessary functions for converting years for the datetime user profile field and use existing functions instead
MDL-18375 calendar: renamed the userdate/usergetdate function in the calendar type to be more descriptive

Also tidied up PHPDocs for these functions.
MDL-18375 calendar: PHPDoc tidy up as well as some other minor changes
MDL-18375 calendar: only display the choice of calendar types if there is more than one
MDL-18375 calendar: added the Gregorian calendar type to the standard list of plugins
MDL-18375 calendar: added condition to ensure calendar type exists before loading
MDL-18375 calendar: changed the name of the function factory() to be more descriptive
MDL-18375 calendar: removed usage of the calendar type in the usergetdate function

The usergetdate function is not only used to display dates, it is also passed to the function
make_timestamp. This means users using another calendar type other than Gregorian will generate
incorrect timestamps which may be saved in the DB or used to populate the date_selector and
date_time_selector elements. For example, when creating an assignment using another calendar
type other than Gregorian, the mod_form.php file calls $this->apply_admin_defaults() which uses
the function usergetmidnight to set the "Allow submissions from" date to today's date and the
"Due date" field to 7 days in the future. The usergetmidnight function calls usergetdate which
is then passed to make_timestamp. Since the usergetdate function was using the calendar type's
timestamp_to_date_array function the date being passed to make_timestamp was not in Gregorian.
So, when using the hijri calendar the year 1434 was being passed which was generating a large
negative number as the timestamp which was then used to populate the date fields.