conStruct Import Drupal Module

Files

file  structImport.module
 

The conStruct Import module file.


Functions

 structImport_main ()
 Main Drupal hook procedure.
 structImport_access ($op, $node, $account)
 Define access restrictions.
 structImport_access_callback ()
 Access callback for the structImport_main() page.
 structImport_block ($op= 'list', $delta=0, $edit=array())
 Declare a block or set of blocks.
 structImport_contents ($which_block)
 Display the conStruct side-bar menu items.
 structImport_menu ()
 Define menu items and page callbacks.
 structImport_perm ()
 Define user permissions.
 conStruct_import ()
 Entry point of the "Import Tool".
 file_upload_error_message ($error_code)

Function Documentation

conStruct_import (  ) 

Entry point of the "Import Tool".

The Import tool is used import datasets from files.


Returns:
a string containing the HTML page generated by the Import tool.
Author:
Frederick Giasson, Structured Dynamics LLC.




Definition at line 327 of file structImport.module.

References $userIP, $wsq, file_upload_error_message(), and get_domain().

Referenced by structImport_main().

Here is the call graph for this function:

file_upload_error_message ( error_code  ) 

Todo:
fix the size of the error message with the one of the setting of the node

Definition at line 957 of file structImport.module.

Referenced by conStruct_import().

structImport_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 78 of file structImport.module.

structImport_access_callback (  ) 

Access callback for the structImport_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 100 of file structImport.module.

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

Declare a block or set of blocks.

Any module can create 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 136 of file structImport.module.

References $base_url, and structImport_contents().

Here is the call graph for this function:

structImport_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 216 of file structImport.module.

References $base_url.

Referenced by structImport_block().

structImport_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 36 of file structImport.module.

References $base_url, and conStruct_import().

Here is the call graph for this function:

structImport_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 255 of file structImport.module.

structImport_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 create 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 306 of file structImport.module.

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