Просмотр исходного кода

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

AntonLV 8 лет назад
Родитель
Сommit
7112b642c6

+ 1 - 1
inc/classes/BxDolGrid.php

@@ -556,7 +556,7 @@ class BxDolGrid extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
 
     protected function _isVisibleGrid ($a)
     {
-        if (!isset($a['visible_for_levels']))
+        if (isAdmin() || !isset($a['visible_for_levels']))
             return true;
         return BxDolAcl::getInstance()->isMemberLevelInSet($a['visible_for_levels']);
     }

+ 1 - 1
inc/classes/BxDolPage.php

@@ -256,7 +256,7 @@ class BxDolPage extends BxDolFactory implements iBxDolFactoryObject, iBxDolRepla
      */
     protected function _isVisiblePage ($a)
     {
-        return BxDolAcl::getInstance()->isMemberLevelInSet($a['visible_for_levels']);
+        return isAdmin() || BxDolAcl::getInstance()->isMemberLevelInSet($a['visible_for_levels']);
     }
 
 }

+ 1 - 1
inc/js/editor.tinymce.js

@@ -45,7 +45,7 @@ function bx_editor_remove_img (aEditorIds, aMarkers) {
 
     for (var j = 0; j < aEditors.length; j++) {
         var eEditor = aEditors[j];
-        if (typeof(eEditor) != 'object' || !eEditor.dom || !eEditor.dom.doc) 
+        if (typeof(eEditor) != 'object' || null === eEditor || typeof(eEditor.dom) != 'object' || typeof(eEditor.dom.doc) != 'object') 
         	continue;
 
         // delete images in html editor

+ 1 - 1
modules/base/general/classes/BxBaseModGeneralFormEntry.php

@@ -138,7 +138,7 @@ class BxBaseModGeneralFormEntry extends BxTemplFormView
 
     	return array (
 			'name' => $this->aInputs[$CNF['FIELD_PHOTO']]['name'],
-			'content_id' => $this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
+			'content_id' => (int)$this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
 			'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : '',
             'thumb_id' => isset($CNF['FIELD_THUMB']) && isset($aContentInfo[$CNF['FIELD_THUMB']]) ? $aContentInfo[$CNF['FIELD_THUMB']] : 0,
             'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : '',

+ 29 - 1
modules/base/groups/classes/BxBaseModGroupsFormsEntryHelper.php

@@ -38,6 +38,8 @@ class BxBaseModGroupsFormsEntryHelper extends BxBaseModProfileFormsEntryHelper
         if (!($oGroupProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->_oModule->_oConfig->getName())))
             return '';
 
+        $this->makeAuthorAdmin ($oGroupProfile, bx_get('initial_members'));
+
         $this->inviteMembers ($oGroupProfile, bx_get('initial_members'));
         
         return '';
@@ -49,7 +51,7 @@ class BxBaseModGroupsFormsEntryHelper extends BxBaseModProfileFormsEntryHelper
             return $s;
 
         if (!($oGroupProfile = BxDolProfile::getInstanceByContentAndType($iContentId, $this->_oModule->_oConfig->getName())))
-            return '';
+            return ''; 
 
         $this->inviteMembers ($oGroupProfile, bx_get('initial_members'));
 
@@ -82,6 +84,32 @@ class BxBaseModGroupsFormsEntryHelper extends BxBaseModProfileFormsEntryHelper
             $this->_oModule->serviceAddMutualConnection ($oGroupProfile->id(), $oProfile->id(), true);            
         }
     }
+
+    /**
+     * Make author admin if their is in initial invitations list
+     * @param $oGroupProfile group id
+     * @param $aInitialProfiles array of initial profile ids
+     * @return nothing
+     */ 
+    protected function makeAuthorAdmin ($oGroupProfile, $aInitialProfiles)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+        $iAdminProfileId = bx_get_logged_profile_id();
+
+        if (!isset($CNF['OBJECT_CONNECTIONS']) || !$CNF['OBJECT_CONNECTIONS'] || !is_array($aInitialProfiles) || !in_array($iAdminProfileId, $aInitialProfiles))
+            return;
+
+        if (!($oConnection = BxDolConnection::getObjectInstance($CNF['OBJECT_CONNECTIONS'])))
+            return;
+
+        if (!$oConnection->isConnected($oGroupProfile->id(), (int)$iAdminProfileId))
+            $oConnection->addConnection($oGroupProfile->id(), (int)$iAdminProfileId);
+        if (!$oConnection->isConnected((int)$iAdminProfileId, $oGroupProfile->id()))
+            $oConnection->addConnection((int)$iAdminProfileId, $oGroupProfile->id());
+
+        if (!$this->_oModule->_oDb->isAdmin ($oGroupProfile->id(), $iAdminProfileId))
+            $this->_oModule->_oDb->toAdmins ($oGroupProfile->id(), $iAdminProfileId);
+    }
 }
 
 /** @} */

+ 1 - 1
modules/base/text/template/form_ghost_template.html

@@ -31,6 +31,6 @@
     });
 
     // select first image as a thumb by default
-    if (1 == $('input[name="__name_thumb__[]"]').length)
+    if (!__content_id__ && 1 == $('input[name="__name_thumb__[]"]').length)
         $('input[name="__name_thumb__[]"]').attr('checked', true);
 </script>

+ 1 - 1
modules/boonex/chat_plus/classes/BxChatPlusStudioPage.php

@@ -23,7 +23,7 @@ class BxChatPlusStudioPage extends BxTemplStudioModule
     
     function getHelp ()
     {
-        return _t('_bx_chat_plus_information_block');
+        return _t('_bx_chat_plus_information_block',  BX_DOL_URL_ROOT);
     }
 }
 

+ 1 - 1
modules/boonex/chat_plus/install/langs/en.xml

@@ -25,7 +25,7 @@
 
 Enter the chat URL in this module settings. <br />
 
-Then OAuth login must be configured. <a href="{0}modules/?r=oauth2/administration/">Generate Key & Secret pair</a> in OAuth2 Server module by pointing chat URL and  desired name. <br />
+Then OAuth login must be configured. <a href="{0}studio/module.php?name=bx_oauth&page=settings">Generate Key & Secret pair</a> in OAuth2 Server module by pointing chat URL and  desired name. <br />
 
 After Key & Secret pair is generated you need to enter them in Chat Administration &gt; OAuth &gt; UNA.
 

+ 1 - 0
modules/boonex/dolphin_connect/classes/BxDolConModule.php

@@ -182,6 +182,7 @@ class BxDolConModule extends BxBaseModConnectModule
         $aProfileFields['birthday'] = isset($aProfileInfo['DateOfBirth']) ? $aProfileInfo['DateOfBirth'] : '';
         $aProfileFields['fullname'] = $sFullname;
         $aProfileFields['picture'] = $aProfileInfo['picture'];
+        $aProfileFields['description'] = $aProfileInfo['DescriptionMe'];
         $aProfileFields['allow_view_to'] = getParam('bx_dolcon_privacy');
             
         return $aProfileFields;

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

@@ -1294,6 +1294,7 @@
 	<string name="_adm_stg_cpt_option_sys_install_time"><![CDATA[Installation date]]></string>
 	<string name="_adm_stg_cpt_option_sys_live_updates_interval"><![CDATA[Live updates interval (in milliseconds)]]></string>
 	<string name="_adm_stg_cpt_option_sys_maps_api_key"><![CDATA[Google Maps API key]]></string>
+	<string name="_adm_stg_cpt_option_sys_embed_default"><![CDATA[Embeds provider]]></string>
 	<string name="_adm_stg_cpt_option_sys_embedly_api_key"><![CDATA[Embed.ly API key (fill in to use instead of Iframely)]]></string>
 	<string name="_adm_stg_cpt_option_sys_embedly_api_pattern"><![CDATA[Embed.ly API pattern (fill in to use instead of Iframely)]]></string>
 	<string name="_adm_stg_cpt_option_sys_iframely_api_key"><![CDATA[Iframely API key]]></string>

+ 1 - 1
modules/boonex/posts/classes/BxPostsFormEntry.php

@@ -148,7 +148,7 @@ class BxPostsFormEntry extends BxBaseModTextFormEntry
 
     	return array (
 			'name' => $this->aInputs[$CNF['FIELD_PHOTO']]['name'],
-			'content_id' => $this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
+			'content_id' => (int)$this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
 			'editor_id' => isset($CNF['FIELD_TEXT_ID']) ? $CNF['FIELD_TEXT_ID'] : ''
     	);
     }

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

@@ -25,7 +25,7 @@
 
 Нужно ввести URL чата в настройках этого модуля. <br />
 
-Затем OAuth модуль должен быть сконфигурирован. <a href="{0}modules/?r=oauth2/administration/">Сгенерируйте пару Ключ & Секрет</a> в модуле OAuth2 сервер указав адрес чата и произвольный заголовок. <br />
+Затем OAuth модуль должен быть сконфигурирован. <a href="{0}studio/module.php?name=bx_oauth&page=settings">Сгенерируйте пару Ключ & Секрет</a> в модуле OAuth2 сервер указав адрес чата и произвольный заголовок. <br />
 
 После того как пара Ключ & Секрет сгенерированы, нужно указать их в чате: <br />
 Администрирование &gt; OAuth &gt; UNA.

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

@@ -1292,6 +1292,7 @@
 	<string name="_adm_stg_cpt_option_sys_install_time"><![CDATA[Дата установки]]></string>
     <string name="_adm_stg_cpt_option_sys_live_updates_interval"><![CDATA[Интервал обновлений (в миллисекундах)]]></string>
     <string name="_adm_stg_cpt_option_sys_maps_api_key"><![CDATA[Ключ Google Maps API]]></string>
+    <string name="_adm_stg_cpt_option_sys_embed_default"><![CDATA[Поставщик встраиваемого кода]]></string>
     <string name="_adm_stg_cpt_option_sys_embedly_api_key"><![CDATA[Ключ Embed.ly API (заполните, чтобы использовать вместо Iframely)]]></string>
     <string name="_adm_stg_cpt_option_sys_embedly_api_pattern"><![CDATA[Шаблон Embed.ly API (заполните, чтобы использовать вместо Iframely)]]></string>
     <string name="_adm_stg_cpt_option_sys_iframely_api_key"><![CDATA[Ключ Iframely API]]></string>