]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Improving wiki listing view.
authorsembrestels <sembrestels@riseup.net>
Thu, 13 Oct 2011 05:01:11 +0000 (07:01 +0200)
committersembrestels <sembrestels@riseup.net>
Thu, 13 Oct 2011 05:01:11 +0000 (07:01 +0200)
start.php
views/default/object/dokuwiki.php

index f44206b3d04b5f2501656385b678db76462b1bca..b54f53b84333b8d3a8f69a22f87cf0f8e129851a 100644 (file)
--- a/start.php
+++ b/start.php
@@ -157,7 +157,7 @@ function dokuwiki_init(){
        }
 
        function elggdokuwiki_url($entity) {
-               return elgg_get_url_site() . "dokuwiki/".$entity->container_guid;
+               return elgg_get_site_url() . "dokuwiki/".$entity->container_guid;
        }
 
 ?>
index 6746567cf06a82f0a88b373e58fbea315b345496..12063b9dad5c06c2c8b611f9f8a6d674f2962977 100644 (file)
@@ -2,24 +2,18 @@
        $entity = $vars['entity'];
        $owner_guid = $entity->container_guid;
        $owner = get_entity($owner_guid);
-       $icon = elgg_view(
-                        "graphics/icon", array(
-                        'entity' => $owner,
-                        'size' => 'small',
-                  )
-                );
+       
+       $icon = elgg_view_entity_icon($owner, 'tiny');
 
-       if ($vars['full_view']) {
-               //
-       }
-       elseif ($owner) {
-               $directory = $CONFIG->dataroot."wikis/".$owner_guid."/pages";
+       if ($owner) {
+               $directory = elgg_get_data_path()."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);
+               $list_body = "<h3><a href='".$entity->getURL()."'>".sprintf(elgg_echo('dokuwiki:wikifrom'),$owner->name)."</a></h3>";
+               $list_body .= sprintf(elgg_echo("dokuwiki:pages"), $filecount);
+               echo elgg_view_image_block($icon, $list_body);
        }
        else {
                // shouldn't show wikis from groups you can't see :-P
-               echo elgg_view_listing("", "");
+               echo elgg_view_image_block("", "");
        }
 ?>