61 lines
1.7 KiB
PHP
61 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\Profile;
|
|
|
|
use App\Http\Livewire\MainPage\SkillsCardFull;
|
|
use App\Models\Language;
|
|
|
|
/**
|
|
* Class MigrateProfilesProfileSkillsForm
|
|
*
|
|
* This class extends the SkillsCardFull class and is responsible for rendering
|
|
* the update profile skills form view in the Livewire component.
|
|
*
|
|
* @package App\Http\Livewire\Profile
|
|
*/
|
|
class MigrateCyclosProfileSkillsForm extends SkillsCardFull
|
|
{
|
|
public bool $showCyclosReference = true;
|
|
public $skillsCardLabel;
|
|
|
|
public function mount($label = null)
|
|
{
|
|
$lang = __(Language::where('lang_code', app()->getLocale())->first()->name) ?? null;
|
|
if ($lang) {
|
|
if (app()->getLocale() != 'en' ) {
|
|
$translationWarning = '(' . __('messages.now_in_language', ['lang' => $lang]) . ')';
|
|
} else {
|
|
$translationWarning = '(' . __('messages.in_English') . ')';
|
|
}
|
|
} else {
|
|
$translationWarning = '';
|
|
}
|
|
$this->skillsCardLabel = __('Skills on this website') . ' ' . $translationWarning;
|
|
}
|
|
|
|
|
|
public function removeCyclosTags()
|
|
{
|
|
$profile = getActiveProfile();
|
|
|
|
if (!$profile) {
|
|
return;
|
|
}
|
|
|
|
// CRITICAL SECURITY: Validate user has ownership/access to this profile
|
|
\App\Helpers\ProfileAuthorizationHelper::authorize($profile);
|
|
|
|
$profile->cyclos_skills = null;
|
|
$profile->save();
|
|
$this->showCyclosReference = false;
|
|
$this->dispatch('refreshSkills');
|
|
$this->skillsCardLabel = null;
|
|
}
|
|
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.profile.migrate-cyclos-profile-skills-form');
|
|
}
|
|
}
|