Skip to content

Commit

Permalink
Devil is in details, fix #536
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Jul 8, 2015
1 parent 1ec0e1c commit fdf4957
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 52 deletions.
17 changes: 9 additions & 8 deletions lhc_web/design/defaulttheme/tpl/lhchat/chatwidget.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
<?php if (in_array('username', $input_data->hattr)) : ?>
<input type="hidden" name="Username" value="<?php echo htmlspecialchars($input_data->username);?>" />
<?php else : ?>
<div class="col-xs-6 form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Name');?><?php if (isset($start_data_fields['name_require_option']) && $start_data_fields['name_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="col-xs-6 form-group<?php if (isset($errors['nick'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Name');?><?php if (isset($start_data_fields['name_require_option']) && $start_data_fields['name_require_option'] == 'required') : ?>*<?php endif;?></label>
<input type="text" class="form-control" name="Username" value="<?php echo htmlspecialchars($input_data->username);?>" />
</div>
<?php endif; ?>
Expand All @@ -60,8 +60,8 @@
<?php if (in_array('email', $input_data->hattr)) : ?>
<input type="hidden" name="Email" value="<?php echo htmlspecialchars($input_data->email);?>" />
<?php else : ?>
<div class="col-xs-6 form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','E-mail');?><?php if (isset($start_data_fields['email_require_option']) && $start_data_fields['email_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="col-xs-6 form-group<?php if (isset($errors['email'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','E-mail');?><?php if (isset($start_data_fields['email_require_option']) && $start_data_fields['email_require_option'] == 'required') : ?>*<?php endif;?></label>
<input class="form-control" type="text" name="Email" value="<?php echo htmlspecialchars($input_data->email);?>" />
</div>
<?php endif; ?>
Expand All @@ -78,8 +78,8 @@
<?php if (in_array('phone', $input_data->hattr)) : ?>
<input type="hidden" name="Phone" value="<?php echo htmlspecialchars($input_data->phone);?>" />
<?php else : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Phone');?><?php if (isset($start_data_fields['phone_require_option']) && $start_data_fields['phone_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="form-group<?php if (isset($errors['phone'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Phone');?><?php if (isset($start_data_fields['phone_require_option']) && $start_data_fields['phone_require_option'] == 'required') : ?>*<?php endif;?></label>
<input class="form-control" type="text" name="Phone" value="<?php echo htmlspecialchars($input_data->phone);?>" />
</div>
<?php endif; ?>
Expand All @@ -95,9 +95,10 @@
<?php if (isset($start_data_fields['message_hidden']) && $start_data_fields['message_hidden'] == true) : $hasExtraField = true; ?>
<textarea class="hide" placeholder="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Enter your message');?>" name="Question"><?php echo htmlspecialchars($input_data->question);?></textarea>
<?php else : ?>
<?php if (!isset($start_data_fields['hide_message_label']) || $start_data_fields['hide_message_label'] == false) : ?>
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Your question');?><?php if (isset($start_data_fields['message_require_option']) && $start_data_fields['message_require_option'] == 'required') : ?>*<?php endif;?></label><?php endif;?>
<div class="<?php if (isset($errors['question'])) : ?> has-error<?php endif;?>">
<?php if (!isset($start_data_fields['hide_message_label']) || $start_data_fields['hide_message_label'] == false) : ?><label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Your question');?><?php if (isset($start_data_fields['message_require_option']) && $start_data_fields['message_require_option'] == 'required') : ?>*<?php endif;?></label><?php endif;?>
<textarea class="form-control form-group <?php if ($hasExtraField !== true && $canReopen !== true) : ?>btrad-reset<?php endif;?>" <?php if (isset($start_data_fields['user_msg_height']) && $start_data_fields['user_msg_height'] > 0) : ?>style="height: <?php echo $start_data_fields['user_msg_height']?>px"<?php endif;?> placeholder="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Please enter a message...');?>" id="id_Question" name="Question"><?php echo htmlspecialchars($input_data->question);?></textarea>
</div>
<?php endif; ?>
<?php else : $hasExtraField = true; endif; ?>

Expand Down
18 changes: 9 additions & 9 deletions lhc_web/design/defaulttheme/tpl/lhchat/offline_form.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
<?php if (isset($start_data_fields['offline_name_hidden']) && $start_data_fields['offline_name_hidden'] == true) : ?>
<input type="hidden" name="Username" value="<?php echo htmlspecialchars($input_data->username);?>" />
<?php else : ?>
<div class="col-xs-6 form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Name');?><?php if (isset($start_data_fields['offline_name_require_option']) && $start_data_fields['offline_name_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="col-xs-6 form-group<?php if (isset($errors['nick'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Name');?><?php if (isset($start_data_fields['offline_name_require_option']) && $start_data_fields['offline_name_require_option'] == 'required') : ?>*<?php endif;?></label>
<input class="form-control" type="text" name="Username" value="<?php echo htmlspecialchars($input_data->username);?>" />
</div>
<?php endif;?>
<?php endif;?>
<?php if (isset($start_data_fields['offline_email_hidden']) && $start_data_fields['offline_email_hidden'] == true) : ?>
<input type="hidden" name="Email" value="<?php echo htmlspecialchars($input_data->email);?>" />
<?php else : ?>
<div class="col-xs-6 form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','E-mail');?>*</label>
<div class="col-xs-6 form-group<?php if (isset($errors['email'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','E-mail');?>*</label>
<input class="form-control" type="text" name="Email" value="<?php echo htmlspecialchars($input_data->email);?>" />
</div>
<?php endif;?>
Expand All @@ -44,16 +44,16 @@
<?php if (isset($start_data_fields['offline_phone_hidden']) && $start_data_fields['offline_phone_hidden'] == true) : ?>
<input type="hidden" name="Phone" value="<?php echo htmlspecialchars($input_data->phone);?>" />
<?php else : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Phone');?><?php if (isset($start_data_fields['offline_phone_require_option']) && $start_data_fields['offline_phone_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="form-group<?php if (isset($errors['phone'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Phone');?><?php if (isset($start_data_fields['offline_phone_require_option']) && $start_data_fields['offline_phone_require_option'] == 'required') : ?>*<?php endif;?></label>
<input class="form-control" type="text" name="Phone" value="<?php echo htmlspecialchars($input_data->phone);?>" />
</div>
<?php endif; ?>
<?php endif; ?>

<?php if (isset($start_data_fields['offline_file_visible_in_page_widget']) && $start_data_fields['offline_file_visible_in_page_widget'] == true) : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','File');?></label>
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','File');?></label>
<input type="file" name="File" value="" />
</div>
<?php endif; ?>
Expand All @@ -62,8 +62,8 @@
<?php if (isset($start_data_fields['offline_message_hidden']) && $start_data_fields['offline_message_hidden'] == true) : ?>
<textarea class="hide" placeholder="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Enter your message');?>" name="Question"><?php echo htmlspecialchars($input_data->question);?></textarea>
<?php else : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Your question');?><?php if (isset($start_data_fields['offline_message_require_option']) && $start_data_fields['offline_message_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="form-group<?php if (isset($errors['question'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Your question');?><?php if (isset($start_data_fields['offline_message_require_option']) && $start_data_fields['offline_message_require_option'] == 'required') : ?>*<?php endif;?></label>
<textarea class="form-control" placeholder="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Enter your message');?>" name="Question"><?php echo htmlspecialchars($input_data->question);?></textarea>
</div>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<?php if (isset($start_data_fields['offline_name_hidden']) && $start_data_fields['offline_name_hidden'] == true) : ?>
<input type="hidden" name="Username" value="<?php echo htmlspecialchars($input_data->username);?>" />
<?php else : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Name');?><?php if (isset($start_data_fields['offline_name_require_option']) && $start_data_fields['offline_name_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="form-group<?php if (isset($errors['nick'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Name');?><?php if (isset($start_data_fields['offline_name_require_option']) && $start_data_fields['offline_name_require_option'] == 'required') : ?>*<?php endif;?></label>
<input class="form-control" type="text" name="Username" value="<?php echo htmlspecialchars($input_data->username);?>" />
</div>
<?php endif; ?>
Expand All @@ -21,8 +21,8 @@
<?php if (isset($start_data_fields['offline_email_hidden']) && $start_data_fields['offline_email_hidden'] == true) : ?>
<input type="hidden" name="Email" value="<?php echo htmlspecialchars($input_data->email);?>" />
<?php else : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','E-mail');?>*</label>
<div class="form-group<?php if (isset($errors['email'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','E-mail');?>*</label>
<input class="form-control" type="text" name="Email" value="<?php echo htmlspecialchars($input_data->email);?>" />
</div>
<?php endif;?>
Expand All @@ -31,16 +31,16 @@
<?php if (isset($start_data_fields['offline_phone_hidden']) && $start_data_fields['offline_phone_hidden'] == true) : ?>
<input type="hidden" name="Phone" value="<?php echo htmlspecialchars($input_data->phone);?>" />
<?php else : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Phone');?><?php if (isset($start_data_fields['offline_phone_require_option']) && $start_data_fields['offline_phone_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="form-group<?php if (isset($errors['phone'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Phone');?><?php if (isset($start_data_fields['offline_phone_require_option']) && $start_data_fields['offline_phone_require_option'] == 'required') : ?>*<?php endif;?></label>
<input class="form-control" type="text" name="Phone" value="<?php echo htmlspecialchars($input_data->phone);?>" />
</div>
<?php endif;?>
<?php endif; ?>

<?php if (isset($start_data_fields['offline_file_visible_in_popup']) && $start_data_fields['offline_file_visible_in_popup'] == true) : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','File');?></label>
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','File');?></label>
<input type="file" name="File" value="" />
</div>
<?php endif; ?>
Expand All @@ -49,8 +49,8 @@
<?php if (isset($start_data_fields['offline_message_hidden']) && $start_data_fields['offline_message_hidden'] == true) : ?>
<textarea class="hide" placeholder="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Enter your message');?>" name="Question"><?php echo htmlspecialchars($input_data->question);?></textarea>
<?php else : ?>
<div class="form-group">
<label><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Your question');?><?php if (isset($start_data_fields['offline_message_require_option']) && $start_data_fields['offline_message_require_option'] == 'required') : ?>*<?php endif;?></label>
<div class="form-group<?php if (isset($errors['question'])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Your question');?><?php if (isset($start_data_fields['offline_message_require_option']) && $start_data_fields['offline_message_require_option'] == 'required') : ?>*<?php endif;?></label>
<textarea class="form-control" placeholder="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','Enter your message');?>" name="Question"><?php echo htmlspecialchars($input_data->question);?></textarea>
</div>
<?php endif;?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
</ul>
</div>


<div class="page-url"><span><a target="_blank" href="{{ou.current_page}}" title="{{ou.current_page}}">{{ou.page_title || ou.current_page}}</a></span></div></td>
<td><div class="page-url"><span><a target="_blank" href="http:{{ou.referrer}}">{{ou.referrer}}</a></span></div></td>
<td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php if (isset($start_data_fields[$tosVariable]) && $start_data_fields[$tosVariable] == true) : $hasExtraField = true;?>
<div class="form-group">
<label><input type="checkbox" <?php echo $input_data->accept_tos == true || ((!isset($_POST) || empty($_POST)) && isset($start_data_fields[$tosCheckedVariable]) && $start_data_fields[$tosCheckedVariable] == true) ? 'checked="checked"' : '';?> name="AcceptTOS" value="on">&nbsp;<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','I accept my personal data will be handled according to');?>&nbsp;<a target="_blank" href="<?php echo erLhcoreClassModelChatConfig::fetch('accept_tos_link')->current_value?>"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','our terms and to the Law');?></a></label>
<div class="form-group<?php if (isset($errors['accept_tos'])) : ?> has-error<?php endif;?>">
<label class="control-label"><input type="checkbox" <?php echo $input_data->accept_tos == true || ((!isset($_POST) || empty($_POST)) && isset($start_data_fields[$tosCheckedVariable]) && $start_data_fields[$tosCheckedVariable] == true) ? 'checked="checked"' : '';?> name="AcceptTOS" value="on">&nbsp;<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','I accept my personal data will be handled according to');?>&nbsp;<a target="_blank" href="<?php echo erLhcoreClassModelChatConfig::fetch('accept_tos_link')->current_value?>"><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat','our terms and to the Law');?></a></label>
</div>
<?php endif; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<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'])?>&nbsp;<?php $adminField['isrequired'] == 'true' ? print '*' : ''?></label>
<div class="form-group<?php if (isset($errors['additional_admin_'.$key])) : ?> has-error<?php endif;?>">
<label class="control-label"><?php echo htmlspecialchars($adminField['fieldname'])?>&nbsp;<?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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
$showField = ($input_data->value_show[$key] == $modeUserVariables || $input_data->value_show[$key] == 'b');

$visibleItem = (isset($input_data->value_types[$key]) && $input_data->value_types[$key] == 'text' && isset($input_data->name_items[$key])); ?>

<?php if ($visibleItem == true && $showField == true) : ?>
<div class="form-group col-xs-<?php isset($input_data->value_sizes[$key]) ? print (int)$input_data->value_sizes[$key] : print 6?>"><label><?php echo htmlspecialchars($input_data->name_items[$key])?><?php isset($input_data->values_req[$key]) && $input_data->values_req[$key] == 't' ? print '*' : ''?></label>
<div class="form-group col-xs-<?php isset($input_data->value_sizes[$key]) ? print (int)$input_data->value_sizes[$key] : print 6?><?php if (isset($errors['additional_'.$key])) : ?> has-error<?php endif;?>"><label class="control-label"><?php echo htmlspecialchars($input_data->name_items[$key])?><?php isset($input_data->values_req[$key]) && $input_data->values_req[$key] == 't' ? print '*' : ''?></label>
<?php endif;?>


<input class="form-control" type="<?php isset($input_data->value_types[$key]) && $showField == true ? print htmlspecialchars($input_data->value_types[$key]) : print 'hidden' ?>" name="value_items[]" value="<?php echo htmlspecialchars($item)?>" />


Expand Down
Loading

0 comments on commit fdf4957

Please sign in to comment.