Implementation of the MO References pages. More...
Functions | |
mo_references_get_targz_file ($archive, $filename) | |
Load a file from a .tar.gz file. | |
mo_references_view () | |
Menu callback function. | |
mo_references_link ($type, $ref=NULL, $body= '') | |
Implementation of hook_link(). | |
mo_references_view_list () | |
List all the active references. | |
mo_references_download ($reference) | |
Start a reference transfer. |
The MO References pages include the necessary functions to handle the decompression of the data from documentation archives and rendering of those files within your Drupal website.
The source files are expected to be static HTML (although it may include some Javascript.) This module will extract the content of the BODY tag and use that as if it were the BODY of a node. Using the administration settings, it is possible to remove some of the decorations from those static pages.
Filters can be applied to those pages to fix them up as required. For instance, some URLs may need fixing since they may not point at the right place (if proper local paths were used, they should work just fine though.)
http://www.m2osw.com/mo_references contact@m2osw.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
mo_references_download | ( | $ | reference | ) |
This function starts a reference transfer. The menu already checks whether the current user has permission to do so.
[in] | $reference | Name of the reference the user wants to download. |
References mo_references_load().
mo_references_get_targz_file | ( | $ | archive, | |
$ | filename | |||
) |
This function decompresses a gzip file expecting a tar formatted file and returns the one file that matches the specified filename.
If the file is not found, the function returns FALSE to indicate an error.
The path to the archive does not use the include path since we do not expect the tarballs to be where PHP code would otherwise be found.
[in] | $archive | Name of the archive file to read |
[in] | $filename | Name of the file to extract from the archive |
Referenced by mo_references_view().
mo_references_link | ( | $ | type, | |
$ | ref = NULL , |
|||
$ | body = '' | |||
) |
This function generates links for the MO Refrences link area.
[in] | $type | The type of link being generated (i.e. mo_references) |
[in] | $ref | The reference object being worked on. |
[in] | $body | The body of the page being presented. |
mo_references_view | ( | ) |
This function reads the path and determine the file to be returned for the documentation. If the path does not exist, we return the default document (i.e. index.html).
The function expects the name of a reference as the first parameter, the following parameters are folders and finally a filename within the reference.
References mo_references_get_targz_file(), mo_references_load(), and mo_references_view_list().
mo_references_view_list | ( | ) |
This function generates a list of all the active references so one can offer his users to choose which reference to look at.
Referenced by mo_references_view().