<?php
namespace Se7enChat\Libraries\Web\Presenters;
use Se7enChat\Boundaries\IndexOutputPort;
use Se7enChat\Gateways\UserInterfaceGateway;

class IndexPresenter implements IndexOutputPort
{
    private $userInterface;
    private $lessUrl;
    private $cssUrl;

    public function __construct(UserInterfaceGateway $ui)
    {
        $this->lessUrl = __DIR__ . '/../../UserInterface/Less';
        $this->cssUrl = CHAT_ROOT . 'Public/Styles';
        $this->userInterface = $ui;
    }

    public function present(array $information)
    {
        $this->compileCss();

        $this->userInterface->render('index', array(
            'pageTitle' => 'Se7enChat',
            'cssUrl' => PUBLIC_ROOT . '/Styles',
            'javascriptUrl' => PUBLIC_ROOT . '/Scripts',
            'imageUrl' => PUBLIC_ROOT . '/Images',
            'user_name' => 'Se7enChat',
            'user_id' => 1,
            'rooms' => array(
                array('name' => 'Room 1'),
                array('name' => 'Room 2', 'selected' => 'selected')
            )
        ));
    }

    private function compileCss()
    {
        $less = new \lessc;
        $less->checkedCompile(
            $this->lessUrl . '/index.less', $this->cssUrl . '/index.css');
    }
}

<?php
namespace Se7enChat\Libraries\Web\Presenters;
use Se7enChat\Boundaries\IndexOutputPort;
use Se7enChat\Gateways\UserInterfaceGateway;

class IndexPresenter implements IndexOutputPort
{
    private $userInterface;
    private $lessUrl;
    private $cssUrl;

    public function __construct(UserInterfaceGateway $ui)
    {
        $this->lessUrl = __DIR__ . '/../../UserInterface/Less';
        $this->cssUrl = CHAT_ROOT . 'Public/Styles';
        $this->userInterface = $ui;
    }

    public function present(array $information)
    {
        $this->compileCss();

        $this->userInterface->render('index', array(
            'pageTitle' => 'Se7enChat',
            'cssUrl' => PUBLIC_ROOT . '/Styles',
            'javascriptUrl' => PUBLIC_ROOT . '/Scripts',
            'imageUrl' => PUBLIC_ROOT . '/Images',
            'user_name' => 'Francisco',
            'user_id' => 1,
            'rooms' => array(
                array('name' => 'Room 1'),
                array('name' => 'Room 2', 'selected' => 'selected')
            )
        ));
    }

    private function compileCss()
    {
        $less = new \lessc;
        $less->checkedCompile(
            $this->lessUrl . '/index.less', $this->cssUrl . '/index.css');
    }
}

--- 
+++ 
@@ -25,7 +25,7 @@
             'cssUrl' => PUBLIC_ROOT . '/Styles',
             'javascriptUrl' => PUBLIC_ROOT . '/Scripts',
             'imageUrl' => PUBLIC_ROOT . '/Images',
-            'user_name' => 'Francisco',
+            'user_name' => 'Se7enChat',
             'user_id' => 1,
             'rooms' => array(
                 array('name' => 'Room 1'),
Change user name to something more practical.

Signed-off-by: Se7enChat <e5dc7202134ade0d04c45466a5972470210b05f6@zoho.com>
