]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.7.x' into conversationtree
authorEvan Prodromou <evan@controlyourself.ca>
Tue, 19 May 2009 21:28:19 +0000 (17:28 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Tue, 19 May 2009 21:28:19 +0000 (17:28 -0400)
EVENTS.txt
index.php
lib/action.php
lib/searchaction.php
lib/subgroupnav.php
plugins/WikiHashtagsPlugin.php [new file with mode: 0644]
theme/base/css/display.css

index 5edf59245a5595710497350ad7d2c913cc4481bb..e0ce1166679a90f4e5c6289d9bc7f8dafaa94a13 100644 (file)
@@ -100,6 +100,14 @@ StartPublicGroupNav: Showing the public group nav menu
 EndPublicGroupNav: At the end of the public group nav menu
 - $action: the current action
 
+StartSubGroupNav: Showing the subscriptions group nav menu
+- $action: the current action
+
+EndSubGroupNav: At the end of the subscriptions group nav menu
+- $action: the current action
+
 RouterInitialized: After the router instance has been initialized
 - $m: the Net_URL_Mapper that has just been set up
 
+ArgsInitialized: After the argument array has been initialized
+- $args: associative array of arguments, can be modified
index e24bde9179fd884a220b05f26f170a06914b07b5..0c69e226f759845d159d68f271c37f9c38c93b4a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -101,6 +101,8 @@ function main()
 
     $args = array_merge($args, $_REQUEST);
 
+    Event::handle('ArgsInitialize', array(&$args));
+
     $action = $args['action'];
 
     if (!$action || !preg_match('/^[a-zA-Z0-9_-]*$/', $action)) {
index 3e43ffe3e3ee1427d53c571ee4fb52b639b31aa6..bab987de6cf2d55063d44ee67e611d934a637894 100644 (file)
@@ -98,15 +98,15 @@ class Action extends HTMLOutputter // lawsuit
             Event::handle('EndShowHTML', array($this));
         }
         if (Event::handle('StartShowHead', array($this))) {
-        $this->showHead();
+            $this->showHead();
             Event::handle('EndShowHead', array($this));
         }
         if (Event::handle('StartShowBody', array($this))) {
-        $this->showBody();
+            $this->showBody();
             Event::handle('EndShowBody', array($this));
         }
         if (Event::handle('StartEndHTML', array($this))) {
-        $this->endHTML();
+            $this->endHTML();
             Event::handle('EndEndHTML', array($this));
         }
     }
@@ -347,7 +347,7 @@ class Action extends HTMLOutputter // lawsuit
     {
         $this->elementStart('body', (common_current_user()) ? array('id' => $this->trimmed('action'),
                                                                     'class' => 'user_in')
-                                                            : array('id' => $this->trimmed('action')));
+                            : array('id' => $this->trimmed('action')));
         $this->elementStart('div', array('id' => 'wrap'));
         if (Event::handle('StartShowHeader', array($this))) {
             $this->showHeader();
@@ -431,10 +431,10 @@ class Action extends HTMLOutputter // lawsuit
                                     _('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect');
                 }
                 $this->menuItem(common_local_url('invite'),
-                                 _('Invite'),
-                                 sprintf(_('Invite friends and colleagues to join you on %s'),
-                                 common_config('site', 'name')),
-                                 false, 'nav_invitecontact');
+                                _('Invite'),
+                                sprintf(_('Invite friends and colleagues to join you on %s'),
+                                        common_config('site', 'name')),
+                                false, 'nav_invitecontact');
                 $this->menuItem(common_local_url('logout'),
                                 _('Logout'), _('Logout from the site'), false, 'nav_logout');
             }
@@ -591,7 +591,10 @@ class Action extends HTMLOutputter // lawsuit
                                         'class' => 'system_notice'));
         $this->element('dt', null, _('Page notice'));
         $this->elementStart('dd');
-        $this->showPageNotice();
+        if (Event::handle('StartShowPageNotice', array($this))) {
+            $this->showPageNotice();
+            Event::handle('EndShowPageNotice', array($this));
+        }
         $this->elementEnd('dd');
         $this->elementEnd('dl');
     }
@@ -629,7 +632,7 @@ class Action extends HTMLOutputter // lawsuit
         $this->elementStart('div', array('id' => 'aside_primary',
                                          'class' => 'aside'));
         if (Event::handle('StartShowExportData', array($this))) {
-        $this->showExportData();
+            $this->showExportData();
             Event::handle('EndShowExportData', array($this));
         }
         if (Event::handle('StartShowSections', array($this))) {
index e7ad4affdaab9eaac36e4fae6fe7c586443b9a1e..e74450e11f3e06dee57ce04754d81c7ac02a6bd6 100644 (file)
@@ -51,7 +51,7 @@ class SearchAction extends Action
      *
      * @return boolean true
      */
-    function isReadOnly()
+    function isReadOnly($args)
     {
         return true;
     }
index 31c3ea0b568e8ed62b1e0524cec920ba621ef958..4a9b36ae8fa1a198c7d2cb7d2be8f8732c4b62cb 100644 (file)
@@ -74,38 +74,44 @@ class SubGroupNav extends Widget
 
         $this->out->elementStart('ul', array('class' => 'nav'));
 
-        $this->out->menuItem(common_local_url('subscriptions',
-                                              array('nickname' =>
-                                                    $this->user->nickname)),
-                             _('Subscriptions'),
-                             sprintf(_('People %s subscribes to'),
-                                     $this->user->nickname),
-                             $action == 'subscriptions',
-                             'nav_subscriptions');
-        $this->out->menuItem(common_local_url('subscribers',
-                                              array('nickname' =>
-                                                    $this->user->nickname)),
-                             _('Subscribers'),
-                             sprintf(_('People subscribed to %s'),
-                                     $this->user->nickname),
-                             $action == 'subscribers',
-                             'nav_subscribers');
-        $this->out->menuItem(common_local_url('usergroups',
-                                              array('nickname' =>
-                                                    $this->user->nickname)),
-                             _('Groups'),
-                             sprintf(_('Groups %s is a member of'),
-                                     $this->user->nickname),
-                             $action == 'usergroups',
-                             'nav_usergroups');
-        if (!is_null($cur) && $this->user->id === $cur->id) {
-            $this->out->menuItem(common_local_url('invite'),
-                                 _('Invite'),
-                                 sprintf(_('Invite friends and colleagues to join you on %s'),
-                                         common_config('site', 'name')),
-                                 $action == 'invite',
-                                 'nav_invite');
+        if (Event::handle('StartSubGroupNav', array($this))) {
+
+            $this->out->menuItem(common_local_url('subscriptions',
+                                                  array('nickname' =>
+                                                        $this->user->nickname)),
+                                 _('Subscriptions'),
+                                 sprintf(_('People %s subscribes to'),
+                                         $this->user->nickname),
+                                 $action == 'subscriptions',
+                                 'nav_subscriptions');
+            $this->out->menuItem(common_local_url('subscribers',
+                                                  array('nickname' =>
+                                                        $this->user->nickname)),
+                                 _('Subscribers'),
+                                 sprintf(_('People subscribed to %s'),
+                                         $this->user->nickname),
+                                 $action == 'subscribers',
+                                 'nav_subscribers');
+            $this->out->menuItem(common_local_url('usergroups',
+                                                  array('nickname' =>
+                                                        $this->user->nickname)),
+                                 _('Groups'),
+                                 sprintf(_('Groups %s is a member of'),
+                                         $this->user->nickname),
+                                 $action == 'usergroups',
+                                 'nav_usergroups');
+            if (!is_null($cur) && $this->user->id === $cur->id) {
+                $this->out->menuItem(common_local_url('invite'),
+                                     _('Invite'),
+                                     sprintf(_('Invite friends and colleagues to join you on %s'),
+                                             common_config('site', 'name')),
+                                     $action == 'invite',
+                                     'nav_invite');
+            }
+
+            Event::handle('EndSubGroupNav', array($this));
         }
+
         $this->out->elementEnd('ul');
     }
 }
diff --git a/plugins/WikiHashtagsPlugin.php b/plugins/WikiHashtagsPlugin.php
new file mode 100644 (file)
index 0000000..6d186a5
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+/**
+ * Laconica, the distributed open-source microblogging tool
+ *
+ * Plugin to show WikiHashtags content in the sidebar
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category  Plugin
+ * @package   Laconica
+ * @author    Evan Prodromou <evan@controlyourself.ca>
+ * @copyright 2008 Control Yourself, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link      http://laconi.ca/
+ */
+
+if (!defined('LACONICA')) {
+    exit(1);
+}
+
+define('WIKIHASHTAGSPLUGIN_VERSION', '0.1');
+
+/**
+ * Plugin to use WikiHashtags
+ *
+ * @category Plugin
+ * @package  Laconica
+ * @author   Evan Prodromou <evan@controlyourself.ca>
+ * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link     http://laconi.ca/
+ *
+ * @see      Event
+ */
+
+class WikiHashtagsPlugin extends Plugin
+{
+    function __construct($code=null)
+    {
+        parent::__construct();
+    }
+
+    function onStartShowSections($action)
+    {
+        $name = $action->trimmed('action');
+
+        if ($name == 'tag') {
+
+            $taginput = $action->trimmed('tag');
+            $tag = common_canonical_tag($taginput);
+
+            if (!empty($tag)) {
+
+                $url = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=render',
+                               urlencode($tag));
+                $editurl = sprintf('http://hashtags.wikia.com/index.php?title=%s&action=edit',
+                                   urlencode($tag));
+
+                $context = stream_context_create(array('http' => array('method' => "GET",
+                                                                       'header' =>
+                                                                       "User-Agent: " . $this->userAgent())));
+                $html = @file_get_contents($url, false, $context);
+
+                $action->elementStart('div', array('id' => 'wikihashtags', 'class' => 'section'));
+
+                if (!empty($html)) {
+                    $action->element('style', null,
+                                     "span.editsection { display: none }\n".
+                                     "table.toc { display: none }");
+                    $action->raw($html);
+                    $action->elementStart('p');
+                    $action->element('a', array('href' => $editurl,
+                                                'title' => sprintf(_('Edit the article for #%s on WikiHashtags'), $tag)),
+                                     _('Edit'));
+                    $action->element('a', array('href' => 'http://www.gnu.org/copyleft/fdl.html',
+                                                'title' => _('Shared under the terms of the GNU Free Documentation License'),
+                                                'rel' => 'license'),
+                                     'GNU FDL');
+                    $action->elementEnd('p');
+                } else {
+                    $action->element('a', array('href' => $editurl),
+                                     sprintf(_('Start the article for #%s on WikiHashtags'), $tag));
+                }
+
+                $action->elementEnd('div');
+            }
+        }
+
+        return true;
+    }
+
+    function userAgent()
+    {
+        return 'WikiHashtagsPlugin/'.WIKIHASHTAGSPLUGIN_VERSION .
+          ' Laconica/' . LACONICA_VERSION;
+    }
+}
index 10fc636385326a05b3148ed6be5902e9d0e622fe..547752b5105601e5155682f8359f03c8efca8e0c 100644 (file)
@@ -495,7 +495,7 @@ line-height:1.618;
 /* entity_profile */
 .entity_profile {
 position:relative;
-width:67.702%;
+width:74.702%;
 min-height:123px;
 float:left;
 margin-bottom:18px;
@@ -531,12 +531,15 @@ margin-bottom:4px;
 .entity_profile .entity_nickname {
 margin-left:11px;
 display:inline;
-font-weight:bold;
 }
 .entity_profile .entity_nickname {
 margin-left:0;
 }
-
+.entity_profile .fn,
+.entity_profile .nickname {
+font-size:1.1em;
+font-weight:bold;
+}
 .entity_profile .entity_fn dd:before {
 content: "(";
 font-weight:normal;
@@ -558,7 +561,7 @@ display:none;
 /*entity_actions*/
 .entity_actions {
 float:right;
-margin-left:4.35%;
+margin-left:2.35%;
 max-width:25%;
 }
 .entity_actions h2 {