Changeset 13816
- Timestamp:
- 03/22/10 03:38:14 (23 months ago)
- Location:
- trunk/modules/boonex
- Files:
-
- 12 edited
-
articles/admin.php (modified) (1 diff)
-
articles/classes/BxArlModule.php (modified) (3 diffs)
-
articles/js/main.js (modified) (1 diff)
-
feedback/admin.php (modified) (1 diff)
-
feedback/classes/BxFdbModule.php (modified) (2 diffs)
-
feedback/js/main.js (modified) (1 diff)
-
news/admin.php (modified) (1 diff)
-
news/classes/BxNewsModule.php (modified) (3 diffs)
-
news/js/main.js (modified) (1 diff)
-
wall/classes/BxWallModule.php (modified) (7 diffs)
-
wall/js/post.js (modified) (2 diffs)
-
wall/js/view.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/boonex/articles/admin.php
r13348 r13816 50 50 51 51 if(isset($_POST['alr-publish'])) 52 $oArticles-> actionPublish($_POST['alr-ids'], true);52 $oArticles->_actPublish($_POST['alr-ids'], true); 53 53 else if(isset($_POST['alr-unpublish'])) 54 $oArticles-> actionPublish($_POST['alr-ids'], false);54 $oArticles->_actPublish($_POST['alr-ids'], false); 55 55 else if(isset($_POST['alr-featured'])) 56 $oArticles-> actionFeatured($_POST['alr-ids'], true);56 $oArticles->_actFeatured($_POST['alr-ids'], true); 57 57 else if(isset($_POST['alr-unfeatured'])) 58 $oArticles-> actionFeatured($_POST['alr-ids'], false);58 $oArticles->_actFeatured($_POST['alr-ids'], false); 59 59 else if(isset($_POST['alr-delete'])) 60 $oArticles-> actionDelete($_POST['alr-ids']);60 $oArticles->_actDelete($_POST['alr-ids']); 61 61 //--- Process actions ---// 62 62 -
trunk/modules/boonex/articles/classes/BxArlModule.php
r13781 r13816 466 466 )); 467 467 } 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) { 469 485 if(!isAdmin()) 470 486 return false; 471 487 488 if(is_int($aIds) || is_string($aIds)) 489 $aIds = array((int)$aIds); 490 472 491 $bResult = $this->_oDb->updateArticles($aIds, array('featured' => ($bPositive ? 1 : 0))); 473 492 if($bResult) … … 482 501 return $bResult; 483 502 } 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) { 485 532 if(!$this->_isDeleteAllowed(true)) 486 533 return false; … … 516 563 return $bResult; 517 564 } 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 544 565 function _isDeleteAllowed($bPerform = false) { 545 566 if(!isLogged()) -
trunk/modules/boonex/articles/js/main.js
r12565 r13816 27 27 var $this = this; 28 28 29 $. get(30 this._sActionsUrl + "act_delete/" + iId,31 { },29 $.post( 30 this._sActionsUrl + "act_delete/", 31 {id:iId}, 32 32 function(sData) { 33 33 var iCode = parseInt(sData); -
trunk/modules/boonex/feedback/admin.php
r13348 r13816 50 50 51 51 if(isset($_POST['feedback-approve'])) 52 $oFeedback-> actionApprove($_POST['feedback-ids'], true);52 $oFeedback->_actApprove($_POST['feedback-ids'], true); 53 53 else if(isset($_POST['feedback-reject'])) 54 $oFeedback-> actionApprove($_POST['feedback-ids'], false);54 $oFeedback->_actApprove($_POST['feedback-ids'], false); 55 55 else if(isset($_POST['feedback-delete'])) 56 $oFeedback-> actionDelete($_POST['feedback-ids']);56 $oFeedback->_actDelete($_POST['feedback-ids']); 57 57 //--- Process actions ---// 58 58 -
trunk/modules/boonex/feedback/classes/BxFdbModule.php
r13778 r13816 353 353 )); 354 354 } 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) { 385 367 if(!isAdmin()) 386 368 return false; 387 369 370 if(is_int($aIds) || is_string($aIds)) 371 $aIds = array((int)$aIds); 372 388 373 $bResult = $this->_oDb->updateFeedback($aIds, array('status' => ($bPositive ? BX_FDB_STATUS_ACTIVE : BX_FDB_STATUS_REJECTED))); 389 374 if($bResult) … … 404 389 return $bResult; 405 390 } 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 } 407 420 function _isDeleteAllowed($iAuthorId = 0, $bPerform = false) { 408 421 if(!isLogged()) -
trunk/modules/boonex/feedback/js/main.js
r12565 r13816 26 26 BxFeedbackMain.prototype.deleteFeedback = function(iId) { 27 27 var $this = this; 28 29 $. get(30 this._sActionsUrl + "act_delete/" + iId,31 { },28 29 $.post( 30 this._sActionsUrl + "act_delete/", 31 {id:iId}, 32 32 function(sData) { 33 33 var iCode = parseInt(sData); -
trunk/modules/boonex/news/admin.php
r13348 r13816 50 50 51 51 if(isset($_POST['news-publish'])) 52 $oNews-> actionPublish($_POST['news-ids'], true);52 $oNews->_actPublish($_POST['news-ids'], true); 53 53 else if(isset($_POST['news-unpublish'])) 54 $oNews-> actionPublish($_POST['news-ids'], false);54 $oNews->_actPublish($_POST['news-ids'], false); 55 55 else if(isset($_POST['news-featured'])) 56 $oNews-> actionFeatured($_POST['news-ids'], true);56 $oNews->_actFeatured($_POST['news-ids'], true); 57 57 else if(isset($_POST['news-unfeatured'])) 58 $oNews-> actionFeatured($_POST['news-ids'], false);58 $oNews->_actFeatured($_POST['news-ids'], false); 59 59 else if(isset($_POST['news-delete'])) 60 $oNews-> actionDelete($_POST['news-ids']);60 $oNews->_actDelete($_POST['news-ids']); 61 61 //--- Process actions ---// 62 62 -
trunk/modules/boonex/news/classes/BxNewsModule.php
r13781 r13816 471 471 )); 472 472 } 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) { 474 490 if(!isAdmin()) 475 491 return false; 476 492 493 if(is_int($aIds) || is_string($aIds)) 494 $aIds = array((int)$aIds); 495 477 496 $bResult = $this->_oDb->updateNews($aIds, array('featured' => ($bPositive ? 1 : 0))); 478 497 if($bResult) … … 487 506 return $bResult; 488 507 } 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) { 490 537 if(!$this->_isDeleteAllowed(true)) 491 538 return false; … … 521 568 return $bResult; 522 569 } 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 549 570 function _isDeleteAllowed($bPerform = false) { 550 571 if(!isLogged()) -
trunk/modules/boonex/news/js/main.js
r12565 r13816 23 23 ); 24 24 } 25 26 25 BxNewsMain.prototype.deleteNews = function(iId) { 27 26 var $this = this; 28 27 29 $. get(30 this._sActionsUrl + "act_delete/" + iId,31 { },28 $.post( 29 this._sActionsUrl + "act_delete/", 30 {id:iId}, 32 31 function(sData) { 33 32 var iCode = parseInt(sData); -
trunk/modules/boonex/wall/classes/BxWallModule.php
r13775 r13816 105 105 $sResult = "parent." . $this->_sJsPostObject . "._loading(null, false);\n"; 106 106 107 $this->_iOwnerId = (int)$_ REQUEST['WallOwnerId'];107 $this->_iOwnerId = (int)$_POST['WallOwnerId']; 108 108 if (!$this->_isCommentPostAllowed(true)) 109 109 return "<script>" . $sResult . "alert('" . addslashes(_t('_wall_msg_not_allowed_post')) . "');</script>"; 110 110 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); 113 113 114 114 $sMethod = "_process" . ucfirst($sPostType) . ucfirst($sContentType); … … 143 143 */ 144 144 function actionDelete() { 145 $this->_iOwnerId = (int)$_ REQUEST['WallOwnerId'];145 $this->_iOwnerId = (int)$_POST['WallOwnerId']; 146 146 if(!$this->_isCommentDeleteAllowed(true)) 147 147 return '{code: 1}'; 148 148 149 $iEventId = (int)$_ REQUEST['WallEventId'];149 $iEventId = (int)$_POST['WallEventId']; 150 150 $bResult = $this->_oDb->deleteEvent(array('id' => $iEventId)); 151 151 … … 162 162 function actionGetPost() { 163 163 $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']; 166 166 167 167 $aEvents = $this->_oDb->getEvents(array('type' => 'id', 'object_id' => $iPostId)); … … 175 175 function actionGetPosts() { 176 176 $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; 181 181 182 182 return $sContent = $this->_getPosts('desc', $iStart, $iPerPage, $sFilter); … … 188 188 */ 189 189 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; 194 194 195 195 $oPaginate = $this->_getPaginate($sFilter); … … 521 521 $aOwner = $this->_oDb->getUser($this->_getAuthorId()); 522 522 523 $sContent = trim(process_db_input($_ REQUEST['content'], BX_TAGS_VALIDATE));523 $sContent = trim(process_db_input($_POST['content'], BX_TAGS_VALIDATE)); 524 524 if(empty($sContent)) 525 525 return array( … … 539 539 $aOwner = $this->_oDb->getUser($this->_getAuthorId()); 540 540 541 $sUrl = trim(process_db_input($_ REQUEST['url'], BX_TAGS_STRIP));541 $sUrl = trim(process_db_input($_POST['url'], BX_TAGS_STRIP)); 542 542 if(empty($sUrl)) 543 543 return array( -
trunk/modules/boonex/wall/js/post.js
r13088 r13816 21 21 var oContents = $(oLink).parents('.boxFirstHeader').siblings('.boxContent').find('.wall-ptype-cnt'); 22 22 if((sType == 'photo' || sType == 'music' || sType == 'video') && oContents.filter('.wall_' + sType).html() == '') { 23 jQuery. get (23 jQuery.post ( 24 24 $this._sActionsUrl + 'get_' + sType + '_uploaders/' + this._iOwnerId, 25 25 {}, … … 57 57 this._loading(oElement, true); 58 58 59 jQuery. get (59 jQuery.post ( 60 60 this._sActionsUrl + 'get_post/', 61 61 oData, -
trunk/modules/boonex/wall/js/view.js
r9635 r13816 86 86 this._loading(true); 87 87 88 jQuery. get (88 jQuery.post ( 89 89 this._sActionsUrl + 'get_paginate/', 90 90 oData,
Note: See TracChangeset
for help on using the changeset viewer.