Răsfoiți Sursa

Ticket #4844 - Reputation module.

AntonLV 1 an în urmă
părinte
comite
5748a960cd

+ 4 - 0
modules/boonex/reputation/install/langs/en.xml

@@ -28,7 +28,11 @@
     <string name="_bx_reputation_grid_column_title_alert_unit"><![CDATA[Section]]></string>
     <string name="_bx_reputation_grid_column_title_alert_action"><![CDATA[Action]]></string>
     <string name="_bx_reputation_grid_column_value_aa_added"><![CDATA[Add]]></string>
+    <string name="_bx_reputation_grid_column_value_aa_post_common"><![CDATA[Write post]]></string>
+    <string name="_bx_reputation_grid_column_value_aa_repost"><![CDATA[Do repost]]></string>
     <string name="_bx_reputation_grid_column_value_aa_deleted"><![CDATA[Remove]]></string>
+    <string name="_bx_reputation_grid_column_value_aa_delete"><![CDATA[Remove post]]></string>
+    <string name="_bx_reputation_grid_column_value_aa_delete_repost"><![CDATA[Remove repost]]></string>
     <string name="_bx_reputation_grid_column_value_aa_commentPost"><![CDATA[Post comment]]></string>
     <string name="_bx_reputation_grid_column_value_aa_commentRemoved"><![CDATA[Remove comment]]></string>
     <string name="_bx_reputation_grid_column_value_aa_doVote"><![CDATA[Do vote]]></string>

+ 21 - 25
modules/boonex/reputation/template/images/icons/std-icon.svg

@@ -1,25 +1,21 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 20.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:#00B356;}
-	.st1{fill:#FFFFFF;}
-</style>
-<title>contact</title>
-<desc>Created with Sketch.</desc>
-<g id="Page-1">
-	<g id="Artboard" transform="translate(-826.000000, -430.000000)">
-		<g id="contact" transform="translate(826.000000, 430.000000)">
-			<g id="Path">
-				<path id="path-1_1_" class="st0" d="M32,64c14,0,21.8,0,26.9-5.1S64,46,64,32s0-21.8-5.1-26.9S46,0,32,0S10.2,0,5.1,5.1
-					S0,18,0,32s0,21.8,5.1,26.9S18,64,32,64z"/>
-			</g>
-		</g>
-	</g>
-</g>
-<path class="st1" d="M15.3,22h33.4c0.7,0,1.3-0.6,1.3-1.3v-3.2c0-0.7-0.6-1.3-1.3-1.3H15.3c-0.7,0-1.3,0.6-1.3,1.3v3.2
-	C14,21.5,14.6,22,15.3,22z M15.3,34.9h33.4c0.7,0,1.3-0.6,1.3-1.3v-3.2c0-0.7-0.6-1.3-1.3-1.3H15.3c-0.7,0-1.3,0.6-1.3,1.3v3.2
-	C14,34.3,14.6,34.9,15.3,34.9z M15.3,47.8h33.4c0.7,0,1.3-0.6,1.3-1.3v-3.2c0-0.7-0.6-1.3-1.3-1.3H15.3c-0.7,0-1.3,0.6-1.3,1.3v3.2
-	C14,47.2,14.6,47.8,15.3,47.8z"/>
-</svg>
+<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="80" height="80" fill="url(#paint0_linear_2005_13008)"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M40.002 13C38.7763 13 37.5745 13.3431 36.5322 13.9913C35.4899 14.6395 34.6483 15.5671 34.1032 16.6702L29.9458 25.1089C29.3642 26.2894 28.2392 27.1083 26.9371 27.299L17.6446 28.6596C16.4315 28.8348 15.2906 29.3461 14.3509 30.1369C13.4066 30.9316 12.7033 31.9767 12.322 33.1536C11.9407 34.3305 11.8971 35.5912 12.1961 36.7919C12.494 37.9876 13.1196 39.0752 14.0012 39.9321L20.7159 46.4796C21.6579 47.3982 22.0879 48.7213 21.866 50.0182L20.2849 59.2565L20.2823 59.2713C20.0726 60.4846 20.2056 61.7325 20.6663 62.874C21.1288 64.02 21.9027 65.0121 22.8992 65.738C23.8957 66.4639 25.0748 66.8947 26.3025 66.9821C27.5267 67.0692 28.751 66.8116 29.8371 66.2378L29.8465 66.2329L38.1369 61.8659C39.3036 61.2513 40.6983 61.2513 41.865 61.8657L50.1636 66.2361C51.2481 66.8103 52.471 67.0694 53.6943 66.9841C54.9241 66.8984 56.1056 66.4682 57.104 65.7418C58.1025 65.0153 58.8779 64.0218 59.3409 62.8738C59.8014 61.7317 59.9341 60.4832 59.7237 59.2696L58.1388 50.0178C57.9166 48.7209 58.3465 47.3977 59.2884 46.479L66.0103 39.9225C66.8903 39.063 67.5134 37.9734 67.8081 36.7763C68.1029 35.5793 68.0573 34.3235 67.6767 33.1512C67.296 31.9789 66.5958 30.9375 65.656 30.1445C64.7183 29.3531 63.5793 28.8403 62.3675 28.663L62.3651 28.6627L62.3599 28.6619L53.0687 27.3C51.7671 27.1092 50.6425 26.2906 50.0609 25.1106L45.9009 16.6702C45.3558 15.5671 44.5142 14.6395 43.4718 13.9913C42.4296 13.3431 41.2278 13 40.002 13ZM40 56C47.732 56 54 49.732 54 42C54 34.268 47.732 28 40 28C32.268 28 26 34.268 26 42C26 49.732 32.268 56 40 56Z" fill="black" fill-opacity="0.2"/>
+<path d="M50 42C50 47.5228 45.5228 52 40 52C34.4772 52 30 47.5228 30 42C30 36.4772 34.4772 32 40 32C45.5228 32 50 36.4772 50 42Z" fill="black" fill-opacity="0.2"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M40.002 12C38.7763 12 37.5745 12.3431 36.5322 12.9913C35.4899 13.6395 34.6483 14.5671 34.1032 15.6702L29.9458 24.1089C29.3642 25.2894 28.2392 26.1083 26.9371 26.299L17.6446 27.6596C16.4315 27.8348 15.2906 28.3461 14.3509 29.1369C13.4066 29.9316 12.7033 30.9767 12.322 32.1536C11.9407 33.3305 11.8971 34.5912 12.1961 35.7919C12.494 36.9876 13.1196 38.0752 14.0012 38.9321L20.7159 45.4796C21.6579 46.3982 22.0879 47.7213 21.866 49.0182L20.2849 58.2565L20.2823 58.2713C20.0726 59.4846 20.2056 60.7325 20.6663 61.874C21.1288 63.02 21.9027 64.0121 22.8992 64.738C23.8957 65.4639 25.0748 65.8947 26.3025 65.9821C27.5267 66.0692 28.751 65.8116 29.8371 65.2378L29.8465 65.2329L38.1369 60.8659C39.3036 60.2513 40.6983 60.2513 41.865 60.8657L50.1636 65.2361C51.2481 65.8103 52.471 66.0694 53.6943 65.9841C54.9241 65.8984 56.1056 65.4682 57.104 64.7418C58.1025 64.0153 58.8779 63.0218 59.3409 61.8738C59.8014 60.7317 59.9341 59.4832 59.7237 58.2696L58.1388 49.0178C57.9166 47.7209 58.3465 46.3977 59.2884 45.479L66.0103 38.9225C66.8903 38.063 67.5134 36.9734 67.8081 35.7763C68.1029 34.5793 68.0573 33.3235 67.6767 32.1512C67.296 30.9789 66.5958 29.9375 65.656 29.1445C64.7183 28.3531 63.5793 27.8403 62.3675 27.663L62.3651 27.6627L62.3599 27.6619L53.0687 26.3C51.7671 26.1092 50.6425 25.2906 50.0609 24.1106L45.9009 15.6702C45.3558 14.5671 44.5142 13.6395 43.4718 12.9913C42.4296 12.3431 41.2278 12 40.002 12ZM40 55C47.732 55 54 48.732 54 41C54 33.268 47.732 27 40 27C32.268 27 26 33.268 26 41C26 48.732 32.268 55 40 55Z" fill="url(#paint1_linear_2005_13008)"/>
+<circle cx="40" cy="41" r="10" fill="url(#paint2_linear_2005_13008)"/>
+<defs>
+<linearGradient id="paint0_linear_2005_13008" x1="40" y1="0" x2="40" y2="80" gradientUnits="userSpaceOnUse">
+<stop stop-color="#6B7280"/>
+<stop offset="1" stop-color="#1F2937"/>
+</linearGradient>
+<linearGradient id="paint1_linear_2005_13008" x1="40" y1="12" x2="40" y2="66" gradientUnits="userSpaceOnUse">
+<stop stop-color="#F9FAFB"/>
+<stop offset="1" stop-color="#9CA3AF"/>
+</linearGradient>
+<linearGradient id="paint2_linear_2005_13008" x1="40" y1="31" x2="40" y2="51" gradientUnits="userSpaceOnUse">
+<stop stop-color="#FDE68A"/>
+<stop offset="1" stop-color="#D97706"/>
+</linearGradient>
+</defs>
+</svg>

+ 4 - 0
modules/boonex/russian/data/langs/bx_reputation/ru.xml

@@ -28,7 +28,11 @@
     <string name="_bx_reputation_grid_column_title_alert_unit"><![CDATA[Раздел]]></string>
     <string name="_bx_reputation_grid_column_title_alert_action"><![CDATA[Действие]]></string>
     <string name="_bx_reputation_grid_column_value_aa_added"><![CDATA[Добавить]]></string>
+    <string name="_bx_reputation_grid_column_value_aa_post_common"><![CDATA[Написать пост]]></string>
+    <string name="_bx_reputation_grid_column_value_aa_repost"><![CDATA[Сдулать репост]]></string>
     <string name="_bx_reputation_grid_column_value_aa_deleted"><![CDATA[Удалить]]></string>
+    <string name="_bx_reputation_grid_column_value_aa_delete"><![CDATA[Удалить пост]]></string>
+    <string name="_bx_reputation_grid_column_value_aa_delete_repost"><![CDATA[Удалить репост]]></string>
     <string name="_bx_reputation_grid_column_value_aa_commentPost"><![CDATA[Оставить комментарий]]></string>
     <string name="_bx_reputation_grid_column_value_aa_commentRemoved"><![CDATA[Удалить комментарий]]></string>
     <string name="_bx_reputation_grid_column_value_aa_doVote"><![CDATA[Проголосовать]]></string>

+ 51 - 0
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -2385,6 +2385,57 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         return isset($aEvent['content']['allowed_view']) ? $aEvent['content']['allowed_view'] : CHECK_ACTION_RESULT_ALLOWED;
     }
 
+    public function serviceGetReputationData()
+    {
+    	$sModule = $this->_aModule['name'];
+
+        return [
+            'handlers' => [
+                ['group' => $sModule . '_object', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'post_common', 'points_active' => 3, 'points_passive' => 0],
+                ['group' => $sModule . '_object', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'delete', 'points_active' => -3, 'points_passive' => 0],
+
+                ['group' => $sModule . '_repost', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'repost', 'points_active' => 1, 'points_passive' => 2],
+                ['group' => $sModule . '_repost', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'delete_repost', 'points_active' => -1, 'points_passive' => -2],
+
+                ['group' => $sModule . '_comment', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'commentPost', 'points_active' => 2, 'points_passive' => 1],
+                ['group' => $sModule . '_comment', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'commentRemoved', 'points_active' => -2, 'points_passive' => -1],
+
+                ['group' => $sModule . '_vote', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'doVote', 'points_active' => 1, 'points_passive' => 1],
+                ['group' => $sModule . '_vote', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'undoVote', 'points_active' => -1, 'points_passive' => -1],
+
+                ['group' => $sModule . '_reaction', 'type' => 'insert', 'alert_unit' => $sModule . '_reactions', 'alert_action' => 'doVote', 'points_active' => 1, 'points_passive' => 1],
+                ['group' => $sModule . '_reaction', 'type' => 'delete', 'alert_unit' => $sModule . '_reactions', 'alert_action' => 'undoVote', 'points_active' => -1, 'points_passive' => -1],
+
+                ['group' => $sModule . '_score_up', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'doVoteUp', 'points_active' => 1, 'points_passive' => 1],
+                ['group' => $sModule . '_score_up', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'undoVoteUp', 'points_active' => -1, 'points_passive' => -1],
+
+                ['group' => $sModule . '_score_down', 'type' => 'insert', 'alert_unit' => $sModule, 'alert_action' => 'doVoteDown', 'points_active' => 1, 'points_passive' => -1],
+                ['group' => $sModule . '_score_down', 'type' => 'delete', 'alert_unit' => $sModule, 'alert_action' => 'undoVoteDown', 'points_active' => -1, 'points_passive' => 1],
+            ],
+            'alerts' => [
+                ['unit' => $sModule, 'action' => 'post_common'],
+                ['unit' => $sModule, 'action' => 'delete'],
+
+                ['unit' => $sModule, 'action' => 'repost'],
+                ['unit' => $sModule, 'action' => 'delete_repost'],
+                
+                ['unit' => $sModule, 'action' => 'commentPost'],
+                ['unit' => $sModule, 'action' => 'commentRemoved'],
+
+                ['unit' => $sModule, 'action' => 'doVote'],
+                ['unit' => $sModule, 'action' => 'undoVote'],
+
+                ['unit' => $sModule . '_reactions', 'action' => 'doVote'],
+                ['unit' => $sModule . '_reactions', 'action' => 'undoVote'],
+
+                ['unit' => $sModule, 'action' => 'doVoteUp'],
+                ['unit' => $sModule, 'action' => 'undoVoteUp'],
+                ['unit' => $sModule, 'action' => 'doVoteDown'],
+                ['unit' => $sModule, 'action' => 'undoVoteDown'],
+            ]
+        ];
+    }
+
     /**
      * @page service Service Calls
      * @section bx_timeline Timeline

+ 4 - 3
modules/boonex/timeline/install/config.php

@@ -132,11 +132,12 @@ $aConfig = array(
     'relation_handlers' => array(
     	'on_install' => '',
     	'on_uninstall' => 'delete_module_events',
-	    'on_enable' => 'add_handlers',
-	    'on_disable' => 'delete_handlers',
+        'on_enable' => 'add_handlers',
+        'on_disable' => 'delete_handlers',
     ),
     'relations' => array(
-    	'bx_notifications'
+        'bx_notifications',
+    	'bx_reputation'
     )
 );