]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/section.php
Merge branch '1.0.x' of git://gitorious.org/statusnet/mainline
[quix0rs-gnu-social.git] / lib / section.php
index 753a37efa424dc52c4f7da187aff869f464aade0..2d8d6f3673f50233ec266a964f22ea8a27297f45 100644 (file)
@@ -61,22 +61,39 @@ class Section extends Widget
                                  array('id' => $this->divId(),
                                        'class' => 'section'));
 
-        $this->out->element('h2', null,
-                            $this->title());
+        $this->showTitle();
 
         $have_more = $this->showContent();
 
         if ($have_more) {
-            $this->out->elementStart('p');
-            $this->out->element('a', array('href' => $this->moreUrl(),
-                                      'class' => 'more'),
-                           $this->moreTitle());
-            $this->out->elementEnd('p');
+            $this->showMore();
         }
 
         $this->out->elementEnd('div');
     }
 
+    function showTitle()
+    {
+        $link = $this->link();
+        if (!empty($link)) {
+            $this->out->elementStart('h2');
+            $this->out->element('a', array('href' => $link), $this->title());
+            $this->out->elementEnd('h2');
+        } else {
+            $this->out->element('h2', null,
+                                $this->title());
+        }
+    }
+
+    function showMore()
+    {
+        $this->out->elementStart('p');
+        $this->out->element('a', array('href' => $this->moreUrl(),
+                                       'class' => 'more'),
+                            $this->moreTitle());
+        $this->out->elementEnd('p');
+    }
+
     function divId()
     {
         return 'generic_section';
@@ -88,6 +105,11 @@ class Section extends Widget
         return _('Untitled section');
     }
 
+    function link()
+    {
+        return null;
+    }
+
     function showContent()
     {
         $this->out->element('p', null,