1 | <?php
|
---|
2 |
|
---|
3 | /***************************************************************************
|
---|
4 | * Dolphin Smart Community Builder
|
---|
5 | * -----------------
|
---|
6 | * begin : Mon Mar 23 2008
|
---|
7 | * copyright : (C) 2008 BoonEx Group
|
---|
8 | * website : http://www.boonex.com/
|
---|
9 | * This file is part of Dolphin - Smart Community Builder
|
---|
10 | *
|
---|
11 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
|
---|
12 | * http://creativecommons.org/licenses/by/3.0/
|
---|
13 | *
|
---|
14 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
---|
15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
16 | * See the Creative Commons Attribution 3.0 License for more details.
|
---|
17 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
|
---|
18 | * see license.txt file; if not, write to marketing@boonex.com
|
---|
19 | ***************************************************************************/
|
---|
20 |
|
---|
21 | require_once( '../inc/header.inc.php' );
|
---|
22 | require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
|
---|
23 | require_once( BX_DIRECTORY_PATH_INC . 'admin_design.inc.php' );
|
---|
24 | require_once( BX_DIRECTORY_PATH_INC . 'admin.inc.php' );
|
---|
25 |
|
---|
26 | bx_import('BxDolPaginate');
|
---|
27 | bx_import('BxDolSubscription');
|
---|
28 | bx_import('BxTemplSearchResult');
|
---|
29 |
|
---|
30 | $logged['admin'] = member_auth( 1, true, true );
|
---|
31 |
|
---|
32 | $oSubscription = new BxDolSubscription();
|
---|
33 |
|
---|
34 | //--- Process actions
|
---|
35 | if(isset($_POST['adm-ms-delete'])) {
|
---|
36 | foreach($_POST['members'] as $iMemberId)
|
---|
37 | $oSubscription->unsubscribe(array(
|
---|
38 | 'type' => 'visitor',
|
---|
39 | 'id' => $iMemberId
|
---|
40 | ));
|
---|
41 | }
|
---|
42 |
|
---|
43 | $sPageTitle = _t('_adm_page_cpt_manage_subscribers');
|
---|
44 |
|
---|
45 | $iNameIndex = 0;
|
---|
46 | $_page = array(
|
---|
47 | 'name_index' => $iNameIndex,
|
---|
48 | 'css_name' => array('forms_adv.css', 'manage_subscribers.css'),
|
---|
49 | 'header' => $sPageTitle,
|
---|
50 | 'header_text' => $sPageTitle
|
---|
51 | );
|
---|
52 | $_page_cont[$iNameIndex]['page_main_code'] = PageCodeSubscribers($oSubscription);
|
---|
53 |
|
---|
54 | PageCodeAdmin();
|
---|
55 |
|
---|
56 | function PageCodeSubscribers($oSubscription) {
|
---|
57 | $iStart = isset($_REQUEST['start']) ? (int)$_REQUEST['start'] : 0;
|
---|
58 | $iPerPage = 20;
|
---|
59 | $oPaginate = new BxDolPaginate(array(
|
---|
60 | 'start' => $iStart,
|
---|
61 | 'per_page' => $iPerPage,
|
---|
62 | 'count' => $oSubscription->getSubscribersCount(),
|
---|
63 | 'page_url' => $_SERVER['PHP_SELF']
|
---|
64 |
|
---|
65 | ));
|
---|
66 |
|
---|
67 | $sControls = BxTemplSearchResult::showAdminActionsPanel('adm-ms-form', array(
|
---|
68 | 'adm-ms-delete' => _t('_adm_btn_ms_delete')
|
---|
69 | ), 'members');
|
---|
70 |
|
---|
71 | $aSubscribers = $oSubscription->getSubscribers(BX_DOL_SBS_TYPE_VISITOR, $iStart, $iPerPage);
|
---|
72 |
|
---|
73 | return $GLOBALS['oAdmTemplate']->parseHtmlByName('manage_subscribers.html', array(
|
---|
74 | 'bx_repeat:items' => is_array($aSubscribers) && !empty($aSubscribers) ? $aSubscribers : MsgBox(_t('_Empty')),
|
---|
75 | 'paginate' => $oPaginate->getPaginate(),
|
---|
76 | 'controls' => $sControls
|
---|
77 | ));
|
---|
78 | }
|
---|
79 | ?> |
---|