feha
Posts: 712
|
Posted: 04/17/2006, 1:48 AM |
|
Here is a function i created to read Styles dir and make a listbox of found Styles ...
//============================================================================
function VISION_TO_STYLES_BOX ($dirName = "../Styles", $select_text = "Styles") {
global $option;
$d = dir($dirName);
while($entry = $d->read())
{
if ($entry != "." && $entry != "..")
{
if (is_dir($dirName."/".$entry) )
{
if(CCGetSession(style) == $entry )
{
$option .="<option selected=\"selected\" value=\"$entry\">$entry</option>\n";
}
else
{
$option .="<option value=\"$entry\">$entry</option>\n";
}
}
}
}
$d->close();
return "<select class=\"VisionToSelect\" name=\"style\" size=\"1\" >\n<option value=\"\"> $select_text </option>\n".$option."</select>\n";
}
//echo VISION_TO_STYLES_BOX();exit;
//============================================================================
Note: You need to create your own form tags or use it within any form ...
you can put the function call into label (HTML) wherever you want to display styles ...
When you add new Style it will be listed in Styles Box ...
Enjoy
feha
_________________
Regards
feha
www.vision.to
feedpixel.com |