<? global $vis_language;
$count=0;
if(isset($module['solutions']) && $module['solutions']==1 && VIS_MODULE_ACCESS_SELFHELP==1) $count++;
if(isset($module['drive']) && $module['drive']==1 && VIS_MODULE_ACCESS_SELFHELP==1) $count++;
if(isset($module['blabber']) && $module['blabber']==1 && VIS_MODULE_ACCESS_BLABBER==1) $count++;
if(isset($module['task']) && $module['task']==1 && VIS_MODULE_ACCESS_TASK==1) $count++;
if(isset($module['report']) && $module['report']==1 && VIS_MODULE_ACCESS_REPORT==1) $count++;
if(isset($module['billing']) && $module['billing']==1 && VIS_MODULE_ACCESS_BILLING==1) $count++;
if(isset($module['forums']) && $module['forums']==1 && VIS_MODULE_ACCESS_FORUMS==1) $count++;
if(VIS_ITIL==1 && (isset($module['itil']) && $module['itil']==1)) $count=$count+5;
if($livechat!=-1 && $livechat['is_enabled']==1) $count++;
if($livezilla!=-1 && $livezilla['is_enabled']==1) $count++;
if($userlike!=-1 && $userlike['is_enabled']==1) $count++;
if($comm100!=-1 && $comm100['is_enabled']==1) $count++;
if($gotosetting_details!=-1 && $gotosetting_details['is_enabled']==1) $count++;
if($assist_details!=-1 && $assist_details['is_enabled']==1) $count++;
if($teamviewer_details!=-1 && $teamviewer_details['is_enabled']==1) $count++;
if($webex_details!=-1 && $webex_details['is_enabled']==1) $count++;
if($twilio_details!=-1 && $twilio_details['is_enabled']==1) $count++;
if($clickdesk!=-1 && $clickdesk['is_enabled']==1) $count++;
if($zopim!=-1 && $zopim['is_enabled']==1) $count++;
if($exotel_details!=-1 && $exotel_details['is_enabled']==1) $count++; 
if($gcal_details!=-1 && $gcal_details['is_enabled']==1) $count++; 
if($crisp_details!=-1 && $crisp_details['is_enabled']==1) $count++; 
if($aircall_details!=-1 && $aircall_details['is_enabled']==1) $count++; 
if($asterisk_details!=-1 && $asterisk_details['is_enabled']==1) $count++; 
$classname=($count<=9)?'col-xs-4':'col-xs-3';
$classid=($count<=9)?3:4;
$enableddiv=0;

if($count>9) echo '<script>$("#vis_left_toolbar_section").removeClass("aside-lg").addClass("aside-xl");</script>';

echo '<div class="row row m-l-none m-r-none">';
if(isset($module['solutions']) && $module['solutions']==1 && VIS_MODULE_ACCESS_SELFHELP==1) { $enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v">
			<a href="#/selfhelp/view_selfhelp/<? echo $vis_language['TXTSELFHELP']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-self-help vh-red"></i> </span><small class="text-muted br_wd"><?= $vis_language['TXTSELFHELP'];?></small></a>
		</div>
	</div>
<? }
if(isset($module['blabber']) && $module['blabber']==1 && VIS_MODULE_ACCESS_BLABBER==1) {
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

	$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v">
			<a href="#/blabber/view_blabs/<? echo $vis_language['TXTBLABS']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-blab vh-blue"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTBLABS'];?></small> </a>
		</div>
	</div>
<? }
if(isset($module['task']) && $module['task']==1 && VIS_MODULE_ACCESS_TASK==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
<div class="<?= $classname; ?>">
		<div class="padder-v">
			<a href="#/home/view_tasks/<? echo $vis_language['TXTTASKS']; ?>/1" onclick="$('#vis_workpanel_div').visExecution('load_module', '<? echo $vis_language['TXTTASKS'].'/1'; ?>', {'vis_module':'home', 'vis_operation':'view_tasks' ,'vis_filter_id':1});"> <span class="m-b-xs block"> <i class="vh vh-2x vh-checkbox vh-info"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTTASKS'];?></small> </a>
		</div>
	</div><? } 
 
if(isset($module['report']) && $module['report']==1 && VIS_MODULE_ACCESS_REPORT==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/report/report_list/<? echo $vis_language['TXTREPORTS']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-report vh-brown"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTREPORTS'];?></small> </a> </div>
	</div>
<? }
if(isset($module['forums']) && $module['forums']==1 && VIS_MODULE_ACCESS_FORUMS==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/forums/view_forum/<? echo $vis_language['TXTFORUMS']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-staff-group vh-green"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTFORUMS'];?></small> </a> </div>
	</div>
<? }

if(isset($module['billing']) && $module['billing']==1 && VIS_MODULE_ACCESS_BILLING==1) { 

if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/billing/billing_menu/<? echo $vis_language['TXTBILLING']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-billing vh-green"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTBILLING'];?></small> </a> </div>
	</div>
<? }

if(VIS_ITIL==1 && (isset($module['itil']) && $module['itil']==1)){
	if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';	
	?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/cmdb/assets/<? echo $vis_language['TXTASSSETS']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-cmdb"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTCMDB'];?></small> </a> </div>
	</div><?  $enableddiv++; if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">'; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/cmdb/contract/<? echo $vis_language['TXTCONTRACT']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-contacts vh-blue"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTCONTRACT'];?></small> </a> </div>
	</div><?  $enableddiv++; if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">'; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/problem/filter_problem/<? echo $vis_language['TXTALL']; ?>/8"> <span class="m-b-xs block"> <i class="vh vh-2x vh-problem-management vh-red"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTPROBLEMS'];?></small> </a> </div>
	</div><?  $enableddiv++; if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">'; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/changes/filter_changes/<? echo $vis_language['TXTALL']; ?>/12"> <span class="m-b-xs block"> <i class="vh vh-2x vh-change-management vh-brown"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTCHANGES'];?></small> </a> </div>
	</div><?  $enableddiv++; if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">'; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/releases/filter_releases/<? echo $vis_language['TXTALL']; ?>/16"> <span class="m-b-xs block"> <i class="vh vh-2x vh-release-management vh-green"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTRELEASES'];?></small> </a> </div>
	</div><?  $enableddiv++; if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">'; ?>
<? }
if(isset($module['drive']) && $module['drive']==1 && VIS_MODULE_ACCESS_SELFHELP==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v">
			<a href="#/selfhelp/view_drive/<? echo "Drive"; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-my-drive"></i> </span><small class="text-muted br_wd"><?=$vis_language['TXTDRIVE']; ?></small></a>
		</div>
	</div>
<? }

if($livezilla!=-1 && $livezilla['is_enabled']==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/chat/livezilla_chat/<? echo $vis_language['TXTLIVEZILLA']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-livezilla vh-livezilla-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTLIVEZILLA'];?></small> </a> </div>
	</div>
<? }
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
if($userlike!=-1 && $userlike['is_enabled']==1) { $enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/chat/userlike_list/<? echo $vis_language['TXTUSERLIKE']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-userlike vh-userlike-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTUSERLIKE'];?></small> </a> </div>
	</div>
<? }
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
if($comm100!=-1 && $comm100['is_enabled']==1) { $enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/chat/comm100_list/<? echo $vis_language['TXTCOMMCHAT']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-comm100 vh-comm100-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTCOMMCHAT'];?></small> </a> </div>
	</div>
<? }
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
if($livechat!=-1 && $livechat['is_enabled']==1) { $enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/chat/livechat_list/<? echo $vis_language['TXTLIVECHAT']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-livechat-inc vh-livechat-inc-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTLIVECHAT'];?></small> </a> </div>
	</div>
<? }
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
if($clickdesk!=-1 && $clickdesk['is_enabled']==1) { $enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/chat/clickdesk_chat/<? echo $vis_language['TXTCLICKDESK']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-clickdesk vh-clickdesk-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTCLICKDESK'];?></small> </a> </div>
	</div>
<? } 
if($zopim!=-1 && $zopim['is_enabled']==1) { if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/chat/zopim_chat/<? echo $vis_language['TXTZOPIM']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-zopim vh-zopim-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTZOPIM'];?></small> </a> </div>
	</div>
<? }

if($gotosetting_details!=-1 && $gotosetting_details['is_enabled']==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/remoteaccess/gotomeeting/<? echo $vis_language['TXTGOTOMEETINGS']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-gotomeeting vh-gotomeeting-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTGOTOMEETINGS'];?></small> </a> </div>
	</div>
<? }

if($assist_details!=-1 && $assist_details['is_enabled']==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/remoteaccess/gotoassist/<? echo $vis_language['TXTGOTOASSIST']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-gotoassist vh-gotoassist-color"></i> </span> <small class="text-muted  br_wd"><?= $vis_language['TXTGOTOASSIST'];?></small> </a> </div>
	</div>
<? }

if($teamviewer_details!=-1 && $teamviewer_details['is_enabled']==1) {

if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
	$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/remoteaccess/teamviewer_list/<? echo $vis_language['TXTTEAMVIEWER']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-teamviewer vh-teamviewer-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTTEAMVIEWER'];?></small> </a> </div>
	</div>
<? }

if($webex_details!=-1 && $webex_details['is_enabled']==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/remoteaccess/webex/<? echo $vis_language['TXTWEBEX']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-circle vh-green"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTWEBEX'];?></small> </a> </div>
	</div>
<?php }

if($twilio_details!=-1 && $twilio_details['is_enabled']==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/voip/twilio_call/<? echo $vis_language['TXTTWILIO']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-twilio vh-twilio-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTTWILIO'];?></small> </a> </div>
	</div>
<?php }


if($exotel_details!=-1 && $exotel_details['is_enabled']==1) { 

if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/voip/exotel_call/<? echo $vis_language['TXTEXOTEL']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-exotel vh-exotel-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTEXOTEL'];?></small> </a> </div>
	</div>
<?php }

if($gcal_details!=-1 && $gcal_details['is_enabled']==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++; ?>
	<div class="<?= $classname; ?>">
<? if(isset($authUrl))
{
 $url=$authUrl;
}else
{$url='#/home/get_gcal_event_list/'.$vis_language['TXTEVENTS'];}?>
  <div class="padder-v"> <a href="<? echo $url."&state=1";?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-google vh-google-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTGOOGLEAPP'];?></small> </a> 
  </div>
</div>
<?php }
 
if($crisp_details!=-1 && $crisp_details['is_enabled']==1) { 
if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';

$enableddiv++;  ?>
	<div class="<?= $classname; ?>">
		 
		<div class="padder-v"> <a href="#/chat/crisp_chat/<? echo $vis_language['TXTCRISPAPP']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-crisp vh-crisp-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTCRISPAPP'];?></small> </a> </div>
	</div>
<?php }

if($aircall_details!=-1 && $aircall_details['is_enabled']==1) { 

if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/voip/aircall_call/<? echo $vis_language['TXTAIRCALL']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-aircall vh-aircall-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTAIRCALL'];?></small> </a> </div>
	</div>
<?php }
if($asterisk_details!=-1 && $asterisk_details['is_enabled']==1) { 

if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
$enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/voip/asterisk_call/<? echo $vis_language['TXTASTERISK']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-asterisk vh-asterisk-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTASTERISK'];?></small> </a> </div>
	</div>
<?php }
/*if(($enableddiv%$classid)==0) echo '</div><div class="row row m-l-none m-r-none">';
if($magento_details!=-1) { $enableddiv++; ?>
	<div class="<?= $classname; ?>">
		<div class="padder-v"> <a href="#/client/magento/<? echo $vis_language['TXTMAGENTO']; ?>"> <span class="m-b-xs block"> <i class="vh vh-2x vh-magento vh-magento-color"></i> </span> <small class="text-muted br_wd"><?= $vis_language['TXTMAGENTO'];?></small> </a> </div>
	</div>
<? }*/  ?> </div>
<script language="javascript">
	$( "#vis_left_toolbar_div a" ).bind( "click", function() {
		$( "#vis_left_toolbar_div" ).parent().parent().removeClass('open');
	});
</script>
