Adopt short array syntax
Since PHP 5.4 the short array syntax `[]` may be used instead of `array()`.
This commit is contained in:
@@ -665,7 +665,7 @@
|
||||
</div>
|
||||
<!-- ./box-body -->
|
||||
</div>
|
||||
<?php \Event::fire('service.desk.admin.settings', array()); ?>
|
||||
<?php \Event::fire('service.desk.admin.settings', []); ?>
|
||||
|
||||
|
||||
@stop
|
||||
|
@@ -96,14 +96,14 @@
|
||||
|
||||
<?php
|
||||
$replacetop = 0;
|
||||
$replacetop = \Event::fire('service.desk.admin.topbar.replace', array());
|
||||
$replacetop = \Event::fire('service.desk.admin.topbar.replace', []);
|
||||
if (count($replacetop) == 0) {
|
||||
$replacetop = 0;
|
||||
} else {
|
||||
$replacetop = $replacetop[0];
|
||||
}
|
||||
$replaceside = 0;
|
||||
$replaceside = \Event::fire('service.desk.admin.sidebar.replace', array());
|
||||
$replaceside = \Event::fire('service.desk.admin.sidebar.replace', []);
|
||||
if (count($replaceside) == 0) {
|
||||
$replaceside = 0;
|
||||
} else {
|
||||
@@ -137,7 +137,7 @@
|
||||
</a>
|
||||
</li>
|
||||
@else
|
||||
<?php \Event::fire('service.desk.admin.topbar', array()); ?>
|
||||
<?php \Event::fire('service.desk.admin.topbar', []); ?>
|
||||
@endif
|
||||
</ul>
|
||||
|
||||
@@ -691,7 +691,7 @@
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<?php \Event::fire('service.desk.admin.sidebar', array()); ?>
|
||||
<?php \Event::fire('service.desk.admin.sidebar', []); ?>
|
||||
</ul>
|
||||
</nav>
|
||||
</section>
|
||||
|
@@ -2,18 +2,18 @@
|
||||
|
||||
$term = $_GET["term"];
|
||||
$organizations =App\Model\helpdesk\Agent_panel\Organization::where('name', 'LIKE', '%' . $term . '%')->get();
|
||||
$json = array();
|
||||
$json = [];
|
||||
|
||||
foreach ($organizations as $organization) {
|
||||
|
||||
$json[] = array(
|
||||
$json[] = [
|
||||
'value' => $organization["name"],
|
||||
'label' => $organization["name"],
|
||||
|
||||
'org' => $organization["name"],
|
||||
|
||||
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
echo json_encode($json);
|
@@ -2,11 +2,11 @@
|
||||
|
||||
$term = $_GET["term"];
|
||||
$users = app\User::where('email', 'LIKE', '%' . $term . '%')->where('active', '=', 1)->where('role', '=', 'user')->get();
|
||||
$json = array();
|
||||
$json = [];
|
||||
|
||||
foreach ($users as $user) {
|
||||
|
||||
$json[] = array(
|
||||
$json[] = [
|
||||
'value' => $user["email"],
|
||||
'label' => 'Name: '.$user["first_name"] .' '.$user["last_name"].' | '.('Email: <'.$user["email"].'>'),
|
||||
'email' => $user["email"],
|
||||
@@ -17,7 +17,7 @@ foreach ($users as $user) {
|
||||
'mobile' => $user["mobile"],
|
||||
'phone_number' => $user["phone_number"]
|
||||
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
echo json_encode($json);
|
||||
|
@@ -52,9 +52,9 @@ class="nav-link active"
|
||||
$date_time_format = UTC::getDateTimeFormat();
|
||||
if (Auth::user()->role == 'agent') {
|
||||
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', [1, 7])->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
|
||||
} else {
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->count();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', [1, 7])->orderBy('id', 'DESC')->count();
|
||||
}
|
||||
?>
|
||||
<!-- Main content -->
|
||||
|
@@ -149,7 +149,7 @@ if ($thread->title != "") {
|
||||
@endif
|
||||
|
||||
|
||||
<?php Event::fire('show-add-event-btn', array()); ?>
|
||||
<?php Event::fire('show-add-event-btn', []); ?>
|
||||
|
||||
<a href="{{url('ticket/print/'.$tickets->id)}}" target="_blank" class="btn btn-default btn-tool btn-sm"><i class="fas fa-print" > </i> {!! Lang::get('lang.generate_pdf') !!}</a>
|
||||
<div class="btn-group">
|
||||
@@ -311,7 +311,7 @@ if ($thread->title != "") {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php Event::fire('ticket.timeline.marble',array($TicketData));?>
|
||||
<?php Event::fire('ticket.timeline.marble',[$TicketData]);?>
|
||||
<div id="gifshow" style="display:none" class="text-center">
|
||||
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}">
|
||||
</div> <!-- added 05/05/2016-->
|
||||
@@ -1072,7 +1072,7 @@ if ($thread->title != "") {
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<?php \Event::fire('show-add-calendar-model', array('id' => $tickets->id))?>
|
||||
<?php \Event::fire('show-add-calendar-model', ['id' => $tickets->id])?>
|
||||
<!-- add or search user Modal -->
|
||||
<div class="modal fade" id="addccc">
|
||||
<div class="modal-dialog">
|
||||
|
@@ -1368,8 +1368,8 @@ class="nav-link active"
|
||||
<div class="modal-body">
|
||||
|
||||
<?php
|
||||
$groups = App\Model\helpdesk\Agent\Groups::all(array('id', 'name'));
|
||||
$departments = App\Model\helpdesk\Agent\Department::all(array('id', 'name'));
|
||||
$groups = App\Model\helpdesk\Agent\Groups::all(['id', 'name']);
|
||||
$departments = App\Model\helpdesk\Agent\Department::all(['id', 'name']);
|
||||
?>
|
||||
|
||||
<!-- <div class="col-sm-4 form-group {{ $errors->has('group') ? 'has-error' : '' }}"> -->
|
||||
@@ -1440,8 +1440,8 @@ class="nav-link active"
|
||||
<div class="modal-body">
|
||||
|
||||
<?php
|
||||
$groups = App\Model\helpdesk\Agent\Groups::all(array('id', 'name'));
|
||||
$departments = App\Model\helpdesk\Agent\Department::all(array('id', 'name'));
|
||||
$groups = App\Model\helpdesk\Agent\Groups::all(['id', 'name']);
|
||||
$departments = App\Model\helpdesk\Agent\Department::all(['id', 'name']);
|
||||
?>
|
||||
|
||||
<!-- <div class="col-sm-4 form-group {{ $errors->has('group') ? 'has-error' : '' }}"> -->
|
||||
|
@@ -101,7 +101,7 @@
|
||||
<div class="wrapper">
|
||||
|
||||
<?php
|
||||
$replacetop = \Event::fire('service.desk.agent.topbar.replace', array());
|
||||
$replacetop = \Event::fire('service.desk.agent.topbar.replace', []);
|
||||
|
||||
if (count($replacetop) == 0) {
|
||||
$replacetop = 0;
|
||||
@@ -109,7 +109,7 @@
|
||||
$replacetop = $replacetop[0];
|
||||
}
|
||||
|
||||
$replaceside = \Event::fire('service.desk.agent.sidebar.replace', array());
|
||||
$replaceside = \Event::fire('service.desk.agent.sidebar.replace', []);
|
||||
|
||||
if (count($replaceside) == 0) {
|
||||
$replaceside = 0;
|
||||
@@ -166,10 +166,10 @@
|
||||
</li>
|
||||
@endif
|
||||
|
||||
<?php \Event::fire('calendar.topbar', array()); ?>
|
||||
<?php \Event::fire('calendar.topbar', []); ?>
|
||||
</ul>
|
||||
@else
|
||||
<?php \Event::fire('service.desk.agent.topbar', array()); ?>
|
||||
<?php \Event::fire('service.desk.agent.topbar', []); ?>
|
||||
@endif
|
||||
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@@ -490,7 +490,7 @@
|
||||
@endforeach
|
||||
@else
|
||||
|
||||
<?php \Event::fire('service.desk.agent.sidebar', array()); ?>
|
||||
<?php \Event::fire('service.desk.agent.sidebar', []); ?>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -571,7 +571,7 @@
|
||||
</nav>
|
||||
</div>
|
||||
@endif
|
||||
<?php \Event::fire('service.desk.agent.topsubbar', array()); ?>
|
||||
<?php \Event::fire('service.desk.agent.topsubbar', []); ?>
|
||||
<!-- /.tab-pane -->
|
||||
</div>
|
||||
<!-- Content Header (Page header) -->
|
||||
@@ -584,7 +584,7 @@
|
||||
|
||||
|
||||
@endif
|
||||
<?php \Event::fire('service.desk.agent.topsubbar', array()); ?>
|
||||
<?php \Event::fire('service.desk.agent.topsubbar', []); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -806,8 +806,8 @@
|
||||
</script>
|
||||
<script>
|
||||
</script>
|
||||
<?php Event::fire('show.calendar.script', array()); ?>
|
||||
<?php Event::fire('load-calendar-scripts', array()); ?>
|
||||
<?php Event::fire('show.calendar.script', []); ?>
|
||||
<?php Event::fire('load-calendar-scripts', []); ?>
|
||||
@yield('FooterInclude')
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -66,7 +66,7 @@
|
||||
|
||||
}
|
||||
$replacetop = 0;
|
||||
$replacetop = \Event::fire('service.desk.agent.topbar.replace', array());
|
||||
$replacetop = \Event::fire('service.desk.agent.topbar.replace', []);
|
||||
|
||||
if (count($replacetop) == 0) {
|
||||
$replacetop = 0;
|
||||
@@ -74,7 +74,7 @@
|
||||
$replacetop = $replacetop[0];
|
||||
}
|
||||
$replaceside = 0;
|
||||
$replaceside = \Event::fire('service.desk.agent.sidebar.replace', array());
|
||||
$replaceside = \Event::fire('service.desk.agent.sidebar.replace', []);
|
||||
|
||||
if (count($replaceside) == 0) {
|
||||
$replaceside = 0;
|
||||
@@ -105,10 +105,10 @@
|
||||
@if(Auth::user()->role == 'admin')
|
||||
<li @yield('Report')><a href="{{URL::route('report.index')}}" onclick="clickReport(event);">{!! Lang::get('lang.report') !!}</a></li>
|
||||
@endif
|
||||
<?php \Event::fire('calendar.topbar', array()); ?>
|
||||
<?php \Event::fire('calendar.topbar', []); ?>
|
||||
</ul>
|
||||
@else
|
||||
<?php \Event::fire('service.desk.agent.topbar', array()); ?>
|
||||
<?php \Event::fire('service.desk.agent.topbar', []); ?>
|
||||
@endif
|
||||
<?php $noti = \App\Model\helpdesk\Notification\UserNotification::where('user_id', '=', Auth::user()->id)->where('is_read', '0')->get(); ?>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
@@ -259,7 +259,7 @@
|
||||
//$inbox = App\Model\helpdesk\Ticket\Tickets::all();
|
||||
$myticket = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', Auth::user()->id)->where('status', '1')->get();
|
||||
$unassigned = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', null)->where('status', '=', '1')->get();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->get();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', [1, 7])->get();
|
||||
$followup_ticket= App\Model\helpdesk\Ticket\Tickets::where('status', '1')->where('follow_up', '1')->get();
|
||||
$closingapproval = App\Model\helpdesk\Ticket\Tickets::where('status', '7')->get();
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
//$inbox = App\Model\helpdesk\Ticket\Tickets::where('dept_id','',Auth::user()->primary_dpt)->get();
|
||||
$myticket = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', Auth::user()->id)->where('status', '1')->get();
|
||||
$unassigned = App\Model\helpdesk\Ticket\Tickets::where('assigned_to', '=', null)->where('status', '=', '1')->where('dept_id', '=', Auth::user()->primary_dpt)->get();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->where('dept_id', '=', Auth::user()->primary_dpt)->get();
|
||||
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', [1, 7])->where('dept_id', '=', Auth::user()->primary_dpt)->get();
|
||||
$followup_ticket= App\Model\helpdesk\Ticket\Tickets::where('status', '1')->where('follow_up', '1')->get();
|
||||
$closingapproval = App\Model\helpdesk\Ticket\Tickets::where('status', '7')->get();
|
||||
|
||||
@@ -388,7 +388,7 @@
|
||||
}
|
||||
?>
|
||||
@else
|
||||
<?php \Event::fire('service.desk.agent.sidebar', array()); ?>
|
||||
<?php \Event::fire('service.desk.agent.sidebar', []); ?>
|
||||
@endif
|
||||
</ul>
|
||||
</section>
|
||||
@@ -444,7 +444,7 @@
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
<?php \Event::fire('service.desk.agent.topsubbar', array()); ?>
|
||||
<?php \Event::fire('service.desk.agent.topsubbar', []); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -613,8 +613,8 @@
|
||||
|
||||
});
|
||||
</script>-->
|
||||
<?php Event::fire('show.calendar.script', array()); ?>
|
||||
<?php Event::fire('load-calendar-scripts', array()); ?>
|
||||
<?php Event::fire('show.calendar.script', []); ?>
|
||||
<?php Event::fire('load-calendar-scripts', []); ?>
|
||||
@yield('FooterInclude')
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -410,17 +410,17 @@ $thread = App\Model\helpdesk\Ticket\Ticket_Thread::where('ticket_id', '=', \Cryp
|
||||
<?php
|
||||
foreach ($attachments as $attachment) {
|
||||
$size = $attachment->size;
|
||||
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
$power = $size > 0 ? floor(log($size, 1024)) : 0;
|
||||
$value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];
|
||||
if ($attachment->poster == 'ATTACHMENT') {
|
||||
if (mime($attachment->type) == true) {
|
||||
$var = '<a href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><img style="width:200px;height:120px;" src="data:image/jpg;base64,' . $attachment->file . '"/></a>';
|
||||
$var = '<a href="' . URL::route('image', ['image_id' => $attachment->id]) . '" target="_blank"><img style="width:200px;height:120px;" src="data:image/jpg;base64,' . $attachment->file . '"/></a>';
|
||||
|
||||
echo '<li><span class="mailbox-attachment-icon has-img">' . $var . '</span><div class="mailbox-attachment-info"><a class="mailbox-attachment-name">' . $attachment->name . '</a><span class="mailbox-attachment-size">' . $value . '</span></div></li>';
|
||||
} else {
|
||||
//$var = '<a href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:'.$attachment->type.';base64,' . base64_encode($data) . '"/></a>';
|
||||
$var = '<a style="width:200px;height:120px;text-decoration: none;" href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><span class="mailbox-attachment-icon" style="background:#fff;height:120px;font-size:16px;">' . strtoupper($attachment->type) . '</span></a><div class="mailbox-attachment-info">' . $attachment->name . '<span class="mailbox-attachment-size">' . $value . '</span></div>';
|
||||
$var = '<a style="width:200px;height:120px;text-decoration: none;" href="' . URL::route('image', ['image_id' => $attachment->id]) . '" target="_blank"><span class="mailbox-attachment-icon" style="background:#fff;height:120px;font-size:16px;">' . strtoupper($attachment->type) . '</span></a><div class="mailbox-attachment-info">' . $attachment->name . '<span class="mailbox-attachment-size">' . $value . '</span></div>';
|
||||
|
||||
echo '<li style="background-color:#f4f4f4;">' . $var . '</li>';
|
||||
}
|
||||
|
@@ -289,7 +289,7 @@ foreach ($conversations as $conversation) {
|
||||
{
|
||||
|
||||
$size = $attachment->size;
|
||||
$units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$units = [ 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
$power = $size > 0 ? floor(log($size, 1024)) : 0;
|
||||
$value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];
|
||||
|
||||
@@ -303,14 +303,14 @@ foreach ($conversations as $conversation) {
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<a href="'.URL::route('image', array('image_id' => $attachment->id)).'" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
$var = '<a href="'.URL::route('image', ['image_id' => $attachment->id]).'" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
|
||||
|
||||
echo '<li style="background-color:#f4f4f4;"><span class="mailbox-attachment-icon has-img">'.$var.'</span><div class="mailbox-attachment-info"><b style="word-wrap: break-word;">'.$attachment->name.'</b><br/><p>'.$value.'</p></div></li>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="'.URL::route('image', array('image_id' => $attachment->id)).'" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">'.strtoupper($attachment->type).'</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">'.$attachment->name.'</b><br/><p>'.$value.'</p></span></div></a>';
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="'.URL::route('image', ['image_id' => $attachment->id]).'" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">'.strtoupper($attachment->type).'</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">'.$attachment->name.'</b><br/><p>'.$value.'</p></span></div></a>';
|
||||
echo '<li style="background-color:#f4f4f4;">'.$var.'</li>';
|
||||
}
|
||||
}
|
||||
|
@@ -294,7 +294,7 @@ foreach ($conversations as $conversation) {
|
||||
<?php
|
||||
foreach ($attachments as $attachment) {
|
||||
$size = $attachment->size;
|
||||
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
$power = $size > 0 ? floor(log($size, 1024)) : 0;
|
||||
$value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];
|
||||
if ($attachment->poster == 'ATTACHMENT') {
|
||||
@@ -304,10 +304,10 @@ foreach ($conversations as $conversation) {
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<a href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
$var = '<a href="' . URL::route('image', ['image_id' => $attachment->id]) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
echo '<li style="background-color:#f4f4f4;"><span class="mailbox-attachment-icon has-img">' . $var . '</span><div class="mailbox-attachment-info"><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></div></li>';
|
||||
} else {
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">' . strtoupper($attachment->type) . '</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></span></div></a>';
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="' . URL::route('image', ['image_id' => $attachment->id]) . '" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">' . strtoupper($attachment->type) . '</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></span></div></a>';
|
||||
echo '<li style="background-color:#f4f4f4;">' . $var . '</li>';
|
||||
}
|
||||
}
|
||||
|
@@ -565,12 +565,12 @@ $data = $ConvDate[0];
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<a href="'.URL::route('image', array('image_id' => $attachment->id)).'" target="_blank"><img src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
$var = '<a href="'.URL::route('image', ['image_id' => $attachment->id]).'" target="_blank"><img src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
echo '<li><span class="mailbox-attachment-icon has-img">'.$var.'</span></li>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$var = '<a href="'.URL::route('image', array('image_id' => $attachment->id)).'" target="_blank">'.$attachment->name.'</a>';
|
||||
$var = '<a href="'.URL::route('image', ['image_id' => $attachment->id]).'" target="_blank">'.$attachment->name.'</a>';
|
||||
echo '<li>'.$var.'</li>';
|
||||
}
|
||||
}
|
||||
|
@@ -520,7 +520,7 @@ $data = $ConvDate[0];
|
||||
{
|
||||
|
||||
$size = $attachment->size;
|
||||
$units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$units = [ 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
$power = $size > 0 ? floor(log($size, 1024)) : 0;
|
||||
$value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];
|
||||
|
||||
@@ -534,14 +534,14 @@ $data = $ConvDate[0];
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<a href="'.URL::route('image', array('image_id' => $attachment->id)).'" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
$var = '<a href="'.URL::route('image', ['image_id' => $attachment->id]).'" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
|
||||
|
||||
echo '<li style="background-color:#f4f4f4;"><span class="mailbox-attachment-icon has-img">'.$var.'</span><div class="mailbox-attachment-info"><b style="word-wrap: break-word;">'.$attachment->name.'</b><br/><p>'.$value.'</p></div></li>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="'.URL::route('image', array('image_id' => $attachment->id)).'" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">'.strtoupper($attachment->type).'</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">'.$attachment->name.'</b><br/><p>'.$value.'</p></span></div></a>';
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="'.URL::route('image', ['image_id' => $attachment->id]).'" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">'.strtoupper($attachment->type).'</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">'.$attachment->name.'</b><br/><p>'.$value.'</p></span></div></a>';
|
||||
echo '<li style="background-color:#f4f4f4;">'.$var.'</li>';
|
||||
}
|
||||
}
|
||||
|
@@ -303,7 +303,7 @@ foreach ($conversations as $conversation) {
|
||||
<?php
|
||||
foreach ($attachments as $attachment) {
|
||||
$size = $attachment->size;
|
||||
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
$power = $size > 0 ? floor(log($size, 1024)) : 0;
|
||||
$value = number_format($size / pow(1024, $power), 2, '.', ',') . ' ' . $units[$power];
|
||||
if ($attachment->poster == 'ATTACHMENT') {
|
||||
@@ -313,10 +313,10 @@ foreach ($conversations as $conversation) {
|
||||
imagejpeg($image, null, 80);
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$var = '<a href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
$var = '<a href="' . URL::route('image', ['image_id' => $attachment->id]) . '" target="_blank"><img style="max-width:200px;height:133px;" src="data:image/jpg;base64,' . base64_encode($data) . '"/></a>';
|
||||
echo '<li style="background-color:#f4f4f4;"><span class="mailbox-attachment-icon has-img">' . $var . '</span><div class="mailbox-attachment-info"><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></div></li>';
|
||||
} else {
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="' . URL::route('image', array('image_id' => $attachment->id)) . '" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">' . strtoupper($attachment->type) . '</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></span></div></a>';
|
||||
$var = '<a style="max-width:200px;height:133px;color:#666;" href="' . URL::route('image', ['image_id' => $attachment->id]) . '" target="_blank"><span class="mailbox-attachment-icon" style="background-color:#fff;">' . strtoupper($attachment->type) . '</span><div class="mailbox-attachment-info"><span ><b style="word-wrap: break-word;">' . $attachment->name . '</b><br/><p>' . $value . '</p></span></div></a>';
|
||||
echo '<li style="background-color:#f4f4f4;">' . $var . '</li>';
|
||||
}
|
||||
}
|
||||
|
@@ -143,12 +143,12 @@ function validate_memory_limit(&$results) {
|
||||
* @return string
|
||||
*/
|
||||
function format_file_size($value) {
|
||||
$data = array(
|
||||
$data = [
|
||||
'TB' => 1099511627776,
|
||||
'GB' => 1073741824,
|
||||
'MB' => 1048576,
|
||||
'kb' => 1024,
|
||||
);
|
||||
];
|
||||
|
||||
// commented because of integer overflow on 32bit sistems
|
||||
// http://php.net/manual/en/language.types.integer.php#language.types.integer.overflow
|
||||
@@ -206,7 +206,7 @@ function validate_extensions(&$results) {
|
||||
$ok = false;
|
||||
} // if
|
||||
|
||||
$recommended_extensions = array(
|
||||
$recommended_extensions = [
|
||||
// 'imap' => 'IMAP extension is used for connecting to mail server using IMAP settings to fetch emails in the system.',
|
||||
// 'mcrypt' => 'Optional extension',
|
||||
// 'gd' => 'GD is used for image manipulation. Without it, system is not able to create thumbnails for files or manage avatars, logos and project icons. Please refer to <a href="http://www.php.net/manual/en/image.installation.php">this</a> page for installation instructions',
|
||||
@@ -216,7 +216,7 @@ function validate_extensions(&$results) {
|
||||
// 'imap' => 'IMAP is used to connect to POP3 and IMAP servers. Without it, Incoming Mail module will not work. Please refer to <a href="http://www.php.net/manual/en/imap.installation.php">this</a> page for installation instructions',
|
||||
// 'zlib' => 'ZLIB is used to read and write gzip (.gz) compressed files',
|
||||
// SVN extension ommited, to avoid confusion
|
||||
);
|
||||
];
|
||||
|
||||
foreach ($recommended_extensions as $recommended_extension => $recommended_extension_desc) {
|
||||
if (extension_loaded($recommended_extension)) {
|
||||
@@ -268,7 +268,7 @@ function checkMaxExecutiontime(&$results)
|
||||
// Do the magic
|
||||
// ---------------------------------------------------
|
||||
|
||||
$results = array();
|
||||
$results = [];
|
||||
|
||||
$php_ok = validate_php($results);
|
||||
$memory_ok = validate_memory_limit($results);
|
||||
|
@@ -59,7 +59,7 @@ if (DB_HOST && DB_USER && DB_NAME) {
|
||||
?>
|
||||
<?php
|
||||
$mysqli_ok = true;
|
||||
$results = array();
|
||||
$results = [];
|
||||
// error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
|
||||
error_reporting(0);
|
||||
if ($default == 'mysql') {
|
||||
|
Reference in New Issue
Block a user