aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-11-28 15:24:49 +0100
committerMario Vavti <mario@mariovavti.com>2016-11-28 15:24:49 +0100
commitf9b732482d1776ba0c8cad593157589189f6bedd (patch)
treeb9e0552beab431823c3fec3ad3bce05699ce3ae9 /include
parent683a09781ad9c9be00ce67e35f560e6fca051f3b (diff)
downloadvolse-hubzilla-f9b732482d1776ba0c8cad593157589189f6bedd.tar.gz
volse-hubzilla-f9b732482d1776ba0c8cad593157589189f6bedd.tar.bz2
volse-hubzilla-f9b732482d1776ba0c8cad593157589189f6bedd.zip
some basic work for implementing mimetypes for wikis
Diffstat (limited to 'include')
-rw-r--r--include/wiki.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/wiki.php b/include/wiki.php
index eb87840f6..c6ef7fe59 100644
--- a/include/wiki.php
+++ b/include/wiki.php
@@ -139,6 +139,9 @@ function wiki_create_wiki($channel, $observer_hash, $wiki, $acl) {
if (!set_iconfig($arr, 'wiki', 'urlName', $wiki['urlName'], true)) {
return array('item' => null, 'success' => false);
}
+ if (!set_iconfig($arr, 'wiki', 'mimteType', $wiki['mimeType'], true)) {
+ return array('item' => null, 'success' => false);
+ }
$post = item_store($arr);
$item_id = $post['item_id'];
@@ -179,17 +182,20 @@ function wiki_get_wiki($resource_id) {
$rawName = get_iconfig($w, 'wiki', 'rawName');
$htmlName = get_iconfig($w, 'wiki', 'htmlName');
$urlName = get_iconfig($w, 'wiki', 'urlName');
+ $mimeType = get_iconfig($w, 'wiki', 'mimeType');
$path = get_iconfig($w, 'wiki', 'path');
if (!realpath(__DIR__ . '/../' . $path)) {
return array('wiki' => null, 'path' => null);
}
// Path to wiki exists
$abs_path = realpath(__DIR__ . '/../' . $path);
- return array( 'wiki' => $w,
- 'path' => $abs_path,
- 'rawName' => $rawName,
- 'htmlName' => $htmlName,
- 'urlName' => $urlName
+ return array(
+ 'wiki' => $w,
+ 'path' => $abs_path,
+ 'rawName' => $rawName,
+ 'htmlName' => $htmlName,
+ 'urlName' => $urlName,
+ 'mimeType' => $mimeType
);
}
}