Commit ba863ff6 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Documentation/UsersManual/index.rst: variable names in stores updated.

Link.php: Button 'edit/new/show/delete/info' do not assign class internal/external.
Store.php, Constants.php: TYPO3_PAGE_LANGUAGE implemented. TYPO3_PAGE_ID, TYPO3_PAGE_TYPE renamed.
parent 819782e7
......@@ -244,12 +244,6 @@ Store: *CLIENT* - C
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| keySemIdUser | *{{keySemIdUser}}*, may be changed by user |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| pageId | current T3 page Id |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| pageType | T3 GET Parameter 'type' |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| pageLanguage | T3 GET Parameter 'L' |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| HTTP_HOST | current HTTP HOST |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| REMOTE_ADDR | Client IP address |
......@@ -258,8 +252,6 @@ Store: *CLIENT* - C
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| form | Unique name of current form |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| random | random string with length of 32 chars, alphanum |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| ANREDE | *{{sex}}* == male >> Sehr geehrter Herr, *{{sex}}* == female Sehr geehrte Frau |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------+
| EANREDE | *{{sex}}* == male >> Dear Mr., *{{sex}}* == female >> Dear Mrs. |
......@@ -276,15 +268,19 @@ Store: *TYPO3* (Bodytext) - T
| | * Fix. E.g. *form = person* |
| | * via SIP. E.g. *form = {{form}}* |
+---------------+-------------------------------------------------------------------+
| feUser | Logged in Typo3 FE User |
| pageId | Record id of current Typo3 page |
+---------------+-------------------------------------------------------------------+
| feUserUid | Logged in Typo3 FE User uid |
| pageType | Current selected page type (typically URL parameter 'type') |
+---------------+-------------------------------------------------------------------+
| feUserGroup | FE groups of logged in Typo3 FE User |
| pageLanguage | Current selected page language (typically URL parameter 'L') |
+---------------+-------------------------------------------------------------------+
| ttcontentUid | Record id of current Typo3 content element |
+---------------+-------------------------------------------------------------------+
| typo3PageId | Record id of current Typo3 page |
| feUser | Logged in Typo3 FE User |
+---------------+-------------------------------------------------------------------+
| feUserUid | Logged in Typo3 FE User uid |
+---------------+-------------------------------------------------------------------+
| feUserGroup | FE groups of logged in Typo3 FE User |
+---------------+-------------------------------------------------------------------+
......@@ -311,6 +307,7 @@ Store: *RECORD* - R
| record column name | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form element: *{{p_id:R}}* |
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
SQL
---
......
......@@ -213,8 +213,9 @@ const TYPO3_FE_USER = 'feUser';
const TYPO3_FE_USER_UID = 'feUserUid';
const TYPO3_FE_USER_GROUP = 'feUserGroup';
const TYPO3_TT_CONTENT_UID = 'ttcontentUid';
const TYPO3_PAGE_ID = 'typo3PageId';
const TYPO3_PAGE_TYPE = 'typo33PageType';
const TYPO3_PAGE_ID = 'pageId';
const TYPO3_PAGE_TYPE = 'pageType';
const TYPO3_PAGE_LANGUAGE = 'pageLanguage';
// System
const SYSTEM_DB_USER = 'DB_USER';
......
......@@ -85,6 +85,8 @@ const NAME_HASH = 'hash';
const NAME_URL_PARAM = 'param';
const NAME_RIGHT_PICTURE_POSITION = 'picturePosition';
const NO_CLASS = 'no_class';
/**
* Class Link
* @package qfq
......@@ -493,6 +495,10 @@ class Link {
$vars[NAME_LINK_CLASS] = ($vars[NAME_LINK_CLASS] == '') ? $vars[NAME_LINK_CLASS_DEFAULT] : $vars[NAME_LINK_CLASS];
break;
}
if ($vars[NAME_LINK_CLASS] === NO_CLASS) {
$vars[NAME_LINK_CLASS] = '';
}
}
/**
......@@ -699,6 +705,7 @@ class Link {
*/
private function buildMail(&$vars, $key, $value) {
$vars[NAME_LINK_CLASS_DEFAULT] = $this->cssLinkClassExternal;
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
/**
......@@ -733,6 +740,7 @@ class Link {
private function buildPicture(&$vars, $key, $value) {
$vars[NAME_ALT_TEXT] = "Grafic: " . $value;
$vars[NAME_IMAGE_TITLE] = $value;
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
/**
......@@ -745,6 +753,7 @@ class Link {
private function buildBullet(&$vars, $key, $value) {
$vars[NAME_IMAGE] = PATH_ICONS . "bullet-" . $value . '.gif';
$vars[NAME_IMAGE_TITLE] = $value;
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
/**
......@@ -757,6 +766,7 @@ class Link {
private function buildCheck(&$vars, $key, $value) {
$vars[NAME_IMAGE] = PATH_ICONS . "checked-" . $value . '.gif';
$vars[NAME_IMAGE_TITLE] = $value;
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
/**
......@@ -773,6 +783,7 @@ class Link {
$vars[NAME_GLYPH] = GLYPH_ICON_DELETE;
$vars[NAME_GLYPH_TITLE] = "Delete";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
// Include Extjs library
$this->utils->loadJSlib($this->fr_error);
......@@ -790,6 +801,7 @@ class Link {
// $vars[NAME_IMAGE_TITLE] = "Edit";
$vars[NAME_GLYPH] = GLYPH_ICON_EDIT;
$vars[NAME_GLYPH_TITLE] = "Edit";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
......@@ -805,6 +817,8 @@ class Link {
// $vars[NAME_IMAGE_TITLE] = "Help";
$vars[NAME_GLYPH] = GLYPH_ICON_HELP;
$vars[NAME_GLYPH_TITLE] = "Help";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
/**
......@@ -820,6 +834,7 @@ class Link {
$vars[NAME_GLYPH] = GLYPH_ICON_INFO;
$vars[NAME_GLYPH_TITLE] = "Information";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
......@@ -836,6 +851,7 @@ class Link {
$vars[NAME_GLYPH] = GLYPH_ICON_NEW;
$vars[NAME_GLYPH_TITLE] = "New";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
......@@ -852,6 +868,7 @@ class Link {
$vars[NAME_GLYPH] = GLYPH_ICON_SHOW;
$vars[NAME_GLYPH_TITLE] = "Details";
$vars[NAME_LINK_CLASS_DEFAULT] = NO_CLASS;
}
}
\ No newline at end of file
......@@ -246,6 +246,9 @@ class Store {
if (isset($GLOBALS["TSFE"]->type))
$arr[TYPO3_PAGE_TYPE] = $GLOBALS["TSFE"]->type;
if (isset($GLOBALS["TSFE"]->sys_language_uid))
$arr[TYPO3_PAGE_LANGUAGE] = $GLOBALS["TSFE"]->sys_language_uid;
self::setVarArray($arr, STORE_TYPO3, true);
}
......
......@@ -89,10 +89,10 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$link = new Link(null, $this->sip, true);
$result = $link->renderLink('m:john@doe.com');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >mailto:john@doe.com</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >mailto:john@doe.com</a>', $result);
$result = $link->renderLink('m:john@doe.com|t:John Doe');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >John Doe</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >John Doe</a>', $result);
}
/**
......@@ -314,39 +314,39 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('', $result);
$result = $link->renderLink('m:john@doe.com');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >mailto:john@doe.com</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >mailto:john@doe.com</a>', $result);
$result = $link->renderLink('t:Example');
$this->assertEquals('', $result);
$result = $link->renderLink('m:john@doe.com|t:Example');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >Example</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >Example</a>', $result);
// r: 0
$result = $link->renderLink('u|r:0');
$this->assertEquals('', $result);
$result = $link->renderLink('m:john@doe.com|r:0');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >mailto:john@doe.com</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >mailto:john@doe.com</a>', $result);
$result = $link->renderLink('t:Example|r:0');
$this->assertEquals('', $result);
$result = $link->renderLink('m:john@doe.com|t:Example|r:0');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >Example</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >Example</a>', $result);
// r: 1
$result = $link->renderLink('u|r:1');
$this->assertEquals('', $result);
$result = $link->renderLink('m:john@doe.com|r:1');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >mailto:john@doe.com</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >mailto:john@doe.com</a>', $result);
$result = $link->renderLink('t:Example|r:1');
$this->assertEquals('<span >Example</span>', $result);
$result = $link->renderLink('m:john@doe.com|t:Example|r:1');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >Example</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >Example</a>', $result);
// r: 2
$result = $link->renderLink('u|r:2');
......@@ -359,7 +359,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('', $result);
$result = $link->renderLink('m:john@doe.com|t:Example|r:2');
$this->assertEquals('<a href="mailto:john@doe.com" class="external" >Example</a>', $result);
$this->assertEquals('<a href="mailto:john@doe.com" >Example</a>', $result);
// r: 3
$result = $link->renderLink('u|r:3');
......@@ -409,39 +409,39 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|P:picture.gif');
$this->assertEquals('<a href="http://example.com" class="external" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </a>', $result);
$this->assertEquals('<a href="http://example.com" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </a>', $result);
$result = $link->renderLink('t:Example|P:picture.gif');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|P:picture.gif');
$this->assertEquals('<a href="http://example.com" class="external" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</a>', $result);
$this->assertEquals('<a href="http://example.com" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</a>', $result);
// r: 0
$result = $link->renderLink('u|r:0|P:picture.gif');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|r:0|P:picture.gif');
$this->assertEquals('<a href="http://example.com" class="external" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </a>', $result);
$this->assertEquals('<a href="http://example.com" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </a>', $result);
$result = $link->renderLink('t:Example|r:0|P:picture.gif');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:0|P:picture.gif');
$this->assertEquals('<a href="http://example.com" class="external" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</a>', $result);
$this->assertEquals('<a href="http://example.com" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</a>', $result);
// r: 1
$result = $link->renderLink('u|r:1|P:picture.gif');
$this->assertEquals('<span ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </span>', $result);
$result = $link->renderLink('u:http://example.com|r:1|P:picture.gif');
$this->assertEquals('<a href="http://example.com" class="external" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </a>', $result);
$this->assertEquals('<a href="http://example.com" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </a>', $result);
$result = $link->renderLink('t:Example|r:1|P:picture.gif');
$this->assertEquals('<span ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</span>', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:1|P:picture.gif');
$this->assertEquals('<a href="http://example.com" class="external" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</a>', $result);
$this->assertEquals('<a href="http://example.com" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</a>', $result);
// r: 2
$result = $link->renderLink('u|r:2|P:picture.gif');
......@@ -449,13 +449,13 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
//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|P:picture.gif');
$this->assertEquals('<a href="http://example.com" class="external" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </a>', $result);
$this->assertEquals('<a href="http://example.com" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > </a>', $result);
$result = $link->renderLink('t:Example|r:2|P:picture.gif');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:2|P:picture.gif');
$this->assertEquals('<a href="http://example.com" class="external" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</a>', $result);
$this->assertEquals('<a href="http://example.com" ><img alt="Grafic: picture.gif" src="picture.gif" title="picture.gif" > Example</a>', $result);
// r: 3:
$result = $link->renderLink('u|r:3|P:picture.gif');
......
Markdown is supported
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