conStruct Delete Drupal Module

Files

file  structDelete.module
 

The conStruct Delete module file.


file  structNetworks.module
 

The conStruct Networks module file.


Functions

 structDelete_main ()
 Main Drupal hook procedure.
 structDelete_access ($op, $node, $account)
 Define access restrictions.
 structDelete_access_callback ()
 Access callback for the structDelete_main() page.
 structDelete_menu ()
 Define menu items and page callbacks.
 structDelete_perm ()
 Define user permissions.
 structDelete_block ($op= 'list', $delta=0, $edit=array())
 Declare a block or set of blocks.
 structDelete_contents ($which_block)
 Display the conStruct side-bar menu items.
 conStruct_delete ()
 Entry point of the "Delete Tool".
 structNetworks_main ()
 Main Drupal hook procedure.
 structNetworks_access ($op, $node, $account)
 Define access restrictions.
 structNetworks_access_callback ()
 Access callback for the structNetworks_main() page.
 structNetworks_menu ()
 Define menu items and page callbacks.
 structNetworks_perm ()
 Define user permissions.
 structNetworks_block ($op= 'list', $delta=0, $edit=array())
 Declare a block or set of blocks.
 structNetworks_contents ($which_block)
 Display the conStruct side-bar menu items.
 conStruct_networks ()
 Entry point of the "Networks Tool".
 getNetworksList ()

Function Documentation

conStruct_delete (  ) 

Entry point of the "Delete Tool".

The Delete tool is used to remove the description of a resource from a node.


Returns:
a string containing the HTML page generated by the Create tool.
Note:
This module should be removed on we integrated CCK with the RDF structure.
This module is only for testing purposes since the editable classes are still hard-wired in this script.
Author:
Frederick Giasson, Structured Dynamics LLC.




Todo:
Finish to integrate the Datasets-Registry idea within conStruct
Todo:
Handling the "Dataset Removal" with another tool

Definition at line 321 of file structDelete.module.

References $base_url, $userIP, $wsq, get_domain(), getDatasetFromUri(), and getGroupIdFromDatasetUri().

Referenced by structDelete_main().

Here is the call graph for this function:

conStruct_networks (  ) 

Entry point of the "Networks Tool".

The Networks tool is used to remove the description of a resource from a node.


Returns:
a string containing the HTML page generated by the Create tool.
Note:
This module should be removed on we integrated CCK with the RDF structure.
This module is only for testing purposes since the editable classes are still hard-wired in this script.
Author:
Frederick Giasson, Structured Dynamics LLC.




Definition at line 320 of file structNetworks.module.

References getNetworksList().

Referenced by structNetworks_main().

Here is the call graph for this function:

getNetworksList (  ) 

Definition at line 463 of file structNetworks.module.

Referenced by conStruct_networks().

structDelete_access ( op,
node,
account 
)

Define access restrictions.

This hook allows node modules to limit access to the node types they define. The administrative account (user ID #1) always passes any access check, so this hook is not called in that case. If this hook is not defined for a node type, all access checks will fail, so only the administrator will be able to see content of that type. However, users with the "administer nodes" permission may always view and edit content through the administrative interface.


Warning:
The access hook is not yet implemented
Parameters:
[in] $op The operation to be performed. Possible values:

  • "create"
  • "delete"
  • "update"
  • "view
[in] $node The node on which the operation is to be performed, or, if it does not yet exist, the type of node to be created.
[in] $account A user object representing the user for whom the operation is to be performed.
Returns:
TRUE if the operation is to be allowed; FALSE if the operation is to be denied; NULL to not override the settings in the node_access table, or access control modules.
Author:
Frederick Giasson, Structured Dynamics LLC.
Todo:
Implementing the access hook properly
See also:
http://api.drupal.org/api/function/hook_access




Definition at line 76 of file structDelete.module.

structDelete_access_callback (  ) 

Access callback for the structDelete_main() page.


Warning:
The access hook callback function is not yet implemented
Returns:
TRUE if the operation is to be allowed; FALSE if the operation is to be denied; NULL to not override the settings in the node_access table, or access control modules.
Author:
Frederick Giasson, Structured Dynamics LLC.
Todo:
Implementing the callback function for the access hook
See also:
http://api.drupal.org/api/function/hook_access




Definition at line 98 of file structDelete.module.

structDelete_block ( op = 'list',
delta = 0,
edit = array() 
)

Declare a block or set of blocks.

Any module can delete a block (or blocks) to be displayed by defining the _block hook. This hook is called by theme.inc to display a block, and also by block.module to procure the list of available blocks.

The functions mymodule_display_block_1 and 2, as used in the example, should of course be defined somewhere in your module and return the content you want to display to your users. If the "content" element is empty, no block will be displayed even if "subject" is present.

After completing your blocks, do not forget to enable them in the block admin menu.


Parameters:
[in] $op What kind of information to retrieve about the block or blocks. Possible values:

  • 'list': A list of all blocks defined by the module.
  • 'configure': Configuration form for the block.
  • 'save': Save the configuration options.
  • 'view': Process the block when enabled in a region in order to view its contents.
[in] $delta Which block to return (not applicable if $op is 'list'). Although it is most commonly an integer starting at 0, this is not mandatory. For instance, aggregator.module uses string values for $delta.
[in] $edit If $op is 'save', the submitted form data from the configuration form.
Returns:
If $op is 'list': An array of block descriptions. Each block description is an associative array.
Author:
Frederick Giasson, Structured Dynamics LLC.
See also:
http://api.drupal.org/api/function/hook_block




Definition at line 201 of file structDelete.module.

References $base_url, and structDelete_contents().

Here is the call graph for this function:

structDelete_contents ( which_block  ) 

Display the conStruct side-bar menu items.

This function is called to generate the HTML of the tool lists being displayed in the side-bar.


Returns:
A string where the HTML menus have been defined.
Author:
Frederick Giasson, Structured Dynamics LLC.




Definition at line 281 of file structDelete.module.

References $base_url.

Referenced by structDelete_block().

structDelete_main (  ) 

Main Drupal hook procedure.

This hook is the first one called by Drupal when one of the module's page is accessed. We use this hook to:

  • Get the URI that has been accessed by the user
  • Trigger the conStruct tool related to this URI by calling its main procedure.


Returns:
A string containing the HTML page description generated by the conStruct tool
Author:
Frederick Giasson, Structured Dynamics LLC.




Definition at line 34 of file structDelete.module.

References $base_url, and conStruct_delete().

Here is the call graph for this function:

structDelete_menu (  ) 

Define menu items and page callbacks.

This hook enables modules to register paths, which determines whose requests are to be handled. Depending on the type of registration requested by each path, a link is placed in the the navigation block and/or an item appears in the menu administration page (q=admin/menu).


Returns:
An array of menu items. Each menu item has a key corresponding to the Drupal path being registered. The item is an associative array.
Author:
Frederick Giasson, Structured Dynamics LLC.
See also:
http://api.drupal.org/api/function/hook_block




Definition at line 120 of file structDelete.module.

structDelete_perm (  ) 

Define user permissions.

This hook can supply permissions that the module defines, so that they can be selected on the user permissions page and used to restrict access to actions the module performs.

The permissions in the array do not need to be wrapped with the function t(), since the string extractor takes care of extracting permission names defined in the perm hook for translation.

Permissions are checked using user_access().


Note:
Currently only two kind of users exist: (1) "access" and (2) "administer". However, we expect to have more kind of users in the future for different node maintenance purposes.
Depending on the user (access or administer), some part of this delete module will be available to the user.
Once new permissions are created, the node administrator has to set their permissions in the setting panel of the node
Returns:
An array of permissions strings.
Author:
Frederick Giasson, Structured Dynamics LLC.
See also:
http://api.drupal.org/api/function/hook_perm




Definition at line 162 of file structDelete.module.

structNetworks_access ( op,
node,
account 
)

Define access restrictions.

This hook allows node modules to limit access to the node types they define. The administrative account (user ID #1) always passes any access check, so this hook is not called in that case. If this hook is not defined for a node type, all access checks will fail, so only the administrator will be able to see content of that type. However, users with the "administer nodes" permission may always view and edit content through the administrative interface.


Warning:
The access hook is not yet implemented
Parameters:
[in] $op The operation to be performed. Possible values:

  • "create"
  • "delete"
  • "update"
  • "view
[in] $node The node on which the operation is to be performed, or, if it does not yet exist, the type of node to be created.
[in] $account A user object representing the user for whom the operation is to be performed.
Returns:
TRUE if the operation is to be allowed; FALSE if the operation is to be denied; NULL to not override the settings in the node_access table, or access control modules.
Author:
Frederick Giasson, Structured Dynamics LLC.
Todo:
Implementing the access hook properly
See also:
http://api.drupal.org/api/function/hook_access




Definition at line 75 of file structNetworks.module.

structNetworks_access_callback (  ) 

Access callback for the structNetworks_main() page.


Warning:
The access hook callback function is not yet implemented
Returns:
TRUE if the operation is to be allowed; FALSE if the operation is to be denied; NULL to not override the settings in the node_access table, or access control modules.
Author:
Frederick Giasson, Structured Dynamics LLC.
Todo:
Implementing the callback function for the access hook
See also:
http://api.drupal.org/api/function/hook_access




Definition at line 97 of file structNetworks.module.

structNetworks_block ( op = 'list',
delta = 0,
edit = array() 
)

Declare a block or set of blocks.

Any module can delete a block (or blocks) to be displayed by defining the _block hook. This hook is called by theme.inc to display a block, and also by block.module to procure the list of available blocks.

The functions mymodule_display_block_1 and 2, as used in the example, should of course be defined somewhere in your module and return the content you want to display to your users. If the "content" element is empty, no block will be displayed even if "subject" is present.

After completing your blocks, do not forget to enable them in the block admin menu.


Parameters:
[in] $op What kind of information to retrieve about the block or blocks. Possible values:

  • 'list': A list of all blocks defined by the module.
  • 'configure': Configuration form for the block.
  • 'save': Save the configuration options.
  • 'view': Process the block when enabled in a region in order to view its contents.
[in] $delta Which block to return (not applicable if $op is 'list'). Although it is most commonly an integer starting at 0, this is not mandatory. For instance, aggregator.module uses string values for $delta.
[in] $edit If $op is 'save', the submitted form data from the configuration form.
Returns:
If $op is 'list': An array of block descriptions. Each block description is an associative array.
Author:
Frederick Giasson, Structured Dynamics LLC.
See also:
http://api.drupal.org/api/function/hook_block




Definition at line 200 of file structNetworks.module.

References $base_url, and structNetworks_contents().

Here is the call graph for this function:

structNetworks_contents ( which_block  ) 

Display the conStruct side-bar menu items.

This function is called to generate the HTML of the tool lists being displayed in the side-bar.


Returns:
A string where the HTML menus have been defined.
Author:
Frederick Giasson, Structured Dynamics LLC.




Definition at line 280 of file structNetworks.module.

References $base_url.

Referenced by structNetworks_block().

structNetworks_main (  ) 

Main Drupal hook procedure.

This hook is the first one called by Drupal when one of the module's page is accessed. We use this hook to:

  • Get the URI that has been accessed by the user
  • Trigger the conStruct tool related to this URI by calling its main procedure.


Returns:
A string containing the HTML page description generated by the conStruct tool
Author:
Frederick Giasson, Structured Dynamics LLC.




Definition at line 33 of file structNetworks.module.

References $base_url, and conStruct_networks().

Here is the call graph for this function:

structNetworks_menu (  ) 

Define menu items and page callbacks.

This hook enables modules to register paths, which determines whose requests are to be handled. Depending on the type of registration requested by each path, a link is placed in the the navigation block and/or an item appears in the menu administration page (q=admin/menu).


Returns:
An array of menu items. Each menu item has a key corresponding to the Drupal path being registered. The item is an associative array.
Author:
Frederick Giasson, Structured Dynamics LLC.
See also:
http://api.drupal.org/api/function/hook_block




Definition at line 119 of file structNetworks.module.

structNetworks_perm (  ) 

Define user permissions.

This hook can supply permissions that the module defines, so that they can be selected on the user permissions page and used to restrict access to actions the module performs.

The permissions in the array do not need to be wrapped with the function t(), since the string extractor takes care of extracting permission names defined in the perm hook for translation.

Permissions are checked using user_access().


Note:
Currently only two kind of users exist: (1) "access" and (2) "administer". However, we expect to have more kind of users in the future for different node maintenance purposes.
Depending on the user (access or administer), some part of this delete module will be available to the user.
Once new permissions are created, the node administrator has to set their permissions in the setting panel of the node
Returns:
An array of permissions strings.
Author:
Frederick Giasson, Structured Dynamics LLC.
See also:
http://api.drupal.org/api/function/hook_perm




Definition at line 161 of file structNetworks.module.

Copyright © 2009-2011. Structured Dynamics LLC Structured Dynamics LLC. All rights reserved.