<?php
/* get country names */
$sql = "SELECT code,name FROM mgw_countries ORDER BY name";
$ADODB_FETCH_MODE=ADODB_FETCH_NUM;
if(($res = $conn->GetAll($sql))===false) exit(showSQLerror($sql, $conn->ErrorMsg(), __LINE__, __FILE__));
$ADODB_FETCH_MODE=ADODB_FETCH_ASSOC;
array_unshift($res, array("",Lang::getLanguageString("chosecountrytext")));

/* settings array */
$settings["contact"] = array( // modulename (will be translated on runtime)
	"settings" => array( // a sub option of this modules settings (will be translated on runtime)
	    "quicksearchmethod" => array( // an option - configtagname in db
              "method" => "checkbox", // options method
	      "choices" => array( // option values
            	array("name"=>"firstname","value"=>"mgw_contacts.firstname"), // name to be displayed, value to be posted
                array("name"=>"lastname","value"=>"mgw_contacts.lastname"), // the name will be placed behind the checkbox
                array("name"=>"company","value"=>"mgw_companies.name1"),
                array("name"=>"email","value"=>"mgw_contacts.email"),
                array("name"=>"city","value"=>"mgw_contacts.priv_city")),
	      "name" => "qsearchoptions", // [optionable] name of the option (will be translated on runtime)
	      "type" => "str", // configtag value, row in the db which holds the data (TODO: MAKE THIS UNNESECARY)
	      "note" => "searchnote",
	      "description" => "WHat fields to look for when quick searching",
	      "selections" => 1,
	      "dimensions" => 1,
	      "default" => array("mgw_contacts.firstname","mgw_contacts.lastname","mgw_companies.name1")
        ),
        "contacts_per_page" => array(
        	"method" => "text", // textboxes need no choices (are ignored if passed anyway)
		"type" => "int", // int values will be checked after posting
		"name" => "contactspersite",
		"description" => "How many contacts to display on one page",
		"default" => "10"
        ),
        "favourite_countries" => array(
        	"method" => "select",
		"choices" => array(
            	array("name" => "(1.)","value"=>$res), // name to be displayed (behind selectbox), array of names and values to put in selectbox
                array("name" => "(2.)","value"=>$res), // selectbox option values have index 0 in the value array
                array("name" => "(3.)","value"=>$res), // selectbox option names have index 1
                array("name" => "(4.)","value"=>$res), 
                array("name" => "(5.)","value"=>$res)),
           	"type" => "str",
		"name" => "favcountries",
		"translate" => false,
		"description" => "list of top 5 favourite countries",
		"selections" => 0,
		"dimensions" => 1,
		"default" => array("DEU","FRA","CZE","GBR")
        ),
        "show_company_id"  => array(
        	"method" => "checkbox", // if no choices array is given to a selectbox a single checkbox with value '1' will be displayed
		"name" => "showcompid", 
		"type" => "int",
		"description" => "1 if company id is to be shown, 0 if not",
		"default" => "0"
        ),
        "use_dialer" => array(
        	"method" => "checkbox",
		"name" => "usedialer",
		"type" => "int",
		"description" => "1 if dialer is to be shown, 0 if not",
		"default" => "0"
        )
    )
);

?>
