Changeset 15733 for trunk/modules
- Timestamp:
- 12/08/11 00:02:57 (6 months ago)
- Location:
- trunk/modules/boonex/groups
- Files:
-
- 8 edited
-
classes/BxGroupsDb.php (modified) (1 diff)
-
classes/BxGroupsFormAdd.php (modified) (7 diffs)
-
classes/BxGroupsFormEdit.php (modified) (1 diff)
-
classes/BxGroupsModule.php (modified) (2 diffs)
-
classes/BxGroupsPageView.php (modified) (2 diffs)
-
classes/BxGroupsSearchResult.php (modified) (1 diff)
-
classes/BxGroupsTemplate.php (modified) (2 diffs)
-
install/sql/enable.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/boonex/groups/classes/BxGroupsDb.php
r15211 r15733 57 57 $this->query ("DELETE FROM `" . $this->_sPrefix . "admins` WHERE `id_entry` = $iId"); 58 58 $this->deleteEntryMediaAll ($iId, 'images'); 59 $this->deleteEntryMediaAll ($iId, 'videos');60 $this->deleteEntryMediaAll ($iId, 'sounds');61 $this->deleteEntryMediaAll ($iId, 'files');62 59 } 63 60 return $iRet; -
trunk/modules/boonex/groups/classes/BxGroupsFormAdd.php
r15211 r15733 23 23 bx_import ('BxDolFormMedia'); 24 24 25 class BxGroupsFormAdd extends BxDolFormMedia { 25 bx_import('BxTemplFormView'); 26 27 class BxGroupsFormAdd extends BxTemplFormView { 26 28 27 29 var $_oMain, $_oDb; 28 30 29 function BxGroupsFormAdd($oMain, $iProfileId, $iEntryId = 0, $iThumb = 0) {31 function __construct ($oMain, $iProfileId, $iEntryId = 0, $iThumb = 0) { 30 32 31 33 $this->_oMain = $oMain; 32 34 $this->_oDb = $oMain->_oDb; 33 34 $this->_aMedia = array (35 'images' => array (36 'post' => 'ready_images',37 'upload_func' => 'uploadPhotos',38 'tag' => BX_GROUPS_PHOTOS_TAG,39 'cat' => BX_GROUPS_PHOTOS_CAT,40 'thumb' => 'thumb',41 'module' => 'photos',42 'title_upload_post' => 'images_titles',43 'title_upload' => _t('_bx_groups_form_caption_file_title'),44 'service_method' => 'get_photo_array',45 ),46 'videos' => array (47 'post' => 'ready_videos',48 'upload_func' => 'uploadVideos',49 'tag' => BX_GROUPS_VIDEOS_TAG,50 'cat' => BX_GROUPS_VIDEOS_CAT,51 'thumb' => false,52 'module' => 'videos',53 'title_upload_post' => 'videos_titles',54 'title_upload' => _t('_bx_groups_form_caption_file_title'),55 'service_method' => 'get_video_array',56 ),57 'sounds' => array (58 'post' => 'ready_sounds',59 'upload_func' => 'uploadSounds',60 'tag' => BX_GROUPS_SOUNDS_TAG,61 'cat' => BX_GROUPS_SOUNDS_CAT,62 'thumb' => false,63 'module' => 'sounds',64 'title_upload_post' => 'sounds_titles',65 'title_upload' => _t('_bx_groups_form_caption_file_title'),66 'service_method' => 'get_music_array',67 ),68 'files' => array (69 'post' => 'ready_files',70 'upload_func' => 'uploadFiles',71 'tag' => BX_GROUPS_FILES_TAG,72 'cat' => BX_GROUPS_FILES_CAT,73 'thumb' => false,74 'module' => 'files',75 'title_upload_post' => 'files_titles',76 'title_upload' => _t('_bx_groups_form_caption_file_title'),77 'service_method' => 'get_file_array',78 ),79 );80 35 81 36 bx_import('BxDolCategories'); … … 85 40 $aCountries = $oProfileFields->convertValues4Input('#!Country'); 86 41 asort($aCountries); 87 88 // generate templates for custom form's elements89 $aCustomMediaTemplates = $this->generateCustomMediaTemplates ($oMain->_iProfileId, $iEntryId, $iThumb);90 42 91 43 // privacy … … 119 71 $aInputPrivacyRate['db'] = $aInputPrivacyCustomPass; 120 72 121 $aInputPrivacyForum = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'post_in_forum');122 $aInputPrivacyForum['values'] = array_merge($aInputPrivacyForum['values'], $aInputPrivacyCustom);123 $aInputPrivacyForum['db'] = $aInputPrivacyCustomPass;124 125 73 $aInputPrivacyUploadPhotos = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'upload_photos'); 126 74 $aInputPrivacyUploadPhotos['values'] = $aInputPrivacyCustom2; 127 75 $aInputPrivacyUploadPhotos['db'] = $aInputPrivacyCustom2Pass; 128 76 129 $aInputPrivacyUploadVideos = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'upload_videos');130 $aInputPrivacyUploadVideos['values'] = $aInputPrivacyCustom2;131 $aInputPrivacyUploadVideos['db'] = $aInputPrivacyCustom2Pass;132 133 $aInputPrivacyUploadSounds = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'upload_sounds');134 $aInputPrivacyUploadSounds['values'] = $aInputPrivacyCustom2;135 $aInputPrivacyUploadSounds['db'] = $aInputPrivacyCustom2Pass;136 137 $aInputPrivacyUploadFiles = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'upload_files');138 $aInputPrivacyUploadFiles['values'] = $aInputPrivacyCustom2;139 $aInputPrivacyUploadFiles['db'] = $aInputPrivacyCustom2Pass;140 77 141 78 $aCustomForm = array( … … 258 195 'categories' => $oCategories->getGroupChooser ('bx_groups', (int)$iProfileId, true), 259 196 260 // images261 262 'header_images' => array(263 'type' => 'block_header',264 'caption' => _t('_bx_groups_form_header_images'),265 'collapsable' => true,266 'collapsed' => false,267 ),268 'thumb' => array(269 'type' => 'custom',270 'content' => $aCustomMediaTemplates['images']['thumb_choice'],271 'name' => 'thumb',272 'caption' => _t('_bx_groups_form_caption_thumb_choice'),273 'info' => _t('_bx_groups_form_info_thumb_choice'),274 'required' => false,275 'db' => array (276 'pass' => 'Int',277 ),278 ),279 'images_choice' => array(280 'type' => 'custom',281 'content' => $aCustomMediaTemplates['images']['choice'],282 'name' => 'images_choice[]',283 'caption' => _t('_bx_groups_form_caption_images_choice'),284 'info' => _t('_bx_groups_form_info_images_choice'),285 'required' => false,286 ),287 'images_upload' => array(288 'type' => 'custom',289 'content' => $aCustomMediaTemplates['images']['upload'],290 'name' => 'images_upload[]',291 'caption' => _t('_bx_groups_form_caption_images_upload'),292 'info' => _t('_bx_groups_form_info_images_upload'),293 'required' => false,294 ),295 296 // videos297 298 'header_videos' => array(299 'type' => 'block_header',300 'caption' => _t('_bx_groups_form_header_videos'),301 'collapsable' => true,302 'collapsed' => false,303 ),304 'videos_choice' => array(305 'type' => 'custom',306 'content' => $aCustomMediaTemplates['videos']['choice'],307 'name' => 'videos_choice[]',308 'caption' => _t('_bx_groups_form_caption_videos_choice'),309 'info' => _t('_bx_groups_form_info_videos_choice'),310 'required' => false,311 ),312 'videos_upload' => array(313 'type' => 'custom',314 'content' => $aCustomMediaTemplates['videos']['upload'],315 'name' => 'videos_upload[]',316 'caption' => _t('_bx_groups_form_caption_videos_upload'),317 'info' => _t('_bx_groups_form_info_videos_upload'),318 'required' => false,319 ),320 321 // sounds322 323 'header_sounds' => array(324 'type' => 'block_header',325 'caption' => _t('_bx_groups_form_header_sounds'),326 'collapsable' => true,327 'collapsed' => false,328 ),329 'sounds_choice' => array(330 'type' => 'custom',331 'content' => $aCustomMediaTemplates['sounds']['choice'],332 'name' => 'sounds_choice[]',333 'caption' => _t('_bx_groups_form_caption_sounds_choice'),334 'info' => _t('_bx_groups_form_info_sounds_choice'),335 'required' => false,336 ),337 'sounds_upload' => array(338 'type' => 'custom',339 'content' => $aCustomMediaTemplates['sounds']['upload'],340 'name' => 'sounds_upload[]',341 'caption' => _t('_bx_groups_form_caption_sounds_upload'),342 'info' => _t('_bx_groups_form_info_sounds_upload'),343 'required' => false,344 ),345 346 // files347 348 'header_files' => array(349 'type' => 'block_header',350 'caption' => _t('_bx_groups_form_header_files'),351 'collapsable' => true,352 'collapsed' => false,353 ),354 'files_choice' => array(355 'type' => 'custom',356 'content' => $aCustomMediaTemplates['files']['choice'],357 'name' => 'files_choice[]',358 'caption' => _t('_bx_groups_form_caption_files_choice'),359 'info' => _t('_bx_groups_form_info_files_choice'),360 'required' => false,361 ),362 'files_upload' => array(363 'type' => 'custom',364 'content' => $aCustomMediaTemplates['files']['upload'],365 'name' => 'files_upload[]',366 'caption' => _t('_bx_groups_form_caption_files_upload'),367 'info' => _t('_bx_groups_form_info_files_upload'),368 'required' => false,369 ),370 197 371 198 // privacy … … 383 210 384 211 'allow_rate_to' => $aInputPrivacyRate, 385 386 'allow_post_in_forum_to' => $aInputPrivacyForum,387 212 388 213 'allow_join_to' => $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'join'), … … 408 233 'allow_upload_photos_to' => $aInputPrivacyUploadPhotos, 409 234 410 'allow_upload_videos_to' => $aInputPrivacyUploadVideos, 411 412 'allow_upload_sounds_to' => $aInputPrivacyUploadSounds, 413 414 'allow_upload_files_to' => $aInputPrivacyUploadFiles, 235 'header_submit' => array( 236 'type' => 'block_header', 237 'caption' => '', 238 ), 415 239 416 240 'Submit' => array ( … … 423 247 ); 424 248 425 if (!$aCustomForm['inputs']['images_choice']['content']) { 426 unset ($aCustomForm['inputs']['thumb']); 427 unset ($aCustomForm['inputs']['images_choice']); 428 } 429 430 if (!$aCustomForm['inputs']['videos_choice']['content']) 431 unset ($aCustomForm['inputs']['videos_choice']); 432 433 if (!$aCustomForm['inputs']['sounds_choice']['content']) 434 unset ($aCustomForm['inputs']['sounds_choice']); 435 436 if (!$aCustomForm['inputs']['files_choice']['content']) 437 unset ($aCustomForm['inputs']['files_choice']); 438 439 $this->processMembershipChecksForMediaUploads ($aCustomForm['inputs']); 440 441 parent::BxDolFormMedia ($aCustomForm); 249 parent::__construct ($aCustomForm); 442 250 } 443 251 444 252 } 445 253 446 ?> -
trunk/modules/boonex/groups/classes/BxGroupsFormEdit.php
r15211 r15733 24 24 class BxGroupsFormEdit extends BxGroupsFormAdd { 25 25 26 function BxGroupsFormEdit ($oMain, $iProfileId, $iEntryId, &$aDataEntry) {27 parent:: BxGroupsFormAdd($oMain, $iProfileId, $iEntryId, $aDataEntry['thumb']);26 function __construct ($oMain, $iProfileId, $iEntryId, &$aDataEntry) { 27 parent::__construct ($oMain, $iProfileId, $iEntryId, $aDataEntry['thumb']); 28 28 29 29 $aFormInputsId = array ( -
trunk/modules/boonex/groups/classes/BxGroupsModule.php
r15211 r15733 539 539 if ($this->isAdmin()) 540 540 return true; 541 if ( !$GLOBALS['logged']['member'])541 if (empty($GLOBALS['logged']['member'])) 542 542 return false; 543 543 $this->_defineActions(); … … 688 688 if (!$iProfileId) 689 689 $iProfileId = $this->_iProfileId; 690 if (( $GLOBALS['logged']['member'] || $GLOBALS['logged']['admin']) && $aDataEntry['author_id'] == $iProfileId&& isProfileActive($iProfileId))690 if ((!empty($GLOBALS['logged']['member']) || !empty($GLOBALS['logged']['admin'])) && $aDataEntry['author_id'] == $iProfileId)// TODO: && isProfileActive($iProfileId)) 691 691 return true; 692 692 return $this->_oDb->isGroupAdmin ($aDataEntry['id'], $iProfileId) && isProfileActive($iProfileId); -
trunk/modules/boonex/groups/classes/BxGroupsPageView.php
r15211 r15733 67 67 68 68 function getBlockCode_Actions() { 69 global $oFunctions;70 69 71 70 if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) { … … 101 100 return ''; 102 101 103 return $oSubscription->getData() . $oFunctions->genObjectsActions($aInfo, 'bx_groups');102 return $oSubscription->getData() . BxTemplFunctions::getInstance()->genObjectsActions($aInfo, 'bx_groups'); 104 103 } 105 104 -
trunk/modules/boonex/groups/classes/BxGroupsSearchResult.php
r15731 r15733 290 290 } 291 291 292 function displayResultBlock () { 293 global $oFunctions; 292 function displayResultBlock () { 294 293 $s = parent::displayResultBlock (); 295 294 if ($s) { 296 295 $oMain = $this->getMain(); 297 $GLOBALS['oSysTemplate']->addDynamicLocation($oMain->_oConfig->getHomePath(), $oMain->_oConfig->getHomeUrl()); 298 $GLOBALS['oSysTemplate']->addCss('unit.css'); 299 return $oFunctions->centerContent ($s, '.bx_groups_unit'); 296 BxDolTemplate::getInstance()->addDynamicLocation($oMain->_oConfig->getHomePath(), $oMain->_oConfig->getHomeUrl()); 297 BxDolTemplate::getInstance()->addCss('unit.css'); 298 bx_import('BxTemplFunctions'); 299 return BxTemplFunctions::getInstance()->centerContent ($s, '.bx_groups_unit'); 300 300 } 301 301 return ''; -
trunk/modules/boonex/groups/classes/BxGroupsTemplate.php
r15211 r15733 38 38 function unit ($aData, $sTemplateName, &$oVotingView) { 39 39 40 require_once(BX_DIRECTORY_PATH_INC . 'prof.inc.php'); 41 40 42 if (null == $this->_oMain) 41 43 $this->_oMain = BxDolModule::getInstance('BxGroupsModule'); … … 59 61 'group_title' => $aData['title'], 60 62 'created' => defineTimeInterval($aData['created']), 61 'author' => $aData['NickName'],62 'author_url' => $aData['author_id'] ? getProfileLink($aData['author_id']) : 'javascript:void(0);',63 'author' => 'Undefined', // TODO: $aData['NickName'], 64 'author_url' => '', // TODO: $aData['author_id'] ? getProfileLink($aData['author_id']) : 'javascript:void(0);', 63 65 'fans_count' => $aData['fans_count'], 64 66 'country_city' => _t($GLOBALS['aPreValues']['Country'][$aData['country']]['LKey']) . (trim($aData['city']) ? ', '.$aData['city'] : ''), -
trunk/modules/boonex/groups/install/sql/enable.sql
r15731 r15733 9 9 -- page compose blocks 10 10 INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES 11 ('bx_groups_view', '998px', 'Group''s actions block', '_bx_groups_block_actions', '1', '0', 'Actions', '', '1 ', '34', 'non,memb', '0'),12 ('bx_groups_view', '998px', 'Group''s rate block', '_bx_groups_block_rate', '1', '1', 'Rate', '', '1 ', '34', 'non,memb', '0'),13 ('bx_groups_view', '998px', 'Group''s info block', '_bx_groups_block_info', '1', '2', 'Info', '', '1 ', '34', 'non,memb', '0'),14 ('bx_groups_view', '998px', 'Group''s fans block', '_bx_groups_block_fans', '1', '3', 'Fans', '', '1 ', '34', 'non,memb', '0'),15 ('bx_groups_view', '998px', 'Group''s unconfirmed fans block', '_bx_groups_block_fans_unconfirmed', '1 ', '5', 'FansUnconfirmed', '', '1', '34', 'memb', '0'),16 ('bx_groups_view', '998px', 'Group''s description block', '_bx_groups_block_desc', '2', '0', 'Desc', '', '1 ', '66', 'non,memb', '0'),17 ('bx_groups_view', '998px', 'Group''s photo block', '_bx_groups_block_photo', '2', '1', 'Photo', '', '1 ', '66', 'non,memb', '0'),18 ('bx_groups_view', '998px', 'Group''s comments block', '_bx_groups_block_comments', '2', '5', 'Comments', '', '1 ', '66', 'non,memb', '0'),19 ('bx_groups_main', '998px', 'Latest Featured Group', '_bx_groups_block_latest_featured_group', '2', '0', 'LatestFeaturedGroup', '', '1 ', '66', 'non,memb', '0'),20 ('bx_groups_main', '998px', 'Recent Groups', '_bx_groups_block_recent', '1', '0', 'Recent', '', '1 ', '34', 'non,memb', '0'),21 ('bx_groups_my', '998px', 'Administration Owner', '_bx_groups_block_administration_owner', '1', '0', 'Owner', '', '1 ', '100', 'non,memb', '0'),11 ('bx_groups_view', '998px', 'Group''s actions block', '_bx_groups_block_actions', '1', '0', 'Actions', '', '11', '34', 'non,memb', '0'), 12 ('bx_groups_view', '998px', 'Group''s rate block', '_bx_groups_block_rate', '1', '1', 'Rate', '', '11', '34', 'non,memb', '0'), 13 ('bx_groups_view', '998px', 'Group''s info block', '_bx_groups_block_info', '1', '2', 'Info', '', '11', '34', 'non,memb', '0'), 14 ('bx_groups_view', '998px', 'Group''s fans block', '_bx_groups_block_fans', '1', '3', 'Fans', '', '11', '34', 'non,memb', '0'), 15 ('bx_groups_view', '998px', 'Group''s unconfirmed fans block', '_bx_groups_block_fans_unconfirmed', '11', '5', 'FansUnconfirmed', '', '1', '34', 'memb', '0'), 16 ('bx_groups_view', '998px', 'Group''s description block', '_bx_groups_block_desc', '2', '0', 'Desc', '', '11', '66', 'non,memb', '0'), 17 ('bx_groups_view', '998px', 'Group''s photo block', '_bx_groups_block_photo', '2', '1', 'Photo', '', '11', '66', 'non,memb', '0'), 18 ('bx_groups_view', '998px', 'Group''s comments block', '_bx_groups_block_comments', '2', '5', 'Comments', '', '11', '66', 'non,memb', '0'), 19 ('bx_groups_main', '998px', 'Latest Featured Group', '_bx_groups_block_latest_featured_group', '2', '0', 'LatestFeaturedGroup', '', '11', '66', 'non,memb', '0'), 20 ('bx_groups_main', '998px', 'Recent Groups', '_bx_groups_block_recent', '1', '0', 'Recent', '', '11', '34', 'non,memb', '0'), 21 ('bx_groups_my', '998px', 'Administration Owner', '_bx_groups_block_administration_owner', '1', '0', 'Owner', '', '11', '100', 'non,memb', '0'), 22 22 ('bx_groups_my', '998px', 'User''s groups', '_bx_groups_block_users_groups', '1', '1', 'Browse', '', '0', '100', 'non,memb', '0'), 23 ('index', '998px', 'Groups', '_bx_groups_block_homepage', 0, 0, 'PHP', 'bx_import(''BxDolService''); return BxDolService::call(''groups'', ''homepage_block'');', 1 , 66, 'non,memb', 0);23 ('index', '998px', 'Groups', '_bx_groups_block_homepage', 0, 0, 'PHP', 'bx_import(''BxDolService''); return BxDolService::call(''groups'', ''homepage_block'');', 11, 66, 'non,memb', 0); 24 24 25 25 -- permalinkU
Note: See TracChangeset
for help on using the changeset viewer.