Przeglądaj źródła

Ticket #702 - Timeline: repost with text

AntonLV 4 lat temu
rodzic
commit
0dc6f6ca40

+ 22 - 14
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -100,20 +100,26 @@
     <string name="_bx_timeline_form_attach_link_input_do_submit"><![CDATA[Добавить]]></string>
     <string name="_bx_timeline_form_attach_link_input_do_submit"><![CDATA[Добавить]]></string>
     <string name="_bx_timeline_form_attach_link_input_do_cancel"><![CDATA[Закрыть]]></string>
     <string name="_bx_timeline_form_attach_link_input_do_cancel"><![CDATA[Закрыть]]></string>
 
 
-    <string name="_bx_timeline_form_repost_to"><![CDATA[Сделать репост в]]></string>
-    <string name="_bx_timeline_form_repost_to_display_browse"><![CDATA[Просмотреть, чтобы сделать репост в]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_reposter_id"><![CDATA[ID исполнителя]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_type"><![CDATA[Тип]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_action"><![CDATA[Действие]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_object_id"><![CDATA[ID объекта]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_search"><![CDATA[Поиск]]></string>
-    <string name="_bx_timeline_form_repost_to_input_search"><![CDATA[Найти]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_list"><![CDATA[Список]]></string>
-    <string name="_bx_timeline_form_repost_to_input_list"><![CDATA[или выбрать]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_do_submit"><![CDATA[Репост]]></string>
-    <string name="_bx_timeline_form_repost_to_input_do_submit"><![CDATA[Репост]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_do_cancel"><![CDATA[Отмена]]></string>
-    <string name="_bx_timeline_form_repost_to_input_do_cancel"><![CDATA[Отмена]]></string>
+    <string name="_bx_timeline_form_reposto"><![CDATA[Сделать репост]]></string>
+    <string name="_bx_timeline_form_repost_display_with"><![CDATA[Cделать репост с текстом]]></string>
+    <string name="_bx_timeline_form_repost_display_to"><![CDATA[Cделать репост в]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_reposter_id"><![CDATA[ID исполнителя]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_owner_id"><![CDATA[ID владельца]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_type"><![CDATA[Тип]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_action"><![CDATA[Действие]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_object_id"><![CDATA[ID объекта]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_search"><![CDATA[Поиск]]></string>
+    <string name="_bx_timeline_form_repost_input_search"><![CDATA[Найти]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_list"><![CDATA[Список]]></string>
+    <string name="_bx_timeline_form_repost_input_list"><![CDATA[или выбрать]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_text"><![CDATA[Текст]]></string>
+    <string name="_bx_timeline_form_repost_input_text"><![CDATA[]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_reposted"><![CDATA[Исходный контент]]></string>
+    <string name="_bx_timeline_form_repost_input_reposted"><![CDATA[]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_do_submit"><![CDATA[Репост]]></string>
+    <string name="_bx_timeline_form_repost_input_do_submit"><![CDATA[Репост]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_do_cancel"><![CDATA[Отмена]]></string>
+    <string name="_bx_timeline_form_repost_input_do_cancel"><![CDATA[Отмена]]></string>
 
 
     <string name="_bx_timeline_privacy_view"><![CDATA[Просматривать события]]></string>
     <string name="_bx_timeline_privacy_view"><![CDATA[Просматривать события]]></string>
 
 
@@ -211,6 +217,8 @@
     <string name="_bx_timeline_menu_set_title_item_share"><![CDATA[Поделиться]]></string>
     <string name="_bx_timeline_menu_set_title_item_share"><![CDATA[Поделиться]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_repost"><![CDATA[Сделать репост]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_repost"><![CDATA[Сделать репост]]></string>
     <string name="_bx_timeline_menu_item_title_item_repost"><![CDATA[Сделать репост]]></string>
     <string name="_bx_timeline_menu_item_title_item_repost"><![CDATA[Сделать репост]]></string>
+    <string name="_bx_timeline_menu_item_title_system_item_repost_with"><![CDATA[Сделать репост с текстом]]></string>
+    <string name="_bx_timeline_menu_item_title_item_repost_with"><![CDATA[Сделать репост с текстом]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_repost_to"><![CDATA[Сделать репост в контекст]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_repost_to"><![CDATA[Сделать репост в контекст]]></string>
     <string name="_bx_timeline_menu_item_title_item_repost_to"><![CDATA[Сделать репост в контекст]]></string>
     <string name="_bx_timeline_menu_item_title_item_repost_to"><![CDATA[Сделать репост в контекст]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_send"><![CDATA[Послать]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_send"><![CDATA[Послать]]></string>

+ 5 - 2
modules/boonex/timeline/classes/BxTimelineConfig.php

@@ -230,16 +230,18 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
             'menu_item_meta' => $this->_sName . '_menu_item_meta',
             'menu_item_meta' => $this->_sName . '_menu_item_meta',
             'menu_post_attachments' => $this->CNF['OBJECT_MENU_ENTRY_ATTACHMENTS'],
             'menu_post_attachments' => $this->CNF['OBJECT_MENU_ENTRY_ATTACHMENTS'],
 
 
+            //TODO: Continue from here.
             'form_post' => $this->_sName . '_post',
             'form_post' => $this->_sName . '_post',
             'form_attach_link' => $this->_sName . '_attach_link',
             'form_attach_link' => $this->_sName . '_attach_link',
-            'form_repost_to' => $this->_sName . '_repost_to',
+            'form_repost' => $this->_sName . '_repost',
             'form_display_post_add' => $this->_sName . '_post_add',
             'form_display_post_add' => $this->_sName . '_post_add',
             'form_display_post_add_public' => $this->_sName . '_post_add_public',
             'form_display_post_add_public' => $this->_sName . '_post_add_public',
             'form_display_post_add_profile' => $this->_sName . '_post_add_profile',
             'form_display_post_add_profile' => $this->_sName . '_post_add_profile',
             'form_display_post_edit' => $this->_sName . '_post_edit',
             'form_display_post_edit' => $this->_sName . '_post_edit',
             'form_display_post_view' => $this->_sName . '_post_view',
             'form_display_post_view' => $this->_sName . '_post_view',
             'form_display_attach_link_add' => $this->_sName . '_attach_link_add',
             'form_display_attach_link_add' => $this->_sName . '_attach_link_add',
-            'form_display_repost_to_browse' => $this->_sName . '_repost_to_browse',
+            'form_display_repost_with' => $this->_sName . '_repost_with',
+            'form_display_repost_to' => $this->_sName . '_repost_to',
 
 
             'grid_mute' => $this->CNF['OBJECT_GRID_MUTE'],
             'grid_mute' => $this->CNF['OBJECT_GRID_MUTE'],
 
 
@@ -309,6 +311,7 @@ class BxTimelineConfig extends BxBaseModNotificationsConfig
                 'main' => $sHp . '-repost-',
                 'main' => $sHp . '-repost-',
                 'counter' => $sHp . '-repost-counter-',
                 'counter' => $sHp . '-repost-counter-',
                 'by_popup' => $sHp . '-repost-by-',
                 'by_popup' => $sHp . '-repost-by-',
+                'with_popup' => $sHp . '-repost-with',
                 'to_popup' => $sHp . '-repost-to',
                 'to_popup' => $sHp . '-repost-to',
             )
             )
         );
         );

+ 25 - 2
modules/boonex/timeline/classes/BxTimelineFormRepostTo.php → modules/boonex/timeline/classes/BxTimelineFormRepost.php

@@ -9,11 +9,13 @@
  * @{
  * @{
  */
  */
 
 
-class BxTimelineFormRepostTo extends BxTemplFormView
+class BxTimelineFormRepost extends BxTemplFormView
 {
 {
     protected $_sModule;
     protected $_sModule;
     protected $_oModule;
     protected $_oModule;
 
 
+    protected $_aReposted;
+
     public function __construct($aInfo, $oTemplate = false)
     public function __construct($aInfo, $oTemplate = false)
     {
     {
         $this->_sModule = 'bx_timeline';
         $this->_sModule = 'bx_timeline';
@@ -21,7 +23,28 @@ class BxTimelineFormRepostTo extends BxTemplFormView
 
 
         parent::__construct($aInfo, $oTemplate);
         parent::__construct($aInfo, $oTemplate);
 
 
-        $this->aFormAttrs['action'] = BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . 'repost_to/';
+        $sAction = trim(str_replace($this->_sModule, '', $this->aParams['display']), "_");
+        $this->aFormAttrs['action'] = BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . $sAction . '/';
+
+        $this->_aReposted = [];
+    }
+
+    public function getReposted()
+    {
+        return $this->_aReposted;
+    }
+
+    public function initChecker($aValues = [], $aSpecificValues = [])
+    {
+        if(isset($aValues['type'], $aValues['action'], $aValues['object_id']))
+            $this->_aReposted = $this->_oModule->_oDb->getReposted($aValues['type'], $aValues['action'], $aValues['object_id']);
+
+        return parent::initChecker($aValues, $aSpecificValues);
+    }
+
+    protected function genCustomInputReposted($aInput)
+    {
+        return $this->_oModule->_oTemplate->getRepostWithFieldReposted($this, $aInput);
     }
     }
 
 
     protected function genCustomInputSearch($aInput)
     protected function genCustomInputSearch($aInput)

+ 2 - 0
modules/boonex/timeline/classes/BxTimelineMenuItemShare.php

@@ -60,6 +60,7 @@ class BxTimelineMenuItemShare extends BxTemplMenu
             $iOwnerId = $this->_oModule->getUserId(); //--- in whose timeline the content will be reposted
             $iOwnerId = $this->_oModule->getUserId(); //--- in whose timeline the content will be reposted
             $iObjectId = $this->_oModule->_oConfig->isSystem($sType, $sAction) ? $this->_aEvent['object_id'] : $this->_aEvent['id'];
             $iObjectId = $this->_oModule->_oConfig->isSystem($sType, $sAction) ? $this->_aEvent['object_id'] : $this->_aEvent['id'];
             $sRepostOnclick = $this->_oModule->serviceGetRepostJsClick($iOwnerId, $sType, $sAction, $iObjectId);
             $sRepostOnclick = $this->_oModule->serviceGetRepostJsClick($iOwnerId, $sType, $sAction, $iObjectId);
+            $sRepostWithOnclick = $this->_oModule->serviceGetRepostWithJsClick($iOwnerId, $sType, $sAction, $iObjectId);
             $sRepostToOnclick = $this->_oModule->serviceGetRepostToJsClick($iOwnerId, $sType, $sAction, $iObjectId);
             $sRepostToOnclick = $this->_oModule->serviceGetRepostToJsClick($iOwnerId, $sType, $sAction, $iObjectId);
 
 
             //--- Send item
             //--- Send item
@@ -76,6 +77,7 @@ class BxTimelineMenuItemShare extends BxTemplMenu
             'content_url' => $this->_aEvent['url'],
             'content_url' => $this->_aEvent['url'],
 
 
             'repost_onclick' => $sRepostOnclick,
             'repost_onclick' => $sRepostOnclick,
+            'repost_with_onclick' => $sRepostWithOnclick,
             'repost_to_onclick' => $sRepostToOnclick,
             'repost_to_onclick' => $sRepostToOnclick,
             'et_send' => $sAetSend
             'et_send' => $sAetSend
     	));
     	));

+ 149 - 40
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -331,7 +331,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         $sAction = bx_process_input(bx_get('action'), BX_DATA_TEXT);
         $sAction = bx_process_input(bx_get('action'), BX_DATA_TEXT);
         $iObjectId = bx_process_input(bx_get('object_id'), BX_DATA_INT);
         $iObjectId = bx_process_input(bx_get('object_id'), BX_DATA_INT);
 
 
-        $aResult = $this->serviceRepost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId);
+        $aResult = $this->repost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId);
         if(!empty($aResult) && is_array($aResult))
         if(!empty($aResult) && is_array($aResult))
             return echoJson($aResult);
             return echoJson($aResult);
 
 
@@ -348,6 +348,51 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         ));
         ));
     }
     }
 
 
+    public function actionRepostWith()
+    {
+        if(($iReposterId = bx_get('reposter_id')) !== false)
+            $iReposterId = bx_process_input($iReposterId, BX_DATA_INT);
+        if(!$iReposterId)
+            $iReposterId = $this->getUserId();
+
+        $iOwnerId = bx_process_input(bx_get('owner_id'), BX_DATA_INT);
+        $sType = bx_process_input(bx_get('type'), BX_DATA_TEXT);
+        $sAction = bx_process_input(bx_get('action'), BX_DATA_TEXT);
+        $iObjectId = bx_process_input(bx_get('object_id'), BX_DATA_INT);
+
+        $oForm = BxDolForm::getObjectInstance($this->_oConfig->getObject('form_repost'), $this->_oConfig->getObject('form_display_repost_with'));
+        $oForm->initChecker(array(
+            'reposter_id' => $iReposterId,
+            'owner_id' => $iOwnerId,
+            'type' => $sType,
+            'action' => $sAction, 
+            'object_id' => $iObjectId
+        ));
+
+        if($oForm->isSubmitted()) {
+            if(!$oForm->isValid())
+                return echoJson(array('popup' => array(
+                    'html' => BxTemplFunctions::getInstance()->transBox($this->_oConfig->getHtmlIds('repost', 'with_popup'), $this->_oTemplate->getRepostWith($oForm)), 
+                    'options' => array('closeOnOuterClick' => false, 'removeOnClose' => true)
+                )));
+
+            $this->repost($iReposterId, $iOwnerId, $sType, $sAction, $iObjectId, ['text' => $oForm->getCleanValue('text')]);
+
+            $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
+            $sCounter = $this->_oTemplate->getRepostCounter($aReposted);
+
+            return echoJson(array(
+                'code' => 0, 
+                'message' => _t('_bx_timeline_txt_msg_success_repost'), 
+                'count' => $aReposted['reposts'], 
+                'countf' => (int)$aReposted['reposts'] > 0 ? $this->_oTemplate->getRepostCounterLabel($aReposted['reposts']) : '',
+                'counter' => $sCounter,
+            ));
+        }
+
+        echo $this->_oTemplate->getRepostTo($oForm);
+    }
+
     public function actionRepostTo()
     public function actionRepostTo()
     {
     {
         $iReposterId = bx_process_input(bx_get('reposter_id'), BX_DATA_INT);
         $iReposterId = bx_process_input(bx_get('reposter_id'), BX_DATA_INT);
@@ -358,7 +403,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
         $sAction = bx_process_input(bx_get('action'), BX_DATA_TEXT);
         $sAction = bx_process_input(bx_get('action'), BX_DATA_TEXT);
         $iObjectId = bx_process_input(bx_get('object_id'), BX_DATA_INT);
         $iObjectId = bx_process_input(bx_get('object_id'), BX_DATA_INT);
 
 
-        $oForm = BxDolForm::getObjectInstance($this->_oConfig->getObject('form_repost_to'), $this->_oConfig->getObject('form_display_repost_to_browse'));
+        $oForm = BxDolForm::getObjectInstance($this->_oConfig->getObject('form_repost'), $this->_oConfig->getObject('form_display_repost_to'));
         $oForm->initChecker(array(
         $oForm->initChecker(array(
             'reposter_id' => $iReposterId,
             'reposter_id' => $iReposterId,
             'type' => $sType,
             'type' => $sType,
@@ -385,7 +430,7 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
                 return echoJson(array());
                 return echoJson(array());
 
 
             foreach($aContexts as $iContextId)
             foreach($aContexts as $iContextId)
-                $this->serviceRepost($iReposterId, $iContextId, $sType, $sAction, $iObjectId);
+                $this->repost($iReposterId, $iContextId, $sType, $sAction, $iObjectId);
 
 
             $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
             $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
             $sCounter = $this->_oTemplate->getRepostCounter($aReposted);
             $sCounter = $this->_oTemplate->getRepostCounter($aReposted);
@@ -2505,7 +2550,36 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
 
 
         return $this->_oTemplate->getRepostJsClick($iOwnerId, $sType, $sAction, $iObjectId);
         return $this->_oTemplate->getRepostJsClick($iOwnerId, $sType, $sAction, $iObjectId);
     }
     }
-    
+
+    /**
+     * @page service Service Calls
+     * @section bx_timeline Timeline
+     * @subsection bx_timeline-repost Repost
+     * @subsubsection bx_timeline-get_repost_with_js_click get_repost_with_js_click
+     * 
+     * @code bx_srv('bx_timeline', 'get_repost_with_js_click', [...]); @endcode
+     * 
+     * Get 'repost with' JavaScript code for OnClick event.
+     * 
+     * @param $iReposterId integer value with reposter profile ID.
+     * @param $sType string value with type (module name). 
+     * @param $sAction string value with action (module action). 
+     * @param $iObjectId integer value with object ID to be reposted. 
+     * @return HTML string with JavaScript code to display in OnClick events of HTML elements.
+     * 
+     * @see BxTimelineModule::serviceGetRepostWithJsClick
+     */
+    /** 
+     * @ref bx_timeline-get_repost_with_js_click "get_repost_with_js_click"
+     */
+    public function serviceGetRepostWithJsClick($iReposterId, $sType, $sAction, $iObjectId)
+    {
+    	if(!$this->isEnabled())
+            return '';
+
+        return $this->_oTemplate->getRepostWithJsClick($iReposterId, $sType, $sAction, $iObjectId);
+    }
+
     /**
     /**
      * @page service Service Calls
      * @page service Service Calls
      * @section bx_timeline Timeline
      * @section bx_timeline Timeline
@@ -2560,41 +2634,36 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
      */
      */
     public function serviceRepost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId, $bForce = false)
     public function serviceRepost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId, $bForce = false)
     {
     {
-        $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
-        if(empty($aReposted) || !is_array($aReposted))
-            return array('code' => 1, 'message' => _t('_bx_timeline_txt_err_cannot_repost'));
-
-        $mixedAllowed = $this->isAllowedRepost($aReposted, true);
-        if(!$bForce && $mixedAllowed !== true)
-            return array('code' => 2, 'message' => strip_tags($mixedAllowed));
-
-        $bReposted = $this->_oDb->isReposted($aReposted['id'], $iOwnerId, $iAuthorId);
-        if($bReposted)
-            return array('code' => 3, 'message' => _t('_bx_timeline_txt_err_already_reposted'));
-
-        $iId = $this->_oDb->insertEvent(array(
-            'owner_id' => $iOwnerId,
-            'system' => 0,
-            'type' => $this->_oConfig->getPrefix('common_post') . 'repost',
-            'action' => '',
-            'object_id' => $iAuthorId,
-            'object_owner_id' => $iAuthorId,
-            'object_privacy_view' => $this->_oConfig->getPrivacyViewDefault('object'),
-            'content' => serialize(array(
-                'type' => $sType,
-                'action' => $sAction,
-                'object_id' => $iObjectId,
-            )),
-            'title' => '',
-            'description' => ''
-        ));
-
-        if(empty($iId))
-            return array('code' => 4, 'message' => _t('_bx_timeline_txt_err_cannot_repost'));
-
-        $this->onRepost($iId, $aReposted);
-
-        return $iId;
+        return $this->repost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId, false, $bForce);
+    }
+    
+    /**
+     * @page service Service Calls
+     * @section bx_timeline Timeline
+     * @subsection bx_timeline-repost Repost
+     * @subsubsection bx_timeline-repost_with repost_with
+     * 
+     * @code bx_srv('bx_timeline', 'repost_with', [...]); @endcode
+     * 
+     * Perform repost action passing additional data.
+     * 
+     * @param $iAuthorId integer value with performer profile ID.
+     * @param $iOwnerId integer value with repost event owner profile ID.
+     * @param $sType string value with type (module name). 
+     * @param $sAction string value with action (module action). 
+     * @param $iObjectId integer value with object ID to be reposted. 
+     * @param $mixedData array with some data to attach to repost event or false. 
+     * @parem $bForce boolean value force reposting without ACL check.
+     * @return an array with error (code and message) or integer with newly created repost event ID.
+     * 
+     * @see BxTimelineModule::serviceRepostWith
+     */
+    /** 
+     * @ref bx_timeline-repost_with "repost_with"
+     */
+    public function serviceRepostWith($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId, $mixedData = false, $bForce = false)
+    {
+        return $this->repost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId, $mixedData, $bForce);
     }
     }
 
 
     /**
     /**
@@ -2641,9 +2710,49 @@ class BxTimelineModule extends BxBaseModNotificationsModule implements iBxDolCon
             $iObjectId = $aRepostedData['object_id'];
             $iObjectId = $aRepostedData['object_id'];
         }
         }
 
 
-        return $this->serviceRepost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId, $bForce);
+        return $this->repost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId, false, $bForce);
     }
     }
 
 
+    public function repost($iAuthorId, $iOwnerId, $sType, $sAction, $iObjectId, $mixedData = false, $bForce = false)
+    {
+        $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
+        if(empty($aReposted) || !is_array($aReposted))
+            return array('code' => 1, 'message' => _t('_bx_timeline_txt_err_cannot_repost'));
+
+        $mixedAllowed = $this->isAllowedRepost($aReposted, true);
+        if(!$bForce && $mixedAllowed !== true)
+            return array('code' => 2, 'message' => strip_tags($mixedAllowed));
+
+        $bReposted = $this->_oDb->isReposted($aReposted['id'], $iOwnerId, $iAuthorId);
+        if($bReposted)
+            return array('code' => 3, 'message' => _t('_bx_timeline_txt_err_already_reposted'));
+
+        $iId = $this->_oDb->insertEvent(array(
+            'owner_id' => $iOwnerId,
+            'system' => 0,
+            'type' => $this->_oConfig->getPrefix('common_post') . 'repost',
+            'action' => '',
+            'object_id' => $iAuthorId,
+            'object_owner_id' => $iAuthorId,
+            'object_privacy_view' => $this->_oConfig->getPrivacyViewDefault('object'),
+            'content' => serialize(array(
+                'type' => $sType,
+                'action' => $sAction,
+                'object_id' => $iObjectId,
+                'rdata' => $mixedData
+            )),
+            'title' => '',
+            'description' => ''
+        ));
+
+        if(empty($iId))
+            return array('code' => 4, 'message' => _t('_bx_timeline_txt_err_cannot_repost'));
+
+        $this->onRepost($iId, $aReposted);
+
+        return $iId;
+    }
+    
     /**
     /**
      * @page service Service Calls
      * @page service Service Calls
      * @section bx_timeline Timeline
      * @section bx_timeline Timeline

+ 150 - 64
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -631,6 +631,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if(isset($aResult['sample_action_custom']))
         if(isset($aResult['sample_action_custom']))
             $aEvent['sample_action_custom'] = $aResult['sample_action_custom'];
             $aEvent['sample_action_custom'] = $aResult['sample_action_custom'];
         $aEvent['content'] = $aResult['content'];
         $aEvent['content'] = $aResult['content'];
+        $aEvent['content_type'] = !empty($aResult['content_type']) ? $aResult['content_type'] : BX_TIMELINE_PARSE_TYPE_DEFAULT;
         $aEvent['views'] = $aResult['views'];
         $aEvent['views'] = $aResult['views'];
         $aEvent['votes'] = $aResult['votes'];
         $aEvent['votes'] = $aResult['votes'];
         $aEvent['reactions'] = $aResult['reactions'];
         $aEvent['reactions'] = $aResult['reactions'];
@@ -643,8 +644,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if(isset($aEvent[$sKey]) && $aEvent[$sKey] !== CHECK_ACTION_RESULT_ALLOWED) 
         if(isset($aEvent[$sKey]) && $aEvent[$sKey] !== CHECK_ACTION_RESULT_ALLOWED) 
             return '';
             return '';
 
 
-        $sType = !empty($aResult['content_type']) ? $aResult['content_type'] : BX_TIMELINE_PARSE_TYPE_DEFAULT;
-        self::$_aMemoryCacheItems[$sMemoryCacheItemsKey] = $this->_getPost($sType, $aEvent, $aBrowseParams);
+        self::$_aMemoryCacheItems[$sMemoryCacheItemsKey] = $this->_getPost($aEvent['content_type'], $aEvent, $aBrowseParams);
         self::$_aMemoryCacheItemsData[$sMemoryCacheItemsKey] = $aEvent;
         self::$_aMemoryCacheItemsData[$sMemoryCacheItemsKey] = $aEvent;
 
 
         return self::$_aMemoryCacheItems[$sMemoryCacheItemsKey];
         return self::$_aMemoryCacheItems[$sMemoryCacheItemsKey];
@@ -1125,6 +1125,39 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         ));
         ));
     }
     }
 
 
+    public function getRepostWith($oForm)
+    {
+        $sStylePrefix = $this->_oConfig->getPrefix('style');
+        $sJsObject = $this->_oConfig->getJsObject('repost');
+
+        return $this->parseHtmlByName('repost_with_popup.html', array(
+            'style_prefix' => $sStylePrefix,
+            'js_object' => $sJsObject,
+            'form' => $oForm->getCode(),
+            'form_id' => $oForm->getId()
+        ));
+    }
+
+    public function getRepostWithFieldReposted($oForm, $aInput)
+    {
+        $sStylePrefix = $this->_oConfig->getPrefix('style');
+        $aBrowseParams = $this->getModule()->getParams();
+
+        $aReposted = $oForm->getReposted();
+        $sReposted = $this->getPost($aReposted, $aBrowseParams);
+
+        $sContent = '';
+        if(!empty($sReposted))
+            $sContent = $this->_getContent($aReposted['content_type'], $aReposted, $aBrowseParams);
+        else
+            $sContent = MsgBox(_t('_Empty'));
+
+        return $this->parseHtmlByName('repost_with_reposted.html', array(
+            'style_prefix' => $sStylePrefix,
+            'content' => $sContent
+        ));
+    }
+
     public function getRepostTo($oForm)
     public function getRepostTo($oForm)
     {
     {
         $sStylePrefix = $this->_oConfig->getPrefix('style');
         $sStylePrefix = $this->_oConfig->getPrefix('style');
@@ -1230,6 +1263,25 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         return $sResult;
         return $sResult;
     }
     }
 
 
+    public function getRepostWithJsClick($iReposterId, $sType, $sAction, $iObjectId)
+    {
+        $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
+        if(empty($aReposted) || !is_array($aReposted))
+            return '';
+
+        $sResult = '';
+        $sCommonPrefix = $this->_oConfig->getPrefix('common_post');
+        if(str_replace($sCommonPrefix, '', $sType) == BX_TIMELINE_PARSE_TYPE_REPOST) {
+            $aRepostedData = unserialize($aReposted['content']);
+
+            $sResult = $this->_getRepostWithJsClick($iReposterId, $aRepostedData['type'], $aRepostedData['action'], $aRepostedData['object_id']);
+        }
+        else
+            $sResult = $this->_getRepostWithJsClick($iReposterId, $sType, $sAction, $iObjectId);
+
+        return $sResult;
+    }
+
     public function getRepostToJsClick($iReposterId, $sType, $sAction, $iObjectId)
     public function getRepostToJsClick($iReposterId, $sType, $sAction, $iObjectId)
     {
     {
         $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
         $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
@@ -1768,11 +1820,22 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if(!method_exists($this, $sMethod))
         if(!method_exists($this, $sMethod))
             return '';
             return '';
 
 
+        $aTmplVars = $this->$sMethod($aEvent, $aBrowseParams);
+
         $sVariable = '_sTmplContentType' . bx_gen_method_name($sType);
         $sVariable = '_sTmplContentType' . bx_gen_method_name($sType);
         if(empty(self::$$sVariable))
         if(empty(self::$$sVariable))
             self::$$sVariable = $this->getHtml('type_' . $sType . '.html');
             self::$$sVariable = $this->getHtml('type_' . $sType . '.html');
 
 
-		return $this->parseHtmlByContent(self::$$sVariable, $this->$sMethod($aEvent, $aBrowseParams));
+        $sTmplCode = self::$$sVariable;
+        bx_alert($this->_oConfig->getName(), 'get_post_content', 0, 0, array(
+            'type' => $sType,
+            'event' => $aEvent,
+            'browse_params' => $aBrowseParams,
+            'tmpl_code' => &$sTmplCode,
+            'tmpl_vars' => &$aTmplVars
+        ));
+
+        return $this->parseHtmlByContent($sTmplCode, $aTmplVars);
     }
     }
 
 
     protected function _getComments($aComments, $aBrowseParams = array())
     protected function _getComments($aComments, $aBrowseParams = array())
@@ -1812,6 +1875,15 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         return sprintf($sFormat, $sJsObject, $iOwnerId, $sType, $sAction, (int)$iObjectId);
         return sprintf($sFormat, $sJsObject, $iOwnerId, $sType, $sAction, (int)$iObjectId);
     }
     }
 
 
+    protected function _getRepostWithJsClick($iReposterId, $sType, $sAction, $iObjectId)
+    {
+        $sJsObject = $this->_oConfig->getJsObject('repost');
+        $sFormat = "%s.repostItemWith(this, %d, '%s', '%s', %d);";
+
+        $iReposterId = !empty($iReposterId) ? (int)$iReposterId : $this->getModule()->getUserId();
+        return sprintf($sFormat, $sJsObject, $iReposterId, $sType, $sAction, (int)$iObjectId);
+    }
+
     protected function _getRepostToJsClick($iReposterId, $sType, $sAction, $iObjectId)
     protected function _getRepostToJsClick($iReposterId, $sType, $sAction, $iObjectId)
     {
     {
         $sJsObject = $this->_oConfig->getJsObject('repost');
         $sJsObject = $this->_oConfig->getJsObject('repost');
@@ -2077,7 +2149,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         //--- Process Links ---//
         //--- Process Links ---//
         $bAddNofollow = $this->_oDb->getParam('sys_add_nofollow') == 'on';
         $bAddNofollow = $this->_oDb->getParam('sys_add_nofollow') == 'on';
 
 
-        $aTmplVarsLinks = array();
+        $aTmplVarsLinks = [];
         if(!empty($aContent['links']))
         if(!empty($aContent['links']))
             foreach($aContent['links'] as $aLink) {
             foreach($aContent['links'] as $aLink) {
                 $sLink = '';
                 $sLink = '';
@@ -2105,32 +2177,32 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                         $sLinkAttrs .= ' ' . $sKey . '="' . bx_html_attribute($sValue) . '"';
                         $sLinkAttrs .= ' ' . $sKey . '="' . bx_html_attribute($sValue) . '"';
 
 
                     $sLink = $this->parseHtmlByName('link_embed_common.html', array(
                     $sLink = $this->parseHtmlByName('link_embed_common.html', array(
-                        'bx_if:show_thumbnail' => array(
+                        'bx_if:show_thumbnail' => [
                             'condition' => !empty($aLink['thumbnail']),
                             'condition' => !empty($aLink['thumbnail']),
-                            'content' => array(
+                            'content' => [
                                 'style_prefix' => $sStylePrefix,
                                 'style_prefix' => $sStylePrefix,
                                 'thumbnail' => $aLink['thumbnail'],
                                 'thumbnail' => $aLink['thumbnail'],
                                 'link' => !empty($aLink['url']) ? $aLink['url'] : 'javascript:void(0)',
                                 'link' => !empty($aLink['url']) ? $aLink['url'] : 'javascript:void(0)',
                                 'attrs' => $sLinkAttrs
                                 'attrs' => $sLinkAttrs
-                            )
-                        ),
+                            ]
+                        ],
                         'link' => !empty($aLink['url']) ? $aLink['url'] : 'javascript:void(0)',
                         'link' => !empty($aLink['url']) ? $aLink['url'] : 'javascript:void(0)',
                         'attrs' => $sLinkAttrs,
                         'attrs' => $sLinkAttrs,
                         'content' => $aLink['title'],
                         'content' => $aLink['title'],
-                        'bx_if:show_text' => array(
+                        'bx_if:show_text' => [
                             'condition' => !empty($aLink['text']),
                             'condition' => !empty($aLink['text']),
-                            'content' => array(
+                            'content' => [
                                 'style_prefix' => $sStylePrefix,
                                 'style_prefix' => $sStylePrefix,
                                 'text' => $aLink['text']
                                 'text' => $aLink['text']
-                            )
-                        )
+                            ]
+                        ]
                     ));
                     ));
                 }
                 }
 
 
-                $aTmplVarsLinks[] = array(
+                $aTmplVarsLinks[] = [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'link' => $sLink
                     'link' => $sLink
-                );
+                ];
             }
             }
 
 
         /*
         /*
@@ -2156,7 +2228,7 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         }
         }
         $bImagesAttach = !empty($aContent['images_attach']) && is_array($aContent['images_attach']);
         $bImagesAttach = !empty($aContent['images_attach']) && is_array($aContent['images_attach']);
         if($bImagesAttach) {
         if($bImagesAttach) {
-            $aImagesAttach = $this->_getTmplVarsImages($aContent['images_attach'], array('layout' => $sAttachmentsLayout, 'first' => empty($aTmplVarsAttachments)), $aEvent, $aBrowseParams);
+            $aImagesAttach = $this->_getTmplVarsImages($aContent['images_attach'], ['layout' => $sAttachmentsLayout, 'first' => empty($aTmplVarsAttachments)], $aEvent, $aBrowseParams);
             if(!empty($aImagesAttach)) {
             if(!empty($aImagesAttach)) {
                 $iAttachmentsTotal += $aImagesAttach['total'];
                 $iAttachmentsTotal += $aImagesAttach['total'];
                 $aTmplVarsAttachments = array_merge($aTmplVarsAttachments, $aImagesAttach['items']);
                 $aTmplVarsAttachments = array_merge($aTmplVarsAttachments, $aImagesAttach['items']);
@@ -2180,16 +2252,16 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if($bVideos) {
         if($bVideos) {
             $aVideos = $this->_getTmplVarsVideos($aContent['videos'], true, $aEvent, $aBrowseParams);
             $aVideos = $this->_getTmplVarsVideos($aContent['videos'], true, $aEvent, $aBrowseParams);
             if(!empty($aVideos))
             if(!empty($aVideos))
-                $aTmplVarsVideos = array(
+                $aTmplVarsVideos = [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'display' => $aVideos['display'],
                     'display' => $aVideos['display'],
                     'bx_repeat:items' => $aVideos['items']
                     'bx_repeat:items' => $aVideos['items']
-                );
+                ];
         }
         }
 
 
         $bVideosAttach = !empty($aContent['videos_attach']) && is_array($aContent['videos_attach']);
         $bVideosAttach = !empty($aContent['videos_attach']) && is_array($aContent['videos_attach']);
         if($bVideosAttach) {
         if($bVideosAttach) {
-            $aVideosAttach = $this->_getTmplVarsVideos($aContent['videos_attach'], array('layout' => $sAttachmentsLayout, 'first' => empty($aTmplVarsAttachments)), $aEvent, $aBrowseParams);
+            $aVideosAttach = $this->_getTmplVarsVideos($aContent['videos_attach'], ['layout' => $sAttachmentsLayout, 'first' => empty($aTmplVarsAttachments)], $aEvent, $aBrowseParams);
             if(!empty($aVideosAttach)) {
             if(!empty($aVideosAttach)) {
                 $iAttachmentsTotal += $aVideosAttach['total'];
                 $iAttachmentsTotal += $aVideosAttach['total'];
                 $aTmplVarsAttachments = array_merge($aTmplVarsAttachments, $aVideosAttach['items']);
                 $aTmplVarsAttachments = array_merge($aTmplVarsAttachments, $aVideosAttach['items']);
@@ -2201,23 +2273,23 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         if($bFiles) {
         if($bFiles) {
             $aFiles = $this->_getTmplVarsFiles($aContent['files'], $aEvent, $aBrowseParams);
             $aFiles = $this->_getTmplVarsFiles($aContent['files'], $aEvent, $aBrowseParams);
             if(!empty($aFiles))
             if(!empty($aFiles))
-                $aTmplVarsFiles = array(
+                $aTmplVarsFiles = [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'display' => $aFiles['display'],
                     'display' => $aFiles['display'],
                     'bx_repeat:items' => $aFiles['items']
                     'bx_repeat:items' => $aFiles['items']
-                );
+                ];
         }
         }
 
 
         $bFilesAttach = !empty($aContent['files_attach']) && is_array($aContent['files_attach']);
         $bFilesAttach = !empty($aContent['files_attach']) && is_array($aContent['files_attach']);
         if($bFilesAttach) {
         if($bFilesAttach) {
             $aFilesAttach = $this->_getTmplVarsFiles($aContent['files_attach'], $aEvent, $aBrowseParams);
             $aFilesAttach = $this->_getTmplVarsFiles($aContent['files_attach'], $aEvent, $aBrowseParams);
             if(!empty($aFilesAttach)) {
             if(!empty($aFilesAttach)) {
-                $aTmplVarsAttachmentsFiles = array(
+                $aTmplVarsAttachmentsFiles = [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'display' => BX_TIMELINE_ML_GALLERY,
                     'display' => BX_TIMELINE_ML_GALLERY,
                     'count' => count($aFilesAttach['items']),
                     'count' => count($aFilesAttach['items']),
                     'bx_repeat:items' => $aFilesAttach['items']
                     'bx_repeat:items' => $aFilesAttach['items']
-                );
+                ];
             }
             }
         }
         }
 
 
@@ -2233,76 +2305,76 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                 $aTmplVarsAttachments = array_slice($aTmplVarsAttachments, 0, $iAttachmentsShow);
                 $aTmplVarsAttachments = array_slice($aTmplVarsAttachments, 0, $iAttachmentsShow);
 
 
             if($iAttachmentsTotal > $iAttachmentsShow)
             if($iAttachmentsTotal > $iAttachmentsShow)
-                $aTmplVarsAttachments[$iAttachmentsShow - 1]['item'] .= $this->parseHtmlByName('attach_more.html', array(
+                $aTmplVarsAttachments[$iAttachmentsShow - 1]['item'] .= $this->parseHtmlByName('attach_more.html', [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'link' => $this->_oConfig->getItemViewUrl($aEvent),
                     'link' => $this->_oConfig->getItemViewUrl($aEvent),
                     'more' => $iAttachmentsTotal - $iAttachmentsShow
                     'more' => $iAttachmentsTotal - $iAttachmentsShow
-                ));
+                ]);
         }
         }
 
 
-        return array(
+        return [
             'style_prefix' => $sStylePrefix,
             'style_prefix' => $sStylePrefix,
-            'bx_if:show_title' => array(
+            'bx_if:show_title' => [
                 'condition' => !empty($sTitle),
                 'condition' => !empty($sTitle),
-                'content' => array(
+                'content' => [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'title' => $sTitle,
                     'title' => $sTitle,
-                )
-            ),
-            'bx_if:show_content' => array(
+                ]
+            ],
+            'bx_if:show_content' => [
                 'condition' => !empty($sText),
                 'condition' => !empty($sText),
-                'content' => array(
+                'content' => [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'item_content' => $sText
                     'item_content' => $sText
-                )
-            ),
-            'bx_if:show_top_raw' => array(
+                ]
+            ],
+            'bx_if:show_top_raw' => [
                 'condition' => !empty($sTopRaw),
                 'condition' => !empty($sTopRaw),
-                'content' => array(
+                'content' => [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'item_content_top_raw' => $sTopRaw
                     'item_content_top_raw' => $sTopRaw
-                )
-            ),
-            'bx_if:show_raw' => array(
+                ]
+            ],
+            'bx_if:show_raw' => [
                 'condition' => !empty($sRaw),
                 'condition' => !empty($sRaw),
-                'content' => array(
+                'content' => [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'item_content_raw' => $sRaw
                     'item_content_raw' => $sRaw
-                )
-            ),
-            'bx_if:show_links' => array(
+                ]
+            ],
+            'bx_if:show_links' => [
                 'condition' => !empty($aTmplVarsLinks),
                 'condition' => !empty($aTmplVarsLinks),
-                'content' => array(
+                'content' => [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'bx_repeat:links' => $aTmplVarsLinks
                     'bx_repeat:links' => $aTmplVarsLinks
-                )
-            ),
-            'bx_if:show_images' => array(
+                ]
+            ],
+            'bx_if:show_images' => [
                 'condition' => !empty($aTmplVarsImages),
                 'condition' => !empty($aTmplVarsImages),
                 'content' => $aTmplVarsImages
                 'content' => $aTmplVarsImages
-            ),
-            'bx_if:show_videos' => array(
+            ],
+            'bx_if:show_videos' => [
                 'condition' => !empty($aTmplVarsVideos),
                 'condition' => !empty($aTmplVarsVideos),
                 'content' => $aTmplVarsVideos
                 'content' => $aTmplVarsVideos
-            ),
-            'bx_if:show_files' => array(
+            ],
+            'bx_if:show_files' => [
                 'condition' => !empty($aTmplVarsFiles),
                 'condition' => !empty($aTmplVarsFiles),
                 'content' => $aTmplVarsFiles
                 'content' => $aTmplVarsFiles
-            ),
-            'bx_if:show_attachments' => array(
+            ],
+            'bx_if:show_attachments' => [
                 'condition' => !empty($aTmplVarsAttachments),
                 'condition' => !empty($aTmplVarsAttachments),
-                'content' => array(
+                'content' => [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'display' => $sAttachmentsLayout,
                     'display' => $sAttachmentsLayout,
                     'count' => count($aTmplVarsAttachments),
                     'count' => count($aTmplVarsAttachments),
                     'bx_repeat:items' => $aTmplVarsAttachments
                     'bx_repeat:items' => $aTmplVarsAttachments
-                )
-            ),
-            'bx_if:show_attachments_files' => array(
+                ]
+            ],
+            'bx_if:show_attachments_files' => [
                 'condition' => !empty($aTmplVarsAttachmentsFiles),
                 'condition' => !empty($aTmplVarsAttachmentsFiles),
                 'content' => $aTmplVarsAttachmentsFiles
                 'content' => $aTmplVarsAttachmentsFiles
-            )
-        );
+            ]
+        ];
     }
     }
 
 
     protected function _getTmplVarsContentRepost(&$aEvent, $aBrowseParams = array())
     protected function _getTmplVarsContentRepost(&$aEvent, $aBrowseParams = array())
@@ -2315,19 +2387,33 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
         $sSample = _t($aContent['sample']);
         $sSample = _t($aContent['sample']);
         $sSampleLink = empty($aContent['url']) ? $sSample : $this->parseLink($aContent['url'], $sSample);
         $sSampleLink = empty($aContent['url']) ? $sSample : $this->parseLink($aContent['url'], $sSample);
 
 
+        $aTmplVarsData = [];
+        if(!empty($aContent['rdata']) && is_array($aContent['rdata'])) {
+            $aData = $aContent['rdata'];
+
+            $aTmplVarsData['style_prefix'] = $sStylePrefix;
+
+            if(isset($aData['text']))
+                $aTmplVarsData['text'] = $this->_prepareTextForOutput($aData['text'], $aEvent['id']);
+        }
+
         $sContent = $this->_getContent($aContent['parse_type'], $aEvent, $aBrowseParams);
         $sContent = $this->_getContent($aContent['parse_type'], $aEvent, $aBrowseParams);
 
 
-        return array(
+        return [
             'style_prefix' => $sStylePrefix,
             'style_prefix' => $sStylePrefix,
             'item_owner_action' => _t('_bx_timeline_txt_reposted', $sOwnerLink, $sSampleLink),
             'item_owner_action' => _t('_bx_timeline_txt_reposted', $sOwnerLink, $sSampleLink),
-            'bx_if:show_content' => array(
+            'bx_if:show_data' => [
+                'condition' => !empty($aTmplVarsData),
+                'content' => $aTmplVarsData
+            ],
+            'bx_if:show_content' => [
                 'condition' => !empty($sContent),
                 'condition' => !empty($sContent),
-                'content' => array(
+                'content' => [
                     'style_prefix' => $sStylePrefix,
                     'style_prefix' => $sStylePrefix,
                     'content' => $sContent,
                     'content' => $sContent,
-                )
-            )
-        );
+                ]
+            ]
+        ];
     }
     }
 
 
     protected function _getTmplVarsNote(&$aEvent)
     protected function _getTmplVarsNote(&$aEvent)

+ 22 - 14
modules/boonex/timeline/install/langs/en.xml

@@ -100,20 +100,26 @@
     <string name="_bx_timeline_form_attach_link_input_do_submit"><![CDATA[Add]]></string>
     <string name="_bx_timeline_form_attach_link_input_do_submit"><![CDATA[Add]]></string>
     <string name="_bx_timeline_form_attach_link_input_do_cancel"><![CDATA[Close]]></string>
     <string name="_bx_timeline_form_attach_link_input_do_cancel"><![CDATA[Close]]></string>
 
 
-    <string name="_bx_timeline_form_repost_to"><![CDATA[Repost To]]></string>
-    <string name="_bx_timeline_form_repost_to_display_browse"><![CDATA[Browse to Repost To]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_reposter_id"><![CDATA[Reposter ID]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_type"><![CDATA[Type]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_action"><![CDATA[Action]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_object_id"><![CDATA[Object ID]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_search"><![CDATA[Search]]></string>
-    <string name="_bx_timeline_form_repost_to_input_search"><![CDATA[Search]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_list"><![CDATA[List]]></string>
-    <string name="_bx_timeline_form_repost_to_input_list"><![CDATA[or select]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_do_submit"><![CDATA[Repost]]></string>
-    <string name="_bx_timeline_form_repost_to_input_do_submit"><![CDATA[Repost]]></string>
-    <string name="_bx_timeline_form_repost_to_input_sys_do_cancel"><![CDATA[Cancel]]></string>
-    <string name="_bx_timeline_form_repost_to_input_do_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_timeline_form_repost"><![CDATA[Repost]]></string>
+    <string name="_bx_timeline_form_repost_display_with"><![CDATA[Repost With Text]]></string>
+    <string name="_bx_timeline_form_repost_display_to"><![CDATA[Repost To]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_reposter_id"><![CDATA[Reposter ID]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_owner_id"><![CDATA[Owner ID]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_type"><![CDATA[Type]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_action"><![CDATA[Action]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_object_id"><![CDATA[Object ID]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_search"><![CDATA[Search]]></string>
+    <string name="_bx_timeline_form_repost_input_search"><![CDATA[Search]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_list"><![CDATA[List]]></string>
+    <string name="_bx_timeline_form_repost_input_list"><![CDATA[or select]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_text"><![CDATA[Text]]></string>
+    <string name="_bx_timeline_form_repost_input_text"><![CDATA[]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_reposted"><![CDATA[Reposted]]></string>
+    <string name="_bx_timeline_form_repost_input_reposted"><![CDATA[]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_do_submit"><![CDATA[Repost]]></string>
+    <string name="_bx_timeline_form_repost_input_do_submit"><![CDATA[Repost]]></string>
+    <string name="_bx_timeline_form_repost_input_sys_do_cancel"><![CDATA[Cancel]]></string>
+    <string name="_bx_timeline_form_repost_input_do_cancel"><![CDATA[Cancel]]></string>
 
 
     <string name="_bx_timeline_form_filters_input_by_modules"><![CDATA[Content:]]></string>
     <string name="_bx_timeline_form_filters_input_by_modules"><![CDATA[Content:]]></string>
     <string name="_bx_timeline_form_filters_input_by_modules_all"><![CDATA[All]]></string>
     <string name="_bx_timeline_form_filters_input_by_modules_all"><![CDATA[All]]></string>
@@ -222,6 +228,8 @@
     <string name="_bx_timeline_menu_set_title_item_share"><![CDATA[Share Item]]></string>
     <string name="_bx_timeline_menu_set_title_item_share"><![CDATA[Share Item]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_repost"><![CDATA[Repost]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_repost"><![CDATA[Repost]]></string>
     <string name="_bx_timeline_menu_item_title_item_repost"><![CDATA[Repost]]></string>
     <string name="_bx_timeline_menu_item_title_item_repost"><![CDATA[Repost]]></string>
+    <string name="_bx_timeline_menu_item_title_system_item_repost_with"><![CDATA[Repost with Text]]></string>
+    <string name="_bx_timeline_menu_item_title_item_repost_with"><![CDATA[Repost with Text]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_repost_to"><![CDATA[Repost to Context]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_repost_to"><![CDATA[Repost to Context]]></string>
     <string name="_bx_timeline_menu_item_title_item_repost_to"><![CDATA[Repost to Context]]></string>
     <string name="_bx_timeline_menu_item_title_item_repost_to"><![CDATA[Repost to Context]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_send"><![CDATA[Send]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_send"><![CDATA[Send]]></string>

+ 3 - 2
modules/boonex/timeline/install/sql/enable.sql

@@ -137,8 +137,9 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
 ('bx_timeline_menu_item_share', 'bx_timeline', 'item-repost', '_bx_timeline_menu_item_title_system_item_repost', '_bx_timeline_menu_item_title_item_repost', 'javascript:void(0)', 'javascript:{repost_onclick}', '_self', 'redo', '', 2147483647, 1, 0, 1),
 ('bx_timeline_menu_item_share', 'bx_timeline', 'item-repost', '_bx_timeline_menu_item_title_system_item_repost', '_bx_timeline_menu_item_title_item_repost', 'javascript:void(0)', 'javascript:{repost_onclick}', '_self', 'redo', '', 2147483647, 1, 0, 1),
-('bx_timeline_menu_item_share', 'bx_timeline', 'item-repost-to', '_bx_timeline_menu_item_title_system_item_repost_to', '_bx_timeline_menu_item_title_item_repost_to', 'javascript:void(0)', 'javascript:{repost_to_onclick}', '_self', 'redo', '', 2147483647, 1, 0, 2),
-('bx_timeline_menu_item_share', 'bx_timeline', 'item-send', '_bx_timeline_menu_item_title_system_item_send', '_bx_timeline_menu_item_title_item_send', 'page.php?i=start-convo&et={et_send}', '', '_self', 'envelope', '', 2147483647, 1, 0, 3);
+('bx_timeline_menu_item_share', 'bx_timeline', 'item-repost-with', '_bx_timeline_menu_item_title_system_item_repost_with', '_bx_timeline_menu_item_title_item_repost_with', 'javascript:void(0)', 'javascript:{repost_with_onclick}', '_self', 'redo', '', 2147483647, 1, 0, 2),
+('bx_timeline_menu_item_share', 'bx_timeline', 'item-repost-to', '_bx_timeline_menu_item_title_system_item_repost_to', '_bx_timeline_menu_item_title_item_repost_to', 'javascript:void(0)', 'javascript:{repost_to_onclick}', '_self', 'redo', '', 2147483647, 1, 0, 3),
+('bx_timeline_menu_item_share', 'bx_timeline', 'item-send', '_bx_timeline_menu_item_title_system_item_send', '_bx_timeline_menu_item_title_item_send', 'page.php?i=start-convo&et={et_send}', '', '_self', 'envelope', '', 2147483647, 1, 0, 4);
 
 
 -- MENU: Item Manage (Pin, Delete, etc)
 -- MENU: Item Manage (Pin, Delete, etc)
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 

+ 35 - 20
modules/boonex/timeline/install/sql/install.sql

@@ -517,32 +517,47 @@ INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_fo
 
 
 -- Forms -> Repost To
 -- Forms -> Repost To
 INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
 INSERT INTO `sys_objects_form` (`object`, `module`, `title`, `action`, `form_attrs`, `submit_name`, `table`, `key`, `uri`, `uri_title`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
-('bx_timeline_repost_to', @sName, '_bx_timeline_form_repost_to', '', '', 'do_submit', '', '', '', '', '', 0, 1, 'BxTimelineFormRepostTo', 'modules/boonex/timeline/classes/BxTimelineFormRepostTo.php');
+('bx_timeline_repost', @sName, '_bx_timeline_form_repost', '', '', 'do_submit', '', '', '', '', '', 0, 1, 'BxTimelineFormRepost', 'modules/boonex/timeline/classes/BxTimelineFormRepost.php');
 
 
 INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
 INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
-('bx_timeline_repost_to_browse', @sName, 'bx_timeline_repost_to', '_bx_timeline_form_repost_to_display_browse', 0);
+('bx_timeline_repost_with', @sName, 'bx_timeline_repost', '_bx_timeline_form_repost_display_with', 0),
+('bx_timeline_repost_to', @sName, 'bx_timeline_repost', '_bx_timeline_form_repost_display_to', 0);
 
 
 INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
 INSERT INTO `sys_form_inputs` (`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES
-('bx_timeline_repost_to', @sName, 'reposter_id', '', '', 0, 'hidden', '_bx_timeline_form_repost_to_input_sys_reposter_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
-('bx_timeline_repost_to', @sName, 'type', '', '', 0, 'hidden', '_bx_timeline_form_repost_to_input_sys_type', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
-('bx_timeline_repost_to', @sName, 'action', '', '', 0, 'hidden', '_bx_timeline_form_repost_to_input_sys_action', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
-('bx_timeline_repost_to', @sName, 'object_id', '', '', 0, 'hidden', '_bx_timeline_form_repost_to_input_sys_object_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
-('bx_timeline_repost_to', @sName, 'search', '', '', 0, 'custom', '_bx_timeline_form_repost_to_input_sys_search', '_bx_timeline_form_repost_to_input_search', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
-('bx_timeline_repost_to', @sName, 'list', '', '', 0, 'custom', '_bx_timeline_form_repost_to_input_sys_list', '_bx_timeline_form_repost_to_input_list', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
-('bx_timeline_repost_to', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
-('bx_timeline_repost_to', @sName, 'do_submit', '_bx_timeline_form_repost_to_input_do_submit', '', 0, 'submit', '_bx_timeline_form_repost_to_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
-('bx_timeline_repost_to', @sName, 'do_cancel', '_bx_timeline_form_repost_to_input_do_cancel', '', 0, 'button', '_bx_timeline_form_repost_to_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
+('bx_timeline_repost', @sName, 'reposter_id', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_reposter_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_timeline_repost', @sName, 'owner_id', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_owner_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_timeline_repost', @sName, 'type', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_type', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_timeline_repost', @sName, 'action', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_action', '', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 0, 0),
+('bx_timeline_repost', @sName, 'object_id', '', '', 0, 'hidden', '_bx_timeline_form_repost_input_sys_object_id', '', '', 0, 0, 0, '', '', '', '', '', '', 'Int', '', 0, 0),
+('bx_timeline_repost', @sName, 'search', '', '', 0, 'custom', '_bx_timeline_form_repost_input_sys_search', '_bx_timeline_form_repost_input_search', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_timeline_repost', @sName, 'list', '', '', 0, 'custom', '_bx_timeline_form_repost_input_sys_list', '_bx_timeline_form_repost_input_list', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_timeline_repost', @sName, 'text', '', '', 0, 'textarea', '_bx_timeline_form_repost_input_sys_text', '_bx_timeline_form_repost_input_text', '', 0, 0, 0, 'a:1:{s:12:"autocomplete";s:3:"off";}', '', '', '', '', '', 'XssHtml', '', 1, 0),
+('bx_timeline_repost', @sName, 'reposted', '', '', 0, 'custom', '_bx_timeline_form_repost_input_sys_reposted', '_bx_timeline_form_repost_input_reposted', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_timeline_repost', @sName, 'controls', '', 'do_submit,do_cancel', 0, 'input_set', '', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_timeline_repost', @sName, 'do_submit', '_bx_timeline_form_repost_input_do_submit', '', 0, 'submit', '_bx_timeline_form_repost_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_timeline_repost', @sName, 'do_cancel', '_bx_timeline_form_repost_input_do_cancel', '', 0, 'button', '_bx_timeline_form_repost_input_sys_do_cancel', '', '', 0, 0, 0, 'a:2:{s:7:"onclick";s:45:"$(''.bx-popup-applied:visible'').dolPopupHide()";s:5:"class";s:22:"bx-def-margin-sec-left";}', '', '', '', '', '', '', '', 0, 0);
 
 
 INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
 INSERT INTO `sys_form_display_inputs` (`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES
-('bx_timeline_repost_to_browse', 'reposter_id', 2147483647, 1, 1),
-('bx_timeline_repost_to_browse', 'type', 2147483647, 1, 2),
-('bx_timeline_repost_to_browse', 'action', 2147483647, 1, 3),
-('bx_timeline_repost_to_browse', 'object_id', 2147483647, 1, 4),
-('bx_timeline_repost_to_browse', 'search', 2147483647, 1, 5),
-('bx_timeline_repost_to_browse', 'list', 2147483647, 1, 6),
-('bx_timeline_repost_to_browse', 'controls', 2147483647, 1, 7),
-('bx_timeline_repost_to_browse', 'do_submit', 2147483647, 1, 8),
-('bx_timeline_repost_to_browse', 'do_cancel', 2147483647, 1, 9);
+('bx_timeline_repost_with', 'reposter_id', 2147483647, 1, 1),
+('bx_timeline_repost_with', 'owner_id', 2147483647, 1, 2),
+('bx_timeline_repost_with', 'type', 2147483647, 1, 3),
+('bx_timeline_repost_with', 'action', 2147483647, 1, 4),
+('bx_timeline_repost_with', 'object_id', 2147483647, 1, 5),
+('bx_timeline_repost_with', 'text', 2147483647, 1, 6),
+('bx_timeline_repost_with', 'reposted', 2147483647, 1, 7),
+('bx_timeline_repost_with', 'controls', 2147483647, 1, 8),
+('bx_timeline_repost_with', 'do_submit', 2147483647, 1, 9),
+('bx_timeline_repost_with', 'do_cancel', 2147483647, 1, 10),
+
+('bx_timeline_repost_to', 'reposter_id', 2147483647, 1, 1),
+('bx_timeline_repost_to', 'type', 2147483647, 1, 2),
+('bx_timeline_repost_to', 'action', 2147483647, 1, 3),
+('bx_timeline_repost_to', 'object_id', 2147483647, 1, 4),
+('bx_timeline_repost_to', 'search', 2147483647, 1, 5),
+('bx_timeline_repost_to', 'list', 2147483647, 1, 6),
+('bx_timeline_repost_to', 'controls', 2147483647, 1, 7),
+('bx_timeline_repost_to', 'do_submit', 2147483647, 1, 8),
+('bx_timeline_repost_to', 'do_cancel', 2147483647, 1, 9);
 
 
 
 
 -- COMMENTS
 -- COMMENTS

+ 55 - 30
modules/boonex/timeline/js/repost.js

@@ -22,50 +22,75 @@ function BxTimelineRepost(oOptions) {
 BxTimelineRepost.prototype = new BxTimelineMain();
 BxTimelineRepost.prototype = new BxTimelineMain();
 
 
 BxTimelineRepost.prototype.repostItem = function(oLink, iOwnerId, sType, sAction, iId) {
 BxTimelineRepost.prototype.repostItem = function(oLink, iOwnerId, sType, sAction, iId) {
-	var $this = this;
-	var oDate = new Date();
-	var oParams = {
-		owner_id: iOwnerId,
-		type: sType,
-		action: sAction,
-		object_id: iId,
-		_t: oDate.getTime()	
-	};
-
-	this.loadingIn(oLink, true);
-
-	jQuery.post(
+    var $this = this;
+    var oDate = new Date();
+    var oParams = {
+        owner_id: iOwnerId,
+        type: sType,
+        action: sAction,
+        object_id: iId,
+        _t: oDate.getTime()	
+    };
+
+    this.loadingIn(oLink, true);
+
+    jQuery.post(
         this._sActionsUrl + 'repost/',
         this._sActionsUrl + 'repost/',
         oParams,
         oParams,
         function(oData) {
         function(oData) {
-        	$this.loadingIn(oLink, false);
+            $this.loadingIn(oLink, false);
 
 
-        	var oPopup = $(oLink).parents('.bx-popup-applied:visible:first');
-        	if(oPopup.length >0)
-        		oPopup.dolPopupHide();
+            var oPopup = $(oLink).parents('.bx-popup-applied:visible:first');
+            if(oPopup.length >0)
+                oPopup.dolPopupHide();
 
 
-        	var oCounter = $this._getCounter(oLink);
-        	var bCounter = oCounter && oCounter.length > 0;
-        	var fContinue = function() {
-                    if(oData && oData.count != undefined && bCounter) {
-                        oCounter.html(oData.countf);
+            var oCounter = $this._getCounter(oLink);
+            var bCounter = oCounter && oCounter.length > 0;
+            var fContinue = function() {
+                if(oData && oData.count != undefined && bCounter) {
+                    oCounter.html(oData.countf);
 
 
-                        oCounter.parents('.' + $this.sSP + '-repost-counter-holder:first').bx_anim(oData.count > 0 ? 'show' : 'hide');
-                    }
+                    oCounter.parents('.' + $this.sSP + '-repost-counter-holder:first').bx_anim(oData.count > 0 ? 'show' : 'hide');
+                }
 
 
-                    if(oData && oData.disabled)
-                        $(oLink).removeAttr('onclick').addClass($(oLink).hasClass('bx-btn') ? 'bx-btn-disabled' : $this.sSP + '-repost-disabled');
-        	};
+                if(oData && oData.disabled)
+                    $(oLink).removeAttr('onclick').addClass($(oLink).hasClass('bx-btn') ? 'bx-btn-disabled' : $this.sSP + '-repost-disabled');
+            };
 
 
-        	if(oData && oData.message != undefined && oData.message.length > 0 && !bCounter)
+            if(oData && oData.message != undefined && oData.message.length > 0 && !bCounter)
                 bx_alert(oData.message, fContinue);
                 bx_alert(oData.message, fContinue);
-        	else
-        		fContinue();
+            else
+                fContinue();
         },
         },
         'json'
         'json'
     );
     );
 };
 };
 
 
+BxTimelineRepost.prototype.repostItemWith = function(oLink, iOwnerId, sType, sAction, iId) {
+    var $this = this;
+    var oData = this._getDefaultData();
+    oData = jQuery.extend({}, oData, {
+        owner_id: iOwnerId,
+        type: sType,
+        action: sAction,
+        object_id: iId
+    });   
+
+    $(window).dolPopupAjax({
+        id: {value: this._aHtmlIds['with_popup'], force: true}, 
+        url: bx_append_url_params(this._sActionsUri + 'repost_with/', oData),
+        closeOnOuterClick: false,
+        removeOnClose: true,
+        onBeforeShow: function() {
+            $this.loadingIn(oLink, false);
+
+            $(oLink).parents(".bx-popup-applied:visible:first").dolPopupHide();
+        }
+    });
+
+    return false;
+};
+
 BxTimelineRepost.prototype.repostItemTo = function(oLink, iReposterId, sType, sAction, iId) {
 BxTimelineRepost.prototype.repostItemTo = function(oLink, iReposterId, sType, sAction, iId) {
     var $this = this;
     var $this = this;
     var oData = this._getDefaultData();
     var oData = this._getDefaultData();

+ 20 - 0
modules/boonex/timeline/template/repost_with_popup.html

@@ -0,0 +1,20 @@
+<div class="__style_prefix__-repost-with bx-popup-width">
+    <div class="__style_prefix__-repost-with-cnt bx-def-padding">
+        __form__
+        <script language="javascript">
+            $(document).ready(function () {
+                $("#__form_id__").ajaxForm({ 
+                    dataType: "json",
+                    beforeSubmit: function (formData, jqForm, options) {
+                        bx_loading($("#__form_id__"), true);
+                    },
+                    success: function (oData) {
+                        $("#__form_id__").parents(".bx-popup-applied:visible:first").dolPopupHide();
+
+                        processJsonData(oData);
+                    }
+                });
+            });
+        </script>
+    </div>
+</div>

+ 5 - 0
modules/boonex/timeline/template/repost_with_reposted.html

@@ -0,0 +1,5 @@
+<div class="__style_prefix__-rw-reposted bx-def-border bx-def-round-corners">
+    <div class="__style_prefix__-rtr-cnt bx-def-padding-sec-topbottom">
+        <div class="__style_prefix__-view-item">__content__</div>
+    </div>
+</div>

+ 5 - 0
modules/boonex/timeline/template/type_repost.html

@@ -1,6 +1,11 @@
 <div class="__style_prefix__-item-action bx-def-margin-lefttopright bx-def-font-middle bx-def-font-grayed">
 <div class="__style_prefix__-item-action bx-def-margin-lefttopright bx-def-font-middle bx-def-font-grayed">
     <span>__item_owner_action__</span>
     <span>__item_owner_action__</span>
 </div>
 </div>
+<bx_if:show_data>
+    <div class="__style_prefix__-data bx-def-margin-lefttopright">
+        <span class="__style_prefix__-d-text bx-def-font-middle">__text__</span>
+    </div>
+</bx_if:show_data>
 <bx_if:show_content>
 <bx_if:show_content>
     <div class="__style_prefix__-content">
     <div class="__style_prefix__-content">
         __content__
         __content__