You are here

function hacked_menu in Hacked! 5

Same name and namespace in other branches
  1. 6.2 hacked.module \hacked_menu()
  2. 6 hacked.module \hacked_menu()
  3. 7.3 hacked.module \hacked_menu()
  4. 7.2 hacked.module \hacked_menu()

Implementation of hook_menu().

File

./hacked.module, line 23
The Hacked! module, shows which project have been changed since download.

Code

function hacked_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/logs/hacked',
      'title' => 'Hacked',
      'description' => 'Get a code hacking report about your installed modules and themes.',
      'callback' => 'hacked_reports_hacked',
      'access' => user_access('administer site configuration'),
      'weight' => 10,
    );
  }
  else {

    // Get a list of all the projects on the site
    if (arg(0) == 'admin' && arg(1) == 'logs' && arg(2) == 'hacked' && arg(3)) {
      $items[] = array(
        'path' => 'admin/logs/hacked/' . arg(3),
        //'title callback' => 'hacked_reports_hacked_details_title',

        ///'title arguments' => array(3),
        'callback' => '_hacked_reports_hacked_details',
        'callback arguments' => array(
          arg(3),
        ),
        'access' => user_access('administer site configuration'),
        'type' => MENU_CALLBACK,
      );
      if (arg(4) == 'diff' && _hacked_get_menu_tail(6)) {
        $items[] = array(
          'path' => 'admin/logs/hacked/' . arg(3) . '/diff/' . _hacked_get_menu_tail(6),
          //'title callback' => 'hacked_reports_hacked_diff_title',

          //'title arguments' => array(3, 5),

          //'load arguments'   => array('%map', '%index'),
          'callback' => '_hacked_reports_hacked_diff',
          'callback arguments' => array(
            arg(3),
            _hacked_get_menu_tail(6),
          ),
          'access' => user_access('view diffs of changed files'),
          'type' => MENU_CALLBACK,
        );
      }
    }
  }
  return $items;
}