From: <sy...@us...> - 2010-10-27 13:44:51
|
Revision: 30346 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30346&view=rev Author: sylvieg Date: 2010-10-27 13:44:45 +0000 (Wed, 27 Oct 2010) Log Message: ----------- [FIX]FILE: display the name or the filename of the fileId if no data is given to avoid a link on a space Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-10-27 13:25:55 UTC (rev 30345) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-10-27 13:44:45 UTC (rev 30346) @@ -48,7 +48,7 @@ 'date' => array( 'required' => false, 'name' => tra('Date'), - 'description' => tra('Pick the archive if exists created just before the date'), + 'description' => tra('Pick the archive if exists created just before the date of the fileId'), ), ), ); @@ -58,6 +58,7 @@ { global $tikilib, $prefs; if (isset($params['fileId'])) { + global $filegallib; include_once ('lib/filegals/filegallib.php'); if ($prefs['feature_file_galleries'] != 'y') { return; } @@ -75,14 +76,19 @@ } $wikipluginFileDate = $date; } - global $filegallib; include_once ('lib/filegals/filegallib.php'); $fileId = $filegallib->getArchiveJustBefore($fileId, $date); if (empty($fileId)) { return tra('No such file'); } + } else { + $info = $filegallib->get_file_info($fileId); + if (empty($info)) { + return tra('Incorrect param').' fileId'; + } } + if (empty($data)) { // to avaoid problem with parsing - $data = ' '; + $data = empty($info['name'])?$info['filename']: $info['name']; } return "[tiki-download_file.php?fileId=$fileId|$data]"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ch...@us...> - 2010-10-27 14:59:01
|
Revision: 30350 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30350&view=rev Author: chealer Date: 2010-10-27 14:58:55 +0000 (Wed, 27 Oct 2010) Log Message: ----------- Plugin FILE: clarify how to use [FIX] remove absolute dependency on feature_wiki_attachments, since FILE now also supports files from galleries I'm not sure about the way it now complains when feature_wiki_attachments is actually missing. Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-10-27 14:55:56 UTC (rev 30349) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-10-27 14:58:55 UTC (rev 30350) @@ -10,8 +10,8 @@ return array( 'name' => tra( 'File' ), 'documentation' => 'PluginFile', - 'description' => tra("Displays a link to an attachment to a wiki page and can display an image attachment. "), - 'prefs' => array( 'feature_wiki_attachments', 'wikiplugin_file' ), + 'description' => tra("Displays a link to a file (either from the file gallery or an attachment to a wiki page) and can display an image attachment."), + 'prefs' => array( 'wikiplugin_file' ), 'inline' => true, 'params' => array( 'name' => array( @@ -22,12 +22,12 @@ 'desc' => array( 'required' => false, 'name' => tra('Description'), - 'description' => tra('Comment'), + 'description' => tra('Wiki attachment:') . ' ' . tra('Comment'), ), 'page' => array( 'required' => false, 'name' => tra('Page'), - 'description' => tra("Gives the name of another page the attached file is on. The file on that page is linked to instead. Only works with wiki pages"), + 'description' => tra('Wiki attachment:') . ' ' . tra("Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page."), ), 'showdesc' => array( 'required' => false, @@ -37,20 +37,20 @@ 'image' =>array( 'required' => false, 'name' => tra('Image'), - 'description' => tra("Says that this file is an image, and should be displayed inline using the img tag"), + 'description' => tra('Wiki attachment:') . ' ' . tra("Says that this file is an image, and should be displayed inline using the img tag"), ), 'fileId' => array( 'required' => false, - 'name' => tra('File ID'), - 'description' => tra('Numeric ID of a file in the file galleries'), + 'name' => tra('File identifier'), + 'description' => tra('File from gallery:') . ' ' . tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', 'filter' => 'digits', ), 'date' => array( 'required' => false, 'name' => tra('Date'), - 'description' => tra('Pick the archive if exists created just before the date of the fileId'), + 'description' => tra('File from gallery:') . ' ' . tra('Pick the archive if exists created just before the date of the fileId'), ), - ), + ) ); } @@ -93,6 +93,9 @@ return "[tiki-download_file.php?fileId=$fileId|$data]"; } + if ($prefs['feature_wiki_attachments'] != 'y') { + return "<span class='warn'>" . tra("Wiki attachments are disabled."). "</span>"; + } $filedata = array(); $filedata["name"] = ''; $filedata["desc"] = ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Sylvie G. <sgr...@gm...> - 2010-10-29 19:12:34
|
Chealer As I have a conflict while merging on this one <<<<<<< .working 'description' => tra('Used as link label instead of the file name or file description'), ======= 'description' => tra('Wiki attachment:') . ' ' . tra('Comment'), >>>>>>> .merge-right.r30411 Both commit are yours 30113 and r30350 So which one do you prefer? Thanks On Wed, 2010-10-27 at 14:58 +0000, ch...@us... wrote: > Revision: 30350 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30350&view=rev > Author: chealer > Date: 2010-10-27 14:58:55 +0000 (Wed, 27 Oct 2010) > > Log Message: > ----------- > Plugin FILE: > clarify how to use > [FIX] remove absolute dependency on feature_wiki_attachments, since FILE now also supports files from galleries > I'm not sure about the way it now complains when feature_wiki_attachments is actually missing. > > Modified Paths: > -------------- > branches/6.x/lib/wiki-plugins/wikiplugin_file.php > > Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php > =================================================================== > --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-10-27 14:55:56 UTC (rev 30349) > +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-10-27 14:58:55 UTC (rev 30350) > @@ -10,8 +10,8 @@ > return array( > 'name' => tra( 'File' ), > 'documentation' => 'PluginFile', > - 'description' => tra("Displays a link to an attachment to a wiki page and can display an image attachment. "), > - 'prefs' => array( 'feature_wiki_attachments', 'wikiplugin_file' ), > + 'description' => tra("Displays a link to a file (either from the file gallery or an attachment to a wiki page) and can display an image attachment."), > + 'prefs' => array( 'wikiplugin_file' ), > 'inline' => true, > 'params' => array( > 'name' => array( > @@ -22,12 +22,12 @@ > 'desc' => array( > 'required' => false, > 'name' => tra('Description'), > - 'description' => tra('Comment'), > + 'description' => tra('Wiki attachment:') . ' ' . tra('Comment'), > ), > 'page' => array( > 'required' => false, > 'name' => tra('Page'), > - 'description' => tra("Gives the name of another page the attached file is on. The file on that page is linked to instead. Only works with wiki pages"), > + 'description' => tra('Wiki attachment:') . ' ' . tra("Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page."), > ), > 'showdesc' => array( > 'required' => false, > @@ -37,20 +37,20 @@ > 'image' =>array( > 'required' => false, > 'name' => tra('Image'), > - 'description' => tra("Says that this file is an image, and should be displayed inline using the img tag"), > + 'description' => tra('Wiki attachment:') . ' ' . tra("Says that this file is an image, and should be displayed inline using the img tag"), > ), > 'fileId' => array( > 'required' => false, > - 'name' => tra('File ID'), > - 'description' => tra('Numeric ID of a file in the file galleries'), > + 'name' => tra('File identifier'), > + 'description' => tra('File from gallery:') . ' ' . tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', > 'filter' => 'digits', > ), > 'date' => array( > 'required' => false, > 'name' => tra('Date'), > - 'description' => tra('Pick the archive if exists created just before the date of the fileId'), > + 'description' => tra('File from gallery:') . ' ' . tra('Pick the archive if exists created just before the date of the fileId'), > ), > - ), > + ) > ); > } > > @@ -93,6 +93,9 @@ > return "[tiki-download_file.php?fileId=$fileId|$data]"; > } > > + if ($prefs['feature_wiki_attachments'] != 'y') { > + return "<span class='warn'>" . tra("Wiki attachments are disabled."). "</span>"; > + } > $filedata = array(); > $filedata["name"] = ''; > $filedata["desc"] = ''; > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs |
From: <ch...@us...> - 2010-10-29 21:18:00
|
Revision: 30417 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30417&view=rev Author: chealer Date: 2010-10-29 21:17:54 +0000 (Fri, 29 Oct 2010) Log Message: ----------- FILE plugin: improve description of remaining parameters Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-10-29 20:51:05 UTC (rev 30416) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-10-29 21:17:54 UTC (rev 30417) @@ -17,7 +17,7 @@ 'name' => array( 'required' => false, 'name' => tra('Name'), - 'description' => tra("Gives the name of the attached file to link to"), + 'description' => tra('Wiki attachment:') . ' ' . tra("Gives the name of the attached file to link to"), ), 'desc' => array( 'required' => false, @@ -32,7 +32,7 @@ 'showdesc' => array( 'required' => false, 'name' => tra('Show description'), - 'description' => tra("Shows the description as the link text instead of the file name"), + 'description' => tra('Wiki attachment:') . ' ' . tra("Shows the description as the link text instead of the file name"), ), 'image' =>array( 'required' => false, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <xa...@us...> - 2010-11-18 15:43:14
|
Revision: 30771 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30771&view=rev Author: xavidp Date: 2010-11-18 15:43:08 +0000 (Thu, 18 Nov 2010) Log Message: ----------- [ENH]Add the option to "Pick a file" next to the from field for FileId, in a similar way to what it was added in PluginFiles Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-18 15:26:02 UTC (rev 30770) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-18 15:43:08 UTC (rev 30771) @@ -24,17 +24,17 @@ 'name' => tra('Description'), 'description' => tra('Wiki attachment:') . ' ' . tra('Comment'), ), - 'page' => array( + 'page' => array( 'required' => false, 'name' => tra('Page'), 'description' => tra('Wiki attachment:') . ' ' . tra("Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page."), ), - 'showdesc' => array( + 'showdesc' => array( 'required' => false, 'name' => tra('Show description'), 'description' => tra('Wiki attachment:') . ' ' . tra("Shows the description as the link text instead of the file name"), ), - 'image' =>array( + 'image' =>array( 'required' => false, 'name' => tra('Image'), 'description' => tra('Wiki attachment:') . ' ' . tra("Says that this file is an image, and should be displayed inline using the img tag"), @@ -43,6 +43,9 @@ 'required' => false, 'name' => tra('File identifier'), 'description' => tra('File from gallery:') . ' ' . tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', + 'type' => 'fileId', + 'area' => 'fgal_picker_id', + 'separator' => ':', 'filter' => 'digits', ), 'date' => array( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <xa...@us...> - 2010-11-18 15:51:05
|
Revision: 30772 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30772&view=rev Author: xavidp Date: 2010-11-18 15:50:58 +0000 (Thu, 18 Nov 2010) Log Message: ----------- [MOD]Simplified the interface for common usage, and extra params are found under the advanced tab Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-18 15:43:08 UTC (rev 30771) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-18 15:50:58 UTC (rev 30772) @@ -14,8 +14,17 @@ 'prefs' => array( 'wikiplugin_file' ), 'inline' => true, 'params' => array( - 'name' => array( + 'fileId' => array( 'required' => false, + 'name' => tra('File identifier'), + 'description' => tra('File from gallery:') . ' ' . tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', + 'type' => 'fileId', + 'area' => 'fgal_picker_id', + 'separator' => ':', + 'filter' => 'digits', + ), + 'name' => array( + 'required' => false, 'name' => tra('Name'), 'description' => tra('Wiki attachment:') . ' ' . tra("Gives the name of the attached file to link to"), ), @@ -23,35 +32,31 @@ 'required' => false, 'name' => tra('Description'), 'description' => tra('Wiki attachment:') . ' ' . tra('Comment'), + 'advanced' => true, ), 'page' => array( 'required' => false, 'name' => tra('Page'), 'description' => tra('Wiki attachment:') . ' ' . tra("Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page."), + 'advanced' => true, ), 'showdesc' => array( 'required' => false, 'name' => tra('Show description'), 'description' => tra('Wiki attachment:') . ' ' . tra("Shows the description as the link text instead of the file name"), + 'advanced' => true, ), 'image' =>array( 'required' => false, 'name' => tra('Image'), 'description' => tra('Wiki attachment:') . ' ' . tra("Says that this file is an image, and should be displayed inline using the img tag"), + 'advanced' => true, ), - 'fileId' => array( - 'required' => false, - 'name' => tra('File identifier'), - 'description' => tra('File from gallery:') . ' ' . tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', - 'type' => 'fileId', - 'area' => 'fgal_picker_id', - 'separator' => ':', - 'filter' => 'digits', - ), 'date' => array( 'required' => false, 'name' => tra('Date'), 'description' => tra('File from gallery:') . ' ' . tra('Pick the archive if exists created just before the date of the fileId'), + 'advanced' => true, ), ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <xa...@us...> - 2010-11-19 12:14:47
|
Revision: 30783 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30783&view=rev Author: xavidp Date: 2010-11-19 12:14:41 +0000 (Fri, 19 Nov 2010) Log Message: ----------- [bp/r30623 & r30624]adding new param type and setting other params as children of one of the values of type param for wikiplugin_file.php + replacing four spaces with tab. Thanks rodrigo_sampaio Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-19 12:11:47 UTC (rev 30782) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-19 12:14:41 UTC (rev 30783) @@ -14,49 +14,61 @@ 'prefs' => array( 'wikiplugin_file' ), 'inline' => true, 'params' => array( - 'fileId' => array( - 'required' => false, - 'name' => tra('File identifier'), - 'description' => tra('File from gallery:') . ' ' . tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', - 'type' => 'fileId', - 'area' => 'fgal_picker_id', - 'separator' => ':', - 'filter' => 'digits', + 'type' => array( + 'required' => true, + 'name' => tra('Type'), + 'options' => array( + array('text' => tra('Select an option'), 'value' => ''), + array('text' => tra('Wiki page attachment'), 'value' => 'attachment'), + array('text' => tra('File from file gallery'), 'value' => 'gallery'), + ), ), 'name' => array( - 'required' => false, + 'required' => true, 'name' => tra('Name'), - 'description' => tra('Wiki attachment:') . ' ' . tra("Gives the name of the attached file to link to"), + 'description' => tra("Gives the name of the attached file to link to"), + 'parent' => array('name' => 'type', 'value' => 'attachment'), ), 'desc' => array( 'required' => false, 'name' => tra('Description'), - 'description' => tra('Wiki attachment:') . ' ' . tra('Comment'), - 'advanced' => true, + 'description' => tra('Used as link label'), + 'parent' => array('name' => 'type', 'value' => 'attachment'), ), 'page' => array( 'required' => false, 'name' => tra('Page'), - 'description' => tra('Wiki attachment:') . ' ' . tra("Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page."), - 'advanced' => true, + 'description' => tra("Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page."), + 'parent' => array('name' => 'type', 'value' => 'attachment'), ), 'showdesc' => array( 'required' => false, - 'name' => tra('Show description'), - 'description' => tra('Wiki attachment:') . ' ' . tra("Shows the description as the link text instead of the file name"), - 'advanced' => true, + 'name' => tra('Show attachment description'), + 'description' => tra("Show the attachment description as the link label instead of the attachment name."), + 'options' => array( + array('text' => tra('No'), 'value' => ''), + array('text' => tra('Yes'), 'value' => 'y'), + ), + 'parent' => array('name' => 'type', 'value' => 'attachment'), ), 'image' =>array( 'required' => false, 'name' => tra('Image'), - 'description' => tra('Wiki attachment:') . ' ' . tra("Says that this file is an image, and should be displayed inline using the img tag"), - 'advanced' => true, + 'description' => tra("Says that this file is an image, and should be displayed inline using the img tag"), + 'parent' => array('name' => 'type', 'value' => 'attachment'), ), + 'fileId' => array( + 'required' => true, + 'name' => tra('File identifier'), + 'description' => tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', + 'filter' => 'digits', + 'parent' => array('name' => 'type', 'value' => 'gallery'), + ), 'date' => array( 'required' => false, 'name' => tra('Date'), - 'description' => tra('File from gallery:') . ' ' . tra('Pick the archive if exists created just before the date of the fileId'), - 'advanced' => true, + 'description' => tra('Pick the archive if exists created just before the date of the fileId'), + 'parent' => array('name' => 'type', 'value' => 'gallery'), ), ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <xa...@us...> - 2010-11-19 13:07:02
|
Revision: 30787 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30787&view=rev Author: xavidp Date: 2010-11-19 13:06:56 +0000 (Fri, 19 Nov 2010) Log Message: ----------- [ENH]Option to have a popup to 'Pick a file' re-added to wikiplugin_file.php, but this time working successfully, and a few params tagged as advanced to clear the interface. Also, after agreeing with rodrigo_sampaio, set File from gallery" as the option shown by default, to avoid two extra clicks for the common task to select or add a file to a file gallery and link it from that textarea (wiki page or wherever else in tiki has a textarea). thanks rodrigo_sampaio, and chealer for previous improvmenets in trunk, which I backported in previous commits Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-19 13:01:50 UTC (rev 30786) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-19 13:06:56 UTC (rev 30787) @@ -12,15 +12,16 @@ 'documentation' => 'PluginFile', 'description' => tra("Displays a link to a file (either from the file gallery or an attachment to a wiki page) and can display an image attachment."), 'prefs' => array( 'wikiplugin_file' ), + 'icon' => 'pics/large/file-manager.png', 'inline' => true, 'params' => array( 'type' => array( 'required' => true, 'name' => tra('Type'), + 'description' => tra('Choose either File from gallery or Wiki page attachment.'), 'options' => array( - array('text' => tra('Select an option'), 'value' => ''), + array('text' => tra('File from file gallery'), 'value' => 'gallery'), array('text' => tra('Wiki page attachment'), 'value' => 'attachment'), - array('text' => tra('File from file gallery'), 'value' => 'gallery'), ), ), 'name' => array( @@ -34,12 +35,14 @@ 'name' => tra('Description'), 'description' => tra('Used as link label'), 'parent' => array('name' => 'type', 'value' => 'attachment'), + 'advanced' => true, ), 'page' => array( 'required' => false, 'name' => tra('Page'), 'description' => tra("Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page."), 'parent' => array('name' => 'type', 'value' => 'attachment'), + 'advanced' => true, ), 'showdesc' => array( 'required' => false, @@ -50,17 +53,21 @@ array('text' => tra('Yes'), 'value' => 'y'), ), 'parent' => array('name' => 'type', 'value' => 'attachment'), + 'advanced' => true, ), 'image' =>array( 'required' => false, 'name' => tra('Image'), 'description' => tra("Says that this file is an image, and should be displayed inline using the img tag"), 'parent' => array('name' => 'type', 'value' => 'attachment'), + 'advanced' => true, ), 'fileId' => array( 'required' => true, 'name' => tra('File identifier'), 'description' => tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', + 'type' => 'fileId', + 'area' => 'fgal_picker_id', 'filter' => 'digits', 'parent' => array('name' => 'type', 'value' => 'gallery'), ), @@ -69,6 +76,7 @@ 'name' => tra('Date'), 'description' => tra('Pick the archive if exists created just before the date of the fileId'), 'parent' => array('name' => 'type', 'value' => 'gallery'), + 'advanced' => true, ), ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <xa...@us...> - 2010-11-22 13:24:57
|
Revision: 30840 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=30840&view=rev Author: xavidp Date: 2010-11-22 13:24:51 +0000 (Mon, 22 Nov 2010) Log Message: ----------- [FIX]Forgot to add the link to the image/icon. Still not clear how to force the icon size to be 16x16 Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-22 12:31:30 UTC (rev 30839) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-11-22 13:24:51 UTC (rev 30840) @@ -128,7 +128,7 @@ $data = empty($info['name'])?$info['filename']: $info['name']; } if (isset($params['showicon']) & $params['showicon'] == "y") { - return "{img src=tiki-download_file.php?fileId=$fileId&thumbnail=y width=16} [tiki-download_file.php?fileId=$fileId|$data]"; + return "{img src=tiki-download_file.php?fileId=$fileId&thumbnail=y&x=16 link=tiki-download_file.php?fileId=$fileId} [tiki-download_file.php?fileId=$fileId|$data]"; } else { return "[tiki-download_file.php?fileId=$fileId|$data]"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <li...@us...> - 2010-12-05 18:44:05
|
Revision: 31140 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=31140&view=rev Author: lindonb Date: 2010-12-05 18:43:57 +0000 (Sun, 05 Dec 2010) Log Message: ----------- Add options, default fields and other cleanup to plugin info for use in plugin edit popup and plugin manager, Also pulled info related changes made in trunk to hopefully avoid merge conflicts. Modified Paths: -------------- branches/6.x/lib/wiki-plugins/wikiplugin_file.php Modified: branches/6.x/lib/wiki-plugins/wikiplugin_file.php =================================================================== --- branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-12-05 17:55:23 UTC (rev 31139) +++ branches/6.x/lib/wiki-plugins/wikiplugin_file.php 2010-12-05 18:43:57 UTC (rev 31140) @@ -7,10 +7,11 @@ function wikiplugin_file_info() { - return array( + global $prefs; + $info = array( 'name' => tra( 'File' ), - 'documentation' => 'PluginFile', - 'description' => tra("Displays a link to a file (either from the file gallery or an attachment to a wiki page) and can display an image attachment. For more than one file from file galleries, or more optional information shown from the file/s, use the plugin FILES instead"), + 'documentation' => tra('PluginFile'), + 'description' => tra('Displays a link to a file (either from the file gallery or an attachment to a wiki page) and can display an image attachment. For more than one file from file galleries, or more optional information shown from the files, use the plugin FILES instead'), 'prefs' => array( 'wikiplugin_file' ), 'body' => tra('Label for the link to the file'), 'icon' => 'pics/icons/file-manager.png', @@ -19,76 +20,104 @@ 'type' => array( 'required' => true, 'name' => tra('Type'), - 'description' => tra('Choose either File from gallery or Wiki page attachment.'), + 'description' => tra('Indicate whether the file is in a file gallery or is a wiki page attachment'), + 'filter' => 'alpha', + 'default' => '', 'options' => array( - array('text' => tra('File from file gallery'), 'value' => 'gallery'), - array('text' => tra('Wiki page attachment'), 'value' => 'attachment'), - ), + array('text' => '', 'value' => ''), + ), //rest filled in below ), 'name' => array( 'required' => true, 'name' => tra('Name'), - 'description' => tra("Gives the name of the attached file to link to"), + 'description' => tra('Identify an attachment by entering its file name, which will show as a link to the file. + If the page parameter is empty, it must be a file name of an attachment to the page where the plugin is used.'), + 'default' => '', 'parent' => array('name' => 'type', 'value' => 'attachment'), ), 'desc' => array( 'required' => false, - 'name' => tra('Description'), - 'description' => tra('Used as link label'), + 'name' => tra('Custom Description'), + 'description' => tra('Custom text that will be used for the link instead of the file name or file description'), 'parent' => array('name' => 'type', 'value' => 'attachment'), 'advanced' => true, + 'default' => '', ), 'page' => array( 'required' => false, 'name' => tra('Page'), - 'description' => tra("Name of the wiki page the file is attached to. If left empty when the plugin is used on a wiki page, this defaults to that wiki page."), + 'description' => tra('Name of the wiki page the file is attached to. Defaults to the wiki page where the plugin is used if empty.'), 'parent' => array('name' => 'type', 'value' => 'attachment'), + 'default' => '', 'advanced' => true, ), 'showdesc' => array( 'required' => false, - 'name' => tra('Show attachment description'), - 'description' => tra("Show the attachment description as the link label instead of the attachment name."), + 'name' => tra('Attachment Description'), + 'description' => tra('Show the attachment description as the link label instead of the attachment file name.'), 'options' => array( - array('text' => tra('No'), 'value' => ''), - array('text' => tra('Yes'), 'value' => 'y'), + array('text' => '', 'value' => ''), + array('text' => tra('Yes'), 'value' => 1), + array('text' => tra('No'), 'value' => 0), ), 'parent' => array('name' => 'type', 'value' => 'attachment'), + 'default' => '', 'advanced' => true, ), 'image' =>array( 'required' => false, 'name' => tra('Image'), - 'description' => tra("Says that this file is an image, and should be displayed inline using the img tag"), + 'description' => tra('Indicates that this attachment is an image, and should be displayed inline using the img tag'), 'parent' => array('name' => 'type', 'value' => 'attachment'), 'advanced' => true, + 'default' => '', + 'options' => array( + array('text' => '', 'value' => ''), + array('text' => tra('Yes'), 'value' => 1), + array('text' => tra('No'), 'value' => 0) + ), ), 'fileId' => array( 'required' => true, - 'name' => tra('File identifier'), - 'description' => tra('Identifier of a file in the file galleries.') . ' ' . tra('Example value:') . ' 42', + 'name' => tra('File ID'), + 'description' => tra('File ID of a file in a file gallery or an archive.') . ' ' . tra('Example value:') . ' 42', 'type' => 'fileId', 'area' => 'fgal_picker_id', 'filter' => 'digits', + 'default' => '', 'parent' => array('name' => 'type', 'value' => 'gallery'), ), 'date' => array( 'required' => false, 'name' => tra('Date'), - 'description' => tra('Pick the archive if exists created just before the date of the fileId'), + 'description' => tra('For an archive file, the archive created just before this date will be linked to.'), 'parent' => array('name' => 'type', 'value' => 'gallery'), + 'default' => '', 'advanced' => true, ), 'showicon' => array( 'required' => false, - 'name' => tra('Show icon'), - 'description' => 'y|n', + 'name' => tra('Show Icon'), + 'description' => tra('Show an icon version of the file or file type with the link to the file.'), 'filter' => 'alpha', 'parent' => array('name' => 'type', 'value' => 'gallery'), + 'default' => '', + 'options' => array( + array('text' => '', 'value' => ''), + array('text' => tra('Yes'), 'value' => 'y'), + array('text' => tra('No'), 'value' => 'n') + ), 'advanced' => true, ), ) ); + if ($prefs['feature_file_galleries'] == 'y') { + $info['params']['type']['options'][] = array('text' => tra('File Gallery File/Archive'), 'value' => 'gallery'); + } + if ($prefs['feature_wiki_attachments'] == 'y') { + $info['params']['type']['options'][] = array('text' => tra('Wiki Page Attachment'), 'value' => 'attachment'); + } + return $info; } function wikiplugin_file( $data, $params ) @@ -120,11 +149,11 @@ } else { $info = $filegallib->get_file_info($fileId); if (empty($info)) { - return tra('Incorrect param').' fileId'; + return tra('Incorrect parameter').' fileId'; } } - if (empty($data)) { // to avaoid problem with parsing + if (empty($data)) { // to avoid problem with parsing $data = empty($info['name'])?$info['filename']: $info['name']; } if (isset($params['showicon']) & $params['showicon'] == "y") { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |