-
-
Notifications
You must be signed in to change notification settings - Fork 699
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,271 additions
and
668 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
lhc_web/design/defaulttheme/js/angular.lhc.startchatformgenerator.js
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,47 @@ | ||
lhcAppControllers.controller('StartChatFormCtrl',['$scope','$http','$location','$rootScope', '$log', function($scope, $http, $location, $rootScope, $log) { | ||
|
||
this.startchatfields = []; | ||
this.size = 6; | ||
this.fieldtype = 'text'; | ||
this.visibility = 'all'; | ||
|
||
var that = this; | ||
|
||
this.move = function(element, offset) { | ||
index = that.startchatfields.indexOf(element); | ||
newIndex = index + offset; | ||
if (newIndex > -1 && newIndex < that.startchatfields.length){ | ||
removedElement = that.startchatfields.splice(index, 1)[0]; | ||
that.startchatfields.splice(newIndex, 0, removedElement) | ||
} | ||
}; | ||
|
||
this.addField = function() { | ||
that.startchatfields.push({ | ||
'fieldname' : that.fieldname, | ||
'defaultvalue' : that.defaultvalue, | ||
'fieldtype' : that.fieldtype, | ||
'visibility' : that.visibility, | ||
'size' : that.size, | ||
'isrequired' : that.isrequired | ||
}); | ||
}; | ||
|
||
this.deleteField = function(field) { | ||
that.startchatfields.splice(that.startchatfields.indexOf(field),1); | ||
}; | ||
|
||
this.deleteField = function(field) { | ||
that.startchatfields.splice(that.startchatfields.indexOf(field),1); | ||
}; | ||
|
||
this.moveLeftField = function(field) { | ||
that.move(field,-1); | ||
} | ||
|
||
this.moveRightField = function(field) { | ||
that.move(field,1); | ||
} | ||
|
||
|
||
}]); |
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
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
17 changes: 17 additions & 0 deletions
17
lhc_web/design/defaulttheme/tpl/lhchat/part/admin_form_variables.tpl.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,17 @@ | ||
<?php if (isset($start_data_fields['custom_fields']) && $start_data_fields['custom_fields'] != '') : | ||
$customAdminfields = json_decode($start_data_fields['custom_fields'],true); | ||
if (is_array($customAdminfields)) : ?> | ||
<div class="row"> | ||
<?php foreach ($customAdminfields as $key => $adminField) : if ($adminField['visibility'] == 'all' || $adminCustomFieldsMode == $adminField['visibility']) : ?> | ||
<?php if ($adminField['fieldtype'] == 'hidden') : ?> | ||
<input class="form-control" type="hidden" name="value_items_admin[<?php echo $key?>]" value="<?php isset($input_data->value_items_admin[$key]) ? print htmlspecialchars($input_data->value_items_admin[$key]) : print htmlspecialchars($adminField['defaultvalue'])?>" /> | ||
<?php else : $hasExtraField = true; ?> | ||
<div class="col-xs-<?php echo htmlspecialchars($adminField['size'])?>"> | ||
<div class="form-group"> | ||
<label><?php echo htmlspecialchars($adminField['fieldname'])?> <?php $adminField['isrequired'] == 'true' ? print '*' : ''?></label> | ||
<input class="form-control" type="text" name="value_items_admin[<?php echo $key?>]" value="<?php isset($input_data->value_items_admin[$key]) ? print htmlspecialchars($input_data->value_items_admin[$key]) : print htmlspecialchars($adminField['defaultvalue'])?>" /> | ||
</div> | ||
</div> | ||
<?php endif; endif; endforeach;?> | ||
</div> | ||
<?php endif; endif;?> |
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
73 changes: 73 additions & 0 deletions
73
lhc_web/design/defaulttheme/tpl/lhchat/startchatformsettings/custom_fields.tpl.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,73 @@ | ||
<p><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Custom fields generator, these fields will be visible in start chat forms')?></p> | ||
|
||
<div ng-controller="StartChatFormCtrl as startChat" <?php if (isset($start_chat_data['custom_fields']) && $start_chat_data['custom_fields'] != '') : ?> ng-init='startChat.startchatfields = <?php echo $start_chat_data['custom_fields']?>'<?php endif;?>> | ||
|
||
<div class="row"> | ||
<div class="col-xs-3"> | ||
<div class="form-group"> | ||
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Field label')?></label> <input ng-model="startChat.fieldname" class="form-control" ng-model="" type="text" name="" value="" /> | ||
</div> | ||
</div> | ||
<div class="col-xs-3"> | ||
<div class="form-group"> | ||
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Default value')?></label> <input ng-model="startChat.defaultvalue" class="form-control" type="text" name="" value="" /> | ||
</div> | ||
</div> | ||
<div class="col-xs-3"> | ||
<div class="form-group"> | ||
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Type')?></label> <select ng-model="startChat.fieldtype" class="form-control"> | ||
<option value="text"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Text')?></option> | ||
<option value="hidden"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Hidden')?></option> | ||
</select> | ||
</div> | ||
</div> | ||
<div class="col-xs-3"> | ||
<div class="form-group"> | ||
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Visible on')?></label> <select ng-model="startChat.visibility" class="form-control"> | ||
<option value="all"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Offline and online form')?></option> | ||
<option value="off"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Only offline')?></option> | ||
<option value="on"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Only online')?></option> | ||
</select> | ||
</div> | ||
</div> | ||
<div class="col-xs-3"> | ||
<div class="form-group"> | ||
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Size (between 1 and 12)')?></label> <input ng-model="startChat.size" class="form-control" type="text" name="" value="6" /> | ||
</div> | ||
</div> | ||
<div class="col-xs-3"> | ||
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Is required')?> <input ng-model="startChat.isrequired" type="checkbox" name="isRequired" /></label> | ||
</div> | ||
|
||
<div class="col-xs-6"> | ||
<input type="button" class="btn btn-default col-xs-12" ng-click="startChat.addField()" value="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Add a field')?>" /> | ||
</div> | ||
</div> | ||
<hr> | ||
|
||
<div class="row"> | ||
<div ng-repeat="field in startChat.startchatfields" class="col-xs-{{field.size}}"> | ||
<div class="form-group"> | ||
<div class="btn-group pull-right" role="group" aria-label="..."> | ||
<button ng-if="$index > 0" type="button" class="btn btn-default btn-xs" ng-click="startChat.moveLeftField(field)">« <?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','left')?></button> | ||
<button ng-if="$index < startChat.startchatfields.length-1" type="button" class="btn btn-default btn-xs" ng-click="startChat.moveRightField(field)"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','right')?> »</button> | ||
</div> | ||
<label>{{field.fieldname}}{{field.isrequired ? '*' : ''}}</label> <input class="form-control" type="text" value="{{field.defaultvalue}}" readonly="readonly"> | ||
<ul class="list-unstyled pt10"> | ||
<li ng-if="field.visibility == 'off'"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Visible only in offline form')?></li> | ||
<li ng-if="field.visibility == 'on'"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Visible only in online form')?></li> | ||
<li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Size')?> - {{field.size}}</li> | ||
<li><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Type')?> - {{field.fieldtype}}</li> | ||
</ul> | ||
<button type="button" class="btn btn-danger btn-xs" ng-click="startChat.deleteField(field)"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchatformsettings','Remove')?></button> | ||
</div> | ||
<input type="hidden" name="customFieldLabel[]" value="{{field.fieldname}}" /> | ||
<input type="hidden" name="customFieldType[]" value="{{field.fieldtype}}" /> | ||
<input type="hidden" name="customFieldSize[]" value="{{field.size}}" /> | ||
<input type="hidden" name="customFieldVisibility[]" value="{{field.visibility}}" /> | ||
<input type="hidden" name="customFieldIsrequired[]" value="{{field.isrequired}}" /> | ||
<input type="hidden" name="customFieldDefaultValue[]" value="{{field.defaultvalue}}" /> | ||
</div> | ||
</div> | ||
|
||
</div> |
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
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
Oops, something went wrong.