added support for template detection and selection

This commit is contained in:
seek3r 2001-01-05 22:38:08 +00:00
parent a7e2ac802f
commit da015de66d
2 changed files with 45 additions and 0 deletions

View File

@ -293,6 +293,29 @@
</tr>
<?php $selected = array(); ?>
<?php $selected[$current_config["template_set"]] = " selected"; ?>
<tr bgcolor="e6e6e6">
<td>Interface/Template Selection:<br> (if user choice, and they dont make a selection, then classic will be used)</td>
<td>
<select name="newsettings[template_set]">
<?php
$templates = $phpgw_setup->get_template_list();
while (list ($key, $value) = each ($templates)){
echo '<option value="'.$key.'" '.$selected[$key].'>'.$templates[$key]["title"].'</option>';
// echo '<option value="'.$key.'">'.$templates[$key]["title"].'</option>';
/*
echo "key= ".$key."<br>";
echo "value= ".$value."<br>";
echo "selected[value]= ".$selected[$key]."<br>";
echo "title= ".$templates[$key]["title"]."<br>";
*/
}
?>
</select>
</td>
</tr>
<?php $selected = array(); ?>
<?php $selected[$current_config["useframes"]] = " selected"; ?>
<tr bgcolor="e6e6e6">
<td>Frame support:</td>

View File

@ -275,6 +275,28 @@
return 10;
}
}
function get_template_list(){
global $phpgw_info;
$d = dir($phpgw_info["server"]["server_root"]."/phpgwapi/templates");
$list["user_choice"]["name"] = "user_choice";
$list["user_choice"]["title"] = "Users Choice";
while($entry=$d->read()) {
if ($entry != "CVS" && $entry != "." && $entry != ".."){
$list[$entry]["name"] = $entry;
$f = $phpgw_info["server"]["server_root"]."/phpgwapi/templates/details.inc.php";
if (file_exists ($f)){
include($f);
$list[$entry]["title"] = "Use ".$phpgw_info["template"][$entry]["title"]."interface";
}else{
$list[$entry]["title"] = $entry;
}
}
}
$d->close();
reset ($list);
return $list;
}
function app_setups($appname = ""){
global $phpgw_info;