This topic is locked

Custom Dropdown

5/12/2010 9:12:45 AM
PHPRunner General questions
D
dovercomputers author

I have created a dropdown box on the add/edit pages. I need to populate it with a list of files from a directory. I have the code to create the dropdown (see below) but where can I overwrite the phprunner generated code.
EDIT

I have put the code below in include/seo_settings.php

It works but can anyone tell me if this is the correct way to do it. Obviously this will get overwritten each time I make a new build as I edit the site.



$dirPath = dir('/home/kentwind/public_html/');

$fileArray = array();

while (($file = $dirPath->read()) !== false)

{

if (substr($file, -3)=="php")

{
$fileArray[ ] = trim($file);

}

}

$dirPath->close();

sort($fileArray);

$c = count($fileArray);

for($i=0; $i<$c; $i++)

{

$fdata["LookupValues"][]= $fileArray[$i];

}


Any ideas please?

A
ann 5/13/2010

Hi,
the easiest way to populate a dropdown is to edit generated file, as you did. To make changes in the PHPRunner code use the object $xt which holds all controls on the page in the Before Display event. Unfortunately we don't have a ready to go solution for this.