Răsfoiți Sursa

Merge branch 'master' of https://github.com/unaio/una

AntonLV 7 ani în urmă
părinte
comite
2d83203b69

+ 33 - 7
inc/classes/BxDolTranscoder.php

@@ -13,6 +13,8 @@ define('BX_DOL_QUEUE_COMPLETE', 'complete'); ///< file is already processed
 define('BX_DOL_QUEUE_FAILED', 'failed'); ///< file processing was failed
 define('BX_DOL_QUEUE_DELETE', 'delete'); ///< file is subject to delete
 
+define('BX_DOL_MAX_RETINA_DIMENSION_MOBILE', 500); ///< max image dimension which will be processes as retine on mobiles
+
 /**
  * Base class for @see BxDolTranscoderImage and @see BxDolTranscoderVideo transcoders
  */
@@ -508,16 +510,22 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
     }
 
     public function getDevicePixelRatio ()
-    {
-        if ($this->_iDevicePixelRatio)
-            return $this->_iDevicePixelRatio;
-
-        if (isset($_COOKIE['devicePixelRatio']) && (!isset($this->_aObject['source_params']['disable_retina']) || !$this->_aObject['source_params']['disable_retina'])) {
+    {   
+        $iRet = 1;
+        if ($this->_iDevicePixelRatio) {
+            $iRet = $this->_iDevicePixelRatio;
+        }
+        elseif (isset($_COOKIE['devicePixelRatio']) && (!isset($this->_aObject['source_params']['disable_retina']) || !$this->_aObject['source_params']['disable_retina'])) {
             $iDevicePixelRatio = intval($_COOKIE['devicePixelRatio']);
             if ($iDevicePixelRatio >= 2)
-                return 2;
+                $iRet = 2;
         }
-        return 1;
+
+        // don't resize images on mobile if they are already big enough
+        if ($iRet > 1 && $this->isMobile() && $this->getMaxResizeDimention() >= BX_DOL_MAX_RETINA_DIMENSION_MOBILE)
+            $iRet = 1;
+
+        return $iRet;
     }
 
     public function getOrigFileUrl ($mixedHandler)
@@ -862,6 +870,24 @@ class BxDolTranscoder extends BxDolFactory implements iBxDolFactoryObject
                 return $aParams['filter_params'];
         return false;
     }
+
+    public function getMaxResizeDimention ()
+    {
+        $a = $this->_oDb->getTranscoderFilters('Resize');
+        if (!$a)
+            return 0;
+        $aFilter = array_pop($a);
+        $aFilterParams = $aFilter['filter_params'] ? unserialize($aFilter['filter_params']) : array();
+        return $aFilterParams ? max(isset($aFilterParams['w']) ? $aFilterParams['w'] : 0, isset($aFilterParams['h']) ? $aFilterParams['h'] : 0) : 0;
+    }
+
+    public function isMobile ()
+    {
+        if (!isset($_SERVER['HTTP_USER_AGENT']))
+            return false;
+        $s = $_SERVER['HTTP_USER_AGENT'];
+        return preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i', $s) || preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i', substr($s, 0, 4));
+    }
 }
 
 /** @} */

+ 14 - 7
inc/classes/BxDolTranscoderQuery.php

@@ -47,10 +47,17 @@ class BxDolTranscoderQuery extends BxDolDb
         return $oDb->getAll($sQuery);
     }
 
-    public function getTranscoderFilters ()
+    public function getTranscoderFilters ($sFilterName = '')
     {
-        $sQuery = $this->prepare("SELECT * FROM {$this->_sTableFilters} WHERE `transcoder_object` = ? ORDER BY `order` ASC", $this->_aObject['object']);
-        return $this->getAll($sQuery);
+        $aBindings = array('object' => $this->_aObject['object']);
+        $sWhere = '';
+        if ($sFilterName) {
+            $sWhere .= ' AND `filter` = :filter '; 
+            $aBindings['filter'] = $sFilterName;
+        }
+        $sQuery = "SELECT * FROM {$this->_sTableFilters} WHERE `transcoder_object` = :object $sWhere ORDER BY `order` ASC";
+        return $this->fromMemory('BxDolTranscoderQuery::getTranscoderFilters' . $this->_aObject['object'] . $sFilterName, 'getAll', $sQuery, $aBindings);
+
     }
 
     public function updateHandler ($iFileId, $mixedHandler)
@@ -73,7 +80,7 @@ class BxDolTranscoderQuery extends BxDolDb
 
     public function getFileIdByHandler ($mixedHandler)
     {
-        $sQuery = $this->prepare("SELECT `file_id` FROM {$this->_sTableFiles} WHERE `transcoder_object` = ? AND `handler` = ?", $this->_aObject['object'], $mixedHandler);
+        $sQuery = $this->prepare("SELECT `file_id` FROM {$this->_sTableFiles} WHERE `transcoder_object` = ? AND `handler` = ? LIMIT 1", $this->_aObject['object'], (string)$mixedHandler);
         return $this->getOne($sQuery);
     }
 
@@ -86,7 +93,7 @@ class BxDolTranscoderQuery extends BxDolDb
     public function updateAccessTime($mixedHandler)
     {
         $iTime = time();
-        $sQuery = $this->prepare("UPDATE {$this->_sTableFiles} SET `atime` = ? WHERE `transcoder_object` = ? AND `handler` = ?", $iTime, $this->_aObject['object'], $mixedHandler);
+        $sQuery = $this->prepare("UPDATE {$this->_sTableFiles} SET `atime` = ? WHERE `transcoder_object` = ? AND `handler` = ? LIMIT 1", $iTime, $this->_aObject['object'], (string)$mixedHandler);
         return $this->res($sQuery);
     }
 
@@ -277,7 +284,7 @@ class BxDolTranscoderQuery extends BxDolDb
 
     public function getTranscodedFileData($mixedHandler)
     {
-        $sQuery = $this->prepare("SELECT `data` FROM {$this->_sTableFiles} WHERE `transcoder_object` = ? AND `handler` = ?", $this->_aObject['object'], $mixedHandler);
+        $sQuery = $this->prepare("SELECT `data` FROM {$this->_sTableFiles} WHERE `transcoder_object` = ? AND `handler` = ? LIMIT 1", $this->_aObject['object'], (string)$mixedHandler);
         $s = $this->getOne($sQuery);
         if (!$s)
             return false;
@@ -287,7 +294,7 @@ class BxDolTranscoderQuery extends BxDolDb
     public function updateTranscodedFileData($mixedHandler, $mixedData)
     {
         $sData = $mixedData ? serialize($mixedData) : '';
-        $sQuery = $this->prepare("UPDATE {$this->_sTableFiles} SET `data` = ? WHERE `transcoder_object` = ? AND `handler` = ?", $sData, $this->_aObject['object'], $mixedHandler);
+        $sQuery = $this->prepare("UPDATE {$this->_sTableFiles} SET `data` = ? WHERE `transcoder_object` = ? AND `handler` = ? LIMIT 1", $sData, $this->_aObject['object'], (string)$mixedHandler);
 
         return $this->res($sQuery);
     }

+ 0 - 18
modules/boonex/mobile_apps/install/langs/en.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources name="en" flag="gb" title="English">
-	<string name="_sys_module_mobileapps"><![CDATA[Mobile Apps]]></string>
-	<string name="_bx_mobileapps"><![CDATA[Mobile Apps]]></string>
-
-	<string name="_bx_mobileapps_setting"><![CDATA[Mobile Apps Setting]]></string>
-    <string name="_bx_mobileapps_adm_stg_cpt_type"><![CDATA[Mobile Apps]]></string>
-    <string name="_bx_mobileapps_adm_stg_cpt_category_general"><![CDATA[General]]></string>
-    <string name="_bx_mobileapps_option_qwerty"><![CDATA[Qwerty]]></string>
-
-	<string name="_bx_mobileapps_information"><![CDATA[Information]]></string>
-    <string name="_bx_mobileapps_information_block"><![CDATA[This module adds neccesary styles and functionalty for proper functionality of UNA mobile apps. Installing this module isn't enough, you need to get source code of mobile apps modify it for your needs and publish in Google and Apple stores.]]></string>
-
-    <string name="_bx_mobileapps_pull_to_refresh"><![CDATA[Pull to refresh]]></string> <!-- потяни, чтобы обновить -->
-    <string name="_bx_mobileapps_release_to_refresh"><![CDATA[Release to refresh]]></string> <!-- отпусти, чтобы обновить -->
-    <string name="_bx_mobileapps_refreshing"><![CDATA[Refreshing]]></string> <!-- обновление -->
-
-</resources>

+ 0 - 30
modules/boonex/mobile_apps/install/sql/enable.sql

@@ -1,30 +0,0 @@
-
--- Settings
-
-SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
-INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES 
-('modules', 'bx_mobileapps', '_bx_mobileapps_adm_stg_cpt_type', 'bx_mobileapps@modules/boonex/mobile_apps/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
-SET @iTypeId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
-VALUES (@iTypeId, 'bx_mobileapps_general', '_bx_mobileapps_adm_stg_cpt_category_general', 1);
-SET @iCategId = LAST_INSERT_ID();
-
-INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-('bx_mobileapps_option_qwerty', '123', @iCategId, '_bx_mobileapps_option_qwerty', 'digit', '', '', '', 10);
-
--- Injections
-
-INSERT INTO `sys_injections`(`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES
-('bx_mobileapps', 0, 'injection_head_begin', 'service', 'a:2:{s:6:"module";s:13:"bx_mobileapps";s:6:"method";s:20:"injection_head_begin";}', 0, 1),
-('bx_mobileapps', 0, 'injection_head', 'service', 'a:2:{s:6:"module";s:13:"bx_mobileapps";s:6:"method";s:14:"injection_head";}', 0, 1);
-
--- Alerts
-
-INSERT INTO `sys_alerts_handlers` SET `name` = 'bx_mobileapps', `class` = 'BxMobileAppsAlerts', `file` = 'modules/boonex/mobile_apps/classes/BxMobileAppsAlerts.php';
-
-SET @iHandlerId = LAST_INSERT_ID();
-
-INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
-('system', 'page_output', @iHandlerId);
-

+ 0 - 26
modules/boonex/mobile_apps/template/images/icons/std-icon.svg

@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="606px" height="606px" viewBox="0 0 606 606" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <title>Mobile Apps</title>
-    <defs>
-        <linearGradient id="linearGradient-1" y2="100%" x2="50%" y1="0%" x1="50%">
-            <stop offset="0%" stop-opacity="0.2" stop-color="#FFFFFF"/>
-            <stop offset="100%" stop-opacity="0.13887" stop-color="#000000"/>
-        </linearGradient>    
-        <path d="M552.268958,552.268958 C600,504.537813 600,431.458333 600,300 C600,168.541667 600,95.4621875 552.268958,47.7310417 C504.537813,0 431.458333,0 300,0 C168.541667,0 95.4621875,0 47.7310417,47.7310417 C0,95.4621875 0,168.541667 0,300 C0,431.458333 0,504.537813 47.7310417,552.268958 C95.4621875,600 168.541667,600 300,600 C431.458333,600 504.537813,600 552.268958,552.268958 Z" id="path-2"></path>
-    </defs>
-    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-        <g transform="translate(3.000000, 3.000000)">
-            <g id="Squircle2-Copy-6">
-                <g id="Shape">
-                    <use fill="#FF4D63" xlink:href="#path-2"></use>
-                    <use stroke="#000000" stroke-width="4.04" fill="url(#linearGradient-1)" xlink:href="#path-2"></use>
-                </g>
-            </g>
-            <g transform="translate(172.000000, 96.000000) scale(0.8, 0.8)" fill="#FFFFFF">
-
-<path fill="#fff" d="M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"></path>
-
-            </g>
-        </g>
-    </g>
-</svg>

+ 3 - 3
modules/boonex/mobile_apps/classes/BxMobileAppsAlerts.php → modules/boonex/nexus/classes/BxNexusAlerts.php

@@ -3,13 +3,13 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxMobileAppsAlerts extends BxDolAlertsResponse
+class BxNexusAlerts extends BxDolAlertsResponse
 {
     protected $_oModule;
     function __construct()
@@ -19,7 +19,7 @@ class BxMobileAppsAlerts extends BxDolAlertsResponse
 
     public function response($o)
     {
-        if ('system' == $o->sUnit && 'page_output' == $o->sAction && 'sys_home' == $o->aExtras['page_name'] && !isLogged() && false !== strpos($_SERVER['HTTP_USER_AGENT'], 'UNAMobileApp')) {
+        if ('system' == $o->sUnit && 'page_output' == $o->sAction && 'sys_home' == $o->aExtras['page_name'] && !isLogged() && false !== strpos($_SERVER['HTTP_USER_AGENT'], 'UNANexus')) {
 
             // require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
     

+ 2 - 2
modules/boonex/mobile_apps/classes/BxMobileAppsConfig.php → modules/boonex/nexus/classes/BxNexusConfig.php

@@ -3,13 +3,13 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxMobileAppsConfig extends BxDolModuleConfig
+class BxNexusConfig extends BxDolModuleConfig
 {
     function __construct($aModule)
     {

+ 2 - 2
modules/boonex/mobile_apps/classes/BxMobileAppsDb.php → modules/boonex/nexus/classes/BxNexusDb.php

@@ -3,13 +3,13 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxMobileAppsDb extends BxDolModuleDb
+class BxNexusDb extends BxDolModuleDb
 {
     function __construct(&$oConfig)
     {

+ 9 - 9
modules/boonex/mobile_apps/classes/BxMobileAppsModule.php → modules/boonex/nexus/classes/BxNexusModule.php

@@ -3,13 +3,13 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxMobileAppsModule extends BxDolModule
+class BxNexusModule extends BxDolModule
 {
     function __construct(&$aModule)
     {
@@ -17,7 +17,7 @@ class BxMobileAppsModule extends BxDolModule
     }
 
     /**
-     * Get injection code required for mobile apps
+     * Get injection code required for Nexus apps
      * @return string
      */
     public function serviceInjectionHeadBegin()
@@ -30,7 +30,7 @@ class BxMobileAppsModule extends BxDolModule
     }
     
     /**
-     * Get injection code required for mobile apps
+     * Get injection code required for Nexus apps
      * @return string with Styles and JS code
      */
     public function serviceInjectionHead()
@@ -51,17 +51,17 @@ class BxMobileAppsModule extends BxDolModule
             $iBubbles += $r['bx_if:addon']['content']['addon'];
         }
 
-        $s  = $this->_oTemplate->parseHtmlByName('mobile_apps_styles.html', array());
-        $s .= $this->_oTemplate->parseHtmlByName('mobile_apps_js.html', array(
+        $s  = $this->_oTemplate->parseHtmlByName('styles.html', array());
+        $s .= $this->_oTemplate->parseHtmlByName('js.html', array(
             'msg' => json_encode(array(
                 'loggedin' => isLogged(),                
                 'bubbles_num' => $iBubbles ? $iBubbles : '',
                 'bubbles' => $aBubbles,
                 'push_tags' => array('user' => bx_get_logged_profile_id())
             )),
-            'txt_pull_to_refresh' => bx_js_string(_t('_bx_mobileapps_pull_to_refresh')),
-            'txt_release_to_refresh' => bx_js_string(_t('_bx_mobileapps_release_to_refresh')),
-            'txt_refreshing' => bx_js_string(_t('_bx_mobileapps_refreshing')),
+            'txt_pull_to_refresh' => bx_js_string(_t('_bx_nexus_pull_to_refresh')),
+            'txt_release_to_refresh' => bx_js_string(_t('_bx_nexus_release_to_refresh')),
+            'txt_refreshing' => bx_js_string(_t('_bx_nexus_refreshing')),
         ));
 
         $this->_oTemplate->addJs('pulltorefresh.min.js');

+ 4 - 4
modules/boonex/mobile_apps/classes/BxMobileAppsStudioPage.php → modules/boonex/nexus/classes/BxNexusStudioPage.php

@@ -3,13 +3,13 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxMobileAppsStudioPage extends BxTemplStudioModule
+class BxNexusStudioPage extends BxTemplStudioModule
 {
     function __construct($sModule = "", $sPage = "")
     {
@@ -17,13 +17,13 @@ class BxMobileAppsStudioPage extends BxTemplStudioModule
 
         $this->aMenuItems = array(
             array('name' => 'settings', 'icon' => 'cogs', 'title' => '_adm_lmi_cpt_settings'),
-            array('name' => 'help', 'icon' => 'question', 'title' => '_bx_mobileapps_information'),
+            array('name' => 'help', 'icon' => 'question', 'title' => '_bx_nexus_information'),
         );
     }
     
     function getHelp ()
     {
-        return _t('_bx_mobileapps_information_block');
+        return _t('_bx_nexus_information_block');
     }
 }
 

+ 2 - 2
modules/boonex/mobile_apps/classes/BxMobileAppsTemplate.php → modules/boonex/nexus/classes/BxNexusTemplate.php

@@ -3,13 +3,13 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxMobileAppsTemplate extends BxDolModuleTemplate
+class BxNexusTemplate extends BxDolModuleTemplate
 {
     function __construct(&$oConfig, &$oDb)
     {

+ 9 - 9
modules/boonex/mobile_apps/install/config.php → modules/boonex/nexus/install/config.php

@@ -3,7 +3,7 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{
@@ -14,9 +14,9 @@ $aConfig = array(
      * Main Section.
      */
     'type' => BX_DOL_MODULE_TYPE_MODULE,
-    'name' => 'bx_mobileapps',
-    'title' => 'Mobile Apps',
-    'note' => 'Mobile Apps.',
+    'name' => 'bx_nexus',
+    'title' => 'Nexus',
+    'note' => 'Nexus - Mobile Apps and Desktop apps connector.',
     'version' => '9.0.0.DEV',
     'vendor' => 'BoonEx',
 	'help_url' => 'http://feed.una.io/?section={module_name}',
@@ -28,16 +28,16 @@ $aConfig = array(
     /**
      * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
      */
-    'home_dir' => 'boonex/mobile_apps/',
-    'home_uri' => 'mobileapps',
+    'home_dir' => 'boonex/nexus/',
+    'home_uri' => 'nexus',
 
-    'db_prefix' => 'bx_mobileapps_',
-    'class_prefix' => 'BxMobileApps',
+    'db_prefix' => 'bx_nexus_',
+    'class_prefix' => 'BxNexus',
 
     /**
      * Category for language keys.
      */
-    'language_category' => 'Mobile Apps',
+    'language_category' => 'Nexus',
     
     /**
      * Installation/Uninstallation Section.

+ 2 - 2
modules/boonex/mobile_apps/install/installer.php → modules/boonex/nexus/install/installer.php

@@ -3,13 +3,13 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{
  */
 
-class BxMobileAppsInstaller extends BxDolStudioInstaller
+class BxNexusInstaller extends BxDolStudioInstaller
 {
     function __construct($aConfig)
     {

+ 18 - 0
modules/boonex/nexus/install/langs/en.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+	<string name="_sys_module_nexus"><![CDATA[Nexus]]></string>
+	<string name="_bx_nexus"><![CDATA[Nexus]]></string>
+
+	<string name="_bx_nexus_setting"><![CDATA[Nexus Setting]]></string>
+    <string name="_bx_nexus_adm_stg_cpt_type"><![CDATA[Nexus]]></string>
+    <string name="_bx_nexus_adm_stg_cpt_category_general"><![CDATA[General]]></string>
+    <string name="_bx_nexus_option_qwerty"><![CDATA[Qwerty]]></string>
+
+	<string name="_bx_nexus_information"><![CDATA[Information]]></string>
+    <string name="_bx_nexus_information_block"><![CDATA[This module adds neccesary styles and functionalty for proper functionality of UNA Nexus apps. Installing this module isn't enough, you need to get source code of mobile apps then modify them for your needs then publish in Google and Apple stores.]]></string>
+
+    <string name="_bx_nexus_pull_to_refresh"><![CDATA[Pull to refresh]]></string> <!-- потяни, чтобы обновить -->
+    <string name="_bx_nexus_release_to_refresh"><![CDATA[Release to refresh]]></string> <!-- отпусти, чтобы обновить -->
+    <string name="_bx_nexus_refreshing"><![CDATA[Refreshing]]></string> <!-- обновление -->
+
+</resources>

+ 3 - 3
modules/boonex/mobile_apps/install/sql/disable.sql → modules/boonex/nexus/install/sql/disable.sql

@@ -1,15 +1,15 @@
 
 -- Settings
 
-DELETE FROM `top`, `toc`, `to` USING `sys_options_types` AS `top` LEFT JOIN `sys_options_categories` AS `toc` ON `top`.`id`=`toc`.`type_id` LEFT JOIN `sys_options` AS `to` ON `toc`.`id`=`to`.`category_id` WHERE `top`.`name` = 'bx_mobileapps';
+DELETE FROM `top`, `toc`, `to` USING `sys_options_types` AS `top` LEFT JOIN `sys_options_categories` AS `toc` ON `top`.`id`=`toc`.`type_id` LEFT JOIN `sys_options` AS `to` ON `toc`.`id`=`to`.`category_id` WHERE `top`.`name` = 'bx_nexus';
 
 -- Injections
 
-DELETE FROM `sys_injections` WHERE `name` IN('bx_mobileapps');
+DELETE FROM `sys_injections` WHERE `name` IN('bx_nexus');
 
 -- Alerts
 
-SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_mobileapps');
+SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_nexus');
 
 DELETE FROM `sys_alerts_handlers` WHERE `id`  = @iHandlerId;
 DELETE FROM `sys_alerts` WHERE `handler_id` =  @iHandlerId ;

+ 30 - 0
modules/boonex/nexus/install/sql/enable.sql

@@ -0,0 +1,30 @@
+
+-- Settings
+
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_nexus', '_bx_nexus_adm_stg_cpt_type', 'bx_nexus@modules/boonex/nexus/|std-icon.svg', IF(NOT ISNULL(@iTypeOrder), @iTypeOrder + 1, 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order` )  
+VALUES (@iTypeId, 'bx_nexus_general', '_bx_nexus_adm_stg_cpt_category_general', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
+('bx_nexus_option_qwerty', '123', @iCategId, '_bx_nexus_option_qwerty', 'digit', '', '', '', 10);
+
+-- Injections
+
+INSERT INTO `sys_injections`(`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES
+('bx_nexus', 0, 'injection_head_begin', 'service', 'a:2:{s:6:"module";s:8:"bx_nexus";s:6:"method";s:20:"injection_head_begin";}', 0, 1),
+('bx_nexus', 0, 'injection_head', 'service', 'a:2:{s:6:"module";s:8:"bx_nexus";s:6:"method";s:14:"injection_head";}', 0, 1);
+
+-- Alerts
+
+INSERT INTO `sys_alerts_handlers` SET `name` = 'bx_nexus', `class` = 'BxNexusAlerts', `file` = 'modules/boonex/nexus/classes/BxNexusAlerts.php';
+
+SET @iHandlerId = LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'page_output', @iHandlerId);
+

+ 2 - 2
modules/boonex/mobile_apps/install/sql/install.sql → modules/boonex/nexus/install/sql/install.sql

@@ -3,13 +3,13 @@
 -- Studio page and widget
 
 INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
-(3, 'bx_mobileapps', '_bx_mobileapps', '_bx_mobileapps', 'bx_mobileapps@modules/boonex/mobile_apps/|std-icon.svg');
+(3, 'bx_nexus', '_bx_nexus', '_bx_nexus', 'bx_nexus@modules/boonex/nexus/|std-icon.svg');
 SET @iPageId = LAST_INSERT_ID();
 
 SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
 SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
 INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
-(@iPageId, 'bx_mobileapps', '{url_studio}module.php?name=bx_mobileapps', '', 'bx_mobileapps@modules/boonex/mobile_apps/|std-icon.svg', '_bx_mobileapps', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+(@iPageId, 'bx_nexus', '{url_studio}module.php?name=bx_nexus', '', 'bx_nexus@modules/boonex/nexus/|std-icon.svg', '_bx_nexus', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
 INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
 (@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
 

+ 1 - 1
modules/boonex/mobile_apps/install/sql/uninstall.sql → modules/boonex/nexus/install/sql/uninstall.sql

@@ -3,5 +3,5 @@
 
 DELETE FROM `tp`, `tw`, `tpw`
 USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
-WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_mobileapps';
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_nexus';
 

+ 0 - 0
modules/boonex/mobile_apps/js/pulltorefresh.min.js → modules/boonex/nexus/js/pulltorefresh.min.js


+ 1 - 1
modules/boonex/mobile_apps/request.php → modules/boonex/nexus/request.php

@@ -3,7 +3,7 @@
  * Copyright (c) UNA, Inc - https://una.io
  * MIT License - https://opensource.org/licenses/MIT
  *
- * @defgroup    MobileApps Mobile Apps
+ * @defgroup    Nexus Nexus - Mobile Apps and Desktop apps connector
  * @ingroup     UnaModules
  *
  * @{

Fișier diff suprimat deoarece este prea mare
+ 7 - 0
modules/boonex/nexus/template/images/icons/std-icon.svg


+ 12 - 11
modules/boonex/mobile_apps/template/mobile_apps_js.html → modules/boonex/nexus/template/js.html

@@ -38,17 +38,18 @@
         ipcRenderer.send('message', __msg__);
 
         // send messenger badge
-        setInterval(function () {
-            if ('undefined' !== typeof oLiveUpdates && oLiveUpdates._aSystemsActive && 'undefined' !== typeof oLiveUpdates._aSystemsActive.bx_messenger_new_messages) {
-                sMsg = {
-                    'bubbles': {
-                        'notifications-messenger': oLiveUpdates._aSystemsActive.bx_messenger_new_messages,
-                    },
-                };
-                ipcRenderer.send('message', sMsg);
-            }
-        }, 3000);
-        
+        if (typeof window.glBxMessengerOnNotificationChange === 'undefined')
+            window.glBxMessengerOnNotificationChange = [];
+
+        window.glBxMessengerOnNotificationChange.push(function (iNewNumberOfUnreadChats) {
+            sMsg = {
+                'bubbles': {
+                    'notifications-messenger': iNewNumberOfUnreadChats,
+                },
+            };
+            ipcRenderer.send('message', sMsg);
+        });
+
         if ($.cookie('memberID')) {
             // force links to open in external browser in electron
             $(document).ready(function () {

+ 0 - 0
modules/boonex/mobile_apps/template/mobile_apps_styles.html → modules/boonex/nexus/template/styles.html


+ 10 - 10
plugins/lessphp/Less.php

@@ -9706,7 +9706,7 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
 				case 40:
 					$parenLevel++;
 					$lastParen = $this->parserCurrentIndex;
-					continue 2;
+					break;
 
 				// )
 				case 41:
@@ -9714,18 +9714,18 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
 					if( $parenLevel < 0 ){
 						return $this->fail("missing opening `(`");
 					}
-					continue 2;
+					break;
 
 				// ;
 				case 59:
 					//if (!$parenLevel) { $this->emitChunk();	}
-					continue 2;
+					break;
 
 				// {
 				case 123:
 					$level++;
 					$lastOpening = $this->parserCurrentIndex;
-					continue 2;
+					break;
 
 				// }
 				case 125:
@@ -9735,10 +9735,10 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
 
 					}
 					//if (!$level && !$parenLevel) { $this->emitChunk(); }
-					continue 2;
+					break;
 				// \
 				case 92:
-					if ($this->parserCurrentIndex < $this->input_len - 1) { $this->parserCurrentIndex++; continue 2; }
+					if ($this->parserCurrentIndex < $this->input_len - 1) { $this->parserCurrentIndex++; break; }
 					return $this->fail("unescaped `\\`");
 
 				// ", ' and `
@@ -9758,12 +9758,12 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
 							$this->parserCurrentIndex++;
 						}
 					}
-					if ($matched) { continue 2; }
+					if ($matched) { break; }
 					return $this->fail("unmatched `" . chr($cc) . "`", $currentChunkStartIndex);
 
 				// /, check for comment
 				case 47:
-					if ($parenLevel || ($this->parserCurrentIndex == $this->input_len - 1)) { continue 2; }
+					if ($parenLevel || ($this->parserCurrentIndex == $this->input_len - 1)) { break; }
 					$cc2 = $this->CharCode($this->parserCurrentIndex+1);
 					if ($cc2 == 47) {
 						// //, find lnfeed
@@ -9784,14 +9784,14 @@ class Less_Exception_Chunk extends Less_Exception_Parser{
 							return $this->fail("missing closing `*/`", $currentChunkStartIndex);
 						}
 					}
-					continue 2;
+					break;
 
 				// *, check for unmatched */
 				case 42:
 					if (($this->parserCurrentIndex < $this->input_len - 1) && ($this->CharCode($this->parserCurrentIndex+1) == 47)) {
 						return $this->fail("unmatched `/*`");
 					}
-					continue 2;
+					break;
 			}
 		}
 

+ 24 - 0
scripts/delete_me.html

@@ -0,0 +1,24 @@
+<!-- NEW IMPLEMENETAION: Javascript install - works fine -->
+<link rel="stylesheet" href="//cdn.flowplayer.com/releases/native/stable/style/flowplayer.css">
+<script src="//cdn.flowplayer.com/releases/native/stable/flowplayer.min.js"></script>
+<div id="bx_flowplayer"></div>
+<script>
+flowplayer('#bx_flowplayer', {
+  "ima": {
+    "ads": [
+      { "time": 0, "adTag": "https://mydserver.com/path/vast.xml" },
+      { "time": 20, "adTag": "https://mydserver.com/path/vast2.xml" },
+      { "time": 300, "adTag": "https://mydserver.com/path/vast3.xml" }
+    ],
+    "parameters": { "age": 25, "location": "us" },
+    "show_all_ads_on_seek": false
+  }
+  poster: "__image__",
+  src: [
+    <bx_if:mp4>{ "src": "__mp4__", "type": "video/mp4" },</bx_if:mp4>
+    <bx_if:webm>{ "src": "__webm__", "type": "video/webm; codecs='vp8, vorbis'" },</bx_if:webm>
+    <bx_if:ogv>{ "src": "__ogv__", "type": "video/ogg" },</bx_if:ogv>
+  ],
+  token: 'eyJraWQiOiI1Y0E2QjlRZml5a3EiLCJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJjIjoie1wiYWNsXCI6NixcImlkXCI6XCI1Y0E2QjlRZml5a3FcIn0iLCJpc3MiOiJGbG93cGxheWVyIn0.uSWLyAwUCdKRL9CyKJIJbgfrRnwKhwcIwQgWgbYIB3_TxMvIgBmIQFxle6pa7RgWLUY4qE_zRawJDR0sk_hZqg'
+})
+</script>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff