Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnClake committed Apr 28, 2017
2 parents dbac98e + 6a90005 commit c1d4713
Show file tree
Hide file tree
Showing 94 changed files with 2,366 additions and 422 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ php-errors.log
sftp-config.json
selenium.php
composer.lock
modules/
bootstrap/
/storage
/vender
Expand All @@ -38,7 +37,7 @@ nbproject
storage
vender
bootstrap
modules
/modules
node_modules


99 changes: 97 additions & 2 deletions Module.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace Clake\UserExtended;

use Clake\UserExtended\Classes\FriendsManager;
use Clake\UserExtended\Classes\Helpers;
use Clake\UserExtended\Classes\UserGroupManager;
use Clake\UserExtended\Classes\UserManager;
use Clake\UserExtended\Classes\UserRoleManager;
Expand All @@ -9,6 +9,7 @@
use Clake\Userextended\Models\Friend;
use Clake\UserExtended\Traits\StaticFactoryTrait;
use Clake\UserExtended\Classes\UserExtended;
use Backend;

/**
* User Extended Core by Shawn Clake
Expand Down Expand Up @@ -48,7 +49,56 @@ public function injectComponents()

public function injectNavigation()
{
return [];
return [
'users-side' => [
'label' => 'Users',
'url' => Backend::url('rainlab/user/users'),
'icon' => 'icon-user',
'order' => 100
],
'routes' => [
'label' => 'Routes',
'url' => Backend::url('clake/userextended/routes/index'),
'icon' => 'icon-eye-slash',
'order' => 200
],
'fields' => [
'label' => 'Field Manager',
'url' => Backend::url('clake/userextended/fields/manage'),
'icon' => 'icon-pencil-square-o',
'order' => 300
],
'roles' => [
'label' => 'Role Manager',
'url' => Backend::url('clake/userextended/roles/manage'),
'icon' => 'icon-pencil',
'order' => 400
],
'friends' => [
'label' => 'Friends',
'url' => Backend::url('clake/userextended/friends/index'),
'icon' => 'icon-users',
'order' => 500
],
'timezones' => [
'label' => 'Timezones',
'url' => Backend::url('clake/userextended/timezones/index'),
'icon' => 'icon-clock-o',
'order' => 600
],
'comments' => [
'label' => 'Comments',
'url' => Backend::url('clake/userextended/comments/index'),
'icon' => 'icon-comments-o',
'order' => 700
],
'modules' => [
'label' => 'Modules',
'url' => Backend::url('clake/userextended/modules/index'),
'icon' => 'icon-puzzle-piece',
'order' => 800
],
];
}

public function injectLang()
Expand All @@ -69,6 +119,51 @@ public function injectBonds()
return [];
}

/**
* Returns the plugin version notes for display in the Module Manager
* @return array
*/
public function getUpdateNotes()
{
return [
'2.2.00' => [Helpers::file(plugins_path('clake/userextended/help/Updates/2.2.00.md')), 'md' => true],
];
}

/**
* Returns the plugin documentation for display in the Module Manager
* @return array
*/
public function getDocumentation()
{
$home = Helpers::file(plugins_path('clake/userextended/readme.md'));

$apis = Helpers::file(plugins_path('clake/userextended/help/APIs/Helpers.md')) .
Helpers::file(plugins_path('clake/userextended/help/APIs/Module.md')) .
Helpers::file(plugins_path('clake/userextended/help/APIs/UserUtil.md'));

$backend = Helpers::file(plugins_path('clake/userextended/help/Backend/FieldManager.md')) .
Helpers::file(plugins_path('clake/userextended/help/Backend/RoleManager.md')) .
Helpers::file(plugins_path('clake/userextended/help/Backend/Routes.md')) .
Helpers::file(plugins_path('clake/userextended/help/Backend/Timezones.md'));

$components = Helpers::file(plugins_path('clake/userextended/help/Components/3rdParty.md')) .
Helpers::file(plugins_path('clake/userextended/help/Components/Account.md')) .
Helpers::file(plugins_path('clake/userextended/help/Components/Friends.md')) .
Helpers::file(plugins_path('clake/userextended/help/Components/User.md'));

$traits = Helpers::file(plugins_path('clake/userextended/help/Traits/Searchable.md')) .
Helpers::file(plugins_path('clake/userextended/help/Traits/Timezonable.md'));

return [
'home' => [$home, 'md' => true],
'apis' => [$apis, 'md' => true],
'backend' => [$backend, 'md' => true],
'components' => [$components, 'md' => true],
'traits' => [$traits, 'md' => true],
];
}

/**
* Returns users with $property col = $value
* @param $value
Expand Down
156 changes: 112 additions & 44 deletions Plugin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace Clake\UserExtended;

use Backend\Classes\Controller;
use Clake\UserExtended\Classes\FriendsManager;
use Clake\UserExtended\Classes\UserExtended;
use System\Classes\PluginBase;
use Event;
Expand Down Expand Up @@ -72,6 +73,31 @@ public function registerMarkupTags()
];
}

public function registerListColumnTypes()
{
return [
'listdropdown' => [$this, 'getListChoice']
];
}

public function getListChoice($value, $column, $record)
{
$string = '';

$class = $column->config['class'];
$function = $column->config['function'];

if(method_exists($class, $function))
{
$class = new $class();
$array = $class->$function();
$string = $array[$value];
}

return $string;
}


/**
* Register method, called when the plugin is first registered.
* @return void
Expand Down Expand Up @@ -105,48 +131,22 @@ public function boot()
*/
Event::listen('backend.menu.extendItems', function ($manager)
{
$manager->addSideMenuItems('RainLab.User', 'user', [
'roles' => [
'label' => 'Role Manager',
'url' => Backend::url('clake/userextended/roles/manage'),
'icon' => 'icon-pencil',
'order' => 700
],
'users-side' => [
'label' => 'Users',
'url' => Backend::url('rainlab/user/users'),
'icon' => 'icon-user',
'order' => 100
],
'fields' => [
'label' => 'Field Manager',
'url' => Backend::url('clake/userextended/fields/manage'),
'icon' => 'icon-pencil-square-o',
'order' => 600
],
'routes' => [
'label' => 'Routes',
'url' => Backend::url('clake/userextended/routes/index'),
'icon' => 'icon-eye-slash',
'order' => 300
],
'timezones' => [
'label' => 'Timezones',
'url' => Backend::url('clake/userextended/timezones/index'),
'icon' => 'icon-clock-o',
'order' => 200
],
]);
$navigation = array_merge(
UserExtended::getNavigation(),
[]
);

$manager->addSideMenuItems('October.Cms', 'cms', [
/*'routes' => [
$manager->addSideMenuItems('RainLab.User', 'user', $navigation);

/*$manager->addSideMenuItems('October.Cms', 'cms', [
'routes' => [
'label' => 'Routes',
'url' => Backend::url('clake/userextended/routes/preview'),
'icon' => 'icon-eye-slash',
//'order' => 600
],*/
],
]);
]);*/

});

Expand Down Expand Up @@ -215,7 +215,80 @@ public function registerSettings()
*/
public function registerPermissions()
{
return [];
return [
'clake.userextended.roles.view' => [
'label' => 'View Roles',
'tab' => 'User Extended'
],
'clake.userextended.groups.view' => [
'label' => 'View Groups',
'tab' => 'User Extended'
],
'clake.userextended.role_users.view' => [
'label' => 'View Users in Roles',
'tab' => 'User Extended'
],
'clake.userextended.group_users.view' => [
'label' => 'View Users in Groups',
'tab' => 'User Extended'
],
'clake.userextended.roles.manage' => [
'label' => 'Manage Roles',
'tab' => 'User Extended'
],
'clake.userextended.groups.manage' => [
'label' => 'Manage Groups',
'tab' => 'User Extended'
],
'clake.userextended.role_users.manage' => [
'label' => 'Manage Users in Roles',
'tab' => 'User Extended'
],
'clake.userextended.group_users.manage' => [
'label' => 'Manage Users in Groups',
'tab' => 'User Extended'
],
'clake.userextended.modules.view' => [
'label' => 'View Modules',
'tab' => 'User Extended'
],
'clake.userextended.modules.manage' => [
'label' => 'Manage Modules',
'tab' => 'User Extended'
],
'clake.userextended.timezones.view' => [
'label' => 'View Timezones',
'tab' => 'User Extended'
],
'clake.userextended.timezones.manage' => [
'label' => 'Manage Timezones',
'tab' => 'User Extended'
],
'clake.userextended.friends.view' => [
'label' => 'View Friends',
'tab' => 'User Extended'
],
'clake.userextended.friends.manage' => [
'label' => 'Manage Friends',
'tab' => 'User Extended'
],
'clake.userextended.routes.view' => [
'label' => 'View Routes',
'tab' => 'User Extended'
],
'clake.userextended.routes.manage' => [
'label' => 'Manage Routes',
'tab' => 'User Extended'
],
'clake.userextended.fields.view' => [
'label' => 'View Fields',
'tab' => 'User Extended'
],
'clake.userextended.fields.manage' => [
'label' => 'Manage Fields',
'tab' => 'User Extended'
],
];
}

/**
Expand All @@ -224,10 +297,7 @@ public function registerPermissions()
*/
public function registerNavigation()
{
return array_merge(
UserExtended::getNavigation(),
[]
);
return [];
}

/**
Expand All @@ -240,9 +310,7 @@ public static function injectAssets($component)
$component->addJs('/plugins/clake/userextended/assets/js/general.js');
$component->addCss('/plugins/clake/userextended/assets/css/general.css');

/*
* Handles injecting JS and CSS assets
*/
// Handles injecting JS and CSS assets
$assets = UserExtended::getAssets();

foreach ($assets as $asset) {
Expand Down
9 changes: 1 addition & 8 deletions assets/css/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,4 @@ div.center-in-parent
div.userblock
{
color:#000;
}

/*div.userblock:hover
{

background-color:rgba(0,0,0,0.1);

}/*
}
Loading

0 comments on commit c1d4713

Please sign in to comment.