Skip to content

Commit

Permalink
Dev: added screen selection to getValidScreenFiles()
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jun 23, 2017
1 parent a204f14 commit a56270b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions application/models/TemplateConfiguration.php
Expand Up @@ -138,13 +138,15 @@ public function getTemplateURL()
* Used from the template editor.
* It returns an array of editable files by screen for a given file type
*
* @param string $sType the type of files (view/css/js)
* @return array array ( [screen name] => array([files]) )
* @param string $sType the type of files (view/css/js)
* @param string $sScreen the screen you want to retreive the files from. If null: all screens
* @return array array ( [screen name] => array([files]) )
*/
public function getValidScreenFiles($sType = "view")
public function getValidScreenFiles($sType = "view", $sScreen=null)
{
$aScreenFiles = array();
$filesFromXML = (array) $this->templateEditor->screens->xpath('//file');

$filesFromXML = (is_null($sScreen)) ? (array) $this->templateEditor->screens->xpath('//file') : $this->templateEditor->screens->xpath('//'.$sScreen.'/file');

foreach( $filesFromXML as $file){

Expand Down

0 comments on commit a56270b

Please sign in to comment.