Not sure if this topic should be under templates, but couldn’t figure out where else to place it. I made a little hack in the file "document_data.static.php". Instead of only showing if web access to a certain document is "Public" or "Private", it will show which document groups are linked in case it is private. I made this hack to make life a bit easier. Hopefully you find it usefull too.
If you want to try it out do the following:
- open document_data.static.php in your editor
- goto line 268
- replace:
<tr>
<td><?php echo $_lang["page_data_web_access"]; ?>: </td>
<td><?php echo $content['privateweb']==0 ? $_lang['public'] : "<b style='color: #821517'>".$_lang['private']."</b> <img src='media/style/".($manager_theme ? "$manager_theme/":"")."images/icons/secured.gif' align='absmiddle' width='16' height='16' />"; ?></td>
</tr>
<?php
// START :: KvZ - 2008-04-03
// ---------------------------------------
// Get document groupnames in case $content['privateweb'] > 0.
// In other words: when document is not public in front-end
// ---------------------------------------
$kvzDocGrps = "";
if($content['privateweb'] != 0)
{
$tbldg = $dbase . ".`" . $table_prefix . "document_groups`";
$tbldgn = $dbase . ".`" . $table_prefix . "documentgroup_names`";
$sql = "SELECT dgn.name FROM $tbldg dg LEFT JOIN $tbldgn dgn ON dgn.id=dg.document_group WHERE dg.document=".$id." ORDER BY dgn.name ASC;";
$kvzr = mysql_query($sql);
if (mysql_num_rows($kvzr) > 0)
{
$kvzDocGrps .= "<b style='color: #821517'>".$_lang['private']."</b> <img src='media/style/".($manager_theme ? "$manager_theme/":"")."images/icons/secured.gif' align='absmiddle' width='16' height='16' />";
while ($kvz = mysql_fetch_object($kvzr))
{
$kvzDocGrps .= "<br /><font style='color: #821517'>".$kvz->name."</font>";
}
}
}
//Original code:
//
//<tr>
// <td><?php echo $_lang["page_data_web_access"]; ?>: </td>
// <td><?php echo $content['privateweb']==0 ? $_lang['public'] : "<b style='color: #821517'>".$_lang['private']."</b> <img src='media/style/".($manager_theme ? "$manager_theme/":"")."images/icons/secured.gif' align='absmiddle' width='16' height='16' />"; ?></td>
//</tr>
//
//New code:
?>
<tr>
<td style="vertical-align: top;"><?php echo $_lang["page_data_web_access"]; ?>: </td>
<td style="vertical-align: top;"><?php echo $content['privateweb']==0 ? $_lang['public'] : $kvzDocGrps ? $kvzDocGrps : "<b style='color: #821517'>".$_lang['private']."</b> <img src='media/style/".($manager_theme ? "$manager_theme/":"")."images/icons/secured.gif' align='absmiddle' width='16' height='16' />"; ?></td>
</tr>
<?php
// END :: KvZ - 2008-04-03
?>
For those about to rock... I salute you