diff options
| author | Christian Fowler <spider@viovio.com> | 2005-12-09 07:04:17 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2005-12-09 07:04:17 +0000 |
| commit | e7bc7b34fbd41030b3df705700c3fb9caaa54b19 (patch) | |
| tree | 7d9390a86f7ab55334e0058dd8b39429377d4a48 /admin/index.php | |
| parent | e686c2762faae2d487381aede0ddcc9662ebbd52 (diff) | |
| download | newsletters-e7bc7b34fbd41030b3df705700c3fb9caaa54b19.tar.gz newsletters-e7bc7b34fbd41030b3df705700c3fb9caaa54b19.tar.bz2 newsletters-e7bc7b34fbd41030b3df705700c3fb9caaa54b19.zip | |
first round of changes to get things functional in bitweaver
Diffstat (limited to 'admin/index.php')
| -rw-r--r-- | admin/index.php | 84 |
1 files changed, 20 insertions, 64 deletions
diff --git a/admin/index.php b/admin/index.php index 775d227..cb67726 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,59 +1,18 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/Attic/index.php,v 1.1 2005/12/09 06:59:54 bitweaver Exp $ +// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/Attic/index.php,v 1.2 2005/12/09 07:04:17 spiderr Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. // Initialization -require_once( '../../tiki_setup_inc.php' ); - +require_once( '../../bit_setup_inc.php' ); include_once( NEWSLETTERS_PKG_PATH.'nl_lib.php' ); +$gBitSystem->verifyPackage( 'newsletters' ); +$gBitSystem->verifyPermission( 'tiki_p_admin_newsletters' ); -if ($feature_newsletters != 'y') { - $smarty->assign('msg', tra("This feature is disabled").": feature_newsletters"); - - $gTikiSystem->display( 'error.tpl' ); - die; -} - -if (!isset($_REQUEST["nl_id"])) { - $_REQUEST["nl_id"] = 0; -} - -$smarty->assign('nl_id', $_REQUEST["nl_id"]); - -$smarty->assign('individual', 'n'); - -if ($userlib->object_has_one_permission($_REQUEST["nl_id"], 'newsletter')) { - $smarty->assign('individual', 'y'); - - if ($tiki_p_admin != 'y') { - $perms = $userlib->get_permissions(0, -1, 'perm_name_desc', '', 'newsletters'); - - foreach ($perms["data"] as $perm) { - $perm_name = $perm["perm_name"]; - - if ($userlib->object_has_permission($user, $_REQUEST["nl_id"], 'newsletter', $perm_name)) { - $$perm_name = 'y'; - - $smarty->assign("$perm_name", 'y'); - } else { - $$perm_name = 'n'; - - $smarty->assign("$perm_name", 'n'); - } - } - } -} - -if ($tiki_p_admin_newsletters != 'y') { - $smarty->assign('msg', tra("You do not have permission to use this feature")); - - $gTikiSystem->display( 'error.tpl' ); - die; -} +require_once( NEWSLETTERS_PKG_PATH.'lookup_newsletter_inc.php' ); if ($_REQUEST["nl_id"]) { $info = $nllib->get_newsletter($_REQUEST["nl_id"]); @@ -68,15 +27,13 @@ if ($_REQUEST["nl_id"]) { $info["validate_addr"] = 'y'; } -$smarty->assign('info', $info); +$gBitSmarty->assign('info', $info); if (isset($_REQUEST["remove"])) { - check_ticket('admin-nl'); $nllib->remove_newsletter($_REQUEST["remove"]); } if (isset($_REQUEST["save"])) { - check_ticket('admin-nl'); if (isset($_REQUEST["allow_user_sub"]) && $_REQUEST["allow_user_sub"] == 'on') { $_REQUEST["allow_user_sub"] = 'y'; } else { @@ -117,8 +74,8 @@ if (isset($_REQUEST["save"])) { $info["unsub_msg"] = 'y'; $info["validate_addr"] = 'y'; //$info["frequency"] = 7 * 24 * 60 * 60; - $smarty->assign('nl_id', 0); - $smarty->assign('info', $info); + $gBitSmarty->assign('nl_id', 0); + $gBitSmarty->assign('info', $info); } if ( empty( $_REQUEST["sort_mode"] ) ) { @@ -133,7 +90,7 @@ if (!isset($_REQUEST["offset"])) { $offset = $_REQUEST["offset"]; } -$smarty->assign_by_ref('offset', $offset); +$gBitSmarty->assign_by_ref('offset', $offset); if (isset($_REQUEST["find"])) { $find = $_REQUEST["find"]; @@ -141,29 +98,29 @@ if (isset($_REQUEST["find"])) { $find = ''; } -$smarty->assign('find', $find); +$gBitSmarty->assign('find', $find); -$smarty->assign_by_ref('sort_mode', $sort_mode); +$gBitSmarty->assign_by_ref('sort_mode', $sort_mode); $channels = $nllib->list_newsletters($offset, $maxRecords, $sort_mode, $find); $cant_pages = ceil($channels["cant"] / $maxRecords); -$smarty->assign_by_ref('cant_pages', $cant_pages); -$smarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$gBitSmarty->assign_by_ref('cant_pages', $cant_pages); +$gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); if ($channels["cant"] > ($offset + $maxRecords)) { - $smarty->assign('next_offset', $offset + $maxRecords); + $gBitSmarty->assign('next_offset', $offset + $maxRecords); } else { - $smarty->assign('next_offset', -1); + $gBitSmarty->assign('next_offset', -1); } // If offset is > 0 then prev_offset if ($offset > 0) { - $smarty->assign('prev_offset', $offset - $maxRecords); + $gBitSmarty->assign('prev_offset', $offset - $maxRecords); } else { - $smarty->assign('prev_offset', -1); + $gBitSmarty->assign('prev_offset', -1); } -$smarty->assign_by_ref('channels', $channels["data"]); +$gBitSmarty->assign_by_ref('channels', $channels["data"]); // Fill array with possible number of questions per page /* @@ -176,16 +133,15 @@ for ($i = 0; $i < 90; $i++) { $freqs[] = $aux; } -$smarty->assign('freqs', $freqs); +$gBitSmarty->assign('freqs', $freqs); */ /* $cat_type='newsletter'; $cat_objid = $_REQUEST["nl_id"]; include_once( CATEGORIES_PKG_PATH.'categorize_list_inc.php' ); */ -ask_ticket('admin-nl'); // Display the template -$gTikiSystem->display( 'tikipackage:newsletters/admin_newsletters.tpl'); +$gBitSystem->display( 'bitpackage:newsletters/admin_newsletters.tpl'); ?> |
