Pārlūkot izejas kodu

Ticket #4870 - Audience Selector Changes.

AntonLV 1 gadu atpakaļ
vecāks
revīzija
313a05f169

+ 2 - 1
inc/classes/BxDolPrivacy.php

@@ -184,7 +184,8 @@ class BxDolPrivacy extends BxDolFactory implements iBxDolFactoryObject
 
         $aValues = $oPrivacy->addDynamicGroups($aValues, $iOwnerId, $aParams);
 
-        $aValues = $oPrivacy->addSpaces($aValues, $iOwnerId, $aParams);
+        if(getParam('sys_enable_post_to_context_for_privacy') == 'on')
+            $aValues = $oPrivacy->addSpaces($aValues, $iOwnerId, $aParams);
 
         $sName = $oPrivacy->convertActionToField($sAction);
 

+ 6 - 2
inc/classes/BxDolPrivacyQuery.php

@@ -80,7 +80,7 @@ class BxDolPrivacyQuery extends BxDolDb
     function getGroupsBy($aParams)
     {
         $sSelectClause = "`id`, `title`, `check`, `active`";
-        $sWhereClause = "";
+        $sWhereClause = $sOrderClause = "";
 
         switch($aParams['type']) {
             case 'id':
@@ -95,6 +95,7 @@ class BxDolPrivacyQuery extends BxDolDb
                 $sCacheName = $this->_sCacheGroupsActVis;
                 $sMethod = 'getAll';
                 $sWhereClause = "`active`='1' AND `visible`='1'";
+                $sOrderClause = "`order` ASC";
                 break;
 
             case 'active_list':
@@ -106,10 +107,13 @@ class BxDolPrivacyQuery extends BxDolDb
                 break;
         }
 
+        if($sOrderClause)
+            $sOrderClause = "ORDER BY " . $sOrderClause;
+
         $sSql = "SELECT
                     " . $sSelectClause . "
                 FROM `sys_privacy_groups`
-                WHERE " . $sWhereClause;
+                WHERE " . $sWhereClause . " " . $sOrderClause;
 
         return !empty($sCacheFunction) && !empty($sCacheName) ? $this->$sCacheFunction($sCacheName, $sMethod, $sSql) : $this->$sMethod($sSql);
     }

+ 16 - 14
install/sql/system.sql

@@ -394,7 +394,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 
 (@iCategoryId, 'sys_search_keyword_min_len', '_adm_stg_cpt_option_sys_search_keyword_min_len', '1', 'digit', '', '', '', '', 80),
 
-(@iCategoryId, 'sys_relations_enable', '_adm_stg_cpt_option_sys_relations_enable', 'on', 'checkbox', '', '', '', '', 90),
+(@iCategoryId, 'sys_relations_enable', '_adm_stg_cpt_option_sys_relations_enable', '', 'checkbox', '', '', '', '', 90),
 (@iCategoryId, 'sys_relations', '_adm_stg_cpt_option_sys_relations', '', 'list', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:21:"get_options_relations";s:6:"params";a:0:{}s:5:"class";s:13:"TemplServices";}', '', '', '', 91),
 
 (@iCategoryId, 'enable_gd', '_adm_stg_cpt_option_enable_gd', 'on', 'checkbox', '', '', '', '', 100),
@@ -531,8 +531,9 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `info`, `value`, `ty
 
 (@iCategoryId, 'sys_profile_bot', '_adm_stg_cpt_option_sys_profile_bot', '_adm_stg_inf_option_sys_profile_bot', '', 'select', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:23:"get_options_profile_bot";s:5:"class";s:13:"TemplServices";}', '', '', 40),
 
-(@iCategoryId, 'sys_hide_post_to_context_for_privacy', '_adm_stg_cpt_option_sys_hide_post_to_context_for_privacy', '', '', 'list', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:44:"get_options_module_list_for_privacy_selector";s:5:"class";s:13:"TemplServices";}', '', '', 50),
-(@iCategoryId, 'sys_treat_cxt_in_cxt_as_cnt', '_adm_stg_cpt_option_sys_treat_cxt_in_cxt_as_cnt', '', 'on', 'checkbox', '', '', '', 51),
+(@iCategoryId, 'sys_enable_post_to_context_for_privacy', '_adm_stg_cpt_option_sys_enable_post_to_context_for_privacy', '', '', 'checkbox', '', '', '', 50),
+(@iCategoryId, 'sys_hide_post_to_context_for_privacy', '_adm_stg_cpt_option_sys_hide_post_to_context_for_privacy', '', '', 'list', 'a:3:{s:6:"module";s:6:"system";s:6:"method";s:44:"get_options_module_list_for_privacy_selector";s:5:"class";s:13:"TemplServices";}', '', '', 51),
+(@iCategoryId, 'sys_treat_cxt_in_cxt_as_cnt', '_adm_stg_cpt_option_sys_treat_cxt_in_cxt_as_cnt', '', 'on', 'checkbox', '', '', '', 52),
 
 (@iCategoryId, 'sys_vote_reactions_quick_mode', '_adm_stg_cpt_option_sys_vote_reactions_quick_mode', '', 'on', 'checkbox', '', '', '', 60),
 
@@ -2405,20 +2406,21 @@ CREATE TABLE `sys_privacy_groups` (
   `check` text NOT NULL default '',
   `active` tinyint(4) NOT NULL default '1',
   `visible` tinyint(4) NOT NULL default '1',
+  `order` int(11) NOT NULL default '0',
   PRIMARY KEY  (`id`)
 );
 
-INSERT INTO `sys_privacy_groups`(`id`, `title`, `check`, `active`, `visible`) VALUES
-('1', '', '', 1, 0),
-('2', '_sys_ps_group_title_me_only', '@me_only', 1, 1),
-('3', '_sys_ps_group_title_public', '@public', 1, 1),
-('4', '_sys_ps_group_title_members', '@members', 0, 0),
-('5', '_sys_ps_group_title_friends', '@friends', 1, 1),
-('6', '_sys_ps_group_title_friends_selected', '@friends_selected_by_object', 1, 1),
-('7', '_sys_ps_group_title_relations', '@relations', 1, 1),
-('8', '_sys_ps_group_title_relations_selected', '@relations_selected_by_object', 1, 1),
-('9', '_sys_ps_group_title_memberships_selected', '@memberships_selected_by_object', 1, 1),
-('99', '_sys_ps_group_title_custom', '@custom_by_object', 0, 0);
+INSERT INTO `sys_privacy_groups`(`id`, `title`, `check`, `active`, `visible`, `order`) VALUES
+('1', '', '', 1, 0, 0),
+('2', '_sys_ps_group_title_me_only', '@me_only', 1, 1, 7),
+('3', '_sys_ps_group_title_public', '@public', 1, 1, 1),
+('4', '_sys_ps_group_title_members', '@members', 0, 0, 0),
+('5', '_sys_ps_group_title_friends', '@friends', 1, 1, 2),
+('6', '_sys_ps_group_title_friends_selected', '@friends_selected_by_object', 1, 1, 3),
+('7', '_sys_ps_group_title_relations', '@relations', 1, 1, 4),
+('8', '_sys_ps_group_title_relations_selected', '@relations_selected_by_object', 1, 1, 5),
+('9', '_sys_ps_group_title_memberships_selected', '@memberships_selected_by_object', 1, 1, 6),
+('99', '_sys_ps_group_title_custom', '@custom_by_object', 0, 0, 0);
 
 CREATE TABLE `sys_privacy_groups_custom` (
   `id` int(11) unsigned NOT NULL auto_increment,

+ 5 - 4
modules/boonex/english/data/langs/system/en.xml

@@ -1761,6 +1761,7 @@
     <string name="_adm_stg_cpt_option_sys_metatags_hashtags_max"><![CDATA[Max number of hashtags per post]]></string>
     <string name="_adm_stg_cpt_option_sys_metatags_mentions_max"><![CDATA[Max number of mentions per post]]></string>
     <string name="_adm_stg_cpt_option_sys_attach_links_max"><![CDATA[Max number of attached links per post (0 - no limit)]]></string>
+    <string name="_adm_stg_cpt_option_sys_enable_post_to_context_for_privacy"><![CDATA[Allow to post to context using Privacy field]]></string>
     <string name="_adm_stg_cpt_option_sys_hide_post_to_context_for_privacy"><![CDATA[Hide post to context for modules in Privacy field]]></string>
     <string name="_adm_stg_cpt_option_sys_treat_cxt_in_cxt_as_cnt"><![CDATA[Treat context posted in context as content]]></string>
     <string name="_adm_stg_cpt_option_sys_search_keyword_min_len"><![CDATA[Keyword min length in site search]]></string>
@@ -3793,14 +3794,14 @@ If it is not enabled then please consider implement this optimization, since it
             <li><b>{0}</b> total</li>
             <li><b>{1}</b> deleted</li>
         </ul>]]></string>
-    <string name="_sys_ps_group_title_memberships_selected"><![CDATA[Selected Membership Levels...]]></string>
+    <string name="_sys_ps_group_title_memberships_selected"><![CDATA[Specific membership levels...]]></string>
     <string name="_sys_ps_group_title_custom"><![CDATA[Custom]]></string>
     <string name="_sys_ps_group_title_followers"><![CDATA[Followers]]></string>
     <string name="_sys_ps_group_title_friends"><![CDATA[Friends]]></string>
-    <string name="_sys_ps_group_title_friends_selected"><![CDATA[Selected Friends...]]></string>
+    <string name="_sys_ps_group_title_friends_selected"><![CDATA[Specific friends...]]></string>
     <string name="_sys_ps_group_title_relations"><![CDATA[Relationships]]></string>
-    <string name="_sys_ps_group_title_relations_selected"><![CDATA[Selected Relationships...]]></string>
-    <string name="_sys_ps_group_title_me_only"><![CDATA[Me only]]></string>
+    <string name="_sys_ps_group_title_relations_selected"><![CDATA[Specific relationships...]]></string>
+    <string name="_sys_ps_group_title_me_only"><![CDATA[Only me]]></string>
     <string name="_sys_ps_group_title_members"><![CDATA[Members]]></string>
     <string name="_sys_ps_group_title_public"><![CDATA[Public]]></string>
     <string name="_sys_ps_group_title_participants"><![CDATA[Participants]]></string>

+ 5 - 4
modules/boonex/russian/data/langs/system/ru.xml

@@ -1737,6 +1737,7 @@
     <string name="_adm_stg_cpt_option_sys_metatags_hashtags_max"><![CDATA[Максимальное число хэш-тагов в одной публикации]]></string>
     <string name="_adm_stg_cpt_option_sys_metatags_mentions_max"><![CDATA[Максимальное число упоминаний кого-либо в одной публикации]]></string>
     <string name="_adm_stg_cpt_option_sys_attach_links_max"><![CDATA[Максимальное число присоединенных ссылок к одной публикации (0 - без ограничений)]]></string>
+    <string name="_adm_stg_cpt_option_sys_enable_post_to_context_for_privacy"><![CDATA[Включить возможность добавления контента в контекст, используя поле "Конфиденциальность"]]></string>
     <string name="_adm_stg_cpt_option_sys_hide_post_to_context_for_privacy"><![CDATA[Скрыть из поля "Конфиденциальность" возможность добавления контента в контекст модулей]]></string>
     <string name="_adm_stg_cpt_option_sys_treat_cxt_in_cxt_as_cnt"><![CDATA[Рассматривать контекст, размещенный в контексте, как контент]]></string>
     <string name="_adm_stg_cpt_option_sys_search_keyword_min_len"><![CDATA[Минимальная длина слова в поиске по сайту]]></string>
@@ -3663,7 +3664,7 @@
         <string name="_sys_pre_lists_content_filter_pg13"><![CDATA[PG-13]]></string>
         <string name="_sys_pre_lists_content_filter_r"><![CDATA[R]]></string>
         <string name="_sys_pre_lists_content_filter_x"><![CDATA[X]]></string>
-        <string name="_sys_pre_lists_relations"><![CDATA[Отношения]]></string>
+        <string name="_sys_pre_lists_relations"><![CDATA[Связи]]></string>
         <string name="_sys_pre_lists_relations_husband"><![CDATA[муж]]></string>
         <string name="_sys_pre_lists_relations_wife"><![CDATA[жена]]></string>
         <string name="_sys_pre_lists_relations_father"><![CDATA[отец]]></string>
@@ -3732,9 +3733,9 @@
     <string name="_sys_ps_group_title_custom"><![CDATA[Индивидуально]]></string>
     <string name="_sys_ps_group_title_followers"><![CDATA[Подписчики]]></string>
     <string name="_sys_ps_group_title_friends"><![CDATA[Друзья]]></string>
-    <string name="_sys_ps_group_title_friends_selected"><![CDATA[Избранные друзья...]]></string>
-    <string name="_sys_ps_group_title_relations"><![CDATA[Отношения]]></string>
-    <string name="_sys_ps_group_title_relations_selected"><![CDATA[Избранные отношения...]]></string>
+    <string name="_sys_ps_group_title_friends_selected"><![CDATA[Определенные друзья...]]></string>
+    <string name="_sys_ps_group_title_relations"><![CDATA[Связи]]></string>
+    <string name="_sys_ps_group_title_relations_selected"><![CDATA[Определенные связи...]]></string>
     <string name="_sys_ps_group_title_me_only"><![CDATA[Только я]]></string>
     <string name="_sys_ps_group_title_members"><![CDATA[Пользователи]]></string>
     <string name="_sys_ps_group_title_public"><![CDATA[Все]]></string>