Skip to content

Commit

Permalink
Dev: added TemplateConfiguration::getLayoutForScreen()
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jun 23, 2017
1 parent afcbb33 commit 5e374e8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions application/models/TemplateConfiguration.php
Expand Up @@ -159,6 +159,26 @@ public function getValidScreenFiles($sType = "view", $sScreen=null)
return $aScreenFiles;
}

/**
* Returns the layout file name for a given screen
*
* @param string $sScreen the screen you want to retreive the files from. If null: all screens
* @return string the file name
*/
public function getLayoutForScreen($sScreen)
{
$filesFromXML = $this->templateEditor->screens->xpath('//'.$sScreen.'/file');

foreach( $filesFromXML as $file){

if ( $file->attributes()->role == "layout" ){
return (string) $file;
}
}

return false;
}

/**
* This function will update the config file of a given template so that it extends another one
*
Expand Down

0 comments on commit 5e374e8

Please sign in to comment.