From 868c532beb36177688c60446212048def0ac3b04 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 10 Oct 2008 17:02:43 +0000 Subject: [PATCH] "link registry parameter with an extra options to egw_vfs::find, to eg. remove some files from the list of attachments" --- phpgwapi/inc/class.egw_link.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.egw_link.inc.php b/phpgwapi/inc/class.egw_link.inc.php index 6ee5f81f7f..9f6327df2d 100644 --- a/phpgwapi/inc/class.egw_link.inc.php +++ b/phpgwapi/inc/class.egw_link.inc.php @@ -47,7 +47,8 @@ * 'add_popup' => '400x300', // size of popup (XxY), if add is in popup * 'notify' => 'app.class.method', // method to be called if an other applications liks or unlinks with app: notify(array $data) * 'file_access' => 'app.class.method', // method to be called to check file access rights, see links_stream_wrapper class - * ); // boolean file_access(string $id,int $check,string $rel_path) + * // boolean file_access(string $id,int $check,string $rel_path) + * 'find_extra' => array('name_preg' => '/^(?!.picture.jpg)$/') // extra options to egw_vfs::find, to eg. remove some files from the list of attachments * } * All entries are optional, thought you only get conected functionality, if you implement them ... * @@ -878,8 +879,10 @@ class egw_link extends solink $url = self::vfs_path($app,$id); //error_log(__METHOD__."($app,$id) url=$url"); + if (!($extra = self::get_registry($app,'find_extra'))) $extra = array(); + $attached = array(); - if (($url2stats = egw_vfs::find($url,array('url'=>true,'need_mime'=>true,'type'=>'f'),true))) + if (($url2stats = egw_vfs::find($url,array('url'=>true,'need_mime'=>true,'type'=>'f')+$extra,true))) { $props = egw_vfs::propfind(array_keys($url2stats)); // get the comments foreach($url2stats as $url => &$fileinfo)