Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
renamed into vault
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed Jan 20, 2016
1 parent 753b44d commit 3240709
Show file tree
Hide file tree
Showing 64 changed files with 204 additions and 229 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Vault
Vault administration panel provides ability to create custom "administration" controllers with pre-created view layout and navigation manager based on set of Materialize styles.

> To be renamed from Albus to Vault.
Elements included
-----------------
* In-Vault uri tag
* Cards and blocks
* Tabs

```html
<extends:albus:layout title="[[Vault]]"/>
<extends:vault:layout title="[[Vault]]"/>

<block:content>
<tab:wrapper>
Expand All @@ -19,24 +17,24 @@ Elements included
<tab:item title="User Information" icon="user" id="info">
<div class="row">
<div class="col s6">
<albus:block>
<vault:block>
<spiral:form>
<form:input label="abc"/>
</spiral:form>
</albus:block>
</vault:block>
</div>

<div class="col s6">
<albus:card color="blue-grey darken-2" text="white">
<vault:card color="blue-grey darken-2" text="white">
<p>There is an issue with something.</p>
</albus:card>
</vault:card>
</div>
</div>
</tab:item>

<!--Additional information about user account-->
<tab:item title="Extra Information" id="extra">
extra user information <albus:uri taget="controller:action">link</albus:uri>
extra user information <vault:uri taget="controller:action">link</vault:uri>
</tab:item>

<!--Test user content-->
Expand All @@ -50,17 +48,17 @@ Elements included

Following code will be compiled into Materialize based HTML:

![Animation](https://raw.githubusercontent.com/spiral/guide/master/resources/albus.gif)
![Animation](https://raw.githubusercontent.com/spiral/guide/master/resources/vault.gif)

# Installation

```
composer require spiral/albus
spiral register spiral/albus
composer require spiral/vault
spiral register spiral/vault
```

Do not forget to mount `AlbusBootloader` (bootloader has to be initated after `SecutiryBootloader`).
Do not forget to mount `VaultBootloader` (bootloader has to be initated after `SecutiryBootloader`).

> You can tweak Albus behaviour (route, middlewares), create new navigation sections or register your own controllers via `app/config/modules/albus.php` configuration file.
> You can tweak Vault behaviour (route, middlewares), create new navigation sections or register your own controllers via `app/config/modules/vault.php` configuration file.
If you wish to play with Albus without configuring security, simply mount `Spiral\Albus\Bootloaders\InsecureAlbusBootloader` bootloader, attention this bootloader will open Albus access to guest accounts and has to be used for debugging purposes only.
If you wish to play with Vault without configuring security, simply mount `Spiral\Vault\Bootloaders\InsecureVaultBootloader` bootloader, attention this bootloader will open Vault access to guest accounts and has to be used for debugging purposes only.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "spiral/albus",
"name": "spiral/vault",
"description": "Extendable, materialize design based, administration panel ",
"authors": [
{
Expand Down
6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('sass', function() {
return gulp.src('./resources/styles/spiral/albus/albus.scss')
return gulp.src('./resources/styles/spiral/vault/vault.scss')
.pipe(sass())
.pipe(gulp.dest('./resources/styles/spiral/albus/'));
.pipe(gulp.dest('./resources/styles/spiral/vault/'));
});

// Watch Files For Changes
gulp.task('watch', function() {
gulp.watch('resources/styles/albus/*.scss', ['sass']);
gulp.watch('resources/styles/vault/*.scss', ['sass']);
});

// Default Task
Expand Down
File renamed without changes.
42 changes: 0 additions & 42 deletions source/Albus/Bootloaders/AlbusBootloader.php

This file was deleted.

16 changes: 0 additions & 16 deletions source/Albus/Exceptions/AlbusException.php

This file was deleted.

23 changes: 0 additions & 23 deletions source/Albus/Security/AlbusLibrary.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
namespace Spiral\Albus\Bootloaders;
namespace Spiral\Vault\Bootloaders;

use Spiral\Albus\Configs\AlbusConfig;
use Spiral\Albus\Security\Rules\InsecureRule;
use Spiral\Vault\Configs\VaultConfig;
use Spiral\Vault\Security\Rules\InsecureRule;
use Spiral\Core\Bootloaders\Bootloader;
use Spiral\Security\Entities\Actors\Guest;
use Spiral\Security\PermissionsInterface;

/**
* Development helper, DO NOT USE in production. Allows full access to Albus for any guest (no
* Development helper, DO NOT USE in production. Allows full access to Vault for any guest (no
* authorization is required).
*/
class InsecureAlbusBootloader extends Bootloader
class InsecureVaultBootloader extends Bootloader
{
const BOOT = true;
const ROLE = Guest::ROLE;

/**
* @param PermissionsInterface $permissions
* @param AlbusConfig $config
* @param VaultConfig $config
*/
public function boot(PermissionsInterface $permissions, AlbusConfig $config)
public function boot(PermissionsInterface $permissions, VaultConfig $config)
{
if (!$permissions->hasRole(static::ROLE)) {
$permissions->addRole(static::ROLE);
Expand Down
42 changes: 42 additions & 0 deletions source/Vault/Bootloaders/VaultBootloader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
namespace Spiral\Vault\Bootloaders;

use Spiral\Vault\Vault;
use Spiral\Vault\Navigation;
use Spiral\Core\Bootloaders\Bootloader;
use Spiral\Http\HttpDispatcher;

/**
* Boots vault administration panel bindings and routes. You can always extend this bootloader and
* disable booting to register route manually.
*/
class VaultBootloader extends Bootloader
{
/**
* Vault require real booting.
*/
const BOOT = true;

/**
* @var array
*/
protected $bindings = [
'vault' => Vault::class,
Navigation::class => [Vault::class, 'navigation']
];

/**
* @param HttpDispatcher $http
* @param Vault $vault
*/
public function boot(HttpDispatcher $http, Vault $vault)
{
$http->addRoute($vault->route());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
*
* Here you list your own virtual bindings to help your IDE:
*
* @see AlbusBootloader
* @see VaultBootloader
* @see SpiralBindings
*
* @property-read \Spiral\Albus\Albus $albus See AlbusBindings
* @property-read \Spiral\Vault\Vault $vault See VaultBindings
* @property-read \Spiral\Views\ViewManager $views See SpiralBindings
*/
trait SharedTrait
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
namespace Spiral\Albus\Configs;
namespace Spiral\Vault\Configs;

use Spiral\Albus\AlbusRoute;
use Spiral\Vault\VaultRoute;
use Spiral\Core\InjectableConfig;

/**
* Configuration for Albus administration panel.
* Configuration for Vault administration panel.
*/
class AlbusConfig extends InjectableConfig
class VaultConfig extends InjectableConfig
{
/**
* Configuration section.
*/
const CONFIG = 'modules/albus';
const CONFIG = 'modules/vault';

/**
* Default permissions namespace.
*/
const GUARD_NAMESPACE = 'albus';
const GUARD_NAMESPACE = 'vault';

/**
* @var array
*/
protected $config = [
'guardNamespace' => 'albus',
'guardNamespace' => 'vault',

//Default albus controller
//Default vault controller
'controllers' => [],
'navigation' => [],

//Example: albus/users/addresses/1/remove/123
//Example: vault/users/addresses/1/remove/123
'route' => [
'middlewares' => [],
'pattern' => 'albus[/<controller>[/<action>[/<id>[/<operation>[/<childID>]]]]]',
'pattern' => 'vault[/<controller>[/<action>[/<id>[/<operation>[/<childID>]]]]]',
'defaults' => [],
'matchHost' => false,
]
Expand All @@ -54,11 +54,11 @@ public function securityNamespace()
}

/**
* List of allowed albus controllers in a form alias => class.
* List of allowed vault controllers in a form alias => class.
*
* Example:
* cms => Vendor\CMSController::class,
* system => Albus\SystemController::class
* system => Vault\SystemController::class
*
* @return array
*/
Expand All @@ -68,7 +68,7 @@ public function controllers()
}

/**
* Albus navigation structure including sections, permissions, titles and etc.
* Vault navigation structure including sections, permissions, titles and etc.
*
* @return array
*/
Expand All @@ -79,11 +79,11 @@ public function navigationSections()

/**
* @param string $name
* @return AlbusRoute
* @return VaultRoute
*/
public function createRoute($name)
{
$route = new AlbusRoute(
$route = new VaultRoute(
$name,
$this->config['route']['pattern'],
$this->config['route']['defaults']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
namespace Spiral\Albus\Controllers;
namespace Spiral\Vault\Controllers;

use Spiral\Core\Controller;

Expand All @@ -19,6 +19,6 @@ class DashboardController extends Controller
*/
public function indexAction()
{
return $this->views->render('albus:dashboard');
return $this->views->render('vault:dashboard');
}
}
16 changes: 16 additions & 0 deletions source/Vault/Exceptions/VaultException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
namespace Spiral\Vault\Exceptions;

/**
* Vault specific exception.
*/
class VaultException extends \RuntimeException
{

}
Loading

0 comments on commit 3240709

Please sign in to comment.