示例#1
0
 function actionAlbumsViewMy($sParamValue = '', $sParamValue1 = '', $sParamValue2 = '', $sParamValue3 = '')
 {
     $sAction = bx_get('action');
     if ($sAction !== false) {
         header('Content-Type: text/html; charset=UTF-8');
         require_once 'BxFilesUploader.php';
         $oUploader = new BxFilesUploader();
         switch ($sAction) {
             case 'cancel_file':
                 echo $oUploader->serviceCancelFileInfo();
                 return;
             case 'accept_file_info':
                 echo $oUploader->serviceAcceptFileInfo();
                 return;
             default:
                 parent::processUpload($oUploader, $sAction);
                 return;
         }
     }
     $bNotAllowView = $this->_iProfileId == 0 || !isLoggedActive();
     $aAlbumInfo = array();
     if (!$bNotAllowView && !empty($sParamValue1)) {
         $aAlbumInfo = $this->oAlbums->getAlbumInfo(array('fileUri' => $sParamValue1, 'owner' => $this->_iProfileId));
         if (!empty($aAlbumInfo)) {
             $bNotAllowView = $aAlbumInfo['AllowAlbumView'] == BX_DOL_PG_HIDDEN;
         }
     }
     if ($bNotAllowView) {
         $sKey = _t('_' . $this->_oConfig->getMainPrefix() . '_access_denied');
         $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => DesignBoxContent($sKey, MsgBox($sKey), 1)), '', '', false);
         return;
     }
     if (is_array($_POST['entry'])) {
         foreach ($_POST['entry'] as $iValue) {
             $iValue = (int) $iValue;
             switch (true) {
                 case isset($_POST['action_delete']):
                     $iCount = $this->_deleteAlbumUnits($iValue);
                     if ($iCount == 0) {
                         $this->oAlbums->removeAlbum($iValue);
                     }
                     break;
                 case isset($_POST['action_move_to']):
                     $this->oAlbums->moveObject((int) $_POST['album_id'], (int) $_POST['new_album'], $iValue);
                     break;
                 case isset($_POST['action_delete_object']):
                     $this->_deleteFile($iValue);
                     break;
             }
         }
     }
     bx_import('PageAlbumsMy', $this->_aModule);
     $sClassName = $this->_oConfig->getClassPrefix() . 'PageAlbumsMy';
     $oPage = new $sClassName($this, $this->_iProfileId, array($sParamValue, $sParamValue1, $sParamValue2, $sParamValue3));
     $sCode = $oPage->getCode();
     switch ($sParamValue) {
         case 'main':
             bx_import('PageAlbumsOwner', $this->_aModule);
             $sClassName = $this->_oConfig->getClassPrefix() . 'PageAlbumsOwner';
             $oPage = new $sClassName($this, array('browse', 'owner', getUsername($this->_iProfileId)));
             $sCode .= $oPage->getCode();
             break;
         case 'main_objects':
             $sCode .= $this->getAlbumPageView($aAlbumInfo);
             break;
     }
     $GLOBALS['oTopMenu']->setCurrentProfileID($this->_iProfileId);
     $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode), '', '', false);
 }
示例#2
0
 function actionAlbumsViewMy($sParamValue = '', $sParamValue1 = '', $sParamValue2 = '', $sParamValue3 = '')
 {
     $sAction = bx_get('action');
     if ($sAction !== false) {
         header('Content-Type: text/html; charset=UTF-8');
         if (!isLogged() && bx_get('oid') && bx_get('pwd')) {
             // in case of request from flash, cookies are not passed, and we have to set it explicitly
             $_COOKIE['memberID'] = bx_get('oid');
             $_COOKIE['memberPassword'] = bx_get('pwd');
             check_logged();
         }
         if (!isLogged()) {
             echo MsgBox(_t('_Access denied'));
             exit;
         }
         $sUpl = 'Uploader';
         bx_import($sUpl, $this->_aModule);
         $sClassName = $this->_oConfig->getClassPrefix() . $sUpl;
         $oUploader = new $sClassName();
         $this->processUpload($oUploader, $sAction);
         exit;
     }
     $bNotAllowView = $this->_iProfileId == 0 || !isLoggedActive();
     $aAlbumInfo = array();
     if (!$bNotAllowView && !empty($sParamValue1)) {
         $aAlbumInfo = $this->oAlbums->getAlbumInfo(array('fileUri' => $sParamValue1, 'owner' => $this->_iProfileId));
         if (!empty($aAlbumInfo)) {
             $bNotAllowView = $aAlbumInfo['AllowAlbumView'] == BX_DOL_PG_HIDDEN;
         }
     }
     if ($bNotAllowView) {
         $sKey = _t('_' . $this->_oConfig->getMainPrefix() . '_access_denied');
         $sCode = DesignBoxContent($sKey, MsgBox($sKey), 1);
         $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode), '', '', false);
         return;
     }
     //album actions check
     if (is_array($_POST['entry'])) {
         foreach ($_POST['entry'] as $iValue) {
             $iValue = (int) $iValue;
             switch (true) {
                 case isset($_POST['action_delete']):
                     $iCount = $this->_deleteAlbumUnits($iValue);
                     if ($iCount == 0) {
                         $this->oAlbums->removeAlbum($iValue);
                     }
                     break;
                 case isset($_POST['action_move_to']):
                     $this->oAlbums->moveObject((int) $_POST['album_id'], (int) $_POST['new_album'], $iValue);
                     break;
                 case isset($_POST['action_delete_object']):
                     $this->_deleteFile($iValue);
                     break;
             }
         }
     }
     $sCode = '';
     switch ($sParamValue) {
         case 'main':
             bx_import('PageAlbumsOwner', $this->_aModule);
             $sClassName = $this->_oConfig->getClassPrefix() . 'PageAlbumsOwner';
             $oPage = new $sClassName($this, array('browse', 'owner', getUsername($this->_iProfileId)));
             $sCode .= $oPage->getCode();
             break;
         case 'main_objects':
             $sCode .= $this->getAlbumPageView($aAlbumInfo);
             break;
     }
     bx_import('PageAlbumsMy', $this->_aModule);
     $sClassName = $this->_oConfig->getClassPrefix() . 'PageAlbumsMy';
     $oPage = new $sClassName($this, $this->_iProfileId, array($sParamValue, $sParamValue1, $sParamValue2, $sParamValue3));
     $sClassPostfix = $oPage->getViewLevel() == 0 ? 'PageAlbumsOwner' : 'PageAlbumView';
     bx_import($sClassPostfix, $this->_aModule);
     $sClassName = $this->_oConfig->getClassPrefix() . $sClassPostfix;
     $oPageViewOwner = new $sClassName($this, array());
     $iPageWidth = $oPageViewOwner->getPageWidth();
     if ($iPageWidth != 0) {
         $oPage->forcePageWidth($iPageWidth);
     }
     $GLOBALS['oTopMenu']->setCurrentProfileID($this->_iProfileId);
     $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $oPage->getCode() . $sCode), '', '', false);
 }
示例#3
0
 function actionAlbumsViewMy($sParamValue = '', $sParamValue1 = '', $sParamValue2 = '', $sParamValue3 = '')
 {
     if ($this->_iProfileId == 0 || !isLoggedActive()) {
         $sKey = _t('_' . $this->_oConfig->getMainPrefix() . '_access_denied');
         $sCode = DesignBoxContent($sKey, MsgBox($sKey), 1);
     } else {
         //album actions check
         if (is_array($_POST['entry'])) {
             foreach ($_POST['entry'] as $iValue) {
                 $iValue = (int) $iValue;
                 switch (true) {
                     case isset($_POST['action_delete']):
                         $iCount = $this->_deleteAlbumUnits($iValue);
                         if ($iCount == 0) {
                             $this->oAlbums->removeAlbum($iValue);
                         }
                         break;
                     case isset($_POST['action_move_to']):
                         $this->oAlbums->moveObject((int) $_POST['album_id'], (int) $_POST['new_album'], $iValue);
                         break;
                     case isset($_POST['action_delete_object']):
                         $this->_deleteFile($iValue);
                         break;
                 }
             }
         }
         $GLOBALS['oTopMenu']->setCurrentProfileID($this->_iProfileId);
         $sClassName = $this->_oConfig->getClassPrefix() . 'PageAlbumsMy';
         bx_import('PageAlbumsMy', $this->_aModule);
         $oPage = new $sClassName($this, $this->_iProfileId, array($sParamValue, $sParamValue1, $sParamValue2, $sParamValue3));
         $sCode = $oPage->getCode();
     }
     $this->_oTemplate->pageCode($this->aPageTmpl, array('page_main_code' => $sCode), '', '', false);
 }