From b51f036e19d55cc18be80090a7fa5dfc1ef3f06c Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Thu, 6 Feb 2014 18:55:34 -0400 Subject: [PATCH] adding dynamic include for js and css files for designer.html template for debug mode --- workflow/engine/controllers/designer.php | 10 +- workflow/engine/templates/designer/index.html | 226 ++---------------- 2 files changed, 32 insertions(+), 204 deletions(-) diff --git a/workflow/engine/controllers/designer.php b/workflow/engine/controllers/designer.php index b9ba61072..eabd551d7 100644 --- a/workflow/engine/controllers/designer.php +++ b/workflow/engine/controllers/designer.php @@ -38,12 +38,18 @@ class Designer extends Controller $this->setVar('isDebugMode', System::isDebugMode()); if (System::isDebugMode()) { + if (! file_exists(PATH_HTML . "lib-dev/pmUI/build.cache")) { + throw new Exception("Error: Development JS Files were are not generated!, please execute: \$rake pmBuildDebug in pmUI project"); + } if (! file_exists(PATH_HTML . "lib-dev/mafe/build.cache")) { throw new Exception("Error: Development JS Files were are not generated!, please execute: \$rake pmBuildDebug in MichelangeloFE project"); } - $this->setVar('designerCacheFile', file(PATH_HTML . "lib-dev/mafe/applications.cache")); - $this->setVar('mafeCacheFile', file(PATH_HTML . "lib-dev/mafe/build.cache")); + $this->setVar('pmuiJsCacheFile', file(PATH_HTML . "lib-dev/pmUI/build.cache", FILE_IGNORE_NEW_LINES)); + $this->setVar('pmuiCssCacheFile', file(PATH_HTML . "lib-dev/pmUI/css.cache", FILE_IGNORE_NEW_LINES)); + + $this->setVar('designerCacheFile', file(PATH_HTML . "lib-dev/mafe/applications.cache", FILE_IGNORE_NEW_LINES)); + $this->setVar('mafeCacheFile', file(PATH_HTML . "lib-dev/mafe/build.cache", FILE_IGNORE_NEW_LINES)); } $this->setView('designer/index'); diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index 8f55f668b..6d101410c 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -1,29 +1,15 @@ {if $isDebugMode} - - - - - - - - - - - - - - - - - + {foreach from=$pmuiCssCacheFile item=file} + + {/foreach} - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + {foreach from=$pmuiJsCacheFile item=file} + + {/foreach} + + + {foreach from=$mafeCacheFile item=file} + + {/foreach} + + {foreach from=$designerCacheFile item=file} + + {/foreach} {else} - - - - + + + +