فهرست منبع

Ticket #4858 - Objects system for PUSH (Onesignal).

AntonLV 1 سال پیش
والد
کامیت
03c5ebaaed

+ 32 - 104
inc/classes/BxDolPush.php

@@ -7,42 +7,34 @@
  * @{
  */
 
-class BxDolPush extends BxDolFactory implements iBxDolSingleton
+class BxDolPush extends BxDolFactoryObject
 {
-    protected $_sAppId;
-    protected $_sRestApi;
+    protected $_sApiUrlRootPush;
+    protected $_sApiUrlRootEmail;
 
-    protected function __construct()
+    protected function __construct($aObject, $oTemplate = null, $sDbClassName = 'BxDolPushQuery')
     {
-        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($aObject, $oTemplate, $sDbClassName);
 
-        parent::__construct();
-
-        $this->_sAppId = getParam('sys_push_app_id');
-        $this->_sRestApi = getParam('sys_push_rest_api');
+        $this->_sApiUrlRootEmail = $this->_getUrlRoot('email');
+        $this->_sApiUrlRootPush = $this->_getUrlRoot('push');
     }
 
     /**
-     * Prevent cloning the instance
+     * Get embed provider object instance by object name
+     * @param $sObject object name
+     * @return object instance or false on error
      */
-    public function __clone()
+    static public function getObjectInstance($sObject = false, $oTemplate = false)
     {
-        if (isset($GLOBALS['bxDolClasses'][get_class($this)]))
-            trigger_error('Clone is not allowed for the class: ' . get_class($this), E_USER_ERROR);
-    }
-
-    /**
-     * Get singleton instance of the class
-     */
-    public static function getInstance()
-    {
-        if(!isset($GLOBALS['bxDolClasses'][__CLASS__]))
-            $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolPush();
+        if(!$sObject)
+            $sObject = getParam('sys_push_default');
+        if(!$sObject)
+            return false;
 
-        return $GLOBALS['bxDolClasses'][__CLASS__];
+        return parent::getObjectInstanceByClassNames($sObject, $oTemplate, 'BxDolPush', 'BxDolPushQuery');
     }
-    
+
     /**
      * Get tags to send to PUSH server
      * @param $iProfileId - profile ID
@@ -139,90 +131,26 @@ class BxDolPush extends BxDolFactory implements iBxDolSingleton
         return $iBubbles;
     }
 
-    public function send($iProfileId, $aMessage, $bAddToQueue = false)
+    public function getCode($sFor = '')
     {
-        if(empty($this->_sAppId) || empty($this->_sRestApi))
-            return false;
-
-        if($bAddToQueue && BxDolQueuePush::getInstance()->add($iProfileId, $aMessage))
-            return true;
-
-        $sUrlWeb = $sUrlApp = !empty($aMessage['url']) ? $aMessage['url'] : '';
-
-        if(($sRootUrl = getParam('sys_api_url_root_email')) !== '') {
-            if(substr(BX_DOL_URL_ROOT, -1) == '/' && substr($sRootUrl, -1) != '/')
-                $sRootUrl .= '/';
+        if($sFor && ($sMethod = '_getCode' . bx_gen_method_name($sFor)) && method_exists($this, $sMethod))
+            return $this->$sMethod();
 
-            if($sUrlWeb)
-                $sUrlWeb = str_replace(BX_DOL_URL_ROOT, $sRootUrl, $sUrlWeb);
-
-            if(empty($aMessage['contents']) && is_array($aMessage['contents']))
-                foreach($aMessage['contents'] as $sKey => $sValue)
-                    $aMessage['contents'][$sKey] = str_replace(BX_DOL_URL_ROOT, $sRootUrl, $sValue);
-        }
+        return '';
+    }
 
-        if(($sRootUrl = getParam('sys_api_url_root_push')) !== '') {
-            if(substr(BX_DOL_URL_ROOT, -1) == '/' && substr($sRootUrl, -1) != '/')
-                $sRootUrl .= '/';
+    public function send($iProfileId, $aMessage, $bAddToQueue = false) {}
 
-            if($sUrlApp)
-                $sUrlApp = str_replace(BX_DOL_URL_ROOT, $sRootUrl, $sUrlApp);
-        }
-        else
-            $sUrlApp = $sUrlWeb;
-
-        $aFields = [
-            'app_id' => $this->_sAppId,
-            'filters' => [
-                ['field' => 'tag', 'key' => 'user_hash', 'relation' => '=', 'value' => encryptUserId($iProfileId)]
-            ],
-            'contents' => !empty($aMessage['contents']) && is_array($aMessage['contents']) ? $aMessage['contents'] : [],
-            'headings' => !empty($aMessage['headings']) && is_array($aMessage['headings']) ? $aMessage['headings'] : [],
-            'web_url' => $sUrlWeb,
-            'app_url' => $sUrlApp,
-            'data' => [
-                'url' => $sUrlWeb
-            ],
-        ];
-        
-        if (empty($aMessage['icon'])){
-            $aMessage['icon'] = BxTemplFunctions::getInstance()->getMainLogoUrl();
-        }
-        if (!empty($aMessage['icon'])){
-            $aFields['chrome_web_icon'] = $aMessage['icon'];
-            $aFields['large_icon'] = $aMessage['icon'];
-            $aFields['ios_attachments'] = ['id'=> $aMessage['icon']];
-        }
-        
-        if ('on' == getParam('bx_nexus_option_push_notifications_count')) {
-            $iBadgeCount = $this->getNotificationsCount($iProfileId);
-            $aFields['ios_badgeType'] = 'SetTo';
-            $aFields['ios_badgeCount'] = $iBadgeCount;
-        }
-
-        $oChannel = curl_init();
-        curl_setopt($oChannel, CURLOPT_URL, "https://onesignal.com/api/v1/notifications");
-        curl_setopt($oChannel, CURLOPT_HTTPHEADER, [
-                'Content-Type: application/json; charset=utf-8',
-                'Authorization: Basic ' . $this->_sRestApi
-        ]);
-        curl_setopt($oChannel, CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($oChannel, CURLOPT_HEADER, false);
-        curl_setopt($oChannel, CURLOPT_POST, true);
-        curl_setopt($oChannel, CURLOPT_POSTFIELDS, json_encode($aFields));
-        if (getParam('sys_curl_ssl_allow_untrusted') == 'on')
-            curl_setopt($oChannel, CURLOPT_SSL_VERIFYPEER, false);
-
-        $sResult = curl_exec($oChannel);
-        curl_close($oChannel);
-
-        $oResult = @json_decode($sResult, true);
-        if(isset($oResult['errors']))
-            foreach($oResult['errors'] as $sError) {  
-                bx_log('sys_push', $sError . " Message:" . json_encode($aMessage));
-            }
+    protected function _getUrlRoot($sType)
+    {
+        $sRootUrl = getParam('sys_api_url_root_' . $sType);
+        if(!$sRootUrl)
+            return false;
+            
+        if(substr(BX_DOL_URL_ROOT, -1) == '/' && substr($sRootUrl, -1) != '/')
+            $sRootUrl .= '/';
 
-        return $sResult;
+        return $sRootUrl;
     }
 }
 

+ 118 - 0
inc/classes/BxDolPushOneSignal.php

@@ -0,0 +1,118 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaCore UNA Core
+ * @{
+ */
+
+class BxDolPushOneSignal extends BxDolPush
+{
+    protected $_sEndpoint;
+
+    protected $_sAppId;
+    protected $_sRestApi;
+
+    protected $_sShortName;
+    protected $_sSafariWebId;
+
+    protected $_bCodeAdded;
+
+    protected function __construct($aObject, $oTemplate = null, $sDbClassName = '')
+    {
+        parent::__construct($aObject, $oTemplate, $sDbClassName);
+
+        $this->_sEndpoint = 'https://onesignal.com/api/v1/notifications';
+
+        $this->_sAppId = getParam('sys_push_onesignal_app_id');
+        $this->_sRestApi = getParam('sys_push_onesignal_rest_api');
+
+        $this->_sShortName = getParam('sys_push_onesignal_short_name');
+        $this->_sSafariWebId = getParam('sys_push_onesignal_safari_id');
+
+        $this->_bCodeAdded = false;
+    }
+
+    public function send($iProfileId, $aMessage, $bAddToQueue = false)
+    {
+        if(empty($this->_sAppId) || empty($this->_sRestApi))
+            return false;
+
+        if($bAddToQueue && BxDolQueuePush::getInstance()->add($iProfileId, $aMessage))
+            return true;
+
+        $sUrlWeb = $sUrlApp = !empty($aMessage['url']) ? $aMessage['url'] : '';
+
+        if($this->_sApiUrlRootEmail !== false) {
+            if($sUrlWeb)
+                $sUrlWeb = str_replace(BX_DOL_URL_ROOT, $this->_sApiUrlRootEmail, $sUrlWeb);
+
+            if(!empty($aMessage['contents']) && is_array($aMessage['contents']))
+                foreach($aMessage['contents'] as $sKey => $sValue)
+                    $aMessage['contents'][$sKey] = str_replace(BX_DOL_URL_ROOT, $this->_sApiUrlRootEmail, $sValue);
+        }
+
+        if($this->_sApiUrlRootPush !== false) {
+            if($sUrlApp)
+                $sUrlApp = str_replace(BX_DOL_URL_ROOT, $this->_sApiUrlRootPush, $sUrlApp);
+        }
+        else
+            $sUrlApp = $sUrlWeb;
+
+        $aFields = [
+            'app_id' => $this->_sAppId,
+            'filters' => [
+                ['field' => 'tag', 'key' => 'user_hash', 'relation' => '=', 'value' => encryptUserId($iProfileId)]
+            ],
+            'contents' => !empty($aMessage['contents']) && is_array($aMessage['contents']) ? $aMessage['contents'] : [],
+            'headings' => !empty($aMessage['headings']) && is_array($aMessage['headings']) ? $aMessage['headings'] : [],
+            'web_url' => $sUrlWeb,
+            'app_url' => $sUrlApp,
+            'data' => [
+                'url' => $sUrlWeb
+            ],
+        ];
+        
+        if(empty($aMessage['icon']))
+            $aMessage['icon'] = BxTemplFunctions::getInstance()->getMainLogoUrl();
+
+        if(!empty($aMessage['icon'])){
+            $aFields['chrome_web_icon'] = $aMessage['icon'];
+            $aFields['large_icon'] = $aMessage['icon'];
+            $aFields['ios_attachments'] = ['id'=> $aMessage['icon']];
+        }
+
+        if('on' == getParam('bx_nexus_option_push_notifications_count')) {
+            $iBadgeCount = $this->getNotificationsCount($iProfileId);
+            $aFields['ios_badgeType'] = 'SetTo';
+            $aFields['ios_badgeCount'] = $iBadgeCount;
+        }
+
+        $oChannel = curl_init();
+        curl_setopt($oChannel, CURLOPT_URL, $this->_sEndpoint);
+        curl_setopt($oChannel, CURLOPT_HTTPHEADER, [
+            'Content-Type: application/json; charset=utf-8',
+            'Authorization: Basic ' . $this->_sRestApi
+        ]);
+        curl_setopt($oChannel, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($oChannel, CURLOPT_HEADER, false);
+        curl_setopt($oChannel, CURLOPT_POST, true);
+        curl_setopt($oChannel, CURLOPT_POSTFIELDS, json_encode($aFields));
+        if (getParam('sys_curl_ssl_allow_untrusted') == 'on')
+            curl_setopt($oChannel, CURLOPT_SSL_VERIFYPEER, false);
+
+        $sResult = curl_exec($oChannel);
+        curl_close($oChannel);
+
+        $oResult = @json_decode($sResult, true);
+        if(isset($oResult['errors']))
+            foreach($oResult['errors'] as $sError) {  
+                bx_log('sys_push', $sError . " Message:" . json_encode($aMessage));
+            }
+
+        return $sResult;
+    }
+}
+
+/** @} */

+ 27 - 0
inc/classes/BxDolPushQuery.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaCore UNA Core
+ * @{
+ */
+
+/**
+ * Database queries for push objects.
+ * @see BxDolPush
+ */
+class BxDolPushQuery extends BxDolFactoryObjectQuery
+{
+    static public function getObject($sObject)
+    {
+        return parent::getObjectFromTable($sObject, 'sys_objects_push');
+    }
+
+    static public function getObjects ()
+    {
+        return parent::getObjectsFromTable('sys_objects_push');
+    }
+}
+
+/** @} */

+ 76 - 0
inc/js/classes/BxDolPushOneSignal.js

@@ -0,0 +1,76 @@
+function BxDolPushOneSignal(oOptions) {
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxDolPushOneSignal' : oOptions.sObjName;
+    this._sSiteName = oOptions.sSiteName == undefined ? '' : oOptions.sSiteName;
+    this._aTags = oOptions.aTags == undefined ? {} : oOptions.aTags;
+    this._sAppId = oOptions.sAppId == undefined ? '' : oOptions.sAppId;
+    this._sShortName = oOptions.sShortName == undefined ? '' : oOptions.sShortName;
+    this._sSafariWebId = oOptions.sSafariWebId == undefined ? '' : oOptions.sSafariWebId;
+    this._sSubfolder = oOptions.sSubfolder == undefined ? '/plugins_public/onesignal/' : oOptions.sSubfolder;
+    this._sNotificationUrl = oOptions.sNotificationUrl == undefined ? '' : oOptions.sNotificationUrl;
+
+    this._sTxtNotificationRequest = oOptions.sTxtNotificationRequest == undefined ? 'Would you like to get notifications' : oOptions.sTxtNotificationRequest;
+    this._sTxtNotificationRequestYes = oOptions.sTxtNotificationRequestYes == undefined ? 'Yes' : oOptions.sTxtNotificationRequestYes;
+    this._sTxtNotificationRequestNo = oOptions.sTxtNotificationRequestNo == undefined ? 'No' : oOptions.sTxtNotificationRequestNo;
+
+    var $this = this;
+    $(document).ready(function() {
+    	$this.init();
+    });
+}
+
+BxDolPushOneSignal.prototype.init = function() {
+    var $this = this;
+    window.OneSignal = window.OneSignal || [];
+
+    OneSignal.push(function() {
+        OneSignal.SERVICE_WORKER_UPDATER_PATH = "OneSignalSDKUpdaterWorker.js.php";
+        OneSignal.SERVICE_WORKER_PATH = "OneSignalSDKWorker.js.php";
+        OneSignal.SERVICE_WORKER_PARAM = { scope: '/' }; /* This registers the workers at the root scope, which is allowed by the HTTP header "Service-Worker-Allowed: /" */
+    });
+
+    OneSignal.push(["init", {
+        appId: $this._sAppId,
+        autoRegister: true, /* Set to true to automatically prompt visitors */
+        subdomainName: $this._sShortName, /* required only for http  sites */
+        safari_web_id: $this._sSafariWebId,
+        path: $this._sSubfolder, /* A trailing slash is required */
+        persistNotification: false,
+        welcomeNotification: {
+            disable:false
+        },
+        httpPermissionRequest: {
+            enable: true
+        },
+        promptOptions: {
+            /* These prompt options values configure both the HTTP prompt and the HTTP popup. */
+            /* actionMessage limited to 90 characters */
+            actionMessage: $this._sTxtNotificationRequest, 
+            /* acceptButtonText limited to 15 characters */
+            acceptButtonText: $this._sTxtNotificationRequestYes,
+            /* cancelButtonText limited to 15 characters */
+            cancelButtonText: $this._sTxtNotificationRequestNo
+        }
+    }]);
+
+    OneSignal.push(function() {
+        var isPushSupported = OneSignal.isPushNotificationsSupported();
+        OneSignal.setDefaultNotificationUrl($this._sNotificationUrl);
+        OneSignal.isPushNotificationsEnabled().then(function(isEnabled) {
+            if('undefined' !== typeof($this._aTags['email'])) {
+                OneSignal.setEmail($this._aTags['email'], $this._aTags['email_hash']);
+                delete $this._aTags['email'];
+                delete $this._aTags['email_hash'];
+            }
+            OneSignal.sendTags($this._aTags); // set tags for onesiganl, some of these tags will be used to send notification
+            if(!isEnabled && isPushSupported)
+                OneSignal.showHttpPermissionRequest();													
+        });
+    });
+
+    if(navigator.userAgent.indexOf('gonative') > -1) {
+        var json = JSON.stringify($this._aTags);
+        $(document).ready(function () {
+            window.location.href='gonative://registration/send?customData=' + encodeURIComponent(json);        
+        });
+    }
+};

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
install/sql/system.sql


+ 2 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -1675,6 +1675,8 @@
     <string name="_adm_stg_inf_option_sys_per_page_search_keyword_single"><![CDATA[Set the maximum number of results displayed per page in Keyword Search]]></string>
     <string name="_adm_stg_cpt_option_sys_per_page_search_keyword_plural"><![CDATA[Site Search Results]]></string>
     <string name="_adm_stg_inf_option_sys_per_page_search_keyword_plural"><![CDATA[Set the maximum number of results displayed per page in Site Search]]></string>
+    <string name="_adm_stg_cpt_option_sys_push_default"><![CDATA[Provider]]></string>
+    
     <string name="_adm_stg_cpt_option_sys_push_app_id"><![CDATA[OneSignal App ID]]></string>
     <string name="_adm_stg_cpt_option_sys_push_rest_api"><![CDATA[REST API Key]]></string>
     <string name="_adm_stg_cpt_option_sys_push_short_name"><![CDATA[Short name (required only for http sites. It must match the Subdomain you entered on the Web Push settings on the OneSignal dashboard)]]></string>

+ 1 - 0
modules/boonex/russian/data/langs/system/ru.xml

@@ -1651,6 +1651,7 @@
     <string name="_adm_stg_inf_option_sys_per_page_search_keyword_single"><![CDATA[Установите максимальное количество результатов, отображаемых на странице при поиске по ключевому слову.]]></string>
     <string name="_adm_stg_cpt_option_sys_per_page_search_keyword_plural"><![CDATA[Результаты поиска по сайту]]></string>
     <string name="_adm_stg_inf_option_sys_per_page_search_keyword_plural"><![CDATA[Установите максимальное количество результатов, отображаемых на странице поиска по сайту.]]></string>
+    <string name="_adm_stg_cpt_option_sys_push_default"><![CDATA[Поставщик]]></string>
     <string name="_adm_stg_cpt_option_sys_push_app_id"><![CDATA[OneSignal App ID]]></string>
     <string name="_adm_stg_cpt_option_sys_push_rest_api"><![CDATA[REST API Key]]></string>
     <string name="_adm_stg_cpt_option_sys_push_short_name"><![CDATA[Короткое имя (требуется только если у вас https сайт. Оно должно совпадать с поддоменом, введёным, в настройках пуш оповещений на OneSignal)]]></string>

+ 4 - 44
template/scripts/BxBaseFunctions.php

@@ -818,52 +818,12 @@ class BxBaseFunctions extends BxDolFactory implements iBxDolSingleton
 
     protected function getInjHeaderPushNotifications() 
     {
-        $iProfileId = bx_get_logged_profile_id();
-        if(empty($iProfileId))
-            return '';
-
-        $sAppId = getParam('sys_push_app_id');
-        if(empty($sAppId))
-            return '';
-
-        $aTags = BxDolPush::getTags($iProfileId);
-        if (!$aTags)
-            return '';
-
-        $sShortName = getParam('sys_push_short_name');
-        $sSafariWebId = getParam('sys_push_safari_id');
+        $sResult = '';
 
-        $sSubfolder = '/plugins_public/onesignal/';
-        $aUrl = parse_url(BX_DOL_URL_ROOT);
-        if(!empty($aUrl['path'])) {
-            $sPath = trim($aUrl['path'], '/');
-            if(!empty($sPath))
-                $sSubfolder = '/' . $sPath . $sSubfolder;
-        }
+        if(($oPush = BxDolPush::getObjectInstance()) !== false)
+            $sResult = $oPush->getCode('page_header');
 
-        $this->_oTemplate->addJs(array(
-            'https://cdn.onesignal.com/sdks/OneSignalSDK.js',
-            'BxDolPush.js',
-        ));
-
-        $sJsClass = 'BxDolPush';
-        $sJsObject = 'oBxDolPush';
-
-        $sContent = "var " . $sJsObject . " = new " . $sJsClass . "(" . json_encode(array(
-            'sObjName' => $sJsObject,
-            'sSiteName' => getParam('site_title'),
-            'aTags' => $aTags,
-            'sAppId' => $sAppId,
-            'sShortName' => $sShortName,
-            'sSafariWebId' => $sSafariWebId,
-            'sSubfolder' => $sSubfolder,
-            'sNotificationUrl' => BX_DOL_URL_ROOT,
-            'sTxtNotificationRequest' => _t('_sys_push_notification_request', getParam('site_title')),
-            'sTxtNotificationRequestYes' => _t('_sys_push_notification_request_yes'),
-            'sTxtNotificationRequestNo' => _t('_sys_push_notification_request_no'),
-        )) . ");";
-
-        return $this->_oTemplate->_wrapInTagJsCode($sContent);
+        return $sResult;
     }
 
     protected function getInjHeaderPopupLoading() 

+ 61 - 0
template/scripts/BxBasePushOneSignal.php

@@ -0,0 +1,61 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaBaseView UNA Base Representation Classes
+ * @{
+ */
+
+/**
+ * OneSignal integration.
+ * @see BxDolPush
+ */
+class BxBasePushOneSignal extends BxDolPushOneSignal
+{
+    protected function _getCodePageHeader()
+    {
+        if($this->_bCodeAdded || !$this->_sAppId)
+            return '';
+
+        $iProfileId = bx_get_logged_profile_id();
+        if(empty($iProfileId))
+            return '';
+
+        $aTags = self::getTags($iProfileId);
+        if(!$aTags)
+            return '';
+
+        $sSubfolder = '/plugins_public/onesignal/';
+        $aUrl = parse_url(BX_DOL_URL_ROOT);
+        if(!empty($aUrl['path'])) {
+            $sPath = trim($aUrl['path'], '/');
+            if(!empty($sPath))
+                $sSubfolder = '/' . $sPath . $sSubfolder;
+        }
+
+        $sJsObject = 'oBxDolPushOneSignal';
+
+        $this->_oTemplate->addJs([
+            'https://cdn.onesignal.com/sdks/OneSignalSDK.js',
+            'BxDolPushOneSignal.js',
+        ]);
+
+        $this->_bCodeAdded = true;
+        return $this->_oTemplate->_wrapInTagJsCode("var " . $sJsObject . " = new BxDolPushOneSignal(" . json_encode([
+            'sObjName' => $sJsObject,
+            'sSiteName' => getParam('site_title'),
+            'aTags' => $aTags,
+            'sAppId' => $this->_sAppId,
+            'sShortName' => $this->_sShortName,
+            'sSafariWebId' => $this->_sSafariWebId,
+            'sSubfolder' => $sSubfolder,
+            'sNotificationUrl' => BX_DOL_URL_ROOT,
+            'sTxtNotificationRequest' => _t('_sys_push_notification_request', getParam('site_title')),
+            'sTxtNotificationRequestYes' => _t('_sys_push_notification_request_yes'),
+            'sTxtNotificationRequestNo' => _t('_sys_push_notification_request_no'),
+        ]) . ");");
+    }
+}
+
+/** @} */

+ 13 - 0
template/scripts/BxBaseServices.php

@@ -1249,6 +1249,19 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
         return $aResults;
     }
 
+    public function serviceGetOptionsPushDefault()
+    {
+        $aResults = [
+            '' => _t('_None')
+        ];
+
+        $aObjects = BxDolPushQuery::getObjects();
+        foreach($aObjects as $aObject)
+            $aResults[$aObject['object']] = $aObject['title'];
+
+        return $aResults;
+    }
+
     public function serviceGetOptionsSocketsFieldDefault()
     {
         $aResults = [];

+ 15 - 0
template/scripts_templ/BxTemplPushOneSignal.php

@@ -0,0 +1,15 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaTemplate UNA Template Classes
+ * @{
+ */
+
+/**
+ * @see BxDolPush
+ */
+class BxTemplPushOneSignal extends BxBasePushOneSignal {}
+
+/** @} */

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است