Skip to content
Snippets Groups Projects
Commit 1ce6c9ad authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing icon viewhelper, adding translations

parent c5150bba
No related branches found
No related tags found
No related merge requests found
...@@ -45,15 +45,18 @@ class IconViewHelper extends AbstractViewHelper { ...@@ -45,15 +45,18 @@ class IconViewHelper extends AbstractViewHelper {
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */
public function render($table, $row, $clickMenu = TRUE) { public function render($table, $row, $clickMenu = TRUE) {
if (!is_array($row)) {
$row = BackendUtility::getRecord($table, $row->getUid());
}
/** @var IconFactory $iconFactory */ /** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class); $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$toolTip = BackendUtility::getRecordToolTip($row, $table); $toolTip = BackendUtility::getRecordToolTip($row, $table);
$iconImg = '<span ' . $toolTip . '>' $iconImg = '<span ' . $toolTip . '>'
. $iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render() . $iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render()
. '</span>'; . '</span>';
if($clickMenu){ if ($clickMenu) {
return BackendUtility::wrapClickMenuOnIcon($iconImg, $table, $row['uid']); return BackendUtility::wrapClickMenuOnIcon($iconImg, $table, $row['uid']);
}else{ } else {
return $iconImg; return $iconImg;
} }
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</script> </script>
<f:for each="{locationOptions}" key="uid" as="location"> <f:for each="{locationOptions}" key="uid" as="location">
<script> <script>
LocationEditLinks["{uid}"] = "{sg:backend.editLink(table: 'tx_sgroutes_domain_model_location', uid: uid) -> f:format.raw()}"; LocationEditLinks["{uid}"] = "{sg:backend.editLink(table: 'tx_sgjobs_domain_model_location', uid: uid) -> f:format.raw()}";
</script> </script>
</f:for> </f:for>
<br /> <br />
......
...@@ -9,11 +9,18 @@ ...@@ -9,11 +9,18 @@
<sg:backend.widget.paginate objects="{jobs}" as="paginatedJobs" configuration="{insertAbove: 1, itemsPerPage: 20}"> <sg:backend.widget.paginate objects="{jobs}" as="paginatedJobs" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tbody> <tbody>
<f:for each="{paginatedJobs}" as="job"> <f:for each="{paginatedJobs}" as="job">
<f:debug>{job}</f:debug>
{sg:backend.editOnClick(table: 'tx_sgjobs_domain_model_job', uid: job.uid) -> sg:set(name: 'editOnClick')} {sg:backend.editOnClick(table: 'tx_sgjobs_domain_model_job', uid: job.uid) -> sg:set(name: 'editOnClick')}
<tr data-uid="{job.uid}"> <tr data-uid="{job.uid}">
<td nowrap="nowrap" class="col-icon">
<f:format.raw>
<sg:backend.icon table="tx_sgjobs_domain_model_job" row="{job}" />
</f:format.raw>
</td>
<td style="white-space: normal;"> <td style="white-space: normal;">
<a href="#" onclick="{editOnClick}"> <a href="#" onclick="{editOnClick}">
<span>{job.title} - {job.subtitle}</span> <span>{job.title} - {job.location.0.city}</span>
</a> </a>
</td> </td>
</tr> </tr>
......
...@@ -42,6 +42,10 @@ ...@@ -42,6 +42,10 @@
<source>Search</source> <source>Search</source>
<target>Suchen</target> <target>Suchen</target>
</trans-unit> </trans-unit>
<trans-unit id="backend.jobs.header" approved="yes">
<source>Job Management</source>
<target>Stellenangebote verwalten</target>
</trans-unit>
<trans-unit id="backend.list.header" approved="yes"> <trans-unit id="backend.list.header" approved="yes">
<source>Header</source> <source>Header</source>
<target>Kopf</target> <target>Kopf</target>
...@@ -50,6 +54,10 @@ ...@@ -50,6 +54,10 @@
<source>Item</source> <source>Item</source>
<target>Eintrag</target> <target>Eintrag</target>
</trans-unit> </trans-unit>
<trans-unit id="backend.noJobsMessage" approved="yes">
<source>There are no jobs that match your criteria</source>
<target>Es gibt keine Stellenangebote für Ihre Suchkriterien</target>
</trans-unit>
<trans-unit id="frontend.detail.back" approved="yes"> <trans-unit id="frontend.detail.back" approved="yes">
<source>Back</source> <source>Back</source>
<target>Zurück</target> <target>Zurück</target>
......
...@@ -33,12 +33,18 @@ ...@@ -33,12 +33,18 @@
<trans-unit id="backend.filters.search"> <trans-unit id="backend.filters.search">
<source>Search</source> <source>Search</source>
</trans-unit> </trans-unit>
<trans-unit id="backend.jobs.header">
<source>Job Management</source>
</trans-unit>
<trans-unit id="backend.list.header"> <trans-unit id="backend.list.header">
<source>Header</source> <source>Header</source>
</trans-unit> </trans-unit>
<trans-unit id="backend.list.item"> <trans-unit id="backend.list.item">
<source>Item</source> <source>Item</source>
</trans-unit> </trans-unit>
<trans-unit id="backend.noJobsMessage">
<source>There are no jobs that match your criteria</source>
</trans-unit>
<trans-unit id="frontend.detail.back"> <trans-unit id="frontend.detail.back">
<source>Back</source> <source>Back</source>
</trans-unit> </trans-unit>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
</f:section> </f:section>
<f:section name="headline"> <f:section name="headline">
<f:translate key="backend.jobs.header" />
</f:section> </f:section>
<f:section name="content"> <f:section name="content">
<f:if condition="{rootPageUid}"> <f:if condition="{rootPageUid}">
......
...@@ -46,7 +46,7 @@ function setHighlight(id) { // ...@@ -46,7 +46,7 @@ function setHighlight(id) { //
*/ */
function sgJobsGoToPage(uid, path) { function sgJobsGoToPage(uid, path) {
if (top.nav) { if (top.nav) {
top.nav.invokePageId(uid,gotToPageCallback); top.nav.invokePageId(uid, gotToPageCallback);
} else { } else {
var tree = top.Ext.getCmp('typo3-pagetree'); var tree = top.Ext.getCmp('typo3-pagetree');
if (tree) { if (tree) {
...@@ -62,11 +62,10 @@ function sgJobsGoToPage(uid, path) { ...@@ -62,11 +62,10 @@ function sgJobsGoToPage(uid, path) {
} }
} }
/** /**
* Callback for page selection in the pagetree * Callback for page selection in the pagetree
*/ */
function gotToPageCallback(path){ function gotToPageCallback(path) {
var callback = top.Ext.createDelegate(top.nav.mainTree.selectPath, top.nav.mainTree); var callback = top.Ext.createDelegate(top.nav.mainTree.selectPath, top.nav.mainTree);
callback.apply(this, arguments); callback.apply(this, arguments);
var node = top.nav.getSelected(); var node = top.nav.getSelected();
...@@ -80,9 +79,9 @@ function gotToPageCallback(path){ ...@@ -80,9 +79,9 @@ function gotToPageCallback(path){
* *
* @return {boolean} * @return {boolean}
*/ */
function editSelectedLocation(){ function editSelectedLocation() {
var selected = TYPO3.jQuery('#filter-locations').val(); var selected = TYPO3.jQuery('#filter-locations').val();
if(selected && LocationEditLinks[selected[0]]) { if (selected && LocationEditLinks[selected[0]]) {
jumpToUrl(LocationEditLinks[selected[0]] + '&returnUrl=' + T3_THIS_LOCATION); jumpToUrl(LocationEditLinks[selected[0]] + '&returnUrl=' + T3_THIS_LOCATION);
} }
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment