Rev 4674 | Rev 5078 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
<?phpuse LeadersLinked\Model\Theme;$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');$currentNetworkHelper = $this->currentNetworkHelper();$currentNetwork = $currentNetworkHelper->getNetwork();// months$months = ['LABEL_MONTH_JANUARY','LABEL_MONTH_FEBRUARY','LABEL_MONTH_MARCH','LABEL_MONTH_APRIL','LABEL_MONTH_MAY','LABEL_MONTH_JUNE','LABEL_MONTH_JULY','LABEL_MONTH_AUGUST','LABEL_MONTH_SEPTEMBER','LABEL_MONTH_OCTOBER','LABEL_MONTH_NOVEMBER','LABEL_MONTH_DECEMBER',];// vars to json$userExperiences = json_encode($user_experiences);$userEducations = json_encode($user_educations);$monthsJson = json_encode($months);$userLanguages = json_encode($user_languages);$userSkills = json_encode($user_skills);$companySizesOptions = json_encode($company_sizes);$degreesOptions = json_encode($degrees);$industriesOptions = json_encode($industries);$languagesOptions = json_encode($languages);$skillsOptions = json_encode($skills);$userAptitudes = json_encode($user_aptitudes);$userHobbiesAndInterests = json_encode($user_hobbies_and_interests);$aptitudesOptions = json_encode($aptitudes);$hobbiesAndInterestsOptions = json_encode($hobbies_and_interests);$googleMapPlacesUrl = 'https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places';$error_msg = "Por favor seleccione una ubicación real";$js = <<<JS// autoComplete placelet autoComplete;function handleScriptLoad(updateQuery, autoCompleteRef, setAddresObject, setError) {autoComplete = new window.google.maps.places.Autocomplete(autoCompleteRef.current,{ types: ["(cities)"]});autoComplete.setFields(["address_components", "formatted_address", "geometry"]);autoComplete.addListener("place_changed", () =>handlePlaceSelect(updateQuery, setAddresObject, setError));}async function handlePlaceSelect(updateQuery, setAddresObject, setError) {const addressObject = autoComplete.getPlace();// console.log(addressObject.geometry.location.lat());// console.log(addressObject.geometry.location.lng());const query = addressObject.formatted_address;if(query){setError("");updateQuery(query);setAddresObject({...addressObject, address_components:[...addressObject.address_components, {latitude: addressObject.geometry.location.lat(),longitude: addressObject.geometry.location.lng(), types:["geometry"]}]});}else{setError("$error_msg");}}const skillsArray = Object.entries($userSkills).map(([key, value]) => ({ value: key, name: value }))const skillsOptions = Object.entries($skillsOptions).map(([key, value]) => ({ value: key, name: value }))const languagesArray = Object.entries($userLanguages).map(([key, value]) => ({ value: key, name: value }))const languagesOptions = Object.entries($languagesOptions).map(([key, value]) => ({ value: key, name: value }))const aptitudesArray = Object.entries($userAptitudes).map(([key, value]) => ({ value: key, name: value }))const aptitudesOptions = Object.entries($aptitudesOptions).map(([key, value]) => ({ value: key, name: value }))const userHobbiesAndInterests = Object.entries($userHobbiesAndInterests).map(([key, value]) => ({ value: key, name: value }))const hobbiesAndInterestsOptions = Object.entries($hobbiesAndInterestsOptions).map(([key, value]) => ({ value: key, name: value }))const backendVars = {userIdEncrypted:"$user_uuid",userProfileIdEncrypted:"$user_profile_uuid",cover:"$cover",following:"$following",follower:"$follower",image:"$image",facebook: "$facebook",twitter: "$twitter",instagram: "$instagram",fullName: `$full_name`,overview: `$overview`,userExperiences: $userExperiences,userEducations: JSON.parse('$userEducations'),months: JSON.parse('$monthsJson'),formatted_address: "$formatted_address",userLanguages: languagesArray,userSkills: skillsArray,userAptitudes: aptitudesArray,userHobbiesAndInterests: userHobbiesAndInterests,imageSizeCover: "$image_size_cover",imageProfileCover: "$image_size_profile",companySizesOptions: JSON.parse('$companySizesOptions'),degreesOptions: JSON.parse('$degreesOptions'),industriesOptions: JSON.parse('$industriesOptions'),// industriesOptions: [],newIndustrisOptions: JSON.parse('$industriesOptions'),languagesOptions: languagesOptions,skillsOptions: skillsOptions,aptitudesOptions: aptitudesOptions,hobbiesAndInterestsOptions: hobbiesAndInterestsOptions,}JS;$this->inlineScript()->appendScript($js);if ($currentNetwork->theme_id == Theme::THEME_LEADERSLINKED_LINKEDIN) {$this->headLink()->appendStylesheet('/react-bundles/profile/edit/main.css');$this->inlineScript()->appendFile('/react-bundles/profile/edit/linkedinProfileEditBundle.js');$this->headLink()->appendStylesheet('/react-bundles/profile/view/main.css');} else {$this->headLink()->appendStylesheet('/react-bundles/profile/edit/main.css');$this->inlineScript()->appendFile('/react-bundles/profile/edit/profileEditBundle.js');}?><div id="react-my-profile-edit"><div class="process-comm" id="paginator-process-comm"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div></div><script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>