forked from pixelandtonic/DigitalProducts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Support for stuff and closed pixelandtonic#17 issue
Also added support for the isLicensed hidden field type - essentially what it will do is allow devs to find all users licensed to a particular product where the license is enabled. Also added support for save and add another in case that wasnt already in the pipeline.
- Loading branch information
1 parent
b9e34c4
commit ba540b2
Showing
4 changed files
with
83 additions
and
0 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
36 changes: 36 additions & 0 deletions
36
digitalproducts/fieldtypes/DigitalProducts_IsLicensedFieldType.php
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,36 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Giel Tettelaar PC | ||
* Date: 3/14/2018 | ||
* Time: 3:56 PM | ||
*/ | ||
|
||
namespace Craft; | ||
|
||
|
||
class DigitalProducts_IsLicensedFieldType extends BaseFieldType{ | ||
|
||
public function getName() | ||
{ | ||
return Craft::t('Is licensed'); | ||
} | ||
public function getInputHtml($name, $value) | ||
{ | ||
return false; | ||
} | ||
|
||
public function defineContentAttribute() | ||
{ | ||
return false; | ||
} | ||
|
||
public function modifyElementsQuery(DbCommand $query, $value) | ||
{ | ||
if ($value !== null) | ||
craft()->digitalProducts_licenses->modifyQuery($query, $value); | ||
|
||
return $query; | ||
} | ||
|
||
} |
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