Skip to content

Commit

Permalink
licensing alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
Praesidiarius committed Jan 30, 2020
1 parent bcb33fa commit 9ee74ca
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/book/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $ composer create-project oneplace/oneplace-core my-app
```

You also need to add some 3rd party assets to make onePlace
fully work. See [Installation](/installation)
fully work. See [Installation](https://docs.1plc.ch/oneplace-core/installation/)

## Support
* Issues: [github.com/oneplc/plc_x_core/issues](https://github.com/oneplc/plc_x_core/issues)
Expand Down
20 changes: 20 additions & 0 deletions module/Application/src/Controller/CoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -762,4 +762,24 @@ public function getSetting($sKey) {
return false;
}
}

protected function checkLicense($sModule) {
if(isset(CoreController::$aGlobalSettings['license-server-url'])) {
//$sApiURL = CoreController::$aGlobalSettings['license-server-url'].'/license/api/list/0?authkey='.CoreController::$aGlobalSettings['license-server-apikey'];
$sApiURL = CoreController::$aGlobalSettings['license-server-url'].'/license/api/list/0?authkey=DEVRANDOMKEY&listmode=entity&systemkey='.CoreController::$aGlobalSettings['license-server-apikey'].'&modulename='.$sModule;
$sAnswer = file_get_contents($sApiURL);

$oResponse = json_decode($sAnswer);

if(is_object($oResponse)) {
if($oResponse->state == 'success') {
return true;
}
}

return false;
} else {
return true;
}
}
}
1 change: 1 addition & 0 deletions module/Application/src/Model/CoreEntityModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ protected function attachDynamicFields() {
case 'text':
case 'textarea':
case 'email':
case 'url':
case 'featuredimage':
case 'tel':
$this->$sFieldName = '';
Expand Down
1 change: 1 addition & 0 deletions module/Application/src/Model/CoreEntityTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected function attachDynamicFields(array $aData,$oObject) {
case 'textarea':
case 'email':
case 'tel':
case 'url':
$aData[$sFieldName] = $oObject->$sFieldName;
break;
case 'currency':
Expand Down
1 change: 1 addition & 0 deletions module/Application/view/partial/basicformfield.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ switch($oField->type) {
/**
* Text Field
*/
case 'url':
case 'text': ?>
<input type="text" class="form-control" name="<?=$this->sFormName?>_<?=$oField->fieldkey?>"
value="<?=(isset($this->oItem)) ? $this->oItem->getTextField($oField->fieldkey) : ''?>"<?=$sExtraAttributes?> />
Expand Down
28 changes: 15 additions & 13 deletions module/Application/view/partial/breadcrumb.phtml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php
if(count($this->aButtons) > 0) {
foreach($this->aButtons as $oBtn) {
# Get current entity ID from layout
$iItemID = (isset($this->layout()->oItem)) ? $this->layout()->oItem->getID() : 0;
<div class="plc-button-panel">
<?php
if(count($this->aButtons) > 0) {
foreach($this->aButtons as $oBtn) {
# Get current entity ID from layout
$iItemID = (isset($this->layout()->oItem)) ? $this->layout()->oItem->getID() : 0;

# Build final link for button
$sFinalHref = str_replace(['##ID##'],[$iItemID],$oBtn->href); ?>
# Build final link for button
$sFinalHref = str_replace(['##ID##'],[$iItemID],$oBtn->href); ?>

<a href="<?=$sFinalHref?>" title="<?=$oBtn->title?>" class="btn btn-<?=$oBtn->class?>">
<?=$this->translate($oBtn->label)?>
</a>
<?php
<a href="<?=$sFinalHref?>" title="<?=$oBtn->title?>" class="btn btn-<?=$oBtn->class?>">
<?=$this->translate($oBtn->label)?>
</a>
<?php
}
}
}
?>
?>
</div>
5 changes: 5 additions & 0 deletions module/Application/view/partial/viewformfield.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ switch($oField->type) {
case 'email':
echo $this->oItem->getTextField($oField->fieldkey);
break;
case 'url':
echo '<a href="'.$this->oItem->getTextField($oField->fieldkey).'" target="_blank">';
echo $this->oItem->getTextField($oField->fieldkey);
echo '</a>';
break;
case 'date':
if($this->oItem->getTextField($oField->fieldkey) != '0000-00-00 00:00:00' && $this->oItem->getTextField($oField->fieldkey) != '0000-00-00') {
echo date('d.m.Y',strtotime($this->oItem->getTextField($oField->fieldkey)));
Expand Down

0 comments on commit 9ee74ca

Please sign in to comment.