root/devel/mod/file/lib/files_user_info_menu.php

Revision 1539, 1.4 kB (checked in by renato, 1 year ago)

Setting prop svn:eol-style in LOTS of files.

  • Property svn:eol-style set to native
Line 
1 <?php
2 global $USER;
3 global $CFG;
4 global $page_owner;
5 $profile_id = $page_owner;
6
7 if ($page_owner != -1 && $page_owner != $USER->ident) {
8     $posts = count_records_select('files',"files_owner = $profile_id AND (".run("users:access_level_sql_where",$profile_id).")");
9     if ($USER->ident == $profile_id) {
10         $title = __gettext("Your Files");
11     } else {
12         $title = __gettext("Files");
13     }
14     
15     if ($posts == 1) {
16         $filesstring = $posts . " " . __gettext("file");
17     } else {
18         $filesstring = $posts . " " . __gettext("files");
19     }
20     
21     $weblog_username = user_info('username', $profile_id);
22     $fileStorage = __gettext("File Storage"); // gettext variable
23     $body = <<< END
24         <ul>
25             <li><a href="{$CFG->wwwroot}{$weblog_username}/files/">$fileStorage</a> <a href="{$CFG->wwwroot}{$weblog_username}/files/rss/"><img src="{$CFG->wwwroot}mod/template/icons/rss.png" alt="RSS" border="0" /></a><br />
26                 ({$filesstring})</li>
27         </ul>
28 END;
29
30     $run_result .= "<li id=\"sidebar_files\">";
31     $run_result .= templates_draw(array(
32                                         'context' => 'sidebarholder',
33                                         'title' => $title,
34                                         'body' => $body
35                                         )
36                                   );
37     $run_result .= "</li>";
38 }
39         
40 ?>
Note: See TracBrowser for help on using the browser.