Loading config/schema/homebox.schema.yml +9 −12 Original line number Diff line number Diff line Loading @@ -19,12 +19,12 @@ homebox.homebox.*: sequence: type: string label: 'Role' options: type: sequence label: 'Visibility' sequence: type: string label: 'Option' dashboardPageEnabled: type: int:tiny label: 'Dashboard Page Enabled' dashboardUserTabEnabled: type: int:tiny label: 'Dashboard User Tab Enabled' blocks: type: sequence label: 'Blocks' Loading @@ -41,9 +41,6 @@ homebox.homebox.*: type: string status: type: boolean columns: type: sequence label: 'Columns' sequence: layoutId: type: string label: 'Columns' No newline at end of file label: 'Layout Id' homebox.install +26 −0 Original line number Diff line number Diff line Loading @@ -16,3 +16,29 @@ function homebox_update_8100() { \Drupal::service('module_installer') ->install(['jquery_ui', 'jquery_ui_draggable', 'jquery_ui_droppable']); } function homebox_update_8101() { // @todo Homebox.php // Renamed "$columns" to "$layoutId" // Removed "$options" // Remove "$path" // @todo routing.yml // Removed homebox.page // @todo schema.yml // Delete "options" // // Change: // columns: // type: sequence // label: 'Columns' // sequence: // type: string // label: 'Columns' // // To: // layoutId: // type: string // label: 'Layout Id' } homebox.module +2 −20 Original line number Diff line number Diff line Loading @@ -5,8 +5,6 @@ * Homebox module hooks. */ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Language\Language; use Drupal\Core\Routing\RouteMatchInterface; /** Loading Loading @@ -46,22 +44,6 @@ function homebox_theme() { ]; } /** * Implements hook_ENTITY_TYPE_insert(). */ function homebox_homebox_insert(EntityInterface $entity) { // @todo Check for existing aliases with the same alias name. /** @var \Drupal\homebox\Entity\Homebox $path_entity */ $path_entity = $entity; $path_alias = \Drupal::entityTypeManager()->getStorage('path_alias')->create([ 'path' => '/homebox-page/' . $entity->id() . '/' . \Drupal::currentUser()->id(), 'alias' => '/' . $path_entity->getPath(), 'langcode' => Language::LANGCODE_SITE_DEFAULT, ]); $path_alias->save(); } /** * Implements hook_local_tasks_alter(). * Loading @@ -74,11 +56,11 @@ function homebox_local_tasks_alter(&$local_tasks) { $homeboxes = $homebox_storage->loadMultiple(); /** @var \Drupal\homebox\Entity\HomeboxInterface $homebox */ foreach ($homeboxes as $homebox) { if ($homebox->getOptions()['menu']) { if ($homebox->getDashboardUserTabEnabled()) { $local_tasks['homebox.user_profile.layout.' . $homebox->id()] = [ 'id' => 'homebox.user_profile.layout.' . $homebox->id(), 'title' => $homebox->label(), 'route_name' => 'homebox.page', 'route_name' => 'homebox.dashboard_user_tab', 'base_route' => 'entity.user.canonical', 'weight' => -100, 'route_parameters' => ['homebox' => $homebox->id()], Loading homebox.permissions.yml +13 −2 Original line number Diff line number Diff line use homebox: title: 'Use Homebox' description: 'Allows to restrict Homebox access in general. If enabled, individual homebox roles can be set in each Homebox.' # TODO: Introduce in 2.0.0-alpha1: [#3264925] #edit own homebox: # title: 'Edit own homeboxes' # description: 'Allows to configure own Homeboxes. If disabled, the Homebox default can not be changed by the user.' bypass homeboxes access: title: 'Bypass Homebox access control' description: 'View and configure all Homeboxes regardless of permission restrictions. Also allows to access other users Homeboxes.' restrict access: TRUE administer homebox: title: 'Administer Homebox' description: 'Allows access to configure Homebox.' restrict access: true description: 'Allows access to configure Homebox settings via settings page.' restrict access: TRUE homebox.routing.yml +34 −4 Original line number Diff line number Diff line homebox.page: path: '/homebox-page/{homebox}/{user}' homebox.dashboard_page.default: path: '/homebox/{homebox}' defaults: _form: '\Drupal\homebox\Form\HomeboxPageForm' _form: '\Drupal\homebox\Form\HomeboxDashboardPageForm' requirements: _custom_access: '\Drupal\homebox\Controller\HomeboxController::access' _custom_access: '\Drupal\homebox\Controller\HomeboxController::accessDashboardPage' options: parameters: homebox: type: entity:homebox homebox.dashboard_page: path: '/homebox/{homebox}/{user}' defaults: _form: '\Drupal\homebox\Form\HomeboxDashboardPageForm' requirements: _custom_access: '\Drupal\homebox\Controller\HomeboxController::accessDashboardPage' options: parameters: homebox: type: entity:homebox user: type: entity:user homebox.dashboard_user_tab: path: '/user/{user}/homebox/{homebox}' defaults: _form: '\Drupal\homebox\Form\HomeboxDashboardUserTabForm' requirements: _custom_access: '\Drupal\homebox\Controller\HomeboxController::accessDashboardUserTab' options: parameters: homebox: type: entity:homebox user: type: entity:user homebox.settings_form: path: '/admin/structure/homebox/{homebox}/settings' Loading Loading
config/schema/homebox.schema.yml +9 −12 Original line number Diff line number Diff line Loading @@ -19,12 +19,12 @@ homebox.homebox.*: sequence: type: string label: 'Role' options: type: sequence label: 'Visibility' sequence: type: string label: 'Option' dashboardPageEnabled: type: int:tiny label: 'Dashboard Page Enabled' dashboardUserTabEnabled: type: int:tiny label: 'Dashboard User Tab Enabled' blocks: type: sequence label: 'Blocks' Loading @@ -41,9 +41,6 @@ homebox.homebox.*: type: string status: type: boolean columns: type: sequence label: 'Columns' sequence: layoutId: type: string label: 'Columns' No newline at end of file label: 'Layout Id'
homebox.install +26 −0 Original line number Diff line number Diff line Loading @@ -16,3 +16,29 @@ function homebox_update_8100() { \Drupal::service('module_installer') ->install(['jquery_ui', 'jquery_ui_draggable', 'jquery_ui_droppable']); } function homebox_update_8101() { // @todo Homebox.php // Renamed "$columns" to "$layoutId" // Removed "$options" // Remove "$path" // @todo routing.yml // Removed homebox.page // @todo schema.yml // Delete "options" // // Change: // columns: // type: sequence // label: 'Columns' // sequence: // type: string // label: 'Columns' // // To: // layoutId: // type: string // label: 'Layout Id' }
homebox.module +2 −20 Original line number Diff line number Diff line Loading @@ -5,8 +5,6 @@ * Homebox module hooks. */ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Language\Language; use Drupal\Core\Routing\RouteMatchInterface; /** Loading Loading @@ -46,22 +44,6 @@ function homebox_theme() { ]; } /** * Implements hook_ENTITY_TYPE_insert(). */ function homebox_homebox_insert(EntityInterface $entity) { // @todo Check for existing aliases with the same alias name. /** @var \Drupal\homebox\Entity\Homebox $path_entity */ $path_entity = $entity; $path_alias = \Drupal::entityTypeManager()->getStorage('path_alias')->create([ 'path' => '/homebox-page/' . $entity->id() . '/' . \Drupal::currentUser()->id(), 'alias' => '/' . $path_entity->getPath(), 'langcode' => Language::LANGCODE_SITE_DEFAULT, ]); $path_alias->save(); } /** * Implements hook_local_tasks_alter(). * Loading @@ -74,11 +56,11 @@ function homebox_local_tasks_alter(&$local_tasks) { $homeboxes = $homebox_storage->loadMultiple(); /** @var \Drupal\homebox\Entity\HomeboxInterface $homebox */ foreach ($homeboxes as $homebox) { if ($homebox->getOptions()['menu']) { if ($homebox->getDashboardUserTabEnabled()) { $local_tasks['homebox.user_profile.layout.' . $homebox->id()] = [ 'id' => 'homebox.user_profile.layout.' . $homebox->id(), 'title' => $homebox->label(), 'route_name' => 'homebox.page', 'route_name' => 'homebox.dashboard_user_tab', 'base_route' => 'entity.user.canonical', 'weight' => -100, 'route_parameters' => ['homebox' => $homebox->id()], Loading
homebox.permissions.yml +13 −2 Original line number Diff line number Diff line use homebox: title: 'Use Homebox' description: 'Allows to restrict Homebox access in general. If enabled, individual homebox roles can be set in each Homebox.' # TODO: Introduce in 2.0.0-alpha1: [#3264925] #edit own homebox: # title: 'Edit own homeboxes' # description: 'Allows to configure own Homeboxes. If disabled, the Homebox default can not be changed by the user.' bypass homeboxes access: title: 'Bypass Homebox access control' description: 'View and configure all Homeboxes regardless of permission restrictions. Also allows to access other users Homeboxes.' restrict access: TRUE administer homebox: title: 'Administer Homebox' description: 'Allows access to configure Homebox.' restrict access: true description: 'Allows access to configure Homebox settings via settings page.' restrict access: TRUE
homebox.routing.yml +34 −4 Original line number Diff line number Diff line homebox.page: path: '/homebox-page/{homebox}/{user}' homebox.dashboard_page.default: path: '/homebox/{homebox}' defaults: _form: '\Drupal\homebox\Form\HomeboxPageForm' _form: '\Drupal\homebox\Form\HomeboxDashboardPageForm' requirements: _custom_access: '\Drupal\homebox\Controller\HomeboxController::access' _custom_access: '\Drupal\homebox\Controller\HomeboxController::accessDashboardPage' options: parameters: homebox: type: entity:homebox homebox.dashboard_page: path: '/homebox/{homebox}/{user}' defaults: _form: '\Drupal\homebox\Form\HomeboxDashboardPageForm' requirements: _custom_access: '\Drupal\homebox\Controller\HomeboxController::accessDashboardPage' options: parameters: homebox: type: entity:homebox user: type: entity:user homebox.dashboard_user_tab: path: '/user/{user}/homebox/{homebox}' defaults: _form: '\Drupal\homebox\Form\HomeboxDashboardUserTabForm' requirements: _custom_access: '\Drupal\homebox\Controller\HomeboxController::accessDashboardUserTab' options: parameters: homebox: type: entity:homebox user: type: entity:user homebox.settings_form: path: '/admin/structure/homebox/{homebox}/settings' Loading