1 | <?php |
||
24 | class ServiceFile extends Service { |
||
25 | |||
26 | |||
27 | /** |
||
28 | * getPublicArea |
||
29 | * |
||
30 | * Return the link which will be displayed in public area in summary page |
||
31 | */ |
||
32 | function getPublicArea() { |
||
33 | $html = ''; |
||
34 | $html .= '<p><a href="/file/showfiles.php?group_id='.$this->getGroupId().'">'; |
||
35 | $html .= $GLOBALS['Response']->getImage("ic/file.png", array('width'=>'20', 'height'=>'20', 'alt'=>$GLOBALS['Language']->getText('include_project_home','files'))); |
||
36 | $html .= ' '.$GLOBALS['Language']->getText('include_project_home','file_releases').'</a>'; |
||
37 | $html .= ' ( '.$GLOBALS['Language']->getText('include_project_home','packages',count($this->_getPackagesForUser(user_getid()))).' )'; |
||
38 | $html .= '</p>'; |
||
39 | return $html; |
||
40 | } |
||
41 | /** |
||
42 | * getSummaryPageContent |
||
43 | * |
||
44 | * Return the text to display on the summary page |
||
45 | * @return arr[title], arr[content] |
||
|
|||
46 | */ |
||
47 | function getSummaryPageContent() { |
||
48 | $hp = Codendi_HTMLPurifier::instance(); |
||
49 | $user = UserManager::instance()->getCurrentUser(); |
||
50 | $ret = array( |
||
51 | 'title' => $GLOBALS['Language']->getText('include_project_home','latest_file_releases'), |
||
52 | 'content' => '' |
||
53 | ); |
||
54 | |||
55 | $packages = $this->_getPackagesForUser($user->getId()); |
||
56 | if (count($packages)) { |
||
57 | $ret['content'] .= ' |
||
58 | <table cellspacing="1" cellpadding="5" width="100%" border="0"> |
||
59 | <tr class="boxitem"> |
||
60 | <td> |
||
61 | '.$GLOBALS['Language']->getText('include_project_home','package').' |
||
62 | </td> |
||
63 | <td> |
||
64 | '.$GLOBALS['Language']->getText('include_project_home','version').' |
||
65 | </td> |
||
66 | <td> |
||
67 | '.$GLOBALS['Language']->getText('include_project_home','download').' |
||
68 | </td> |
||
69 | </tr> |
||
70 | '; |
||
71 | require_once('FileModuleMonitorFactory.class.php'); |
||
72 | $fmmf = new FileModuleMonitorFactory(); |
||
73 | foreach($packages as $package) { |
||
74 | // the icon is different whether the package is monitored or not |
||
75 | if ($fmmf->isMonitoring($package['package_id'], $user, false)) { |
||
76 | $monitor_img = $GLOBALS['HTML']->getImage("ic/notification_stop.png",array('alt'=>$GLOBALS['Language']->getText('include_project_home', 'stop_monitoring'), 'title'=>$GLOBALS['Language']->getText('include_project_home', 'stop_monitoring'))); |
||
77 | } else { |
||
78 | $monitor_img = $GLOBALS['HTML']->getImage("ic/notification_start.png",array('alt'=>$GLOBALS['Language']->getText('include_project_home', 'start_monitoring'), 'title'=>$GLOBALS['Language']->getText('include_project_home', 'start_monitoring'))); |
||
79 | } |
||
80 | |||
81 | $ret['content'] .= ' |
||
82 | <TR class="boxitem"> |
||
83 | <TD> |
||
84 | <B>' . $hp->purify(util_unconvert_htmlspecialchars($package['package_name']), CODENDI_PURIFIER_CONVERT_HTML) . '</B> |
||
85 | <a HREF="/file/filemodule_monitor.php?filemodule_id=' . $package['package_id'] . '&group_id='.$this->getGroupId().'">'. |
||
86 | $monitor_img . ' |
||
87 | </a> |
||
88 | </TD>'; |
||
89 | // Releases to display |
||
90 | $ret['content'] .= '<TD>'. $hp->purify($package['release_name'], CODENDI_PURIFIER_CONVERT_HTML) .' <A href="/file/shownotes.php?group_id=' . $this->getGroupId() . '&release_id=' . $package['release_id'] . '">' . |
||
91 | $GLOBALS['HTML']->getImage("ic/text.png",array('alt'=>$GLOBALS['Language']->getText('include_project_home','release_notes'), 'title'=>$GLOBALS['Language']->getText('include_project_home','release_notes'))) . ' |
||
92 | </TD> |
||
93 | <TD><A HREF="/file/showfiles.php?group_id=' . $this->getGroupId() . '&release_id=' . $package['release_id'] . '">'.$GLOBALS['Language']->getText('include_project_home','download').'</A></TD></TR>'; |
||
94 | } |
||
95 | $ret['content'] .= '</table>'; |
||
96 | } else { |
||
97 | $ret['content'] .= '<b>'. $GLOBALS['Language']->getText('include_project_home','no_files_released') .'</b>'; |
||
98 | } |
||
99 | $ret['content'] .= ' |
||
100 | <div align="center"> |
||
101 | <a href="/file/showfiles.php?group_id='.$this->getGroupId().'">['.$GLOBALS['Language']->getText('include_project_home','view_all_files').']</A> |
||
102 | </div> |
||
103 | '; |
||
104 | return $ret; |
||
105 | } |
||
106 | |||
107 | private function getFRSPackageFactory() { |
||
111 | |||
112 | /** |
||
113 | * _getPackagesForUser |
||
114 | * |
||
115 | * return the packages the user can see |
||
116 | * |
||
117 | * @param user_id |
||
118 | */ |
||
119 | function _getPackagesForUser($user_id) { |
||
168 | } |
||
169 | ?> |
||
170 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.