Skip to content

Commit

Permalink
version 1.4.0
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Crawford <[email protected]>
  • Loading branch information
engram-design committed Dec 2, 2015
1 parent a68efa5 commit 0ffc65a
Show file tree
Hide file tree
Showing 12 changed files with 147 additions and 80 deletions.
47 changes: 4 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

Field Manager is a Craft CMS plugin to help make it easy to manage your fields and field groups.

At this stage, functionality revolves around cloning fields and field groups, but [more features are planned](https://github.com/engram-design/FieldManager#roadmap)!

<img src="https://raw.githubusercontent.com/engram-design/FieldManager/master/screenshots/main.png" />


## Install

- Add the `fieldmanager` directory into your `craft/plugins` directory.
Expand All @@ -16,6 +15,7 @@ At this stage, functionality revolves around cloning fields and field groups, bu
- Change the plugin name as it appear in the CP navigation.
- Toggle the visibility of the plugin on the CP navgiation. Handy if you only need to use it from time to time.


## Cloning

Ever needed to clone a field - or even a whole field group? You can easily use Field Manager to do both!
Expand All @@ -28,6 +28,7 @@ One thing to note for field group cloning, is that fields are required to have u

You may also set this yourself if you choose to, using the `Prefix` field when cloning a field group. Please note that it needs to be a valid handle (no spaces, no hyphens, underscores only).


## Supported FieldTypes

**Craft**
Expand Down Expand Up @@ -71,44 +72,4 @@ Found a bug? Have a suggestion? [Submit an issue](https://github.com/engram-desi

## Changelog

#### 1.3.5

- Fixed import/export issue with Position Select field - [#9](https://github.com/engram-design/FieldManager/issues/9).

#### 1.3.4

- Refactor import/export services.
- Fully support import/export Matrix-in-SuperTable and SuperTable-in-Matrix.

#### 1.3.3

- Added support for [SuperTable](https://github.com/engram-design/SuperTable).
- Fix for 'Show in CP Nav' setting - [#5](https://github.com/engram-design/FieldManager/issues/5).
- Fix when exporting Matrix fields, field settings weren't getting exported - [#6](https://github.com/engram-design/FieldManager/issues/6).
- Minor cosmetic fixes.

#### 1.3.2

- Added support for exporting Matrix fields.

#### 1.3.1

- Added full-featured import mapping. Allows changing of field name, handle and group assignment for each field for import.

#### 1.3

- Added import/exporting of fields.

#### 1.2

- Edit fields or field groups directly from the FieldManager screen. Just click the blue links on the left-hand side of the table.
- Better error-handling for `saveField()`
- Swapped HUD for Modal when cloning single field. Allows editing of all field settings/properties, not just group, name and handle.

#### 1.1

- Added an option to provide a `prefix` to be used for all fields handle value when cloning group. This is because field handles need to be unique!

#### 1.0

- Initial release.
[View JSON Changelog](https://github.com/engram-design/FieldManager/blob/master/changelog.json)
79 changes: 79 additions & 0 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[
{
"version": "1.4.0",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.4.0.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Added] Craft 2.5 support, including release feed and icons."
]
}, {
"version": "1.3.5",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.3.5.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Fixed] Fixed import/export issue with Position Select field - [#9](https://github.com/engram-design/FieldManager/issues/9)."
]
}, {
"version": "1.3.4",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.3.4.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Improved] Fully support import/export Matrix-in-SuperTable and SuperTable-in-Matrix.",
"[Improved] Refactor import/export services."
]
}, {
"version": "1.3.3",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.3.3.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Added] Added support for [SuperTable](https://github.com/engram-design/SuperTable).",
"[Fixed] Fix for 'Show in CP Nav' setting - [#5](https://github.com/engram-design/FieldManager/issues/5).",
"[Fixed] Fix when exporting Matrix fields, field settings weren't getting exported - [#6](https://github.com/engram-design/FieldManager/issues/6).",
"[Fixed] Minor cosmetic fixes."
]
}, {
"version": "1.3.2",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.3.2.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Added] Added support for exporting Matrix fields."
]
}, {
"version": "1.3.1",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.3.1.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Added] Added full-featured import mapping. Allows changing of field name, handle and group assignment for each field for import."
]
}, {
"version": "1.3.0",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.3.0.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Added] Added import/exporting of fields."
]
}, {
"version": "1.2.0",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.2.0.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Improved] Edit fields or field groups directly from the FieldManager screen. Just click the blue links on the left-hand side of the table.",
"[Improved] Better error-handling for `saveField()`",
"[Improved] Swapped HUD for Modal when cloning single field. Allows editing of all field settings/properties, not just group, name and handle."
]
}, {
"version": "1.1.0",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.1.0.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"[Added] Added an option to provide a `prefix` to be used for all fields handle value when cloning group. This is because field handles need to be unique!"
]
}, {
"version": "1.0.0",
"downloadUrl": "https://github.com/engram-design/FieldManager/archive/1.0.0.zip",
"date": "2015-12-02 23:25:00",
"notes": [
"Initial release."
]
}
]
16 changes: 0 additions & 16 deletions composer.json

This file was deleted.

39 changes: 26 additions & 13 deletions fieldmanager/FieldManagerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

class FieldManagerPlugin extends BasePlugin
{
/* --------------------------------------------------------------
* PLUGIN INFO
* ------------------------------------------------------------ */
// =========================================================================
// PLUGIN INFO
// =========================================================================

public function getName()
{
Expand All @@ -14,7 +14,12 @@ public function getName()

public function getVersion()
{
return '1.3.5';
return '1.4.0';
}

public function getSchemaVersion()
{
return '1.0.0';
}

public function getDeveloper()
Expand All @@ -27,16 +32,31 @@ public function getDeveloperUrl()
return 'http://sgroup.com.au';
}

public function getPluginUrl()
{
return 'https://github.com/engram-design/FieldManager';
}

public function getDocumentationUrl()
{
return $this->getPluginUrl() . '/blob/master/README.md';
}

public function getReleaseFeedUrl()
{
return $this->getPluginUrl() . '/blob/master/changelog.json';
}

public function hasCpSection()
{
return craft()->fieldManager->isCpSectionEnabled() ? true : false;
}

public function getSettingsHtml()
{
return craft()->templates->render( 'fieldmanager/settings', array(
return craft()->templates->render('fieldmanager/settings', array(
'settings' => $this->getSettings(),
) );
));
}

protected function defineSettings()
Expand All @@ -45,11 +65,4 @@ protected function defineSettings()
'cpSectionEnabled' => array( AttributeType::Bool, 'default' => true ),
);
}



/* --------------------------------------------------------------
* HOOKS
* ------------------------------------------------------------ */

}
3 changes: 3 additions & 0 deletions fieldmanager/controllers/FieldManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

class FieldManagerController extends BaseController
{
// Public Methods
// =========================================================================

public function actionGetGroupFieldHtml()
{
$this->requirePostRequest();
Expand Down
5 changes: 4 additions & 1 deletion fieldmanager/resources/css/fieldmanager.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
font-weight: bold;
}


body.ltr .rightalign {
float: right;
}

.clone-btn.element {
cursor: pointer;
Expand All @@ -58,6 +60,7 @@
.icon.delete-group:not(.disabled):hover:before {
color: #da5a47;
}

.icon.delete-group:before {
content: 'remove';
color: rgba(0, 0, 0, 0.2);
Expand Down
3 changes: 3 additions & 0 deletions fieldmanager/resources/icon-mask.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions fieldmanager/resources/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions fieldmanager/resources/js/fieldmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ $(function() {
$hudContents = $hudContents.add(this.$form);

this.hud = new Garnish.HUD(this.$element, $hudContents, {
bodyClass: 'body elementeditor',
bodyClass: 'body',
closeOtherHUDs: false
});

Expand Down Expand Up @@ -275,7 +275,7 @@ $(function() {
$hudContents = $hudContents.add(this.$form);

this.hud = new Garnish.HUD(this.$element, $hudContents, {
bodyClass: 'body elementeditor',
bodyClass: 'body',
closeOtherHUDs: false
});

Expand Down
3 changes: 3 additions & 0 deletions fieldmanager/services/FieldManagerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

class FieldManagerService extends BaseApplicationComponent
{
// Public Methods
// =========================================================================

public function isCpSectionEnabled()
{
$settings = craft()->plugins->getPlugin('fieldManager')->getSettings();
Expand Down
9 changes: 7 additions & 2 deletions fieldmanager/services/FieldManager_ExportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

class FieldManager_ExportService extends BaseApplicationComponent
{
// Public Methods
// =========================================================================

public function export(array $fieldIds)
{
$fieldDefs = array();
Expand Down Expand Up @@ -33,7 +36,8 @@ public function export(array $fieldIds)
return $fieldDefs;
}

public function handleMatrixExport($field) {
public function handleMatrixExport($field)
{
$blockTypeDefs = array();
$blockTypes = craft()->matrix->getBlockTypesByFieldId($field->id);

Expand Down Expand Up @@ -63,7 +67,8 @@ public function handleMatrixExport($field) {
return $blockTypeDefs;
}

public function handleSuperTableExport($field) {
public function handleSuperTableExport($field)
{
$blockTypeDefs = array();
$blockTypes = craft()->superTable->getBlockTypesByFieldId($field->id);

Expand Down
11 changes: 8 additions & 3 deletions fieldmanager/services/FieldManager_ImportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

class FieldManager_ImportService extends BaseApplicationComponent
{
public function import($fieldDefs) {
// Public Methods
// =========================================================================

public function import($fieldDefs)
{
$fields = craft()->fields->getAllFields('handle');
$fieldTypes = craft()->fields->getAllFieldTypes();

Expand Down Expand Up @@ -44,7 +47,8 @@ public function import($fieldDefs) {
return true;
}

public function handleMatrixImport($fieldDef, $field) {
public function handleMatrixImport($fieldDef, $field)
{
$blockTypes = craft()->matrix->getBlockTypesByFieldId($field->id, 'handle');

if (!array_key_exists('blockTypes', $fieldDef)) {
Expand Down Expand Up @@ -101,7 +105,8 @@ public function handleMatrixImport($fieldDef, $field) {
}
}

public function handleSuperTableImport($fieldDef, $field) {
public function handleSuperTableImport($fieldDef, $field)
{
$blockTypes = craft()->superTable->getBlockTypesByFieldId($field->id, 'id');

foreach ($fieldDef['blockTypes'] as $blockTypeFields) {
Expand Down

0 comments on commit 0ffc65a

Please sign in to comment.