AntonLV 10 سال پیش
والد
کامیت
09eb54aed8
72فایلهای تغییر یافته به همراه113 افزوده شده و 125 حذف شده
  1. 8 0
      inc/classes/BxDol.php
  2. 1 1
      inc/classes/BxDolAccount.php
  3. 1 1
      inc/classes/BxDolAccountQuery.php
  4. 2 2
      inc/classes/BxDolAcl.php
  5. 1 1
      inc/classes/BxDolAclQuery.php
  6. 1 1
      inc/classes/BxDolCacheUtilities.php
  7. 2 2
      inc/classes/BxDolCaptcha.php
  8. 2 2
      inc/classes/BxDolCategory.php
  9. 2 2
      inc/classes/BxDolCmts.php
  10. 1 1
      inc/classes/BxDolCmtsQuery.php
  11. 1 1
      inc/classes/BxDolConnection.php
  12. 2 5
      inc/classes/BxDolCover.php
  13. 1 1
      inc/classes/BxDolCronQuery.php
  14. 1 1
      inc/classes/BxDolDb.php
  15. 2 2
      inc/classes/BxDolDesigns.php
  16. 2 2
      inc/classes/BxDolEditor.php
  17. 1 4
      inc/classes/BxDolEmailTemplates.php
  18. 2 12
      inc/classes/BxDolFavorite.php
  19. 1 1
      inc/classes/BxDolFile.php
  20. 1 1
      inc/classes/BxDolForm.php
  21. 1 1
      inc/classes/BxDolFtp.php
  22. 2 2
      inc/classes/BxDolGrid.php
  23. 1 1
      inc/classes/BxDolIO.php
  24. 2 2
      inc/classes/BxDolImageResize.php
  25. 2 2
      inc/classes/BxDolInformer.php
  26. 1 1
      inc/classes/BxDolInstallerUtils.php
  27. 2 2
      inc/classes/BxDolKey.php
  28. 2 2
      inc/classes/BxDolLanguages.php
  29. 1 1
      inc/classes/BxDolLanguagesQuery.php
  30. 2 2
      inc/classes/BxDolLiveUpdates.php
  31. 2 2
      inc/classes/BxDolMenu.php
  32. 2 2
      inc/classes/BxDolMetatags.php
  33. 1 1
      inc/classes/BxDolMinify.php
  34. 1 1
      inc/classes/BxDolModule.php
  35. 1 1
      inc/classes/BxDolModuleConfig.php
  36. 1 1
      inc/classes/BxDolModuleQuery.php
  37. 1 1
      inc/classes/BxDolModuleTemplate.php
  38. 8 2
      inc/classes/BxDolObject.php
  39. 2 2
      inc/classes/BxDolPage.php
  40. 2 2
      inc/classes/BxDolPayments.php
  41. 1 1
      inc/classes/BxDolPermalinks.php
  42. 2 2
      inc/classes/BxDolPrivacy.php
  43. 1 1
      inc/classes/BxDolProfile.php
  44. 1 1
      inc/classes/BxDolProfileForms.php
  45. 1 1
      inc/classes/BxDolProfileQuery.php
  46. 1 1
      inc/classes/BxDolProfileUndefined.php
  47. 1 1
      inc/classes/BxDolReport.php
  48. 2 2
      inc/classes/BxDolRss.php
  49. 1 1
      inc/classes/BxDolRssBoonEx.php
  50. 1 1
      inc/classes/BxDolRssPageBlock.php
  51. 1 1
      inc/classes/BxDolSession.php
  52. 1 1
      inc/classes/BxDolSessionQuery.php
  53. 1 1
      inc/classes/BxDolSocialSharing.php
  54. 2 2
      inc/classes/BxDolSocialSharingQuery.php
  55. 1 1
      inc/classes/BxDolStorage.php
  56. 1 1
      inc/classes/BxDolTemplate.php
  57. 1 1
      inc/classes/BxDolTranscoder.php
  58. 1 1
      inc/classes/BxDolUploader.php
  59. 2 5
      inc/classes/BxDolView.php
  60. 2 9
      inc/classes/BxDolVote.php
  61. 2 2
      inc/classes/BxDolXmlParser.php
  62. 2 2
      studio/classes/BxDolStudioCart.php
  63. 2 2
      studio/classes/BxDolStudioJson.php
  64. 1 1
      studio/classes/BxDolStudioLanguagesUtils.php
  65. 2 2
      studio/classes/BxDolStudioOAuth.php
  66. 1 1
      studio/classes/BxDolStudioOAuthLib.php
  67. 1 1
      studio/classes/BxDolStudioOAuthOAuth1.php
  68. 1 1
      studio/classes/BxDolStudioOAuthOAuth2.php
  69. 1 1
      studio/classes/BxDolStudioOAuthPlugin.php
  70. 1 1
      studio/classes/BxDolStudioTemplate.php
  71. 1 1
      studio/classes/BxDolStudioWidgetsQuery.php
  72. 1 1
      template/scripts/BxBaseFunctions.php

+ 8 - 0
inc/classes/BxDol.php

@@ -25,6 +25,14 @@ class BxDol
     public function __construct () {}
 }
 
+/**
+ * Base class for all classes with protected constructor
+ */
+class BxDolFactory
+{
+    protected function __construct () {}
+}
+
 /**
  * Singleton interface, for objects with one instance only
  */

+ 1 - 1
inc/classes/BxDolAccount.php

@@ -9,7 +9,7 @@
 
 bx_import('BxDolAcl');
 
-class BxDolAccount extends BxDol
+class BxDolAccount extends BxDolFactory implements iBxDolSingleton
 {
     protected $_iAccountID;
     protected $_oQuery;

+ 1 - 1
inc/classes/BxDolAccountQuery.php

@@ -12,7 +12,7 @@
  */
 class BxDolAccountQuery extends BxDolDb implements iBxDolSingleton
 {
-    public function __construct()
+    protected 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);

+ 2 - 2
inc/classes/BxDolAcl.php

@@ -72,7 +72,7 @@ define('MEMBERSHIP_PERIOD_UNIT_MONTH', 'month');
 define('MEMBERSHIP_PERIOD_UNIT_YEAR', 'year');
 
 
-class BxDolAcl extends BxDol implements iBxDolSingleton
+class BxDolAcl extends BxDolFactory implements iBxDolSingleton
 {
     protected $oDb;
 
@@ -105,7 +105,7 @@ class BxDolAcl extends BxDol implements iBxDolSingleton
 
         parent::__construct();
 
-        $this->oDb = new BxDolAclQuery();
+        $this->oDb = BxDolAclQuery::getInstance();
     }
 
     /**

+ 1 - 1
inc/classes/BxDolAclQuery.php

@@ -13,7 +13,7 @@
  */
 class BxDolAclQuery extends BxDolDb implements iBxDolSingleton
 {
-    function __construct()
+    protected 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);

+ 1 - 1
inc/classes/BxDolCacheUtilities.php

@@ -11,7 +11,7 @@
 
 class BxDolCacheUtilities extends BxDol
 {
-    function __construct ()
+    public function __construct ()
     {
         parent::__construct();
     }

+ 2 - 2
inc/classes/BxDolCaptcha.php

@@ -49,7 +49,7 @@
  *      echo 'captcha is incorrect'; //
  * @endcode
  */
-class BxDolCaptcha extends BxDol implements iBxDolFactoryObject
+class BxDolCaptcha extends BxDolFactory implements iBxDolFactoryObject
 {
     protected $_sObject;
     protected $_aObject;
@@ -58,7 +58,7 @@ class BxDolCaptcha extends BxDol implements iBxDolFactoryObject
      * Constructor
      * @param $aObject array of captcha options
      */
-    public function __construct($aObject)
+    protected function __construct($aObject)
     {
         parent::__construct();
 

+ 2 - 2
inc/classes/BxDolCategory.php

@@ -34,7 +34,7 @@
  * - override_class_file: the location of the user defined class, leave it empty if class is located in system folders.
  *
  */
-class BxDolCategory extends BxDol implements iBxDolFactoryObject
+class BxDolCategory extends BxDolFactory implements iBxDolFactoryObject
 {
     protected $_sObject;
     protected $_aObject;
@@ -43,7 +43,7 @@ class BxDolCategory extends BxDol implements iBxDolFactoryObject
      * Constructor
      * @param $aObject array of editor options
      */
-    public function __construct($aObject)
+    protected function __construct($aObject)
     {
         parent::__construct();
 

+ 2 - 2
inc/classes/BxDolCmts.php

@@ -128,7 +128,7 @@ define('BX_CMT_RATE_VALUE_MINUS', -1);
  *      - $aExtra['rate'] - comment rate 1 or -1
  *
  */
-class BxDolCmts extends BxDol implements iBxDolReplaceable
+class BxDolCmts extends BxDolFactory implements iBxDolReplaceable
 {
     protected $_oQuery = null;
     protected $_oTemplate = null;
@@ -174,7 +174,7 @@ class BxDolCmts extends BxDol implements iBxDolReplaceable
      * $sSystem - comments system name
      * $iId - obect id to be commented
      */
-    function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
+    protected function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolCmtsQuery.php

@@ -26,7 +26,7 @@ class BxDolCmtsQuery extends BxDolDb
 
     protected $_sTableIds;
 
-    function __construct(&$oMain)
+    public function __construct(&$oMain)
     {
         $this->_oMain = $oMain;
 

+ 1 - 1
inc/classes/BxDolConnection.php

@@ -110,7 +110,7 @@ define('BX_CONNECTIONS_CONTENT_TYPE_COMMON', 'common');
  * @endcode
  *
  */
-class BxDolConnection extends BxDol implements iBxDolFactoryObject
+class BxDolConnection extends BxDolFactory implements iBxDolFactoryObject
 {
     protected $_sObject;
     protected $_aObject;

+ 2 - 5
inc/classes/BxDolCover.php

@@ -31,7 +31,7 @@
  * @endcode
  *
  */
-class BxDolCover extends BxDol implements iBxDolSingleton
+class BxDolCover extends BxDolFactory implements iBxDolSingleton
 {
     protected $_aOptions = array();
     protected $_sTemplateName = 'cover.html';
@@ -39,10 +39,7 @@ class BxDolCover extends BxDol implements iBxDolSingleton
     protected $_sCoverImageUrl = false;
     protected $_aOptiondDefault = array();
 
-    /**
-     * Constructor
-     */
-    public function __construct()
+    protected function __construct()
     {
         if (isset($GLOBALS['bxDolClasses']['BxDolCover']))
             trigger_error ('Multiple instances are not allowed for the BxDolCover class.', E_USER_ERROR);

+ 1 - 1
inc/classes/BxDolCronQuery.php

@@ -13,7 +13,7 @@
  */
 class BxDolCronQuery extends BxDolDb implements iBxDolSingleton
 {
-    function __construct()
+    protected 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);

+ 1 - 1
inc/classes/BxDolDb.php

@@ -17,7 +17,7 @@ define('BX_DB_ERR_ESCAPE', 3);
 define('BX_PDO_STATE_NOT_EXECUTED', NULL);
 define('BX_PDO_STATE_SUCCESS', '00000');
 
-class BxDolDb extends BxDol implements iBxDolSingleton
+class BxDolDb extends BxDolFactory implements iBxDolSingleton
 {	
     protected static $_rLink;
     protected static $_aDbCacheData;

+ 2 - 2
inc/classes/BxDolDesigns.php

@@ -7,14 +7,14 @@
  * @{
  */
 
-class BxDolDesigns extends BxDol implements iBxDolSingleton
+class BxDolDesigns extends BxDolFactory implements iBxDolSingleton
 {
     protected $sDesign;
     protected $oDesign;
 
     protected $aParams;
 
-    function __construct()
+    protected 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);

+ 2 - 2
inc/classes/BxDolEditor.php

@@ -63,7 +63,7 @@ define('BX_EDITOR_MINI', 3);
  * @endcode
  *
  */
-class BxDolEditor extends BxDol implements iBxDolFactoryObject
+class BxDolEditor extends BxDolFactory implements iBxDolFactoryObject
 {
     protected $_sObject;
     protected $_aObject;
@@ -72,7 +72,7 @@ class BxDolEditor extends BxDol implements iBxDolFactoryObject
      * Constructor
      * @param $aObject array of editor options
      */
-    public function __construct($aObject)
+    protected function __construct($aObject)
     {
         parent::__construct();
 

+ 1 - 4
inc/classes/BxDolEmailTemplates.php

@@ -53,7 +53,7 @@ bx_import('BxDolPermalinks');
  * @endcode
  *
  */
-class BxDolEmailTemplates extends BxDol implements iBxDolSingleton
+class BxDolEmailTemplates extends BxDolFactory implements iBxDolSingleton
 {
     protected $_oEmailTemplatesQuery;
 
@@ -61,9 +61,6 @@ class BxDolEmailTemplates extends BxDol implements iBxDolSingleton
     protected $iFallbackLangId;
     protected $aDefaultKeys;
 
-    /**
-     * Class constructor.
-     */
     protected function __construct()
     {
         if (isset($GLOBALS['bxDolClasses'][get_class($this)]))

+ 2 - 12
inc/classes/BxDolFavorite.php

@@ -52,26 +52,16 @@ define('BX_DOL_FAVORITE_USAGE_DEFAULT', BX_DOL_FAVORITE_USAGE_BLOCK);
  */
 class BxDolFavorite extends BxDolObject
 {
-    protected $_oTemplate;
-
     protected $_sBaseUrl;
 
-    /**
-     * Constructor
-     */
-    function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
+    protected function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
-        parent::__construct($sSystem, $iId, $iInit);
+        parent::__construct($sSystem, $iId, $iInit, $oTemplate);
         if(empty($this->_sSystem))
             return;
 
         $this->_oQuery = new BxDolFavoriteQuery($this);
 
-        if ($oTemplate)
-            $this->_oTemplate = $oTemplate;
-        else
-            $this->_oTemplate = BxDolTemplate::getInstance();
-
         $this->_sBaseUrl = BxDolPermalinks::getInstance()->permalink($this->_aSystem['base_url']);
         if(get_mb_substr($this->_sBaseUrl, 0, 4) != 'http')
             $this->_sBaseUrl = BX_DOL_URL_ROOT . $this->_sBaseUrl;

+ 1 - 1
inc/classes/BxDolFile.php

@@ -7,7 +7,7 @@
  * @{
  */
 
-class BxDolFile extends BxDol implements iBxDolSingleton
+class BxDolFile extends BxDolFactory implements iBxDolSingleton
 {
     protected $_sPathFrom;
     protected $_sPathTo;

+ 1 - 1
inc/classes/BxDolForm.php

@@ -728,7 +728,7 @@ class BxDolForm extends BxDol implements iBxDolReplaceable
     public $aParams; ///< additional form parameters
     public $id; ///< Form element id
 
-    function __construct ($aInfo, $oTemplate)
+    public function __construct ($aInfo, $oTemplate)
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolFtp.php

@@ -14,7 +14,7 @@ class BxDolFtp extends BxDolFile
     protected $_sPassword;
     protected $_rStream;
 
-    function __construct($sHost, $sLogin, $sPassword, $sPath = '/')
+    public function __construct($sHost, $sLogin, $sPassword, $sPath = '/')
     {
         parent::__construct();
         $this->_sHost = $sHost;

+ 2 - 2
inc/classes/BxDolGrid.php

@@ -245,7 +245,7 @@
  *
  */
 
-class BxDolGrid extends BxDol implements iBxDolFactoryObject, iBxDolReplaceable
+class BxDolGrid extends BxDolFactory implements iBxDolFactoryObject, iBxDolReplaceable
 {
     protected $_aMarkers = array ();
 
@@ -257,7 +257,7 @@ class BxDolGrid extends BxDol implements iBxDolFactoryObject, iBxDolReplaceable
      * Constructor
      * @param $aOptions array of grid options
      */
-    public function __construct($aOptions)
+    protected function __construct($aOptions)
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolIO.php

@@ -9,7 +9,7 @@
 
 class BxDolIO extends BxDol
 {
-    function __construct()
+    public function __construct()
     {
         parent::__construct();
     }

+ 2 - 2
inc/classes/BxDolImageResize.php

@@ -20,7 +20,7 @@ spl_autoload_register(function ($sClass) {
 define('IMAGE_ERROR_SUCCESS', 0); ///< operation was successfull
 define('IMAGE_ERROR_WRONG_TYPE', 2); ///< operation failed, most probably because incorrect image format(or not image file) was provided
 
-class BxDolImageResize extends BxDol implements iBxDolSingleton
+class BxDolImageResize extends BxDolFactory implements iBxDolSingleton
 {
     protected $w = 64, $h = 64; ///< size of destination image
     protected $_isAutoCrop = false;
@@ -30,7 +30,7 @@ class BxDolImageResize extends BxDol implements iBxDolSingleton
     protected $_oManager; ///< Intervention Image Manager
     protected $_sError; ///< Intervention Image Manager error string
 
-    function __construct()
+    protected 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);

+ 2 - 2
inc/classes/BxDolInformer.php

@@ -33,7 +33,7 @@ define('BX_INFORMER_ERROR', 3);
  * @endcode
  *
  */
-class BxDolInformer extends BxDol
+class BxDolInformer extends BxDolFactory implements iBxDolSingleton
 {
 	protected $_bEnabled = true;
     protected $_aMessages = array();
@@ -41,7 +41,7 @@ class BxDolInformer extends BxDol
     /**
      * Constructor
      */
-    public function __construct()
+    protected function __construct()
     {
         if (isset($GLOBALS['bxDolClasses']['BxDolInformer']))
             trigger_error ('Multiple instances are not allowed for the BxDolInformer class.', E_USER_ERROR);

+ 1 - 1
inc/classes/BxDolInstallerUtils.php

@@ -14,7 +14,7 @@ class BxDolInstallerUtils extends BxDolIO
 {
     protected $_aNonHashableFiles = array();
 
-    function __construct()
+    public function __construct()
     {
         parent::__construct();
     }

+ 2 - 2
inc/classes/BxDolKey.php

@@ -36,14 +36,14 @@
  *      echo 'key is invalid';
  * @endcode
  */
-class BxDolKey extends BxDol implements iBxDolSingleton
+class BxDolKey extends BxDolFactory implements iBxDolSingleton
 {
     protected $_oQuery;
 
     /**
      * Constructor
      */
-    public function __construct()
+    protected 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);

+ 2 - 2
inc/classes/BxDolLanguages.php

@@ -12,12 +12,12 @@ define('BX_DOL_LANGUAGE_DEFAULT', 'en');
 define('BX_DOL_LANGUAGE_CATEGORY_SYSTEM', 1);
 define('BX_DOL_LANGUAGE_CATEGORY_CUSTOM', 2);
 
-class BxDolLanguages extends BxDol implements iBxDolSingleton
+class BxDolLanguages extends BxDolFactory implements iBxDolSingleton
 {
     protected $oDb;
     protected $sCurrentLanguage;
 
-    function __construct()
+    protected 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);

+ 1 - 1
inc/classes/BxDolLanguagesQuery.php

@@ -9,7 +9,7 @@
 
 class BxDolLanguagesQuery extends BxDolDb implements iBxDolSingleton
 {
-    function __construct()
+    protected 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);

+ 2 - 2
inc/classes/BxDolLiveUpdates.php

@@ -13,7 +13,7 @@
  * @ref BxDolLiveUpdates
  */
 
-class BxDolLiveUpdates extends BxDol
+class BxDolLiveUpdates extends BxDolFactory implements iBxDolSingleton
 {
 	protected $_oQuery;
     protected $_aSystems;
@@ -27,7 +27,7 @@ class BxDolLiveUpdates extends BxDol
     protected $_sJsClass;
     protected $_sJsObject;
 
-    public function __construct()
+    protected function __construct()
     {
         parent::__construct();
 

+ 2 - 2
inc/classes/BxDolMenu.php

@@ -81,7 +81,7 @@
  * menu objects are integrated into pages - there is special 'menu' page block type for it.
  *
  */
-class BxDolMenu extends BxDol implements iBxDolFactoryObject, iBxDolReplaceable
+class BxDolMenu extends BxDolFactory implements iBxDolFactoryObject, iBxDolReplaceable
 {
     protected static $SEL_MODULE = '';
     protected static $SEL_NAME = '';
@@ -101,7 +101,7 @@ class BxDolMenu extends BxDol implements iBxDolFactoryObject, iBxDolReplaceable
      * Constructor
      * @param $aObject array of menu options
      */
-    public function __construct($aObject)
+    protected function __construct($aObject)
     {
         parent::__construct();
 

+ 2 - 2
inc/classes/BxDolMetatags.php

@@ -117,7 +117,7 @@ define('BX_METATAGS_KEYWORDS_MAX', 9);
  * @endcode
  *
  */
-class BxDolMetatags extends BxDol implements iBxDolFactoryObject
+class BxDolMetatags extends BxDolFactory implements iBxDolFactoryObject
 {
     protected $_sObject;
     protected $_aObject;
@@ -128,7 +128,7 @@ class BxDolMetatags extends BxDol implements iBxDolFactoryObject
      * Constructor
      * @param $aObject array of metags object options
      */
-    public function __construct($aObject)
+    protected function __construct($aObject)
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolMinify.php

@@ -14,7 +14,7 @@ require_once(BX_DIRECTORY_PATH_PLUGINS . 'matthiasmullie/minify/Minify.php');
 require_once(BX_DIRECTORY_PATH_PLUGINS . 'matthiasmullie/minify/CSS.php');
 require_once(BX_DIRECTORY_PATH_PLUGINS . 'matthiasmullie/minify/JS.php');
 
-class BxDolMinify extends BxDol implements iBxDolSingleton
+class BxDolMinify extends BxDolFactory implements iBxDolSingleton
 {
     protected function __construct()
     {

+ 1 - 1
inc/classes/BxDolModule.php

@@ -49,7 +49,7 @@ class BxDolModule extends BxDol
     /**
      * constructor
      */
-    function __construct($aModule)
+    public function __construct($aModule)
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolModuleConfig.php

@@ -51,7 +51,7 @@ class BxDolModuleConfig extends BxDol
     /**
      * constructor
      */
-    function __construct($aModule)
+    public function __construct($aModule)
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolModuleQuery.php

@@ -9,7 +9,7 @@
 
 class BxDolModuleQuery extends BxDolDb implements iBxDolSingleton
 {
-    function __construct()
+    protected 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);

+ 1 - 1
inc/classes/BxDolModuleTemplate.php

@@ -16,7 +16,7 @@ class BxDolModuleTemplate extends BxDolTemplate
     /*
      * Constructor.
      */
-    function __construct(&$oConfig, &$oDb, $sRootPath = BX_DIRECTORY_PATH_ROOT, $sRootUrl = BX_DOL_URL_ROOT)
+    public function __construct(&$oConfig, &$oDb, $sRootPath = BX_DIRECTORY_PATH_ROOT, $sRootUrl = BX_DOL_URL_ROOT)
     {
         parent::__construct($sRootPath, $sRootUrl);
 

+ 8 - 2
inc/classes/BxDolObject.php

@@ -11,8 +11,9 @@
  * Base class for all "Object" classes.
  * Child classes usually represents high level programming constructions to generate ready 'objects' functionality, like Comments, Votings, Forms.
  */
-class BxDolObject extends BxDol
+class BxDolObject extends BxDolFactory implements iBxDolReplaceable
 {
+    protected $_oTemplate = null;
 	protected $_oQuery = null;
 
     protected $_iId = 0; ///< item id the action to be performed with
@@ -21,7 +22,7 @@ class BxDolObject extends BxDol
 
     protected $_aMarkers = array ();
 
-    public function __construct($sSystem, $iId, $iInit = 1)
+    protected function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
         parent::__construct();
 
@@ -32,6 +33,11 @@ class BxDolObject extends BxDol
         $this->_sSystem = $sSystem;
         $this->_aSystem = $aSystems[$sSystem];
 
+        if ($oTemplate)
+            $this->_oTemplate = $oTemplate;
+        else
+            $this->_oTemplate = BxDolTemplate::getInstance();
+
         if(!$this->isEnabled())
             return;
 

+ 2 - 2
inc/classes/BxDolPage.php

@@ -115,7 +115,7 @@
  * @endcode
  *
  */
-class BxDolPage extends BxDol implements iBxDolFactoryObject, iBxDolReplaceable
+class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolReplaceable
 {
     protected $_sObject;
     protected $_aObject;
@@ -126,7 +126,7 @@ class BxDolPage extends BxDol implements iBxDolFactoryObject, iBxDolReplaceable
      * Constructor
      * @param $aObject array of page options
      */
-    public function __construct($aObject)
+    protected function __construct($aObject)
     {
         parent::__construct();
 

+ 2 - 2
inc/classes/BxDolPayments.php

@@ -7,14 +7,14 @@
  * @{
  */
 
-class BxDolPayments extends BxDol implements iBxDolSingleton
+class BxDolPayments extends BxDolFactory implements iBxDolSingleton
 {
 	protected $_oDb;
 
 	protected $_aObjects;
 	protected $_sActive;
 
-    public function __construct()
+    protected function __construct()
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolPermalinks.php

@@ -59,7 +59,7 @@ class BxDolPermalinks extends BxDolDb implements iBxDolSingleton
     protected $aPrefixesStandard;
     protected $aPrefixesPermalink;
 
-    function __construct()
+    protected 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);

+ 2 - 2
inc/classes/BxDolPrivacy.php

@@ -59,7 +59,7 @@ define('BX_DOL_PG_DEFAULT', BX_DOL_PG_ALL);
  * no alerts available
  *
  */
-class BxDolPrivacy extends BxDol implements iBxDolFactoryObject
+class BxDolPrivacy extends BxDolFactory implements iBxDolFactoryObject
 {
     protected $_oDb;
     protected $_sObject;
@@ -69,7 +69,7 @@ class BxDolPrivacy extends BxDol implements iBxDolFactoryObject
      * Constructor
      * @param $aObject array of grid options
      */
-    function __construct($aObject)
+    protected function __construct($aObject)
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolProfile.php

@@ -12,7 +12,7 @@ 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
 define('BX_PROFILE_ACTION_EXTERNAL', 2); ///< action peformed by external service, like join using OAuth 
 
-class BxDolProfile extends BxDol implements iBxDolProfile
+class BxDolProfile extends BxDolFactory implements iBxDolProfile
 {
     protected $_iProfileID;
     protected $_oQuery;

+ 1 - 1
inc/classes/BxDolProfileForms.php

@@ -10,7 +10,7 @@
 /**
  * Functions to automate profile creation/editing/deletion forms.
  */
-class BxDolProfileForms extends BxDol
+class BxDolProfileForms extends BxDolFactory
 {
     /**
      * Constructor

+ 1 - 1
inc/classes/BxDolProfileQuery.php

@@ -12,7 +12,7 @@
  */
 class BxDolProfileQuery extends BxDolDb implements iBxDolSingleton
 {
-    public function __construct()
+    protected 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);

+ 1 - 1
inc/classes/BxDolProfileUndefined.php

@@ -18,7 +18,7 @@
  *     $oProfile = BxDolProfileUndefined::getInstance();
  * @endcode
  */
-class BxDolProfileUndefined extends BxDol implements iBxDolSingleton, iBxDolProfile
+class BxDolProfileUndefined extends BxDolFactory implements iBxDolSingleton, iBxDolProfile
 {
     /**
      * Constructor

+ 1 - 1
inc/classes/BxDolReport.php

@@ -83,7 +83,7 @@ class BxDolReport extends BxDolObject
 
 	protected $_aTypes;
 
-    public function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
+    protected function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
         parent::__construct($sSystem, $iId, $iInit);
         if(empty($this->_sSystem))

+ 2 - 2
inc/classes/BxDolRss.php

@@ -44,7 +44,7 @@
  *
  */
 
-class BxDolRss extends BxDol implements iBxDolFactoryObject
+class BxDolRss extends BxDolFactory implements iBxDolFactoryObject
 {
 	protected $_oDb;
 	protected $_sObject;
@@ -55,7 +55,7 @@ class BxDolRss extends BxDol implements iBxDolFactoryObject
     /**
      * Constructor
      */
-    function __construct($aObject)
+    protected function __construct($aObject)
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolRssBoonEx.php

@@ -11,7 +11,7 @@ class BxDolRssBoonEx extends BxTemplRss
 {
 	protected $aFeeds;
 
-    function __construct($aObject)
+    public function __construct($aObject)
     {
         parent::__construct($aObject);
 

+ 1 - 1
inc/classes/BxDolRssPageBlock.php

@@ -9,7 +9,7 @@
 
 class BxDolRssPageBlock extends BxTemplRss
 {
-    function __construct($aObject)
+    public function __construct($aObject)
     {
         parent::__construct($aObject);
     }

+ 1 - 1
inc/classes/BxDolSession.php

@@ -10,7 +10,7 @@
 define('BX_DOL_SESSION_LIFETIME', 3600);
 define('BX_DOL_SESSION_COOKIE', 'memberSession');
 
-class BxDolSession extends BxDol implements iBxDolSingleton
+class BxDolSession extends BxDolFactory implements iBxDolSingleton
 {
     protected $oDb;
     protected $sId;

+ 1 - 1
inc/classes/BxDolSessionQuery.php

@@ -14,7 +14,7 @@ class BxDolSessionQuery extends BxDolDb
 {
     protected $sTable;
 
-    function __construct()
+    public function __construct()
     {
         parent::__construct();
 

+ 1 - 1
inc/classes/BxDolSocialSharing.php

@@ -36,7 +36,7 @@
  *      override_output - override output string
  *
  */
-class BxDolSocialSharing extends BxDol implements iBxDolSingleton
+class BxDolSocialSharing extends BxDolFactory implements iBxDolSingleton
 {
     protected $_oQuery;
     protected $_aSocialButtons = array (); // active social buttons array

+ 2 - 2
inc/classes/BxDolSocialSharingQuery.php

@@ -13,12 +13,12 @@
 class BxDolSocialSharingQuery extends BxDolDb
 {
 
-    function __construct()
+    public function __construct()
     {
         parent::__construct();
     }
 
-    function getActiveButtons ()
+    public function getActiveButtons ()
     {
         return $this->fromCache('sys_objects_social_sharing', 'getAll', 'SELECT * FROM `sys_objects_social_sharing` WHERE `active` = 1 ORDER BY `order` ASC');
     }

+ 1 - 1
inc/classes/BxDolStorage.php

@@ -190,7 +190,7 @@ define('BX_DOL_STORAGE_QUEUED_DELETIONS_PER_RUN', 200); ///< max number of file
  * you control this period using 'token_life' field in 'sys_objects_storage' table.
  *
  */
-abstract class BxDolStorage extends BxDol implements iBxDolFactoryObject
+abstract class BxDolStorage extends BxDolFactory implements iBxDolFactoryObject
 {
     protected $_aObject; ///< object properties
     protected $_iCacheControl; ///< browser cache in seconds, 0 - disabled

+ 1 - 1
inc/classes/BxDolTemplate.php

@@ -121,7 +121,7 @@ define('BX_PAGE_TRANSITION', 150); ///< transition page with redirect to display
  * no alerts available
  *
  */
-class BxDolTemplate extends BxDol implements iBxDolSingleton
+class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
 {
     /**
      * Main fields

+ 1 - 1
inc/classes/BxDolTranscoder.php

@@ -16,7 +16,7 @@ define('BX_DOL_QUEUE_DELETE', 'delete'); ///< file is subject to delete
 /**
  * Base class for @see BxDolTranscoderImage and @see BxDolTranscoderVideo transcoders
  */
-class BxDolTranscoder extends BxDol implements iBxDolFactoryObject
+class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
 {
     protected $_sLog = ''; ///< file conversion log
     protected $_aObject; ///< object properties

+ 1 - 1
inc/classes/BxDolUploader.php

@@ -105,7 +105,7 @@
  * - {js_instance_name} - instance of BxDolUploader javascript class
  *
  */
-abstract class BxDolUploader extends BxDol
+abstract class BxDolUploader extends BxDolFactory
 {
     protected $_oTemplate;
 

+ 2 - 5
inc/classes/BxDolView.php

@@ -52,12 +52,9 @@ define ('BX_DOL_VIEW_OLD_VIEWS', 3 * 86400); ///< views older than this number o
  */
 class BxDolView extends BxDolObject
 {
-    /**
-     * Constructor
-     */
-    function __construct($sSystem, $iId, $iInit = true)
+    protected function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
-        parent::__construct($sSystem, $iId, $iInit);
+        parent::__construct($sSystem, $iId, $iInit, $oTemplate);
         if(empty($this->_sSystem))
             return;
 

+ 2 - 9
inc/classes/BxDolVote.php

@@ -84,24 +84,17 @@ define('BX_DOL_VOTE_USAGE_DEFAULT', BX_DOL_VOTE_USAGE_BLOCK);
 
 class BxDolVote extends BxDolObject
 {
-	protected $_oTemplate;
-
 	protected $_bLike = true;
 	protected $_sType = BX_DOL_VOTE_TYPE_LIKES;
 
-    public function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
+    protected function __construct($sSystem, $iId, $iInit = true, $oTemplate = false)
     {
-        parent::__construct($sSystem, $iId, $iInit);
+        parent::__construct($sSystem, $iId, $iInit, $oTemplate);
         if(empty($this->_sSystem))
             return;
 
         $this->_oQuery = new BxDolVoteQuery($this);
 
-        if ($oTemplate)
-            $this->_oTemplate = $oTemplate;
-        else
-            $this->_oTemplate = BxDolTemplate::getInstance();
-
 		$this->_bLike = $this->isLikeMode();
         $this->_sType = $this->_bLike ? BX_DOL_VOTE_TYPE_LIKES : BX_DOL_VOTE_TYPE_STARS;
     }

+ 2 - 2
inc/classes/BxDolXmlParser.php

@@ -7,11 +7,11 @@
  * @{
  */
 
-class BxDolXmlParser extends BxDol implements iBxDolSingleton
+class BxDolXmlParser extends BxDolFactory implements iBxDolSingleton
 {
     protected $rParser;
 
-    function __construct()
+    protected 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);

+ 2 - 2
studio/classes/BxDolStudioCart.php

@@ -7,14 +7,14 @@
  * @{
  */
 
-class BxDolStudioCart extends BxDol implements iBxDolSingleton
+class BxDolStudioCart extends BxDolFactory implements iBxDolSingleton
 {
     public static $sIDiv = ':';
     public static $sPDiv = '_';
     private $sSessionKey = 'bx-std-str-cart';
     private $bAllowAccumulate = false;
 
-    public function __construct()
+    protected 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);

+ 2 - 2
studio/classes/BxDolStudioJson.php

@@ -7,9 +7,9 @@
  * @{
  */
 
-class BxDolStudioJson extends BxDol implements iBxDolSingleton
+class BxDolStudioJson extends BxDolFactory implements iBxDolSingleton
 {
-    public function __construct()
+    protected 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);

+ 1 - 1
studio/classes/BxDolStudioLanguagesUtils.php

@@ -11,7 +11,7 @@ bx_import('BxDolLanguages');
 
 class BxDolStudioLanguagesUtils extends BxDolLanguages implements iBxDolSingleton
 {
-    function __construct()
+    protected 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);

+ 2 - 2
studio/classes/BxDolStudioOAuth.php

@@ -9,7 +9,7 @@
 
 bx_import('BxDolStudioInstallerUtils');
 
-class BxDolStudioOAuth extends BxDol
+class BxDolStudioOAuth extends BxDolFactory
 {
     protected $oSession;
 
@@ -20,7 +20,7 @@ class BxDolStudioOAuth extends BxDol
     protected $sSecret;
     protected $sDataRetrieveMethod;
 
-    public function __construct()
+    protected function __construct()
     {
         parent::__construct ();
 

+ 1 - 1
studio/classes/BxDolStudioOAuthLib.php

@@ -9,7 +9,7 @@
 
 class BxDolStudioOAuthLib extends BxDolStudioOAuthOAuth1 implements iBxDolSingleton
 {
-    public function __construct()
+    protected 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);

+ 1 - 1
studio/classes/BxDolStudioOAuthOAuth1.php

@@ -16,7 +16,7 @@ define('BX_DOL_OAUTH_URL_FETCH_DATA', BX_DOL_OAUTH_URL_BASE . 'oauth_fetch_data.
 
 class BxDolStudioOAuthOAuth1 extends BxDolStudioOAuth
 {
-    public function __construct()
+    protected function __construct()
     {
     	parent::__construct();
     }

+ 1 - 1
studio/classes/BxDolStudioOAuthOAuth2.php

@@ -13,7 +13,7 @@ class BxDolStudioOAuthOAuth2 extends BxDolStudioOAuth implements iBxDolSingleton
 	protected $sScope;
 	protected $sPageHandle;
 
-    public function __construct()
+    protected 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);

+ 1 - 1
studio/classes/BxDolStudioOAuthPlugin.php

@@ -22,7 +22,7 @@ class BxDolStudioOAuthPlugin extends BxDolStudioOAuthOAuth1 implements iBxDolSin
     protected $sService;
     protected $oStorage;
 
-    public function __construct()
+    protected 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);

+ 1 - 1
studio/classes/BxDolStudioTemplate.php

@@ -12,7 +12,7 @@ define('BX_PAGE_COLUMN_DUAL', 3); ///< page, with 2 columns
 
 class BxDolStudioTemplate extends BxDolTemplate implements iBxDolSingleton
 {
-    function __construct()
+    protected 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);

+ 1 - 1
studio/classes/BxDolStudioWidgetsQuery.php

@@ -9,7 +9,7 @@
 
 class BxDolStudioWidgetsQuery extends BxDolStudioPageQuery implements iBxDolSingleton
 {
-    function __construct()
+    public 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);

+ 1 - 1
template/scripts/BxBaseFunctions.php

@@ -7,7 +7,7 @@
  * @{
  */
 
-class BxBaseFunctions extends BxDol implements iBxDolSingleton
+class BxBaseFunctions extends BxDolFactory implements iBxDolSingleton
 {
     protected $_oTemplate;
     protected $_sDesignBoxIcon = 'chevron';