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

Drupal example source code file (views_test.module)

This example Drupal source code file (views_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

access, argument1, argument2, array, description, function, null, permission, php, return, template, test, title, views_test

The views_test.module Drupal example source code

<?php
// $Id: views_test.module,v 1.1.2.9 2011/01/04 21:26:47 dereine Exp $

/**
 * Implements hook_permission().
 */
function views_test_permission() {
  return array(
    'views_test test permission' => array(
      'title' => t('Test permission'),
      'description' => t('views_test test permission'),
    ),
  );
}

/**
 * Implements hook_views_api().
 */
function views_test_views_api() {
  return array(
    'api' => '3.0-alpha1',
    'template path' => drupal_get_path('module', 'views_test') . '/templates',
  );
}

/**
 * Implements hook_views_data()
 */
function views_test_views_data() {
  return variable_get('views_test_views_data', array());
}

/**
 * Implements hook_views_plugins()
 */
function views_test_views_plugins() {
  return variable_get('views_test_views_plugins', array());
}

function views_test_test_static_access_callback($access) {
  return $access;
}

function views_test_test_dynamic_access_callback($access, $argument1, $argument2) {
  return $access && $argument1 == variable_get('test_dynamic_access_argument1', NULL) && $argument2 == variable_get('test_dynamic_access_argument2', NULL);
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal views_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.