<?php

# $Id: function.admin_tab_preferences.php 1 2011-06-12 15:25:27Z arnoud $ 

#BEGIN_LICENSE
#-------------------------------------------------------------------------
# Module: UpCoupon (c) 2011 by Arnoud van Susteren (arnoud@upservice.nl)
#
# An addon module for CMS Made Simple to setup a Coupon Codes Lottery
# 
#-------------------------------------------------------------------------
# CMS - CMS Made Simple is (c) 2005 by Ted Kulp (wishy@cmsmadesimple.org)
# This project's homepage is: 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(!is_object(cmsms())) exit;

###############################################################################
# setup form
###############################################################################

if (isset($params['preferences_message'])) {
        $preferences_message = explode(",", $params['preferences_message']);
        $smarty->assign('preferences_message',$this->ShowMessage($this->Lang($preferences_message[0], array($this->Lang($preferences_message[1])))));
}

$smarty->assign('startform',$this->CreateFormStart($id,'preferences_add_edit',$returnid));

//$smarty->assign('underconstruction_text', $this->ShowMessage($this->Lang('preferences_underconstruction')));

// email_registered_customer

$smarty->assign('section_email_registered_customer',$this->Lang('p_section_email_registered_customer'));

if ($this->GetPreference('email_registered_true_false',0) == 1) {
    $smarty->assign('email_registered_true_false_text',$this->ShowMessage($this->Lang('p_email_registered_true')));    
} else {
    $smarty->assign('email_registered_true_false_text',$this->ShowErrors($this->Lang('p_email_registered_false')));    
}

$smarty->assign('email_registered_customer_text',$this->Lang('p_email_registered_check'));
$smarty->assign('email_registered_customer_input',$this->CreateInputCheckbox($id,'email_registered_check','1',$this->GetPreference('email_registered_check',0)));

$smarty->assign('email_registered_subject_text',$this->Lang('p_email_registered_subject'));
$smarty->assign('email_registered_subject_input',$this->CreateInputText($id,'email_registered_subject',$this->GetPreference('email_registered_subject',$this->Lang('p_email_registered_subject_default')),30,50));

$smarty->assign('email_registered_address_email_text',$this->Lang('p_email_registered_address_email'));
$smarty->assign('email_registered_address_email_input',$this->CreateInputText($id,'email_registered_address_email',$this->GetPreference('email_registered_address_email',''),30,100));
$smarty->assign('email_registered_address_email_help',$this->Lang('p_email_registered_address_email_help'));

$smarty->assign('email_registered_address_name_text',$this->Lang('p_email_registered_address_name'));
$smarty->assign('email_registered_address_name_input',$this->CreateInputText($id,'email_registered_address_name',$this->GetPreference('email_registered_address_name',''),30,100));

$smarty->assign('email_registered_message_text',$this->Lang('p_email_registered_message'));
$smarty->assign('email_registered_message_input', $this->CreateTextArea(false, $id, $this->GetTemplate('email_registered_message'), 'email_registered_message'));

$smarty->assign('email_registered_message_vars',$this->Lang('email_registered_message_vars'));
$smarty->assign('email_registered_message_vars_list',$this->Lang('email_registered_message_vars_list'));
$smarty->assign('email_registered_message_vars_link',$admintheme->DisplayImage('icons/system/info.gif', $this->Lang('email_registered_message_vars'),'','','systemicon'));

$smarty->assign('email_registered_message_winner_text',$this->Lang('p_email_registered_message_winner'));
$smarty->assign('email_registered_message_winner_input', $this->CreateTextArea(false, $id, $this->GetTemplate('email_registered_message_winner'), 'email_registered_message_winner'));

$smarty->assign('email_registered_message_winner_vars',$this->Lang('email_registered_message_winner_vars'));
$smarty->assign('email_registered_message_winner_vars_list',$this->Lang('email_registered_message_winner_vars_list'));
$smarty->assign('email_registered_message_winner_vars_link',$admintheme->DisplayImage('icons/system/info.gif', $this->Lang('email_registered_message_winner_vars'),'','','systemicon'));

/*

$smarty->assign('section_title_02_text',$this->Lang('preferences_section_title_02'));

$this->smarty->assign('double_text',$this->Lang('preferences_double'));
$this->smarty->assign('double_input',
		$this->Lang('preferences_double_width') . ':&nbsp;' .
		$this->CreateInputText( $id, 'double_a', $this->GetPreference('double_a',800), 4, 4 ) .
		'px &nbsp;&nbsp;' . $this->Lang('preferences_double_height') . ':&nbsp;' .
		$this->CreateInputText( $id, 'double_b', $this->GetPreference('double_b',800), 4, 4 ) . 'px'
);

*/

$smarty->assign('submit', $this->CreateInputSubmit ($id, 'submit', $this->Lang('submit')));

$this->smarty->assign('cancel', $this->CreateInputSubmit($id, 'cancel', $this->Lang('cancel')));

$smarty->assign('endform', $this->CreateFormEnd ());


###############################################################################
# ProcessTemplate
###############################################################################

echo $this->ProcessTemplate ('preferences_list.tpl');

#
# EOF
#
?>