Commit 9eaa5058 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Manual.rst: fix some typo, add FE.value description for type 'upload'.

parent 60b4741c
...@@ -197,7 +197,7 @@ Setup a *report* to manage all *forms*: ...@@ -197,7 +197,7 @@ Setup a *report* to manage all *forms*:
10 { 10 {
# List of Forms: Do not show this list of forms if there is a form given by SIP. # List of Forms: Do not show this list of forms if there is a form given by SIP.
# Table header. # Table header.
sql = SELECT CONCAT('{{pageId:T}}&form=Form&') as _Pagen, '#', 'Name', 'Title', 'Table', '' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'='' sql = SELECT CONCAT('{{pageId:T}}&form=form&') as _Pagen, '#', 'Name', 'Title', 'Table', '' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
head = <table class="table table-hover qfq-table-50"> head = <table class="table table-hover qfq-table-50">
tail = </table> tail = </table>
rbeg = <thead><tr> rbeg = <thead><tr>
...@@ -207,7 +207,7 @@ Setup a *report* to manage all *forms*: ...@@ -207,7 +207,7 @@ Setup a *report* to manage all *forms*:
10 { 10 {
# All forms # All forms
sql = SELECT CONCAT('{{pageId:T}}&form=Form&r=', f.id) as _Pagee, f.id, f.name, f.title, f.tableName, CONCAT('form=Form&r=', f.id) as _Paged FROM Form AS f ORDER BY f.name sql = SELECT CONCAT('{{pageId:T}}&form=form&r=', f.id) as _Pagee, f.id, f.name, f.title, f.tableName, CONCAT('form=form&r=', f.id) as _Paged FROM Form AS f ORDER BY f.name
rbeg = <tr> rbeg = <tr>
rend = </tr> rend = </tr>
fbeg = <td> fbeg = <td>
...@@ -2933,6 +2933,10 @@ Inside the *Form editor* it's shown as a 'native FormElement'. ...@@ -2933,6 +2933,10 @@ Inside the *Form editor* it's shown as a 'native FormElement'.
During saving the current record, it behaves like an action FormElement During saving the current record, it behaves like an action FormElement
and will be processed after saving the primary record and before any action FormElements are processed. and will be processed after saving the primary record and before any action FormElements are processed.
* *FormElement.value*: By default, the full path of any already uploaded file is shown. To show something different, e.g.
only the filename, define: ::
{{SELECT SUBSTRING_INDEX(pathFilenamePicture, '/', -1) FROM Note WHERE id={{id:R0}} }}
* *FormElement.parameter*: * *FormElement.parameter*:
...@@ -2953,7 +2957,7 @@ and will be processed after saving the primary record and before any action Form ...@@ -2953,7 +2957,7 @@ and will be processed after saving the primary record and before any action Form
* If for a specific filetype is no mime type available, the definition of file extension(s) is possible. This is **less * If for a specific filetype is no mime type available, the definition of file extension(s) is possible. This is **less
secure**, cause there is no *content* check on the server after the upload. secure**, cause there is no *content* check on the server after the upload.
* *maxFileSize*: max filesize in Bytes for an uploaded file. Default: 10485760 (=10MB) * *maxFileSize*: max filesize in bytes for an uploaded file. Default: 10485760 (=10MB)
* *fileDestination*: Destination where to copy the file. A good practice is to specify a relative `fileDestination` - * *fileDestination*: Destination where to copy the file. A good practice is to specify a relative `fileDestination` -
such an installation (filesystem and database) are moveable. such an installation (filesystem and database) are moveable.
...@@ -2985,7 +2989,7 @@ and will be processed after saving the primary record and before any action Form ...@@ -2985,7 +2989,7 @@ and will be processed after saving the primary record and before any action Form
Immediately after the upload finished (before the user press save), the file will be checked on the server for it's Immediately after the upload finished (before the user press save), the file will be checked on the server for it's
content or file extension (see 'accept'). content or file extension (see 'accept').
The maximum size is defined by the minimum of `upload_max_filesize`, `post_max_size`and `memory_limit` (PHP script) in the php.ini. The maximum size is defined by the minimum of `upload_max_filesize`, `post_max_size` and `memory_limit` (PHP script) in the php.ini.
In case of broken uploads, please also check `max_input_time` in php.ini. In case of broken uploads, please also check `max_input_time` in php.ini.
......
...@@ -543,6 +543,89 @@ class LinkTest extends \PHPUnit_Framework_TestCase { ...@@ -543,6 +543,89 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('', $result); $this->assertEquals('', $result);
} }
/**
* @throws UserReportException
*/
public function testRenderModeUrlButton() {
$link = new Link($this->sip, true);
// r: default (0)
$result = $link->renderLink('u:http://example.com|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('t:Example|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example</a>', $result);
// r: 0
$result = $link->renderLink('u:http://example.com|r:0|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('t:Example|r:0|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:0|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example</a>', $result);
// r: 1
$result = $link->renderLink('u:http://example.com|r:1|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('t:Example|r:1|B:yellow');
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:1|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example</a>', $result);
// r: 2
//TODO: no link if text is empty - image is linked here: this is not what the user expects.
$result = $link->renderLink('u:http://example.com|r:2|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('t:Example|r:2|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:2|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example</a>', $result);
// r: 3:
$result = $link->renderLink('u:http://example.com|r:3|B:yellow');
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" >', $result);
$result = $link->renderLink('t:Example|r:3|B:yellow');
// $this->assertEquals('<span ><img alt="picture.gif" src="picture.gif" title="picture.gif" > Example</span>', $result);
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:3|B:yellow');
// $this->assertEquals('<span ><img alt="picture.gif" src="picture.gif" title="picture.gif" > Example</span>', $result);
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example', $result);
// r: 4
$result = $link->renderLink('u:http://example.com|r:4|B:yellow');
// $this->assertEquals('<span >http://example.com</span>', $result);
$this->assertEquals('http://example.com', $result);
$result = $link->renderLink('t:Example|r:4|B:yellow');
// $this->assertEquals('<span ><img alt="picture.gif" src="picture.gif" title="picture.gif" > Example</span>', $result);
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:4|B:yellow');
// $this->assertEquals('<span >http://example.com</span>', $result);
$this->assertEquals('http://example.com', $result);
// r: 5
$result = $link->renderLink('u:http://example.com|r:5|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('t:Example|r:5|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:5|B:yellow');
$this->assertEquals('', $result);
}
/** /**
* @throws UserReportException * @throws UserReportException
*/ */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment