better UI
authorDuck (Jakob Munih) <duck@obala.net>
Wed, 25 Feb 2009 11:16:55 +0000 (12:16 +0100)
committerDuck (Jakob Munih) <duck@obala.net>
Wed, 25 Feb 2009 11:16:55 +0000 (12:16 +0100)
15 files changed:
folks/edit/friends/add.php
folks/edit/friends/blacklist.php
folks/edit/friends/for.php
folks/edit/friends/friends.php
folks/edit/friends/from.php
folks/edit/friends/index.php
folks/edit/friends/invite.php
folks/edit/friends/know.php
folks/edit/friends/of.php
folks/friends.php
folks/templates/edit/add.php
folks/templates/edit/friends.php
folks/templates/edit/invite.php
folks/templates/edit/tabs.php [deleted file]
folks/templates/friends/friends.php

index f90b386..7978c8e 100644 (file)
@@ -66,7 +66,9 @@ Horde::addScriptFile('tables.js', 'horde', true);
 require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
-echo $tabs->render('blacklist');
+echo $tabs->render('add');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/add.php';
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index eaaffeb..a282bd9 100644 (file)
@@ -82,8 +82,9 @@ require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('blacklist');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/friends.php';
-
 $friend_form->renderActive();
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index 5ea034d..12fe7b9 100644 (file)
@@ -52,6 +52,8 @@ require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friendsof');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/friends.php';
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index 3fb4892..08d79f1 100644 (file)
@@ -49,6 +49,8 @@ require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friends');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/friends.php';
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index e8ac38d..904ffc9 100644 (file)
@@ -44,6 +44,8 @@ require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friendsof');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/friends.php';
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index 4abbb6a..9a5e2b8 100644 (file)
@@ -48,6 +48,8 @@ require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friends');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/friends.php';
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index 9a291f3..c0ea69e 100644 (file)
@@ -58,6 +58,8 @@ require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friends');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/invite.php';
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index 78d2de6..73805d5 100644 (file)
@@ -48,6 +48,8 @@ require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friends');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/friends.php';
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index 6fa4cd3..dcd5508 100644 (file)
@@ -44,6 +44,8 @@ require FOLKS_TEMPLATES . '/common-header.inc';
 require FOLKS_TEMPLATES . '/menu.inc';
 
 echo $tabs->render('friendsof');
+require FOLKS_TEMPLATES . '/edit/header.php';
 require FOLKS_TEMPLATES . '/edit/friends.php';
+require FOLKS_TEMPLATES . '/edit/footer.php';
 
 require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index c7d6ade..5dd8be0 100644 (file)
@@ -53,12 +53,11 @@ foreach ($friend_list as $user) {
         continue;
     }
     foreach ($activities as $activity) {
-        $firendActivities[$activity['activity_date']] = array('message' => $activity['activity_message'],
-                                                                'scope' => $activity['activity_scope'],
-                                                                'user' => $user);
+        $firendActivities[$activity['activity_date']] = $activity;
     }
 }
 krsort($firendActivities);
+$firendActivities = array_slice($firendActivities, 0, 30);
 
 // Own activities
 $activities = $folks_driver->getActivity(Auth::getAuth());
@@ -68,13 +67,6 @@ if ($activities instanceof PEAR_Error) {
     exit;
 }
 
-// Users online
-$online = $folks_driver->getOnlineUsers();
-if ($online instanceof PEAR_Error) {
-    $notification->push($online);
-    $online = array();
-}
-
 Horde::addScriptFile('stripe.js', 'horde', true);
 
 require FOLKS_TEMPLATES . '/common-header.inc';
index d2de40f..15f18ec 100644 (file)
@@ -1,3 +1 @@
-<?php require dirname(__FILE__) . '/tabs.php'; ?>
-
 <?php echo $friend_form->renderActive(null, null, null, 'post')?>
\ No newline at end of file
index 0dee0a7..a296d34 100644 (file)
@@ -1,5 +1,3 @@
-<?php require dirname(__FILE__) . '/tabs.php'; ?>
-
 <h1 class="header"><?php echo $title ?></h1>
 
 <?php
index 5542bf3..c3f789d 100644 (file)
@@ -1,3 +1 @@
-<?php require dirname(__FILE__) . '/tabs.php'; ?>
-
 <?php echo $form->renderActive(null, null, null, 'post')?>
\ No newline at end of file
diff --git a/folks/templates/edit/tabs.php b/folks/templates/edit/tabs.php
deleted file mode 100644 (file)
index 1f16753..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<h1 class="header"><?php echo _("Friends") ?></h1>
-<br />
-<br />
-
-<?php
-
-// Users online
-$online = $folks_driver->getOnlineUsers();
-if ($online instanceof PEAR_Error) {
-    return $online;
-}
-
-// Get groups
-$groups = $friends->getGroups();
-if ($groups instanceof PEAR_Error) {
-    $notification->push($groups);
-    $groups = array();
-}
-
-$vars = Variables::getDefaultVariables();
-$ftabs = new Horde_UI_Tabs('ftab', $vars);
-
-$ftabs->addTab(_("Add"), Horde::applicationUrl('edit/friends/add.php'), 'add');
-$ftabs->addTab(_("All"), Horde::applicationUrl('edit/friends/index.php'), 'all');
-$ftabs->addTab(_("Invite"), Horde::applicationUrl('edit/friends/invite.php'), 'invite');
-
-foreach ($groups as $group_id => $group_name) {
-    $ftabs->addTab($group_name, Horde::applicationUrl('edit/friends/friends.php'), $group_id);
-}
-
-$ftabs->addTab(_("Might know"), Horde::applicationUrl('edit/friends/know.php'), 'know');
-$ftabs->addTab(_("Wainting for"), Horde::applicationUrl('edit/friends/for.php'), 'for');
-$ftabs->addTab(_("Wainting from"), Horde::applicationUrl('edit/friends/from.php'), 'from');
-$ftabs->addTab(_("I am friend of"), Horde::applicationUrl('edit/friends/of.php'), 'of');
-$ftabs->addTab(_("Blacklist"), Horde::applicationUrl('edit/friends/blacklist.php'), 'blacklist');
-
-echo $ftabs->render();
index 284abdb..cf96daf 100644 (file)
@@ -8,80 +8,14 @@
 <h1 class="header">
 <span style="float: right"><a href="<?php echo Horde::applicationUrl('edit/friends/index.php') ?>"><?php echo _("Edit friends") ?></a></span>
 <?php echo _("Friends activities") ?></h1>
-<table id="friendactivities" class="striped sortable"  style="width: 100%">
-<thead>
-<tr>
-    <th><?php echo _("User") ?></th>
-    <th><?php echo _("Activity") ?></th>
-</tr>
-</thead>
-<tbody>
 <?php
-foreach ($firendActivities as $activity_date => $activity) {
-    echo '<tr>'
-            . '<td><a href="' . Folks::getUrlFor('user', $activity['user']) . '">'
-            . '<img src="' . Folks::getImageUrl($activity['user']) . '" class="userMiniIcon" /> '
-                . $activity['user'] . '</a></td>'
-            . ' <td>' . $activity['message'] . '<br />' .
-                    '<span class="small">' . Folks::format_datetime($activity_date) . '</span>'
-            . '</td></tr>';
-}
+$list = $firendActivities;
+require FOLKS_TEMPLATES . '/block/activities.php';
 ?>
 
-</table>
-
-<br />
-<br />
-
-<h1 class="header">
-<span style="float: right"><a href="<?php echo Horde::applicationUrl('edit/activity.php') ?>"><?php echo _("Edit activities") ?></a></span>
-<?php echo _("Your activities") ?>
-</h1>
-<table id="activities" class="striped sortable" style="width: 100%">
-<thead>
-<tr>
-    <th><?php echo _("Application") ?></th>
-    <th><?php echo _("Activity") ?></th>
-</tr>
-</thead>
-<tbody>
-<?php foreach ($activities as $activity) { ?>
-<tr>
-    <td><a href="<?php echo $registry->get('webroot', $activity['activity_scope']) ?>" />
-        <img src="<?php echo $registry->getImageDir($activity['activity_scope']) . '/' . $activity['activity_scope'] ?>.png" />
-        <?php echo $registry->get('name', $activity['activity_scope']) ?></a>
-    </td>
-    <td>
-        <?php echo $activity['activity_message']; unset($activity['activity_message']); ?><br >
-        <span class="small"><?php echo Folks::format_datetime($activity['activity_date']) ?></span>
-    </td>
-</tr>
-<?php } ?>
-</tbody>
-</table>
-
 </td>
 <td>
 
-<h1 class="header"><?php echo _("Online friends") ?></h1>
-<?php
-// Prepare actions
-$actions = array(
-    array('url' => Horde::applicationUrl('user.php'),
-          'id' => 'user',
-          'name' => _("View profile")));
-if ($registry->hasInterface('letter')) {
-    $actions[] = array('url' => $registry->callByPackage('letter', 'compose', ''),
-                        'id' => 'user_to',
-                        'name' => _("Send message"));
-}
-$list = array_intersect($friend_list, array_flip($online));
-require FOLKS_TEMPLATES . '/block/users.php';
-?>
-
-<br />
-<br />
-
 <h1 class="header"><?php echo _("People you might know") ?></h1>
 <?php
 // Prepare actions
@@ -120,6 +54,18 @@ $list = $friend_list;
 require FOLKS_TEMPLATES . '/block/users.php';
 ?>
 
+<br />
+<br />
+
+<h1 class="header">
+<span style="float: right"><a href="<?php echo Horde::applicationUrl('edit/activity.php') ?>"><?php echo _("Edit activities") ?></a></span>
+<?php echo _("Your activities") ?>
+</h1>
+<?php
+$list = $activities;
+require FOLKS_TEMPLATES . '/block/activities.php';
+?>
+
 </td>
 </tr>
 </table>