uid==0)
{
drupal_goto(“/”);
}
$entra=intercetta_scuola_user_has_role(“Referente”,$user);
if(!$entra)
{
drupal_goto(“/”);
}
$nid=$_GET[‘nid’];
$aggiungi=$_GET[‘aggiungi’];
$menu=$_GET[‘menu’];
if(!empty($aggiungi) && !empty($nid) && !empty($menu))
{
$node=node_load($nid);
$alias=drupal_get_path_alias(“node/$nid”);
$nomeMenu=$_GET[‘menu’];
$item = array(
‘link_path’ => “node/$nid”,
‘link_title’ => $node->title,
‘menu_name’ => $nomeMenu,
‘weight’ => 0,
‘expanded’ => 0,
‘router_path’ => “node/%”,
);
menu_link_save($item);
drupal_set_message(“Voce di menu aggiunta correttamente”);
drupal_goto(“/admin/structure/menu/manage/$nomeMenu”);
}
?>
field_id_scuola[‘und’][0][‘value’];
$result = db_query(“select distinct nid from node n inner join field_data_field_id_scuola s on s.entity_id=n.nid inner join field_data_field_link l on l.entity_id=n.nid where s.field_id_scuola_value=$idScuola”);
$arr=array();
while ($record = $result->fetchObject())
{
// Perform operations on $record->title, etc. here.
$nidC=$record->nid;
$nodoC=node_load($nidC);
array_push($arr,$nodoC);
}
?>