Skip to content

Commit

Permalink
fix: Use correct language key#-----------------------50--------------…
Browse files Browse the repository at this point in the history
…---------|
  • Loading branch information
zooley committed Apr 11, 2024
1 parent d083817 commit 1189cbe
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
16 changes: 9 additions & 7 deletions app/Halcyon/Html/Builder/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ public static function order($rows, $cls = 'saveoder', $task = 'saveorder')
/**
* Method to create a checked out icon with optional overlib in a grid.
*
* @param object &$row The row object
* @param object $row The row object
* @param bool $tooltip True if an overlib with checkout information should be created.
* @return string HTML for the icon and tooltip
*/
protected static function _checkedOut(&$row, $tooltip = true)
protected static function _checkedOut($row, bool $tooltip = true): string
{
$hover = '<span class="checkedout">';
$hover = '<span class="checkedout text-warning';

if ($tooltip && isset($row->checked_out_time))
{
Expand All @@ -297,10 +297,12 @@ protected static function _checkedOut(&$row, $tooltip = true)
$date = $dt->format('l, d F Y');
$time = $dt->format('H:i');

$hover = '<span class="editlinktip hasTip" title="' . trans('global.check out') . '::' . e($text) . '<br />' . $date . '<br />' . $time . '">';
$hover .= ' has-tip" data-tip="' . trans('global.messages.check out') . '::' . e($text) . '<br />' . $date . '<br />' . $time;
}

return $hover . trans('global.checked out') . '</span>';
$hover .= '"><span class="fa fa-check-square-o" aria-hidden="true"></span>';

return $hover . '<span class="sr-only visually-hidden">' . trans('global.messages.checked out') . '</span></span>';
}

/**
Expand Down Expand Up @@ -329,10 +331,10 @@ public static function checkedout($i, $editorName, $time, $prefix = '', $enabled
$time = addslashes(htmlspecialchars(Carbon::parse($time)->format('H:i'), ENT_COMPAT, 'UTF-8'));

$active_title = trans('global.check in') . '::' . $text . '<br />' . $date . '<br />' . $time;
$inactive_title = trans('global.checked out') . '::' . $text . '<br />' . $date . '<br />' . $time;
$inactive_title = trans('global.messages.checked out') . '::' . $text . '<br />' . $date . '<br />' . $time;

return self::action(
$i, 'checkin', $prefix, trans('global.checked out'), $active_title, $inactive_title, true, 'checkedout',
$i, 'checkin', $prefix, trans('global.messages.checked out'), $active_title, $inactive_title, true, 'checkedout',
'checkedout', $enabled, false, $checkbox
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function edit($id, Request $request)
if ($row->checked_out
&& $row->checked_out <> auth()->user()->id)
{
return $this->cancel()->with('warning', trans('global.checked out'));
return $this->cancel()->with('warning', trans('global.messages.checked out'));
}

if ($row->id)
Expand Down
11 changes: 7 additions & 4 deletions app/Modules/Listeners/Resources/views/admin/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,13 @@
?>
<tr<?php if (!$path) { echo ' class="locked"'; } ?>>
<td class="text-center">
@if ($path && $canEdit)
{!! App\Halcyon\Html\Builder\Grid::id($i, $row->id) !!}
@elseif (!$path)
<span class="fa fa-exclamation-triangle text-warning" aria-hidden="true"></span>
@if ($row->checked_out && !$canCheckin)
@else
@if ($path && $canEdit)
{!! App\Halcyon\Html\Builder\Grid::id($i, $row->id) !!}
@elseif (!$path)
<span class="fa fa-exclamation-triangle text-warning" aria-hidden="true"></span>
@endif
@endif
</td>
<td class="priority-5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function edit(Request $request, $id)
if ($row->checked_out
&& $row->checked_out <> auth()->user()->id)
{
return redirect(route('admin.pages.index'))->with('warning', trans('global.checked out'));
return redirect(route('admin.pages.index'))->with('warning', trans('global.messages.checked out'));
}

$parents = Page::query()
Expand Down
4 changes: 2 additions & 2 deletions app/Modules/Pages/Http/Controllers/Site/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PagesController extends Controller
*/
public function index(Request $request)
{
if ($request->wantsJson()) //$request->expectsJson())
if ($request->wantsJson())
{
return response()->json(['message' => trans('global.unacceptable header')], 406);
}
Expand Down Expand Up @@ -250,7 +250,7 @@ public function edit(Request $request, $id)
if ($row->checked_out
&& $row->checked_out <> auth()->user()->id)
{
return redirect(route('home'))->with('warning', trans('global.checked out'));
return redirect(route('home'))->with('warning', trans('global.messages.checked out'));
}

$parents = Page::query()
Expand Down

0 comments on commit 1189cbe

Please sign in to comment.