Browse Source

- Add the Help page + Help widget

pull/5/head
Jaussoin Timothée 14 years ago
parent
commit
71d1801ece
  1. 42
      system/Controller/ControllerMain.php
  2. 76
      system/Widget/widgets/Help/Help.php
  3. 3
      system/Widget/widgets/Help/help.css
  4. 25
      themes/movim/css/style2.css
  5. 21
      themes/movim/help.tpl

42
system/Controller/ControllerMain.php

@ -41,6 +41,7 @@ class ControllerMain extends ControllerBase
$this->page->menuAddLink(t('Home'), '?q=mainPage', true);
$this->page->menuAddLink(t('Profile'), '?q=profile');
$this->page->menuAddLink(t('Configuration'), '?q=config');
$this->page->menuAddLink(t('Help'), '?q=help');
$content = new TplPageBuilder($user);
@ -76,6 +77,7 @@ class ControllerMain extends ControllerBase
$this->page->menuAddLink($name, false, true);
$this->page->menuAddLink(t('Profile'), '?q=profile');
$this->page->menuAddLink(t('Configuration'), '?q=config');
$this->page->menuAddLink(t('Help'), '?q=help');
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('friend.tpl'));
@ -97,6 +99,7 @@ class ControllerMain extends ControllerBase
$this->page->menuAddLink(t('Home'), '?q=mainPage');
$this->page->menuAddLink(t('Profile'), '?q=profile');
$this->page->menuAddLink(t('Configuration'), '?q=config', true);
$this->page->menuAddLink(t('Help'), '?q=help');
$content = new TplPageBuilder($user);
@ -116,6 +119,7 @@ class ControllerMain extends ControllerBase
$this->page->menuAddLink(t('Home'), '?q=mainPage');
$this->page->menuAddLink(t('Profile'), '?q=profile', true);
$this->page->menuAddLink(t('Configuration'), '?q=config');
$this->page->menuAddLink(t('Help'), '?q=help');
$content = new TplPageBuilder($user);
@ -131,6 +135,7 @@ class ControllerMain extends ControllerBase
$this->page->menuAddLink('Movim | Human Network', 'http://www.movim.eu/');
$this->page->menuAddLink(t('Home'), '?q=mainPage');
$this->page->menuAddLink(t('Account Creation'), '?q=account', true);
//$this->page->menuAddLink(t('Help'), '?q=help');
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('account.tpl'));
@ -146,19 +151,50 @@ class ControllerMain extends ControllerBase
*/
function login()
{
global $sdb;
$message = new Message();
$sdb->create($message);
$this->page->setTitle(t('%s - Login to Movim', APP_TITLE));
$this->page->menuAddLink('Movim | Human Network', 'http://www.movim.eu/');
$this->page->menuAddLink(t('Home'), '?q=mainPage', true);
if(Conf::getServerConfElement("accountCreation") == 1)
$this->page->menuAddLink(t('Account Creation'), '?q=account');
//$this->page->menuAddLink(t('Help'), '?q=help');
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('login.tpl'));
echo $this->page->build('page.tpl');
}
/*
* Show help page
*/
function help()
{
$user = new User();
$this->page->setTitle(t('%s - Help Page', APP_TITLE));
if(!$user->isLogged()) {
/*$this->page->menuAddLink('Movim | Human Network', 'http://www.movim.eu/');
$this->page->menuAddLink(t('Home'), '?q=mainPage');
if(Conf::getServerConfElement("accountCreation") == 1)
$this->page->menuAddLink(t('Account Creation'), '?q=account');
$this->page->menuAddLink(t('Help'), '?q=help', true);*/
$this->login();
} else {
$this->page->menuAddLink(t('Home'), '?q=mainPage');
$this->page->menuAddLink(t('Profile'), '?q=profile');
$this->page->menuAddLink(t('Configuration'), '?q=config');
$this->page->menuAddLink(t('Help'), '?q=help', true);
}
$content = new TplPageBuilder($user);
$this->page->setContent($content->build('help.tpl'));
echo $this->page->build('page.tpl');
}
function disconnect()
{

76
system/Widget/widgets/Help/Help.php

@ -0,0 +1,76 @@
<?php
/**
* @package Widgets
*
* @file Vcard.php
* This file is part of MOVIM.
*
* @brief A widget which display some help
*
* @author Timothée Jaussoin <edhelas_at_gmail_dot_com>
*
* @version 1.0
* @date 3 may 2012
*
* Copyright (C)2010 MOVIM project
*
* See COPYING for licensing information.
*/
class Help extends WidgetBase
{
function WidgetLoad() {
$this->addcss('help.css');
}
function build()
{
?>
<div id="help">
<h2>Traduction de H. Rackham (1914)</h2>
<p>"But I must explain to you how all this mistaken idea of
denouncing pleasure and praising pain was born and I will
give you a complete account of the system, and expound the
actual teachings of the great explorer of the truth, the
master-builder of human happiness.</p>
<h3>No one rejects, dislikes,</h3>
Or avoids pleasure itself, because it is pleasure, but
because those who do not know how to pursue pleasure
rationally encounter consequences that are extremely
painful. Nor again is there anyone who loves or pursues or
desires to obtain pain of itself, because it is pain, but
because occasionally circumstances occur in which toil and
pain can procure him some great pleasure. To take a trivial
example, which of us ever undertakes laborious physical
exercise, except to obtain some advantage from it? But who
has any right to find fault with a man who chooses to enjoy
a pleasure that has no annoying consequences, or one who
avoids a pain that produces no resultant pleasure?"</p>
<a href="http://wiki.movim.eu">See the Official Wiki</a>
<h2>Section 1.10.33 du "De Finibus Bonorum et Malorum" de Ciceron (45 av. J.-C.)</h2>
<p>"At vero eos et accusamus et iusto odio dignissimos
ducimus qui blanditiis praesentium voluptatum deleniti
atque corrupti quos dolores et quas molestias excepturi
sint occaecati cupiditate non provident, similique sunt
in culpa qui officia deserunt mollitia animi, id est laborum
et dolorum fuga. Et harum quidem rerum facilis est et
expedita distinctio. Nam libero tempore, cum soluta nobis
est eligendi optio cumque nihil impedit quo minus id quod
maxime placeat facere possimus, omnis voluptas assumenda
est, omnis dolor repellendus. Temporibus autem quibusdam et
aut officiis debitis aut rerum necessitatibus saepe eveniet
ut et voluptates repudiandae sint et molestiae non
recusandae. Itaque earum rerum hic tenetur a sapiente
delectus, ut aut reiciendis voluptatibus maiores alias
consequatur aut perferendis doloribus asperiores repellat."
</p>
</div>
<?php
}
}

3
system/Widget/widgets/Help/help.css

@ -0,0 +1,3 @@
#help {
padding: 1.5em;
}

25
themes/movim/css/style2.css

@ -72,9 +72,32 @@ h1 {
font-size: 1.5em;
}
h2:first-child {
padding-top: 0px;
}
h2 {
color: #888;
padding-top: 0.6em;
padding-bottom: 0.5em;
font-size: 1.2em;
}
h3 {
color: #8C8C8C;
font-weight: bold;
font-size: 1.1em;
padding: 0.3em 0px;
}
p {
text-align: justify;
}
p:first-letter {
font-size: 2.5em;
padding-right: 0.1em;
padding-top: 0.15em;
float: left;
}
#topgray {

21
themes/movim/help.tpl

@ -0,0 +1,21 @@
<?php /* -*- mode: html -*- */
?>
<?php $this->widget('Poller');?>
<?php $this->widget('Logout');?>
<?php $this->widget('Chat');?>
<?php /*$this->widget('Log');*/?>
<div id="left">
<?php $this->widget('Profile'); ?>
<?php $this->widget('Notifs');?>
<?php $this->widget('Roster');?>
</div>
<div id="right">
</div>
<div id="center">
<h1><?php echo t('Help'); ?></h1>
<?php $this->widget('Help');?>
</div>
Loading…
Cancel
Save