Alex Trofimov 9 лет назад
Родитель
Сommit
eca4cf0d53

+ 9 - 0
upgrade/files/9.0.0.B4-9.0.0.B5/check.php

@@ -0,0 +1,9 @@
+<?php
+
+$mixCheckResult = 'Update can not be applied';
+
+$sVer = $this->oDb->getOne("SELECT `version` FROM `sys_modules` WHERE `name` = 'system'");
+if ('9.0.0.B4' == $sVer || '9.0.0-B4' == $sVer)
+    $mixCheckResult = true;
+
+return $mixCheckResult;

+ 12 - 0
upgrade/files/9.0.0.B4-9.0.0.B5/files/inc/version.inc.php

@@ -0,0 +1,12 @@
+<?php defined('BX_DOL') or defined('BX_DOL_INSTALL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    UnaCore UNA Core
+ * @{
+ */
+
+define('BX_DOL_VERSION', '9.0.0-B5'); ///< system files version, for DB version @see bx_get_ver, DB and files version must match
+
+/** @} */

+ 66 - 0
upgrade/files/9.0.0.B4-9.0.0.B5/files/template/scripts/BxBaseMenuSocialSharing.php

@@ -0,0 +1,66 @@
+<?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
+ * @{
+ */
+
+/**
+ * Menu for content social sharing
+ */
+class BxBaseMenuSocialSharing extends BxTemplMenu
+{
+    protected $_aNeedEncode = array(
+    	'url' => 'url_encoded',
+    	'title' => 'title_encoded'
+    );
+
+    public function __construct ($aObject, $oTemplate)
+    {
+        parent::__construct ($aObject, $oTemplate);
+
+        $sLang = BxDolLanguages::getInstance()->getCurrentLanguage();
+        $this->addMarkers(array (
+            'lang' => $sLang,
+        ));
+    }
+
+    public function addMarkers($a)
+    {
+        if(!empty($this->_aNeedEncode) && is_array($this->_aNeedEncode))
+            foreach($this->_aNeedEncode as $sKey1 => $sKey2)
+                if(array_key_exists($sKey1, $a))
+                    $a[$sKey2] = rawurlencode($a[$sKey1]);
+
+        return parent::addMarkers($a); 
+    }
+
+    public function getCode()
+    {
+        if (!isset($this->_aObject['menu_items']))
+            $this->_aObject['menu_items'] = $this->getMenuItemsRaw();
+
+        // alert
+        $sOverrideOutput = null;
+        $oAlert = new BxDolAlerts('system', 'social_sharing_display', '', '', array (
+        	'markers' => &$this->_aMarkers,
+            'buttons' => &$this->_aObject['menu_items'],
+            'override_output' => &$sOverrideOutput,
+        ));
+        $oAlert->alert();
+
+        // return custom code if there is one
+        if ($sOverrideOutput)
+            return $sOverrideOutput;
+
+        //return empty string of there is no buttons
+        if (empty($this->_aObject['menu_items']))
+            return '';
+
+        return parent::getCode();
+    }
+}
+
+/** @} */

+ 3 - 0
upgrade/files/9.0.0.B4-9.0.0.B5/script.php

@@ -0,0 +1,3 @@
+<?php
+    
+    return true;

+ 5 - 0
upgrade/files/9.0.0.B4-9.0.0.B5/sql.sql

@@ -0,0 +1,5 @@
+
+-- last step is to update current version
+
+UPDATE `sys_modules` SET `version` = '9.0.0-B5' WHERE (`version` = '9.0.0.B4' OR `version` = '9.0.0-B4') AND `name` = 'system';
+