From 9ee74ca0cf0abaab1da51c602a62525ee704c25d Mon Sep 17 00:00:00 2001 From: Praesidiarius Date: Thu, 30 Jan 2020 18:14:57 +0100 Subject: [PATCH] licensing alpha --- docs/book/index.md | 2 +- .../src/Controller/CoreController.php | 20 +++++++++++++ .../Application/src/Model/CoreEntityModel.php | 1 + .../Application/src/Model/CoreEntityTable.php | 1 + .../view/partial/basicformfield.phtml | 1 + .../Application/view/partial/breadcrumb.phtml | 28 ++++++++++--------- .../view/partial/viewformfield.phtml | 5 ++++ 7 files changed, 44 insertions(+), 14 deletions(-) diff --git a/docs/book/index.md b/docs/book/index.md index 189ba53..b8395bd 100644 --- a/docs/book/index.md +++ b/docs/book/index.md @@ -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) diff --git a/module/Application/src/Controller/CoreController.php b/module/Application/src/Controller/CoreController.php index a6f973b..45dd0ab 100644 --- a/module/Application/src/Controller/CoreController.php +++ b/module/Application/src/Controller/CoreController.php @@ -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; + } + } } \ No newline at end of file diff --git a/module/Application/src/Model/CoreEntityModel.php b/module/Application/src/Model/CoreEntityModel.php index d508550..2bd6651 100644 --- a/module/Application/src/Model/CoreEntityModel.php +++ b/module/Application/src/Model/CoreEntityModel.php @@ -264,6 +264,7 @@ protected function attachDynamicFields() { case 'text': case 'textarea': case 'email': + case 'url': case 'featuredimage': case 'tel': $this->$sFieldName = ''; diff --git a/module/Application/src/Model/CoreEntityTable.php b/module/Application/src/Model/CoreEntityTable.php index 6436148..e0bdd06 100644 --- a/module/Application/src/Model/CoreEntityTable.php +++ b/module/Application/src/Model/CoreEntityTable.php @@ -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': diff --git a/module/Application/view/partial/basicformfield.phtml b/module/Application/view/partial/basicformfield.phtml index 96eb800..e470347 100644 --- a/module/Application/view/partial/basicformfield.phtml +++ b/module/Application/view/partial/basicformfield.phtml @@ -14,6 +14,7 @@ switch($oField->type) { /** * Text Field */ + case 'url': case 'text': ?> /> diff --git a/module/Application/view/partial/breadcrumb.phtml b/module/Application/view/partial/breadcrumb.phtml index beb6f8d..d4443b9 100644 --- a/module/Application/view/partial/breadcrumb.phtml +++ b/module/Application/view/partial/breadcrumb.phtml @@ -1,16 +1,18 @@ -aButtons) > 0) { - foreach($this->aButtons as $oBtn) { - # Get current entity ID from layout - $iItemID = (isset($this->layout()->oItem)) ? $this->layout()->oItem->getID() : 0; +
+ 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); ?> - - translate($oBtn->label)?> - - " title="title?>" class="btn btn-class?>"> + translate($oBtn->label)?> + + \ No newline at end of file + ?> +
\ No newline at end of file diff --git a/module/Application/view/partial/viewformfield.phtml b/module/Application/view/partial/viewformfield.phtml index fdc5050..7f3640d 100644 --- a/module/Application/view/partial/viewformfield.phtml +++ b/module/Application/view/partial/viewformfield.phtml @@ -12,6 +12,11 @@ switch($oField->type) { case 'email': echo $this->oItem->getTextField($oField->fieldkey); break; + case 'url': + echo ''; + echo $this->oItem->getTextField($oField->fieldkey); + echo ''; + 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)));