2011-02-28 16:08:15 +00:00
< ? php
2012-04-04 18:02:32 -04:00
/**
* Class SkinEngine
2012-07-17 12:36:44 -04:00
*
2012-04-04 18:02:32 -04:00
* This class load and dispatch the main systems layouts
* @ author Erik Amaru Ortiz < erik @ colosa . com >
* @ author Hugo Loza
*/
2012-04-27 10:45:55 -04:00
define ( 'SE_LAYOUT_NOT_FOUND' , 6 );
2012-04-04 18:02:32 -04:00
class SkinEngine
{
2013-05-02 16:16:09 -04:00
private $skinDefault = '' ;
2012-04-04 18:02:32 -04:00
private $layout = '' ;
private $template = '' ;
private $skin = '' ;
private $content = '' ;
private $mainSkin = '' ;
private $skinFiles = array ();
private $forceTemplateCompile = true ;
private $skinVariants = array ();
private $skinsBasePath = array ();
private $configurationFile = array ();
private $layoutFile = array ();
private $layoutFileBlank = array ();
private $layoutFileExtjs = array ();
private $layoutFileRaw = array ();
private $layoutFileTracker = array ();
private $layoutFileSubmenu = array ();
private $cssFileName = '' ;
public function __construct ( $template , $skin , $content )
{
$this -> template = $template ;
$this -> skin = $skin ;
$this -> content = $content ;
$this -> skinVariants = array ( 'blank' , 'extjs' , 'raw' , 'tracker' , 'submenu' );
$this -> skinsBasePath = G :: ExpandPath ( " skinEngine " );
2013-05-02 16:16:09 -04:00
$sysConf = System :: getSystemConfiguration ( PATH_CONFIG . 'env.ini' );
$this -> skinDefault = ( isset ( $sysConf [ 'default_skin' ]) && $sysConf [ 'default_skin' ] != '' ) ? $sysConf [ 'default_skin' ] : 'classic' ;
2012-04-04 18:02:32 -04:00
$this -> _init ();
}
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
private function _init ()
{
// setting default skin
if ( ! isset ( $this -> skin ) || $this -> skin == " " ) {
2013-05-02 16:16:09 -04:00
$this -> skin = $this -> skinDefault ;
2012-04-04 18:02:32 -04:00
}
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
// deprecated submenu type ""green-submenu"" now is mapped to "submenu"
if ( $this -> skin == " green-submenu " ) {
$this -> skin = " submenu " ;
}
2012-01-20 12:01:02 -04:00
2012-04-04 18:02:32 -04:00
if ( ! in_array ( strtolower ( $this -> skin ), $this -> skinVariants )) {
$this -> forceTemplateCompile = true ; //Only save in session the main SKIN
2012-01-20 12:01:02 -04:00
2012-04-04 18:02:32 -04:00
if ( isset ( $_SESSION [ 'currentSkin' ]) && $_SESSION [ 'currentSkin' ] != $this -> skin ) {
2012-07-17 12:36:44 -04:00
$this -> forceTemplateCompile = true ;
2012-04-04 18:02:32 -04:00
}
$_SESSION [ 'currentSkin' ] = SYS_SKIN ;
}
else {
$_SESSION [ 'currentSkin' ] = SYS_SKIN ;
$_SESSION [ 'currentSkinVariant' ] = $this -> skin ;
}
2012-01-20 12:01:02 -04:00
2012-04-04 18:02:32 -04:00
// setting default skin
if ( ! isset ( $_SESSION [ 'currentSkin' ])) {
2013-05-02 16:16:09 -04:00
$_SESSION [ 'currentSkin' ] = $this -> skinDefault ;
2012-04-04 18:02:32 -04:00
}
2012-01-20 12:01:02 -04:00
2012-04-04 18:02:32 -04:00
$this -> mainSkin = $_SESSION [ 'currentSkin' ];
2012-07-17 12:36:44 -04:00
2012-01-20 12:01:02 -04:00
2012-04-04 18:02:32 -04:00
$skinObject = null ;
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
//Set defaults "classic"
$configurationFile = $this -> skinsBasePath . 'base' . PATH_SEP . 'config.xml' ;
$layoutFile = $this -> skinsBasePath . 'base' . PATH_SEP . 'layout.html' ;
$layoutFileBlank = $this -> skinsBasePath . 'base' . PATH_SEP . 'layout-blank.html' ;
$layoutFileExtjs = $this -> skinsBasePath . 'base' . PATH_SEP . 'layout-extjs.html' ;
$layoutFileRaw = $this -> skinsBasePath . 'base' . PATH_SEP . 'layout-raw.html' ;
$layoutFileTracker = $this -> skinsBasePath . 'base' . PATH_SEP . 'layout-tracker.html' ;
$layoutFileSubmenu = $this -> skinsBasePath . 'base' . PATH_SEP . 'layout-submenu.html' ;
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
//Based on requested Skin look if there is any registered with that name
if ( strtolower ( $this -> mainSkin ) != " classic " ) {
2012-06-28 12:16:44 -04:00
if ( defined ( 'PATH_CUSTOM_SKINS' ) && is_dir ( PATH_CUSTOM_SKINS . $this -> mainSkin )) { // check this skin on user skins path
2012-04-04 18:02:32 -04:00
$skinObject = PATH_CUSTOM_SKINS . $this -> mainSkin ;
}
2012-06-28 12:16:44 -04:00
else if ( is_dir ( $this -> skinsBasePath . $this -> mainSkin )) { // check this skin on core skins path
$skinObject = $this -> skinsBasePath . $this -> mainSkin ;
}
2012-04-04 18:02:32 -04:00
else { //Skin doesn't exist
2013-05-02 16:16:09 -04:00
$this -> mainSkin = $this -> skinDefault ;
if ( defined ( 'PATH_CUSTOM_SKINS' ) && is_dir ( PATH_CUSTOM_SKINS . $this -> mainSkin )) { // check this skin on user skins path
$skinObject = PATH_CUSTOM_SKINS . $this -> mainSkin ;
}
else if ( is_dir ( $this -> skinsBasePath . $this -> mainSkin )) { // check this skin on core skins path
$skinObject = $this -> skinsBasePath . $this -> mainSkin ;
}
2012-04-04 18:02:32 -04:00
}
}
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
//This should have an XML definition and a layout html
2012-07-17 12:36:44 -04:00
if ( $skinObject && file_exists ( $skinObject . PATH_SEP . 'config.xml' )
2012-04-04 18:02:32 -04:00
&& file_exists ( $skinObject . PATH_SEP . 'layout.html' )) {
$configurationFile = $skinObject . PATH_SEP . 'config.xml' ;
$layoutFile = $skinObject . PATH_SEP . 'layout.html' ;
2012-07-17 12:36:44 -04:00
2012-04-04 18:02:32 -04:00
if ( file_exists ( $skinObject . PATH_SEP . 'layout-blank.html' )){
$layoutFileBlank = $skinObject . PATH_SEP . 'layout-blank.html' ;
}
if ( file_exists ( $skinObject . PATH_SEP . 'layout-extjs.html' )){
$layoutFileExtjs = $skinObject . PATH_SEP . 'layout-extjs.html' ;
}
if ( file_exists ( $skinObject . PATH_SEP . 'layout-raw.html' )){
$layoutFileRaw = $skinObject . PATH_SEP . 'layout-raw.html' ;
}
if ( file_exists ( $skinObject . PATH_SEP . 'layout-tracker.html' )){
$layoutFileTracker = $skinObject . PATH_SEP . 'layout-tracker.html' ;
}
if ( file_exists ( $skinObject . PATH_SEP . 'layout-submenu.html' )){
$layoutFileSubmenu = $skinObject . PATH_SEP . 'layout-submenu.html' ;
}
}
$this -> layoutFile = pathInfo ( $layoutFile );
$this -> layoutFileBlank = pathInfo ( $layoutFileBlank );
$this -> layoutFileExtjs = pathInfo ( $layoutFileExtjs );
$this -> layoutFileTracker = pathInfo ( $layoutFileTracker );
$this -> layoutFileRaw = pathInfo ( $layoutFileRaw );
$this -> layoutFileSubmenu = pathInfo ( $layoutFileSubmenu );
$this -> cssFileName = $this -> mainSkin ;
if ( $this -> skin != $this -> mainSkin && in_array ( strtolower ( $this -> skin ), $this -> skinVariants )) {
$this -> cssFileName .= " - " . $this -> skin ;
}
2012-02-24 19:32:24 -04:00
}
2012-04-04 18:02:32 -04:00
public function setLayout ( $layout )
{
$this -> layout = $layout ;
2012-02-24 19:32:24 -04:00
}
2012-04-04 18:02:32 -04:00
public function dispatch ()
{
$skinMethod = '_' . strtolower ( $this -> skin );
2012-07-17 12:36:44 -04:00
2012-04-27 10:45:55 -04:00
try {
if ( ! method_exists ( $this , $skinMethod )) {
$skinMethod = '_default' ;
}
2012-07-17 12:36:44 -04:00
2012-04-27 10:45:55 -04:00
$this -> $skinMethod ();
}
catch ( Exception $e ) {
switch ( $e -> getCode ()) {
case SE_LAYOUT_NOT_FOUND :
2012-06-05 16:35:29 -04:00
$data [ 'exception_type' ] = G :: LoadTranslation ( 'ID_SKIN_EXCEPTION' );
$data [ 'exception_title' ] = G :: LoadTranslation ( 'ID_SKIN_LAYOUT_NOT_FOUND' );
$data [ 'exception_message' ] = G :: LoadTranslation ( 'ID_SKIN_INCORRECT_VERIFY_URL' );
2012-06-04 17:08:14 -04:00
$data [ 'exception_list' ] = array ();
2012-04-27 10:45:55 -04:00
if ( substr ( $this -> mainSkin , 0 , 2 ) != 'ux' ) {
$url = '../login/login' ;
}
else {
2012-06-04 17:08:14 -04:00
$url = '../main/login' ;
2012-04-27 10:45:55 -04:00
}
2012-07-17 12:36:44 -04:00
2012-04-27 10:45:55 -04:00
$link = '<a href="' . $url . '">Try Now</a>' ;
2012-06-05 16:35:29 -04:00
$data [ 'exception_notes' ][] = G :: LoadTranslation ( 'ID_REDIRECT_URL' ) . $link ;
2012-04-27 10:45:55 -04:00
G :: renderTemplate ( PATH_TPL . 'exception' , $data );
break ;
}
exit ( 0 );
2012-04-04 18:02:32 -04:00
}
2012-02-24 19:32:24 -04:00
}
2012-04-04 18:02:32 -04:00
/**
* Skins Alternatives
*/
private function _raw ()
{
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php' ; // put full path to Smarty.class.php
G :: verifyPath ( PATH_SMARTY_C , true );
G :: verifyPath ( PATH_SMARTY_CACHE , true );
$smarty = new Smarty ();
$oHeadPublisher =& headPublisher :: getSingleton ();
$smarty -> template_dir = $this -> layoutFileRaw [ 'dirname' ];
$smarty -> compile_dir = PATH_SMARTY_C ;
$smarty -> cache_dir = PATH_SMARTY_CACHE ;
$smarty -> config_dir = PATH_THIRDPARTY . 'smarty/configs' ;
if ( isset ( $oHeadPublisher )) {
$header = $oHeadPublisher -> printRawHeader ();
}
$smarty -> assign ( 'header' , $header );
$smarty -> force_compile = $this -> forceTemplateCompile ;
$smarty -> display ( $this -> layoutFileRaw [ 'basename' ]);
2012-02-24 19:32:24 -04:00
}
2012-04-04 18:02:32 -04:00
private function _plain ()
{
$oHeadPublisher = & headPublisher :: getSingleton ();
echo $oHeadPublisher -> renderExtJs ();
2012-02-24 19:32:24 -04:00
}
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
private function _extjs ()
{
G :: LoadClass ( 'serverConfiguration' );
$oServerConf =& serverConf :: getSingleton ();
$oHeadPublisher =& headPublisher :: getSingleton ();
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
if ( $oHeadPublisher -> extJsInit === true ){
$header = $oHeadPublisher -> getExtJsVariablesScript ();
$styles = $oHeadPublisher -> getExtJsStylesheets ( $this -> cssFileName );
$body = $oHeadPublisher -> getExtJsScripts ();
2011-02-28 16:08:15 +00:00
2012-10-11 15:56:00 -04:00
//default
2012-04-04 18:02:32 -04:00
$templateFile = G :: ExpandPath ( " skinEngine " ) . 'base' . PATH_SEP . 'extJsInitLoad.html' ;
2012-10-11 15:56:00 -04:00
//Custom skins
if ( defined ( 'PATH_CUSTOM_SKINS' ) && is_dir ( PATH_CUSTOM_SKINS . $this -> mainSkin )) {
$templateFile = PATH_CUSTOM_SKINS . $this -> mainSkin . PATH_SEP . 'extJsInitLoad.html' ;
}
2012-10-17 12:41:33 -04:00
//Skin uxs - simplified
if ( ! isset ( $_SESSION [ 'user_experience' ])) {
$_SESSION [ 'user_experience' ] = 'NORMAL' ;
}
2012-10-11 15:56:00 -04:00
if ( $_SESSION [ 'user_experience' ] != 'NORMAL' ) {
$templateFile = ( is_dir ( PATH_CUSTOM_SKINS . 'uxs' )) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'extJsInitLoad.html' : $templateFile ;
}
2012-04-04 18:02:32 -04:00
}
else {
$styles = " " ;
$header = $oHeadPublisher -> getExtJsStylesheets ( $this -> cssFileName );
$header .= $oHeadPublisher -> includeExtJs ();
$body = $oHeadPublisher -> renderExtJs ();
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
$templateFile = $this -> layoutFile [ 'dirname' ] . PATH_SEP . $this -> layoutFileExtjs [ 'basename' ];
}
2012-10-01 13:44:27 -04:00
2012-04-04 18:02:32 -04:00
$template = new TemplatePower ( $templateFile );
$template -> prepare ();
$template -> assign ( 'header' , $header );
$template -> assign ( 'styles' , $styles );
$template -> assign ( 'bodyTemplate' , $body );
2012-10-01 13:44:27 -04:00
2012-12-18 16:15:04 -04:00
$doctype = " <!DOCTYPE html PUBLIC \" -//W3C//DTD XHTML 1.0 Transitional//EN \" \" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd \" > " ;
$meta = null ;
$dirBody = null ;
2013-04-22 17:01:26 -04:00
if ( isset ( $_SERVER [ " HTTP_USER_AGENT " ]) && preg_match ( " /^.* \ (.*MSIE ( \ d+) \ ..+ \ ).* $ / " , $_SERVER [ " HTTP_USER_AGENT " ], $arrayMatch )) {
2012-12-18 16:15:04 -04:00
$ie = intval ( $arrayMatch [ 1 ]);
$swTrident = ( preg_match ( " /^.*Trident.* $ / " , $_SERVER [ " HTTP_USER_AGENT " ])) ? 1 : 0 ; //Trident only in IE8+
$sw = 1 ;
if ((( $ie == 7 && $swTrident == 1 ) || $ie == 8 ) && ! preg_match ( " /^ux.+ $ / " , SYS_SKIN )) { //IE8
$sw = 0 ;
}
if ( $sw == 1 ) {
2013-04-08 14:21:54 -04:00
if ( $ie == 10 ) {
$ie = 8 ;
}
2012-12-18 16:15:04 -04:00
$doctype = null ;
$meta = " <meta http-equiv= \" X-UA-Compatible \" content= \" IE= $ie\ " /> " ;
}
2012-08-08 12:46:26 -04:00
}
2012-12-18 16:15:04 -04:00
$serverConf = & serverConf :: getSingleton ();
if ( $serverConf -> isRtl ( SYS_LANG )) {
$dirBody = " dir= \" RTL \" " ;
2012-08-03 18:57:48 -04:00
}
2012-10-01 13:44:27 -04:00
2012-12-18 16:15:04 -04:00
$template -> assign ( " doctype " , $doctype );
$template -> assign ( " meta " , $meta );
$template -> assign ( " dirBody " , $dirBody );
2012-04-04 18:02:32 -04:00
echo $template -> getOutputContent ();
}
private function _blank ()
{
2012-02-24 19:32:24 -04:00
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php' ; // put full path to Smarty.class.php
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
G :: verifyPath ( PATH_SMARTY_C , true );
G :: verifyPath ( PATH_SMARTY_CACHE , true );
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$smarty = new Smarty ();
$oHeadPublisher =& headPublisher :: getSingleton ();
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
$smarty -> template_dir = $this -> layoutFileBlank [ 'dirname' ];
2012-02-24 19:32:24 -04:00
$smarty -> compile_dir = PATH_SMARTY_C ;
2012-04-04 18:02:32 -04:00
$smarty -> cache_dir = PATH_SMARTY_CACHE ;
2012-02-24 19:32:24 -04:00
$smarty -> config_dir = PATH_THIRDPARTY . 'smarty/configs' ;
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
if ( isset ( $oHeadPublisher )) {
2012-02-24 19:32:24 -04:00
$header = $oHeadPublisher -> printHeader ();
2012-04-04 18:02:32 -04:00
$header .= $oHeadPublisher -> getExtJsStylesheets ( $this -> cssFileName );
2012-02-24 19:32:24 -04:00
}
$smarty -> assign ( 'username' , ( isset ( $_SESSION [ 'USR_USERNAME' ]) ? '(' . $_SESSION [ 'USR_USERNAME' ] . ' ' . G :: LoadTranslation ( 'ID_IN' ) . ' ' . SYS_SYS . ')' : '' ) );
$smarty -> assign ( 'header' , $header );
2012-04-04 18:02:32 -04:00
$smarty -> force_compile = $this -> forceTemplateCompile ;
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
// display
$smarty -> display ( $this -> layoutFileBlank [ 'basename' ]);
}
2011-09-30 11:41:02 -04:00
2012-04-04 18:02:32 -04:00
private function _submenu ()
{
2012-02-24 19:32:24 -04:00
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php' ; // put full path to Smarty.class.php
global $G_ENABLE_BLANK_SKIN ;
//menu
global $G_MAIN_MENU ;
global $G_SUB_MENU ;
global $G_MENU_SELECTED ;
global $G_SUB_MENU_SELECTED ;
global $G_ID_MENU_SELECTED ;
global $G_ID_SUB_MENU_SELECTED ;
G :: verifyPath ( PATH_SMARTY_C , true );
G :: verifyPath ( PATH_SMARTY_CACHE , true );
$smarty = new Smarty ();
$oHeadPublisher = & headPublisher :: getSingleton ();
2012-04-04 18:02:32 -04:00
$smarty -> template_dir = $this -> layoutFileSubmenu [ 'dirname' ];
$smarty -> compile_dir = PATH_SMARTY_C ;
$smarty -> cache_dir = PATH_SMARTY_CACHE ;
$smarty -> config_dir = PATH_THIRDPARTY . 'smarty/configs' ;
2012-02-24 19:32:24 -04:00
if ( isset ( $G_ENABLE_BLANK_SKIN ) && $G_ENABLE_BLANK_SKIN ) {
$smarty -> display ( $layoutFileBlank [ 'basename' ]);
2012-07-17 12:36:44 -04:00
}
2012-02-24 19:32:24 -04:00
else {
$header = '' ;
if ( isset ( $oHeadPublisher )) {
2011-02-28 16:08:15 +00:00
$oHeadPublisher -> title = isset ( $_SESSION [ 'USR_USERNAME' ]) ? '(' . $_SESSION [ 'USR_USERNAME' ] . ' ' . G :: LoadTranslation ( 'ID_IN' ) . ' ' . SYS_SYS . ')' : '' ;
$header = $oHeadPublisher -> printHeader ();
2012-04-04 18:02:32 -04:00
$header .= $oHeadPublisher -> getExtJsStylesheets ( $this -> cssFileName );
2012-02-24 19:32:24 -04:00
}
$footer = '' ;
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
if ( strpos ( $_SERVER [ 'REQUEST_URI' ], '/login/login' ) !== false ) {
2011-02-28 16:08:15 +00:00
$freeOfChargeText = " " ;
2013-04-19 11:06:20 -04:00
if ( ! defined ( 'SKIP_FREE_OF_CHARGE_TEXT' ))
$freeOfChargeText = " Supplied free of charge with no support, certification, warranty, <br>maintenance nor indemnity by Colosa and its Certified Partners. " ;
if ( class_exists ( 'pmLicenseManager' )) $freeOfChargeText = " " ;
$fileFooter = PATH_SKINS . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
$fileFooter = PATH_SKIN_ENGINE . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
$fileFooter = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
2013-05-10 16:40:22 -04:00
$footer .= " <br />Copyright © 2003- " . date ( 'Y' ) . " <a href= \" http://www.colosa.com \" alt= \" Colosa, Inc. \" target= \" _blank \" >Colosa, Inc.</a> All rights reserved.<br /> $freeOfChargeText " . " <br><br/><a href= \" http://www.processmaker.com \" alt= \" Powered by ProcessMaker - Open Source Workflow & Business Process Management (BPM) Management Software \" title= \" Powered by ProcessMaker \" target= \" _blank \" ></a> " ;
2013-04-19 11:06:20 -04:00
}
}
2012-02-24 19:32:24 -04:00
}
}
2011-09-30 11:41:02 -04:00
2012-02-24 19:32:24 -04:00
$oMenu = new Menu ();
$menus = $oMenu -> generateArrayForTemplate ( $G_MAIN_MENU , 'SelectedMenu' , 'mainMenu' , $G_MENU_SELECTED , $G_ID_MENU_SELECTED );
$smarty -> assign ( 'menus' , $menus );
2011-09-30 11:41:02 -04:00
2012-03-29 16:42:09 -04:00
if ( substr ( SYS_SKIN , 0 , 2 ) == 'ux' ) {
$smarty -> assign ( 'exit_editor' , 1 );
$smarty -> assign ( 'exit_editor_label' , G :: loadTranslation ( 'ID_CLOSE_EDITOR' ));
}
2012-02-24 19:32:24 -04:00
$oSubMenu = new Menu ();
$subMenus = $oSubMenu -> generateArrayForTemplate ( $G_SUB_MENU , 'selectedSubMenu' , 'subMenu' , $G_SUB_MENU_SELECTED , $G_ID_SUB_MENU_SELECTED );
$smarty -> assign ( 'subMenus' , $subMenus );
2011-09-30 11:41:02 -04:00
2012-02-24 19:32:24 -04:00
if ( ! defined ( 'NO_DISPLAY_USERNAME' )) {
2011-02-28 16:08:15 +00:00
define ( 'NO_DISPLAY_USERNAME' , 0 );
2012-02-24 19:32:24 -04:00
}
if ( NO_DISPLAY_USERNAME == 0 ) {
2011-02-28 16:08:15 +00:00
$smarty -> assign ( 'userfullname' , isset ( $_SESSION [ 'USR_FULLNAME' ]) ? $_SESSION [ 'USR_FULLNAME' ] : '' );
$smarty -> assign ( 'user' , isset ( $_SESSION [ 'USR_USERNAME' ]) ? '(' . $_SESSION [ 'USR_USERNAME' ] . ')' : '' );
$smarty -> assign ( 'rolename' , isset ( $_SESSION [ 'USR_ROLENAME' ]) ? $_SESSION [ 'USR_ROLENAME' ] . '' : '' );
$smarty -> assign ( 'pipe' , isset ( $_SESSION [ 'USR_USERNAME' ]) ? ' | ' : '' );
$smarty -> assign ( 'logout' , G :: LoadTranslation ( 'ID_LOGOUT' ));
$smarty -> assign ( 'workspace' , defined ( 'SYS_SYS' ) ? SYS_SYS : '' );
$uws = ( isset ( $_SESSION [ 'USR_ROLENAME' ]) && $_SESSION [ 'USR_ROLENAME' ] != '' ) ? strtolower ( G :: LoadTranslation ( 'ID_WORKSPACE_USING' )) : G :: LoadTranslation ( 'ID_WORKSPACE_USING' );
$smarty -> assign ( 'workspace_label' , $uws );
2013-04-08 14:21:54 -04:00
2013-04-04 16:38:53 -04:00
G :: LoadClass ( " configuration " );
$conf = new Configurations ();
2013-04-04 17:34:14 -04:00
if ( defined ( 'SYS_SYS' ) && $conf -> exists ( " ENVIRONMENT_SETTINGS " )) {
$smarty -> assign ( 'udate' , $conf -> getSystemDate ( date ( 'Y-m-d' )));
} else {
$smarty -> assign ( 'udate' , G :: getformatedDate ( date ( 'Y-m-d' ), 'M d, yyyy' , SYS_LANG ));
}
2013-04-08 11:17:27 -04:00
$name = $conf -> userNameFormat ( isset ( $_SESSION [ 'USR_USERNAME' ]) ? $_SESSION [ 'USR_USERNAME' ] : '' , isset ( $_SESSION [ 'USR_FULLNAME' ]) ? htmlentities ( $_SESSION [ 'USR_FULLNAME' ] , ENT_QUOTES , 'UTF-8' ) : '' );
$smarty -> assign ( 'user' , $name );
2012-02-24 19:32:24 -04:00
}
if ( defined ( 'SYS_SYS' )) {
2011-02-28 16:08:15 +00:00
$logout = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/login/login' ;
2012-02-24 19:32:24 -04:00
}
else {
2011-02-28 16:08:15 +00:00
$logout = '/sys/' . SYS_LANG . '/' . SYS_SKIN . '/login/login' ;
2012-02-24 19:32:24 -04:00
}
2011-09-30 11:41:02 -04:00
2012-02-24 19:32:24 -04:00
$smarty -> assign ( 'linklogout' , $logout );
$smarty -> assign ( 'header' , $header );
$smarty -> assign ( 'footer' , $footer );
$smarty -> assign ( 'tpl_menu' , PATH_TEMPLATE . 'menu.html' );
$smarty -> assign ( 'tpl_submenu' , PATH_TEMPLATE . 'submenu.html' );
if ( class_exists ( 'PMPluginRegistry' )) {
2011-02-28 16:08:15 +00:00
$oPluginRegistry = & PMPluginRegistry :: getSingleton ();
$sCompanyLogo = $oPluginRegistry -> getCompanyLogo ( '/images/processmaker.logo.jpg' );
2012-07-17 12:36:44 -04:00
}
2012-02-24 19:32:24 -04:00
else {
2011-02-28 16:08:15 +00:00
$sCompanyLogo = '/images/processmaker.logo.jpg' ;
2012-02-24 19:32:24 -04:00
}
2011-09-30 11:41:02 -04:00
2012-02-24 19:32:24 -04:00
$smarty -> assign ( 'logo_company' , $sCompanyLogo );
2012-04-04 18:02:32 -04:00
$smarty -> display ( $this -> layoutFileSubmenu [ 'basename' ]);
2012-02-24 19:32:24 -04:00
}
2012-04-04 18:02:32 -04:00
}
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
private function _tracker ()
{
2012-02-24 19:32:24 -04:00
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php' ; // put full path to Smarty.class.php
global $G_ENABLE_BLANK_SKIN ;
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
G :: verifyPath ( PATH_SMARTY_C , true );
G :: verifyPath ( PATH_SMARTY_CACHE , true );
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$smarty = new Smarty ();
$oHeadPublisher =& headPublisher :: getSingleton ();
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$smarty -> template_dir = PATH_SKINS ;
$smarty -> compile_dir = PATH_SMARTY_C ;
$smarty -> cache_dir = PATH_SMARTY_CACHE ;
$smarty -> config_dir = PATH_THIRDPARTY . 'smarty/configs' ;
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
if ( isset ( $G_ENABLE_BLANK_SKIN ) && $G_ENABLE_BLANK_SKIN ) {
2012-04-04 18:02:32 -04:00
$smarty -> force_compile = $this -> forceTemplateCompile ;
$smarty -> display ( $this -> layoutFileBlank [ 'basename' ]);
2012-02-24 19:32:24 -04:00
}
else {
$header = '' ;
if ( isset ( $oHeadPublisher )) {
$oHeadPublisher -> title = isset ( $_SESSION [ 'USR_USERNAME' ]) ? '(' . $_SESSION [ 'USR_USERNAME' ] . ' ' . G :: LoadTranslation ( 'ID_IN' ) . ' ' . SYS_SYS . ')' : '' ;
$header = $oHeadPublisher -> printHeader ();
}
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
$footer = '' ;
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
if ( strpos ( $_SERVER [ 'REQUEST_URI' ], '/login/login' ) !== false ) {
2013-04-19 11:06:20 -04:00
$fileFooter = PATH_SKINS . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
$fileFooter = PATH_SKIN_ENGINE . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
$fileFooter = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
2013-05-10 16:40:22 -04:00
$footer .= " <br />Copyright © 2003- " . date ( 'Y' ) . " <a href= \" http://www.colosa.com \" alt= \" Colosa, Inc. \" target= \" _blank \" >Colosa, Inc.</a> All rights reserved.<br /> $freeOfChargeText " . " <br><br/><a href= \" http://www.processmaker.com \" alt= \" Powered by ProcessMaker - Open Source Workflow & Business Process Management (BPM) Management Software \" title= \" Powered by ProcessMaker \" target= \" _blank \" ></a> " ;
2013-04-19 11:06:20 -04:00
}
}
}
2012-02-24 19:32:24 -04:00
}
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
//menu
global $G_MAIN_MENU ;
global $G_SUB_MENU ;
global $G_MENU_SELECTED ;
global $G_SUB_MENU_SELECTED ;
global $G_ID_MENU_SELECTED ;
global $G_ID_SUB_MENU_SELECTED ;
$oMenu = new Menu ();
$menus = $oMenu -> generateArrayForTemplate ( $G_MAIN_MENU , 'SelectedMenu' , 'mainMenu' , $G_MENU_SELECTED , $G_ID_MENU_SELECTED );
$smarty -> assign ( 'menus' , $menus );
$oSubMenu = new Menu ();
$subMenus = $oSubMenu -> generateArrayForTemplate ( $G_SUB_MENU , 'selectedSubMenu' , 'subMenu' , $G_SUB_MENU_SELECTED , $G_ID_SUB_MENU_SELECTED );
$smarty -> assign ( 'subMenus' , $subMenus );
$smarty -> assign ( 'user' , isset ( $_SESSION [ 'USR_USERNAME' ]) ? $_SESSION [ 'USR_USERNAME' ] : '' );
$smarty -> assign ( 'pipe' , isset ( $_SESSION [ 'USR_USERNAME' ]) ? ' | ' : '' );
$smarty -> assign ( 'logout' , G :: LoadTranslation ( 'ID_LOGOUT' ));
$smarty -> assign ( 'header' , $header );
$smarty -> assign ( 'tpl_menu' , PATH_TEMPLATE . 'menu.html' );
$smarty -> assign ( 'tpl_submenu' , PATH_TEMPLATE . 'submenu.html' );
if ( class_exists ( 'PMPluginRegistry' )) {
$oPluginRegistry = & PMPluginRegistry :: getSingleton ();
$sCompanyLogo = $oPluginRegistry -> getCompanyLogo ( '/images/processmaker.logo.jpg' );
}
else
$sCompanyLogo = '/images/processmaker.logo.jpg' ;
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$smarty -> assign ( 'logo_company' , $sCompanyLogo );
2012-04-04 18:02:32 -04:00
$smarty -> force_compile = $this -> forceTemplateCompile ;
$smarty -> display ( $this -> layoutFileTracker [ 'basename' ]);
2012-02-24 19:32:24 -04:00
}
2012-04-04 18:02:32 -04:00
}
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
private function _mvc ()
{
2012-02-24 19:32:24 -04:00
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php' ; // put full path to Smarty.class.php
2013-05-15 10:54:17 -04:00
require_once PATH_GULLIVER_HOME . 'includes' . PATH_SEP . 'smarty_plugins' . PATH_SEP . 'function.pmos.php' ;
2012-02-24 19:32:24 -04:00
G :: LoadClass ( 'serverConfiguration' );
$oServerConf =& serverConf :: getSingleton ();
$oHeadPublisher =& headPublisher :: getSingleton ();
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$smarty = new Smarty ();
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
$smarty -> compile_dir = PATH_SMARTY_C ;
$smarty -> cache_dir = PATH_SMARTY_CACHE ;
$smarty -> config_dir = PATH_THIRDPARTY . 'smarty/configs' ;
2013-05-15 10:54:17 -04:00
$smarty -> register_function ( 'translate' , 'translate' );
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$viewVars = $oHeadPublisher -> getVars ();
2011-02-28 16:08:15 +00:00
2012-04-04 18:02:32 -04:00
// verify if is using extJs engine
if ( count ( $oHeadPublisher -> extJsScript ) > 0 ) {
$header = $oHeadPublisher -> getExtJsStylesheets ( $this -> cssFileName . '-extJs' );
$header .= $oHeadPublisher -> includeExtJs ();
$smarty -> assign ( '_header' , $header );
}
$contentFiles = $oHeadPublisher -> getContent ();
$viewFile = isset ( $contentFiles [ 0 ]) ? $contentFiles [ 0 ] : '' ;
if ( empty ( $this -> layout )) {
2012-07-17 12:36:44 -04:00
$smarty -> template_dir = PATH_TPL ;
2012-04-05 12:52:33 -04:00
$tpl = $viewFile . '.html' ;
2012-04-04 18:02:32 -04:00
}
else {
$smarty -> template_dir = $this -> layoutFile [ 'dirname' ];
2012-07-17 12:36:44 -04:00
$tpl = 'layout-' . $this -> layout . '.html' ;
2012-04-27 10:45:55 -04:00
//die($smarty->template_dir.PATH_SEP.$tpl);
if ( ! file_exists ( $smarty -> template_dir . PATH_SEP . $tpl )) {
$e = new Exception ( " Layout $tpl does not exist! " , SE_LAYOUT_NOT_FOUND );
$e -> layoutFile = $smarty -> template_dir . PATH_SEP . $tpl ;
2012-07-17 12:36:44 -04:00
2012-04-27 10:45:55 -04:00
throw $e ;
}
2012-04-04 18:02:32 -04:00
$smarty -> assign ( '_content_file' , $viewFile );
}
2012-02-24 19:32:24 -04:00
if ( strpos ( $viewFile , '.' ) === false ) {
2012-07-17 12:36:44 -04:00
$viewFile .= '.html' ;
2012-02-24 19:32:24 -04:00
}
2011-09-30 11:41:02 -04:00
2012-02-24 19:32:24 -04:00
foreach ( $viewVars as $key => $value ) {
2012-07-17 12:36:44 -04:00
$smarty -> assign ( $key , $value );
2012-02-24 19:32:24 -04:00
}
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
if ( defined ( 'DEBUG' ) && DEBUG ) {
$smarty -> force_compile = true ;
}
2012-01-20 12:01:02 -04:00
2012-04-04 18:02:32 -04:00
$smarty -> assign ( '_skin' , $this -> mainSkin );
$smarty -> display ( $tpl );
}
private function _default ()
{
2012-02-24 19:32:24 -04:00
require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php' ; // put full path to Smarty.class.php
global $G_ENABLE_BLANK_SKIN ;
//menu
2012-04-04 18:02:32 -04:00
global $G_PUBLISH ;
2012-02-24 19:32:24 -04:00
global $G_MAIN_MENU ;
global $G_SUB_MENU ;
global $G_MENU_SELECTED ;
global $G_SUB_MENU_SELECTED ;
global $G_ID_MENU_SELECTED ;
global $G_ID_SUB_MENU_SELECTED ;
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
G :: verifyPath ( PATH_SMARTY_C , true );
G :: verifyPath ( PATH_SMARTY_CACHE , true );
2012-01-20 12:01:02 -04:00
2012-02-24 19:32:24 -04:00
$smarty = new Smarty ();
$oHeadPublisher = & headPublisher :: getSingleton ();
2012-01-20 12:01:02 -04:00
2012-02-24 19:32:24 -04:00
$smarty -> compile_dir = PATH_SMARTY_C ;
$smarty -> cache_dir = PATH_SMARTY_CACHE ;
$smarty -> config_dir = PATH_THIRDPARTY . 'smarty/configs' ;
2012-01-20 12:01:02 -04:00
2012-02-24 19:32:24 -04:00
//To setup en extJS Theme for this Skin
G :: LoadClass ( 'serverConfiguration' );
$oServerConf =& serverConf :: getSingleton ();
$extSkin = $oServerConf -> getProperty ( " extSkin " );
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
if ( ! $extSkin ) {
$extSkin = array ();
}
2012-01-20 12:01:02 -04:00
2012-02-24 19:32:24 -04:00
$extSkin [ SYS_SKIN ] = " xtheme-gray " ;
$oServerConf -> setProperty ( " extSkin " , $extSkin );
//End of extJS Theme setup
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
if ( isset ( $G_ENABLE_BLANK_SKIN ) && $G_ENABLE_BLANK_SKIN ) {
2012-04-04 18:02:32 -04:00
$smarty -> template_dir = $this -> layoutFileBlank [ 'dirname' ];
$smarty -> force_compile = $this -> forceTemplateCompile ;
2012-02-24 19:32:24 -04:00
$smarty -> display ( $layoutFileBlank [ 'basename' ]);
}
else {
2012-04-04 18:02:32 -04:00
$smarty -> template_dir = $this -> layoutFile [ 'dirname' ];
2013-04-08 14:21:54 -04:00
$meta = null ;
$header = null ;
if ( preg_match ( " /^.* \ (.*MSIE ( \ d+) \ ..+ \ ).* $ / " , $_SERVER [ " HTTP_USER_AGENT " ], $arrayMatch )) {
$ie = intval ( $arrayMatch [ 1 ]);
if ( $ie == 10 ) {
$ie = 8 ;
$meta = " <meta http-equiv= \" X-UA-Compatible \" content= \" IE= $ie\ " /> " ;
}
}
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
if ( isset ( $oHeadPublisher )) {
2012-10-01 13:44:27 -04:00
if ( defined ( 'SYS_SYS' )) {
$oHeadPublisher -> title = isset ( $_SESSION [ 'USR_USERNAME' ]) ? '(' . $_SESSION [ 'USR_USERNAME' ] . ' ' . G :: LoadTranslation ( 'ID_IN' ) . ' ' . SYS_SYS . ')' : '' ;
}
2012-02-24 19:32:24 -04:00
$header = $oHeadPublisher -> printHeader ();
2012-04-04 18:02:32 -04:00
$header .= $oHeadPublisher -> getExtJsStylesheets ( $this -> cssFileName );
2012-02-24 19:32:24 -04:00
}
2012-07-17 12:36:44 -04:00
2013-04-08 14:21:54 -04:00
$smarty -> assign ( " meta " , $meta );
$smarty -> assign ( " header " , $header );
2012-02-24 19:32:24 -04:00
$footer = '' ;
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
if ( strpos ( $_SERVER [ 'REQUEST_URI' ], '/login/login' ) !== false ) {
$freeOfChargeText = " " ;
if ( ! defined ( 'SKIP_FREE_OF_CHARGE_TEXT' ))
$freeOfChargeText = " Supplied free of charge with no support, certification, warranty, <br>maintenance nor indemnity by Colosa and its Certified Partners. " ;
if ( class_exists ( 'pmLicenseManager' )) $freeOfChargeText = " " ;
2013-04-19 11:06:20 -04:00
$fileFooter = PATH_SKINS . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
$fileFooter = PATH_SKIN_ENGINE . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
$fileFooter = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . 'footer.html' ;
if ( file_exists ( $fileFooter )) {
$footer .= file_get_contents ( $fileFooter );
} else {
2013-05-10 16:40:22 -04:00
$footer .= " <br />Copyright © 2003- " . date ( 'Y' ) . " <a href= \" http://www.colosa.com \" alt= \" Colosa, Inc. \" target= \" _blank \" >Colosa, Inc.</a> All rights reserved.<br /> $freeOfChargeText " . " <br><br/><a href= \" http://www.processmaker.com \" alt= \" Powered by ProcessMaker - Open Source Workflow & Business Process Management (BPM) Management Software \" title= \" Powered by ProcessMaker \" target= \" _blank \" ></a> " ;
2013-04-19 11:06:20 -04:00
}
}
}
2012-02-24 19:32:24 -04:00
}
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$oMenu = new Menu ();
$menus = $oMenu -> generateArrayForTemplate ( $G_MAIN_MENU , 'SelectedMenu' , 'mainMenu' , $G_MENU_SELECTED , $G_ID_MENU_SELECTED );
$smarty -> assign ( 'menus' , $menus );
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$oSubMenu = new Menu ();
$subMenus = $oSubMenu -> generateArrayForTemplate ( $G_SUB_MENU , 'selectedSubMenu' , 'subMenu' , $G_SUB_MENU_SELECTED , $G_ID_SUB_MENU_SELECTED );
$smarty -> assign ( 'subMenus' , $subMenus );
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
if ( ! defined ( 'NO_DISPLAY_USERNAME' )) {
define ( 'NO_DISPLAY_USERNAME' , 0 );
}
if ( NO_DISPLAY_USERNAME == 0 ) {
$switch_interface = isset ( $_SESSION [ 'user_experience' ]) && $_SESSION [ 'user_experience' ] == 'SWITCHABLE' ;
2011-02-28 16:08:15 +00:00
2012-02-24 19:32:24 -04:00
$smarty -> assign ( 'user_logged' , ( isset ( $_SESSION [ 'USER_LOGGED' ]) ? $_SESSION [ 'USER_LOGGED' ] : '' ));
$smarty -> assign ( 'switch_interface' , $switch_interface );
$smarty -> assign ( 'switch_interface_label' , G :: LoadTranslation ( 'ID_SWITCH_INTERFACE' ));
$smarty -> assign ( 'rolename' , isset ( $_SESSION [ 'USR_ROLENAME' ]) ? $_SESSION [ 'USR_ROLENAME' ] . '' : '' );
$smarty -> assign ( 'pipe' , isset ( $_SESSION [ 'USR_USERNAME' ]) ? ' | ' : '' );
$smarty -> assign ( 'logout' , G :: LoadTranslation ( 'ID_LOGOUT' ));
$smarty -> assign ( 'workspace' , defined ( 'SYS_SYS' ) ? SYS_SYS : '' );
$uws = ( isset ( $_SESSION [ 'USR_ROLENAME' ]) && $_SESSION [ 'USR_ROLENAME' ] != '' ) ? strtolower ( G :: LoadTranslation ( 'ID_WORKSPACE_USING' )) : G :: LoadTranslation ( 'ID_WORKSPACE_USING' );
$smarty -> assign ( 'workspace_label' , $uws );
2013-04-08 14:21:54 -04:00
2013-04-04 16:38:53 -04:00
G :: LoadClass ( " configuration " );
$conf = new Configurations ();
2013-04-04 17:34:14 -04:00
if ( defined ( 'SYS_SYS' ) && $conf -> exists ( " ENVIRONMENT_SETTINGS " )) {
$smarty -> assign ( 'udate' , $conf -> getSystemDate ( date ( 'Y-m-d' )));
} else {
$smarty -> assign ( 'udate' , G :: getformatedDate ( date ( 'Y-m-d' ), 'M d, yyyy' , SYS_LANG ));
}
2013-04-08 11:17:27 -04:00
$name = $conf -> userNameFormat ( isset ( $_SESSION [ 'USR_USERNAME' ]) ? $_SESSION [ 'USR_USERNAME' ] : '' , isset ( $_SESSION [ 'USR_FULLNAME' ]) ? htmlentities ( $_SESSION [ 'USR_FULLNAME' ] , ENT_QUOTES , 'UTF-8' ) : '' );
$smarty -> assign ( 'user' , $name );
2012-02-24 19:32:24 -04:00
}
if ( class_exists ( 'pmLicenseManager' )){
2012-04-04 18:02:32 -04:00
$pmLicenseManagerO = & pmLicenseManager :: getSingleton ();
$expireIn = $pmLicenseManagerO -> getExpireIn ();
$expireInLabel = $pmLicenseManagerO -> getExpireInLabel ();
2012-02-24 19:32:24 -04:00
//if($expireIn<=30){
2012-04-04 18:02:32 -04:00
if ( $expireInLabel != " " ){
2012-02-24 19:32:24 -04:00
$smarty -> assign ( 'msgVer' , '<label class="textBlack">' . $expireInLabel . '</label> ' );
}
//}
}
if ( defined ( 'SYS_SYS' )) {
$logout = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/login/login' ;
}
else {
$logout = '/sys/' . SYS_LANG . '/' . SYS_SKIN . '/login/login' ;
}
$smarty -> assign ( 'linklogout' , $logout );
$smarty -> assign ( 'footer' , $footer );
$smarty -> assign ( 'tpl_menu' , PATH_TEMPLATE . 'menu.html' );
$smarty -> assign ( 'tpl_submenu' , PATH_TEMPLATE . 'submenu.html' );
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
G :: LoadClass ( 'replacementLogo' );
$oLogoR = new replacementLogo ();
2012-07-17 12:36:44 -04:00
2012-02-24 19:32:24 -04:00
if ( defined ( " SYS_SYS " )){
2012-04-04 18:02:32 -04:00
$aFotoSelect = $oLogoR -> getNameLogo (( isset ( $_SESSION [ 'USER_LOGGED' ])) ? $_SESSION [ 'USER_LOGGED' ] : '' );
if ( is_array ( $aFotoSelect )) {
2012-02-24 19:32:24 -04:00
$sFotoSelect = trim ( $aFotoSelect [ 'DEFAULT_LOGO_NAME' ]);
$sWspaceSelect = trim ( $aFotoSelect [ 'WORKSPACE_LOGO_NAME' ]);
}
}
if ( class_exists ( 'PMPluginRegistry' )) {
$oPluginRegistry = & PMPluginRegistry :: getSingleton ();
2012-04-04 18:02:32 -04:00
if ( isset ( $sFotoSelect ) && $sFotoSelect != '' && ! ( strcmp ( $sWspaceSelect , SYS_SYS )) ){
2012-02-24 19:32:24 -04:00
$sCompanyLogo = $oPluginRegistry -> getCompanyLogo ( $sFotoSelect );
2012-04-04 18:02:32 -04:00
$sCompanyLogo = " /sys " . SYS_SYS . " / " . SYS_LANG . " / " . SYS_SKIN . " /setup/showLogoFile.php?id= " . base64_encode ( $sCompanyLogo );
2011-02-28 16:08:15 +00:00
}
else {
2012-02-24 19:32:24 -04:00
$sCompanyLogo = $oPluginRegistry -> getCompanyLogo ( '/images/processmaker.logo.jpg' );
2011-02-28 16:08:15 +00:00
}
2012-02-24 19:32:24 -04:00
}
else {
$sCompanyLogo = '/images/processmaker.logo.jpg' ;
}
$smarty -> assign ( 'logo_company' , $sCompanyLogo );
2012-04-04 18:02:32 -04:00
$smarty -> force_compile = $this -> forceTemplateCompile ;
2012-02-24 19:32:24 -04:00
2012-04-04 18:02:32 -04:00
$smarty -> display ( $this -> layoutFile [ 'basename' ]);
2012-02-24 19:32:24 -04:00
}
2012-04-04 18:02:32 -04:00
}
2011-02-28 16:08:15 +00:00
}