Logo Search packages:      
Sourcecode: bamboo version File versions  Download package

tabs.php

<?php

if ($page->path == "/.trash" || $page->path == "/.clipboard")
      return;
      
function tab($label, $action, $default=false) {
    global $root;
    static $count=0;
    $count++;
    
    $key = preg_replace('!.*<u>(.*)</u>.*!i','$1',$label);
    $label = str_replace(' ', '&nbsp;', $label);

      $ea = get('eaction',get('ea',''));  
      if ($ea=='' || $ea=='save' || $ea=='saveview')
            $active = $default;
      else
            $active = $ea==$action;

      if ($action == 'view') {
            $query="";
      }
      else {
            $query="?a=edit&ea=$action";
      }
      $class = $active ? "class=here" : "";
      $accesskey = $key ? "accesskey=$key" : '';
      echo "<td $class class=tab$count>";
            echo alink($query, $label, $accesskey);
      echo "</td>\n";
}

?><table cellspacing=4><tr>
<?php

$tabs = @$GLOBALS['edit-tabs'];

if ($tabs) {
      foreach($tabs as $label => $info) {
            if (is_array($info)) {
                  $default = true;
                  $action = $info[0];
            }
            else {
                  $default = false;
                  $action = $info;
            }
            tab($label,$action,$default);
      }
}
else {
      tab('Page <u>I</u>nfo','info');
      tab('<u>E</u>dit Content','edit',true);
      tab('<u>P</u>roperties','props');
#     tab('Per<u>m</u>issions','perms');
      tab('<u>H</u>istory','history');
      tab('Vie<u>w</u> Site','view');
}

?>
</tr></table>

Generated by  Doxygen 1.6.0   Back to index