<?php
include_once 'forms/directory.forms.inc';
include_once 'includes/api.inc';

/**
 * @file
 * Directory module.
 */

/**
 * Implements hook_help().
 */

function directory_help($path, $arg) {
  switch ($path) {
    case 'admin/help#directory':
      return '<p>' . t('Configuracion modulo directory', array('storage' => 'Configuracion modulo directorio' )) . '</p>';
  }
}

/**
 * Implements hook_permission().
 */

function directory_permission() {
  return array(
    'administer directory' =>  array(
      'title' => t('Administer directory'),
      'description' => t('Perform administration directory'),
    ),
  );
}

/**
 * Implements hook_menu().
 */

function directory_menu() {
  $items = array();
  // Config id Entity for render

  $items['admin/config/system/directory'] = array(
    'title' => 'Settings Directory',
    'page callback' => 'directory_config',
    'description' => 'Configure the directory module settings.',
    'access arguments' => array('administer directory'),
    'type' => MENU_NORMAL_ITEM,
    'position' => 'left',
    'weight' => -15,    
  ); 

  $items['admin/config/directory'] = array(
    'title' => 'Directory Config',
    'description' => 'Configure the advanced directory module settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('directory_config_entity'),
    'access arguments' => array('administer directory'),
    'type' => MENU_NORMAL_ITEM,
    'position' => 'left',
    'weight' => -16,      
  );

  // Render page directory
  $items['directorio'] = array( 
    'description' => t('Form Directory Poli'),
    'page callback' => 'drupal_get_form', 
    'page arguments' => array('directory_form'), 
    'access arguments' => array('access content'),
    'type' => MENU_NORMAL_ITEM,
  );
  return $items;
}

/**
 * Implements hook_theme().
 */
function directory_theme($existing, $type, $theme, $path) {
  $wrapper = ''; $node = '';
  $themes = array(

    'directory-results' => array(
    'template' => 'theme/directory-results',
      'variables' => array(
        'wrapper' => $wrapper,
        'node'    => $node,
      ),    
    ),
  
    'directory-results-stations' => array(
    'template' => 'theme/directory-results-stations',
      'variables' => array(
        'wrapper' => $wrapper,
        'node'    => $node,
      ),    
    ),    
 
    'directory-results-cais' => array(
    'template' => 'theme/directory-results-cais',
      'variables' => array(
        'wrapper' => $wrapper,
        'node'    => $node,
      ),    
    ),  

    'directory-results-quadrant' => array(
    'template' => 'theme/directory-results-quadrant',
      'variables' => array(
        'wrapper' => $wrapper,
        'node'    => $node,
      ),    
    ),  


    'directory-results-others-units' => array(
    'template' => 'theme/directory-results-others-units',
      'variables' => array(
        'wrapper' => $wrapper,
        'node'    => $node,
      ),    
    ),  

    'directory-results-keyword' => array(
    'template' => 'theme/directory-results-keyword',
      'variables' => array(
        'wrapper' => $wrapper,
        'node'    => $node,
      ),    
    ),

    'directory-results-dependencies' => array(
    'template' => 'theme/directory-results-dependencies',
      'variables' => array(
        'wrapper' => $wrapper,
        'node'    => $node,
      ),    
    ),

  );

  return $themes;
}
