Browse Source

- Add a "Discover" page for the public profiles

- Little CSS fixes
- Little Route fixes
pull/16/head
Jaussoin Timothée 12 years ago
parent
commit
b2933eee96
  1. 18
      app/controllers/ControllerMain.php
  2. 9
      app/widgets/Blog/Blog.php
  3. 64
      app/widgets/Discover/Discover.php
  4. 1
      system/Route.php
  5. 1
      themes/movim/conf.tpl
  6. 4
      themes/movim/css/style.css
  7. 13
      themes/movim/discover.tpl
  8. 1
      themes/movim/help.tpl
  9. 1
      themes/movim/media.tpl
  10. 1
      themes/movim/profile.tpl

18
app/controllers/ControllerMain.php

@ -298,6 +298,7 @@ class ControllerMain extends ControllerBase
{
$this->page->setTitle(t('%s - About', APP_TITLE));
$this->page->menuAddLink(t('Home'), 'main');
$this->page->menuAddLink(t('Discover'), 'discover');
$this->page->menuAddLink(t('About'), 'about', true);
$content = new TplPageBuilder();
@ -365,6 +366,7 @@ class ControllerMain extends ControllerBase
$this->page->setTitle(t('%s - Login to Movim', APP_TITLE));
$this->page->menuAddLink(t('Home'), 'main', true);
$this->page->menuAddLink(t('Discover'), 'discover');
$this->page->menuAddLink(t('About'), 'about');
$content = new TplPageBuilder($user);
@ -411,6 +413,22 @@ class ControllerMain extends ControllerBase
}
}
/**
* Discover the XMPP network from the internet
*/
function discover()
{
$this->page->setTitle(t('%s - Discover', APP_TITLE));
$this->page->menuAddLink(t('Home'), 'main');
$this->page->menuAddLink(t('Discover'), 'discover', true);
$this->page->menuAddLink(t('About'), 'about');
$content = new TplPageBuilder();
$this->page->setContent($content->build('discover.tpl'));
echo $this->page->build('page.tpl');
}
/*
* Show help page

9
app/widgets/Blog/Blog.php

@ -7,7 +7,8 @@ class Blog extends WidgetCommon {
$node = $_GET['n'];
$this->view->assign('from', $from);
$this->view->assign('node', $node);
if(isset($node))
$this->view->assign('node', $node);
$pd = new \modl\PostnDAO();
$messages = $pd->getPublic($from, $node);
@ -20,9 +21,9 @@ class Blog extends WidgetCommon {
$n = $pd->getNode($from, $node);
if(isset($n->title))
$this->view->assign('title', $n->title);
else
elseif(isset($n->nodeid))
$this->view->assign('title', $n->nodeid);
// Fir a simple contact
// For a simple contact
} else {
$this->view->assign('title', t("%s's feed",$messages[0]->getContact()->getTrueName()));
$this->view->assign('logo', $messages[0]->getContact()->getPhoto('l'));
@ -31,6 +32,8 @@ class Blog extends WidgetCommon {
$this->view->assign('date', date('c'));
$this->view->assign('name', $messages[0]->getContact()->getTrueName());
$this->view->assign('feed', Route::urlize('feed',array($from, $node)));
} else {
$this->view->assign('title', t('Feed'));
}
$this->view->assign('posts', $this->preparePosts($messages, true));

64
app/widgets/Discover/Discover.php

@ -0,0 +1,64 @@
<?php
class Discover extends WidgetCommon {
function WidgetLoad()
{
}
function prepareContacts() {
$html = '';
$cd = new \modl\ContactDAO();
$users = array_reverse($cd->getAllPublic());
$gender = getGender();
$marital = getMarital();
foreach($users as $user) {
$html .= '
<div class="post">
<a href="'.Route::urlize('blog', array($user->jid, false)).'">
<img class="avatar" src="'.$user->getPhoto('m').'"/>
<div class="postbubble">
<span class="name">'.
$user->getTrueName().'
</span>
<span class="asv">'.
$user->getAge().' '.
$gender[$user->gender].' '.
$marital[$user->marital].'
</span>
<div
class="content"
style="
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 1.5em;
"
>'.prepareString($user->desc).'</div>
</div>
</a>
</div>
';
}
return $html;
}
function build()
{
?>
<div id="discover">
<div class="paddedtopbottom">
<h2><?php echo t('Last registered'); ?></h2>
</div>
<div id="contactsresult">
<?php echo $this->prepareContacts(); ?>
</div>
</div>
<?php
}
}

1
system/Route.php

@ -12,6 +12,7 @@ class Route extends ControllerBase {
'loading' => false,
'admin' => false,
'explore' => false,
'discover' => false,
'profile' => false,
'media' => array('f'),
'conf' => false,

1
themes/movim/conf.tpl

@ -10,6 +10,7 @@
<div id="main">
<div id="left">
<?php $this->widget('Connection');?>
<?php $this->widget('Profile');?>
<?php $this->widget('Bookmark');?>
<?php $this->widget('Notifs');?>

4
themes/movim/css/style.css

@ -444,6 +444,7 @@ nav {
-moz-box-sizing: border-box;
}
.menu li .discover,
.menu li .explore { background-image: url(../img/icons/menu/globe.png); }
.menu li .profile { background-image: url(../img/icons/menu/user.png); }
.menu li .conf { background-image: url(../img/icons/menu/settings.png); }
@ -453,7 +454,8 @@ nav {
.menu li .up { background-image: url(../img/icons/menu/upload.png); }
.menu li .plus { background-image: url(../img/icons/menu/plus.png); }
.menu li .search { background-image: url(../img/icons/menu/search.png); }
.menu li .users, .menu li .account { background-image: url(../img/icons/menu/users.png); }
.menu li .users,
.menu li .account { background-image: url(../img/icons/menu/users.png); }
.menu li .expand { background-image: url(../img/icons/menu/expand.png); }
.menu li .contract { background-image: url(../img/icons/menu/contract.png); }
.menu li .media { background-image: url(../img/icons/menu/folder.png); }

13
themes/movim/discover.tpl

@ -0,0 +1,13 @@
<?php /* -*- mode: html -*- */
?>
<div id="head">
</div>
<div id="main" style="margin-top: 0px;">
<div id="left">
</div>
<div id="center">
<?php $this->widget('Discover');?>
</div>
</div>

1
themes/movim/help.tpl

@ -10,6 +10,7 @@
<div id="main">
<div id="left">
<?php $this->widget('Connection');?>
<?php $this->widget('Profile');?>
<?php $this->widget('Bookmark');?>
<?php $this->widget('Notifs');?>

1
themes/movim/media.tpl

@ -11,6 +11,7 @@
<div id="main">
<div id="left">
<?php $this->widget('Connection');?>
<?php $this->widget('Profile');?>
<?php $this->widget('Bookmark');?>
<?php $this->widget('Notifs');?>

1
themes/movim/profile.tpl

@ -10,6 +10,7 @@
</div>
<div id="main">
<div id="left">
<?php $this->widget('Connection');?>
<?php $this->widget('Profile');?>
<?php $this->widget('Bookmark');?>
<?php $this->widget('Notifs');?>

Loading…
Cancel
Save