A QCodo powered CMS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.3 KiB

  1. <?php
  2. /**
  3. * The Application class is an abstract class that statically provides
  4. * information and global utilities for the entire web application.
  5. *
  6. * Custom constants for this webapp, as well as global variables and global
  7. * methods should be declared in this abstract class (declared statically).
  8. *
  9. * This Application class should extend from the ApplicationBase class in
  10. * the framework.
  11. */
  12. abstract class QApplication extends QApplicationBase {
  13. /**
  14. * This is called by the PHP5 Autoloader. This method overrides the
  15. * one in ApplicationBase.
  16. *
  17. * @return void
  18. */
  19. public static function Autoload($strClassName) {
  20. // First use the Qcodo Autoloader
  21. if (!parent::Autoload($strClassName)) {
  22. // NOTE: Run any custom autoloading functionality (if any) here...
  23. }
  24. }
  25. /**
  26. * Method will setup Internationalization.
  27. * NOTE: This method has been INTENTIONALLY left incomplete.
  28. * @return void
  29. */
  30. public static function InitializeI18n() {
  31. if (isset($_SESSION)) {
  32. if (array_key_exists('country_code', $_SESSION))
  33. QApplication::$CountryCode = $_SESSION['country_code'];
  34. if (array_key_exists('language_code', $_SESSION))
  35. QApplication::$LanguageCode = $_SESSION['language_code'];
  36. }
  37. /*
  38. * NOTE: This is where you would implement code to do Language Setting discovery, as well, for example:
  39. * Checking against $_GET['language_code']
  40. * checking against session (example provided below)
  41. * Checking the URL
  42. * etc.
  43. * Options to do this are left to the developer.
  44. */
  45. // Initialize I18n if QApplication::$LanguageCode is set
  46. if (QApplication::$LanguageCode)
  47. QI18n::Initialize();
  48. // Otherwise, you could optionally run with some defaults
  49. else {
  50. // QApplication::$CountryCode = 'us';
  51. // QApplication::$LanguageCode = 'en';
  52. // QI18n::Initialize();
  53. }
  54. }
  55. ////////////////////////////
  56. // QApplication Customizations (e.g. EncodingType, Disallowing PHP Session, etc.)
  57. ////////////////////////////
  58. // public static $EncodingType = 'ISO-8859-1';
  59. // public static $EnableSession = false;
  60. ////////////////////////////
  61. // Additional Static Methods
  62. ////////////////////////////
  63. // NOTE: Define any other custom global WebApplication functions (if any) here...
  64. }
  65. ?>