Ejemplo n.º 1
0
 /**
  * Scans the project.
  *
  * @return void
  */
 private function scan()
 {
     foreach ($this->project->copies as $copy) {
         if (is_dir($copy)) {
             //-- Process known extensions
             foreach ($this->fileExtensions as $ext) {
                 $data = $this->getCodeLines($copy, $ext);
                 $this->addData($data, $ext);
             }
             //foreach
             //-- Process images
             $files = JFolder::files($copy, $this->imgExtensions, true, true);
             $this->projectData['images']['files'] += count($files);
             foreach ($files as $file) {
                 $this->projectData['images']['size'] += filesize($file);
             }
             //foreach
             $this->totalFiles += $this->projectData['images']['files'];
             $this->totalSize += $this->projectData['images']['size'];
         } else {
             //-- It's a file
             //... @todo ?
             //-- Process known extensions
             foreach ($this->fileExtensions as $ext) {
                 $data = $this->getCodeLines($copy, $ext);
                 $this->addData($data, $ext);
             }
             //foreach
         }
     }
     //foreach
     /*
      * Language files
      */
     $langPaths = $this->project->getLanguagePaths();
     $languages = EcrLanguageHelper::discoverLanguages($this->project);
     foreach ($languages as $tag => $scopes) {
         foreach ($scopes as $scope) {
             $fileName = $langPaths[$scope] . DS . 'language' . DS . $tag . DS . $tag . '.' . $this->project->getLanguageFileName($scope);
             $data = $this->getCodeLines($fileName, 'ini');
             $this->addData($data, 'languages');
         }
         //foreach
     }
     //foreach
     return $this;
 }
Ejemplo n.º 2
0
        <td width="10%" nowrap="nowrap">
            <strong><?php 
    echo $tag;
    ?>
</strong>
            <br/>
            <?php 
    echo $lang['name'];
    ?>
        </td>
        <?php 
    foreach ($scopes as $scope => $path) {
        ?>
        <td>
            <?php 
        EcrLanguageHelper::checkFile($this->project, $tag, $scope);
        ?>
        </td>
        <?php 
    }
    ?>
    </tr>
    <?php 
}
?>
    </tbody>
</table>

<input type="hidden" id="lng_scope" name="lng_scope" value=""/>
<input type="hidden" id="lngcreate_lang" name="lngcreate_lang" value=""/>
Ejemplo n.º 3
0
 /**
  * Constructor.
  *
  * @param string $name Project name.
  */
 public function __construct($name = '')
 {
     if (!$name || !$this->readProjectXml($name)) {
         return;
     }
     $this->findCopies();
     $this->langs = EcrLanguageHelper::discoverLanguages($this);
     if ($this->type == 'component') {
         $this->readMenu();
     }
     $this->readJoomlaXml();
     $this->dbId = $this->getId();
     $this->readDeployFile();
 }
Ejemplo n.º 4
0
 /**
  * Remove a BOM from a language file.
  *
  * @return void
  */
 public function remove_bom()
 {
     $input = JFactory::getApplication()->input;
     $fileName = $input->get('file');
     if (!$fileName) {
         EcrHtml::message('No filename set', 'error');
     } else {
         if (EcrLanguageHelper::removeBOM_utf8($fileName)) {
             EcrHtml::message(jgettext('The BOM has been removed'));
         } else {
             EcrHtml::message(jgettext('Unable to remove the BOM'), 'error');
         }
     }
     $input->set('view', 'languages');
     $input->set('task', 'languages');
     parent::display();
 }