-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from open-sausages/master
Fixes and polish
- Loading branch information
Showing
12 changed files
with
105 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
code/extensions/ShareDraftContentCMSPageEditControllerExtension.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
class ShareDraftContentControllerExtension extends Extension { | ||
/** | ||
* @var array | ||
*/ | ||
private static $allowed_actions = array( | ||
'MakeShareDraftLink', | ||
); | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function MakeShareDraftLink() { | ||
if ($member = Member::currentUser()) { | ||
if($this->owner->hasMethod('CurrentPage') && $this->owner->CurrentPage()->canEdit($member)) { | ||
return $this->owner->CurrentPage()->ShareTokenLink(); | ||
} elseif ($this->owner->hasMethod('canEdit') && $this->owner->canEdit($member)) { | ||
return $this->owner->ShareTokenLink(); | ||
} | ||
} | ||
|
||
return Security::permissionFailure(); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getShareDraftLinkAction() { | ||
return $this->owner->Link('MakeShareDraftLink'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Front-end development | ||
# Developer Tools | ||
|
||
Get the dependencies by running `npm install`. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Getting Started | ||
|
||
The easiest way to install is by using [Composer](https://getcomposer.org): | ||
|
||
```sh | ||
$ composer require silverstripe/sharedraftcontent | ||
``` | ||
|
||
You'll also need to run `dev/build`. You should now see a link/button on the bottom-right of edit pages. Clicking the link will generate a new share link. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Introduction | ||
|
||
[](https://travis-ci.org/silverstripe-labs/silverstripe-sharedraftcontent) | ||
[](https://scrutinizer-ci.com/g/silverstripe-labs/silverstripe-sharedraftcontent) | ||
[](https://packagist.org/packages/silverstripe-labs/silverstripe-sharedraftcontent) | ||
[](license.md) | ||
|
||
Share draft page content with non-CMS users. | ||
|
||
## Share Links | ||
|
||
The generated share links have a public key and hash. There can be any number of share links per-page, but all share links are unique, and cannot be used to gain access to pages other than the one each link was created for. | ||
|
||
## Sections | ||
|
||
- [Getting Started](getting-started.md) | ||
- [Developer Tools](developer-tools.md) | ||
|
||
## Questions | ||
|
||
This module was created by [SilverStripe](https://twitter.com/silverstripe). You can ask questions on Twitter. | ||
|
||
You can report bugs or request features on [GitHub](https://github.com/silverstripe-labs/silverstripe-sharedraftcontent/issues). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters