[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7100] Frontend: filter on valid doc-types
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7100] Frontend: filter on valid doc-types |
Date: |
Wed, 09 Mar 2011 14:30:47 +0000 |
Revision: 7100
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7100
Author: sigurdne
Date: 2011-03-09 14:30:46 +0000 (Wed, 09 Mar 2011)
Log Message:
-----------
Frontend: filter on valid doc-types
Modified Paths:
--------------
trunk/frontend/inc/class.uidrawings.inc.php
trunk/frontend/templates/base/config.tpl
Modified: trunk/frontend/inc/class.uidrawings.inc.php
===================================================================
--- trunk/frontend/inc/class.uidrawings.inc.php 2011-03-09 11:55:14 UTC (rev
7099)
+++ trunk/frontend/inc/class.uidrawings.inc.php 2011-03-09 14:30:46 UTC (rev
7100)
@@ -73,23 +73,31 @@
}
}
-
//----------------------------------------------datatable settings--------
+ $valid_types =
isset($config->config_data['document_valid_types']) &&
$config->config_data['document_valid_types'] ? str_replace ( ',' , '|' ,
$config->config_data['document_valid_types'] ) : '';
+
$content = array();
- foreach($document_list as $entry)
+ if($valid_types)
{
- $content[] = array
- (
- 'document_id' =>
$entry['document_id'],
- 'document_name' =>
$entry['document_name'],
- 'link'
=> $entry['link'],
- 'title'
=> $entry['title'],
- 'doc_type'
=> $entry['doc_type'],
+ foreach($document_list as $entry)
+ {
+ if (
!preg_match("/({$valid_types})$/i", $entry['document_name']) )
+ {
+ continue;
+ }
+
+ $content[] = array
+ (
+ 'document_id'
=> $entry['document_id'],
+ 'document_name'
=> $entry['document_name'],
+ 'link'
=> $entry['link'],
+ 'title'
=> $entry['title'],
+ 'doc_type'
=> $entry['doc_type'],
'document_date' =>
$GLOBALS['phpgw']->common->show_date($entry['document_date'],$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']),
- );
+ );
+ }
}
-
$datavalues[0] = array
(
'name' => "0",
Modified: trunk/frontend/templates/base/config.tpl
===================================================================
--- trunk/frontend/templates/base/config.tpl 2011-03-09 11:55:14 UTC (rev
7099)
+++ trunk/frontend/templates/base/config.tpl 2011-03-09 14:30:46 UTC (rev
7100)
@@ -81,6 +81,10 @@
</table>
</td>
</tr>
+ <tr class="row_on">
+ <td>{lang_document_valid_types}(comma separated list of
valid filetypes):</td>
+ <td><input name="newsettings[document_valid_types]"
value="{value_document_valid_types}"></td>
+ </tr>
<tr class="row_off">
<td>{lang_delegate_limit}:</td>
<td><input name="newsettings[delegate_limit]"
value="{value_delegate_limit}"></td>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7100] Frontend: filter on valid doc-types,
Sigurd Nes <=