Jump to content

WHMCS [configOptions] Pushing to Custom Feilds


derrick1123

Recommended Posts

I'ts been bugging me for a few days, so I decided to try and get some help.

function somestuff_ConfigOptions($params) {
    ini_set("soap.wsdl_cache_enabled", "0");

    $rwsdl = "https://somesite";
    $vwsdl = "https://somesite";

    $rurl = "https://somesite";
    $vurl = "https://somesite";

    $rns = "somestuff";
    $vns = "somestuff";

    $apiuser=somestuff;
    $apikey=somestuff;
    $auth = array ( "username" => $apiuser, "apiKey" => $apikey );

    $soapClient = new SoapClient($rwsdl, array("trace" => 1));
    $oSoapVar= new SoapVar( $auth, SOAP_ENC_OBJECT);
    $oSoapHeader = new SoapHeader($rns, 'RequestCredentials', $oSoapVar);

    try {
	$info = $soapClient->__soapCall('locationList',array(), array(), $oSoapHeader);
    } catch (SoapFault $exception) { return $exception;  }
    $locations=$info->{'locations'};
    $lc = count($locations);

    $llist = "";

    for($i=1;$i<$lc;$i++)
    {
	$llist .= $locations[$i]->{'locationId'}."|".str_replace(",",";",$locations[$i]->{'name'}).",";
    }
$llist .= $locations[0]->{'locationId'}."|".str_replace(",",";",$locations[0]->{'name'});

    $configarray = array(
	"Location" => array( "Type" => "dropdown", "Options" => $llist),
);
    return $configarray;

}

 

It works perfectly as a drop down, which allows me to choose the location I want in the back-end...but I want the users to be able to choose the location.

I would need to be able to push it to Config Fields instead of Module Settings.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.