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

    Copyright (C) 2010  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=$MyRequestHandler->getNLModuleKeyValue("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"]= $MyRequestHandler->getNLModuleKeyValue("Archive_enabled");
	$NLConf_map["Archive_storetime"]= $MyRequestHandler->getNLModuleKeyValue("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="";

	$NLConf_map["Permanent_recipient"]=$MyRequestHandler->getNLModuleKeyValue("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=\"".$MyRequestHandler->getNLModuleKeyName("cur_NLcof_modul")."\" value=\"$cur_NLcof_modul\">";
	//for security reasons, submiting current admin modul and newsletter
	print "<input type=\"hidden\" name=\"modul\" value=\"".$MySessionHandler->getCurrentModule()."\">";
	print "<input type=\"hidden\" name=\"SelectNL\" value=\"".$MySessionHandler->getNLID()."\">";

	print $MSG1."<br>";
	print "<br><br>";
	print "<table border=0>";
	print "<tr><td>".$MSG_Map["Permanent_recipient"].":</td><td><input type=text name=\"".$MyRequestHandler->getNLModuleKeyName("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=\"".$MyRequestHandler->getNLModuleKeyName("Archive_enabled")."\" value=\"yes\"";
    
	if($NLConf_map["Archive_enabled"] =="yes")
	{
	    print " checked ";
	}
	print "> | $MSG_NO <input type=\"radio\" name=\"".$MyRequestHandler->getNLModuleKeyName("Archive_enabled")."\" value=\"no\"";
	if($NLConf_map["Archive_enabled"] !="yes")
	{
	    print " checked ";
	}
	print "<tr><td>".$MSG_Map["Archive_storetime"].":</td><td>";
	print "<select name=\"".$MyRequestHandler->getNLModuleKeyName("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=\"".$MyRequestHandler->getNLModuleKeyName("NLConfOption")."\" value=\"update\"></td><td><input type=\"Submit\" value=\"$MSG_Submit\"></form></td></tr></table>";


?>
       

















Return current item: ADbNewsSender