Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added standard .editorconfig file #4

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# For more information about the properties used in this file,
# please see the EditorConfig documentation:
# http://editorconfig.org

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{*.yml,package.json}]
indent_size = 2

# The indent size used in the package.json file cannot be changed:
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/tests export-ignore
/docs export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.scrutinizer.yml export-ignore
9 changes: 9 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
inherit: true

checks:
php:
code_rating: true
duplication: true

filter:
paths: [code/*, tests/*]
36 changes: 36 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details

sudo: false

language: php

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0

env:
- DB=MYSQL CORE_RELEASE=3.2

matrix:
include:
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3
- php: 5.6
env: DB=MYSQL CORE_RELEASE=3.1
- php: 5.6
env: DB=PGSQL CORE_RELEASE=3.2
allow_failures:
- php: 7.0

before_script:
- composer self-update || true
- git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support
- php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- cd ~/builds/ss
- composer install

script:
- vendor/bin/phpunit content-widget/tests
20 changes: 0 additions & 20 deletions LICENSE

This file was deleted.

34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
# SilverStripe Content Widget

Display HTML content in a widget!

## Installation

```sh
$ composer require silverstripe/content-widget
```

## Usage

Enable [widgets module](https://github.com/silverstripe/silverstripe-widgets), and add a content
widget to a page.

## Licence

```
The MIT License (MIT)

Copyright (c) 2013 Burnbright Web Solutions

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
1 change: 1 addition & 0 deletions code-of-conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When having discussions about this module in issues or pull request please adhere to the [SilverStripe Community Code of Conduct](https://docs.silverstripe.org/en/contributing/code_of_conduct).
58 changes: 30 additions & 28 deletions code/ContentWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,40 @@
*
* @package silverstripe-content-widget
*/
class ContentWidget extends Widget {
/**
* @var array
*/
public static $db = array(
"HTML" => "HTMLText"
);
class ContentWidget extends Widget
{
/**
* @var array
*/
public static $db = array(
"HTML" => "HTMLText"
);

/**
* @var string
*/
private static $title = "HTML Content";
/**
* @var string
*/
private static $title = "HTML Content";

/**
* @var string
*/
private static $cmsTitle = "HTML Content";
/**
* @var string
*/
private static $cmsTitle = "HTML Content";

/**
* @var string
*/
private static $description = "Custom HTML content widget.";
/**
* @var string
*/
private static $description = "Custom HTML content widget.";

/**
* @return FieldList
*/
public function getCMSFields() {
$fields = parent::getCMSFields();
/**
* @return FieldList
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();

$fields->push(TextField::create("Title"));
$fields->push(HtmlEditorField::create("HTML", "Content"));
$fields->push(TextField::create("Title"));
$fields->push(HtmlEditorField::create("HTML", "Content"));

return $fields;
}
return $fields;
}
}
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
"name": "Jeremy Shipman",
"email": "[email protected]"
}
]
],
"replace": {
"burnbright/silverstripe-widget-content": "self.version"
}
}
7 changes: 7 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2015 Jeremy Shipman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.