Customer portal : Added support for demo mode

SVN:trunk[4160]
This commit is contained in:
Guillaume Lajarige
2016-05-30 09:00:02 +00:00
parent f640558349
commit 026edb523c
2 changed files with 11 additions and 2 deletions

View File

@@ -89,7 +89,8 @@ class UserProfileBrickController extends BrickController
$sCurContactId = $oCurContact->GetKey();
// Setting form mode regarding the demo mode parameter
$sFormMode = (MetaModel::GetConfig()->Get('demo_mode')) ? ObjectController::ENUM_MODE_VIEW : ObjectController::ENUM_MODE_EDIT;
$bDemoMode = MetaModel::GetConfig()->Get('demo_mode');
$sFormMode = ($bDemoMode) ? ObjectController::ENUM_MODE_VIEW : ObjectController::ENUM_MODE_EDIT;
// Preparing forms
$aData['forms']['contact'] = ObjectController::HandleForm($oRequest, $oApp, $sFormMode, $sCurContactClass, $sCurContactId, $oBrick->GetForm());
@@ -99,7 +100,8 @@ class UserProfileBrickController extends BrickController
$aData = $aData + array(
'oBrick' => $oBrick,
'sFormMode' => $sFormMode
'sFormMode' => $sFormMode,
'bDemoMode' => $bDemoMode
);
$oResponse = $oApp['twig']->render($oBrick->GetPageTemplatePath(), $aData);

View File

@@ -11,6 +11,13 @@
{% endblock %}
{% block pMainContentHolder%}
{% if bDemoMode %}
<div class="alert alert-warning">
<span class="fa fa-info fa-2x" style="margin-right: 10px; vertical-align: sub;"></span>
User profile edition is not available in demo mode.
</div>
{% endif %}
<div id="user-profile-wrapper">
<div class="row">
<div class="col-sm-6">