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

#24 - System Votes integration update.

AntonLV 12 лет назад
Родитель
Сommit
1f2d5be828

+ 2 - 0
inc/js/classes/BxDolVote.js

@@ -94,6 +94,8 @@ BxDolVote.prototype.vote = function (oLink, iValue)
             var oCounter = $this._getCounter(oLink);
             if(oCounter)
             	oCounter.html(oData.countf);
+
+            oCounter.parents('.' + $this._sSP + '-counter-holder:first').bx_anim(oData.count > 0 ? 'show' : 'hide');
         },
         'json'
     );

+ 3 - 1
install/sql/system.sql

@@ -2575,7 +2575,8 @@ INSERT INTO `sys_menu_templates` (`id`, `template`, `title`) VALUES
 (11, 'menu_interactive_vertical.html', '_sys_menu_template_title_interactive_vertical'),
 (12, 'menu_account_popup.html', '_sys_menu_template_title_account_popup'),
 (13, 'menu_account_notifications.html', '_sys_menu_template_title_account_notifications'),
-(14, 'menu_floating_blocks_big.html', '_sys_menu_template_title_floating_blocks_big');
+(14, 'menu_floating_blocks_big.html', '_sys_menu_template_title_floating_blocks_big'),
+(15, 'menu_custom.html', '_sys_menu_template_title_custom');
 
 CREATE TABLE IF NOT EXISTS `sys_objects_menu` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
@@ -2660,6 +2661,7 @@ CREATE TABLE IF NOT EXISTS `sys_menu_items` (
   `visible_for_levels` int(11) NOT NULL DEFAULT '2147483647',
   `active` tinyint(4) NOT NULL DEFAULT '1',
   `copyable` tinyint(4) NOT NULL DEFAULT '1',
+  `editable` tinyint(4) NOT NULL DEFAULT '1',
   `order` int(11) NOT NULL,
   PRIMARY KEY (`id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

+ 8 - 8
modules/base/notifications/classes/BxBaseModNotificationsConfig.php

@@ -87,7 +87,7 @@ class BxBaseModNotificationsConfig extends BxBaseModGeneralConfig
     	if(empty($sType))
             return $this->_aPrefixes;
 
-        return $this->_aPrefixes[$sType];
+        return isset($this->_aPrefixes[$sType]) ? $this->_aPrefixes[$sType] : '';
     }
 
     public function getObject($sType = '')
@@ -95,7 +95,7 @@ class BxBaseModNotificationsConfig extends BxBaseModGeneralConfig
     	if(empty($sType))
             return $this->_aObjects;
 
-        return $this->_aObjects[$sType];
+        return isset($this->_aObjects[$sType]) ? $this->_aObjects[$sType] : '';
     }
 
 	public function getHandlerDescriptor()
@@ -117,7 +117,7 @@ class BxBaseModNotificationsConfig extends BxBaseModGeneralConfig
         if($sKey == '')
             return $this->_aHandlers;
 
-        return $this->_aHandlers[$sKey];
+        return isset($this->_aHandlers[$sKey]) ? $this->_aHandlers[$sKey] : '';
     }
 
     public function getHandlersHidden()
@@ -127,12 +127,12 @@ class BxBaseModNotificationsConfig extends BxBaseModGeneralConfig
 
 	public function getJsClass($sType)
     {
-        return $this->_aJsClass[$sType];
+        return isset($this->_aJsClass[$sType]) ? $this->_aJsClass[$sType] : '';
     }
 
     public function getJsObject($sType)
     {
-        return $this->_aJsObjects[$sType];
+        return isset($this->_aJsObjects[$sType]) ? $this->_aJsObjects[$sType] : '';
     }
 
 	public function getPerPage($sType = 'default')
@@ -140,15 +140,15 @@ class BxBaseModNotificationsConfig extends BxBaseModGeneralConfig
     	if(empty($sType))
             return $this->_aPerPage;
 
-        return $this->_aPerPage[$sType];
+        return isset($this->_aPerPage[$sType]) ? $this->_aPerPage[$sType] : '';
     }
 
     public function getHtmlIds($sType, $sKey = '')
     {
         if(empty($sKey))
-            return $this->_aHtmlIds[$sType];
+            return isset($this->_aHtmlIds[$sType]) ? $this->_aHtmlIds[$sType] : array();
 
-        return $this->_aHtmlIds[$sType][$sKey];
+        return isset($this->_aHtmlIds[$sType][$sKey]) ? $this->_aHtmlIds[$sType][$sKey] : '';
     }
 
     public function getAnimationEffect()

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

@@ -1810,6 +1810,7 @@ If it is not enabled then please consider implement this optimization, since it
 	<string name="_sys_menu_template_title_ver"><![CDATA[Vertical Links]]></string>
 	<string name="_sys_menu_template_title_ver_lite"><![CDATA[Vertical Links (lite)]]></string>
 	<string name="_sys_menu_template_title_account_popup"><![CDATA[Account popup]]></string>
+	<string name="_sys_menu_template_title_custom"><![CDATA[Custom menu items]]></string>
 	<string name="_sys_menu_title_account"><![CDATA[Account Menu]]></string>
 	<string name="_sys_menu_title_account_dashboard"><![CDATA[Account Dashboard Menu]]></string>
 	<string name="_sys_menu_title_account_dashboard_administration"><![CDATA[Account Dashboard Administration Menu]]></string>

+ 41 - 19
modules/boonex/timeline/classes/BxTimelineMenuItem.php → modules/boonex/timeline/classes/BxTimelineMenuItemActions.php

@@ -14,7 +14,7 @@ bx_import('BxTemplMenu');
 /**
  * 'Item' menu.
  */
-class BxTimelineMenuItem extends BxTemplMenu
+class BxTimelineMenuItemActions extends BxTemplMenu
 {
     protected $_aEvent;
     protected $_oModule;
@@ -37,14 +37,6 @@ class BxTimelineMenuItem extends BxTemplMenu
 
         $this->_aEvent = $aEvent;
 
-        $iVotesObject = 0;
-        $sVotesSystem = $sVotesOnclick = '';
-        if(isset($aEvent['votes']) && is_array($aEvent['votes']) && isset($aEvent['votes']['system'])) {
-            $sVotesSystem = $aEvent['votes']['system'];
-            $iVotesObject = $aEvent['votes']['object_id'];
-            $sVotesOnclick = $this->_oModule->getVoteObject($sVotesSystem, $iVotesObject)->getJsClick();
-        }
-
         $iCommentsObject = 0;
         $sCommentsSystem = $sCommentsOnclick = '';
         if(isset($aEvent['comments']) && is_array($aEvent['comments']) && isset($aEvent['comments']['system'])) {
@@ -77,10 +69,6 @@ class BxTimelineMenuItem extends BxTemplMenu
             'comment_object' => $iCommentsObject,
             'comment_onclick' => $sCommentsOnclick,
 
-            'vote_system' => $sVotesSystem,
-            'vote_object' => $iVotesObject,
-            'vote_onclick' => $sVotesOnclick,
-
             'share_type' => $sShareType,
             'share_action' => $sShareAction,
             'share_object' => $iShareObject,
@@ -104,6 +92,46 @@ class BxTimelineMenuItem extends BxTemplMenu
 
     	return $bVisible;
     }
+
+    protected function _getMenuItem ($aItem)
+    {
+    	if (isset($aItem['active']) && !$aItem['active'])
+			return false;
+
+		if (isset($aItem['visible_for_levels']) && !$this->_isVisible($aItem))
+        	return false;
+
+    	$sMethod = '_getMenuItem' . str_replace(' ', '', ucwords(str_replace('-', ' ', $aItem['name'])));
+
+    	if(!method_exists($this, $sMethod)) {
+    		$aItem = parent::_getMenuItem($aItem);
+    		if($aItem === false)
+    			return false;
+
+			$sItem = $this->_oModule->_oTemplate->parseHtmlByName('menu_item.html', $aItem);
+    	}
+    	else
+    		$sItem = $this->$sMethod($aItem);
+
+    	if(empty($sItem))
+    		return false;
+
+		return array(
+			'class' => $this->_isSelected($aItem) ? 'bx-menu-tab-active' : '',
+			'item' => $sItem
+		);
+    }
+
+    protected function _getMenuItemItemVote($aItem)
+    {
+        if(!isset($this->_aEvent['votes']) || !is_array($this->_aEvent['votes']) || !isset($this->_aEvent['votes']['system'])) 
+        	return false;
+
+		$sVotesSystem = $this->_aEvent['votes']['system'];
+		$iVotesObject = $this->_aEvent['votes']['object_id'];
+    	return $this->_oModule->getVoteObject($sVotesSystem, $iVotesObject)->getElementInline();
+    }
+
     /**
      * Check if menu items is visible.
      * @param $a menu item array
@@ -117,12 +145,6 @@ class BxTimelineMenuItem extends BxTemplMenu
         $sCheckFuncName = '';
         $aCheckFuncParams = array();
         switch ($a['name']) {
-            case 'item-delete':
-                $sCheckFuncName = 'isAllowedDelete';
-                if(!empty($this->_aEvent))
-                    $aCheckFuncParams = array($this->_aEvent);
-                break;
-
             case 'item-comment':
                 $sCheckFuncName = 'isAllowedComment';
                 if(!empty($this->_aEvent))

+ 89 - 0
modules/boonex/timeline/classes/BxTimelineMenuItemManage.php

@@ -0,0 +1,89 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    Timeline Timeline
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+bx_import('BxTemplMenu');
+
+/**
+ * 'Item' menu.
+ */
+class BxTimelineMenuItemManage extends BxTemplMenu
+{
+    protected $_aEvent;
+    protected $_oModule;
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+
+        $this->_oModule = BxDolModule::getInstance('bx_timeline');
+
+        $this->addMarkers(array(
+            'js_object_view' => $this->_oModule->_oConfig->getJsObject('view'),
+        ));
+    }
+
+    public function setEvent($aEvent)
+    {
+        if(empty($aEvent) || !is_array($aEvent))
+            return;
+
+        $this->_aEvent = $aEvent;
+
+        $this->addMarkers(array(
+            'content_id' => $aEvent['id'],
+        ));
+    }
+
+    public function isVisible()
+    {
+    	if(!isset($this->_aObject['menu_items']))
+			$this->_aObject['menu_items'] = $this->_oQuery->getMenuItems();
+
+    	$bVisible = false;
+    	foreach ($this->_aObject['menu_items'] as $a) {
+    		if((isset($a['active']) && !$a['active']) || (isset($a['visible_for_levels']) && !$this->_isVisible($a)))
+				continue;
+			
+			$bVisible = true;
+			break;
+    	}
+
+    	return $bVisible;
+    }
+
+    /**
+     * Check if menu items is visible.
+     * @param $a menu item array
+     * @return boolean
+     */
+    protected function _isVisible ($a)
+    {
+        if(!parent::_isVisible($a))
+            return false;
+
+        $sCheckFuncName = '';
+        $aCheckFuncParams = array();
+        switch ($a['name']) {
+            case 'item-delete':
+                $sCheckFuncName = 'isAllowedDelete';
+                if(!empty($this->_aEvent))
+                    $aCheckFuncParams = array($this->_aEvent);
+                break;
+        }
+
+        if(!$sCheckFuncName || !method_exists($this->_oModule, $sCheckFuncName))
+            return true;
+
+        return call_user_func_array(array($this->_oModule, $sCheckFuncName), $aCheckFuncParams) === true;
+    }
+}
+
+/** @} */

+ 17 - 20
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -119,15 +119,22 @@ class BxTimelineModule extends BxBaseModNotificationsModule
             'description' => ''
         ));
 
-        if(!empty($iId)) {
-            $this->onShare($iId, $aShared);
-
-            $sCounter = $this->_oTemplate->getShareCounter($aContent['type'], $aContent['action'], $aContent['object_id']);
-            $this->_echoResultJson(array('code' => 0, 'counter' => $sCounter, 'msg' => _t('_bx_timeline_txt_msg_success_share')));
-            return;
+        if(empty($iId)) {
+	        $this->_echoResultJson(array('code' => 3, 'msg' => _t('_bx_timeline_txt_err_cannot_share')));        
+	        return;
         }
 
-        $this->_echoResultJson(array('code' => 3, 'msg' => _t('_bx_timeline_txt_err_cannot_share')));
+        $this->onShare($iId, $aShared);
+
+        $aShared = $this->_oDb->getShared($aContent['type'], $aContent['action'], $aContent['object_id']);
+		$sCounter = $this->_oTemplate->getShareCounter($aShared);
+
+		$this->_echoResultJson(array(
+			'code' => 0, 
+			'msg' => _t('_bx_timeline_txt_msg_success_share'), 
+			'count' => $aShared['shares'], 
+			'counter' => $sCounter
+		));
     }
 
     function actionGetPost()
@@ -372,7 +379,9 @@ class BxTimelineModule extends BxBaseModNotificationsModule
     	if(!$this->isEnabled())
     		return '';
 
-        return $this->_oTemplate->getShareCounter($sType, $sAction, $iObjectId);
+		$aShared = $this->_oDb->getShared($sType, $sAction, $iObjectId);
+
+        return $this->_oTemplate->getShareCounter($aShared);
     }
 
     public function serviceGetShareJsScript()
@@ -411,18 +420,6 @@ class BxTimelineModule extends BxBaseModNotificationsModule
         ));
     }
 
-    public function serviceGetMenuItemAddonVote($sSystem, $iObjectId)
-    {
-        if(empty($sSystem) || empty($iObjectId))
-            return '';
-
-        $oVote = $this->getVoteObject($sSystem, $iObjectId);
-        if($oVote === false)
-            return '';
-
-        return $oVote->getCounter();
-    }
-
     public function serviceGetMenuItemAddonShare($sType, $sAction, $iObjectId)
     {
         if(empty($sType) || empty($iObjectId))

+ 6 - 4
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -306,20 +306,22 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                 'condition' => $bShowCounter,
                 'content' => array(
                     'style_prefix' => $sStylePrefix,
-                    'counter' => $this->getShareCounter($sType, $sAction, $iObjectId)
+        			'bx_if:show_hidden' => array(
+        				'condition' => (int)$aShared['shares'] == 0,
+        				'content' => array()
+        			),
+                    'counter' => $this->getShareCounter($aShared)
                 )
             ),
             'script' => $this->getShareJsScript()
         ));
     }
 
-    public function getShareCounter($sType, $sAction, $iObjectId)
+    public function getShareCounter($aEvent)
     {
         $sStylePrefix = $this->_oConfig->getPrefix('style');
         $sJsObject = $this->_oConfig->getJsObject('share');
 
-        $aEvent = $this->_oDb->getShared($sType, $sAction, $iObjectId);
-
         return $this->parseHtmlByName('share_counter.html', array(
             'href' => 'javascript:void(0)',
             'title' => _t('_bx_timeline_txt_shared_by'),

+ 0 - 1
modules/boonex/timeline/install/langs/en.xml

@@ -73,7 +73,6 @@
     <string name="_bx_timeline_menu_item_title_system_item_comment"><![CDATA[Comment]]></string>
     <string name="_bx_timeline_menu_item_title_item_comment"><![CDATA[Comment]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_vote"><![CDATA[Vote]]></string>
-    <string name="_bx_timeline_menu_item_title_item_vote"><![CDATA[Plus]]></string>
     <string name="_bx_timeline_menu_item_title_system_item_share"><![CDATA[Share]]></string>
     <string name="_bx_timeline_menu_item_title_item_share"><![CDATA[Share]]></string>
 

+ 6 - 6
modules/boonex/timeline/install/sql/enable.sql

@@ -29,7 +29,7 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbo
 
 -- MENU: Item Manage (Delete)
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_timeline_menu_item_manage', '_bx_timeline_menu_title_item_manage', 'bx_timeline_menu_item_manage', 'bx_timeline', 6, 0, 1, 'BxTimelineMenuItem', 'modules/boonex/timeline/classes/BxTimelineMenuItem.php');
+('bx_timeline_menu_item_manage', '_bx_timeline_menu_title_item_manage', 'bx_timeline_menu_item_manage', 'bx_timeline', 6, 0, 1, 'BxTimelineMenuItemManage', 'modules/boonex/timeline/classes/BxTimelineMenuItemManage.php');
 
 INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
 ('bx_timeline_menu_item_manage', 'bx_timeline', '_bx_timeline_menu_set_title_item_manage', 0);
@@ -39,15 +39,15 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 
 -- MENU: Item Actions (Comment, Plus)
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
-('bx_timeline_menu_item_actions', '_bx_timeline_menu_title_item_actions', 'bx_timeline_menu_item_actions', 'bx_timeline', 10, 0, 1, 'BxTimelineMenuItem', 'modules/boonex/timeline/classes/BxTimelineMenuItem.php');
+('bx_timeline_menu_item_actions', '_bx_timeline_menu_title_item_actions', 'bx_timeline_menu_item_actions', 'bx_timeline', 15, 0, 1, 'BxTimelineMenuItemActions', 'modules/boonex/timeline/classes/BxTimelineMenuItemActions.php');
 
 INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
 ('bx_timeline_menu_item_actions', 'bx_timeline', '_bx_timeline_menu_set_title_item_actions', 0);
 
-INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
-('bx_timeline_menu_item_actions', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '_bx_timeline_menu_item_title_item_comment', 'javascript:void(0)', 'javascript:{comment_onclick}', '_self', 'comment', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_menu_item_addon_comment";s:6:"params";a:2:{i:0;s:16:"{comment_system}";i:1;s:16:"{comment_object}";}}', '', 2147483647, 1, 0, 1),
-('bx_timeline_menu_item_actions', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '_bx_timeline_menu_item_title_item_vote', 'javascript:void(0)', 'javascript:{vote_onclick}', '_self', 'plus', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:24:"get_menu_item_addon_vote";s:6:"params";a:2:{i:0;s:13:"{vote_system}";i:1;s:13:"{vote_object}";}}', '', 2147483647, 1, 0, 2),
-('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '_bx_timeline_menu_item_title_item_share', 'javascript:void(0)', 'javascript:{share_onclick}', '_self', 'share', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:25:"get_menu_item_addon_share";s:6:"params";a:3:{i:0;s:12:"{share_type}";i:1;s:14:"{share_action}";i:2;s:14:"{share_object}";}}', '', 2147483647, 1, 0, 3);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES 
+('bx_timeline_menu_item_actions', 'bx_timeline', 'item-comment', '_bx_timeline_menu_item_title_system_item_comment', '_bx_timeline_menu_item_title_item_comment', 'javascript:void(0)', 'javascript:{comment_onclick}', '_self', 'comment', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:27:"get_menu_item_addon_comment";s:6:"params";a:2:{i:0;s:16:"{comment_system}";i:1;s:16:"{comment_object}";}}', '', 2147483647, 1, 0, 1, 1),
+('bx_timeline_menu_item_actions', 'bx_timeline', 'item-vote', '_bx_timeline_menu_item_title_system_item_vote', '', 'javascript:void(0)', '', '', '', '', '', 2147483647, 1, 0, 0, 2),
+('bx_timeline_menu_item_actions', 'bx_timeline', 'item-share', '_bx_timeline_menu_item_title_system_item_share', '_bx_timeline_menu_item_title_item_share', 'javascript:void(0)', 'javascript:{share_onclick}', '_self', 'share', 'a:3:{s:6:"module";s:11:"bx_timeline";s:6:"method";s:25:"get_menu_item_addon_share";s:6:"params";a:3:{i:0;s:12:"{share_type}";i:1;s:14:"{share_action}";i:2;s:14:"{share_object}";}}', '', 2147483647, 1, 0, 1, 3);
 
 
 -- SETTINGS

+ 18 - 16
modules/boonex/timeline/js/main.js

@@ -4,54 +4,56 @@ function BxTimelineMain() {
 	this.sIdView = '#bx-timeline';
 	this.sIdItem = '#bx-timeline-item-';
 
-	this.sClassMasonry = 'bx-tl-masonry';
-	this.sClassItem = 'bx-tl-item';
-	this.sClassItemComments = 'bx-tl-item-comments-holder';
+	this.sSP = 'bx-tl';
+	this.sClassMasonry = this.sSP + '-masonry';
+	this.sClassItems = this.sSP + '-items';
+	this.sClassItem = this.sSP + '-item';
+	this.sClassItemComments = this.sSP + '-item-comments-holder';
 }
 
 BxTimelineMain.prototype.isMasonry = function() {
-	return $(this.sIdView + ' .bx-tl-items').hasClass(this.sClassMasonry);
+	return $(this.sIdView + ' .' + this.sClassItems).hasClass(this.sClassMasonry);
 };
 
 BxTimelineMain.prototype.isMasonryEmpty = function() {
-	return $(this.sIdView + ' .bx-tl-items .bx-tl-item').length == 0;
+	return $(this.sIdView + ' .' + this.sClassItems + ' .' + this.sClassItem).length == 0;
 };
 
 BxTimelineMain.prototype.initMasonry = function() {
-	var oItems = $(this.sIdView + ' .bx-tl-items');
+	var oItems = $(this.sIdView + ' .' + this.sClassItems);
 
-	if(oItems.find('.bx-tl-item').length > 0) {
+	if(oItems.find('.' + this.sClassItem).length > 0) {
 		oItems.addClass(this.sClassMasonry).masonry({
-		  itemSelector: '.bx-tl-item',
-		  columnWidth: '.bx-tl-grid-sizer'
+		  itemSelector: '.' + this.sClassItem,
+		  columnWidth: '.' + this.sSP + '-grid-sizer'
 		});
 	}
 };
 
 BxTimelineMain.prototype.destroyMasonry = function() {
-	$(this.sIdView + ' .bx-tl-items').removeClass(this.sClassMasonry).masonry('destroy');
+	$(this.sIdView + ' .' + this.sClassItems).removeClass(this.sClassMasonry).masonry('destroy');
 };
 
 BxTimelineMain.prototype.appendMasonry = function(oItems) {
 	var $this = this;
 	var oItems = $(oItems);
-	oItems.find('img.bx-tl-item-image').load(function() {
+	oItems.find('img.' + this.sSP + '-item-image').load(function() {
 		$this.reloadMasonry();
 	});
-	$(this.sIdView + ' .bx-tl-items').append(oItems).masonry('appended', oItems);
+	$(this.sIdView + ' .' + this.sClassItems).append(oItems).masonry('appended', oItems);
 };
 
 BxTimelineMain.prototype.prependMasonry = function(oItems) {
 	var $this = this;
 	var oItems = $(oItems);
-	oItems.find('img.bx-tl-item-image').load(function() {
+	oItems.find('img.' + this.sSP + '-item-image').load(function() {
 		$this.reloadMasonry();
 	});
-	$(this.sIdView + ' .bx-tl-items').prepend(oItems).masonry('prepended', oItems);
+	$(this.sIdView + ' .' + this.sClassItems).prepend(oItems).masonry('prepended', oItems);
 };
 
 BxTimelineMain.prototype.reloadMasonry = function() {
-	$(this.sIdView + ' .bx-tl-items').masonry('reloadItems').masonry('layout');
+	$(this.sIdView + ' .' + this.sClassItems).masonry('reloadItems').masonry('layout');
 };
 
 BxTimelineMain.prototype.loadingInButton = function(e, bShow) {
@@ -62,7 +64,7 @@ BxTimelineMain.prototype.loadingInButton = function(e, bShow) {
 };
 
 BxTimelineMain.prototype.loadingInItem = function(e, bShow) {
-	var oParent = $(e).length ? $(e).parents('.bx-tl-item:first') : $('body'); 
+	var oParent = $(e).length ? $(e).parents('.' + this.sClassItem + ':first') : $('body'); 
 	bx_loading(oParent, bShow);
 };
 

+ 4 - 4
modules/boonex/timeline/js/post.js

@@ -187,11 +187,11 @@ BxTimelinePost.prototype._getPost = function(oElement, iPostId) {
         	$this.loadingInBlock(oView, false);
 
         	if($.trim(oData.item).length) {
-        		if(!oView.find('.bx-tl-load-more').is(':visible'))
-        			oView.find('.bx-tl-load-more').show();
+        		if(!oView.find('.' + $this.sSP + '-load-more').is(':visible'))
+        			oView.find('.' + $this.sSP + '-load-more').show();
 
-        		if(oView.find('.bx-tl-empty').is(':visible'))
-        			oView.find('.bx-tl-empty').hide();
+        		if(oView.find('.' + $this.sSP + '-empty').is(':visible'))
+        			oView.find('.' + $this.sSP + '-empty').hide();
 
         		if(!$this.isMasonry())
         			$this.initMasonry();

+ 3 - 2
modules/boonex/timeline/js/share.js

@@ -34,8 +34,9 @@ BxTimelineShare.prototype.shareItem = function(oLink, iOwnerId, sType, sAction,
                 alert(oData.msg);
 
         	if(oData && oData.counter != undefined) {
-        		var sCounterId = $(oData.counter).attr('id');
-        		$('#' + sCounterId).replaceWith(oData.counter);
+        		var sCounter = $(oData.counter).attr('id');
+        		$('#' + sCounter).replaceWith(oData.counter);
+        		$('#' + sCounter).parents('.' + $this.sSP + '-share-counter-holder:first').bx_anim(oData.count > 0 ? 'show' : 'hide');
         	}
         },
         'json'

+ 5 - 3
modules/boonex/timeline/js/view.js

@@ -63,6 +63,8 @@ BxTimelineView.prototype.deletePost = function(oLink, iId) {
                 alert(oData.msg);
 
             if(oData && oData.code == 0)
+            	$(oLink).parents('.bx-popup-applied:first:visible').dolPopupHide();
+
                 $($this.sIdItem + oData.id).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
                     $(this).remove();
 
@@ -166,7 +168,7 @@ BxTimelineView.prototype._getPosts = function(oElement, sAction) {
 	        		default:
 	        			$this.loadingInBlock(oElement, false);
 
-	        			oView.find('.bx-tl-items').bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
+	        			oView.find('.' + $this.sClassItems).bx_anim('hide', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
 			                $(this).html(sItems).show().bxTime();
 
 			                if($this.isMasonryEmpty()) {
@@ -184,10 +186,10 @@ BxTimelineView.prototype._getPosts = function(oElement, sAction) {
         	}
 
         	if(oData && oData.load_more != undefined)
-        		oView.find('.bx-tl-load-more-holder').html($.trim(oData.load_more));
+        		oView.find('.' + $this.sSP + '-load-more-holder').html($.trim(oData.load_more));
 
         	if(oData && oData.back != undefined)
-        		oView.find('.bx-tl-back-holder').html($.trim(oData.back));
+        		oView.find('.' + $this.sSP + '-back-holder').html($.trim(oData.back));
         },
         'json'
     );

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

@@ -0,0 +1,5 @@
+<a href="__link__" target="__target__" onclick="__onclick__" title="__title__">
+	<bx_if:icon><i class="sys-icon __icon__"></i></bx_if:icon>
+	<bx_if:image><img style="background-image:url(__icon_url__)" src="<bx_icon_url:spacer.gif />" /></bx_if:image>
+</a>
+<bx_if:addon>__addon__</bx_if:addon>

+ 1 - 1
modules/boonex/timeline/template/share_element_block.html

@@ -1,7 +1,7 @@
 <div id="__html_id__" class="__style_prefix__-share __class__ bx-def-margin-left-auto bx-clearfix" bx_share_data_count="__count__">
 	<div class="__style_prefix__-share-element-holder">__do_share__</div>
 	<bx_if:show_counter>
-		<div class="__style_prefix__-share-counter-holder bx-def-margin-sec-left">__counter__</div>
+		<div class="__style_prefix__-share-counter-holder bx-def-margin-sec-left"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
 	</bx_if:show_counter>
 </div>
 __script__

+ 8 - 0
studio/template/scripts/BxBaseStudioNavigationItems.php

@@ -492,6 +492,14 @@ class BxBaseStudioNavigationItems extends BxDolStudioNavigationItems
         return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
     }
 
+	protected function _getActionEdit ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if($sType == 'single' && (int)$aRow['editable'] == 0)
+            return '';
+
+        return  parent::_getActionDefault($sType, $sKey, $a, false, $isDisabled, $aRow);
+    }
+
     protected function _getActionDelete ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
         if ($sType == 'single' && $aRow['module'] == BX_DOL_STUDIO_MODULE_SYSTEM)

+ 5 - 0
template/menu_custom.html

@@ -0,0 +1,5 @@
+<ul id="bx-menu-custom" class="bx-menu-hor bx-menu-hor-inline bx-menu-object-__object__ bx-clearfix">
+    <bx_repeat:menu_items>
+        <li class="bx-def-margin-left-auto __class__">__item__</li>
+    </bx_repeat:menu_items>
+</ul>

+ 52 - 47
template/scripts/BxBaseMenu.php

@@ -68,60 +68,65 @@ class BxBaseMenu extends BxDolMenu
      */
     public function getMenuItems ()
     {
-        $aRet = array();
         if (!isset($this->_aObject['menu_items']))
             $this->_aObject['menu_items'] = $this->_oQuery->getMenuItems();
 
-        foreach ($this->_aObject['menu_items'] as $a) {
-
-            if (isset($a['active']) && !$a['active'])
-                continue;
-
-            if (isset($a['visible_for_levels']) && !$this->_isVisible($a))
-                continue;
-
-            $a['title'] = _t($a['title']);
-
-            $a = $this->_replaceMarkers($a);
-
-            $mixedAddon = $this->_getMenuAddon($a);
-            $this->addMarkers(array('addon' => $mixedAddon));
-
-            $a = $this->_replaceMarkers($a);
-
-            list ($sIcon, $sIconUrl) = $this->_getMenuIcon($a);
-
-            $a['class_add'] = $this->_isSelected($a) ? 'bx-menu-tab-active' : '';
-            $a['link'] = isset($a['link']) ? $this->_oPermalinks->permalink($a['link']) : 'javascript:void(0);';
-            $a['title_attr'] = bx_html_attribute($a['title']);
-            $a['bx_if:image'] = array (
-                'condition' => (bool)$sIconUrl,
-                'content' => array('icon_url' => $sIconUrl),
-            );
-            $a['bx_if:icon'] = array (
-                'condition' => (bool)$sIcon,
-                'content' => array('icon' => $sIcon),
-            );
-            $a['bx_if:title'] = array (
-                'condition' => (bool)$a['title'],
-                'content' => array('title' => $a['title']),
-            );
-
-            $a['bx_if:addon'] = array (
-                'condition' => (bool)$mixedAddon,
-                'content' => array('addon' => $mixedAddon),
-            );
-
-            foreach ($this->_aOptionalParams as $sName => $sDefaultValue)
-                if (!isset($a[$sName]))
-                    $a[$sName] = $sDefaultValue;
-
-            $aRet[] = $a;
+		$aItems = array();
+        foreach ($this->_aObject['menu_items'] as $aItem) {
+        	$aItem = $this->_getMenuItem ($aItem);
+        	if($aItem !== false)
+            	$aItems[] = $aItem;
         }
 
-        return $aRet;
+        return $aItems;
     }
 
+	protected function _getMenuItem ($a)
+	{
+		if (isset($a['active']) && !$a['active'])
+			return false;
+
+		if (isset($a['visible_for_levels']) && !$this->_isVisible($a))
+        	return false;
+
+		$a['title'] = _t($a['title']);
+
+		$a = $this->_replaceMarkers($a);
+
+		$mixedAddon = $this->_getMenuAddon($a);
+		$this->addMarkers(array('addon' => $mixedAddon));
+
+		$a = $this->_replaceMarkers($a);
+
+		list ($sIcon, $sIconUrl) = $this->_getMenuIcon($a);
+
+		$a['class_add'] = $this->_isSelected($a) ? 'bx-menu-tab-active' : '';
+		$a['link'] = isset($a['link']) ? $this->_oPermalinks->permalink($a['link']) : 'javascript:void(0);';
+		$a['title_attr'] = bx_html_attribute($a['title']);
+		$a['bx_if:image'] = array (
+			'condition' => (bool)$sIconUrl,
+			'content' => array('icon_url' => $sIconUrl),
+		);
+		$a['bx_if:icon'] = array (
+        	'condition' => (bool)$sIcon,
+            'content' => array('icon' => $sIcon),
+		);
+		$a['bx_if:title'] = array (
+			'condition' => (bool)$a['title'],
+			'content' => array('title' => $a['title']),
+		);
+		$a['bx_if:addon'] = array (
+			'condition' => (bool)$mixedAddon,
+			'content' => array('addon' => $mixedAddon),
+		);
+
+		foreach ($this->_aOptionalParams as $sName => $sDefaultValue)
+        	if (!isset($a[$sName]))
+            	$a[$sName] = $sDefaultValue;
+
+		return $a;
+	}
+
     protected function _getMenuIcon ($a)
     {
         $sIcon = false;

+ 4 - 0
template/scripts/BxBaseVote.php

@@ -164,6 +164,10 @@ class BxBaseVote extends BxDolVote
                 'condition' => isset($aParams['show_counter']) && $aParams['show_counter'] === true,
                 'content' => array(
                     'style_prefix' => $this->_sStylePrefix,
+        			'bx_if:show_hidden' => array(
+        				'condition' => (int)$aVote['count'] == 0,
+        				'content' => array()
+        			),
                     'counter' => $this->getCounter()
                 )
             ),

+ 1 - 1
template/vote_element_block.html

@@ -1,7 +1,7 @@
 <div id="__html_id__" class="__style_prefix__ __class__ bx-def-margin-left-auto bx-clearfix" bx_vote_data_rate="__rate__" bx_vote_data_count="__count__">
 	<div class="__style_prefix__-element-holder">__do_vote__</div>
 	<bx_if:show_counter>
-		<div class="__style_prefix__-counter-holder bx-def-margin-sec-left">__counter__</div>
+		<div class="__style_prefix__-counter-holder bx-def-margin-sec-left"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</div>
 	</bx_if:show_counter>
 </div>
 __script__

+ 1 - 1
template/vote_element_inline.html

@@ -1,4 +1,4 @@
 <span id="__html_id__" class="__style_prefix__ __class__" bx_vote_data_rate="__rate__" bx_vote_data_count="__count__">
-	<span class="__style_prefix__-element-holder">__do_vote__</span><bx_if:show_counter><span class="__style_prefix__-counter-holder bx-def-margin-sec-left">__counter__</span></bx_if:show_counter>
+	<span class="__style_prefix__-element-holder">__do_vote__</span><bx_if:show_counter><span class="__style_prefix__-counter-holder bx-def-margin-sec-left"<bx_if:show_hidden> style="display:none"</bx_if:show_hidden>>__counter__</span></bx_if:show_counter>
 </span>
 __script__