GetValue('template_engine','enable')) {
$template_xml = new Templates($ldapserver->server_id);
if ($config->GetValue('template_engine','disable_old'))
$templates = $template_xml->getTemplates();
else
$templates = array_merge($template_xml->getTemplates(),$templates);
}
# Remove non-visable templates.
foreach ($templates as $index => $template)
if (isset($template['visible']) && (! $template['visible']))
unset ($templates[$index]);
$templates['custom']['title'] = 'Custom';
$templates['custom']['icon'] = 'images/object.png';
$count = count( $templates );
foreach( $templates as $name => $template ) {
$i++;
# If the template doesnt have a title, we'll use the desc field.
$template['desc'] = isset($template['title']) ? $template['title'] : $template['desc'];
# Balance the columns properly
if( ( count( $templates ) % 2 == 0 && $i == intval( $count / 2 ) ) ||
( count( $templates ) % 2 == 1 && $i == intval( $count / 2 ) + 1 ) )
echo " |
|