2016-03-25 23:29:20 +01:00
< ? php
//get the browser version
$user_agent = http_user_agent ();
$browser_version = $user_agent [ 'version' ];
$browser_name = $user_agent [ 'name' ];
2016-06-09 01:32:08 +02:00
$browser_version_array = explode ( '.' , $browser_version );
2016-03-25 23:29:20 +01:00
//set the doctype
echo ( $browser_name != " Internet Explorer " ) ? " <!DOCTYPE html> \n " : " <!DOCTYPE html PUBLIC \" -//W3C//DTD XHTML 1.0 Transitional//EN \" \" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd \" > \n " ;
//get the php self path and set a variable with only the directory path
$php_self_array = explode ( " / " , $_SERVER [ 'PHP_SELF' ]);
$php_self_dir = '' ;
foreach ( $php_self_array as & $value ) {
if ( substr ( $value , - 4 ) != " .php " ) {
$php_self_dir .= $value . " / " ;
}
}
unset ( $php_self_array );
if ( strlen ( PROJECT_PATH ) > 0 ) {
$php_self_dir = substr ( $php_self_dir , strlen ( PROJECT_PATH ), strlen ( $php_self_dir ));
}
2016-05-04 20:55:56 +02:00
?>
< html xmlns = " http://www.w3.org/1999/xhtml " xml : lang = " en " lang = " en " >
< head >
< meta charset = " utf-8 " >
< meta http - equiv = " Content-Type " content = " text/html; charset=UTF-8 " >
< meta http - equiv = " X-UA-Compatible " content = " IE=edge " >
< meta name = " viewport " content = " width=device-width, initial-scale=1 " >
2016-03-25 23:29:20 +01:00
2016-05-04 20:55:56 +02:00
< link rel = " stylesheet " type = " text/css " href = " <!-- { project_path}-->/resources/bootstrap/css/bootstrap.min.css " >
< link rel = " stylesheet " type = " text/css " href = " <!-- { project_path}-->/resources/bootstrap/css/bootstrap-datetimepicker.min.css " />
< link rel = " stylesheet " type = " text/css " href = " <!-- { project_path}-->/resources/bootstrap/css/bootstrap-colorpicker.min.css " >
< link rel = " stylesheet " type = " text/css " href = " <!-- { project_path}-->/themes/<?php echo $_SESSION['domain'] ['template']['name']; ?>/css.php<?php echo ( $default_login ) ? '?login=default' : null; ?> " >
< ? php
//load custom css
if ( $_SESSION [ 'theme' ][ 'custom_css' ][ 'text' ] != '' ) {
echo " <link rel='stylesheet' type='text/css' href=' " . $_SESSION [ 'theme' ][ 'custom_css' ][ 'text' ] . " '> \n \n " ;
}
2016-03-25 23:29:20 +01:00
//set fav icon
2016-05-04 20:55:56 +02:00
$favicon = ( isset ( $_SESSION [ 'theme' ][ 'favicon' ][ 'text' ])) ? $_SESSION [ 'theme' ][ 'favicon' ][ 'text' ] : '<!--{project_path}-->/themes/default/favicon.ico' ;
2016-03-25 23:29:20 +01:00
echo " <link rel='icon' href=' " . $favicon . " '> \n " ;
?>
2016-05-04 20:55:56 +02:00
< title ><!-- { title } --></ title >
2016-03-25 23:29:20 +01:00
2016-05-04 20:55:56 +02:00
< script language = " JavaScript " type = " text/javascript " src = " <!-- { project_path}-->/resources/jquery/jquery-1.11.1.js " ></ script >
< script language = " JavaScript " type = " text/javascript " src = " <!-- { project_path}-->/resources/jquery/jquery.autosize.input.js " ></ script >
< script language = " JavaScript " type = " text/javascript " src = " <!-- { project_path}-->/resources/momentjs/moment.js " ></ script >
< script language = " JavaScript " type = " text/javascript " src = " <!-- { project_path}-->/resources/bootstrap/js/bootstrap.min.js " ></ script >
< script language = " JavaScript " type = " text/javascript " src = " <!-- { project_path}-->/resources/bootstrap/js/bootstrap-datetimepicker.min.js " ></ script >
< script language = " JavaScript " type = " text/javascript " src = " <!-- { project_path}-->/resources/bootstrap/js/bootstrap-colorpicker.js " ></ script >
2016-06-03 02:26:32 +02:00
< script language = " JavaScript " type = " text/javascript " src = " <!-- { project_path}-->/resources/bootstrap/js/bootstrap-pwstrength.min.js " ></ script >
2016-05-05 20:57:08 +02:00
< ? php
//web font loader
if ( $_SESSION [ 'theme' ][ 'font_loader' ][ 'text' ] == 'true' ) {
if ( $_SESSION [ 'theme' ][ 'font_retrieval' ][ 'text' ] != 'asynchronous' ) {
$font_loader_version = ( $_SESSION [ 'theme' ][ 'font_loader_version' ][ 'text' ] != '' ) ? $_SESSION [ 'theme' ][ 'font_loader_version' ][ 'text' ] : 1 ;
echo " <script language='JavaScript' type='text/javascript' src='//ajax.googleapis.com/ajax/libs/webfont/ " . $font_loader_version . " /webfont.js'></script> \n " ;
}
echo " <script language='JavaScript' type='text/javascript' src='<!-- { project_path}-->/resources/fonts/web_font_loader.php?v= " . $font_loader_version . " '></script> \n " ;
}
?>
2016-03-25 23:29:20 +01:00
< script language = " JavaScript " type = " text/javascript " >
2016-04-07 22:48:12 +02:00
//display message bar via js
function display_message ( msg , mood , delay ) {
var mood = ( typeof mood !== 'undefined' ) ? mood : 'default' ;
var delay = ( typeof delay !== 'undefined' ) ? delay : < ? php echo ( 1000 * ( float ) $_SESSION [ 'theme' ][ 'message_delay' ][ 'text' ]); ?> ;
if ( msg != '' ) {
var inner_width = $ ( window ) . width ();
// add class by mood
$ ( " #message_container " ) . addClass ( 'message_container_mood_' + mood );
$ ( " #message_text " ) . addClass ( 'message_text_mood_' + mood );
// output message
$ ( " #message_text " ) . html ( msg );
$ ( " #message_container " ) . css ({ height : $ ( " #message_text " ) . css ( " height " )});
$ ( " #message_container " ) . css ({ width : inner_width });
$ ( " #message_text " ) . show () . animate ({ top : '+=80' }, 500 ) . animate ({ opacity : 1 }, 'fast' ) . delay ( delay ) . animate ({ top : '-=80' }, 1000 ) . animate ({ opacity : 0 });
$ ( " #message_container " ) . show () . animate ({ top : '+=80' }, 500 ) . animate ({ opacity : < ? php echo $_SESSION [ 'theme' ][ 'message_opacity' ][ 'text' ]; ?> }, "fast").delay(delay).animate({top: '-=80'}, 1000).animate({opacity: 0}, function() {
$ ( " #message_container " ) . removeClass ( 'message_container_mood_' + mood );
});
2016-03-25 23:29:20 +01:00
}
2016-04-07 22:48:12 +02:00
}
2016-03-25 23:29:20 +01:00
2016-04-07 22:48:12 +02:00
$ ( document ) . ready ( function () {
2016-03-25 23:29:20 +01:00
//set response message, if any
< ? php
if ( strlen ( $_SESSION [ 'message' ]) > 0 ) {
$message_text = addslashes ( $_SESSION [ 'message' ]);
$message_mood = $_SESSION [ 'message_mood' ];
$message_delay = $_SESSION [ 'message_delay' ];
echo " display_message(' " . $message_text . " ' " ;
echo ( $message_mood != '' ) ? " , ' " . $message_mood . " ' " : " , 'default' " ;
if ( $message_delay != '' ) {
echo " , ' " . $message_delay . " ' " ;
}
echo " ); " ;
unset ( $_SESSION [ 'message' ], $_SESSION [ 'message_mood' ], $_SESSION [ 'message_delay' ]);
}
?>
//hide message bar on hover
$ ( " #message_text " ) . mouseover ( function () { $ ( this ) . hide (); $ ( " #message_container " ) . hide (); });
2016-04-01 01:11:37 +02:00
< ? php
if ( permission_exists ( " domain_select " ) && count ( $_SESSION [ 'domains' ]) > 1 ) {
?>
//domain selector controls
$ ( " .domain_selector_domain " ) . click ( function () { show_domains (); });
$ ( " #domains_hide " ) . click ( function () { hide_domains (); });
2016-03-25 23:29:20 +01:00
2016-04-01 01:11:37 +02:00
function show_domains () {
2016-04-07 21:01:21 +02:00
$ ( '#domains_visible' ) . val ( 1 );
2016-04-01 01:11:37 +02:00
var scrollbar_width = ( window . innerWidth - $ ( window ) . width ()); //gold: only solution that worked with body { overflow:auto } (add -ms-overflow-style: scrollbar; to <body> style for ie 10+)
if ( scrollbar_width > 0 ) {
$ ( " body " ) . css ({ 'margin-right' : scrollbar_width , 'overflow' : 'hidden' }); //disable body scroll bars
$ ( " .navbar " ) . css ( 'margin-right' , scrollbar_width ); //adjust navbar margin to compensate
$ ( " #domains_container " ) . css ( 'right' , - scrollbar_width ); //domain container right position to compensate
}
2016-04-07 21:01:21 +02:00
$ ( document ) . scrollTop ( 0 );
2016-04-06 02:37:46 +02:00
$ ( " #domains_container " ) . show ();
2016-04-07 21:01:21 +02:00
$ ( " #domains_block " ) . animate ({ marginRight : '+=300' }, 400 , function () {
$ ( " #domain_filter " ) . focus ();
});
2016-03-25 23:29:20 +01:00
}
2016-04-01 01:11:37 +02:00
function hide_domains () {
2016-04-07 21:01:21 +02:00
$ ( '#domains_visible' ) . val ( 0 );
2016-04-01 01:11:37 +02:00
$ ( document ) . ready ( function () {
$ ( " #domains_block " ) . animate ({ marginRight : '-=300' }, 400 , function () {
$ ( " #domain_filter " ) . val ( '' );
domain_search ( $ ( " #domain_filter " ) . val ());
$ ( " .navbar " ) . css ( 'margin-right' , '0' ); //restore navbar margin
$ ( " #domains_container " ) . css ( 'right' , '0' ); //domain container right position
$ ( " #domains_container " ) . hide ();
$ ( " body " ) . css ({ 'margin-right' : '0' , 'overflow' : 'auto' }); //enable body scroll bars
});
2016-03-25 23:29:20 +01:00
});
}
2016-04-01 01:11:37 +02:00
< ? php
2016-04-07 21:01:21 +02:00
key_press ( 'escape' , 'up' , 'document' , null , null , " if ( $ ('#domains_visible').val() == 0) { show_domains(); } else { hide_domains(); } " , false );
2016-04-01 01:11:37 +02:00
}
?>
2016-03-25 23:29:20 +01:00
//link table rows (except the last - the list_control_icons cell) on a table with a class of 'tr_hover', according to the href attribute of the <tr> tag
$ ( '.tr_hover tr' ) . each ( function ( i , e ) {
$ ( e ) . children ( 'td:not(.list_control_icon,.list_control_icons,.tr_link_void)' ) . click ( function () {
var href = $ ( this ) . closest ( " tr " ) . attr ( " href " );
if ( href ) { window . location = href ; }
});
});
//apply the auto-size jquery script to all text inputs
2016-05-17 21:44:42 +02:00
$ ( " input[type=text].txt,input[type=number].txt,input[type=password].txt,input[type=text].formfld,input[type=number].formfld,input[type=password].formfld " ) . not ( '.datetimepicker,.datepicker' ) . autosizeInput ();
2016-03-25 23:29:20 +01:00
//apply bootstrap-datetime plugin
$ ( function () {
$ ( '.datetimepicker' ) . datetimepicker ({
2016-04-13 21:23:07 +02:00
format : 'YYYY-MM-DD HH:mm' ,
showTodayButton : true ,
showClear : true ,
showClose : true ,
2016-03-25 23:29:20 +01:00
});
2016-05-17 21:44:42 +02:00
$ ( '.datepicker' ) . datetimepicker ({
format : 'YYYY-MM-DD' ,
showTodayButton : true ,
showClear : true ,
showClose : true ,
});
2016-03-25 23:29:20 +01:00
});
//apply bootstrap-colorpicker plugin
$ ( function (){
$ ( '.colorpicker' ) . colorpicker ({
align : 'left' ,
customClass : 'colorpicker-2x' ,
sliders : {
saturation : {
maxLeft : 200 ,
maxTop : 200
},
hue : {
maxTop : 200
},
alpha : {
maxTop : 200
}
}
});
});
2016-06-03 02:26:32 +02:00
//apply password strength plugin
$ ( '#password' ) . pwstrength ({
common : {
minChar : 8 ,
usernameField : '#username' ,
},
/* rules: { }, */
ui : {
// very weak weak normal medium strong very strong
colorClasses : [ " danger " , " warning " , " warning " , " warning " , " success " , " success " ],
progressBarMinPercentage : 15 ,
showVerdicts : false ,
viewports : {
progress : " #pwstrength_progress "
}
}
});
2016-05-21 03:08:10 +02:00
< ? php if ( $_SESSION [ 'theme' ][ 'menu_brand_image' ][ 'text' ] != '' && $_SESSION [ 'theme' ][ 'menu_brand_image_hover' ][ 'text' ] != '' ) { ?>
//crossfade menu brand images (if hover version set)
$ ( function (){
$ ( '#menu_brand_image' ) . mouseover ( function (){
$ ( this ) . fadeOut ( 'fast' , function (){
$ ( '#menu_brand_image_hover' ) . fadeIn ( 'fast' );
});
});
$ ( '#menu_brand_image_hover' ) . mouseout ( function (){
$ ( this ) . fadeOut ( 'fast' , function (){
$ ( '#menu_brand_image' ) . fadeIn ( 'fast' );
});
});
});
< ? php } ?>
2016-03-25 23:29:20 +01:00
});
2016-03-28 17:09:33 +02:00
//audio playback functions
var recording_audio ;
function recording_play ( recording_id ) {
if ( document . getElementById ( 'recording_progress_bar_' + recording_id )) {
document . getElementById ( 'recording_progress_bar_' + recording_id ) . style . display = '' ;
}
recording_audio = document . getElementById ( 'recording_audio_' + recording_id )
if ( recording_audio . paused ) {
recording_audio . volume = 1 ;
recording_audio . play ();
document . getElementById ( 'recording_button_' + recording_id ) . innerHTML = " <?php echo str_replace( " class = 'list_control_icon' " , " class = 'list_control_icon' style = 'opacity: 1;' " , $v_link_label_pause ); ?> " ;
}
else {
recording_audio . pause ();
document . getElementById ( 'recording_button_' + recording_id ) . innerHTML = " <?php echo $v_link_label_play ; ?> " ;
}
}
function recording_reset ( recording_id ) {
if ( document . getElementById ( 'recording_progress_bar_' + recording_id )) {
document . getElementById ( 'recording_progress_bar_' + recording_id ) . style . display = 'none' ;
}
document . getElementById ( 'recording_button_' + recording_id ) . innerHTML = " <?php echo $v_link_label_play ; ?> " ;
}
function update_progress ( recording_id ) {
recording_audio = document . getElementById ( 'recording_audio_' + recording_id );
var recording_progress = document . getElementById ( 'recording_progress_' + recording_id );
var value = 0 ;
if ( recording_audio . currentTime > 0 ) {
value = ( 100 / recording_audio . duration ) * recording_audio . currentTime ;
}
recording_progress . style . width = value + " % " ;
}
2016-03-25 23:29:20 +01:00
</ script >
<!-- { head } -->
</ head >
< ? php
//add multi-lingual support
$language = new text ;
$text = $language -> get ( null , 'themes/default' );
?>
< body onload = " <?php echo $onload ;?> " >
< div id = 'message_container' class = 'message_container_mood_default' ></ div >
< div id = 'message_text' class = 'message_container_text_default' ></ div >
< ? php
//logged in show the domains block
if ( strlen ( $_SESSION [ " username " ]) > 0 && permission_exists ( " domain_select " ) && count ( $_SESSION [ 'domains' ]) > 1 ) {
?>
< div id = " domains_container " >
< input type = " hidden " id = " domains_visible " value = " 0 " >
< div id = " domains_block " >
< div id = " domains_header " >
< input id = " domains_hide " type = " button " class = " btn " style = " float: right " value = " <?php echo $text['theme-button-close'] ; ?> " >
< ? php
if ( file_exists ( $_SERVER [ " DOCUMENT_ROOT " ] . " /app/domains/domains.php " )) {
$href = '/app/domains/domains.php' ;
}
else {
$href = '/core/domain_settings/domains.php' ;
}
echo " <a href= \" " . $href . " \" ><b style= \" color: #000; \" > " . $text [ 'theme-title-domains' ] . " </b></a> ( " . sizeof ( $_SESSION [ 'domains' ]) . " ) " ;
?>
< br >< br >
2016-04-12 01:52:58 +02:00
< input type = " text " id = " domain_filter " class = " formfld " style = " margin-left: 0; min-width: 100%; width: 100%; " placeholder = " <?php echo $text['theme-label-search'] ; ?> " onkeyup = " domain_search(this.value); " >
2016-03-25 23:29:20 +01:00
</ div >
< div id = " domains_list " >
< ? php
$bgcolor1 = " #eaedf2 " ;
$bgcolor2 = " #fff " ;
foreach ( $_SESSION [ 'domains' ] as $domain ) {
$bgcolor = ( $bgcolor == $bgcolor1 ) ? $bgcolor2 : $bgcolor1 ;
$bgcolor = ( $domain [ 'domain_uuid' ] == $_SESSION [ 'domain_uuid' ]) ? " #eeffee " : $bgcolor ;
echo " <div id= \" " . $domain [ 'domain_name' ] . " \" class='domains_list_item' style='background-color: " . $bgcolor . " ' onclick= \" document.location.href=' " . PROJECT_PATH . " /core/domain_settings/domains.php?domain_uuid= " . $domain [ 'domain_uuid' ] . " &domain_change=true'; \" > " ;
echo " <a href=' " . PROJECT_PATH . " /core/domain_settings/domains.php?domain_uuid= " . $domain [ 'domain_uuid' ] . " &domain_change=true' " . (( $domain [ 'domain_uuid' ] == $_SESSION [ 'domain_uuid' ]) ? " style='font-weight: bold;' " : null ) . " > " . $domain [ 'domain_name' ] . " </a> \n " ;
if ( $domain [ 'domain_description' ] != '' ) {
echo " <span class= \" domain_list_item_description \" > - " . $domain [ 'domain_description' ] . " </span> \n " ;
}
echo " </div> \n " ;
$ary_domain_names [] = $domain [ 'domain_name' ];
$ary_domain_descs [] = str_replace ( '"' , '\"' , $domain [ 'domain_description' ]);
}
?>
</ div >
< script >
var domain_names = new Array ( " <?php echo implode(' " , " ', $ary_domain_names )?> " );
var domain_descs = new Array ( " <?php echo implode(' " , " ', $ary_domain_descs )?> " );
function domain_search ( criteria ) {
for ( var x = 0 ; x < domain_names . length ; x ++ ) {
if ( domain_names [ x ] . toLowerCase () . match ( criteria . toLowerCase ()) || domain_descs [ x ] . toLowerCase () . match ( criteria . toLowerCase ())) {
document . getElementById ( domain_names [ x ]) . style . display = '' ;
}
else {
document . getElementById ( domain_names [ x ]) . style . display = 'none' ;
}
}
}
</ script >
</ div >
</ div >
< ? php
}
2016-03-27 11:22:42 +02:00
2016-03-25 23:29:20 +01:00
// qr code container for contacts
echo " <div id='qr_code_container' style='display: none;' onclick=' $ (this).fadeOut(400);'> " ;
echo " <table cellpadding='0' cellspacing='0' border='0' width='100%' height='100%'><tr><td align='center' valign='middle'> " ;
echo " <span id='qr_code' onclick= \" $ ('#qr_code_container').fadeOut(400); \" ></span> " ;
echo " </td></tr></table> " ;
echo " </div> " ;
2016-03-26 02:38:57 +01:00
if ( ! $default_login ) {
2016-03-25 23:29:20 +01:00
2016-03-26 02:38:57 +01:00
//*************** BOOTSTRAP MENU ********************************
function show_menu ( $menu_array , $menu_style , $menu_position ) {
2016-03-27 11:22:42 +02:00
global $text ;
2016-03-26 02:38:57 +01:00
//determine menu behavior
switch ( $menu_style ) {
case 'inline' :
$menu_type = 'default' ;
2016-05-21 03:08:10 +02:00
$menu_width = 'calc(100% - 20px)' ;
2016-03-26 02:38:57 +01:00
$menu_brand = false ;
break ;
case 'static' :
$menu_type = 'static-top' ;
$menu_width = 'calc(100% - 40px)' ;
$menu_brand = true ;
2016-03-27 09:03:13 +02:00
$menu_corners = " style='-webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;' " ;
2016-03-26 02:38:57 +01:00
break ;
case 'fixed' :
default :
$menu_position = ( $menu_position != '' ) ? $menu_position : 'top' ;
$menu_type = 'fixed-' . $menu_position ;
2016-06-02 06:04:00 +02:00
$menu_width = 'calc(90% - 20px)' ;
2016-03-26 02:38:57 +01:00
$menu_brand = true ;
}
?>
2016-03-25 23:29:20 +01:00
2016-03-27 08:46:06 +02:00
< nav class = " navbar navbar-inverse navbar-<?php echo $menu_type ; ?> " < ? php echo $menu_corners ; ?> >
2016-03-26 02:38:57 +01:00
< div class = " container-fluid " style = 'width: <?php echo $menu_width; ?>; padding: 0;' >
< div class = " navbar-header " >
2016-05-21 03:08:10 +02:00
< button type = " button " class = " navbar-toggle collapsed " < ? php echo ( $menu_style == 'fixed' ) ? " style='margin-right: -2%;' " : null ; ?> data-toggle="collapse" data-target="#main_navbar" aria-expanded="false" aria-controls="navbar">
2016-03-26 02:38:57 +01:00
< span class = " sr-only " > Toggle navigation </ span >
2016-03-27 08:32:19 +02:00
< span class = " icon-bar " style = 'margin-top: 1px;' ></ span >
2016-03-26 02:38:57 +01:00
< span class = " icon-bar " ></ span >
< span class = " icon-bar " ></ span >
</ button >
2016-03-25 23:29:20 +01:00
< ? php
2016-03-26 02:38:57 +01:00
if ( $menu_brand ) {
//define menu brand link
if ( strlen ( PROJECT_PATH ) > 0 ) {
$menu_brand_link = PROJECT_PATH ;
}
else if ( ! $default_login ) {
$menu_brand_link = '/' ;
}
//define menu brand mark
$menu_brand_text = ( $_SESSION [ 'theme' ][ 'menu_brand_text' ][ 'text' ] != '' ) ? $_SESSION [ 'theme' ][ 'menu_brand_text' ][ 'text' ] : " FusionPBX " ;
2016-03-28 16:22:59 +02:00
if ( $_SESSION [ 'theme' ][ 'menu_brand_type' ][ 'text' ] == 'image' || $_SESSION [ 'theme' ][ 'menu_brand_type' ][ 'text' ] == '' ) {
2016-06-09 01:28:01 +02:00
$menu_brand_image = ( $_SESSION [ 'theme' ][ 'menu_brand_image' ][ 'text' ] != '' ) ? $_SESSION [ 'theme' ][ 'menu_brand_image' ][ 'text' ] : PROJECT_PATH . " /themes/default/images/logo.png " ;
2016-05-21 03:08:10 +02:00
echo " <a href=' " . $menu_brand_link . " '> " ;
echo " <img id='menu_brand_image' class='navbar-logo' " . (( $menu_style == 'fixed' ) ? " style='margin-right: -2%;' " : null ) . " src=' " . $menu_brand_image . " ' title= \" " . $menu_brand_text . " \" > " ;
if ( $_SESSION [ 'theme' ][ 'menu_brand_image_hover' ][ 'text' ] != '' ) {
echo " <img id='menu_brand_image_hover' class='navbar-logo' style='display: none;' src=' " . $_SESSION [ 'theme' ][ 'menu_brand_image_hover' ][ 'text' ] . " ' title= \" " . $menu_brand_text . " \" > " ;
}
echo " </a> " ;
2016-03-26 02:38:57 +01:00
}
2016-03-28 16:22:59 +02:00
else if ( $_SESSION [ 'theme' ][ 'menu_brand_type' ][ 'text' ] == 'text' ) {
2016-03-26 02:38:57 +01:00
echo " <div class='pull-left'><a class='navbar-brand' href= \" " . $menu_brand_link . " \" > " . $menu_brand_text . " </a></div> \n " ;
2016-03-25 23:29:20 +01:00
}
}
2016-06-02 06:04:00 +02:00
//domain name/selector (xs)
2016-03-25 23:29:20 +01:00
if ( $_SESSION [ " username " ] != '' && permission_exists ( " domain_select " ) && count ( $_SESSION [ 'domains' ]) > 1 ) {
2016-06-02 06:04:00 +02:00
echo " <span class='pull-right visible-xs'><a href='#' class='domain_selector_domain' title=' " . $text [ 'theme-label-open_selector' ] . " '> " . $_SESSION [ 'domain_name' ] . " </a></span> \n " ;
2016-03-25 23:29:20 +01:00
}
?>
2016-03-26 02:38:57 +01:00
</ div >
< div class = " collapse navbar-collapse " id = " main_navbar " >
< ul class = " nav navbar-nav " >
< ? php
foreach ( $menu_array as $index_main => $menu_parent ) {
$submenu = false ;
if ( is_array ( $menu_parent [ 'menu_items' ]) && sizeof ( $menu_parent [ 'menu_items' ]) > 0 ) {
$mod_li = " class='dropdown' " ;
$mod_a_1 = " class='dropdown-toggle text-left' data-toggle='dropdown' " ;
$submenu = true ;
}
2016-05-25 02:21:26 +02:00
$mod_a_2 = ( $menu_parent [ 'menu_item_link' ] != '' && ! $submenu ) ? $menu_parent [ 'menu_item_link' ] : '#' ;
2016-03-26 02:38:57 +01:00
$mod_a_3 = ( $menu_parent [ 'menu_item_category' ] == 'external' ) ? " target='_blank' " : null ;
2016-05-02 22:42:06 +02:00
if ( $_SESSION [ 'theme' ][ 'menu_main_icons' ][ 'boolean' ] != 'false' ) {
if ( $menu_parent [ 'menu_item_icon' ] != '' && substr_count ( $menu_parent [ 'menu_item_icon' ], 'glyphicon-' ) > 0 ) {
$menu_main_icon = " <span class='glyphicon " . $menu_parent [ 'menu_item_icon' ] . " ' title= \" " . $menu_parent [ 'menu_language_title' ] . " \" ></span> " ;
}
else {
unset ( $menu_main_icon );
2016-04-06 00:41:58 +02:00
}
2016-05-21 03:08:10 +02:00
$menu_main_item = " <span class='hidden-sm' style='margin-left: 5px;'> " . $menu_parent [ 'menu_language_title' ] . " </span> " ;
2016-04-07 23:59:48 +02:00
}
else {
$menu_main_item = $menu_parent [ 'menu_language_title' ];
2016-03-26 02:38:57 +01:00
}
echo " <li " . $mod_li . " > \n " ;
2016-04-07 23:59:48 +02:00
echo " <a " . $mod_a_1 . " href=' " . $mod_a_2 . " ' " . $mod_a_3 . " > " . $menu_main_icon . $menu_main_item . " </a> \n " ;
2016-03-26 02:38:57 +01:00
if ( $submenu ) {
echo " <ul class='dropdown-menu'> \n " ;
foreach ( $menu_parent [ 'menu_items' ] as $index_sub => $menu_sub ) {
2016-03-28 10:25:13 +02:00
$mod_a_2 = $menu_sub [ 'menu_item_link' ];
2016-06-09 22:13:10 +02:00
if ( $mod_a_2 == '' ) {
2016-03-28 10:25:13 +02:00
$mod_a_2 = '#' ;
}
2016-06-09 22:13:10 +02:00
else if (( $menu_sub [ 'menu_item_category' ] == 'internal' ) || (( $menu_sub [ 'menu_item_category' ] == 'external' ) && substr ( $mod_a_2 , 0 , 1 ) == '/' )) {
// accomodate adminer auto-login, if enabled
if ( substr ( $mod_a_2 , 0 , 22 ) == '/app/adminer/index.php' ) {
global $db_type ;
$mod_a_2 .= '?' . (( $db_type == 'mysql' ) ? 'server' : $db_type ) . '&db=fusionpbx&ns=public' ;
$mod_a_2 .= ( $_SESSION [ 'adminer' ][ 'auto_login' ][ 'boolean' ] == 'true' ) ? " &username=auto " : null ;
}
$mod_a_2 = PROJECT_PATH . $mod_a_2 ;
2016-03-28 10:25:13 +02:00
}
2016-03-26 02:38:57 +01:00
$mod_a_3 = ( $menu_sub [ 'menu_item_category' ] == 'external' ) ? " target='_blank' " : null ;
2016-05-02 22:42:06 +02:00
if ( $_SESSION [ 'theme' ][ 'menu_sub_icons' ][ 'boolean' ] != 'false' ) {
if ( $menu_sub [ 'menu_item_icon' ] != '' && substr_count ( $menu_sub [ 'menu_item_icon' ], 'glyphicon-' ) > 0 ) {
$menu_sub_icon = " <span class='glyphicon " . $menu_sub [ 'menu_item_icon' ] . " '></span> " ;
}
else {
unset ( $menu_sub_icon );
2016-03-26 02:38:57 +01:00
}
}
2016-05-02 22:42:06 +02:00
echo " <li><a href=' " . $mod_a_2 . " ' " . $mod_a_3 . " > " . (( $_SESSION [ 'theme' ][ 'menu_sub_icons' ]) ? " <span class='glyphicon glyphicon-minus visible-xs pull-left' style='margin: 4px 10px 0 25px;'></span> " : null ) . $menu_sub [ 'menu_language_title' ] . $menu_sub_icon . " </a></li> \n " ;
2016-03-26 02:38:57 +01:00
}
echo " </ul> \n " ;
}
echo " </li> \n " ;
}
?>
</ ul >
2016-06-02 06:04:00 +02:00
< ? php
echo " <span class='pull-right hidden-xs' style='white-space: nowrap;'> " ;
//domain name/selector (sm+)
if ( $_SESSION [ " username " ] != '' && permission_exists ( " domain_select " ) && count ( $_SESSION [ 'domains' ]) > 1 && $_SESSION [ 'theme' ][ 'domain_visible' ][ 'text' ] == 'true' ) {
echo " <a href='#' class='domain_selector_domain' title=' " . $text [ 'theme-label-open_selector' ] . " '> " . $_SESSION [ 'domain_name' ] . " </a> " ;
}
//logout icon
if ( $_SESSION [ 'username' ] != '' && $_SESSION [ 'theme' ][ 'logout_icon_visible' ][ 'text' ] == " true " ) {
$username_full = $_SESSION [ 'username' ] . (( count ( $_SESSION [ 'domains' ]) > 1 ) ? " @ " . $_SESSION [ " user_context " ] : null );
echo " <a href=' " . PROJECT_PATH . " /logout.php' class='logout_icon' title= \" " . $text [ 'theme-label-logout' ] . " \" onclick= \" return confirm(' " . $text [ 'theme-confirm-logout' ] . " ') \" ><span class='glyphicon glyphicon-log-out'></span></a> " ;
unset ( $username_full );
}
echo " </span> " ;
?>
2016-03-26 02:38:57 +01:00
</ div >
2016-03-25 23:29:20 +01:00
</ div >
2016-03-26 02:38:57 +01:00
</ nav >
2016-03-25 23:29:20 +01:00
2016-03-26 02:38:57 +01:00
< ? php
}
//determine menu configuration
$menu = new menu ;
$menu -> db = $db ;
$menu -> menu_uuid = $_SESSION [ 'domain' ][ 'menu' ][ 'uuid' ];
$menu_array = $menu -> menu_array ();
unset ( $menu );
$menu_style = ( $_SESSION [ 'theme' ][ 'menu_style' ][ 'text' ] != '' ) ? $_SESSION [ 'theme' ][ 'menu_style' ][ 'text' ] : 'fixed' ;
$menu_position = ( $_SESSION [ 'theme' ][ 'menu_position' ][ 'text' ]) ? $_SESSION [ 'theme' ][ 'menu_position' ][ 'text' ] : 'top' ;
2016-03-29 07:39:42 +02:00
$open_container = " <div class='container-fluid' style='padding: 0;' align='center'> " ;
2016-03-26 02:38:57 +01:00
switch ( $menu_style ) {
case 'inline' :
$logo_align = ( $_SESSION [ 'theme' ][ 'logo_align' ][ 'text' ] != '' ) ? $_SESSION [ 'theme' ][ 'logo_align' ][ 'text' ] : 'left' ;
echo str_replace ( " center " , $logo_align , $open_container );
2016-04-16 02:39:12 +02:00
if ( $_SERVER [ 'PHP_SELF' ] != PROJECT_PATH . " /core/install/install.php " ) {
2016-03-27 08:32:19 +02:00
$logo = ( $_SESSION [ 'theme' ][ 'logo' ][ 'text' ] != '' ) ? $_SESSION [ 'theme' ][ 'logo' ][ 'text' ] : PROJECT_PATH . " /themes/default/images/logo.png " ;
2016-03-26 02:38:57 +01:00
echo " <a href=' " . (( PROJECT_PATH != '' ) ? PROJECT_PATH : '/' ) . " '><img src=' " . $logo . " ' style='padding: 15px 20px;'></a> " ;
}
show_menu ( $menu_array , $menu_style , $menu_position );
break ;
case 'static' :
echo $open_container ;
show_menu ( $menu_array , $menu_style , $menu_position );
break ;
case 'fixed' :
show_menu ( $menu_array , $menu_style , $menu_position );
echo $open_container ;
}
?>
2016-03-25 23:29:20 +01:00
2016-05-21 03:08:10 +02:00
< div id = 'main_content' >
<!-- { body } -->
</ div >
< div id = 'footer' >
2016-04-07 23:26:40 +02:00
< span class = 'footer' >< ? php echo ( isset ( $_SESSION [ 'theme' ][ 'footer' ][ 'text' ])) ? $_SESSION [ 'theme' ][ 'footer' ][ 'text' ] : " © " . $text [ 'theme-label-copyright' ] . " 2008 - " . date ( " Y " ) . " <a href='http://www.fusionpbx.com' class='footer' target='_blank'>fusionpbx.com</a> " . $text [ 'theme-label-all_rights_reserved' ]; ?> </span>
2016-04-02 22:26:29 +02:00
</ div >
2016-03-25 23:29:20 +01:00
</ div >
< ? php
2016-05-21 03:08:10 +02:00
// note: div above matches $open_container
2016-03-25 23:29:20 +01:00
}
// default login being used
else {
$logo = ( isset ( $_SESSION [ 'theme' ][ 'logo' ][ 'text' ])) ? $_SESSION [ 'theme' ][ 'logo' ][ 'text' ] : PROJECT_PATH . " /themes/default/images/logo.png " ;
?>
2016-05-22 01:38:23 +02:00
< div id = 'default_login' >
< a href = '<?php echo PROJECT_PATH; ?>/' >< img id = 'login_logo' src = '<?php echo $logo; ?>' ></ a >< br />
<!-- { body } -->
</ div >
< div id = 'footer_login' >
< span class = 'footer' >< ? php echo ( isset ( $_SESSION [ 'theme' ][ 'footer' ][ 'text' ])) ? $_SESSION [ 'theme' ][ 'footer' ][ 'text' ] : " © " . $text [ 'theme-label-copyright' ] . " 2008 - " . date ( " Y " ) . " <a href='http://www.fusionpbx.com' class='footer' target='_blank'>fusionpbx.com</a> " . $text [ 'theme-label-all_rights_reserved' ]; ?> </span>
2016-03-25 23:29:20 +01:00
</ div >
< ? php
2016-04-13 00:18:50 +02:00
unset ( $_SESSION [ 'background_image' ]);
2016-03-25 23:29:20 +01:00
}
?>
</ body >
2016-06-09 01:28:01 +02:00
</ html >