Compare commits

...

4 Commits

@ -938,3 +938,85 @@ function digitsToLatin($number)
$number = str_replace($arabic2, $latin, $number);
return str_replace($arabic, $latin, $number);
}
/**
* @param $lang code like fa
* @return string
*/
function getEmojiLanguagebyCode($lang) {
$languages = array(
"af" => "🇿🇦", // Afrikaans
"sq" => "🇦🇱", // Albanian
"am" => "🇪🇹", // Amharic
"ar" => "🇸🇦", // Arabic
"hy" => "🇦🇲", // Armenian
"az" => "🇦🇿", // Azerbaijani
"eu" => "🇪🇸", // Basque
"be" => "🇧🇾", // Belarusian
"bn" => "🇧🇩", // Bengali
"bs" => "🇧🇦", // Bosnian
"bg" => "🇧🇬", // Bulgarian
"ca" => "🇪🇸", // Catalan
"zh" => "🇨🇳", // Chinese
"hr" => "🇭🇷", // Croatian
"cs" => "🇨🇿", // Czech
"da" => "🇩🇰", // Danish
"nl" => "🇳🇱", // Dutch
"en" => "🇺🇸", // English
"et" => "🇪🇪", // Estonian
"fi" => "🇫🇮", // Finnish
"fr" => "🇫🇷", // French
"gl" => "🇪🇸", // Galician
"ka" => "🇬🇪", // Georgian
"de" => "🇩🇪", // German
"el" => "🇬🇷", // Greek
"gu" => "🇮🇳", // Gujarati
"ht" => "🇭🇹", // Haitian
"he" => "🇮🇱", // Hebrew
"hi" => "🇮🇳", // Hindi
"hu" => "🇭🇺", // Hungarian
"is" => "🇮🇸", // Icelandic
"id" => "🇮🇩", // Indonesian
"ga" => "🇮🇪", // Irish
"it" => "🇮🇹", // Italian
"ja" => "🇯🇵", // Japanese
"kk" => "🇰🇿", // Kazakh
"ko" => "🇰🇷", // Korean
"lv" => "🇱🇻", // Latvian
"lt" => "🇱🇹", // Lithuanian
"mk" => "🇲🇰", // Macedonian
"ms" => "🇲🇾", // Malay
"ml" => "🇮🇳", // Malayalam
"mt" => "🇲🇹", // Maltese
"mn" => "🇲🇳", // Mongolian
"no" => "🇳🇴", // Norwegian
"ps" => "🇦🇫", // Pashto
"fa" => "🇮🇷", // Persian
"pl" => "🇵🇱", // Polish
"pt" => "🇵🇹", // Portuguese
"ro" => "🇷🇴", // Romanian
"ru" => "🇷🇺", // Russian
"sr" => "🇷🇸", // Serbian
"sk" => "🇸🇰", // Slovak
"sl" => "🇸🇮", // Slovenian
"es" => "🇪🇸", // Spanish
"sw" => "🇰🇪", // Swahili
"sv" => "🇸🇪", // Swedish
"ta" => "🇮🇳", // Tamil
"te" => "🇮🇳", // Telugu
"th" => "🇹🇭", // Thai
"tr" => "🇹🇷", // Turkish
"uk" => "🇺🇦", // Ukrainian
"ur" => "🇵🇰", // Urdu
"uz" => "🇺🇿", // Uzbek
"vi" => "🇻🇳", // Vietnamese
"cy" => "🇬🇧" // Welsh
);
$lang = strtolower($lang);
if (array_key_exists($lang, $languages)) {
return $languages[$lang];
} else {
return "❓";
}
}

@ -97,10 +97,11 @@ class SettingController extends Controller
$files = $request->allFiles();
if (isset($files['pic'])) {
foreach ($files['pic'] as $index => $file) {
// $name = time() . '.' . $file->getClientOriginalExtension();
// Setting::where('key',$key)->update(['value' => $name]);
// $request->file($index)->storeAs('public/setting', $name);
$file->move(public_path('/images/'), str_replace('_','.',$index) );//store('/images/'.,['disk' => 'public']);
if ($file->extension() == 'mp4' || $file->extension() == 'mp3'){
$file->move(public_path('/assets/file/'), str_replace('_','.',$index) );//store('/images/'.,['disk' => 'public']);
}else{
$file->move(public_path('/images/'), str_replace('_','.',$index) );//store('/images/'.,['disk' => 'public']);
}
}
}
return redirect()->back()->with(['message' => __('Setting of website updated')]);

@ -127,6 +127,6 @@ class TransportController extends Controller
default:
$msg = __('Unknown bulk action :' . $request->input('bulk'));
}
return redirect()->route('admin.customer.index')->with(['message' => $msg]);
return redirect()->route('admin.transport.index')->with(['message' => $msg]);
}
}

@ -1,10 +0,0 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class TransportController extends Controller
{
//
}

@ -284,6 +284,7 @@
"Main product category": "دسته اصلی محصول",
"Manage": "مدیریت",
"Max click": "حداکثر تعداد کلیک",
"Media": "رسانه",
"Menu": "فهرست\/منو",
"Menus": "فهرست‌ها",
"Menus list": "فهرست منوها",
@ -632,4 +633,4 @@
"user": "کاربر",
"weight": "وزن",
"yesterday": "دیروز"
}
}

@ -220,6 +220,7 @@
"Main product category": "«Основная категория товаров»",
"Manage": "Управлять",
"Max click": "«Макс клик»",
"Media": "",
"Menu": "",
"Menus": "«Меню»",
"Menus list": "«Список меню»",

@ -84,10 +84,26 @@
</select>
@break
@case('image')
<img src="{{asset('images/'.str_replace('_','.',$set->key))}}?{{time()}}"
class="img-fluid" style="max-height: 150px;max-width: 45%" alt="cover">
@if(pathinfo(str_replace('_','.',$set->key), PATHINFO_EXTENSION) == 'mp4')
<video controls
src="{{asset('assets/file/'.str_replace('_','.',$set->key))}}?{{time()}}"
class="img-fluid"
style="max-height: 150px;max-width: 45%"></video>
<br>
@elseif(pathinfo(str_replace('_','.',$set->key), PATHINFO_EXTENSION) == 'mp3')
<audio controls
src="{{asset('assets/file/'.str_replace('_','.',$set->key))}}?{{time()}}"
class="img-fluid"
style="max-height: 150px;max-width: 45%"></audio>
<br>
@else
<img
src="{{asset('images/'.str_replace('_','.',$set->key))}}?{{time()}}"
class="img-fluid" style="max-height: 150px;max-width: 45%"
alt="cover">
@endif
<input type="file" name="pic[{{$set->key}}]" id="{{$set->key}}"
accept="image/*"
accept=".{{pathinfo(str_replace('_','.',$set->key), PATHINFO_EXTENSION)}}"
class="form-control-file"/>
@break
@default
@ -152,7 +168,7 @@
<option value="checkbox"
@if (old('type') == 'checkbox' ) selected @endif >{{__("Checkbox")}} </option>
<option value="image"
@if (old('type') == 'image' ) selected @endif >{{__("Image")}} </option>
@if (old('type') == 'image' ) selected @endif >{{__("Media")}} </option>
</select>
</div>
@ -189,7 +205,7 @@
<script>
try {
document.querySelector('#price').classList.add('currency');
} catch(e) {
} catch (e) {
// console.log(e.message);
}

Loading…
Cancel
Save