Skip to content

Commit

Permalink
getting ready for mass deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Praesidiarius committed Mar 13, 2020
1 parent 9e1f8b5 commit e4b220b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "oneplace/oneplace-core",
"description": "onePlace Core Application",
"type": "project",
"version": "1.0.28",
"version": "1.0.29",
"license": "BSD-3-Clause",
"keywords": [
"laminas",
Expand Down
24 changes: 21 additions & 3 deletions module/Application/src/Controller/CoreApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,19 @@ public function getAction() {
# Init public item
$aPublicItem = ['id'=>$oItem->getID()];

$oRoot = false;
// Event Fix
// todo: create hook here and move code to hook
if(isset($oItem->root_event_idfs)) {
if($oItem->root_event_idfs != 0) {
$oRoot = $this->oTableGateway->getSingle($oItem->root_event_idfs);
$oItem->label = $oRoot->label;
$oItem->excerpt = $oRoot->excerpt;
$oItem->featured_image = $oRoot->featured_image;
$oItem->description = $oRoot->description;
}
}

# add all fields to item
foreach($aFields as $oField) {
switch($oField->type) {
Expand Down Expand Up @@ -438,11 +451,16 @@ public function getAction() {
break;
case 'text':
case 'date':
case 'datetime':
case 'textarea':
$aPublicItem[$oField->fieldkey] = $translator->translate($oItem->getTextField($oField->fieldkey),$sEntityType,$sLang);
break;
case 'featuredimage':
$aPublicItem['featured_image'] = '/data/'.$sEntityType.'/'.$oItem->getID().'/'.$oItem->getTextField('featured_image');
$iImageID = $oItem->getID();
if($oRoot) {
$iImageID = $oRoot->getID();
}
$aPublicItem['featured_image'] = '/data/'.$sEntityType.'/'.$iImageID.'/'.$oItem->getTextField('featured_image');
break;
case 'gallery':
$oMediaSel = new Select(CoreApiController::$aCoreTables['core-gallery-media']->getTable());
Expand All @@ -465,8 +483,8 @@ public function getAction() {
}
}

if (array_key_exists($this->sSingleForm.'-api-list-before',CoreEntityController::$aEntityHooks)) {
foreach(CoreEntityController::$aEntityHooks[$this->sSingleForm.'-api-list-before'] as $oHook) {
if (array_key_exists($this->sSingleForm.'-api-get-before',CoreEntityController::$aEntityHooks)) {
foreach(CoreEntityController::$aEntityHooks[$this->sSingleForm.'-api-get-before'] as $oHook) {
$sHookFunc = $oHook->sFunction;
$aCustomData = $oHook->oItem->$sHookFunc($oItem);
$aPublicItem = array_merge($aPublicItem,$aCustomData);
Expand Down
10 changes: 5 additions & 5 deletions module/Application/src/Controller/CoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,20 +775,20 @@ protected function sendEmail($sTemplate,$aTemplateData,$sToMail,$sToName,$sSubje
$oMail = new Mail\Message();
$oMail->setEncoding('UTF-8');
$oMail->setBody($oBody);
$oMail->setFrom('[email protected]', 'onePlace');
$oMail->setFrom(CoreController::$aGlobalSettings['noreply-email'], CoreController::$aGlobalSettings['noreply-from']);
$oMail->addTo($sToMail, $sToName);
$oMail->setSubject($sSubject);

# Setup SMTP Transport for proper email sending
$oTransport = new SmtpTransport();
$aOptions = new SmtpOptions([
'name' => 'mail.cyon.ch',
'host' => 'mail.cyon.ch',
'name' => CoreController::$aGlobalSettings['noreply-server'],
'host' => CoreController::$aGlobalSettings['noreply-server'],
'port' => 587,
'connection_class' => 'login',
'connection_config' => [
'username' => '[email protected]',
'password' => 'gH:KFPb8<!9D',
'username' => CoreController::$aGlobalSettings['noreply-email'],
'password' => CoreController::$aGlobalSettings['noreply-pw'],
'ssl' => 'tls',
],
]);
Expand Down
2 changes: 1 addition & 1 deletion module/Application/src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Module {
*
* @since 1.0.0
*/
const VERSION = '1.0.28';
const VERSION = '1.0.29';

public function getConfig() : array
{
Expand Down
26 changes: 20 additions & 6 deletions module/Application/view/partial/breadcrumb.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,27 @@
$iItemID = (isset($this->layout()->oItem)) ? $this->layout()->oItem->getID() : 0;

# Build final link for button
$sFinalHref = str_replace(['##ID##'],[$iItemID],$oBtn->href); ?>
$sFinalHref = str_replace(['##ID##'],[$iItemID],$oBtn->href);
$bPrint = true;
if(isset($this->layout()->oItem)) {
if($oBtn->filter_check != '') {
$sFilter = $oBtn->filter_check;
if(property_exists($this->layout()->oItem,$sFilter)) {
if($this->layout()->oItem->$sFilter != $oBtn->filter_value) {
$bPrint = false;
}
}
}
}

<a href="<?=$sFinalHref?>" title="<?=$oBtn->title?>" class="btn btn-<?=$oBtn->class?>">
<?=($oBtn->icon != '') ? '<i class="'.$oBtn->icon.'"></i> ' : ''?>
<?=$this->translate($oBtn->label)?>
</a>
<?php
if($bPrint) {
?>
<a href="<?= $sFinalHref ?>" title="<?= $oBtn->title ?>" class="btn btn-<?= $oBtn->class ?>">
<?= ($oBtn->icon != '') ? '<i class="' . $oBtn->icon . '"></i> ' : '' ?>
<?= $this->translate($oBtn->label) ?>
</a>
<?php
}
}
}
?>
Expand Down

0 comments on commit e4b220b

Please sign in to comment.