Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #37 from fbergkemper/master
Browse files Browse the repository at this point in the history
Feature Update and Changes
- Installation and Configuration Test
- Application entry point changed to dashboard
  • Loading branch information
frabdev committed Sep 3, 2014
2 parents f79f1c0 + ea4f8b6 commit 51455f3
Show file tree
Hide file tree
Showing 13 changed files with 884 additions and 4 deletions.
3 changes: 2 additions & 1 deletion config/application.config.php
Expand Up @@ -28,7 +28,7 @@
// Use the $env value to dtermine which module to load
$modules = array(
'Application',
'Dashboard',
'Dashboard',
'Director',
'Fileset',
'Pool',
Expand All @@ -42,6 +42,7 @@
'Statistics',
'Admin',
'User',
'Install',
);

/*
Expand Down
12 changes: 10 additions & 2 deletions init_autoloader.php
Expand Up @@ -54,6 +54,14 @@
}
}

if (!class_exists('Zend\Loader\AutoloaderFactory')) {
throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.');
try {
if (!class_exists('Zend\Loader\AutoloaderFactory')) {
throw new RuntimeException('<p>Unable to load Zend Framework 2. Please install the Zend Framework 2 package from your
distribution repository.<br />If Zend Framework 2 is already installed, please define
a ZF2_PATH environment variable.</p>');
}
}
catch(Exception $e) {
print $e->getMessage();
}

3 changes: 2 additions & 1 deletion module/Application/config/module.config.php
Expand Up @@ -15,7 +15,7 @@
'options' => array(
'route' => '/',
'defaults' => array(
'controller' => 'Application\Controller\Index',
'controller' => 'Dashboard\Controller\Dashboard',
'action' => 'index',
),
),
Expand Down Expand Up @@ -91,6 +91,7 @@
'printRetention' => 'Application\View\Helper\Retention',
'printHumanReadableTimeperiod' => 'Application\View\Helper\HumanReadableTimeperiod',
'printExpiration' => 'Application\View\Helper\Expiration',
'printStatusGlyphicons' => 'Application\View\Helper\StatusGlyphicons',
),
),
'view_manager' => array(
Expand Down
@@ -0,0 +1,51 @@
<?php

/**
*
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace Application\View\Helper;

use Zend\View\Helper\AbstractHelper;

class StatusGlyphicons extends AbstractHelper
{
public function __invoke($status)
{

switch($status)
{
case '0':
$output = '<div class="text-success"><span class="glyphicon glyphicon-ok"></span></div>';
break;
case '-1':
$output = '<div class="text-danger"><span class="glyphicon glyphicon-remove"></span></div>';
break;
default:
$output = $status;
break;
}

return $output;

}
}
85 changes: 85 additions & 0 deletions module/Application/view/layout/install.phtml
@@ -0,0 +1,85 @@
<?php

/**
*
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
* @author Frank Bergkemper
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

echo $this->doctype();

?>

<html lang="en">

<head>
<meta charset="utf-8">
<?php echo $this->headTitle('Bareos')->setSeparator(' - ')->setAutoEscape(false) ?>

<?php echo $this->headMeta()
->appendName('viewport', 'width=device-width, initial-scale=1.0')
->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
?>

<!-- Styles -->
<?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico'))
->prependStylesheet($this->basePath() . '/css/style.css')
->prependStylesheet($this->basePath() . '/css/bootstrap-theme.min.css')
->prependStylesheet($this->basePath() . '/css/bootstrap.min.css')
->prependStylesheet($this->basePath() . '/css/jquery.jqplot.min.css')
?>

<!-- Scripts -->
<?php echo $this->headScript()
->prependFile($this->basePath() . '/js/bootstrap.min.js')
->prependFile($this->basePath() . '/js/excanvas.min.js')
->prependFile($this->basePath() . '/js/jqplot.pieRenderer.min.js')
->prependFile($this->basePath() . '/js/jqplot.barRenderer.min.js')
->prependFile($this->basePath() . '/js/jqplot.categoryAxisRenderer.min.js')
->prependFile($this->basePath() . '/js/jqplot.pointLabels.min.js')
->prependFile($this->basePath() . '/js/jquery.jqplot.min.js')
->prependFile($this->basePath() . '/js/jquery.min.js')
->prependFile($this->basePath() . '/js/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9',))
->prependFile($this->basePath() . '/js/html5shiv.js', 'text/javascript', array('conditional' => 'lt IE 9',));
?>

</head>

<body>

<div class="container">

<?php echo $this->content; ?>

<hr />

<footer>
<p class="text-muted">&copy; 2013 - <?php echo date('Y') ?> <a href="http://www.bareos.com/" target="_blank">Bareos GmbH &amp; Co. KG</a>, GNU Affero General Public License Version 3</p>
</footer>

</div>

<?php echo $this->inlineScript() ?>

</body>

</html>

54 changes: 54 additions & 0 deletions module/Install/Module.php
@@ -0,0 +1,54 @@
<?php

namespace Install;

use Install\Model\Install;
use Install\Model\InstallTable;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;

class Module
{

public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}

public function getServiceConfig()
{
return array(
'factories' => array(
'Install\Model\InstallTable' => function($sm)
{
$tableGateway = $sm->get('InstallTableGateway');
$table = new InstallTable($tableGateway);
return $table;
},
'InstallTableGateway' => function($sm)
{
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Install());
return new TableGateway('install', $dbAdapter, null, $resultSetPrototype);
},
),
);
}

}

3 changes: 3 additions & 0 deletions module/Install/autoload_classmap.php
@@ -0,0 +1,3 @@
<?php

return array();
59 changes: 59 additions & 0 deletions module/Install/config/module.config.php
@@ -0,0 +1,59 @@
<?php

/**
*
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2014 dass-IT GmbH (http://www.dass-it.de/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

return array(

'controllers' => array(
'invokables' => array(
'Install\Controller\Install' => 'Install\Controller\InstallController',
),
),

'router' => array(
'routes' => array(
'install' => array(
'type' => 'segment',
'options' => array(
'route' => '/install[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Install\Controller\Install',
'action' => 'index',
),
),
),
),
),

'view_manager' => array(
'template_path_stack' => array(
'install' => __DIR__ . '/../view',
),
),

);

0 comments on commit 51455f3

Please sign in to comment.