home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (rules_test.module)

This example Drupal source code file (rules_test.module) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

array, callback, function, getter, in, language, logged, op, php, rules_test_no_access, translate, true, type, user

The rules_test.module Drupal example source code

<?php
// $Id: rules_test.module,v 1.1.2.1 2010/12/16 09:30:44 fago Exp $

/**
 * @file Rules test module.
 */

/**
 * Implements hook_entity_property_info_alter() to add a property without
 * access.
 */
function rules_test_entity_property_info_alter(&$info) {
  $properties =& $info['site']['properties'];

  $properties['no-access-user'] = array(
    'label' => t("Logged in user"),
    'description' => t("The currently logged in user."),
    'getter callback' => 'entity_metadata_system_get_properties',
    'access callback' => 'rules_test_no_access',
    'type' => 'user',
  );
}

function rules_test_no_access($op) {
  return $op == 'edit' ? FALSE : TRUE;
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal rules_test.module source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.