Skip to content

Commit

Permalink
Merge pull request #927 from LuckyCyborg/master
Browse files Browse the repository at this point in the history
Implementation of a **CRUD** for Users management on the Users Module
  • Loading branch information
daveismynamecom committed Jun 3, 2016
2 parents a4d5f6d + c3c5f65 commit 22cb413
Show file tree
Hide file tree
Showing 58 changed files with 1,573 additions and 197 deletions.
3 changes: 2 additions & 1 deletion app/Config/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Active Modules
*
* @author David Carr - [email protected]
* @author David Carr - [email protected]
* @author Virgil-Adrian Teaca - [email protected]
* @version 3.0
*/
Expand All @@ -11,6 +11,7 @@


Config::set('modules', array(
'Dashboard',
'Demos',
'Users',
));
2 changes: 1 addition & 1 deletion app/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
Route::filter('guest', function($route) {
if (! Auth::guest()) {
// User is authenticated, redirect him to Dashboard Page.
return Redirect::to('users/dashboard');
return Redirect::to('admin/dashboard');
}
});
2 changes: 2 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class User extends BaseModel implements UserInterface, RemindableInterface

protected $hidden = array('password');

public $timestamps = true;


/**
* Get the unique identifier for the User.
*
Expand Down
13 changes: 13 additions & 0 deletions app/Modules/Dashboard/Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
/**
* Config - the Module's specific Configuration.
*
* @author Virgil-Adrian Teaca - [email protected]
* @version 3.0
*/

use Core\Config;

/**
* Configuration constants and options.
*/
57 changes: 57 additions & 0 deletions app/Modules/Dashboard/Controllers/Admin/Dashboard.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
/**
* Dasboard - Implements a simple Administration Dashboard.
*
* @author Virgil-Adrian Teaca - [email protected]
* @version 3.0
*/

namespace App\Modules\Dashboard\Controllers\Admin;

use Core\Controller;
use Core\View;
use Helpers\Url;


class Dashboard extends Controller
{
protected $template = 'AdminLte';
protected $layout = 'backend';


public function __construct()
{
parent::__construct();
}

protected function before()
{
// Calculate and share on Views the URIs.
$uri = Url::detectUri();

// Prepare the base URI.
$parts = explode('/', trim($uri, '/'));

// Make the path equal with the first part if it exists, i.e. 'admin'
$baseUri = array_shift($parts);

// Add to path the next part, if it exists, defaulting to 'dashboard'.
if(! empty($parts)) {
$baseUri .= '/' .array_shift($parts);
} else if ($withDashboard) {
$baseUri .= '/dashboard';
}

View::share('currentUri', $uri);
View::share('baseUri', $baseUri);

return parent::before();
}

public function index()
{
return $this->getView()
->shares('title', __d('dashboard', 'Dashboard'));
}

}
12 changes: 12 additions & 0 deletions app/Modules/Dashboard/Events.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Events - all Module's specific Events are defined here.
*
* @author Virgil-Adrian Teaca - [email protected]
* @version 3.0
*/

use Support\Facades\Event;


/** Define Events. */
12 changes: 12 additions & 0 deletions app/Modules/Dashboard/Filters.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Routing Filters - all Module's specific Routing Filters are defined here.
*
* @author Virgil-Adrian Teaca - [email protected]
* @version 3.0
*/

use Routing\Route;


/** Define Route Filters. */
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Cz/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Da/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => 'Skrivebord',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/De/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/En/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Es/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Fa/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => 'داشبورد',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Fr/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/It/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Ja/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Nl/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Pl/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Ro/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
7 changes: 7 additions & 0 deletions app/Modules/Dashboard/Language/Ru/messages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return array (
'Dashboard' => '',
'Someday, we\'ll have widgets and stuff on here...' => '',
'Yup. This is the Dashboard.' => '',
);
18 changes: 18 additions & 0 deletions app/Modules/Dashboard/Routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Routes - all Module's specific Routes are defined here.
*
* @author Virgil-Adrian Teaca - [email protected]
* @version 3.0
*/

use Routing\Router;


/** Define static routes. */

// The Adminstrations's Dashboard.
Router::get('admin(/dashboard)', array(
'filters' => 'auth',
'uses' => 'App\Modules\Dashboard\Controllers\Admin\Dashboard@index'
));
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<section class="content-header">
<h1><?= __('Dashboard'); ?></h1>
<h1><?= __d('dashboard', 'Dashboard'); ?></h1>
<ol class="breadcrumb">
<li><a href='<?= site_url('users/dashboard'); ?>'><i class="fa fa-dashboard"></i> <?= __('Dashboard'); ?></a></li>
<li><a href='<?= site_url('users/dashboard'); ?>'><i class="fa fa-dashboard"></i> <?= __d('dashboard', 'Dashboard'); ?></a></li>
</ol>
</section>

Expand All @@ -12,8 +12,8 @@

<div class="box box-widget">
<div class="box-body">
<h4><strong><?= __('Yup. This is the Dashboard.'); ?></strong></h4>
<p><?= __('Someday, we\'ll have widgets and stuff on here...'); ?></p>
<h4><strong><?= __d('dashboard', 'Yup. This is the Dashboard.'); ?></strong></h4>
<p><?= __d('dashboard', 'Someday, we\'ll have widgets and stuff on here...'); ?></p>
</div>
</div>

Expand Down
Loading

0 comments on commit 22cb413

Please sign in to comment.