Hi Folks, I'm converting a backend admin script that I have, to use PHPRunner and have a problem with creating a custom dropdown.
The issue is that the values in the dropdown need to be populated based on a directory listing (this dropdown controls what template the script is to use in the front end). So, the values in the <SELECT> statement need to be based on the listing.
My current script uses the following function to get the directory listings and then I dump this into a <SELECT> tag so the can pick the template to use.
I can't find a way to accomplish the same in PHPRunner.
Cheers and thanks in advance!
[codebox]function get_templates($directory)
{
global $cfg;
$new_array = array();
$fp = opendir($directory);
while ($filename = readdir($fp))
{
if ($filename != "." && $filename != "..")
{
if (!is_file($filename))
{
$new_array[$filename] = $filename;
}
}
}
closedir($fp);
return($new_array);
}[/codebox]