You are here

hacked.module in Hacked! 7.3

The Hacked! module, shows which project have been changed since download.

We download the original project file, and hash all the files contained within, then we hash our local copies and compare.

File

hacked.module
View source
<?php

/**
 * @file
 * The Hacked! module, shows which project have been changed since download.
 *
 * We download the original project file, and hash all the files contained
 * within, then we hash our local copies and compare.
 */

/**
 * Attach helpers.
 */
require_once __DIR__ . '/hacked.helpers.inc';

/**
 * Implements hook_help().
 */
function hacked_help($path, $arg) {
  return '';
}

/**
 * Implementation of hook_menu().
 */
function hacked_menu() {
  $items = [];
  $items['admin/reports/hacked'] = [
    'title' => 'Hacked',
    'description' => 'Get a code hacking report about your installed modules and themes.',
    'page callback' => 'drupal_get_form',
    'page arguments' => [
      'hacked_report_form',
    ],
    'access arguments' => [
      'check hacked',
    ],
    'weight' => 10,
    'file' => 'hacked.forms.inc',
  ];

  /*$items['admin/reports/hacked/settings'] = array(
      'title' => 'Settings',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('hacked_settings_form'),
      'access arguments' => array('administer site configuration'),
      'file' => 'hacked.admin.inc',
      'type' => MENU_LOCAL_TASK,
    );*/

  /*$items['admin/reports/hacked/list'] = [
      'title' => 'List projects',
      'type' => MENU_DEFAULT_LOCAL_TASK,
    ];*/

  /*$items['admin/reports/hacked/rebuild-report'] = array(
      'type' => MENU_CALLBACK,
      'page callback' => 'hacked_reports_rebuild',
      'access arguments' => array('administer site configuration'),
      'file' => 'hacked.report.inc',
    );*/

  /*$items['admin/reports/hacked/%hacked_project'] = array(
      'title callback' => 'hacked_reports_hacked_details_title',
      'title arguments' => array(3),
      'page callback' => 'hacked_reports_hacked_details',
      'page arguments' => array(3),
      'access arguments' => array('administer site configuration'),
      'type' => MENU_CALLBACK,
      'file' => 'hacked.details.inc',
    );*/

  /*if (module_exists('diff')) {
      $items['admin/reports/hacked/%hacked_project/diff/%menu_tail'] = array(
        'title callback' => 'hacked_reports_hacked_diff_title',
        'title arguments' => array(3, 5),
        'load arguments'   => array('%map', '%index'),
        'page callback' => 'hacked_reports_hacked_diff',
        'page arguments' => array(3, 5),
        'access arguments' => array('view diffs of changed files'),
        'type' => MENU_CALLBACK,
        'file' => 'hacked.diff.inc',
      );
    }*/
  return $items;
}

/**
 * Implementation of hook_permission().
 */
function hacked_permission() {
  return [
    'check hacked' => [
      'title' => t('Check your modules and themes'),
      'restrict access' => TRUE,
    ],
  ];
}

Functions

Namesort descending Description
hacked_help Implements hook_help().
hacked_menu Implementation of hook_menu().
hacked_permission Implementation of hook_permission().