Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # functions.php
- <?php
- // Load the Webeo_Core class
- require_once TEMPLATEPATH . '/lib/webeo/Webeo_Core.class.php';
- // Instantiate Webeo Themeframework
- add_action('after_setup_theme', create_function('', 'return Webeo_Core::getInstance()->init();'), 9);
- ?>
- # Webeo_Core.class.php
- <?php
- class Webeo_Core {
- // ...
- /**
- * Constructor for singleton pattern
- *
- * @return void
- */
- private function __construct() {
- }
- /**
- * Make clone private, so nobody can clone the instance
- *
- * @final
- * @return void
- */
- final private function __clone() {
- }
- /**
- * Get instance of Webeo_Core
- * Singleton pattern
- *
- * @static
- * @return Webeo_Core object
- */
- public static function getInstance() {
- if (is_null(self::$_instance)) {
- self::$_instance = new Webeo_Core();
- }
- return self::$_instance;
- }
- /**
- * Initialize the framework
- *
- * @return void
- */
- public function init() {
- if (self::$_initialized) {
- return;
- }
- // ...
- // FIXME
- // Set namespace for this theme and define path to language files
- $languages = ( is_dir( TEMPLATEPATH . '/languages' ) ) ? TEMPLATEPATH . '/languages' : TEMPLATEPATH;
- load_theme_textdomain('webeo', $languages);
- // ...
- self::$_initialized = true;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement