Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 4069 | Rev 4554 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
4553 stevensc 2
use LeadersLinked\Model\Theme;
1 www 3
 
4
$this->inlineScript()->appendFile('https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places');
5
 
4553 stevensc 6
$currentNetworkHelper = $this->currentNetworkHelper();
7
$currentNetwork = $currentNetworkHelper->getNetwork();
8
 
1 www 9
// months
10
$months = [
11
  'LABEL_MONTH_JANUARY',
12
  'LABEL_MONTH_FEBRUARY',
13
  'LABEL_MONTH_MARCH',
14
  'LABEL_MONTH_APRIL',
15
  'LABEL_MONTH_MAY',
16
  'LABEL_MONTH_JUNE',
17
  'LABEL_MONTH_JULY',
18
  'LABEL_MONTH_AUGUST',
19
  'LABEL_MONTH_SEPTEMBER',
20
  'LABEL_MONTH_OCTOBER',
21
  'LABEL_MONTH_NOVEMBER',
22
  'LABEL_MONTH_DECEMBER',
23
];
24
 
25
// vars to json
26
$userExperiences = json_encode($user_experiences);
27
$userEducations = json_encode($user_educations);
28
$monthsJson = json_encode($months);
29
$userLanguages = json_encode($user_languages);
30
$userSkills = json_encode($user_skills);
31
$companySizesOptions = json_encode($company_sizes);
32
$degreesOptions = json_encode($degrees);
33
$industriesOptions = json_encode($industries);
34
$languagesOptions = json_encode($languages);
35
$skillsOptions = json_encode($skills);
3912 efrain 36
$userAptitudes = json_encode($user_aptitudes);
37
$userHobbiesAndInterests = json_encode($user_hobbies_and_interests);
38
$aptitudesOptions = json_encode($aptitudes);
39
$hobbiesAndInterestsOptions = json_encode($hobbies_and_interests);
40
 
1 www 41
$googleMapPlacesUrl = 'https://maps.googleapis.com/maps/api/js?key=' . $google_map_key . '&libraries=places';
42
$error_msg = "Por favor seleccione una ubicación real";
43
 
44
 
45
 
46
$js = <<<JS
47
 
48
 
49
// autoComplete place
50
let autoComplete;
51
 
52
function handleScriptLoad(updateQuery, autoCompleteRef, setAddresObject, setError) {
53
  autoComplete = new window.google.maps.places.Autocomplete(
54
    autoCompleteRef.current,
55
    { types: ["(cities)"]}
56
  );
57
  autoComplete.setFields(["address_components", "formatted_address", "geometry"]);
58
  autoComplete.addListener("place_changed", () =>
59
    handlePlaceSelect(updateQuery, setAddresObject, setError)
60
  );
61
}
62
 
63
async function handlePlaceSelect(updateQuery, setAddresObject, setError) {
64
  const addressObject = autoComplete.getPlace();
65
  // console.log(addressObject.geometry.location.lat());
66
  // console.log(addressObject.geometry.location.lng());
67
  const query = addressObject.formatted_address;
68
  if(query){
69
    setError("");
70
    updateQuery(query);
71
    setAddresObject({...addressObject, address_components:[...addressObject.address_components, {latitude: addressObject.geometry.location.lat(),longitude: addressObject.geometry.location.lng(), types:["geometry"]}]});
72
  }else{
73
    setError("$error_msg");
74
  }
75
}
76
 
77
const backendVars = {
78
  userIdEncrypted:"$user_uuid",
79
  userProfileIdEncrypted:"$user_profile_uuid",
80
  cover:"$cover",
81
  following:"$following",
82
  follower:"$follower",
83
  image:"$image",
84
  facebook: "$facebook",
85
  twitter: "$twitter",
86
  instagram: "$instagram",
87
  fullName: `$full_name`,
88
  overview: `$overview`,
4069 stevensc 89
  userExperiences: $userExperiences,
1 www 90
  userEducations: JSON.parse('$userEducations'),
91
  months: JSON.parse('$monthsJson'),
92
  formattedAddress: "$formatted_address",
93
  userLanguages: JSON.parse('$userLanguages'),
94
  userSkills: JSON.parse('$userSkills'),
3912 efrain 95
  userAptitudes: JSON.parse('$userAptitudes'),
96
  userHobbiesAndInterests: JSON.parse('$userHobbiesAndInterests'),
1 www 97
  imageSizeCover: "$image_size_cover",
98
  imageProfileCover: "$image_size_profile",
99
  companySizesOptions: JSON.parse('$companySizesOptions'),
100
  degreesOptions: JSON.parse('$degreesOptions'),
101
  industriesOptions: JSON.parse('$industriesOptions'),
102
  // industriesOptions: [],
103
  newIndustrisOptions: JSON.parse('$industriesOptions'),
104
  languagesOptions: JSON.parse('$languagesOptions'),
105
  skillsOptions: JSON.parse('$skillsOptions'),
3912 efrain 106
  aptitudesOptions: JSON.parse('$aptitudesOptions'),
107
  hobbiesAndInterestsOptions: JSON.parse('$hobbiesAndInterestsOptions'),
108
 
109
 
1 www 110
}
111
JS;
112
$this->inlineScript()->appendScript($js);
4553 stevensc 113
if ($currentNetwork->theme_id == Theme::THEME_LEADERSLINKED_LINKEDIN) {
114
  $this->headLink()->appendStylesheet('/react-bundles/profile/edit/main.css');
115
  $this->inlineScript()->appendFile('/react-bundles/profile/edit/linkedinProfileEditBundle.js');
116
}else {
117
  $this->headLink()->appendStylesheet('/react-bundles/profile/edit/main.css');
118
  $this->inlineScript()->appendFile('/react-bundles/profile/edit/profileEditBundle.js');
119
}
1 www 120
?>
121
 
122
 
123
<div id="react-my-profile-edit">
124
  <div class="process-comm" id="paginator-process-comm">
125
    <div class="spinner">
126
      <div class="bounce1"></div>
127
      <div class="bounce2"></div>
128
      <div class="bounce3"></div>
129
    </div>
130
  </div>
131
</div>
132
<script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>