Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2015-10-07 12:39:18

thousandsins
Member
Registered: 2015-09-14
Posts: 15

Index.tpl.php HELP

Hi, I'm trying to change the view of Index.tpl.php. I changed all elements of "sortable-column-dashboard" into something new. Dragging the panels/portlets is working fine but when I refresh the page the position is not right as it is. I just notice that the panels/portlets position doesn't get current value in how I positioned it. Maybe when I drag them into different position, it doesn't "save" the value of position. Can you help me with my code? Do I miss something?

index.tpl.php

[== PHP ==]
<?php
$departmentNames = array();
$departmentList = array();
$departments = erLhcoreClassModelDepartament::getList($departmentParams);

foreach ($departments as $department) {
    $departmentNames[$department->id] = $department->name;
    $departmentList[] = array(
        'id' => $department->id,
        'name' => $department->name
    );
}

$dashboardOrder = (string)erLhcoreClassModelUserSetting::getSetting('dwo','');

if ($dashboardOrder == '') {
    $dashboardOrder = erLhcoreClassModelChatConfig::fetch('dashboard_order')->current_value;
}

$dashboardOrder = explode('|',$dashboardOrder);

$columnsTotal = count($dashboardOrder);
$columnSize = 12 / $columnsTotal;

?>
<div class="row" id="sortable_portlets" ng-init='lhc.userDepartments=<?php echo json_encode($departmentList,JSON_HEX_APOS)?>;lhc.userDepartmentsNames=<?php echo json_encode($departmentNames,JSON_HEX_APOS)?>;lhc.setUpListNames(["actived","closedd","unreadd","pendingd","operatord","departmentd"])'>
     <a class="dashboard-configuration" onclick="return lhc.revealModal({'url':WWW_DIR_JAVASCRIPT +'chat/dashboardwidgets'})" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface','Configure dashboard')?>"><i class="material-icons mr-0">&#xE871;</i></a>
     <?php for ($i = 0; $i < $columnsTotal; $i++) : $widgets = array_filter(explode(',', $dashboardOrder[$i])); ?>
        <div class="col-md-<?php echo $columnSize+2?> col-lg-<?php echo $columnSize?> column sortable">
            <?php foreach ($widgets as $wiget) : ?>
                <?php if ($wiget == 'online_operators') : ?>
                 
                     <?php if ($canListOnlineUsers == true || $canListOnlineUsersAll == true) : ?>
                        <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/online_operators.tpl.php'));?>
                     <?php endif;?>
                 
                <?php elseif ($wiget == 'active_chats') : ?>
                
                     <?php if ($activeTabEnabled == true && $online_chat_enabled_pre == true) : ?>
                        <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/active_chats.tpl.php'));?>
                     <?php endif;?>
                     
                <?php elseif ($wiget == 'online_visitors') : ?>
                
                     <?php if ($online_visitors_enabled_pre == true) : ?>
                        <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/online_visitors.tpl.php'));?>
                     <?php endif;?>
                    
                <?php elseif ($wiget == 'departments_stats') : ?>
                
                    <?php if ($online_chat_enabled_pre == true) : ?>
                        <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/departments_stats.tpl.php'));?>
                    <?php endif;?>
                    
                <?php elseif ($wiget == 'pending_chats') : ?>
                
                    <?php if ($pendingTabEnabled == true && $online_chat_enabled_pre == true) : ?>
                        <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/pending_chats.tpl.php'));?>
                    <?php endif;?>
                    
                <?php elseif ($wiget == 'unread_chats') : ?>
                
                    <?php if ($unreadTabEnabled == true && $online_chat_enabled_pre == true) : ?>
                        <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/unread_chats.tpl.php'));?>
                    <?php endif;?>
                    
                <?php elseif ($wiget == 'transfered_chats') : ?>
                
                    <?php include(erLhcoreClassDesign::designtpl('lhchat/lists_panels/transfer_panel_container_pre.tpl.php'));?>
            
                    <?php if ($transfer_panel_container_pre_enabled == true) : ?>
                            <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/transfered_chats.tpl.php'));?>
                    <?php endif;?>
                    
                <?php elseif ($wiget == 'closed_chats') : ?>
                
                    <?php if ($online_chat_enabled_pre == true && $closedTabEnabled == true) : ?>                
                        <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/closed_chats.tpl.php'));?>
                    <?php endif;?>
                <?php else : ?>
                    <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/extension_panel_multiinclude.tpl.php'));?>
                <?php endif;?>
            <?php endforeach;?>
            
            <?php if (empty($widgets)) : ?>
            &nbsp;
            <?php endif;?>
					<!-- empty sortable porlet required for each columns! -->
					<div class="portlet portlet-sortable-empty">
					</div>
        </div>
     <?php endfor;?>
</div>
<?php $popoverInitialized = true; ?>

panels/*

[== PHP ==]
<div class="portlet portlet-sortable box dashboard-portlet" data-panel-id="active_chats">
	<div class="portlet-title">
		<div class="caption">
		<i class="icon-speech cht-active"></i> <?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/titles/active_chats.tpl.php'));?> ({{active_chats.list.length}}{{active_chats.list.length == lhc.limita ? '+' : ''}})
		</div>
		<div class="actions">
			<a class="btn btn-primary btn-sm" target="_blank" href="<?php echo erLhcoreClassDesign::baseurl('chat/activechats')?>" title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout','Active Chats');?>"><i class="fa fa-external-link"></i></a>
		</div>
	</div>
	<div class="portlet-body">
	    <?php $optinsPanel = array('panelid' => 'actived','limitid' => 'limita'); ?>
		<?php include(erLhcoreClassDesign::designtpl('lhfront/dashboard/panels/parts/options.tpl.php'));?>
		
		<div ng-if="active_chats.list.length > 0" class="panel-list">
			<table class="table table-condensed mb0 table-small table-fixed table-striped table-hover">
				<thead>
					<tr>
						<th width="60%"><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface','Visitor');?>" class="material-icons">face</i></th>
						<th width="20%"><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface','Operator');?>" class="glyphicon glyphicon-user"></i></th>
						<th width="20%"><i title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface','Department');?>" class="glyphicon glyphicon-home"></i></th>
					</tr>
				</thead>
				<tr ng-repeat="chat in active_chats.list track by chat.id" ng-class="{'user-away-row': chat.user_status_front == 2, 'user-online-row': chat.user_status_front == 0}">
					<td>
					    
						<div data-toggle="popover" data-placement="top" data-chat-id="{{chat.id}}" class="abbr-list"><span ng-if="chat.country_code != undefined"><img ng-src="<?php echo erLhcoreClassDesign::design('images/flags');?>/{{chat.country_code}}.png" alt="{{chat.country_name}}" title="{{chat.country_name}}" />&nbsp;</span><a title="<?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface','Open in a new window');?>" class="material-icons" ng-click="lhc.startChatNewWindow(chat.id,chat.nick)">open_in_new</a><a ng-click="lhc.previewChat(chat.id)" class="material-icons">info_outline</a> <a ng-click="lhc.startChat(chat.id,chat.nick)" title="{{chat.nick}}"> {{chat.nick}} </a></div>
												
						<div id="popover-title-{{chat.id}}" class="hide">
						  {{chat.nick}} [{{chat.id}}]
						</div>
						
						<div id="popover-content-{{chat.id}}" class="hide">
						    <i class="material-icons">access_time</i>{{chat.time_created_front}}<br/>
							<i class="material-icons">account_box</i>{{chat.plain_user_name}}<br />
							<i class="material-icons">home</i>{{chat.department_name}}
						</div>
						
					</td>
					<td>
						<div class="abbr-list" title="{{chat.plain_user_name}}">{{chat.plain_user_name}}</div>
					</td>
					<td>
						<div class="abbr-list" title="{{chat.department_name}}">{{chat.department_name}}</div>
					</td>
				</tr>
			</table>
		</div>
		
		<div ng-if="active_chats.list.length == 0" class="m10 alert alert-info"><i class="material-icons">search</i><?php echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface','Nothing found')?>...</div>
		
	</div>
</div>

Offline

#2 2015-10-09 11:36:53

PeopleInside
Administrator
From: Italy
Registered: 2014-04-10
Posts: 4,046
Website

Re: Index.tpl.php HELP

Hi,
thank you for your message!

Seems your request is a customization of LHC.
For this i think there is commercial support
https://livehelperchat.com/support-13c.html

So if you not receive help you have to consider the commercial support.

Why are you editing this file?


lol PeopleInside - Live helper chat - free limited forum support!
wink For commercial support or GitHub [see FAQ here]
ops If you want to support this open source project, just donate [see support page]
glasses Something wrong with the forum? [contact a superhero]

Offline

Board footer