14 changed files with 175 additions and 78 deletions
-
15app/controllers/AboutController.php
-
13app/controllers/DisconnectController.php
-
15app/controllers/LoginController.php
-
18app/controllers/MainController.php
-
0app/views/about.tpl
-
0app/views/login.tpl
-
25app/views/main.tpl
-
9bootstrap.php
-
10index.php
-
10system/Tpl/TplPageBuilder.php
-
55system/Tpl/TplTheme.php
-
38system/controllers/BaseController.php
-
42system/controllers/FrontController.php
-
3system/i18n/i18n.php
@ -0,0 +1,15 @@ |
|||
<?php |
|||
|
|||
class AboutController extends BaseController { |
|||
function load() { |
|||
$this->session_only = false; |
|||
} |
|||
|
|||
function dispatch() { |
|||
$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); |
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
<?php |
|||
|
|||
class DisconnectController extends BaseController { |
|||
function load() { |
|||
$this->session_only = false; |
|||
} |
|||
|
|||
function dispatch() { |
|||
$user = new User(); |
|||
$user->desauth(); |
|||
$this->name = 'login'; |
|||
} |
|||
} |
@ -0,0 +1,15 @@ |
|||
<?php |
|||
|
|||
class LoginController extends BaseController { |
|||
function load() { |
|||
$this->session_only = false; |
|||
} |
|||
|
|||
function dispatch() { |
|||
$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'); |
|||
} |
|||
} |
@ -0,0 +1,18 @@ |
|||
<?php |
|||
|
|||
class MainController extends BaseController { |
|||
function load() { |
|||
$this->session_only = true; |
|||
} |
|||
|
|||
function dispatch() { |
|||
$this->page->setTitle(t('%s - Welcome to Movim', APP_TITLE)); |
|||
$this->page->menuAddLink(t('Home'), 'main', true); |
|||
$this->page->menuAddLink(t('News'), 'news'); |
|||
$this->page->menuAddLink(t('Explore'), 'explore'); |
|||
$this->page->menuAddLink(t('Profile'), 'profile'); |
|||
$this->page->menuAddLink(t('Media'), 'media'); |
|||
$this->page->menuAddLink(t('Configuration'), 'conf'); |
|||
$this->page->menuAddLink(t('Help'), 'help'); |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
<?php /* -*- mode: html -*- */ |
|||
?> |
|||
<?php $this->widget('Poller');?> |
|||
<?php $this->widget('Presence');?> |
|||
<?php $this->widget('Chat');?> |
|||
<?php //$this->widget('ChatExt');?> |
|||
|
|||
<div id="main"> |
|||
<div id="left"> |
|||
<?php $this->widget('Connection');?> |
|||
<?php $this->widget('Profile');?> |
|||
<?php $this->widget('Bookmark');?> |
|||
<?php $this->widget('Notifs');?> |
|||
<?php $this->widget('Location');?> |
|||
</div> |
|||
|
|||
<div id="center"> |
|||
<?php $this->widget('Feed');?> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<div id="right"> |
|||
<?php $this->widget('Roster');?> |
|||
</div> |
@ -1,55 +0,0 @@ |
|||
<?php |
|||
|
|||
/** |
|||
* @file TplTheme.php |
|||
* This file is part of MOVIM. |
|||
* |
|||
* @brief This objects abstracts a Movim theme and its configuration. |
|||
* |
|||
* @author Guillaume Pasquet <etenil@etenilsrealm.nl> |
|||
* |
|||
* @version 1.0 |
|||
* @date 1 April 2011 |
|||
* |
|||
* Copyright (C) 2011 MOVIM Project. |
|||
* |
|||
* See included COPYING file for licensing details. |
|||
*/ |
|||
|
|||
class TplTheme |
|||
{ |
|||
private $regions; |
|||
private $name; |
|||
private $desc; |
|||
private $author; |
|||
private $license; |
|||
|
|||
private $path; |
|||
|
|||
/** |
|||
* Class constructor. |
|||
* @param theme_name is the theme's name |
|||
*/ |
|||
public function __construct($theme_name) |
|||
{ |
|||
$this->load($theme_name); |
|||
} |
|||
|
|||
/** |
|||
* Loads up the theme's files and configuration. |
|||
* @param name is the theme's name. |
|||
*/ |
|||
private function load($name) |
|||
{ |
|||
$this->name = $name; |
|||
$this->path = THEMES_PATH . $this->name . '/'; |
|||
|
|||
if(file_exists($this->path . 'conf.xml')) { |
|||
$this->conf = simplexml_load_file($this->path . 'conf.xml'); |
|||
} else { |
|||
throw new MovimException(t("Couldn't load file %s", $this->path . 'conf.xml')); |
|||
} |
|||
} |
|||
} |
|||
|
|||
?>
|
@ -0,0 +1,38 @@ |
|||
<?php |
|||
|
|||
class BaseController { |
|||
public $name = 'main'; // The name of the current page
|
|||
protected $session_only = false;// The page is protected by a session ?
|
|||
protected $page; |
|||
|
|||
function __construct() { |
|||
$this->page = new TplPageBuilder(); |
|||
$this->page->addScript('movim_hash.js'); |
|||
$this->page->addScript('movim_utils.js'); |
|||
$this->page->addScript('movim_base.js'); |
|||
$this->page->addScript('movim_tpl.js'); |
|||
$this->page->addScript('movim_rpc.js'); |
|||
} |
|||
|
|||
function check_session() { |
|||
if($this->session_only) { |
|||
$user = new User(); |
|||
|
|||
if(!$user->isLogged()) { |
|||
$this->name = 'login'; |
|||
} |
|||
} |
|||
} |
|||
|
|||
function display() { |
|||
if($this->session_only) { |
|||
$user = new User(); |
|||
$content = new TplPageBuilder($user); |
|||
} else { |
|||
$content = new TplPageBuilder(); |
|||
} |
|||
|
|||
$this->page->setContent($content->build($this->name.'.tpl')); |
|||
echo $this->page->build('page.tpl'); |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue