<?php
#-------------------------------------------------------------------------
# Module: Newsletter Made Simple
#        (c) to 2008 by Paul Lempkepf
#        (c) 2008 and on by Robert Campbell (calguy1000@cmsmadesimple.org)
#
#  An addon module for CMS Made Simple to provide a flexible
#  mailing list solution.
#
#-------------------------------------------------------------------------
# CMSMS - CMS Made Simple is (c) 2005 by Ted Kulp (wishy@cmsmadesimple.org)
# Visit the CMSMS Homepage at: http://www.cmsmadesimple.org
#
#-------------------------------------------------------------------------
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# However, as a special exception to the GPL, this software is distributed
# as an addon module to CMS Made Simple.  You may not use this software
# in any Non GPL version of CMS Made simple, or in any version of CMS
# Made simple that does not indicate clearly and obviously in its admin
# section that the site was built with CMS Made simple.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Or read it online: http://www.gnu.org/licenses/licenses.html#GPL
#
#-------------------------------------------------------------------------
#END_LICENSE
if( !isset($gCms) ) exit;
if( !$this->CheckPermission('Modify Site Preferences') ) return;

// simple way to have common nav available to all admin pages
$smarty->assign('startform', $this->CreateFormStart($id, 'save_admin_prefs', $returnid));
$smarty->assign('endform', $this->CreateFormEnd());
$smarty->assign('submit', $this->CreateInputSubmit($id, 'submit', $this->Lang('submit')));

$smarty->assign('messagesperhour',$this->GetPreference('messagesperhour',0));

$smarty->assign('prompt_email_user_on_admin_subscribe', $this->Lang('prompt_email_user_on_admin_subscribe'));
$smarty->assign('email_user_on_admin_subscribe', $this->CreateInputCheckbox($id, 'email_user_on_admin_subscribe', 1, $this->GetPreference('email_user_on_admin_subscribe', 0)));

$smarty->assign('prompt_admin_email',$this->Lang('admin_email'));
$smarty->assign('admin_email', $this->CreateInputText($id, 'admin_email', $this->GetPreference('admin_email', ''), 50));
$smarty->assign('prompt_admin_name',$this->Lang('admin_name'));
$smarty->assign('prompt_admin_replyto',$this->Lang('admin_replyto'));
$smarty->assign('admin_name', $this->CreateInputText($id, 'admin_name', $this->GetPreference('admin_name', ''), 50));
$smarty->assign('admin_replyto', $this->CreateInputText($id, 'admin_replyto', $this->GetPreference('admin_replyto'), 50));

$smarty->assign('prompt_pop3_server',$this->Lang('pop3_server'));
$smarty->assign('pop3_server',
		$this->CreateInputText($id,'pop3_server',
					 $this->GetPreference('pop3_server'),50));
$smarty->assign('prompt_pop3_username',$this->Lang('pop3_username'));
$smarty->assign('pop3_username',
		$this->CreateInputText($id,'pop3_username',
					 $this->GetPreference('pop3_username'),50));
$smarty->assign('prompt_pop3_password',$this->Lang('pop3_password'));
$smarty->assign('pop3_password',
		$this->CreateInputPassword($id,'pop3_password',
					     $this->GetPreference('pop3_password')));

$smarty->assign('prompt_bounce_limit',$this->Lang('bounce_limit'));
$smarty->assign('bounce_limit',
		$this->CreateInputText($id,'bounce_limit',
					 $this->GetPreference('bounce_limit',10),3,3));
$smarty->assign('info_bounce_limit',$this->Lang('info_bounce_limit'));
$smarty->assign('prompt_bounce_messagelimit',$this->Lang('bounce_messagelimit'));
$smarty->assign('info_bounce_messagelimit',$this->Lang('info_bounce_messagelimit'));
$smarty->assign('bounce_messagelimit',
		$this->CreateInputText($id,'bounce_messagelimit',
					 $this->GetPreference('bounce_messagelimit',500),4,4));

$smarty->assign('prompt_message_charset',$this->Lang('message_charset'));
$smarty->assign('message_charset', $this->CreateInputText($id, 'message_charset', $this->GetPreference('message_charset', '1'), 50));

$smarty->assign('prompt_require_confirmation',$this->Lang('require_confirmation'));
$smarty->assign('require_confirmation',
		$this->CreateInputYesNoDropdown($id,'require_confirmation',$this->GetPreference('require_confirmation',1)));

$smarty->assign('prompt_unsubscribe_deletes',$this->Lang('unsubscribe_deletes'));
$smarty->assign('unsubscribe_deletes',
		$this->CreateInputYesNoDropdown($id,'unsubscribe_deletes',$this->GetPreference('unsubscribe_deletes',0)));
$smarty->assign('sendheaders',$this->GetPreference('sendheaders',1));
$precedence_list = array('none'=>$this->Lang('p_none'),
			 'bulk'=>$this->Lang('p_bulk'),
			 'list'=>$this->Lang('p_list'),
			 'junk'=>$this->Lang('p_junk'));
$smarty->assign('precedence_list',$precedence_list);
$smarty->assign('precedence',$this->GetPreference('precedence','bulk'));
$smarty->assign('max_error_count',(int)$this->GetPreference('max_error_count',10));
$smarty->assign('check_email_dns',$this->GetPreference('check_email_dns'));
$smarty->assign('check_dns_subscribe',$this->GetPreference('check_dns_subscribe'));

// Display the populated template
echo $this->ProcessTemplate('adminprefs.tpl');
