Location: PHPKode > projects > ADbNewsSender > ADbNewsSender_2.0.4/protected/admin/nl/config_modules/other.php.inc
<?php
//Copyright (c) Florian Grannemann
//Last change in version: 2.0 Alpha 1
/*
    ******************************************************************************
    ADbNewsSender 2

    Copyright (C) 2009  Florian Grannemann (hide@address.com)
    Website: http://adbnewssender.sf.net



    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 3 of the License, or
    any later version.

    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, see http://www.gnu.org/licenses/
    ******************************************************************************
*/

//Do not edit anything unless you realy REALY know what you are doing!


$NLConfOption=$_POST["NLConfOption"];



if($NLConfOption !="update")
{
	$NLConf_map=array();
	
	$NLConf_map["Archive_storetime"]= $MyNL->get_NLconfig_setting("Archive_storetime");
	$NLConf_map["Archive_enabled"]= $MyNL->get_NLconfig_setting("Archive_enabled");
	$NLConf_map["Permanent_recipient"]=$MyNL->get_NLconfig_setting("Permanent_recipient");
}
else
{
	$NLConf_map=array();
	$NLConf_map["Archive_enabled"]= $_POST["Archive_enabled"];
	$NLConf_map["Archive_storetime"]= $_POST["Archive_storetime"];
	
	if($NLConf_map["Archive_enabled"] !="yes")
	{
	    $NLConf_map["Archive_enabled"]="no";
	}
	if($NLConf_map["Archive_storetime"] <1)
	{
	    $NLConf_map["Archive_storetime"]=1;
	}
	if($NLConf_map["Archive_storetime"] >120)
	{
	    $NLConf_map["Archive_storetime"]=120;
	}
	
	$error="";

	/*foreach($NLConf_map as $key=>$val)
	{
	    if(!$val)
	    {
		$error=$error.$MSG_Map[$key]."<br>";
	    }
	}
	*/
	$NLConf_map["Permanent_recipient"]=$_POST["Permanent_recipient"];
	if(!$error)
	{
	    foreach($NLConf_map as $key=>$val)
	    {
		$MyNL->replace_setting($key,"$val");
	    }
	    print "<b>".$MSG_Success."</b><br>";
	}
	else
	{
	   print $ErrorMSG_1."<br>".$error;
	}
	
	
	print "<br><br>";
}


	
	
	print "<form action=\"".$_SERVER["PHP_SELF"]."\" method=post>"; 
	print "<input type=\"hidden\" name=\"cur_NLcof_modul\" value=\"$cur_NLcof_modul\">";
	//for security reasons, submiting current admin modul and newsletter
	print "<input type=\"hidden\" name=\"modul\" value=\"".$_SESSION["currentModulType"]."|".intval($_SESSION["currentModulNr"])."\">";
	print "<input type=\"hidden\" name=\"SelectNL\" value=\"".$_SESSION["CurrentNL"]."\">";

	print $MSG1."<br>";
	print "<br><br>";
	print "<table border=0>";
	print "<tr><td>".$MSG_Map["Permanent_recipient"].":</td><td><input type=text name=\"Permanent_recipient\"size=40 value=\"".$NLConf_map["Permanent_recipient"]."\"></td></tr>";
	print "<tr><td>".$MSG_Map["Archive_enabled"]."</td><td> $MSG_YES <input type=\"radio\" name=\"Archive_enabled\" value=\"yes\"";
    
	if($NLConf_map["Archive_enabled"] =="yes")
	{
	    print " checked ";
	}
	print "> | $MSG_NO <input type=\"radio\" name=\"Archive_enabled\" value=\"no\"";
	if($NLConf_map["Archive_enabled"] !="yes")
	{
	    print " checked ";
	}
	print "<tr><td>".$MSG_Map["Archive_storetime"].":</td><td>";
	print "<select name=\"Archive_storetime\">";
	$i=1;
	while ($i <=30)
	{
		print "<option value=\"$i\"";
		if ($i == $NLConf_map["Archive_storetime"])
		{
			print " selected";
		}
		print ">$i </option>";
		$i++;
	}

	print "</select> $Months</td></tr>";
	
	print "<input type=\"hidden\" name=\"NLConfOption\" value=\"update\"></td><td><input type=\"Submit\" value=\"$MSG_Submit\"></form></td></tr></table>";


?>
       

















Return current item: ADbNewsSender