~xibo-maintainers/xibo/brorsen

« back to all changes in this revision

Viewing changes to server/lib/pages/content.class.php

  • Committer: Dan Garner
  • Date: 2012-09-16 15:06:03 UTC
  • mfrom: (249.2.6 server-140rc1)
  • Revision ID: dan@xibo.org.uk-20120916150603-n8juk1anzq243fgz
MergedĀ lp:~dangarner/xibo/server-140rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
                $msgType        = __('Type');
95
95
                $msgRetired     = __('Retired');
96
96
                $msgOwner       = __('Owner');
97
 
                $msgShared      = __('Shared');
 
97
                $msgShowOriginal = __('Show the original file name for each media item?');
98
98
 
99
99
                $filterForm = <<<END
100
100
                        <div class="FilterDiv" id="LibraryFilter">
115
115
                                                <tr>
116
116
                                                        <td>$msgOwner</td>
117
117
                                                        <td>$user_list</td>
118
 
                                                        <td></td>
119
 
                                                        <td></td>
 
118
                                                        <td colspan="4"><input type="checkbox" name="filter_showOriginal" id="filter_showOriginal" /><label for="filter_showOriginal">$msgShowOriginal</label></td>
120
119
                                                </tr>
121
120
                                        </table>
122
121
                        </form>
154
153
                $shared                 = Kit::GetParam('shared', _REQUEST, _STRING);
155
154
                $filter_userid  = Kit::GetParam('filter_userid', _REQUEST, _STRING, 'all');
156
155
                $filter_retired = Kit::GetParam('filter_retired', _REQUEST, _STRING, 'all');
 
156
                $filterShowOriginal = Kit::GetParam('filter_showOriginal', _REQUEST, _CHECKBOX, 'off');
157
157
                
158
158
                setSession('content', 'mediatype', $mediatype);
159
159
                setSession('content', 'name', $name);
169
169
                $SQL .= "        media.duration, ";
170
170
                $SQL .= "        media.userID, ";
171
171
                $SQL .= "        media.FileSize, ";
172
 
                $SQL .= "        IFNULL((SELECT parentmedia.mediaid FROM media parentmedia WHERE parentmedia.editedmediaid = media.mediaid),0) AS ParentID ";
 
172
                $SQL .= "        IFNULL((SELECT parentmedia.mediaid FROM media parentmedia WHERE parentmedia.editedmediaid = media.mediaid),0) AS ParentID, ";
 
173
                $SQL .= "        media.originalFileName ";
173
174
                $SQL .= "FROM    media ";
174
175
                $SQL .= " LEFT OUTER JOIN media parentmedia ";
175
176
                $SQL .= " ON parentmedia.MediaID = media.MediaID ";
208
209
                // Messages
209
210
                $msgName        = __('Name');
210
211
                $msgType        = __('Type');
211
 
                $msgRetired     = __('Retired');
212
212
                $msgOwner       = __('Owner');
213
213
                $msgFileSize    = __('Size');
214
214
                $msgRevisions = __('Revised');
 
215
                $msgOriginal = __('Original Filename');
215
216
                $msgShared      = __('Permissions');
216
217
                $msgAction      = __('Action');
217
218
 
218
 
        $output = <<<END
219
 
                        <div class="info_table">
220
 
                    <table style="width:100%">
221
 
                        <thead>
222
 
                            <tr>
223
 
                                <th>$msgName</th>
224
 
                                <th>$msgType</th>
225
 
                                <th>h:mi:ss</th>            
226
 
                                <th>$msgFileSize</th>
227
 
                                <th>$msgOwner</th>
228
 
                                <th>$msgShared</th>       
229
 
                                <th>$msgRevisions</th>
230
 
                                <th>$msgAction</th>     
231
 
                            </tr>
232
 
                        </thead>
233
 
                        <tbody>
234
 
END;
 
219
        $output = '';
 
220
        $output.= '<div class="info_table">';
 
221
        $output.= ' <table style="width:100%">';
 
222
        $output.= '     <thead>';
 
223
        $output.= '         <tr>';
 
224
        $output.= '             <th>' . $msgName . '</th>';
 
225
        $output.= '             <th>' . $msgType . '</th>';
 
226
        $output.= '             <th>h:mi:ss</th>';         
 
227
        $output.= '             <th>' . $msgFileSize . '</th>';
 
228
        $output.= '             <th>' . $msgOwner . '</th>';
 
229
        $output.= '             <th>' . $msgShared . '</th>';      
 
230
        $output.= '             <th>' . $msgRevisions . '</th>';
 
231
        
 
232
        if ($filterShowOriginal == 1)
 
233
            $output.= '             <th>' . $msgOriginal . '</th>';
 
234
        
 
235
        $output.= '             <th>' . $msgAction . '</th>'; 
 
236
        $output.= '         </tr>';
 
237
        $output.= '     </thead>';
 
238
        $output.= '     <tbody>';
235
239
                
236
240
        while ($aRow = $db->get_row($results))
237
241
        {
242
246
            $ownerid            = Kit::ValidateParam($aRow[4], _INT);
243
247
            $fileSize = Kit::ValidateParam($aRow[5], _INT);
244
248
            $revisions = (Kit::ValidateParam($aRow[6], _INT) != 0) ? '<img src="img/act.gif" />' : '';
245
 
 
 
249
            $originalFileName = Kit::ValidateParam($aRow[7], _STRING);
 
250
            
246
251
            // Size in MB
247
252
            $sz = 'BKMGTP';
248
253
            $factor = floor((strlen($fileSize) - 1) / 3);
277
282
                $output .= "<td>$username</td>";
278
283
                $output .= "<td>$group</td>";
279
284
                $output .= '<td>' . $revisions . '</td>';
 
285
                
 
286
                if ($filterShowOriginal == 1)
 
287
                    $output .= '<td>' . $originalFileName . '</td>';
280
288
 
281
289
                // ACTION buttons
282
290
                if ($auth->edit)
329
337
                $response = new ResponseManager();
330
338
                
331
339
                // Get a list of the enabled modules and then create buttons for them
332
 
                if (!$enabledModules = new ModuleManager($db, $user, 0)) trigger_error($enabledModules->message, E_USER_ERROR);
 
340
                if (!$enabledModules = new ModuleManager($db, $user, 0)) 
 
341
                    trigger_error($enabledModules->message, E_USER_ERROR);
333
342
                
334
343
                $buttons = '';
335
344