Commit 17bf0bdb authored by Achilles's avatar Achilles

add boostrap_layouts panels page_manager layout_plugin ctools

parent 008c4776
# Created by https://www.gitignore.io/api/phpstorm,sublimetext,osx,windows
### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# .idea/shelf
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project
# sftp configuration file
sftp-config.json
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
This diff is collapsed.
# Bootstrap Layouts
This project is the combination of the Drupal 7 [Display Suite Bootstrap Layouts]
and [Panels Bootstrap Layouts] modules for Drupal 8.
## Requirements
- [Drupal Bootstrap] or any other theme that utilizes the Bootstrap framework
grid system and classes.
- Any module or theme that utilizes the [Layout Plugin] module:
- [Display Suite]
- [Panels] (via [Page Manager])
- Or any other project that uses Layout Plugin.
## Installation
Install as you would normally install a contributed Drupal module. See:
https://drupal.org/documentation/install/modules-themes/modules-8 for further
information.
## Configuration
Configuration will depend on which project is been use to display it, either
Display Suite or Panels. But all this project needs is to be installed.
## Maintainers
- Darryl Norris ([darol100](https://www.drupal.org/u/darol100))
- Mark Carver ([markcarver](https://www.drupal.org/u/markcarver))
[Display Suite Bootstrap Layouts]:https://www.drupal.org/project/ds_bootstrap_layouts
[Panels Bootstrap Layouts]:https://www.drupal.org/project/panels_bootstrap_layouts
[Drupal Bootstrap]:https://www.drupal.org/project/bootstrap
[Layout Plugin]:https://www.drupal.org/project/layout_plugin
[Display Suite]:https://www.drupal.org/project/ds
[Panels]:https://www.drupal.org/project/panels
[Page Manager]:https://www.drupal.org/project/page_manager
<?php
/**
* @file
* API hooks/callbacks for the Bootstrap Layouts module.
*/
use Drupal\Component\Utility\Unicode;
/**
* Alters the list of available classes that can be used in Bootstrap layouts.
*
* @param array $classes
* An associative array groups keyed by group machine name, containing
* another associative array containing key/value pairs where the class
* is the key and a human readable label is the the value.
* @param $groups
* An associative array groups labels keyed by group machine name.
*
* @see \Drupal\bootstrap_layouts\BootstrapLayoutsManager::getClassOptions
*/
function hook_bootstrap_layouts_class_options_alter(&$classes, &$groups) {
// Add theme specific classes.
$groups['my_theme'] = t('My Theme');
foreach (['top', 'middle', 'bottom'] as $style) {
$classes['my_theme']["section-$style"] = t('Section: @style', ['@style' => Unicode::ucfirst($style)]);
}
}
name: Bootstrap Layouts
type: module
description: This module is going to generate layouts with Bootstrap grid system.
# core: 8.x
package: Layout
dependencies:
- layout_plugin
# Information added by Drupal.org packaging script on 2016-12-10
version: '8.x-4.1'
core: '8.x'
project: 'bootstrap_layouts'
datestamp: 1481413090
<?php
/**
* @file
* Install, uninstall and update hooks for the Bootstrap Layouts module.
*/
/**
* Runs updates for registered update plugins.
*
* @param int $schema
* The schema version to update.
*
* @see \Drupal\bootstrap_layouts\BootstrapLayoutsManager::update()
*
* @throws Exception
* When the "plugin.manager.bootstrap_layouts" service could not be loaded.
*/
function _bootstrap_layouts_update($schema) {
$container = \Drupal::getContainer();
// Rebuild the container if the bootstrap layouts manager doesn't exist.
if (!$container->has('plugin.manager.bootstrap_layouts')) {
drupal_flush_all_caches();
}
/** @var \Drupal\bootstrap_layouts\BootstrapLayoutsManager $bootstrap_layouts_manager */
if ($manager = $container->get('plugin.manager.bootstrap_layouts')) {
$manager->update($schema);
}
else {
throw new Exception('Unable to load the "plugin.manager.bootstrap_layouts" service.');
}
}
/**
* Upgrade existing Bootstrap Layout instances.
*/
function bootstrap_layouts_update_8401() {
/** @see \Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\Updates\BootstrapLayoutsUpdate8401 */
_bootstrap_layouts_update(8401);
}
/**
* Fix "1 Column (stacked)" regions.
*/
function bootstrap_layouts_update_8402() {
/** @see \Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\Updates\BootstrapLayoutsUpdate8402 */
_bootstrap_layouts_update(8402);
}
# One column.
bs_1col:
label: '1 Column'
category: 'Bootstrap'
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase'
type: partial
icon: images/1col.png
template: templates/3.0.0/bs-1col
regions:
main:
label: 'Content'
classes:
- col-sm-12
# One column (stacked).
bs_1col_stacked:
label: '1 Column (Stacked)'
category: 'Bootstrap'
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase'
type: partial
icon: images/1col-stacked.png
template: templates/3.0.0/bs-1col-stacked
regions:
top:
label: 'Top'
classes:
- col-sm-12
main:
label: 'Content'
classes:
- col-sm-12
bottom:
label: 'Bottom'
classes:
- col-sm-12
# Two columns.
bs_2col:
label: '2 Columns'
category: 'Bootstrap'
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase'
type: partial
icon: images/2col.png
template: templates/3.0.0/bs-2col
regions:
left:
label: 'Left'
classes:
- col-sm-6
right:
label: 'Right'
classes:
- col-sm-6
# Two columns (bricked).
bs_2col_bricked:
label: '2 Columns (Bricked)'
category: 'Bootstrap'
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase'
type: partial
icon: images/2col-bricked.png
template: templates/3.0.0/bs-2col-bricked
regions:
top:
label: 'Top'
classes:
- col-sm-12
top_left:
label: 'Top Left'
classes:
- col-sm-6
top_right:
label: 'Top Right'
classes:
- col-sm-6
middle:
label: 'Middle'
classes:
- col-sm-12
bottom_left:
label: 'Bottom Left'
classes:
- col-sm-6
bottom_right:
label: 'Bottom Right'
classes:
- col-sm-6
bottom:
label: 'Bottom'
classes:
- col-sm-12
# Two columns (stacked).
bs_2col_stacked:
label: '2 Columns (Stacked)'
category: 'Bootstrap'
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase'
type: partial
icon: images/2col-stacked.png
template: templates/3.0.0/bs-2col-stacked
regions:
top:
label: 'Top'
classes:
- col-sm-12
left:
label: 'Left'
classes:
- col-sm-6
right:
label: 'Right'
classes:
- col-sm-6
bottom:
label: 'Bottom'
classes:
- col-sm-12
# Three columns.
bs_3col:
label: '3 Columns'
category: 'Bootstrap'
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase'
type: partial
icon: images/3col.png
template: templates/3.0.0/bs-3col
regions:
left:
label: 'Left'
classes:
- col-sm-4
middle:
label: 'Middle'
classes:
- col-sm-4
right:
label: 'Right'
classes:
- col-sm-4
# Three columns (bricked).
bs_3col_bricked:
label: '3 Columns (Bricked)'
category: 'Bootstrap'
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase'
type: partial
icon: images/3col-bricked.png
template: templates/3.0.0/bs-3col-bricked
regions:
top:
label: 'Top'
classes:
- col-sm-12
top_left:
label: 'Top Left'
classes:
- col-sm-4
top_middle:
label: 'Top Middle'
classes:
- col-sm-4
top_right:
label: 'Top Right'
classes:
- col-sm-4
middle:
label: 'Middle'
classes:
- col-sm-12
bottom_left:
label: 'Bottom Left'
classes:
- col-sm-4
bottom_middle:
label: 'Bottom Middle'
classes:
- col-sm-4
bottom_right:
label: 'Bottom Right'
classes:
- col-sm-4
bottom:
label: 'Bottom'
classes:
- col-sm-12
# Three columns (stacked).
bs_3col_stacked:
label: '3 Columns (Stacked)'
category: 'Bootstrap'
class: '\Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase'
type: partial
icon: images/3col-stacked.png
template: templates/3.0.0/bs-3col-stacked
regions:
top:
label: 'Top'
classes:
- col-sm-12
left:
label: 'Left'
classes:
- col-sm-4
middle:
label: 'Middle'
classes:
- col-sm-4
right:
label: 'Right'
classes:
- col-sm-4
bottom:
label: 'Bottom'
classes:
- col-sm-12
# Four columns.