r2282 fix broken nav link when viewing a file
authorAaron Dummer <aaron@dummer.info>
Tue, 11 Nov 2008 17:36:28 +0000 (17:36 +0000)
committerAaron Dummer <aaron@dummer.info>
Tue, 11 Nov 2008 17:36:28 +0000 (17:36 +0000)
inc/navigation.php
inc/pagetitles.php

index dae369d..8ca93ce 100644 (file)
@@ -671,7 +671,7 @@ $page['filesbylink']['bypass_type'] = 'string';
 $page['filesbylink']['parent'] = 'files';
 $ophandler['filesbylink']['default']['deleteFile'] = 'deleteFile';
 
-$page['file']['title'] = 'File';
+$page['file']['title_handler'] = 'dynamic_title_file';
 $page['file']['bypass'] = 'file_id';
 $page['file']['bypass_type'] = 'uint';
 $page['file']['parent'] = 'files';
index 4bcbb1f..9a16367 100644 (file)
@@ -200,6 +200,17 @@ function dynamic_title_file ()
        $ret = array();
        switch ($pageno)
        {
+               case 'file':
+                       assertUIntArg ('file_id', __FUNCTION__);
+                       $file = getFileInfo ($_REQUEST['file_id']);
+                       if ($file == NULL)
+                       {
+                               showError ('getFileInfo() failed', __FUNCTION__);
+                               return NULL;
+                       }
+                       $ret['name'] = $file['name'];
+                       $ret['params']['file_id'] = $_REQUEST['file_id'];
+                       break;
                case 'filesbylink':
                        assertStringArg ('entity_type', __FUNCTION__);
                        $ret['name'] = $_REQUEST['entity_type'];