HomeHelpTrac

Changeset 15733 for trunk/modules


Ignore:
Timestamp:
12/08/11 00:02:57 (6 months ago)
Author:
Alexander Trofimov
Message:

Groups - some corrections

Location:
trunk/modules/boonex/groups
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/boonex/groups/classes/BxGroupsDb.php

    r15211 r15733  
    5757            $this->query ("DELETE FROM `" . $this->_sPrefix . "admins` WHERE `id_entry` = $iId"); 
    5858            $this->deleteEntryMediaAll ($iId, 'images'); 
    59             $this->deleteEntryMediaAll ($iId, 'videos'); 
    60             $this->deleteEntryMediaAll ($iId, 'sounds'); 
    61             $this->deleteEntryMediaAll ($iId, 'files'); 
    6259        } 
    6360        return $iRet; 
  • trunk/modules/boonex/groups/classes/BxGroupsFormAdd.php

    r15211 r15733  
    2323bx_import ('BxDolFormMedia'); 
    2424 
    25 class BxGroupsFormAdd extends BxDolFormMedia { 
     25bx_import('BxTemplFormView'); 
     26 
     27class BxGroupsFormAdd extends BxTemplFormView { 
    2628 
    2729    var $_oMain, $_oDb; 
    2830 
    29     function BxGroupsFormAdd ($oMain, $iProfileId, $iEntryId = 0, $iThumb = 0) { 
     31    function __construct ($oMain, $iProfileId, $iEntryId = 0, $iThumb = 0) { 
    3032 
    3133        $this->_oMain = $oMain; 
    3234        $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         ); 
    8035 
    8136        bx_import('BxDolCategories'); 
     
    8540        $aCountries = $oProfileFields->convertValues4Input('#!Country'); 
    8641        asort($aCountries); 
    87  
    88         // generate templates for custom form's elements 
    89         $aCustomMediaTemplates = $this->generateCustomMediaTemplates ($oMain->_iProfileId, $iEntryId, $iThumb); 
    9042 
    9143        // privacy 
     
    11971        $aInputPrivacyRate['db'] = $aInputPrivacyCustomPass; 
    12072 
    121         $aInputPrivacyForum = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'post_in_forum'); 
    122         $aInputPrivacyForum['values'] = array_merge($aInputPrivacyForum['values'], $aInputPrivacyCustom); 
    123         $aInputPrivacyForum['db'] = $aInputPrivacyCustomPass; 
    124  
    12573        $aInputPrivacyUploadPhotos = $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'upload_photos'); 
    12674        $aInputPrivacyUploadPhotos['values'] = $aInputPrivacyCustom2; 
    12775        $aInputPrivacyUploadPhotos['db'] = $aInputPrivacyCustom2Pass; 
    12876 
    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; 
    14077 
    14178        $aCustomForm = array( 
     
    258195                'categories' => $oCategories->getGroupChooser ('bx_groups', (int)$iProfileId, true), 
    259196 
    260                 // images 
    261  
    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                 // videos 
    297  
    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                 // sounds 
    322  
    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                 // files 
    347  
    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                 ), 
    370197 
    371198                // privacy 
     
    383210 
    384211                'allow_rate_to' => $aInputPrivacyRate, 
    385  
    386                 'allow_post_in_forum_to' => $aInputPrivacyForum, 
    387212 
    388213                'allow_join_to' => $this->_oMain->_oPrivacy->getGroupChooser($iProfileId, 'groups', 'join'), 
     
    408233                'allow_upload_photos_to' => $aInputPrivacyUploadPhotos, 
    409234 
    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                ), 
    415239 
    416240                'Submit' => array ( 
     
    423247        ); 
    424248 
    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); 
    442250    } 
    443251 
    444252} 
    445253 
    446 ?> 
  • trunk/modules/boonex/groups/classes/BxGroupsFormEdit.php

    r15211 r15733  
    2424class BxGroupsFormEdit extends BxGroupsFormAdd { 
    2525 
    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']); 
    2828 
    2929        $aFormInputsId = array ( 
  • trunk/modules/boonex/groups/classes/BxGroupsModule.php

    r15211 r15733  
    539539        if ($this->isAdmin()) 
    540540            return true; 
    541         if (!$GLOBALS['logged']['member']) 
     541        if (empty($GLOBALS['logged']['member'])) 
    542542            return false; 
    543543        $this->_defineActions(); 
     
    688688        if (!$iProfileId) 
    689689            $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)) 
    691691            return true; 
    692692        return $this->_oDb->isGroupAdmin ($aDataEntry['id'], $iProfileId) && isProfileActive($iProfileId); 
  • trunk/modules/boonex/groups/classes/BxGroupsPageView.php

    r15211 r15733  
    6767 
    6868    function getBlockCode_Actions() { 
    69         global $oFunctions; 
    7069 
    7170        if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) { 
     
    101100                return ''; 
    102101 
    103             return $oSubscription->getData() . $oFunctions->genObjectsActions($aInfo, 'bx_groups'); 
     102            return $oSubscription->getData() . BxTemplFunctions::getInstance()->genObjectsActions($aInfo, 'bx_groups'); 
    104103        } 
    105104 
  • trunk/modules/boonex/groups/classes/BxGroupsSearchResult.php

    r15731 r15733  
    290290    } 
    291291 
    292     function displayResultBlock () { 
    293         global $oFunctions; 
     292    function displayResultBlock () {         
    294293        $s = parent::displayResultBlock (); 
    295294        if ($s) { 
    296295            $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'); 
    300300        } 
    301301        return ''; 
  • trunk/modules/boonex/groups/classes/BxGroupsTemplate.php

    r15211 r15733  
    3838    function unit ($aData, $sTemplateName, &$oVotingView) { 
    3939 
     40        require_once(BX_DIRECTORY_PATH_INC . 'prof.inc.php'); 
     41 
    4042        if (null == $this->_oMain) 
    4143            $this->_oMain = BxDolModule::getInstance('BxGroupsModule'); 
     
    5961            'group_title' => $aData['title'], 
    6062            '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);', 
    6365            'fans_count' => $aData['fans_count'], 
    6466            'country_city' => _t($GLOBALS['aPreValues']['Country'][$aData['country']]['LKey']) . (trim($aData['city']) ? ', '.$aData['city'] : ''), 
  • trunk/modules/boonex/groups/install/sql/enable.sql

    r15731 r15733  
    99-- page compose blocks 
    1010INSERT 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'), 
    2222    ('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); 
    2424 
    2525-- permalinkU 
Note: See TracChangeset for help on using the changeset viewer.