mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-11 16:38:39 +01:00
added support for template detection and selection
This commit is contained in:
parent
a7e2ac802f
commit
da015de66d
@ -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>
|
||||
|
@ -276,6 +276,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
$d = dir($phpgw_info["server"]["server_root"]);
|
||||
|
Loading…
Reference in New Issue
Block a user