Bläddra i källkod

Merge branch 'master' of github.com:boonex/dolphin

Alex Trofimov 12 år sedan
förälder
incheckning
acfef8f2b6
24 ändrade filer med 502 tillägg och 42 borttagningar
  1. 19 1
      modules/base/general/classes/BxBaseModGeneralGridAdministration.php
  2. 38 0
      modules/base/general/classes/BxBaseModGeneralMenuManageTools.php
  3. 9 23
      modules/base/profile/classes/BxBaseModProfileGridAdministration.php
  4. 1 1
      modules/base/profile/classes/BxBaseModProfileGridModeration.php
  5. 2 15
      modules/base/profile/classes/BxBaseModProfileMenuManageTools.php
  6. 138 0
      modules/base/text/classes/BxBaseModTextGridAdministration.php
  7. 29 0
      modules/base/text/classes/BxBaseModTextGridModeration.php
  8. 25 0
      modules/base/text/classes/BxBaseModTextMenuManageTools.php
  9. 12 0
      modules/base/text/classes/BxBaseModTextModule.php
  10. 1 0
      modules/boonex/organizations/classes/BxOrgsConfig.php
  11. 1 0
      modules/boonex/organizations/install/langs/en.xml
  12. 1 0
      modules/boonex/persons/classes/BxPersonsConfig.php
  13. 1 0
      modules/boonex/persons/install/langs/en.xml
  14. 20 0
      modules/boonex/posts/classes/BxPostsConfig.php
  15. 23 0
      modules/boonex/posts/classes/BxPostsGridAdministration.php
  16. 23 0
      modules/boonex/posts/classes/BxPostsGridModeration.php
  17. 27 0
      modules/boonex/posts/classes/BxPostsMenuManageTools.php
  18. 1 0
      modules/boonex/posts/classes/BxPostsSearchResult.php
  19. 24 0
      modules/boonex/posts/install/langs/en.xml
  20. 4 0
      modules/boonex/posts/install/sql/disable.sql
  21. 58 2
      modules/boonex/posts/install/sql/enable.sql
  22. 1 0
      modules/boonex/posts/install/sql/install.sql
  23. 43 0
      modules/boonex/posts/js/manage_tools.js
  24. 1 0
      modules/boonex/posts/template/css/manage_tools.css

+ 19 - 1
modules/base/general/classes/BxBaseModGeneralGridAdministration.php

@@ -29,7 +29,25 @@ class BxBaseModGeneralGridAdministration extends BxTemplGrid
         $this->_sParamsDivider = '#-#';
         $this->_sParamsDivider = '#-#';
     }
     }
 
 
-    public function _getFilterSelectOne($sFilterName, $aFilterValues)
+    protected function _getActionSettings($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+    	$sJsObject = $this->_oModule->_oConfig->getJsObject('manage_tools');
+    	$sMenuName = $this->_oModule->_oConfig->CNF['OBJECT_MENU_MANAGE_TOOLS'];
+
+    	bx_import('BxDolMenu');
+    	$sMenu = BxDolMenu::getObjectInstance($sMenuName)->getCode();
+    	if(empty($sMenu))
+    		return '';
+
+    	$a['attr'] = array_merge($a['attr'], array(
+    		"bx-popup-id" => $sMenuName . "-" . $aRow['id'],
+    		"onclick" => "$(this).off('click'); " . $sJsObject . ".onClickSettings('" . $sMenuName . "', this);"
+    	));
+
+    	return $this->_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
+    }
+
+    protected function _getFilterSelectOne($sFilterName, $aFilterValues)
     {
     {
         if(empty($sFilterName) || empty($aFilterValues))
         if(empty($sFilterName) || empty($aFilterValues))
             return '';
             return '';

+ 38 - 0
modules/base/general/classes/BxBaseModGeneralMenuManageTools.php

@@ -0,0 +1,38 @@
+<?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    BaseGeneral Base classes for modules
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+bx_import('BxTemplMenu');
+
+/**
+ * Manage tools submenu
+ */
+class BxBaseModGeneralMenuManageTools extends BxTemplMenu
+{
+	protected $_oModule;
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+
+        $this->_oModule = BxDolModule::getInstance($this->MODULE);
+
+        $iContentId = 0;
+        if(bx_get('content_id') !== false)
+        	$iContentId = (int)bx_get('content_id');
+
+		$this->addMarkers(array(
+			'js_object' => $this->_oModule->_oConfig->getJsObject('manage_tools'),
+			'content_id' => $iContentId
+		));
+    }
+}
+
+/** @} */

+ 9 - 23
modules/base/profile/classes/BxBaseModProfileGridAdministration.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
  *
- * @defgroup    BaseGeneral Base classes for modules
+ * @defgroup    BaseProfile Base classes for profile modules
  * @ingroup     DolphinModules
  * @ingroup     DolphinModules
  * 
  * 
  * @{
  * @{
@@ -58,6 +58,8 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
 
 
 	public function performActionDelete($bWithContent = false)
 	public function performActionDelete($bWithContent = false)
     {
     {
+    	$sPrefixLang = $this->_oModule->_oConfig->getPrefix('lang');
+
     	if($bWithContent) {
     	if($bWithContent) {
 			$this->_echoResultJson(array('msg' => 'TODO: delete with content'));
 			$this->_echoResultJson(array('msg' => 'TODO: delete with content'));
 	    	return;
 	    	return;
@@ -88,7 +90,7 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
             $iAffected++;
             $iAffected++;
         }
         }
 
 
-        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t('_adm_nav_err_menus_delete')));
+        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($sPrefixLang . '_grid_action_err_delete')));
     }
     }
 
 
 	public function performActionDeleteWithContent()
 	public function performActionDeleteWithContent()
@@ -129,11 +131,13 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
     {
     {
         parent::_getFilterControls();
         parent::_getFilterControls();
 
 
+        $sPrefixLang = $this->_oModule->_oConfig->getPrefix('lang');
+
         $sFilterName = 'filter1';
         $sFilterName = 'filter1';
         $aFilterValues = array(
         $aFilterValues = array(
-			'active' => '_bx_persons_grid_filter_item_title_adm_active',
-            'pending' => '_bx_persons_grid_filter_item_title_adm_pending',
-            'suspended' => '_bx_persons_grid_filter_item_title_adm_suspended',
+			'active' => $sPrefixLang . '_grid_filter_item_title_adm_active',
+            'pending' => $sPrefixLang . '_grid_filter_item_title_adm_pending',
+            'suspended' => $sPrefixLang . '_grid_filter_item_title_adm_suspended',
 		);
 		);
 
 
         return  $this->_getFilterSelectOne($sFilterName, $aFilterValues) . $this->_getSearchInput();
         return  $this->_getFilterSelectOne($sFilterName, $aFilterValues) . $this->_getSearchInput();
@@ -153,24 +157,6 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
         return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
         return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
     }
     }
 
 
-    protected function _getActionSettings($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
-    {
-    	$sName = $this->_oModule->_oConfig->getName() . "_menu_manage_tools";
-    	$sJsObject = $this->_oModule->_oConfig->getJsObject('manage_tools');
-
-    	bx_import('BxDolMenu');
-    	$sMenu = BxDolMenu::getObjectInstance($sName)->getCode();
-    	if(empty($sMenu))
-    		return '';
-
-    	$a['attr'] = array_merge($a['attr'], array(
-    		"bx-popup-id" => $sName . "-" . $aRow['id'],
-    		"onclick" => "$(this).off('click'); " . $sJsObject . ".onClickSettings('" . $sName . "', this);"
-    	));
-
-    	return $this->_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
-    }
-
     protected function _getCellLastOnline($mixedValue, $sKey, $aField, $aRow)
     protected function _getCellLastOnline($mixedValue, $sKey, $aField, $aRow)
     {
     {
         return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
         return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);

+ 1 - 1
modules/base/profile/classes/BxBaseModProfileGridModeration.php

@@ -3,7 +3,7 @@
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  *
  *
- * @defgroup    BaseGeneral Base classes for modules
+ * @defgroup    BaseProfile Base classes for profile modules
  * @ingroup     DolphinModules
  * @ingroup     DolphinModules
  * 
  * 
  * @{
  * @{

+ 2 - 15
modules/base/profile/classes/BxBaseModProfileMenuManageTools.php

@@ -9,29 +9,16 @@
  * @{
  * @{
  */
  */
 
 
-bx_import('BxTemplMenu');
+bx_import('BxBaseModGeneralMenuManageTools');
 
 
 /**
 /**
  * Manage tools submenu
  * Manage tools submenu
  */
  */
-class BxBaseModProfileMenuManageTools extends BxTemplMenu
+class BxBaseModProfileMenuManageTools extends BxBaseModGeneralMenuManageTools
 {
 {
-	protected $_oModule;
-
     public function __construct($aObject, $oTemplate = false)
     public function __construct($aObject, $oTemplate = false)
     {
     {
         parent::__construct($aObject, $oTemplate);
         parent::__construct($aObject, $oTemplate);
-
-        $this->_oModule = BxDolModule::getInstance($this->MODULE);
-
-        $iContentId = 0;
-        if(bx_get('content_id') !== false)
-        	$iContentId = (int)bx_get('content_id');
-
-		$this->addMarkers(array(
-			'js_object' => $this->_oModule->_oConfig->getJsObject('manage_tools'),
-			'content_id' => $iContentId
-		));
     }
     }
 }
 }
 
 

+ 138 - 0
modules/base/text/classes/BxBaseModTextGridAdministration.php

@@ -0,0 +1,138 @@
+<?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    BaseText Base classes for text modules
+ * @ingroup     DolphinModules
+ * 
+ * @{
+ */
+
+bx_import('BxBaseModGeneralGridAdministration');
+
+class BxBaseModTextGridAdministration extends BxBaseModGeneralGridAdministration
+{
+	protected $_sFilter1;
+
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+
+    	$sFilter1 = bx_get('filter1');
+        if(!empty($sFilter1)) {
+            $this->_sFilter1 = bx_process_input($sFilter1);
+            $this->_aQueryAppend['filter1'] = $this->_sFilter1;
+        }
+    }
+
+	public function performActionDelete()
+    {
+    	$sPrefixLang = $this->_oModule->_oConfig->getPrefix('lang');
+
+        $iAffected = 0;
+        $aIds = bx_get('ids');
+        if(!$aIds || !is_array($aIds)) {
+            $this->_echoResultJson(array());
+            exit;
+        }
+
+        $aIdsAffected = array ();
+        foreach($aIds as $iId) {
+        	if((int)$this->_delete($iId) == 0)
+                continue;
+
+            $aIdsAffected[] = $iId;
+            $iAffected++;
+        }
+
+        $this->_echoResultJson($iAffected ? array('grid' => $this->getCode(false), 'blink' => $aIdsAffected) : array('msg' => _t($sPrefixLang . '_grid_action_err_delete')));
+    }
+
+    protected function _switcherChecked2State($isChecked)
+    {
+        return $isChecked ? 'active' : 'hidden';
+    }
+
+    protected function _switcherState2Checked($mixedState)
+    {
+        return 'active' == $mixedState ? true : false;
+    }
+
+    protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
+    {
+        if(strpos($sFilter, $this->_sParamsDivider) !== false)
+            list($this->_sFilter1, $sFilter) = explode($this->_sParamsDivider, $sFilter);
+
+    	if(!empty($this->_sFilter1))
+        	$this->_aOptions['source'] .= $this->_oModule->_oDb->prepare(" AND `status`=?", $this->_sFilter1);
+
+        return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
+    }
+
+    //--- Layout methods ---//
+	protected function _getFilterControls()
+    {
+        parent::_getFilterControls();
+
+        $sPrefixLang = $this->_oModule->_oConfig->getPrefix('lang');
+
+        $sFilterName = 'filter1';
+        $aFilterValues = array(
+			'active' => $sPrefixLang . '_grid_filter_item_title_adm_active',
+            'hidden' => $sPrefixLang . '_grid_filter_item_title_adm_hidden',
+		);
+
+        return  $this->_getFilterSelectOne($sFilterName, $aFilterValues) . $this->_getSearchInput();
+    }
+
+	protected function _getCellTitle($mixedValue, $sKey, $aField, $aRow)
+    {
+    	$CNF = &$this->_oModule->_oConfig->CNF;
+
+        bx_import('BxDolPermalinks');
+        $sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_VIEW_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]);
+
+        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
+            'href' => $sUrl,
+            'title' => $mixedValue,
+            'bx_repeat:attrs' => array(),
+            'content' => $mixedValue
+        ));
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellAdded($mixedValue, $sKey, $aField, $aRow)
+    {
+        return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
+    }
+
+    protected function _getCellAuthor($mixedValue, $sKey, $aField, $aRow)
+    {
+    	$oProfile = $this->_getProfileObject($aRow['author']);
+    	$sProfile = $oProfile->getDisplayName();
+
+        $mixedValue = $this->_oTemplate->parseHtmlByName('bx_a.html', array(
+            'href' => $oProfile->getUrl(),
+            'title' => $sProfile,
+            'bx_repeat:attrs' => array(),
+            'content' => $sProfile
+        ));
+
+        return parent::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
+    }
+
+    protected function _getProfileObject($iId)
+    {
+    	bx_import('BxDolProfile');
+        $oProfile = BxDolProfile::getInstance($iId);
+        if (!$oProfile) {
+            bx_import('BxDolProfileUndefined');
+            $oProfile = BxDolProfileUndefined::getInstance();
+        }
+        return $oProfile;
+    }
+}
+
+/** @} */

+ 29 - 0
modules/base/text/classes/BxBaseModTextGridModeration.php

@@ -0,0 +1,29 @@
+<?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    BaseText Base classes for text modules
+ * @ingroup     DolphinModules
+ * 
+ * @{
+ */
+
+bx_import('BxBaseModTextGridAdministration');
+
+class BxBaseModTextGridModeration extends BxBaseModTextGridAdministration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+        parent::__construct ($aOptions, $oTemplate);
+
+        $this->_sManageType = 'moderation';
+    }
+
+	public function performActionDelete()
+    {
+        $this->_echoResultJson(array());
+    }
+}
+
+/** @} */

+ 25 - 0
modules/base/text/classes/BxBaseModTextMenuManageTools.php

@@ -0,0 +1,25 @@
+<?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    BaseText Base classes for text modules
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+bx_import('BxBaseModGeneralMenuManageTools');
+
+/**
+ * Manage tools submenu
+ */
+class BxBaseModTextMenuManageTools extends BxBaseModGeneralMenuManageTools
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 12 - 0
modules/base/text/classes/BxBaseModTextModule.php

@@ -23,6 +23,18 @@ class BxBaseModTextModule extends BxBaseModGeneralModule
     }
     }
 
 
     // ====== SERVICE METHODS
     // ====== SERVICE METHODS
+	public function serviceGetMenuAddonManageTools()
+	{
+		bx_import('SearchResult', $this->_aModule);
+        $sClass = $this->_aModule['class_prefix'] . 'SearchResult';
+        $o = new $sClass();
+        $o->fillFilters(array(
+			'status' => 'hidden'
+        ));
+        $o->unsetPaginate();
+
+        return $o->getNum();
+	}
 
 
     /**
     /**
      * Display pablic entries
      * Display pablic entries

+ 1 - 0
modules/boonex/organizations/classes/BxOrgsConfig.php

@@ -80,6 +80,7 @@ class BxOrgsConfig extends BxBaseModProfileConfig
             'OBJECT_MENU_SUBMENU' => 'bx_organizations_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU' => 'bx_organizations_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_organizations_view_submenu',  // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_organizations_view_submenu',  // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'organizations-home', // first item in view entry submenu from main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'organizations-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_organizations_menu_manage_tools', //manage menu in content administration tools
             'OBJECT_GRID_ADMINISTRATION' => 'bx_organizations_administration',
             'OBJECT_GRID_ADMINISTRATION' => 'bx_organizations_administration',
         	'OBJECT_GRID_MODERATION' => 'bx_organizations_moderation',
         	'OBJECT_GRID_MODERATION' => 'bx_organizations_moderation',
 
 

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

@@ -141,6 +141,7 @@
     <string name="_bx_orgs_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
     <string name="_bx_orgs_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
     <string name="_bx_orgs_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
     <string name="_bx_orgs_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
     <string name="_bx_orgs_grid_action_title_adm_set_acl_level"><![CDATA[Set Membership]]></string>
     <string name="_bx_orgs_grid_action_title_adm_set_acl_level"><![CDATA[Set Membership]]></string>
+	<string name="_bx_orgs_grid_action_err_delete"><![CDATA[Cannot delete the selected organization(s).]]></string>
 
 
     <string name="_bx_orgs_txt_account_pending"><![CDATA[This profile is pending approval, please wait until it is activated.]]></string>
     <string name="_bx_orgs_txt_account_pending"><![CDATA[This profile is pending approval, please wait until it is activated.]]></string>
     <string name="_bx_orgs_txt_account_suspended"><![CDATA[This profile is suspended.]]></string>
     <string name="_bx_orgs_txt_account_suspended"><![CDATA[This profile is suspended.]]></string>

+ 1 - 0
modules/boonex/persons/classes/BxPersonsConfig.php

@@ -80,6 +80,7 @@ class BxPersonsConfig extends BxBaseModProfileConfig
             'OBJECT_MENU_SUBMENU' => 'bx_persons_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU' => 'bx_persons_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_persons_view_submenu',  // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_persons_view_submenu',  // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'persons-home', // first item in view entry submenu from main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'persons-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_persons_menu_manage_tools', //manage menu in content administration tools
             'OBJECT_GRID_ADMINISTRATION' => 'bx_persons_administration',
             'OBJECT_GRID_ADMINISTRATION' => 'bx_persons_administration',
         	'OBJECT_GRID_MODERATION' => 'bx_persons_moderation',
         	'OBJECT_GRID_MODERATION' => 'bx_persons_moderation',
 
 

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

@@ -141,6 +141,7 @@
     <string name="_bx_persons_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
     <string name="_bx_persons_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
     <string name="_bx_persons_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
     <string name="_bx_persons_grid_action_title_adm_delete_with_content"><![CDATA[Delete With Content]]></string>
     <string name="_bx_persons_grid_action_title_adm_set_acl_level"><![CDATA[Set Membership]]></string>
     <string name="_bx_persons_grid_action_title_adm_set_acl_level"><![CDATA[Set Membership]]></string>
+    <string name="_bx_persons_grid_action_err_delete"><![CDATA[Cannot delete the selected person(s).]]></string>
 
 
     <string name="_bx_persons_txt_account_pending"><![CDATA[This profile is pending approval, please wait until it is activated.]]></string>
     <string name="_bx_persons_txt_account_pending"><![CDATA[This profile is pending approval, please wait until it is activated.]]></string>
     <string name="_bx_persons_txt_account_suspended"><![CDATA[This profile is suspended.]]></string>
     <string name="_bx_persons_txt_account_suspended"><![CDATA[This profile is suspended.]]></string>

+ 20 - 0
modules/boonex/posts/classes/BxPostsConfig.php

@@ -66,6 +66,9 @@ class BxPostsConfig extends BxBaseModTextConfig
             'OBJECT_MENU_SUBMENU' => 'bx_posts_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU' => 'bx_posts_submenu', // main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_posts_view_submenu', // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_posts_view_submenu', // view entry submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'posts-home', // first item in view entry submenu from main module submenu
             'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'posts-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_posts_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_posts_administration',
+        	'OBJECT_GRID_MODERATION' => 'bx_posts_moderation',
 
 
             // menu items which visibility depends on custom visibility checking
             // menu items which visibility depends on custom visibility checking
             'MENU_ITEM_TO_METHOD' => array (
             'MENU_ITEM_TO_METHOD' => array (
@@ -85,6 +88,23 @@ class BxPostsConfig extends BxBaseModTextConfig
             ),
             ),
         );
         );
 
 
+        $this->_aPrefixes = array(
+        	'lang' => '_bx_posts'
+        );
+
+        $this->_aJsClass = array(
+        	'manage_tools' => 'BxPostsManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'manage_tools' => 'oBxPostsManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'moderation' => $this->CNF['OBJECT_GRID_MODERATION'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
     }
     }
 }
 }
 
 

+ 23 - 0
modules/boonex/posts/classes/BxPostsGridAdministration.php

@@ -0,0 +1,23 @@
+<?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    Posts Posts
+ * @ingroup     DolphinModules
+ * 
+ * @{
+ */
+
+bx_import('BxBaseModTextGridAdministration');
+
+class BxPostsGridAdministration extends BxBaseModTextGridAdministration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_posts';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 23 - 0
modules/boonex/posts/classes/BxPostsGridModeration.php

@@ -0,0 +1,23 @@
+<?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    Posts Posts
+ * @ingroup     DolphinModules
+ * 
+ * @{
+ */
+
+bx_import('BxBaseModTextGridModeration');
+
+class BxPostsGridModeration extends BxBaseModTextGridModeration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_posts';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/posts/classes/BxPostsMenuManageTools.php

@@ -0,0 +1,27 @@
+<?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    Posts Posts
+ * @ingroup     DolphinModules
+ *
+ * @{
+ */
+
+bx_import('BxBaseModTextMenuManageTools');
+
+/**
+ * 'Posts manage tools' menu.
+ */
+class BxPostsMenuManageTools extends BxBaseModTextMenuManageTools
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_posts';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 1 - 0
modules/boonex/posts/classes/BxPostsSearchResult.php

@@ -26,6 +26,7 @@ class BxPostsSearchResult extends BxBaseModTextSearchResult
             'searchFields' => array('title', 'text'),
             'searchFields' => array('title', 'text'),
             'restriction' => array(
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
+        		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
             ),
             ),
             'paginate' => array('perPage' => getParam('bx_posts_per_page_browse'), 'start' => 0),
             'paginate' => array('perPage' => getParam('bx_posts_per_page_browse'), 'start' => 0),
             'sorting' => 'last',
             'sorting' => 'last',

+ 24 - 0
modules/boonex/posts/install/langs/en.xml

@@ -70,6 +70,12 @@
     <string name="_bx_posts_page_block_title_entries_of_author"><![CDATA[Posts of author]]></string>   
     <string name="_bx_posts_page_block_title_entries_of_author"><![CDATA[Posts of author]]></string>   
     <string name="_bx_posts_page_block_title_entries_actions"><![CDATA[Posts actions]]></string>
     <string name="_bx_posts_page_block_title_entries_actions"><![CDATA[Posts actions]]></string>
     <string name="_bx_posts_page_block_title_browse_cmts"><![CDATA[Posts' Comments]]></string>
     <string name="_bx_posts_page_block_title_browse_cmts"><![CDATA[Posts' Comments]]></string>
+	<string name="_bx_posts_page_title_sys_moderation"><![CDATA[Posts Moderation]]></string>
+	<string name="_bx_posts_page_title_moderation"><![CDATA[Posts Moderation]]></string>
+	<string name="_bx_posts_page_title_sys_administration"><![CDATA[Posts Administration]]></string>
+	<string name="_bx_posts_page_title_administration"><![CDATA[Posts Administration]]></string>
+	<string name="_bx_posts_page_block_title_moderation"><![CDATA[Posts Moderation]]></string>
+	<string name="_bx_posts_page_block_title_administration"><![CDATA[Posts Administration]]></string>    
 
 
     <string name="_bx_posts_menu_set_title_view_entry"><![CDATA[View Post]]></string>
     <string name="_bx_posts_menu_set_title_view_entry"><![CDATA[View Post]]></string>
     <string name="_bx_posts_menu_title_view_entry"><![CDATA[View Post]]></string>
     <string name="_bx_posts_menu_title_view_entry"><![CDATA[View Post]]></string>
@@ -86,6 +92,10 @@
     <string name="_bx_posts_menu_item_title_entries_home"><![CDATA[Posts]]></string>
     <string name="_bx_posts_menu_item_title_entries_home"><![CDATA[Posts]]></string>
     <string name="_bx_posts_menu_item_title_system_entries_public"><![CDATA[Public]]></string>
     <string name="_bx_posts_menu_item_title_system_entries_public"><![CDATA[Public]]></string>
     <string name="_bx_posts_menu_item_title_entries_public"><![CDATA[Public]]></string>
     <string name="_bx_posts_menu_item_title_entries_public"><![CDATA[Public]]></string>
+    <string name="_bx_posts_menu_item_title_system_entries_moderation"><![CDATA[Moderation]]></string>
+    <string name="_bx_posts_menu_item_title_entries_moderation"><![CDATA[Moderation]]></string>
+    <string name="_bx_posts_menu_item_title_system_entries_administration"><![CDATA[Administration]]></string>
+    <string name="_bx_posts_menu_item_title_entries_administration"><![CDATA[Administration]]></string>
     <string name="_bx_posts_menu_item_title_system_entries_featured"><![CDATA[Featured]]></string>
     <string name="_bx_posts_menu_item_title_system_entries_featured"><![CDATA[Featured]]></string>
     <string name="_bx_posts_menu_item_title_entries_featured"><![CDATA[Featured]]></string>
     <string name="_bx_posts_menu_item_title_entries_featured"><![CDATA[Featured]]></string>
     <string name="_bx_posts_menu_title_view_entry_submenu"><![CDATA[View Post Submenu]]></string>
     <string name="_bx_posts_menu_title_view_entry_submenu"><![CDATA[View Post Submenu]]></string>
@@ -97,6 +107,20 @@
     <string name="_bx_posts_menu_item_title_view_entries_author"><![CDATA[Posts]]></string>
     <string name="_bx_posts_menu_item_title_view_entries_author"><![CDATA[Posts]]></string>
     <string name="_bx_posts_menu_title_entries_my"><![CDATA[My Posts Action Menu]]></string>
     <string name="_bx_posts_menu_title_entries_my"><![CDATA[My Posts Action Menu]]></string>
     <string name="_bx_posts_menu_set_title_entries_my"><![CDATA[My Posts Menu]]></string>
     <string name="_bx_posts_menu_set_title_entries_my"><![CDATA[My Posts Menu]]></string>
+    <string name="_bx_posts_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_posts_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+	<string name="_bx_posts_menu_item_title_system_admt_posts"><![CDATA[Posts]]></string>
+	<string name="_bx_posts_menu_item_title_admt_posts"><![CDATA[{addon} hidden post(s)]]></string> 
+
+	<string name="_bx_posts_grid_filter_item_title_adm_select_one"><![CDATA[Select Status...]]></string>
+	<string name="_bx_posts_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_posts_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+	<string name="_bx_posts_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_posts_grid_column_title_adm_title"><![CDATA[Title]]></string>
+    <string name="_bx_posts_grid_column_title_adm_added"><![CDATA[Added]]></string>
+    <string name="_bx_posts_grid_column_title_adm_author"><![CDATA[Author]]></string>
+    <string name="_bx_posts_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_posts_grid_action_err_delete"><![CDATA[Cannot delete the selected post(s).]]></string>
 
 
     <string name="_bx_posts_txt_sample_single"><![CDATA[post]]></string>
     <string name="_bx_posts_txt_sample_single"><![CDATA[post]]></string>
     <string name="_bx_posts_txt_sample_comment_single"><![CDATA[post's comment]]></string>
     <string name="_bx_posts_txt_sample_comment_single"><![CDATA[post's comment]]></string>

+ 4 - 0
modules/boonex/posts/install/sql/disable.sql

@@ -28,3 +28,7 @@ DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_posts', 'bx_posts_cm
 -- METATAGS
 -- METATAGS
 DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_posts';
 DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_posts';
 
 
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_posts_administration', 'bx_posts_moderation');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_posts_administration', 'bx_posts_moderation');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_posts_administration', 'bx_posts_moderation');

+ 58 - 2
modules/boonex/posts/install/sql/enable.sql

@@ -91,6 +91,22 @@ INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `lay
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
 ('bx_posts_home', 1, 'bx_posts', '_bx_posts_page_block_title_recent_entries', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_public\";}', 0, 1, 0);
 ('bx_posts_home', 1, 'bx_posts', '_bx_posts_page_block_title_recent_entries', 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:13:\"browse_public\";}', 0, 1, 0);
 
 
+-- PAGE: module moderation
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_moderation', '_bx_posts_page_title_sys_moderation', '_bx_posts_page_title_moderation', 'bx_posts', 5, 64, 1, 'posts-moderation', 'page.php?i=posts-moderation', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_moderation', 1, 'bx_posts', '_bx_posts_page_block_title_moderation', 11, 64, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:10:\"moderation\";}}', 0, 1, 0);
+
+-- PAGE: module administration
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_administration', '_bx_posts_page_title_sys_administration', '_bx_posts_page_title_administration', 'bx_posts', 5, 128, 1, 'posts-administration', 'page.php?i=posts-administration', '', '', '', 0, 1, 0, 'BxPostsPageBrowse', 'modules/boonex/posts/classes/BxPostsPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_posts_administration', 1, 'bx_posts', '_bx_posts_page_block_title_administration', 11, 128, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_posts\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
 -- PAGE: add block to homepage
 -- PAGE: add block to homepage
 
 
 SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
 SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
@@ -146,8 +162,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_posts_submenu', 'bx_posts', 'posts-home', '_bx_posts_menu_item_title_system_entries_public', '_bx_posts_menu_item_title_entries_public', 'page.php?i=posts-home', '', '', '', '', 2147483647, 1, 1, 1),
 ('bx_posts_submenu', 'bx_posts', 'posts-home', '_bx_posts_menu_item_title_system_entries_public', '_bx_posts_menu_item_title_entries_public', 'page.php?i=posts-home', '', '', '', '', 2147483647, 1, 1, 1),
-('bx_posts_submenu', 'bx_posts', 'posts-featured', '_bx_posts_menu_item_title_system_entries_featured', '_bx_posts_menu_item_title_entries_featured', 'page.php?i=posts-featured', '', '', '', '', 2147483647, 1, 1, 2);
-
+('bx_posts_submenu', 'bx_posts', 'posts-featured', '_bx_posts_menu_item_title_system_entries_featured', '_bx_posts_menu_item_title_entries_featured', 'page.php?i=posts-featured', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_posts_submenu', 'bx_posts', 'posts-moderation', '_bx_posts_menu_item_title_system_entries_moderation', '_bx_posts_menu_item_title_entries_moderation', 'page.php?i=posts-moderation', '', '', '', '', 64, 1, 1, 3),
+('bx_posts_submenu', 'bx_posts', 'posts-administration', '_bx_posts_menu_item_title_system_entries_administration', '_bx_posts_menu_item_title_entries_administration', 'page.php?i=posts-administration', '', '', '', '', 128, 1, 1, 4);
 
 
 -- MENU: sub-menu for view entry
 -- MENU: sub-menu for view entry
 
 
@@ -161,6 +178,22 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_posts_view_submenu', 'bx_posts', 'view-post', '_bx_posts_menu_item_title_system_view_entry', '_bx_posts_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-post&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
 ('bx_posts_view_submenu', 'bx_posts', 'view-post', '_bx_posts_menu_item_title_system_view_entry', '_bx_posts_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-post&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
 ('bx_posts_view_submenu', 'bx_posts', 'view-post-comments', '_bx_posts_menu_item_title_system_view_entry_comments', '_bx_posts_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-post-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2);
 ('bx_posts_view_submenu', 'bx_posts', 'view-post-comments', '_bx_posts_menu_item_title_system_view_entry_comments', '_bx_posts_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-post-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2);
 
 
+-- MENU: manage tools submenu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_posts_menu_manage_tools', '_bx_posts_menu_title_manage_tools', 'bx_posts_menu_manage_tools', 'bx_posts', 6, 0, 1, 'BxPostsMenuManageTools', 'modules/boonex/posts/classes/BxPostsMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_posts_menu_manage_tools', 'bx_posts', '_bx_posts_menu_set_title_manage_tools', 0);
+
+--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_posts_menu_manage_tools', 'bx_posts', 'delete-with-content', '_bx_posts_menu_item_title_system_delete_with_content', '_bx_posts_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 128, 1, 0, 0);
+
+-- MENU: dashboard manage tools
+
+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 
+('sys_account_dashboard_manage_tools', 'bx_posts', 'posts-moderation', '_bx_posts_menu_item_title_system_admt_posts', '_bx_posts_menu_item_title_admt_posts', 'page.php?i=posts-moderation', '', '_self', '', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 64, 1, 0, 1),
+('sys_account_dashboard_manage_tools', 'bx_posts', 'posts-administration', '_bx_posts_menu_item_title_system_admt_posts', '_bx_posts_menu_item_title_admt_posts', 'page.php?i=posts-administration', '', '_self', '', 'a:2:{s:6:"module";s:8:"bx_posts";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 128, 1, 0, 1);
 
 
 -- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
 -- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
 
 
@@ -250,3 +283,26 @@ INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `ClassName`, `ClassPath
 INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
 INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
 ('bx_posts', 'bx_posts_meta_keywords', 'bx_posts_meta_locations', '', '', '');
 ('bx_posts', 'bx_posts_meta_keywords', 'bx_posts_meta_locations', '', '', '');
 
 
+-- GRIDS: administration
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `override_class_name`, `override_class_file`) VALUES
+('bx_posts_administration', 'Sql', 'SELECT * FROM `bx_posts_posts` WHERE 1 ', 'bx_posts_posts', 'id', '', 'status', '', 100, NULL, 'start', '', 'title,text', '', 'like', '', '', 'BxPostsGridAdministration', 'modules/boonex/posts/classes/BxPostsGridAdministration.php'),
+('bx_posts_moderation', 'Sql', 'SELECT * FROM `bx_posts_posts` WHERE 1 ', 'bx_posts_posts', 'id', '', 'status', '', 100, NULL, 'start', '', 'title,text', '', 'like', '', '', 'BxPostsGridModeration', 'modules/boonex/posts/classes/BxPostsGridModeration.php');
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_posts_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_posts_administration', 'switcher', '_bx_posts_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_posts_administration', 'title', '_bx_posts_grid_column_title_adm_title', '25%', 0, '', '', 3),
+('bx_posts_administration', 'added', '_bx_posts_grid_column_title_adm_added', '20%', 1, '25', '', 4),
+('bx_posts_administration', 'author', '_bx_posts_grid_column_title_adm_author', '25%', 0, '25', '', 5),
+('bx_posts_administration', 'actions', '', '20%', 0, '', '', 6),
+('bx_posts_moderation', 'switcher', '', '10%', 0, '', '', 1),
+('bx_posts_moderation', 'title', '_bx_posts_grid_column_title_adm_title', '25%', 0, '', '', 2),
+('bx_posts_moderation', 'added', '_bx_posts_grid_column_title_adm_added', '25%', 1, '25', '', 3),
+('bx_posts_moderation', 'author', '_bx_posts_grid_column_title_adm_author', '25%', 0, '25', '', 4),
+('bx_posts_moderation', 'actions', '', '15%', 0, '', '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
+('bx_posts_administration', 'bulk', 'delete', '_bx_posts_grid_action_title_adm_delete', '', 1, 2),
+('bx_posts_administration', 'single', 'delete', '', 'remove', 1, 2),
+('bx_posts_administration', 'single', 'settings', '', 'cog', 0, 3),
+('bx_posts_moderation', 'single', 'settings', '', 'cog', 0, 1);

+ 1 - 0
modules/boonex/posts/install/sql/install.sql

@@ -14,6 +14,7 @@ CREATE TABLE IF NOT EXISTS `bx_posts_posts` (
   `votes` int(11) NOT NULL default '0',
   `votes` int(11) NOT NULL default '0',
   `comments` int(11) NOT NULL default '0',
   `comments` int(11) NOT NULL default '0',
   `allow_view_to` int(11) NOT NULL DEFAULT '3',
   `allow_view_to` int(11) NOT NULL DEFAULT '3',
+  `status` enum('active','hidden') NOT NULL DEFAULT 'active',
   PRIMARY KEY (`id`),
   PRIMARY KEY (`id`),
   FULLTEXT KEY `title_text` (`title`,`text`)
   FULLTEXT KEY `title_text` (`title`,`text`)
 );
 );

+ 43 - 0
modules/boonex/posts/js/manage_tools.js

@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinStudio Dolphin Studio
+ * @{
+ */
+
+function BxPostsManageTools(oOptions) {
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxPostsManageTools' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxPostsManageTools.prototype.onChangeFilter = function(oFilter) {
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+	glGrids[this._sObjNameGrid].setFilter(sValueFilter1 + this._sParamsDivider + sValueSearch, true);
+};
+
+BxPostsManageTools.prototype.onClickSettings = function(sMenuObject, oButton) {
+	if($(oButton).hasClass('bx-btn-disabled'))
+		return false;
+
+	bx_menu_popup(sMenuObject, oButton, {}, {
+		content_id: $(oButton).attr('bx_grid_action_data')
+	});
+};
+
+/** @} */

+ 1 - 0
modules/boonex/posts/template/css/manage_tools.css

@@ -0,0 +1 @@
+@import url(../../../../base/general/template/css/manage_tools.css);