Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/k-samuel/dvelum
Browse files Browse the repository at this point in the history
Designer hotfix 0.9.5.2
  • Loading branch information
k-samuel committed Jun 1, 2015
2 parents c7ce13b + 98cbe67 commit 3ef883c
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 55 deletions.
2 changes: 0 additions & 2 deletions www/system/app/Frontend/Controller/Backoffice.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ protected function loginAction()

public function indexAction()
{
var_dump($this->_module);

$this->_resource->addInlineJs('
var canEdit = ' . intval($this->_user->canEdit($this->_module)) . ';
var canDelete = ' . intval($this->_user->canDelete($this->_module)) . ';
Expand Down
2 changes: 1 addition & 1 deletion www/system/config/versions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
return array(
'core'=>'0.9.5.1',
'core'=>'0.9.5.2',
'designer'=>'0.11',
'reports'=>'0.3.1',
'medialib'=>'0.4',
Expand Down
104 changes: 52 additions & 52 deletions www/system/library/Designer/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,21 @@ static public function runProject($projectFile , Config_Abstract $designerConfig
{
foreach ($projectData['includes'] as $file)
{
if(File::getExt($file) == '.css')
{
if(strpos($file , '?') === false){
$file = $file .'?'. $cachedKey;
}
if(File::getExt($file) == '.css')
{
if(strpos($file , '?') === false){
$file = $file .'?'. $cachedKey;
}

$resource->addCss($file , false);
}else{
$resource->addCss($file , false);
}else{

if(strpos($file , '?') === false){
$file = $file .'?'. $cachedKey;
}
if(strpos($file , '?') === false){
$file = $file .'?'. $cachedKey;
}

$resource->addJs($file , false, false);
}
$resource->addJs($file , false, false);
}
}
}
$resource->addInlineJs($initCode);
Expand All @@ -163,40 +163,40 @@ static public function getProjectIncludes($cacheKey , Designer_Project $project
// include langs
if(isset($projectConfig['langs']) && !empty($projectConfig['langs']))
{
$language = Lang::getDefaultDictionary();
$lansPath = $designerConfig->get('langs_path');
$langsUrl = $designerConfig->get('langs_url');

foreach ($projectConfig['langs'] as $k=>$file)
{
$file = $language.'/'.$file.'.js';
if(file_exists($lansPath.$file)){
$includes[] = $langsUrl . $file . '?' . filemtime($lansPath.$file);
}
}
$language = Lang::getDefaultDictionary();
$lansPath = $designerConfig->get('langs_path');
$langsUrl = $designerConfig->get('langs_url');

foreach ($projectConfig['langs'] as $k=>$file)
{
$file = $language.'/'.$file.'.js';
if(file_exists($lansPath.$file)){
$includes[] = $langsUrl . $file . '?' . filemtime($lansPath.$file);
}
}
}

if(isset($projectConfig['files']) && !empty($projectConfig['files']))
{
foreach ($projectConfig['files'] as $file)
foreach ($projectConfig['files'] as $file)
{
$ext = File::getExt($file);

if($ext === '.js' || $ext === '.css')
{
$ext = File::getExt($file);

if($ext === '.js' || $ext === '.css')
{
$includes[] = $designerConfig->get('js_url') . $file;

}else
{
$projectFile = $designerConfig->get('configs') . $file;
$subProject = Designer_Factory::loadProject($designerConfig, $projectFile);
$projectKey = self::getProjectCacheKey($projectFile);
$files = self::getProjectIncludes($projectKey , $subProject , true , $replace);
unset($subProject);
if(!empty($files))
$includes = array_merge($includes , $files);
}
$includes[] = $designerConfig->get('js_url') . $file;

}else
{
$projectFile = $designerConfig->get('configs') . $file;
$subProject = Designer_Factory::loadProject($designerConfig, $projectFile);
$projectKey = self::getProjectCacheKey($projectFile);
$files = self::getProjectIncludes($projectKey , $subProject , true , $replace);
unset($subProject);
if(!empty($files))
$includes = array_merge($includes , $files);
}
}
}

Ext_Code::setRunNamespace($projectConfig['runnamespace']);
Expand All @@ -223,7 +223,7 @@ static public function getProjectIncludes($cacheKey , Designer_Project $project
*/
$mTime = 0;
if(file_exists('.'.$actionFile))
$mTime = filemtime('.'.$actionFile);
$mTime = filemtime('.'.$actionFile);

$includes[] = $actionFile . '?' . $mTime;
return $includes;
Expand All @@ -249,17 +249,17 @@ static public function getProjectCacheKey($projectFile)
*/
static public function replaceCodeTemplates(array $replaces , $code)
{
if(!empty($replaces))
{
$k = array();
$v = array();
foreach ($replaces as $item)
{
$k[] = $item['tpl'];
$v[] = $item['value'];
}
return str_replace($k , $v , $code);
}
if(!empty($replaces))
{
$k = array();
$v = array();
foreach ($replaces as $item)
{
$k[] = $item['tpl'];
$v[] = $item['value'];
}
return str_replace($k , $v , $code);
}
return $code;
}
}

0 comments on commit 3ef883c

Please sign in to comment.