Changeset 8494


Ignore:
Timestamp:
Jan 15, 2009, 11:19:36 AM (16 years ago)
Author:
Andrey Prikaznov
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/modules/boonex/shared_photo/classes/BxShPhotoUploader.php

    r8487 r8494  
    220220    } 
    221221 
    222     function serviceGenPhotoUploadForm() { 
    223         return $this->GenPhotoUploadForm(BX_DOL_URL_MODULES . 'boonex/shared_photo/uploadPhoto.php'); 
    224     } 
    225  
    226     function GenPhotoUploadForm($sWorkingFile) { 
     222    function serviceGenPhotoUploadForm($sPredefCategory) { 
     223        return $this->GenPhotoUploadForm(BX_DOL_URL_MODULES . 'boonex/shared_photo/uploadPhoto.php', $sPredefCategory); 
     224    } 
     225 
     226    function GenPhotoUploadForm($sWorkingFile, $sPredefCategory = '') { 
    227227        global $site; 
    228228 
     
    253253        if ($sInitType == 'photo') { 
    254254            //list($sPhotoForm, $sPhotoRecForm, $sPhotoEmbForm) = $this->GenPhotoUploadForm(); 
    255             list($sPhotoRecForm, $sPhotoForms) = $this->Gen10PhotoUploadForms($sWorkingFile); 
     255            list($sPhotoRecForm, $sPhotoForms) = $this->Gen10PhotoUploadForms($sWorkingFile, $sPredefCategory); 
    256256            $aRepeatPhoto = array( 
    257257                array( 
     
    289289    } 
    290290 
    291     function Gen10PhotoUploadForms($sWorkingFile) { 
     291    function Gen10PhotoUploadForms($sWorkingFile, $sPredefCategory = '') { 
    292292        global $logged; 
    293293 
     
    315315                $sPhotoUplFile = $sPhotoUplInfo = ''; 
    316316                $sPhotoUplFile = $this->getUploadFormFile(array('type' => 'photo', 'is_form' => false, 'inputs' => $this->_addHidden('photo', 'upload', 'post', $i ))); 
    317                 $sPhotoUplInfo = $this->getUploadFormInformation(array('type' => 'photo', 'is_form' => false, 'inputs' => $this->_addHidden('photo', 'uploadInformation', 'postInformation', $i))); 
     317                $sPhotoUplInfo = $this->getUploadFormInformation(array('type' => 'photo', 'is_form' => false, 'inputs' => $this->_addHidden('photo', 'uploadInformation', 'postInformation', $i)), $sPredefCategory); 
    318318 
    319319                $sAfterStatus = (getParam('autoApproval_Photo') == 'on') ? _t('_Your photo now in approved status') : _t('_Your photo now in pending status'); 
     
    559559    } 
    560560 
    561     function getUploadFormInformation($aParams = array()) { 
     561    function getUploadFormInformation($aParams = array(), $sPredefCategory = '') { 
    562562        $sType = isset($aParams['type']) ? $aParams['type'] : 'photo'; 
    563563        $sAction = isset($aParams['action']) ? $aParams['action'] : 'uploadSharePhoto.php'; 
    564564        $isForm = !isset($aParams['is_form']) || (isset($aParams['is_form']) && $aParams['is_form'] === true); 
    565565 
    566         require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolCategories.php'); 
    567         $oCategories = new BxDolCategories(); 
    568         $aCategories = $oCategories->getCategoriesList('photo', $this->_iOwnerId, true); 
     566        $aFormCategories = array(); 
     567        if ($sPredefCategory != '') { 
     568             $aFormCategories['category'] = array( 
     569                'type' => 'hidden', 
     570                'name' => 'category[]', 
     571                'value' => $sPredefCategory 
     572            ); 
     573        } else { 
     574            require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolCategories.php'); 
     575            $oCategories = new BxDolCategories(); 
     576            $aCategories = $oCategories->getCategoriesList('photo', $this->_iOwnerId, true); 
     577 
     578             $aFormCategories['category'] = array( 
     579                'type' => 'select_box', 
     580                'name' => 'category', 
     581                'caption' => _t('_Category'), 
     582                'values' => $aCategories 
     583            ); 
     584        } 
    569585         
    570586        $aForm = array( 
     
    598614                    'name' => 'description', 
    599615                    'caption' => _t('_Description'), 
    600                 ), 
    601                  'category' => array( 
    602                     'type' => 'select_box', 
    603                     'name' => 'category', 
    604                     'caption' => _t('_Category'), 
    605                     'values' => $aCategories 
    606616                ) 
    607617            ), 
    608618        ); 
    609          
     619 
     620        // merging categories 
     621        $aForm['inputs'] = array_merge($aForm['inputs'], $aFormCategories); 
     622 
    610623        // add submit if form wrapper allowed 
    611624        if ($isForm) { 
     
    617630            ); 
    618631        } 
    619          
     632 
    620633        $aForm['inputs'] = isset($aParams['inputs']) ? array_merge($aForm['inputs'], $aParams['inputs']) : $aForm['inputs']; 
    621634        $oForm = new BxTemplFormView($aForm); 
Note: See TracChangeset for help on using the changeset viewer.
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
Fork me on GitHub