Changeset 8494
- Timestamp:
- Jan 15, 2009, 11:19:36 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/modules/boonex/shared_photo/classes/BxShPhotoUploader.php ¶
r8487 r8494 220 220 } 221 221 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 = '') { 227 227 global $site; 228 228 … … 253 253 if ($sInitType == 'photo') { 254 254 //list($sPhotoForm, $sPhotoRecForm, $sPhotoEmbForm) = $this->GenPhotoUploadForm(); 255 list($sPhotoRecForm, $sPhotoForms) = $this->Gen10PhotoUploadForms($sWorkingFile );255 list($sPhotoRecForm, $sPhotoForms) = $this->Gen10PhotoUploadForms($sWorkingFile, $sPredefCategory); 256 256 $aRepeatPhoto = array( 257 257 array( … … 289 289 } 290 290 291 function Gen10PhotoUploadForms($sWorkingFile ) {291 function Gen10PhotoUploadForms($sWorkingFile, $sPredefCategory = '') { 292 292 global $logged; 293 293 … … 315 315 $sPhotoUplFile = $sPhotoUplInfo = ''; 316 316 $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); 318 318 319 319 $sAfterStatus = (getParam('autoApproval_Photo') == 'on') ? _t('_Your photo now in approved status') : _t('_Your photo now in pending status'); … … 559 559 } 560 560 561 function getUploadFormInformation($aParams = array() ) {561 function getUploadFormInformation($aParams = array(), $sPredefCategory = '') { 562 562 $sType = isset($aParams['type']) ? $aParams['type'] : 'photo'; 563 563 $sAction = isset($aParams['action']) ? $aParams['action'] : 'uploadSharePhoto.php'; 564 564 $isForm = !isset($aParams['is_form']) || (isset($aParams['is_form']) && $aParams['is_form'] === true); 565 565 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 } 569 585 570 586 $aForm = array( … … 598 614 'name' => 'description', 599 615 'caption' => _t('_Description'), 600 ),601 'category' => array(602 'type' => 'select_box',603 'name' => 'category',604 'caption' => _t('_Category'),605 'values' => $aCategories606 616 ) 607 617 ), 608 618 ); 609 619 620 // merging categories 621 $aForm['inputs'] = array_merge($aForm['inputs'], $aFormCategories); 622 610 623 // add submit if form wrapper allowed 611 624 if ($isForm) { … … 617 630 ); 618 631 } 619 632 620 633 $aForm['inputs'] = isset($aParams['inputs']) ? array_merge($aForm['inputs'], $aParams['inputs']) : $aForm['inputs']; 621 634 $oForm = new BxTemplFormView($aForm);
Note: See TracChangeset
for help on using the changeset viewer.