TYPO3 CMS  TYPO3_6-2
Format.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script belongs to the TYPO3 Flow framework. *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
13 
14 use TYPO3\Flow\Annotations as Flow;
15 
22 class Format {
23 
27  protected $formatName;
28 
33  protected $formatPath;
34 
41  public function __construct($formatName, $formatPath) {
42  $this->formatName = $formatName;
43  $this->formatPath = $formatPath;
44  }
45 
52  public function getFormatName() {
53  return $this->formatName;
54  }
55 
62  public function getFormatPath() {
63  return $this->formatPath;
64  }
65 
72  public function getAvailableLanguages() {
73  $languages = array();
74 
75  $languagesDirectoryIterator = new \DirectoryIterator($this->formatPath);
76  $languagesDirectoryIterator->rewind();
77  while ($languagesDirectoryIterator->valid()) {
78  $filename = $languagesDirectoryIterator->getFilename();
79  if ($filename[0] != '.' && $languagesDirectoryIterator->isDir()) {
80  $language = $filename;
81  $languages[] = $language;
82  }
83  $languagesDirectoryIterator->next();
84  }
85 
86  return $languages;
87  }
88 }
89 ?>
__construct($formatName, $formatPath)
Definition: Format.php:41