Ver Fonte

#10 - Interfaces

Alex Trofimov há 13 anos atrás
pai
commit
8642b822eb
45 ficheiros alterados com 245 adições e 213 exclusões
  1. 38 1
      inc/classes/BxDol.php
  2. 1 1
      inc/classes/BxDolAccountQuery.php
  3. 1 1
      inc/classes/BxDolAcl.php
  4. 12 6
      inc/classes/BxDolAclQuery.php
  5. 1 1
      inc/classes/BxDolCaptcha.php
  6. 9 6
      inc/classes/BxDolConfig.php
  7. 1 1
      inc/classes/BxDolConnection.php
  8. 8 6
      inc/classes/BxDolDb.php
  9. 1 1
      inc/classes/BxDolEditor.php
  10. 1 1
      inc/classes/BxDolEmailTemplates.php
  11. 8 6
      inc/classes/BxDolFile.php
  12. 1 1
      inc/classes/BxDolGrid.php
  13. 8 6
      inc/classes/BxDolImageResize.php
  14. 8 6
      inc/classes/BxDolImageTranscoder.php
  15. 2 2
      inc/classes/BxDolKey.php
  16. 8 6
      inc/classes/BxDolLanguages.php
  17. 1 2
      inc/classes/BxDolLanguagesQuery.php
  18. 1 1
      inc/classes/BxDolMenu.php
  19. 7 5
      inc/classes/BxDolModule.php
  20. 10 6
      inc/classes/BxDolModuleQuery.php
  21. 1 4
      inc/classes/BxDolPage.php
  22. 7 5
      inc/classes/BxDolParams.php
  23. 1 1
      inc/classes/BxDolPermalinks.php
  24. 1 1
      inc/classes/BxDolProfile.php
  25. 1 2
      inc/classes/BxDolProfileQuery.php
  26. 1 1
      inc/classes/BxDolProfileUndefined.php
  27. 8 6
      inc/classes/BxDolSession.php
  28. 3 1
      inc/classes/BxDolSocialSharing.php
  29. 9 6
      inc/classes/BxDolStorage.php
  30. 11 8
      inc/classes/BxDolTemplate.php
  31. 9 6
      inc/classes/BxDolXmlParser.php
  32. 1 1
      modules/boonex/persons/classes/BxPersonsModule.php
  33. 1 1
      splash.php
  34. 8 6
      studio/classes/BxDolStudioCart.php
  35. 6 6
      studio/classes/BxDolStudioInstallerUtils.php
  36. 7 6
      studio/classes/BxDolStudioJson.php
  37. 4 4
      studio/classes/BxDolStudioLanguagesUtils.php
  38. 8 6
      studio/classes/BxDolStudioOAuth.php
  39. 3 3
      studio/classes/BxDolStudioTemplate.php
  40. 3 3
      studio/classes/BxDolStudioWidgetsQuery.php
  41. 2 2
      studio/template/scripts/BxBaseStudioFunctions.php
  42. 3 3
      studio/template/scripts/BxBaseStudioMenuTop.php
  43. 10 58
      template/scripts/BxBaseConfig.php
  44. 9 6
      template/scripts/BxBaseFunctions.php
  45. 1 1
      template/scripts/BxBaseServices.php

+ 38 - 1
inc/classes/BxDol.php

@@ -14,11 +14,48 @@
  */
 
 
+/**
+ * Base class for all Dolphin classes
+ */
 class BxDol {
-
     function BxDol () {
 
     }
 }
 
+/**
+ * Singleton interface, for objects with one instance only
+ */
+interface iBxDolSingleton {
+    public static function getInstance();
+}
+
+/**
+ * Factory interface for object instances, once instance per object name
+ */
+interface iBxDolFactoryObject {
+    static public function getObjectInstance($sObject);
+}
+
+/**
+ * Profile interface, class must implement basic profile methods to be compliant with Profile interface
+ */
+interface iBxDolProfile {
+    public function id();
+    public function getDisplayName();
+    public function getUrl();
+    public function getUnit();
+    public function getThumb();
+}
+
+/**
+ * Profile services module interface, module class must implement basic profile services to be compliant with Profile interface
+ */
+interface iBxDolProfileService {
+    public function serviceProfileUnit ($iContentId);
+    public function serviceProfileThumb ($iContentId);
+    public function serviceProfileName ($iContentId);
+    public function serviceProfileUrl ($iContentId);
+}
+
 /** @} */

+ 1 - 1
inc/classes/BxDolAccountQuery.php

@@ -12,7 +12,7 @@ bx_import('BxDolDb');
 /**
  * All queries related to account
  */
-class BxDolAccountQuery extends BxDolDb {
+class BxDolAccountQuery extends BxDolDb implements iBxDolSingleton {
 
     public function __construct() {
 

+ 1 - 1
inc/classes/BxDolAcl.php

@@ -76,7 +76,7 @@ define('CHECK_ACTION_RESULT_LIMIT_REACHED', 3);
 define('CHECK_ACTION_RESULT_NOT_ALLOWED_BEFORE', 4);
 define('CHECK_ACTION_RESULT_NOT_ALLOWED_AFTER', 5);
 
-class BxDolAcl extends BxDol {
+class BxDolAcl extends BxDol implements iBxDolSingleton {
 
     protected $oDb;
 

+ 12 - 6
inc/classes/BxDolAclQuery.php

@@ -1,14 +1,19 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolDb');
 
-class BxDolAclQuery extends BxDolDb {
+/**
+ * Database queries for ACL
+ * @see BxDolAcl
+ */
+class BxDolAclQuery extends BxDolDb implements iBxDolSingleton {
     function __construct() {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
@@ -250,4 +255,5 @@ class BxDolAclQuery extends BxDolDb {
         return (int)$this->query($sQuery) > 0;
     }
 }
+
 /** @} */

+ 1 - 1
inc/classes/BxDolCaptcha.php

@@ -53,7 +53,7 @@ bx_import('BxDolCaptchaQuery');
  *      echo 'captcha is incorrect'; // 
  * @endcode
  */
-class BxDolCaptcha extends BxDol {
+class BxDolCaptcha extends BxDol implements iBxDolFactoryObject {
 
     protected $_sObject;
     protected $_aObject;

+ 9 - 6
inc/classes/BxDolConfig.php

@@ -1,17 +1,18 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDol');
 
 /**
  * System class for main configuration settings.
  */
-class BxDolConfig extends BxDol {
+class BxDolConfig extends BxDol implements iBxDolSingleton {
     var $aUrlStatic;
     var $aUrlDynamic;
 
@@ -117,3 +118,5 @@ class BxDolConfig extends BxDol {
         return 'BX_' . strtoupper(implode('_', $aArgs));
     }
 }
+
+/** @} */

+ 1 - 1
inc/classes/BxDolConnection.php

@@ -102,7 +102,7 @@ define('BX_CONNECTIONS_TYPE_MUTUAL', 'mutual');
  * @endcode
  * 
  */
-class BxDolConnection extends BxDol {
+class BxDolConnection extends BxDol implements iBxDolFactoryObject {
 
     protected $_sObject;
     protected $_aObject;

+ 8 - 6
inc/classes/BxDolDb.php

@@ -1,14 +1,15 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolParams');
 
-class BxDolDb extends BxDol {
+class BxDolDb extends BxDol implements iBxDolSingleton {
 
     var $error_checking = true;
     var $error_message;
@@ -692,3 +693,4 @@ EOJ;
     }
 }
 
+/** @} */

+ 1 - 1
inc/classes/BxDolEditor.php

@@ -67,7 +67,7 @@ define('BX_EDITOR_MINI', 3);
  * @endcode
  * 
  */
-class BxDolEditor extends BxDol {
+class BxDolEditor extends BxDol implements iBxDolFactoryObject {
 
     protected $_sObject;
     protected $_aObject;

+ 1 - 1
inc/classes/BxDolEmailTemplates.php

@@ -55,7 +55,7 @@ bx_import('BxDolEmailTemplatesQuery');
  * @endcode
  * 
  */
-class BxDolEmailTemplates extends BxDol {
+class BxDolEmailTemplates extends BxDol implements iBxDolSingleton {
 
     protected $_oEmailTemplatesQuery;
 

+ 8 - 6
inc/classes/BxDolFile.php

@@ -1,12 +1,13 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
-class BxDolFile extends BxDol {
+class BxDolFile extends BxDol implements iBxDolSingleton {
     var $_sPathFrom;
     var $_sPathTo;
 
@@ -142,3 +143,4 @@ class BxDolFile extends BxDol {
     }
 }
 
+/** @} */

+ 1 - 1
inc/classes/BxDolGrid.php

@@ -246,7 +246,7 @@
  * 
  */
 
-class BxDolGrid extends BxDol {
+class BxDolGrid extends BxDol implements iBxDolFactoryObject {
 
     protected $_sObject;
     protected $_aOptions;

+ 8 - 6
inc/classes/BxDolImageResize.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 // Function error codes
 define( 'IMAGE_ERROR_SUCCESS',               0 );
@@ -29,7 +30,7 @@ define( 'IMAGE_TYPE_GIF',         1 );
 define( 'IMAGE_TYPE_JPG',         2 );
 define( 'IMAGE_TYPE_PNG',         3 );
 
-class BxDolImageResize extends BxDol {
+class BxDolImageResize extends BxDol implements iBxDolSingleton {
 
     var $w = 64, $h = 64; ///< size of destination image
     var $_isCrop = false;
@@ -549,3 +550,4 @@ class BxDolImageResize extends BxDol {
     }
 }
 
+/** @} */

+ 8 - 6
inc/classes/BxDolImageTranscoder.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolStorage');
 bx_import('BxDolImageTranscoderQuery');
@@ -80,7 +81,7 @@ bx_import('BxDolImageTranscoderQuery');
  * @endcode
  *
  */
-class BxDolImageTranscoder extends BxDol {
+class BxDolImageTranscoder extends BxDol implements iBxDolFactoryObject {
 
     protected $_aObject; ///< object properties
     protected $_oStorage; ///< storage object, transcoded images are stored here
@@ -555,3 +556,4 @@ class BxDolImageTranscoder extends BxDol {
     }
 }
 
+/** @} */

+ 2 - 2
inc/classes/BxDolKey.php

@@ -26,7 +26,7 @@ bx_import('BxDolKeyQuery');
  *  bx_import('BxDolKey'); // import class
  *  $oKeys = BxDolKey::getInstance(); // get object instance
  *  if ($oKeys) // check if object is available for using
- *      echo $oKeys->getNewKey (3600); // geе new hashed key, which will be autoimatically deleted after 1 hour
+ *      echo $oKeys->getNewKey (3600); // get new hashed key, which will be automatically deleted after 1 hour
  * @endcode
  * 
  * Check if hashed key exists:
@@ -40,7 +40,7 @@ bx_import('BxDolKeyQuery');
  *      echo 'key is invalid';
  * @endcode
  */
-class BxDolKey extends BxDol {
+class BxDolKey extends BxDol implements iBxDolSingleton {
 
     protected $_oQuery;
 

+ 8 - 6
inc/classes/BxDolLanguages.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDol');
 bx_import('BxDolLanguagesQuery');
@@ -12,7 +13,7 @@ bx_import('BxDolLanguagesQuery');
 define('BX_DOL_LANGUAGE_CATEGORY_SYSTEM', 1);
 define('BX_DOL_LANGUAGE_CATEGORY_CUSTOM', 2);
 
-class BxDolLanguages extends BxDol {
+class BxDolLanguages extends BxDol implements iBxDolSingleton {
     protected $oDb;
     protected $sCurrentLanguage;
 
@@ -319,4 +320,5 @@ function bx_lang_name()
 {
 	return BxDolLanguages::getInstance()->getCurrentLanguage();
 }
+
 /** @} */

+ 1 - 2
inc/classes/BxDolLanguagesQuery.php

@@ -9,7 +9,7 @@
 
 bx_import('BxDolDb');
 
-class BxDolLanguagesQuery extends BxDolDb {
+class BxDolLanguagesQuery extends BxDolDb implements iBxDolSingleton {
 
     function __construct() {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
@@ -275,4 +275,3 @@ class BxDolLanguagesQuery extends BxDolDb {
 }
 
 /** @} */
-

+ 1 - 1
inc/classes/BxDolMenu.php

@@ -84,7 +84,7 @@ bx_import('BxDolPermalinks');
  * menu objects are integrated into pages - there is special 'menu' page block type for it.
  * 
  */
-class BxDolMenu extends BxDol {
+class BxDolMenu extends BxDol implements iBxDolFactoryObject {
 
     protected static $SEL_MODULE = '';
     protected static $SEL_NAME = '';

+ 7 - 5
inc/classes/BxDolModule.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 /**
  * Base class for Module classes in modules engine.
@@ -143,3 +144,4 @@ class BxDolModule extends BxDol {
 
 }
 
+/** @} */

+ 10 - 6
inc/classes/BxDolModuleQuery.php

@@ -1,14 +1,15 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolDb');
 
-class BxDolModuleQuery extends BxDolDb {
+class BxDolModuleQuery extends BxDolDb implements iBxDolSingleton {
     function BxDolModuleQuery() {
     	if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
@@ -33,6 +34,7 @@ class BxDolModuleQuery extends BxDolDb {
 
         return $GLOBALS['bxDolClasses'][__CLASS__];
     }
+
     function getModuleById($iId) {
         $sSql = $this->prepare("SELECT `id`, `name`, `title`, `vendor`, `version`, `product_url`, `update_url`, `path`, `uri`, `class_prefix`, `db_prefix`, `lang_category`, `date`, `enabled` FROM `sys_modules` WHERE `id`=? LIMIT 1", $iId);
         return $this->fromMemory('sys_modules_' . $iId, 'getRow', $sSql);
@@ -125,3 +127,5 @@ class BxDolModuleQuery extends BxDolDb {
         return $this->getAll($sSql);
     }
 }
+
+/** @} */

+ 1 - 4
inc/classes/BxDolPage.php

@@ -118,10 +118,7 @@ bx_import('BxDolPageQuery');
  * @endcode
  *
  */
-
-
-
-class BxDolPage extends BxDol {
+class BxDolPage extends BxDol implements iBxDolFactoryObject {
 
     protected $_sObject;
     protected $_aObject;

+ 7 - 5
inc/classes/BxDolParams.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolCacheFile');
 
@@ -107,3 +108,4 @@ class BxDolParams extends BxDol {
     }
 }
 
+/** @} */

+ 1 - 1
inc/classes/BxDolPermalinks.php

@@ -53,7 +53,7 @@ bx_import('BxDolDb');
  * - $aExtra['return_data'] - it is possible to override default behavior, by setting 'return_data' to non NULL value.
  *
  */
-class BxDolPermalinks extends BxDolDb {
+class BxDolPermalinks extends BxDolDb implements iBxDolSingleton {
     var $sCacheFile;
     var $aLinksStandard;
     var $aLinksPermalink;

+ 1 - 1
inc/classes/BxDolProfile.php

@@ -13,7 +13,7 @@ define('BX_PROFILE_ACTION_AUTO', 0); ///< automatic action without any checking
 define('BX_PROFILE_ACTION_MANUAL', 1); ///< manual action performed by human 
 define('BX_PROFILE_ACTION_ROBOT', 2); ///< action peformed by some robot based on some conditions
 
-class BxDolProfile extends BxDol {
+class BxDolProfile extends BxDol implements iBxDolProfile {
 
     var $_iProfileID;
     var $_oQuery;

+ 1 - 2
inc/classes/BxDolProfileQuery.php

@@ -12,7 +12,7 @@ bx_import('BxDolDb');
 /**
  * All queries related to profiles
  */
-class BxDolProfileQuery extends BxDolDb {
+class BxDolProfileQuery extends BxDolDb implements iBxDolSingleton {
 
     public function __construct() {
 
@@ -196,4 +196,3 @@ class BxDolProfileQuery extends BxDolDb {
 }
 
 /** @} */
-

+ 1 - 1
inc/classes/BxDolProfileUndefined.php

@@ -22,7 +22,7 @@
  * }
  * @endcode
  */
-class BxDolProfileUndefined extends BxDol {
+class BxDolProfileUndefined extends BxDol implements iBxDolSingleton, iBxDolProfile {
 
     /**
      * Constructor

+ 8 - 6
inc/classes/BxDolSession.php

@@ -1,17 +1,18 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolSessionQuery');
 
 define('BX_DOL_SESSION_LIFETIME', 3600);
 define('BX_DOL_SESSION_COOKIE', 'memberSession');
 
-class BxDolSession extends BxDol {
+class BxDolSession extends BxDol implements iBxDolSingleton {
     var $oDb;
     var $sId;
     var $iUserId;
@@ -151,3 +152,4 @@ class BxDolSession extends BxDol {
     }
 }
 
+/** @} */

+ 3 - 1
inc/classes/BxDolSocialSharing.php

@@ -23,8 +23,10 @@ bx_import('BxDolSocialSharingQuery');
  * 
  * @section example Example of usage:
  *
+ * @code
  * bx_import('BxTemplSocialSharing');
  * echo BxTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle);
+ * @endcode
  *
  *
  * @section alerts Alerts:
@@ -37,7 +39,7 @@ bx_import('BxDolSocialSharingQuery');
  *      override_output - override output string
  *
  */ 
-class BxDolSocialSharing extends BxDol
+class BxDolSocialSharing extends BxDol implements iBxDolSingleton
 {
     protected $_oQuery;
 	protected $_aSocialButtons = array (); // active social buttons array

+ 9 - 6
inc/classes/BxDolStorage.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 define('BX_DOL_STORAGE_ERR_OK', 0);
 
@@ -195,7 +196,7 @@ bx_import('BxDolStorageQuery');
  * you control this period using 'token_life' field in 'sys_objects_storage' table.
  * 
  */
-abstract class BxDolStorage extends BxDol {
+abstract class BxDolStorage extends BxDol implements iBxDolFactoryObject {
 
     protected $_aObject; ///< object properties
     protected $_iCacheControl; ///< browser cache in seconds, 0 - disabled
@@ -1091,3 +1092,5 @@ class BxDolStorageHelperStorage {
         return $this->aFile['size'];
     }
 }
+
+/** @} */

+ 11 - 8
inc/classes/BxDolTemplate.php

@@ -1,10 +1,11 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 ini_set('pcre.backtrack_limit', 1000000);
 
@@ -23,6 +24,7 @@ define('BX_PAGE_CLEAR', 2); ///< clear page, without any headers and footers
 define('BX_PAGE_POPUP', 44); ///< popup page, without any headers and footers
 define('BX_PAGE_TRANSITION', 150); ///< transition page with redirect to display some msg, like 'please wait', without headers footers
 define('BX_PAGE_MOBILE', 11); ///< mobile page
+
 /**
  * Template engine.
  *
@@ -83,7 +85,7 @@ define('BX_PAGE_MOBILE', 11); ///< mobile page
  *
  *
  * Example of usage:
- * \code
+ * @code
  *  $oSysTemplate = BxDolTemplate::getInstance();
  *
  *  $oSysTemplate->addCss(array('test1.css', 'test2.css'));
@@ -110,7 +112,7 @@ define('BX_PAGE_MOBILE', 11); ///< mobile page
  *        )
  *     )
  *  ));
- * \endcode
+ * @endcode
  *
  *
  * Memberships/ACL:
@@ -121,7 +123,7 @@ define('BX_PAGE_MOBILE', 11); ///< mobile page
  * no alerts available
  *
  */
-class BxDolTemplate extends BxDol {
+class BxDolTemplate extends BxDol implements iBxDolSingleton {
     /**
      * Main fields
      */
@@ -1905,3 +1907,4 @@ class BxDolTemplate extends BxDol {
 	}
 }
 
+/** @} */

+ 9 - 6
inc/classes/BxDolXmlParser.php

@@ -1,15 +1,17 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
 
 defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDol');
 
-class BxDolXmlParser extends BxDol {
+class BxDolXmlParser extends BxDol implements iBxDolSingleton {
     protected $rParser;
 
     function BxDolXmlParser() {
@@ -193,4 +195,5 @@ class BxDolXmlParser extends BxDol {
         return $sContent;
     }
 }
-/** @} */
+
+/** @} */

+ 1 - 1
modules/boonex/persons/classes/BxPersonsModule.php

@@ -17,7 +17,7 @@ bx_import ('BxDolAcl');
  *
  * Basic person profiles.
  */
-class BxPersonsModule extends BxDolModule {
+class BxPersonsModule extends BxDolModule implements iBxDolProfileService {
 
     protected $_iProfileId;
 

+ 1 - 1
splash.php

@@ -17,7 +17,7 @@ bx_import('BxDolStudioTemplate');
 bx_import('BxTemplStudioMenuTop');
 bx_import('BxTemplFormView');
 
-class BxDolSplashMenuTop extends BxTemplStudioMenuTop
+class BxDolSplashMenuTop extends BxTemplStudioMenuTop implements iBxDolSingleton
 {
 	function BxDolSplashMenuTop()
 	{

+ 8 - 6
studio/classes/BxDolStudioCart.php

@@ -1,4 +1,4 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -6,17 +6,18 @@
  * @defgroup    DolphinStudio Dolphin Studio
  * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
-class BxDolStudioCart {
+class BxDolStudioCart extends BxDol implements iBxDolSingleton {
 	public static $sIDiv = ':';
 	public static $sPDiv = '_';
 	private $sSessionKey = 'bx-std-str-cart';
 	private $bAllowAccumulate = false;
 
     public function __construct() {
-    	if(isset($GLOBALS['bxDolClasses'][get_class($this)]))
+    	if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
+
+        parent::__construct ();
     }
 
 	public function __clone() {
@@ -25,7 +26,7 @@ class BxDolStudioCart {
     }
 
 	static function getInstance() {
-        if(!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
+        if (!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
         	$sClass = __CLASS__;
             $GLOBALS['bxDolClasses'][__CLASS__] = new $sClass();
         }
@@ -131,4 +132,5 @@ class BxDolStudioCart {
         return $aResult;
     }
 }
-/** @} */
+
+/** @} */

+ 6 - 6
studio/classes/BxDolStudioInstallerUtils.php

@@ -1,4 +1,4 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -6,13 +6,12 @@
  * @defgroup    DolphinStudio Dolphin Studio
  * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolInstallerUtils');
 
-class BxDolStudioInstallerUtils extends BxDolInstallerUtils {
+class BxDolStudioInstallerUtils extends BxDolInstallerUtils implements iBxDolSingleton {
     public function BxDolStudioInstallerUtils() {
-        if(isset($GLOBALS['bxDolClasses'][get_class($this)]))
+        if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
         parent::BxDolInstallerUtils();
@@ -30,7 +29,7 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils {
      * Get singleton instance of the class
      */
     static function getInstance() {
-        if(!isset($GLOBALS['bxDolClasses'][__CLASS__]))
+        if (!isset($GLOBALS['bxDolClasses'][__CLASS__]))
             $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolStudioInstallerUtils();
 
         return $GLOBALS['bxDolClasses'][__CLASS__];
@@ -215,4 +214,5 @@ class BxDolStudioInstallerUtils extends BxDolInstallerUtils {
         $aInstalledPathes = array_keys($aInstalledInfo);
     }
 }
-/** @} */
+
+/** @} */

+ 7 - 6
studio/classes/BxDolStudioJson.php

@@ -1,4 +1,4 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -6,13 +6,13 @@
  * @defgroup    DolphinStudio Dolphin Studio
  * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
-class BxDolStudioJson {
+class BxDolStudioJson extends BxDol implements iBxDolSingleton {
     public function __construct() {
-    	if(isset($GLOBALS['bxDolClasses'][get_class($this)]))
+    	if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
+        parent::__construct ();
     }
 
 	public function __clone() {
@@ -21,7 +21,7 @@ class BxDolStudioJson {
     }
 
 	static function getInstance() {
-        if(!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
+        if (!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
             $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolStudioJson();
         }
 
@@ -42,4 +42,5 @@ class BxDolStudioJson {
 		return $mixedResult;
     }
 }
-/** @} */
+
+/** @} */

+ 4 - 4
studio/classes/BxDolStudioLanguagesUtils.php

@@ -1,4 +1,4 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -6,13 +6,12 @@
  * @defgroup    DolphinStudio Dolphin Studio
  * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolLanguages');
 bx_import('BxDolXmlParser');
 bx_import('BxDolStudioLanguagesUtilsQuery');
 
-class BxDolStudioLanguagesUtils extends BxDolLanguages {
+class BxDolStudioLanguagesUtils extends BxDolLanguages implements iBxDolSingleton {
     function __construct() {
         if(isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
@@ -423,4 +422,5 @@ class BxDolStudioLanguagesUtils extends BxDolLanguages {
         return $bResult;
     }
 }
-/** @} */
+
+/** @} */

+ 8 - 6
studio/classes/BxDolStudioOAuth.php

@@ -1,4 +1,4 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
@@ -6,9 +6,8 @@
  * @defgroup    DolphinStudio Dolphin Studio
  * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
-class BxDolStudioOAuth {
+class BxDolStudioOAuth extends BxDol implements iBxDolSingleton {
 	protected $sKey;
 	protected $sSecret;
 
@@ -18,9 +17,11 @@ class BxDolStudioOAuth {
 	protected $oSession;
 
     public function __construct() {
-    	if(isset($GLOBALS['bxDolClasses'][get_class($this)]))
+    	if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
+        parent::__construct ();
+
 		$this->sKey = getParam('sys_oauth_key');
 		$this->sSecret = getParam('sys_oauth_secret');
 
@@ -37,7 +38,7 @@ class BxDolStudioOAuth {
     }
 
 	static function getInstance() {
-        if(!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
+        if (!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
         	$sClass = __CLASS__;
             $GLOBALS['bxDolClasses'][__CLASS__] = new $sClass();
         }
@@ -189,4 +190,5 @@ class BxDolStudioOAuth {
     	return $sMessage;
     }
 }
-/** @} */
+
+/** @} */

+ 3 - 3
studio/classes/BxDolStudioTemplate.php

@@ -14,10 +14,10 @@ define('BX_PAGE_COLUMN_DUAL', 3); ///< page, with 2 columns
 
 bx_import('BxDolTemplate');
 
-class BxDolStudioTemplate extends BxDolTemplate {
+class BxDolStudioTemplate extends BxDolTemplate implements iBxDolSingleton {
 
     function BxDolStudioTemplate() {
-        if(isset($GLOBALS['bxDolClasses'][get_class($this)]))
+        if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
         parent::BxDolTemplate();
@@ -48,7 +48,7 @@ class BxDolStudioTemplate extends BxDolTemplate {
      * Get singleton instance of the class
      */
     public static function getInstance() {
-        if(!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
+        if (!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
             $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolStudioTemplate();
             $GLOBALS['bxDolClasses'][__CLASS__]->init();
         }

+ 3 - 3
studio/classes/BxDolStudioWidgetsQuery.php

@@ -10,7 +10,7 @@ defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolStudioPageQuery');
 
-class BxDolStudioWidgetsQuery extends BxDolStudioPageQuery {
+class BxDolStudioWidgetsQuery extends BxDolStudioPageQuery implements iBxDolSingleton {
     function BxDolStudioWidgetsQuery() {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
@@ -31,7 +31,7 @@ class BxDolStudioWidgetsQuery extends BxDolStudioPageQuery {
      */
     public static function getInstance() {
     	$sClass = __CLASS__;
-        if(!isset($GLOBALS['bxDolClasses'][__CLASS__]))
+        if (!isset($GLOBALS['bxDolClasses'][__CLASS__]))
             $GLOBALS['bxDolClasses'][__CLASS__] = new $sClass();
 
         return $GLOBALS['bxDolClasses'][__CLASS__];
@@ -96,4 +96,4 @@ class BxDolStudioWidgetsQuery extends BxDolStudioPageQuery {
         return (int)$this->getOne("SELECT FOUND_ROWS()");
     }
 }
-/** @} */
+/** @} */

+ 2 - 2
studio/template/scripts/BxBaseStudioFunctions.php

@@ -12,7 +12,7 @@ defined('BX_DOL') or die('hack attempt');
 bx_import('BxDolStudioTemplate');
 bx_import('BxBaseFunctions');
 
-class BxBaseStudioFunctions extends BxBaseFunctions {
+class BxBaseStudioFunctions extends BxBaseFunctions implements iBxDolSingleton {
 
     function BxBaseStudioFunctions($oTemplate = false) {
     	if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
@@ -22,7 +22,7 @@ class BxBaseStudioFunctions extends BxBaseFunctions {
     }
 
     public static function getInstance() {
-        if(!isset($GLOBALS['bxDolClasses']['BxBaseStudioFunctions']))
+        if (!isset($GLOBALS['bxDolClasses']['BxBaseStudioFunctions']))
             $GLOBALS['bxDolClasses']['BxBaseStudioFunctions'] = new BxTemplStudioFunctions();
 
         return $GLOBALS['bxDolClasses']['BxBaseStudioFunctions'];

+ 3 - 3
studio/template/scripts/BxBaseStudioMenuTop.php

@@ -11,16 +11,16 @@ defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolStudioMenuTop');
 
-class BxBaseStudioMenuTop extends BxDolStudioMenuTop { 
+class BxBaseStudioMenuTop extends BxDolStudioMenuTop implements iBxDolSingleton { 
     function BxBaseStudioMenuTop() {
-        if(isset($GLOBALS['bxDolClasses'][get_class($this)]))
+        if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
             trigger_error ('Multiple instances are not allowed for the class: ' . get_class($this), E_USER_ERROR);
 
         parent::BxDolStudioMenuTop();
     }
 
     public static function getInstance() {
-        if(!isset($GLOBALS['bxDolClasses']['BxBaseStudioMenuTop']))
+        if (!isset($GLOBALS['bxDolClasses']['BxBaseStudioMenuTop']))
             $GLOBALS['bxDolClasses']['BxBaseStudioMenuTop'] = new BxTemplStudioMenuTop();
 
         return $GLOBALS['bxDolClasses']['BxBaseStudioMenuTop'];

+ 10 - 58
template/scripts/BxBaseConfig.php

@@ -1,70 +1,21 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
-class BxBaseConfig extends BxDol {
-    /**/
-    var    $PageCompThird_db_num                    = 0;
+class BxBaseConfig extends BxDol implements iBxDolSingleton {
 
-    /*Membership.php*/
-    var    $PageCompStatus_db_num                    = 1;
-    var    $PageCompSubscriptions_db_num            = 1;
-    var    $PageCompMemberships_db_num                = 1;
-        //Checkout
-    var    $PageCompCheckoutInfo_db_num            = 1;
-    var    $PageCompProviderList_db_num            = 1;
-    var    $PageCompErrorMessage_db_num            = 1;
-
-    var    $PageExplanation_db_num                    = 1;
-
-        /*    greet.php    */
-    var    $PageVkiss_db_num                        = 1;
-        /*    compose.php    */
-    var    $PageCompose_db_num                        = 0;
-        /*    list-pop.php    */
-    var    $PageListPop_db_num                        = 1;
-
-        /* calculate page with in: px - pixels, % - percentages */
-    var $PageComposeColumnCalculation            = 'px'; //
-
-    //Width of Votes scale at profilr view page
-    var    $iProfileViewProgressBar                    = 67;
-
-        // show text link "view as photogallery" in the page navigation of search result page
-    var    $show_gallery_link_in_page_navigation    = 1;
-
-    var    $popUpWindowWidth                        = 660;
-    var    $popUpWindowHeight                        = 200;
-
-        // Groups
-    var $iGroupMembersPreNum                    = 21; //number of random members shown in main page of group
-    var $iGroupMembersResPerPage                = 14;
-
-    var $iGroupsSearchResPerPage                = 10;
-    var $iGroupsSearchResults_dbnum                = 1;
-
-    var $iQSearchWindowWidth                    = 400;
-    var $iQSearchWindowHeight                   = 400;
-
-    var $iTagsMinFontSize                        = 10;  //Minimal font size of tag
-    var $iTagsMaxFontSize                        = 30; //Maximal font size of tag
-
-    //var $sCalendarCss;
-
-    var $bAnonymousMode;
+    var $iTagsMinFontSize = 10;  // minimal font size of tag
+    var $iTagsMaxFontSize = 30; // maximal font size of tag
 
     var $bAllowUnicodeInPreg = false; // allow unicode in regular expressions
 
-
-
     function BxBaseConfig() {
         parent::BxDol();
-
-        $this -> bAnonymousMode = getParam('anon_mode');;
     }
 
     public static function getInstance() {
@@ -75,3 +26,4 @@ class BxBaseConfig extends BxDol {
     }
 }
 
+/** @} */

+ 9 - 6
template/scripts/BxBaseFunctions.php

@@ -1,14 +1,15 @@
-<?php
+<?php defined('BX_DOL') or die('hack attempt');
 /**
- * @package     Dolphin Core
- * @copyright   Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
- * @license     CC-BY - http://creativecommons.org/licenses/by/3.0/
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Dolphin Core
+ * @{
  */
-defined('BX_DOL') or die('hack attempt');
 
 bx_import('BxDolTemplate');
 
-class BxBaseFunctions extends BxDol {
+class BxBaseFunctions extends BxDol implements iBxDolSingleton {
 
     protected $_aSpecialKeys;
     protected $_oTemplate;
@@ -654,3 +655,5 @@ EOF;
     }
 
 }
+
+/** @} */

+ 1 - 1
template/scripts/BxBaseServices.php

@@ -10,7 +10,7 @@
 /**
  * System services.
  */
-class BxBaseServices extends BxDol {
+class BxBaseServices extends BxDol implements iBxDolProfileService {
     public function __construct() {
         parent::__construct();
     }