diff options
author | Andrew Manning <andrew@reticu.li> | 2016-11-27 13:43:07 -0700 |
---|---|---|
committer | Andrew Manning <andrew@reticu.li> | 2016-11-27 13:43:07 -0700 |
commit | 7470b1180e884104b690b39dce90143c72c096a3 (patch) | |
tree | ed3e35300fb4f707d453060c8fb8388d15da355d /Zotlabs | |
parent | 99a4bb63c780a939673e2153226635133fbba0eb (diff) | |
download | volse-hubzilla-7470b1180e884104b690b39dce90143c72c096a3.tar.gz volse-hubzilla-7470b1180e884104b690b39dce90143c72c096a3.tar.bz2 volse-hubzilla-7470b1180e884104b690b39dce90143c72c096a3.zip |
Add ability to include page assets in documentation pages such as images. Updated Personal Channel tutorial to use local images using this new capability.
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Help.php | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Zotlabs/Module/Help.php b/Zotlabs/Module/Help.php index 570e8e0cf..27d94e405 100644 --- a/Zotlabs/Module/Help.php +++ b/Zotlabs/Module/Help.php @@ -44,8 +44,39 @@ class Help extends \Zotlabs\Web\Controller { return $o; } + + + if(argc() > 2 && argv(argc()-2) === 'assets') { + $path = ''; + for($x = 1; $x < argc(); $x ++) { + if(strlen($path)) + $path .= '/'; + $path .= argv($x); + } + $realpath = 'doc/' . $path; + //Set the content-type header as appropriate + $imageInfo = getimagesize($realpath); + switch ($imageInfo[2]) { + case IMAGETYPE_JPEG: + header("Content-Type: image/jpeg"); + break; + case IMAGETYPE_GIF: + header("Content-Type: image/gif"); + break; + case IMAGETYPE_PNG: + header("Content-Type: image/png"); + break; + default: + break; + } + header("Content-Length: " . filesize($realpath)); - $content = get_help_content(); + // dump the picture and stop the script + readfile($realpath); + killme(); + } + + $content = get_help_content(); return replace_macros(get_markup_template('help.tpl'), array( '$title' => t('$Projectname Documentation'), |