|  | @@ -259,6 +259,8 @@ function materio_showroom_form_field_ui_field_edit_form_alter(&$form, &$form_sta
 | 
	
		
			
				|  |  |   * Implements hook_form_alter().
 | 
	
		
			
				|  |  |   */
 | 
	
		
			
				|  |  |  function materio_showroom_form_alter(&$form, &$form_state, $form_id) {
 | 
	
		
			
				|  |  | +  // dsm($form_id);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    // act only on node edit form
 | 
	
		
			
				|  |  |    if(isset($form['#node_edit_form'])){
 | 
	
		
			
				|  |  |      // dsm($form_id, 'form_id');
 | 
	
	
		
			
				|  | @@ -267,6 +269,7 @@ function materio_showroom_form_alter(&$form, &$form_state, $form_id) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      _materio_showroom_alter_location_field_form($form, $form_state, $form_id);
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  function _materio_showroom_alter_location_field_form(&$form, &$form_state, $form_id){
 | 
	
	
		
			
				|  | @@ -385,6 +388,33 @@ function materio_showroom_permission() {
 | 
	
		
			
				|  |  |    );
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * Implements hook_menu_local_tasks_alter().
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +function materio_showroom_menu_local_tasks_alter(&$data, $router_item, $root_path) {
 | 
	
		
			
				|  |  | +  switch($root_path){
 | 
	
		
			
				|  |  | +    case 'admin/content/showrooms' :
 | 
	
		
			
				|  |  | +      $item = menu_get_item('node/add/showroom');
 | 
	
		
			
				|  |  | +      if ($item['access']) {
 | 
	
		
			
				|  |  | +        $data['actions']['output'][] = array(
 | 
	
		
			
				|  |  | +          '#theme' => 'menu_local_action',
 | 
	
		
			
				|  |  | +          '#link' => $item,
 | 
	
		
			
				|  |  | +        );
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      // TODO: prepopulate user role and showroom taxo (https://www.drupal.org/project/prepopulate)
 | 
	
		
			
				|  |  | +      // $item = menu_get_item('admin/people/create');
 | 
	
		
			
				|  |  | +      // if ($item['access']) {
 | 
	
		
			
				|  |  | +      //   $data['actions']['output'][] = array(
 | 
	
		
			
				|  |  | +      //     '#theme' => 'menu_local_action',
 | 
	
		
			
				|  |  | +      //     '#link' => $item,
 | 
	
		
			
				|  |  | +      //   );
 | 
	
		
			
				|  |  | +      // }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      break;
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  //     __  ____                  __  _
 | 
	
		
			
				|  |  |  //    /  |/  (_)___ __________ _/ /_(_)___  ____
 | 
	
		
			
				|  |  |  //   / /|_/ / / __ `/ ___/ __ `/ __/ / __ \/ __ \
 | 
	
	
		
			
				|  | @@ -434,7 +464,7 @@ function materio_showroom_migrate_location_fields_settings_form(){
 | 
	
		
			
				|  |  |      '#type'=>'select',
 | 
	
		
			
				|  |  |      '#options'=>$nt_options,
 | 
	
		
			
				|  |  |      '#default_value' => $node_type,
 | 
	
		
			
				|  |  | -    '#title' => t('source field (must be a text field)'),
 | 
	
		
			
				|  |  | +    '#title' => t('Content type'),
 | 
	
		
			
				|  |  |      '#multiple' => false,
 | 
	
		
			
				|  |  |    );
 | 
	
		
			
				|  |  |  
 |