You are here

om_tools.module in OM Tools 7.2

This is a collection of OM Tools.

@author: Daniel Honrade http://drupal.org/user/351112

File

om_tools.module
View source
<?php

// $Id$

/**
 * @file
 * This is a collection of OM Tools.
 *
 * @author: Daniel Honrade http://drupal.org/user/351112
 *
 */

/**
 * @include
 *
 *  Reusable code library
 *
 */
@(include_once dirname(__FILE__) . '/inc/om_tools.utils.inc');

/**
 * Implementation of hook_menu().
 *
 */
function om_tools_menu() {
  $tools = om_tools_get();
  $items = array();
  $items['admin/config/system/om-tools'] = array(
    'title' => 'OM Tools',
    'page callback' => 'drupal_get_form',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer om tools',
    ),
    'page arguments' => array(
      'om_tools_admin',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'inc/om_tools.admin.inc',
  );
  $items['admin/config/system/om-tools/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer om tools',
    ),
    'page arguments' => array(
      'om_tools_admin',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'inc/om_tools.admin.inc',
    'weight' => 0,
  );
  $items['admin/config/system/om-tools/advanced-editing'] = array(
    'title' => 'Advanced Editing',
    'page callback' => 'drupal_get_form',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer om tools',
    ),
    'page arguments' => array(
      'om_tools_admin_advanced',
      'om_tools',
      'OM Tools 2',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'inc/om_tools.admin.inc',
    'weight' => 1,
  );
  if (in_array('user', $tools)) {
    $items['user/login-register'] = array(
      'title' => '',
      'page callback' => 'user_login_register',
      'access callback' => 'user_access',
      'access arguments' => array(
        'access content',
      ),
      'type' => MENU_CALLBACK,
      'file' => 'tools/user/user.inc',
    );
  }
  return $items;
}

/**
 * Implementation of hook_perm().
 *
 */
function om_tools_permission() {
  return array(
    'administer om tools' => array(
      'title' => t('Administer OM Tools'),
      'description' => t('Perform administration tasks for OM Tools.'),
    ),
  );
}

/**
 * Implementation of hook_form_alter().
 *
 * @param $form
 * @param $form_state
 * @param $form_id
 * @return array()
 */
function om_tools_form_alter(&$form, &$form_state, $form_id) {
  om_tools_alter($form, $form_state, $form_id);
}

/**
 * Override or insert om variables into the templates.
 */
function om_tools_preprocess_html(&$vars) {
  om_tools_processor($vars, 'preprocess_html');
}

/**
 * Override or insert om variables into the templates.
 */
function om_tools_process_html(&$vars) {
  om_tools_processor($vars, 'process_html');
}

/**
 * Override or insert om variables into the templates.
 */
function om_tools_preprocess_page(&$vars) {
  om_tools_processor($vars, 'preprocess_page');
}

/**
 * Override or insert om variables into the templates.
 */
function om_tools_process_page(&$vars) {
  om_tools_processor($vars, 'process_page');
}

/**
 * Override or insert om variables into the templates.
 *
 */
function om_tools_preprocess_block(&$vars) {
  om_tools_processor($vars, 'preprocess_block');

  //dsm($vars);
}

Functions

Namesort descending Description
om_tools_form_alter Implementation of hook_form_alter().
om_tools_menu Implementation of hook_menu().
om_tools_permission Implementation of hook_perm().
om_tools_preprocess_block Override or insert om variables into the templates.
om_tools_preprocess_html Override or insert om variables into the templates.
om_tools_preprocess_page Override or insert om variables into the templates.
om_tools_process_html Override or insert om variables into the templates.
om_tools_process_page Override or insert om variables into the templates.