diff options
author | sembrestels <sembrestels@riseup.net> | 2011-10-13 02:39:43 +0200 |
---|---|---|
committer | sembrestels <sembrestels@riseup.net> | 2011-10-13 02:39:43 +0200 |
commit | 090e2188026c76ac396c919b27404dc7cb110bf8 (patch) | |
tree | 9f7f3a1278aa0a09f168abdc0db98f7de1788870 /views/default | |
download | elgg-090e2188026c76ac396c919b27404dc7cb110bf8.tar.gz elgg-090e2188026c76ac396c919b27404dc7cb110bf8.tar.bz2 |
Dokuwiki module for Elgg 1.7
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/dokuwiki/grouppage.php | 13 | ||||
-rw-r--r-- | views/default/dokuwiki/index.php | 7 | ||||
-rw-r--r-- | views/default/dokuwiki/metatags.php | 5 | ||||
-rw-r--r-- | views/default/dokuwiki/sidebar.php | 12 | ||||
-rw-r--r-- | views/default/object/dokuwiki.php | 25 | ||||
-rw-r--r-- | views/default/river/dokuwiki.php | 17 |
6 files changed, 79 insertions, 0 deletions
diff --git a/views/default/dokuwiki/grouppage.php b/views/default/dokuwiki/grouppage.php new file mode 100644 index 000000000..c5a342ac7 --- /dev/null +++ b/views/default/dokuwiki/grouppage.php @@ -0,0 +1,13 @@ +<?php + +$group = page_owner_entity(); +$offset = (int)get_input("offset",0); +if ($group->dokuwiki_enable == 'yes' && $group->dokuwiki_frontpage_enable == 'yes') { + echo '<div class="contentWrapper">'; + set_input("inline_page", true); + echo elggdokuwiki_page_handler(array($group->guid)); + echo '</div>'; + $count = elgg_get_entities(array('offset'=>$offset,'full_view'=>FALSE,'types'=>'group','container_guid'=>$group->getGUID(),'count'=>TRUE)); +} + +?> diff --git a/views/default/dokuwiki/index.php b/views/default/dokuwiki/index.php new file mode 100644 index 000000000..dd20235dd --- /dev/null +++ b/views/default/dokuwiki/index.php @@ -0,0 +1,7 @@ +<?php + global $CONFIG; + //error_log("DOKUWIKI_OPEN:".$CONFIG->pluginspath.'dokuwiki/lib/dokuwiki/'.$vars['page']); + $destfile = $CONFIG->pluginspath.'dokuwiki/lib/dokuwiki/'.$vars['page']; + if (file_exists($destfile)) + include($destfile); +?> diff --git a/views/default/dokuwiki/metatags.php b/views/default/dokuwiki/metatags.php new file mode 100644 index 000000000..b70fa4a32 --- /dev/null +++ b/views/default/dokuwiki/metatags.php @@ -0,0 +1,5 @@ +<?php +if (get_context() == "dokuwiki") { + tpl_metaheaders(); +} +?> diff --git a/views/default/dokuwiki/sidebar.php b/views/default/dokuwiki/sidebar.php new file mode 100644 index 000000000..c47a1bf6d --- /dev/null +++ b/views/default/dokuwiki/sidebar.php @@ -0,0 +1,12 @@ +<?php + +$group = page_owner_entity(); +if ($group->dokuwiki_enable == 'yes' && $group->dokuwiki_frontsidebar_enable == 'yes') { + set_input("inline_sidebar", true); + set_input("inline_page", false); + echo "<div id='group_pages_widget'>"; + echo elggdokuwiki_page_handler(array($group->guid)); + echo "</div>"; + } + +?> diff --git a/views/default/object/dokuwiki.php b/views/default/object/dokuwiki.php new file mode 100644 index 000000000..6746567cf --- /dev/null +++ b/views/default/object/dokuwiki.php @@ -0,0 +1,25 @@ +<?php + $entity = $vars['entity']; + $owner_guid = $entity->container_guid; + $owner = get_entity($owner_guid); + $icon = elgg_view( + "graphics/icon", array( + 'entity' => $owner, + 'size' => 'small', + ) + ); + + if ($vars['full_view']) { + // + } + elseif ($owner) { + $directory = $CONFIG->dataroot."wikis/".$owner_guid."/pages"; + $filecount = count(glob("" . $directory . "/*")); + $body = "<a href='".$vars['url']."pg/dokuwiki/".$owner_guid."'>".sprintf(elgg_echo('dokuwiki:wikifrom'),$owner->name)." (".sprintf(elgg_echo("dokuwiki:pages"), $filecount).")</a>"; + echo elgg_view_listing($icon, $body); + } + else { + // shouldn't show wikis from groups you can't see :-P + echo elgg_view_listing("", ""); + } +?> diff --git a/views/default/river/dokuwiki.php b/views/default/river/dokuwiki.php new file mode 100644 index 000000000..17e4949cd --- /dev/null +++ b/views/default/river/dokuwiki.php @@ -0,0 +1,17 @@ +<?php + // 'action_type'=>$action_type, 'subject_guid'=>$subject_guid, 'object_guid' =>$object_guid, 'item'=>$res + $user = get_entity($vars['item']->subject_guid); + $wiki = get_entity($vars['item']->object_guid); + $parts = explode("/", $vars['item']->action_type); + $id = $wiki->container_guid; + $namespace = "<a href='".$vars['url']."pg/dokuwiki/".$id."?id=".$parts[2]."'>".$parts[2]."</a>"; + if ($wiki_owner = get_entity($wiki->container_guid)) + $wikifrom = sprintf(elgg_echo("dokuwiki:wikifrom"), $wiki_owner->name); + else + $wikifrom = elgg_echo("dokuwiki:sitewiki"); + if ($wiki) + $wikiname = "<a href='".$wiki->getURL()."'>".$wikifrom."</a>"; + if ($user) + $user_node = "<a href='".$user->getURL()."'>" . $user->name . "</a>"; + echo sprintf(elgg_echo("dokuwiki:river:modified"), $user_node, $namespace, $wikiname); +?> |