Example #1
0
 */
return ['id' => 'users', 'enable' => function () {
    return zbase_config_get('modules.users.enable', true);
}, 'access' => 'admin', 'class' => null, 'backend' => true, 'frontend' => false, 'url' => ['backend' => 'users/{action?}/{id?}'], 'navigation' => ['back' => ['enable' => true, 'nav' => ['route' => ['name' => 'admin.users'], 'icon' => 'fa fa-users', 'label' => 'Users', 'title' => 'Manage Users']]], 'api' => ['users.logout' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'logout']], 'routes' => ['admin-users-template' => ['url' => 'admin/templates/users.html', 'view' => ['enable' => true, 'layout' => 'blank', 'name' => 'type.html', 'content' => function () {
    $angularDatatable = zbase_angular_widget_datatable('users', 'admin-users');
    $string = null;
    if (!empty($angularDatatable['template'])) {
        $string = $angularDatatable['template'];
    }
    return $string;
}]], 'admin-user-template' => ['url' => 'admin/users/view']], 'angular' => ['backend' => ['routeProvider' => [['url' => function () {
    return zbase_angular_route('admin.users', [], true);
}, 'templateUrl' => function () {
    return zbase_angular_template_url('admin-users-template', []);
}, 'controller' => 'adminUsersController'], ['url' => function () {
    return zbase_angular_route('admin.users', ['action' => 'view'], true) . '/:itemId';
}, 'templateUrl' => function () {
    return zbase_url_from_route('admin-user-template', [], true);
}, 'controller' => 'adminUsersController']], 'controllers' => [['controller' => 'adminUsersController', 'view' => ['file' => function () {
    return zbase_view_render(zbase_view_file_module('users.views.angular.controllers.adminUsersController'));
}]]]]], 'controller' => ['back' => ['action' => ['index' => ['page' => ['title' => 'Manage Users', 'headTitle' => 'Manage Users', 'subTitle' => '', 'breadcrumbs' => [['label' => 'Users', 'link' => '#']]]], 'view' => ['page' => ['title' => 'Manage Users', 'headTitle' => 'Manage Users', 'subTitle' => '', 'breadcrumbs' => [['label' => 'Users', 'name' => 'admin.users']]]]]]], 'event' => [], 'widgets' => ['back' => ['controller' => ['action' => ['index' => ['admin-users' => null], 'json-index' => ['admin-users' => null], 'view' => ['admin-user' => null], 'json-view' => ['admin-user' => null], 'json-status' => ['admin-user-status' => null], 'json-email' => function () {
    return zbase_config_get('modules.account.widgets.controller.email', ['admin-user-email' => null]);
}, 'json-password' => function () {
    return zbase_config_get('modules.account.widgets.controller.password', ['admin-user-password' => null]);
}, 'json-username' => function () {
    return zbase_config_get('modules.account.widgets.controller.username', ['admin-user-username' => null]);
}, 'json-profile' => function () {
    return zbase_config_get('modules.account.widgets.controller.profile', ['admin-user-profile' => null]);
}, 'image' => function () {
    return zbase_config_get('modules.account.widgets.controller.image', ['admin-user-image' => null]);
}]]]]];
Example #2
0
 * zbase()->loadModuleFrom(PATH_TO_MODULES);
 * 		- widgets will be added automatically if a "widget" folder is found (zbase()->loadWidgetsFrom(PATH_TO_WIDGETS))
 *
 */
return ['id' => 'account', 'enable' => true, 'access' => 'user', 'class' => null, 'backend' => true, 'frontend' => true, 'url' => ['backend' => 'account/{action?}', 'frontend' => 'account/{action?}/{task?}'], 'api' => ['user.password' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'password', 'requestMethod' => 'post', 'params' => ['email' => ['validations' => ['required' => ['enable' => true], 'email' => ['enable' => true], 'exists' => ['enable' => true, 'text' => function () {
    return 'exists:' . zbase_entity('user')->getTable() . ',email';
}, 'message' => 'Email address not found.']], 'name' => 'Email Address', 'varname' => 'username']]], 'user.login' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'login', 'requestMethod' => 'post', 'params' => ['paramOne' => ['validations' => ['required' => ['enable' => true], 'email' => ['enable' => true]], 'name' => 'Email Address', 'varname' => 'username'], 'paramTwo' => ['validations' => ['required' => ['enable' => true]], 'name' => 'Password', 'varname' => 'password']]], 'user.updateProfile' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'updateProfile', 'requestMethod' => 'post', 'notParams' => ['userId'], 'params' => ['first_name' => ['validations' => ['required' => ['enable' => true]], 'name' => 'Last Name'], 'last_name' => ['validations' => ['required' => ['enable' => true]], 'name' => 'Last Name']]], 'user.updateProfileImage' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'updateProfileImage', 'requestMethod' => ['get', 'post'], 'notParams' => ['userId'], 'params' => []], 'user.updateEmail' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'updateEmail', 'requestMethod' => 'post', 'notParams' => ['userId'], 'params' => ['email' => ['validations' => ['required' => ['enable' => true], 'email' => ['enable' => true], 'unique' => ['enable' => true, 'text' => function () {
    return 'unique:' . zbase_entity('user')->getTable() . ',email,' . zbase_auth_user()->id() . ',user_id';
}, 'message' => 'Email address already exists.'], 'not_in' => ['enable' => true, 'text' => function () {
    return 'not_in:' . zbase_auth_user()->email;
}, 'message' => 'Please provide a different email address.']], 'name' => 'Email Address'], 'accountpassword' => ['validations' => ['required' => ['enable' => true], 'accountPassword' => ['enable' => true, 'message' => 'Account password don\'t match.']], 'name' => 'Account Password']]], 'user.updatePassword' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'updatePassword', 'requestMethod' => 'post', 'notParams' => ['userId'], 'params' => ['password' => ['label' => 'New Password', 'validations' => ['required' => ['enable' => true, 'message' => 'A new password is required.'], 'min' => ['enable' => true, 'text' => 'min:6', 'message' => 'Password too short.'], 'passwordStrengthCheck' => ['enable' => true, 'message' => 'Password is too weak.']]], 'passwordConfirm' => ['label' => 'Confirm New Password', 'validations' => ['required_with' => ['enable' => true, 'text' => 'required_with:password', 'message' => 'Please verify new password.'], 'same' => ['enable' => true, 'text' => 'same:password', 'message' => 'New passwords are not the same.']]], 'accountpassword' => ['validations' => ['required' => ['enable' => true], 'accountPassword' => ['enable' => true, 'message' => 'Account password don\'t match.']], 'label' => 'Account Password']]], 'user.logout' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'logout'], 'user.current' => ['enable' => true, 'class' => \Zbase\Entity\Laravel\User\Api::class, 'method' => 'current']], 'navigation' => ['back' => ['enable' => true, 'nav' => ['order' => 1, 'route' => ['name' => 'admin.account'], 'icon' => 'fa fa-user', 'label' => 'Account', 'title' => 'Account Settings']]], 'routes' => [], 'angular' => ['mobile' => ['backend' => ['routeProvider' => [['url' => function () {
    return zbase_angular_route('admin.account', [], true);
}, 'templateUrl' => function () {
    return zbase_angular_template_url('account', [], true);
}, 'controller' => 'adminAccountMainController'], ['url' => function () {
    return zbase_angular_route('admin.logout', [], true);
}, 'controller' => 'adminAccountMainController'], ['auth' => false, 'url' => '/', 'templateUrl' => function () {
    return zbase_angular_template_url('admin.login', [], true);
}, 'controller' => 'adminAuthController']], 'controllers' => [['controller' => 'mainController', 'view' => ['file' => function () {
    return zbase_view_render(zbase_view_file_module('account.views.angular.back.mobile.controllers.mainController'));
}]], ['controller' => 'adminAccountMainController', 'view' => ['file' => function () {
    return zbase_view_render(zbase_view_file_module('account.views.angular.back.mobile.controllers.adminAccountMainController'));
}]], ['auth' => false, 'controller' => 'adminAuthController', 'view' => ['file' => function () {
    return zbase_view_render(zbase_view_file_module('account.views.angular.back.mobile.controllers.adminAuthController'));
}]]]]]], 'controller' => ['back' => ['action' => ['index' => ['page' => ['title' => 'Account Information', 'headTitle' => 'Account', 'subTitle' => 'Manage account and login information', 'breadcrumbs' => [['label' => 'Account', 'link' => '#']]]]]], 'front' => ['action' => ['index' => ['page' => ['title' => 'Account Information', 'headTitle' => 'Account', 'subTitle' => 'Manage account and login information', 'breadcrumbs' => [['label' => 'Account', 'link' => '#']]]]]]], 'widgets' => ['controller' => ['index' => function () {
    return zbase_config_get('modules.account.widgets.controller.index', ['account' => null]);
}, 'json-email' => function () {
    return zbase_config_get('modules.account.widgets.controller.email', ['account-email' => null]);
}, 'json-password' => function () {
    return zbase_config_get('modules.account.widgets.controller.password', ['account-password' => null]);
}, 'json-username' => function () {