mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b3a715c7dd
@ -1,4 +1,4 @@
|
||||
# OpenClassify - Laravel 8 Classified Script Platform
|
||||
# OpenClassify - Laravel 8 Classified Script Platform - Weekly Updates
|
||||
|
||||
OpenClassify is modular and most advanced open source classified platform build with Laravel 8 & PHP 7.3+ Supported. Included Pyrocms 3.9
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
|
||||
use Visiosoft\LocationModule\City\CityModel;
|
||||
use Visiosoft\LocationModule\Country\CountryModel;
|
||||
use Visiosoft\LocationModule\District\DistrictModel;
|
||||
use Visiosoft\MediaFieldType\Http\Controller\UploadController;
|
||||
|
||||
class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
{
|
||||
@ -562,4 +563,33 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
|
||||
->whereJsonContains('cf_json', [$key => $value])
|
||||
->first();
|
||||
}
|
||||
|
||||
public function uploadImage()
|
||||
{
|
||||
$folder_repository = app(FolderRepositoryInterface::class);
|
||||
|
||||
if (request()->has(['adv_id', 'upload'])
|
||||
and $adv = $this->newQuery()->find(request('adv_id'))
|
||||
and $folder = $folder_repository->findBySlug('images')) {
|
||||
|
||||
|
||||
$upload_service = app(UploadController::class);
|
||||
|
||||
request()->offsetSet('folder', $folder->id);
|
||||
|
||||
if ($response = $upload_service->upload()) {
|
||||
|
||||
$file_id = $response->getData()->id;
|
||||
|
||||
DB::table('advs_advs_files')->insert([
|
||||
'entry_id' => $adv->id,
|
||||
'file_id' => $file_id
|
||||
]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,4 +58,6 @@ interface AdvRepositoryInterface extends EntryRepositoryInterface
|
||||
public function currentAds();
|
||||
|
||||
public function findByCFJSON($key, $value);
|
||||
|
||||
public function uploadImage();
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@ function phoneMask(fields) {
|
||||
var iti = intlTelInput(inputQuery, {
|
||||
hiddenInput: inputQuery.getAttribute('name'),
|
||||
class: "form-control",
|
||||
formatOnDisplay: true,
|
||||
nationalMode: true,
|
||||
initialCountry: "auto",
|
||||
geoIpLookup: function (success, failure) {
|
||||
$.get("https://ipinfo.io", function () {
|
||||
@ -14,9 +16,21 @@ function phoneMask(fields) {
|
||||
success(countryCode);
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
addMask(iti, inputQuery);
|
||||
$(inputQuery).on("countrychange", function(event) {
|
||||
iti.setNumber("");
|
||||
addMask(iti, inputQuery);
|
||||
});
|
||||
});
|
||||
|
||||
function addMask(iti, inputQuery){
|
||||
let selectedCountryData = iti.getSelectedCountryData();
|
||||
let newPlaceholder = intlTelInputUtils.getExampleNumber(selectedCountryData.iso2, true, intlTelInputUtils.numberFormat.INTERNATIONAL);
|
||||
$(inputQuery).inputmask({ mask: newPlaceholder.replace(/[0-9+]/ig,'9'), keepStatic: false });
|
||||
}
|
||||
|
||||
// var fields_arr = fields.split(',');
|
||||
// $.each(fields_arr, function (index, value) {
|
||||
// maskPhone($(value).attr('name'))
|
||||
@ -38,8 +52,8 @@ function phoneMask(fields) {
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function controlNumber(inputQuery) {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
|
||||
{% block content %}
|
||||
{% set phoneLogin = not setting_value('visiosoft.module.advs::register_email_field') or app.request.get('type') == 'phone' %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="row justify-content-center mx-0 mx-md-3">
|
||||
<div class="col-12 text-left m-0 row justify-content-center">
|
||||
<div class="col-12 col-lg-5 m-3 login-section">
|
||||
{% set form = form('signIn')
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
{% set enableCaptcha = setting_value('visiosoft.module.profile::google_captcha_site_key') and setting_value('visiosoft.module.profile::google_captcha_secret_key') %}
|
||||
|
||||
<div class="py-4">
|
||||
<div class="row justify-content-center bg-light rounded border px-3 register-area">
|
||||
<div class="row justify-content-center bg-light rounded border px-3 register-area mx-0 mx-md-3">
|
||||
<div class="col-12 col-md-6 text-left p-3 m-0">
|
||||
|
||||
<div class="personal-register">
|
||||
|
||||
@ -2769,4 +2769,6 @@ body {
|
||||
|
||||
/** bootstrap 4.1 Column Fix**/
|
||||
.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}
|
||||
.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}
|
||||
.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}
|
||||
.d-flex{display: flex}
|
||||
.align-items-center{align-items: center}
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="30.828" height="30.475" viewBox="0 0 30.828 30.475">
|
||||
<g id="guide" transform="translate(0.002 0)">
|
||||
<path id="Union_177" data-name="Union 177" d="M1.95,22.08A1.95,1.95,0,0,1,0,20.129V4.549A1.976,1.976,0,0,1,1.941,2.6H3.9V2.063A1.979,1.979,0,0,1,5.588.119a10.833,10.833,0,0,1,8.591,2.489.666.666,0,0,1,.222,0A10.835,10.835,0,0,1,23,.124a1.966,1.966,0,0,1,1.685,1.939V2.6h1.95a1.949,1.949,0,0,1,1.947,1.95v7.79a.65.65,0,1,1-1.3,0V4.549a.65.65,0,0,0-.647-.651h-1.95v7.141a.65.65,0,1,1-1.3,0V2.063a.665.665,0,0,0-.567-.655,9.562,9.562,0,0,0-7.875,2.438V14.939a.649.649,0,1,1-1.3,0V3.841A9.553,9.553,0,0,0,5.776,1.408a.67.67,0,0,0-.578.655V17.324a.615.615,0,0,0,.208.467.683.683,0,0,0,.534.161,10.43,10.43,0,0,1,5.835,1.008.65.65,0,0,1-.292,1.233.694.694,0,0,1-.286-.064,9.149,9.149,0,0,0-5.11-.888,1.969,1.969,0,0,1-1.545-.483A1.932,1.932,0,0,1,3.9,17.324V3.9H1.95a.658.658,0,0,0-.651.651V20.129a.651.651,0,0,0,.651.651h9.089a.65.65,0,1,1,0,1.3Z" transform="translate(-0.002 0)" fill="#4a4a4a"/>
|
||||
<path id="Path_20041" data-name="Path 20041" d="M19.25,11a8.25,8.25,0,1,0,8.25,8.25A8.259,8.259,0,0,0,19.25,11Z" transform="translate(3.327 2.976)" fill="#ffb100"/>
|
||||
<g id="information-button" transform="translate(20.081 17.135)">
|
||||
<path id="Path_20042" data-name="Path 20042" d="M9.525,12.512q-.634.25-1.012.381a2.669,2.669,0,0,1-.878.131,1.749,1.749,0,0,1-1.194-.375,1.21,1.21,0,0,1-.425-.951,3.453,3.453,0,0,1,.031-.458c.022-.156.056-.331.1-.528l.529-1.869c.047-.179.087-.35.119-.508a2.254,2.254,0,0,0,.047-.44A.678.678,0,0,0,6.7,7.4a.837.837,0,0,0-.565-.14,1.484,1.484,0,0,0-.421.063c-.143.044-.266.083-.368.122l.14-.576Q6,6.654,6.478,6.5a2.938,2.938,0,0,1,.9-.152,1.717,1.717,0,0,1,1.177.369,1.225,1.225,0,0,1,.413.957q0,.122-.029.429a2.871,2.871,0,0,1-.106.564L8.3,10.534c-.043.15-.081.321-.116.512a2.706,2.706,0,0,0-.051.435.625.625,0,0,0,.166.506.93.93,0,0,0,.575.135,1.668,1.668,0,0,0,.435-.067,2.475,2.475,0,0,0,.352-.118ZM9.432,4.947a1.256,1.256,0,0,1-.887.342,1.27,1.27,0,0,1-.89-.342,1.092,1.092,0,0,1-.371-.83,1.1,1.1,0,0,1,.371-.832,1.26,1.26,0,0,1,.89-.346,1.246,1.246,0,0,1,.887.346,1.12,1.12,0,0,1,0,1.661Z" transform="translate(-5.344 -2.94)" fill="#fff"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@ -45,7 +45,7 @@
|
||||
|
||||
</form>
|
||||
|
||||
<ul class="nav navbar-nav navbar-left">
|
||||
<ul class="nav navbar-nav navbar-left d-flex align-items-center">
|
||||
{% for shortcut in template.cp.shortcuts %}
|
||||
<li class="nav-item shortcut {#dropdown#}">
|
||||
<a {{ html_attributes(shortcut.attributes) }} {#data-toggle="dropdown"#}>
|
||||
@ -68,6 +68,9 @@
|
||||
{#</ul>#}
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
{{ addBlock('admin/topbar')|raw }}
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a href="javascript:void(0);" data-toggle="dropdown">
|
||||
<img src="{{ user().gravatar.path }}" width="36" class="rounded-circle">
|
||||
|
||||
@ -40,9 +40,6 @@ $(function () {
|
||||
sending: function (file, xhr, formData) {
|
||||
formData.append('folder', element.data('folder'));
|
||||
},
|
||||
renameFile: function (file) {
|
||||
return new Date().getTime() + '_' + file.name.replace(/ /g, '_');
|
||||
},
|
||||
accept: function (file, done) {
|
||||
$.get(REQUEST_ROOT_PATH + '/streams/media-field_type/exists/' + element.data('folder'), {'file': file.name}, function (data) {
|
||||
if (data.exists) {
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
use Anomaly\Streams\Platform\Image\Image;
|
||||
use Anomaly\Streams\Platform\Model\Files\FilesFilesEntryModel;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Visiosoft\MediaFieldType\Table\UploadTableBuilder;
|
||||
@ -48,19 +49,39 @@ class UploadController extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
public function changeFileName($file)
|
||||
{
|
||||
|
||||
$file_name = $file->getClientOriginalName();
|
||||
$ext = pathinfo($file_name, PATHINFO_EXTENSION);
|
||||
|
||||
$file_name = str_replace('.' . $ext, '', $file_name);
|
||||
$file_name = preg_replace('/[^A-Za-z0-9 _-]/', '', $file_name);
|
||||
|
||||
$file = new UploadedFile($file->getPathname(),
|
||||
strtotime('now') . "-" . $file_name . "." . $ext,
|
||||
$file->getClientMimeType(),
|
||||
$file->getError());
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
public function upload()
|
||||
{
|
||||
$path = $_FILES['upload']['name'];
|
||||
$file_request = $this->changeFileName($this->request->file('upload'));
|
||||
|
||||
$path = $file_request->getClientOriginalName();
|
||||
|
||||
$ext = pathinfo($path, PATHINFO_EXTENSION);
|
||||
if($ext == 'svg') {
|
||||
if ($ext == 'svg') {
|
||||
$mimes [0] = 'svg';
|
||||
$file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($this->request->get('folder')));
|
||||
$file = $this->uploader->upload($file_request, $this->folders->find($this->request->get('folder')));
|
||||
} else {
|
||||
$mimes = explode('/', $this->request->file('upload')->getMimeType());
|
||||
$mimes = explode('/', $file_request->getMimeType());
|
||||
if ($mimes[0] == 'image') {
|
||||
$file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($this->request->get('folder')));
|
||||
$file = $this->uploader->upload($file_request, $this->folders->find($this->request->get('folder')));
|
||||
} else if ($doc_folder = app(FolderRepositoryInterface::class)->findBySlug('ads_documents')) {
|
||||
$file = $this->uploader->upload($this->request->file('upload'), $doc_folder);
|
||||
$file = $this->uploader->upload($file_request, $doc_folder);
|
||||
} else {
|
||||
return $this->response->json(['error' => trans('visiosoft.field_type.media::message.error_upload_docs')], 500);
|
||||
}
|
||||
@ -93,7 +114,7 @@ class UploadController extends AdminController
|
||||
}
|
||||
|
||||
|
||||
$fullImg = WaterMark::make($this->request->file('upload')->getRealPath());
|
||||
$fullImg = WaterMark::make($file_request->getRealPath());
|
||||
|
||||
if ($settings_value['image_resize_backend']) {
|
||||
$fullImg = $fullImg->resize(null, $settings_value['full_image_height'],
|
||||
@ -102,7 +123,7 @@ class UploadController extends AdminController
|
||||
});
|
||||
}
|
||||
|
||||
$mdImg = WaterMark::make($this->request->file('upload')->getRealPath())
|
||||
$mdImg = WaterMark::make($file_request->getRealPath())
|
||||
->resize(null, $settings_value['medium_image_height'], function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
});
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
{{ asset_style("visiosoft.module.profile::assets/css/profile-nav.scss") }}
|
||||
{% endblock %}
|
||||
|
||||
<div class="row my-md-5">
|
||||
<div class="row my-md-5 mx-0 mx-md-3">
|
||||
|
||||
{% include "visiosoft.module.profile::profile/partials/navigation" %}
|
||||
|
||||
@ -12,4 +12,4 @@
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -40,6 +40,10 @@ return [
|
||||
'/profile',
|
||||
'/profile/*',
|
||||
'/ajax/*',
|
||||
'/cron/*',
|
||||
'/cron',
|
||||
'/cart',
|
||||
'/cart/*',
|
||||
],
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user