HomeHelpTrac

Changeset 13816


Ignore:
Timestamp:
03/22/10 03:38:14 (23 months ago)
Author:
Anton Lesnikov
Message:

Ticket #1927

Location:
trunk/modules/boonex
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/boonex/articles/admin.php

    r13348 r13816  
    5050 
    5151if(isset($_POST['alr-publish']))  
    52     $oArticles->actionPublish($_POST['alr-ids'], true); 
     52    $oArticles->_actPublish($_POST['alr-ids'], true); 
    5353else if(isset($_POST['alr-unpublish']))  
    54     $oArticles->actionPublish($_POST['alr-ids'], false); 
     54    $oArticles->_actPublish($_POST['alr-ids'], false); 
    5555else if(isset($_POST['alr-featured']))  
    56     $oArticles->actionFeatured($_POST['alr-ids'], true); 
     56    $oArticles->_actFeatured($_POST['alr-ids'], true); 
    5757else if(isset($_POST['alr-unfeatured']))  
    58     $oArticles->actionFeatured($_POST['alr-ids'], false); 
     58    $oArticles->_actFeatured($_POST['alr-ids'], false); 
    5959else if(isset($_POST['alr-delete']))  
    60     $oArticles->actionDelete($_POST['alr-ids']); 
     60    $oArticles->_actDelete($_POST['alr-ids']); 
    6161//--- Process actions ---// 
    6262 
  • trunk/modules/boonex/articles/classes/BxArlModule.php

    r13781 r13816  
    466466        )); 
    467467    } 
    468     function actionFeatured($aIds, $bPositive = true) {      
     468    function actionFeatured() { 
     469        $iId = (int)$_POST['id']; 
     470 
     471        return !empty($iId) ? $this->_actFeatured($iId) : false; 
     472    } 
     473    function actionPublish() { 
     474        $iId = (int)$_POST['id']; 
     475 
     476        return !empty($iId) ? $this->_actPublish($iId) : false; 
     477    } 
     478    function actionDelete() { 
     479        $iId = (int)$_POST['id']; 
     480 
     481        return !empty($iId) ? $this->_actDelete($iId) : false; 
     482    } 
     483 
     484    function _actFeatured($aIds, $bPositive = true) {        
    469485        if(!isAdmin())  
    470486            return false; 
    471                  
     487 
     488        if(is_int($aIds) || is_string($aIds)) 
     489            $aIds = array((int)$aIds); 
     490 
    472491        $bResult = $this->_oDb->updateArticles($aIds, array('featured' => ($bPositive ? 1 : 0))); 
    473492        if($bResult) 
     
    482501        return $bResult; 
    483502    } 
    484     function actionDelete($aIds) {       
     503    function _actPublish($aIds, $bPositive = true) { 
     504        if(!isAdmin())  
     505            return false; 
     506 
     507        if(is_int($aIds) || is_string($aIds)) 
     508            $aIds = array((int)$aIds); 
     509 
     510        $bResult = $this->_oDb->updateArticles($aIds, array('status' => ($bPositive ? BX_TD_STATUS_ACTIVE : BX_TD_STATUS_INACTIVE))); 
     511        if($bResult) 
     512            foreach($aIds as $iId) { 
     513                //--- Articles -> Publish/Unpublish for Alerts Engine ---// 
     514                $oAlert = new BxDolAlerts('bx_' . $this->_oConfig->getUri(), ($bPositive ? 'publish' : 'unpublish'), $iId, BxDolTextData::getAuthorId()); 
     515                $oAlert->alert(); 
     516                //--- Articles -> Publish/Unpublish for Alerts Engine ---// 
     517                 
     518                //--- Reparse Global Tags ---// 
     519                $oTags = new BxDolTags(); 
     520                $oTags->reparseObjTags('bx_' . $this->_oConfig->getUri(), $iId); 
     521                //--- Reparse Global Tags ---// 
     522                 
     523                //--- Reparse Global Categories ---//             
     524                $oCategories = new BxDolCategories(); 
     525                $oCategories->reparseObjTags('bx_' . $this->_oConfig->getUri(), $iId); 
     526                //--- Reparse Global Categories ---// 
     527            } 
     528         
     529        return $bResult; 
     530    } 
     531    function _actDelete($aIds) {         
    485532        if(!$this->_isDeleteAllowed(true))  
    486533            return false; 
     
    516563        return $bResult; 
    517564    } 
    518     function actionPublish($aIds, $bPositive = true) { 
    519         if(!isAdmin())  
    520             return false; 
    521          
    522         $bResult = $this->_oDb->updateArticles($aIds, array('status' => ($bPositive ? BX_TD_STATUS_ACTIVE : BX_TD_STATUS_INACTIVE))); 
    523         if($bResult) 
    524             foreach($aIds as $iId) { 
    525                 //--- Articles -> Publish/Unpublish for Alerts Engine ---// 
    526                 $oAlert = new BxDolAlerts('bx_' . $this->_oConfig->getUri(), ($bPositive ? 'publish' : 'unpublish'), $iId, BxDolTextData::getAuthorId()); 
    527                 $oAlert->alert(); 
    528                 //--- Articles -> Publish/Unpublish for Alerts Engine ---// 
    529                  
    530                 //--- Reparse Global Tags ---// 
    531                 $oTags = new BxDolTags(); 
    532                 $oTags->reparseObjTags('bx_' . $this->_oConfig->getUri(), $iId); 
    533                 //--- Reparse Global Tags ---// 
    534                  
    535                 //--- Reparse Global Categories ---//             
    536                 $oCategories = new BxDolCategories(); 
    537                 $oCategories->reparseObjTags('bx_' . $this->_oConfig->getUri(), $iId); 
    538                 //--- Reparse Global Categories ---// 
    539             } 
    540          
    541         return $bResult; 
    542     } 
    543      
    544565    function _isDeleteAllowed($bPerform = false) { 
    545566        if(!isLogged()) 
  • trunk/modules/boonex/articles/js/main.js

    r12565 r13816  
    2727    var $this = this; 
    2828     
    29     $.get( 
    30         this._sActionsUrl + "act_delete/" + iId, 
    31         {}, 
     29    $.post( 
     30        this._sActionsUrl + "act_delete/", 
     31        {id:iId}, 
    3232        function(sData) { 
    3333            var iCode = parseInt(sData); 
  • trunk/modules/boonex/feedback/admin.php

    r13348 r13816  
    5050 
    5151if(isset($_POST['feedback-approve']))  
    52     $oFeedback->actionApprove($_POST['feedback-ids'], true); 
     52    $oFeedback->_actApprove($_POST['feedback-ids'], true); 
    5353else if(isset($_POST['feedback-reject']))  
    54     $oFeedback->actionApprove($_POST['feedback-ids'], false); 
     54    $oFeedback->_actApprove($_POST['feedback-ids'], false); 
    5555else if(isset($_POST['feedback-delete']))  
    56     $oFeedback->actionDelete($_POST['feedback-ids']); 
     56    $oFeedback->_actDelete($_POST['feedback-ids']); 
    5757//--- Process actions ---// 
    5858 
  • trunk/modules/boonex/feedback/classes/BxFdbModule.php

    r13778 r13816  
    353353        )); 
    354354    } 
    355     function actionDelete($aIds) { 
    356         if(is_int($aIds) || is_string($aIds)) { 
    357             $aFeedback = $this->_oDb->getFeedback(array('sample_type' => 'id', 'id' => (int)$aIds)); 
    358             if(!$this->_isDeleteAllowed($aFeedback['author_id'], true))  
    359                 return false; 
    360  
    361             $aIds = array((int)$aIds); 
    362         } 
    363         else if(!$this->_isDeleteAllowed())  
    364             return false; 
    365                  
    366         $bResult = $this->_oDb->deleteFeedback($aIds); 
    367         if($bResult) 
    368             foreach($aIds as $iId) { 
    369                 //--- Feedback -> Delete for Alerts Engine ---// 
    370                 bx_import('BxDolAlerts'); 
    371                 $oAlert = new BxDolAlerts('bx_' . $this->_oConfig->getUri(), 'delete', $iId, BxDolTextData::getAuthorId()); 
    372                 $oAlert->alert(); 
    373                 //--- Feedback -> Delete for Alerts Engine ---// 
    374                  
    375                 //--- Reparse Global Tags ---// 
    376                 bx_import('BxDolTags'); 
    377                 $oTags = new BxDolTags(); 
    378                 $oTags->reparseObjTags('bx_feedback', $iId); 
    379                 //--- Reparse Global Tags ---// 
    380             } 
    381  
    382         return $bResult; 
    383     } 
    384     function actionApprove($aIds, $bPositive = true) { 
     355    function actionApprove() { 
     356        $iId = (int)$_POST['id']; 
     357 
     358        return !empty($iId) ? $this->_actApprove($iId) : false; 
     359    } 
     360    function actionDelete() { 
     361        $iId = (int)$_POST['id']; 
     362 
     363        return !empty($iId) ? $this->_actDelete($iId) : false; 
     364    } 
     365     
     366    function _actApprove($aIds, $bPositive = true) { 
    385367        if(!isAdmin())  
    386368            return false; 
    387          
     369 
     370        if(is_int($aIds) || is_string($aIds)) 
     371            $aIds = array((int)$aIds); 
     372 
    388373        $bResult = $this->_oDb->updateFeedback($aIds, array('status' => ($bPositive ? BX_FDB_STATUS_ACTIVE : BX_FDB_STATUS_REJECTED))); 
    389374        if($bResult) 
     
    404389        return $bResult; 
    405390    } 
    406  
     391    function _actDelete($aIds) { 
     392        if(is_int($aIds) || is_string($aIds)) { 
     393            $aFeedback = $this->_oDb->getFeedback(array('sample_type' => 'id', 'id' => (int)$aIds)); 
     394            if(!$this->_isDeleteAllowed($aFeedback['author_id'], true))  
     395                return false; 
     396 
     397            $aIds = array((int)$aIds); 
     398        } 
     399        else if(!$this->_isDeleteAllowed(0, true))  
     400            return false; 
     401 
     402        $bResult = $this->_oDb->deleteFeedback($aIds); 
     403        if($bResult) 
     404            foreach($aIds as $iId) { 
     405                //--- Feedback -> Delete for Alerts Engine ---// 
     406                bx_import('BxDolAlerts'); 
     407                $oAlert = new BxDolAlerts('bx_' . $this->_oConfig->getUri(), 'delete', $iId, BxDolTextData::getAuthorId()); 
     408                $oAlert->alert(); 
     409                //--- Feedback -> Delete for Alerts Engine ---// 
     410                 
     411                //--- Reparse Global Tags ---// 
     412                bx_import('BxDolTags'); 
     413                $oTags = new BxDolTags(); 
     414                $oTags->reparseObjTags('bx_feedback', $iId); 
     415                //--- Reparse Global Tags ---// 
     416            } 
     417 
     418        return $bResult; 
     419    } 
    407420    function _isDeleteAllowed($iAuthorId = 0, $bPerform = false) { 
    408421        if(!isLogged()) 
  • trunk/modules/boonex/feedback/js/main.js

    r12565 r13816  
    2626BxFeedbackMain.prototype.deleteFeedback = function(iId) { 
    2727    var $this = this; 
    28      
    29     $.get( 
    30         this._sActionsUrl + "act_delete/" + iId, 
    31         {}, 
     28 
     29    $.post( 
     30        this._sActionsUrl + "act_delete/", 
     31        {id:iId}, 
    3232        function(sData) { 
    3333            var iCode = parseInt(sData); 
  • trunk/modules/boonex/news/admin.php

    r13348 r13816  
    5050 
    5151if(isset($_POST['news-publish']))  
    52     $oNews->actionPublish($_POST['news-ids'], true); 
     52    $oNews->_actPublish($_POST['news-ids'], true); 
    5353else if(isset($_POST['news-unpublish']))  
    54     $oNews->actionPublish($_POST['news-ids'], false); 
     54    $oNews->_actPublish($_POST['news-ids'], false); 
    5555else if(isset($_POST['news-featured']))  
    56     $oNews->actionFeatured($_POST['news-ids'], true); 
     56    $oNews->_actFeatured($_POST['news-ids'], true); 
    5757else if(isset($_POST['news-unfeatured']))  
    58     $oNews->actionFeatured($_POST['news-ids'], false); 
     58    $oNews->_actFeatured($_POST['news-ids'], false); 
    5959else if(isset($_POST['news-delete']))  
    60     $oNews->actionDelete($_POST['news-ids']); 
     60    $oNews->_actDelete($_POST['news-ids']); 
    6161//--- Process actions ---// 
    6262 
  • trunk/modules/boonex/news/classes/BxNewsModule.php

    r13781 r13816  
    471471        )); 
    472472    } 
    473     function actionFeatured($aIds, $bPositive = true) {      
     473    function actionFeatured() { 
     474        $iId = (int)$_POST['id']; 
     475 
     476        return !empty($iId) ? $this->_actFeatured($iId) : false; 
     477    } 
     478    function actionPublish() { 
     479        $iId = (int)$_POST['id']; 
     480 
     481        return !empty($iId) ? $this->_actPublish($iId) : false; 
     482    } 
     483    function actionDelete() { 
     484        $iId = (int)$_POST['id']; 
     485 
     486        return !empty($iId) ? $this->_actDelete($iId) : false; 
     487    } 
     488 
     489    function _actFeatured($aIds, $bPositive = true) {        
    474490        if(!isAdmin())  
    475491            return false; 
    476                  
     492 
     493        if(is_int($aIds) || is_string($aIds)) 
     494            $aIds = array((int)$aIds); 
     495 
    477496        $bResult = $this->_oDb->updateNews($aIds, array('featured' => ($bPositive ? 1 : 0))); 
    478497        if($bResult) 
     
    487506        return $bResult; 
    488507    } 
    489     function actionDelete($aIds) {       
     508    function _actPublish($aIds, $bPositive = true) { 
     509        if(!isAdmin())  
     510            return false; 
     511 
     512        if(is_int($aIds) || is_string($aIds)) 
     513            $aIds = array((int)$aIds); 
     514 
     515        $bResult = $this->_oDb->updateNews($aIds, array('status' => ($bPositive ? BX_TD_STATUS_ACTIVE : BX_TD_STATUS_INACTIVE)));        
     516        if($bResult) 
     517            foreach($aIds as $iId) { 
     518                //--- News -> Publish/Unpublish for Alerts Engine ---// 
     519                $oAlert = new BxDolAlerts('bx_' . $this->_oConfig->getUri(), ($bPositive ? 'publish' : 'unpublish'), $iId, BxDolTextData::getAuthorId()); 
     520                $oAlert->alert(); 
     521                //--- News -> Publish/Unpublish for Alerts Engine ---// 
     522                 
     523                //--- Reparse Global Tags ---// 
     524                $oTags = new BxDolTags(); 
     525                $oTags->reparseObjTags('bx_' . $this->_oConfig->getUri(), $iId); 
     526                //--- Reparse Global Tags ---// 
     527                 
     528                //--- Reparse Global Categories ---//             
     529                $oCategories = new BxDolCategories(); 
     530                $oCategories->reparseObjTags('bx_' . $this->_oConfig->getUri(), $iId); 
     531                //--- Reparse Global Categories ---// 
     532            } 
     533         
     534        return $bResult; 
     535    } 
     536    function _actDelete($aIds) {         
    490537        if(!$this->_isDeleteAllowed(true))  
    491538            return false; 
     
    521568        return $bResult; 
    522569    } 
    523     function actionPublish($aIds, $bPositive = true) { 
    524         if(!isAdmin())  
    525             return false; 
    526  
    527         $bResult = $this->_oDb->updateNews($aIds, array('status' => ($bPositive ? BX_TD_STATUS_ACTIVE : BX_TD_STATUS_INACTIVE)));        
    528         if($bResult) 
    529             foreach($aIds as $iId) { 
    530                 //--- News -> Publish/Unpublish for Alerts Engine ---// 
    531                 $oAlert = new BxDolAlerts('bx_' . $this->_oConfig->getUri(), ($bPositive ? 'publish' : 'unpublish'), $iId, BxDolTextData::getAuthorId()); 
    532                 $oAlert->alert(); 
    533                 //--- News -> Publish/Unpublish for Alerts Engine ---// 
    534                  
    535                 //--- Reparse Global Tags ---// 
    536                 $oTags = new BxDolTags(); 
    537                 $oTags->reparseObjTags('bx_' . $this->_oConfig->getUri(), $iId); 
    538                 //--- Reparse Global Tags ---// 
    539                  
    540                 //--- Reparse Global Categories ---//             
    541                 $oCategories = new BxDolCategories(); 
    542                 $oCategories->reparseObjTags('bx_' . $this->_oConfig->getUri(), $iId); 
    543                 //--- Reparse Global Categories ---// 
    544             } 
    545          
    546         return $bResult; 
    547     } 
    548      
    549570    function _isDeleteAllowed($bPerform = false) { 
    550571        if(!isLogged()) 
  • trunk/modules/boonex/news/js/main.js

    r12565 r13816  
    2323    ); 
    2424} 
    25  
    2625BxNewsMain.prototype.deleteNews = function(iId) { 
    2726    var $this = this; 
    2827     
    29     $.get( 
    30         this._sActionsUrl + "act_delete/" + iId, 
    31         {}, 
     28    $.post( 
     29        this._sActionsUrl + "act_delete/", 
     30        {id:iId}, 
    3231        function(sData) { 
    3332            var iCode = parseInt(sData); 
  • trunk/modules/boonex/wall/classes/BxWallModule.php

    r13775 r13816  
    105105        $sResult = "parent." . $this->_sJsPostObject . "._loading(null, false);\n"; 
    106106 
    107         $this->_iOwnerId = (int)$_REQUEST['WallOwnerId']; 
     107        $this->_iOwnerId = (int)$_POST['WallOwnerId']; 
    108108        if (!$this->_isCommentPostAllowed(true)) 
    109109            return "<script>" . $sResult . "alert('" . addslashes(_t('_wall_msg_not_allowed_post')) . "');</script>"; 
    110110 
    111         $sPostType = process_db_input($_REQUEST['WallPostType'], BX_TAGS_STRIP); 
    112         $sContentType = process_db_input($_REQUEST['WallContentType'], BX_TAGS_STRIP); 
     111        $sPostType = process_db_input($_POST['WallPostType'], BX_TAGS_STRIP); 
     112        $sContentType = process_db_input($_POST['WallContentType'], BX_TAGS_STRIP); 
    113113 
    114114        $sMethod = "_process" . ucfirst($sPostType) . ucfirst($sContentType); 
     
    143143     */ 
    144144    function actionDelete() {        
    145         $this->_iOwnerId = (int)$_REQUEST['WallOwnerId']; 
     145        $this->_iOwnerId = (int)$_POST['WallOwnerId']; 
    146146        if(!$this->_isCommentDeleteAllowed(true)) 
    147147            return '{code: 1}'; 
    148148 
    149         $iEventId = (int)$_REQUEST['WallEventId']; 
     149        $iEventId = (int)$_POST['WallEventId']; 
    150150        $bResult = $this->_oDb->deleteEvent(array('id' => $iEventId)); 
    151151 
     
    162162    function actionGetPost() { 
    163163        $this->_bJsMode = true; 
    164         $this->_iOwnerId = (int)$_REQUEST['WallOwnerId']; 
    165         $iPostId = (int)$_REQUEST['WallPostId']; 
     164        $this->_iOwnerId = (int)$_POST['WallOwnerId']; 
     165        $iPostId = (int)$_POST['WallPostId']; 
    166166         
    167167        $aEvents = $this->_oDb->getEvents(array('type' => 'id', 'object_id' => $iPostId)); 
     
    175175    function actionGetPosts() { 
    176176        $this->_bJsMode = true; 
    177         $this->_iOwnerId = (int)$_REQUEST['WallOwnerId']; 
    178         $iStart = (int)$_REQUEST['WallStart']; 
    179         $iPerPage = isset($_REQUEST['WallPerPage']) ? (int)$_REQUEST['WallPerPage'] : $this->_oConfig->getPerPage(); 
    180         $sFilter = isset($_REQUEST['WallFilter']) ? process_db_input($_REQUEST['WallFilter'], BX_TAGS_STRIP) : BX_WALL_FILTER_ALL; 
     177        $this->_iOwnerId = (int)$_POST['WallOwnerId']; 
     178        $iStart = (int)$_POST['WallStart']; 
     179        $iPerPage = isset($_POST['WallPerPage']) ? (int)$_POST['WallPerPage'] : $this->_oConfig->getPerPage(); 
     180        $sFilter = isset($_POST['WallFilter']) ? process_db_input($_POST['WallFilter'], BX_TAGS_STRIP) : BX_WALL_FILTER_ALL; 
    181181 
    182182        return $sContent = $this->_getPosts('desc', $iStart, $iPerPage, $sFilter); 
     
    188188     */ 
    189189    function actionGetPaginate() { 
    190         $this->_iOwnerId = (int)$_REQUEST['WallOwnerId']; 
    191         $iStart = (int)$_REQUEST['WallStart']; 
    192         $iPerPage = isset($_REQUEST['WallPerPage']) ? (int)$_REQUEST['WallPerPage'] : $this->_oConfig->getPerPage(); 
    193         $sFilter = isset($_REQUEST['WallFilter']) ? process_db_input($_REQUEST['WallFilter'], BX_TAGS_STRIP) : BX_WALL_FILTER_ALL; 
     190        $this->_iOwnerId = (int)$_POST['WallOwnerId']; 
     191        $iStart = (int)$_POST['WallStart']; 
     192        $iPerPage = isset($_POST['WallPerPage']) ? (int)$_POST['WallPerPage'] : $this->_oConfig->getPerPage(); 
     193        $sFilter = isset($_POST['WallFilter']) ? process_db_input($_POST['WallFilter'], BX_TAGS_STRIP) : BX_WALL_FILTER_ALL; 
    194194         
    195195        $oPaginate = $this->_getPaginate($sFilter); 
     
    521521        $aOwner = $this->_oDb->getUser($this->_getAuthorId()); 
    522522         
    523         $sContent = trim(process_db_input($_REQUEST['content'], BX_TAGS_VALIDATE)); 
     523        $sContent = trim(process_db_input($_POST['content'], BX_TAGS_VALIDATE)); 
    524524        if(empty($sContent)) 
    525525            return array( 
     
    539539        $aOwner = $this->_oDb->getUser($this->_getAuthorId()); 
    540540         
    541         $sUrl = trim(process_db_input($_REQUEST['url'], BX_TAGS_STRIP)); 
     541        $sUrl = trim(process_db_input($_POST['url'], BX_TAGS_STRIP)); 
    542542        if(empty($sUrl)) 
    543543            return array( 
  • trunk/modules/boonex/wall/js/post.js

    r13088 r13816  
    2121    var oContents = $(oLink).parents('.boxFirstHeader').siblings('.boxContent').find('.wall-ptype-cnt'); 
    2222    if((sType == 'photo' || sType == 'music' || sType == 'video') && oContents.filter('.wall_' + sType).html() == '') { 
    23         jQuery.get ( 
     23        jQuery.post ( 
    2424            $this._sActionsUrl + 'get_' + sType + '_uploaders/' + this._iOwnerId, 
    2525            {}, 
     
    5757    this._loading(oElement, true); 
    5858 
    59     jQuery.get ( 
     59    jQuery.post ( 
    6060        this._sActionsUrl + 'get_post/', 
    6161        oData, 
  • trunk/modules/boonex/wall/js/view.js

    r9635 r13816  
    8686        this._loading(true); 
    8787 
    88     jQuery.get ( 
     88    jQuery.post ( 
    8989        this._sActionsUrl + 'get_paginate/', 
    9090        oData, 
Note: See TracChangeset for help on using the changeset viewer.