$oParent){ $iParent = $key; } //print_r(taxonomy_get_parents($element["#item"]["service_taxonomy_id"])); $sReturn .= taxonomy_image_display($key); }else{ $sReturn .= taxonomy_image_display($element["#item"]["service_taxonomy_id"]); } if ($element["#item"]["description"]){ $sReturn .= "

".$element["#item"]["description"]."

"; } return $sReturn; } } function _showCsServicesServicePoiType($element){ //print_r($element["#item"]); if ($element["#item"]["service_taxonomy_id"]){ $sReturn = ""; if (!taxonomy_image_display($element["#item"]["service_taxonomy_id"])) { $aParent = taxonomy_get_parents($element["#item"]["service_taxonomy_id"]); foreach ($aParent as $key => $oParent){ echo "parent ".$oParent."
"; $iParent = $key; } //print_r(taxonomy_get_parents($element["#item"]["service_taxonomy_id"])); $sReturn .= taxonomy_image_display($key); }else{ $sReturn .= taxonomy_image_display($element["#item"]["service_taxonomy_id"]); } if ($element["#item"]["description"]){ $sReturn .= "

".$element["#item"]["description"]."

"; } // Title $oTaxonomy = taxonomy_get_term($element["#item"]["service_taxonomy_id"]); //exit(); $sReturn = $sReturn." ". $oTaxonomy->name; return $sReturn; } } function _showCsServicesSummaryService($element){ //print_r($element["#item"]); $field = content_fields( $element['#field_name']); $iVoc = $field["widget"]["vocabulary"]; $aTerm = taxonomy_node_get_terms(node_load(arg(1))); $sReturn = ""; foreach ($aTerm as $key => $oParent){ if ($oParent->vid == $iVoc){ $sReturn .= taxonomy_image_display($key, array("width"=> "30","height" => "30")); } } return $sReturn; } ?> $oTerm){ $items[$oTerm->tid] = $oTerm->name; $i++; } return drupal_json($items); } ?> t('None')); }else{ $aTermService = array(); } $firstTerm = null; $aTermRemove = array(); foreach ($aTerm as $key => $value){ /*if ($firstTerm == null && $bEnableNone == "false"){ $firstTerm = $key; }*/ $aTermService[$key] = t($value->name); array_push($aTermRemove,$key); } if (taxonomy_image_display($iTerm)){ $element["group_start"] = array( "#value" => "
".t($oTerm->name)."".taxonomy_image_display($iTerm), '#weight' => 0 ); }else{ $sImages = ""; for ($i = 0; $i < count($aTermRemove); $i++){ $sImages .= taxonomy_image_display($aTermRemove[$i])."  "; } $element["group_start"] = array( "#value" => "
".t($oTerm->name)."".$sImages, '#weight' => 0 ); } $field_key1 = $element['#columns'][0]; $field_key2 = $element['#columns'][1]; $req = ($field["required"] == 1) ? TRUE : FALSE; if ($bIsPoiType == "true"){ $element[$field_key1] = array( '#type' => 'radios', '#default_value' => $element['#value'][$field_key1] ? $element['#value'][$field_key1] : $firstTerm, '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#options' => $aTermService, '#delta' => $element['#delta'], '#weight' => 1, '#required' => $req, '#attributes' => array( "onclick"=>"javascript:chooseTaxonomyPoiType(this,".$iVid.",".$iTerm.",".json_encode($aTermRemove).",'".$element["#id"]."-".str_replace("_","-",$field_key2)."');csservice_updateNodeTitle(this,".$iVid.");", ), ); if ($element['#value'][$field_key1]){ $element["scriptpoitype"] = array( '#value' =>"", '#weight' => 2 ); } }else{ $element[$field_key1] = array( '#type' => 'radios', '#default_value' => $element['#value'][$field_key1] ? $element['#value'][$field_key1] : $firstTerm, '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#options' => $aTermService, '#delta' => $element['#delta'], '#weight' => 1, '#required' => $req, '#attributes' => array( "onclick"=>"javascript:chooseTaxonomy(this,".$iVid.",".$iTerm.",".json_encode($aTermRemove).",'".$element["#id"]."-".str_replace("_","-",$field_key2)."');" ), ); } if ($bEnableDescription == "true"){ $element[$field_key2] = array( '#title' => t("Description"), '#type' => 'textarea', '#default_value' => isset($element['#value'][$field_key2]) ? $element['#value'][$field_key2] : "", '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#columns' => $element['#columns'], '#delta' => $element['#delta'], '#weight' => 3, ); }else{ $element[$field_key2] = array( '#type' => 'hidden', '#default_value' => "", '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#columns' => $element['#columns'], '#delta' => $element['#delta'], '#weight' => 3, ); } if ($element['#value'][$field_key1] == ""){ $element["group_stop"] = array( "#value" => "
", '#weight' => 4 ); }else{ $element["group_stop"] = array( "#value" => "
", '#weight' => 4 ); } // Used so that hook_field('validate') knows where to flag an error. $element['_error_element'] = array( '#type' => 'value', '#value' => implode('][', array_merge($element['#parents'], array($field_key))), ); return $element; } function theme_csservices_csservices($element) { return $element['#children']; } function csservices_csservices_process_value($item) { //print_r($item); return $item; } ?> 'api', 'v' => 2, 'key' => $googleapikey ); $content = " "; switch ($type){ case "big": $content .= "
".t("Loading...")."
"; break; case "small": $content .= "
".t("Loading...")."
"; break; } $content .= " "; return $content; } function geoposition_showNames($data, $type ="big"){ switch ($type) { case 'big': return "
".t("Nation")."".$data->nation."
".t("Region")."".$data->region."
".t("Province")."".$data->province."
".t("City")."".$data->city."
"; break; case 'small': return "".$data->city."( ".$data->province.", ".$data->nation." )"; break; case 'main': return "
".t("City")."".$data->city."
".t("Province")."".$data->province."
".t("Region")."".$data->region."
"; break; } } function geoposition_getLocation($loc_lau2_id){ //$result = db_query("select nome as city from loc_lau2 where ID_lau2 = '$loc_lau2_id'"); $result = db_query(" select {loc_lau2}.nome as city, {loc_lau1}.nome as undefined, {loc_nuts0}.nome as nation, {loc_nuts1}.nome as area, {loc_nuts2}.nome as region, {loc_nuts3}.nome as province, {loc_nuts0}.ID_Nuts0 as idnation, {loc_nuts2}.ID_Nuts2 as idregion, {loc_nuts3}.ID_Nuts3 as idprovince, {loc_lau2}.ID_Lau2 as idcity from {loc_lau2} left join {loc_lau1} on {loc_lau2}.ID_Lau1 = {loc_lau1}.ID_Lau1 left join {loc_nuts0} on {loc_lau2}.ID_Nuts0 = {loc_nuts0}.ID_Nuts0 left join {loc_nuts1} on {loc_lau2}.ID_Nuts1 = {loc_nuts1}.ID_Nuts1 left join {loc_nuts2} on {loc_lau2}.ID_Nuts2 = {loc_nuts2}.ID_Nuts2 left join {loc_nuts3} on {loc_lau2}.ID_Nuts3 = {loc_nuts3}.ID_Nuts3 where {loc_lau2}.ID_Lau2 = '".$loc_lau2_id."' "); $oData = db_fetch_object($result); return $oData; } function geoposition_getNation(){ $items = array(); $result = db_query(" select {loc_nuts0}.ID_Nuts0 as id, {loc_nuts0}.nome as name from {loc_nuts0} order by {loc_nuts0}.nome "); //$oData = db_fetch_object($result); while ($row = db_fetch_object($result)) { $items[$row->id] = $row->name; } return $items; } function geoposition_getRegion($id){ $result = db_query(" select {loc_nuts2}.ID_Nuts2 as id, {loc_nuts2}.nome as name from {loc_nuts2} where {loc_nuts2}.ID_Nuts0 = '".$id."' order by {loc_nuts2}.nome "); while ($row = db_fetch_object($result)) { $items[$row->id] = $row->name; } return $items; } function geoposition_getProvince($id){ $result = db_query(" select {loc_nuts3}.ID_Nuts3 as id, {loc_nuts3}.nome as name from {loc_nuts3} where {loc_nuts3}.ID_Nuts2 = '".$id."' order by {loc_nuts3}.nome "); while ($row = db_fetch_object($result)) { $items[$row->id] = $row->name; } return $items; } function geoposition_getCity($id){ $result = db_query(" select {loc_lau2}.ID_Lau2 as id, {loc_lau2}.nome as name from {loc_lau2} where {loc_lau2}.ID_Nuts3 = '".$id."' order by {loc_lau2}.nome "); while ($row = db_fetch_object($result)) { $items[$row->id] = $row->name; } return $items; } ?> 'textfield', '#title' => t('Google api key'), '#maxlength' => 128, '#required' => TRUE, '#default_value'=> variable_get("geoposition_googleapikey",null) ); $form["geoposition_base_dir_service"] = array( '#type' => 'textfield', '#title' => t('Base Directory for Services'), '#maxlength' => 128, '#required' => TRUE, '#default_value'=> variable_get("geoposition_base_dir_service",null) ); /** Metti il node type **/ $form['submit'] = array('#type' => 'submit', '#value' => t('Submit')); return $form; } function geopositionadmin_form_submit($form, &$form_state) { variable_set("geoposition_googleapikey",$form_state['values']["googleapi"]); variable_set("geoposition_base_dir_service",$form_state['values']["geoposition_base_dir_service"]); drupal_set_message(t("GEOPOSITION: Data Stored")); } function geopositionadminlocation_form($form_state){ /** Metti il node type **/ $form['submit'] = array('#type' => 'submit', '#value' => t('Attiva Sync Location')); return $form; } function geopositionadminlocation_form_submit($form, &$form_state) { //print_r(node_load(12)); // Get all nodes poi /*$node->data1 = "foo"; $node->data2 = "bar"; node_object_prepare($node); // this is about the default values node_save($node);*/ /*$node = new stdClass(); $node->type = "location"; $node->title = "Cantagallo"; $node->field_city = array( 0 => array ( "loc_lau_id" => "100001" ) ); node_save($node);*/ drupal_set_message(t("Location sync done")); } ?> 'api', 'v' => 2, 'key' => $googleapikey ); drupal_set_html_head(''); $module_path = drupal_get_path('module', 'geoposition'); if (array_search('webmaster', $user->roles) != NULL){ drupal_add_js($module_path."/js/geoposition_admin.js"); }else{ drupal_add_js($module_path."/js/geoposition.js"); } drupal_add_js($module_path."/js/autonodetitle.js"); //print_r($element); $element["begin_block"] = array( '#value' => "
", '#weight' => 0, ); $field_key1 = $element['#columns'][0]; $element["location_text"] = array( '#value' => geoposition_showNames(geoposition_getLocation(isset($element['#value'][$field_key1]) ? $element['#value'][$field_key1] : "0000")), '#weight' => 0, ); $element[$field_key1] = array( '#type' => 'hidden', '#default_value' => isset($element['#value'][$field_key1]) ? $element['#value'][$field_key1] : "0000", '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#columns' => $element['#columns'], '#delta' => $element['#delta'], '#weight' => 1, ); $idLocation = isset($element['#value'][$field_key1]) ? $element['#value'][$field_key1] : "0000"; $LocationData = geoposition_getLocation($idLocation); $aNation = geoposition_getNation(); $aRegion = geoposition_getRegion($LocationData->idnation); $aProvince = geoposition_getProvince($LocationData->idregion); $aCity = geoposition_getCity($LocationData->idprovince); $element["geoposition_location"] = array( '#type' => 'fieldset', '#title' => t('Choose Location'), '#weight' => 2, '#collapsible' => FALSE, '#collapsed' => FALSE, '#attributes' => array( 'id' => 'div_geoposition_location' ) ); $element["geoposition_location"]["slcNation"] = array( '#type' => 'select', '#title' => t('Nation'), '#options' => $aNation, '#attributes' => array( "onchange"=>"javascript:loadRegionData();" ), '#default_value' => $LocationData->idnation ); $element["geoposition_location"]["slcRegion"] = array( '#type' => 'select', '#title' => t('Region'), '#options' => $aRegion, '#attributes' => array( "onchange"=>"javascript:loadProvinceData();" ), '#default_value' => $LocationData->idregion ); $element["geoposition_location"]["slcProvince"] = array( '#type' => 'select', '#title' => t('Province'), '#options' => $aProvince, '#attributes' => array( "onchange"=>"javascript:loadCityData();" ), '#default_value' => $LocationData->idprovince ); $element["geoposition_location"]["slcCity"] = array( '#type' => 'select', '#title' => t('City'), '#options' => $aCity, '#attributes' => array( "onchange"=>"javascript:loadPosData();" ), '#default_value' => $LocationData->idcity ); $field_key4 = $element['#columns'][3]; $element[$field_key4] = array( '#title' => t("Location"), '#type' => 'textfield', '#default_value' => isset($element['#value'][$field_key4]) ? $element['#value'][$field_key4] : "", '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#columns' => $element['#columns'], '#delta' => $element['#delta'], '#weight' => 3, ); $field_key5 = $element['#columns'][4]; $element[$field_key5] = array( '#title' => t("Address"), '#type' => 'textfield', '#default_value' => isset($element['#value'][$field_key5]) ? $element['#value'][$field_key5] : "", '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#columns' => $element['#columns'], '#delta' => $element['#delta'], '#weight' => 4, ); $field_key2 = $element['#columns'][1]; $element[$field_key2] = array( '#title' => t("Lat"), '#type' => 'textfield', '#default_value' => isset($element['#value'][$field_key2]) ? $element['#value'][$field_key2] : "45.133497", '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#columns' => $element['#columns'], '#delta' => $element['#delta'], '#weight' => 5, '#attributes' => array( 'readonly' => 'true' ) ); $field_key3 = $element['#columns'][2]; $element[$field_key3] = array( '#title' => t("Long"), '#type' => 'textfield', '#default_value' => isset($element['#value'][$field_key3]) ? $element['#value'][$field_key3] : "10.026135", '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#columns' => $element['#columns'], '#delta' => $element['#delta'], '#weight' => 6, '#attributes' => array( 'readonly' => 'true' ) ); $element["gmap"] = array( '#value' => "
".t("Loading...")."
", '#weight' => 7, ); $element["end_block"] = array( '#value' => "
", '#weight' => 8, ); // Used so that hook_field('validate') knows where to flag an error. $element['_error_element'] = array( '#type' => 'value', '#value' => implode('][', array_merge($element['#parents'], array($field_key))), ); return $element; } function geoposition_geoposition_validate($element , &$form_state){ if (!isset($element["#post"]["title"])){ // E'un Form per decidere i default -> non validare return; } $field_name = $element['#field_name']; $type_name = $element['#type_name']; $field = content_fields($field_name, $type_name); $field_key = $element['#columns'][0]; $value = $element['#value'][$field_key]; if ($value == "0000") { form_set_error('', t('You must specify a valid location!')); return; } $error_field = implode('][', $element['#parents']) .']['. $field_key; // Estrazione nome città e provincia $result = db_query(" select {node}.nid as nid, {node}.type as type, {content_type_location}.field_city_loc_lau_id as loc_lau_id from {node} inner join {content_type_location} on {node}.nid = {content_type_location}.nid where {content_type_location}.field_city_loc_lau_id = '".$value."' "); if (!$row = db_fetch_object($result)){ // Creazione del nodo // Estrazione del titolo $result2 = db_query(" select {loc_lau2}.nome as city, {loc_nuts3}.nome as prov from {loc_lau2} inner join {loc_nuts3} on {loc_lau2}.ID_Nuts3 = {loc_nuts3}.ID_Nuts3 where {loc_lau2}.ID_Lau2 = '".$value."' "); $row2 = db_fetch_object($result2); $title = $row2->city." (".$row2->prov.")"; // TODO // inserimento campi link // Verifica univocità link $node = new stdClass(); $node->type = "location"; $node->title = $title; $node->field_city = array( 0 => array ( "loc_lau_id" => $value, ) ); node_save($node); }else{ // TODO // update dei campi link // Verifica di quelli esistenti (se url è uguale ciccia) } } function theme_geoposition_geoposition($element) { return $element['#children']; } function geoposition_geoposition_process_value($item) { //print_r($item); return $item; } ?> 'api', 'v' => 2, 'key' => $googleapikey ); $module_path = drupal_get_path('module', 'geoposition'); drupal_add_js($module_path."/js/location.js"); //print_r($element); $element["begin_block"] = array( '#value' => "
", '#weight' => 0, ); $field_key1 = $element['#columns'][0]; $element["location_text"] = array( '#value' => geoposition_showNames(geoposition_getLocation(isset($element['#value'][$field_key1]) ? $element['#value'][$field_key1] : "19036")), '#weight' => 0, ); $element[$field_key1] = array( '#type' => 'hidden', '#default_value' => isset($element['#value'][$field_key1]) ? $element['#value'][$field_key1] : "19036", '#field_name' => $element['#field_name'], '#type_name' => $element['#type_name'], '#columns' => $element['#columns'], '#delta' => $element['#delta'], '#weight' => 1, ); $idLocation = isset($element['#value'][$field_key1]) ? $element['#value'][$field_key1] : "19036"; $LocationData = geoposition_getLocation($idLocation); $aNation = geoposition_getNation(); $aRegion = geoposition_getRegion($LocationData->idnation); $aProvince = geoposition_getProvince($LocationData->idregion); $aCity = geoposition_getCity($LocationData->idprovince); $element["geoposition_location"] = array( '#type' => 'fieldset', '#title' => t('Select Location'), '#weight' => 2, '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array( 'id' => 'div_geoposition_location' ) ); $element["geoposition_location"]["slcNation"] = array( '#type' => 'select', '#title' => t('Select Nation'), '#options' => $aNation, '#attributes' => array( "onchange"=>"javascript:loadRegionData();" ), '#default_value' => $LocationData->idnation ); $element["geoposition_location"]["slcRegion"] = array( '#type' => 'select', '#title' => t('Select Region'), '#options' => $aRegion, '#attributes' => array( "onchange"=>"javascript:loadProvinceData();" ), '#default_value' => $LocationData->idregion ); $element["geoposition_location"]["slcProvince"] = array( '#type' => 'select', '#title' => t('Select Province'), '#options' => $aProvince, '#attributes' => array( "onchange"=>"javascript:loadCityData();" ), '#default_value' => $LocationData->idprovince ); $element["geoposition_location"]["slcCity"] = array( '#type' => 'select', '#title' => t('Select City'), '#options' => $aCity, '#attributes' => array( "onchange"=>"javascript:chooseCity();" ), '#default_value' => $LocationData->idcity ); $element["end_block"] = array( '#value' => "
", '#weight' => 6, ); // Used so that hook_field('validate') knows where to flag an error. $element['_error_element'] = array( '#type' => 'value', '#value' => implode('][', array_merge($element['#parents'], array($field_key))), ); return $element; } function theme_geoposition_location($element) { return $element['#children']; } function geoposition_location_process_value($item) { //print_r($item); return $item; } ?>$field_name; $result = db_query(" select {node}.nid as nid, {node}.type as type, {content_type_location}.field_city_loc_lau_id as loc_lau_id from {node} inner join {content_type_location} on {node}.nid = {content_type_location}.nid where {content_type_location}.field_city_loc_lau_id = '".$location_field[0]["loc_lau_id"]."' "); $row = db_fetch_object($result); $node = node_load($row->nid); if ($node){ return t("Informations")." ".$node->title; }else{ return ""; } } ?>$field_name; /*$result = db_query(" select {node}.nid as nid, {node}.type as type, {content_type_location}.field_city_loc_lau_id as loc_lau_id from {node} inner join {content_type_location} on {node}.nid = {content_type_location}.nid where {content_type_location}.field_city_loc_lau_id = '".$location_field[0]["loc_lau_id"]."' ");*/ //echo "Pos ".$location_field[0]["lat"]."
"; // Calcolo deltalat //print_r($element["#node"]->field_poilocation); $minX = $location_field[0]["long"] - 0.02; $maxX = $location_field[0]["long"] + 0.02; $minY = $location_field[0]["lat"] - 0.02; $maxY = $location_field[0]["lat"] + 0.02; $params = array( 'order' => 'popularity', 'set' => 'public', 'from' => '0', 'to' => '10', 'minx' => $minX, 'miny' => $minY, 'maxx' => $maxX, 'maxy' => $maxY, 'size' => 'thumbnail', ); $encoded_params = array(); foreach ($params as $k => $v){ $encoded_params[] = urlencode($k).'='.urlencode($v); } $url = "http://www.panoramio.com/map/get_panoramas.php?".implode("&", $encoded_params); $rsp = file_get_contents($url); if (!$rsp){ return "errore di accesso"; }else{ $res = json_decode($rsp); $data = array(); for ($i =0; $i < count($res->photos); $i++){ array_push($data, array(" photos[$i]->photo_id.".jpg\" rev=\"http://static.panoramio.com/\" rel=\"lightbox\"> photos[$i]->photo_file_url."\"> ",$res->photos[$i]->photo_title)); } return theme_table(null,$data, array(), null); } /*$row = db_fetch_object($result); $node = node_load($row->nid); if ($node){ return node_view($node); }else{ return ""; }*/ } ?>$field_name; $loc_lau_id = $location_field[0]["loc_lau_id"]; $result = db_query(" select {loc_lau2}.meteo as meteo from {loc_lau2} where {loc_lau2}.ID_Lau2 = '".$loc_lau_id."' "); $row = db_fetch_object($result); if ($row->meteo){ return ""; }else{ return ""; } } ?>
Fatal error: require_once(): Failed opening required 'sites/all/modules/01-backup/ctools_old/page_manager/plugins/tasks/node_view.inc' (include_path='.:/opt/plesk/php/5.6/share/pear') in /data/vhosts/camperservicesearch.com/httpdocs/site/includes/menu.inc on line 348