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 {
* @throws \InvalidArgumentException
*/
public function render($table, $row, $clickMenu = TRUE) {
if (!is_array($row)) {
$row = BackendUtility::getRecord($table, $row->getUid());
}
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$toolTip = BackendUtility::getRecordToolTip($row, $table);
$iconImg = '<span ' . $toolTip . '>'
. $iconFactory->getIconForRecord($table, $row, Icon::SIZE_SMALL)->render()
. '</span>';
if($clickMenu){
if ($clickMenu) {
return BackendUtility::wrapClickMenuOnIcon($iconImg, $table, $row['uid']);
}else{
} else {
return $iconImg;
}
}
......
......@@ -16,7 +16,7 @@
</script>
<f:for each="{locationOptions}" key="uid" as="location">
<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>
</f:for>
<br />
......
......@@ -9,11 +9,18 @@
<sg:backend.widget.paginate objects="{jobs}" as="paginatedJobs" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tbody>
<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')}
<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;">
<a href="#" onclick="{editOnClick}">
<span>{job.title} - {job.subtitle}</span>
<span>{job.title} - {job.location.0.city}</span>
</a>
</td>
</tr>
......
......@@ -42,6 +42,10 @@
<source>Search</source>
<target>Suchen</target>
</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">
<source>Header</source>
<target>Kopf</target>
......@@ -50,6 +54,10 @@
<source>Item</source>
<target>Eintrag</target>
</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">
<source>Back</source>
<target>Zurück</target>
......
......@@ -33,12 +33,18 @@
<trans-unit id="backend.filters.search">
<source>Search</source>
</trans-unit>
<trans-unit id="backend.jobs.header">
<source>Job Management</source>
</trans-unit>
<trans-unit id="backend.list.header">
<source>Header</source>
</trans-unit>
<trans-unit id="backend.list.item">
<source>Item</source>
</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">
<source>Back</source>
</trans-unit>
......
......@@ -6,6 +6,7 @@
</f:section>
<f:section name="headline">
<f:translate key="backend.jobs.header" />
</f:section>
<f:section name="content">
<f:if condition="{rootPageUid}">
......
......@@ -46,7 +46,7 @@ function setHighlight(id) { //
*/
function sgJobsGoToPage(uid, path) {
if (top.nav) {
top.nav.invokePageId(uid,gotToPageCallback);
top.nav.invokePageId(uid, gotToPageCallback);
} else {
var tree = top.Ext.getCmp('typo3-pagetree');
if (tree) {
......@@ -62,11 +62,10 @@ function sgJobsGoToPage(uid, path) {
}
}
/**
* 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);
callback.apply(this, arguments);
var node = top.nav.getSelected();
......@@ -80,9 +79,9 @@ function gotToPageCallback(path){
*
* @return {boolean}
*/
function editSelectedLocation(){
function editSelectedLocation() {
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);
}
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