Commit 81835e68 authored by sgalinsk's avatar sgalinsk

First Import

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/lfeditor/trunk@12284 735d13b6-9817-0410-8766-e36946ffe9aa
parent 2b3b3475
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>LFEditor</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.php.core.PhpIncrementalProjectBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
</natures>
</projectDescription>
#Mon Mar 03 18:24:41 GMT 2008
eclipse.preferences.version=1
org.eclipse.php.core.contextRoot=
org.eclipse.php.core.defaultEncoding=
org.eclipse.php.core.includePath=<?xml version\="1.0" encoding\="UTF-8"?>\n<includepath>\n\t<includepathentry createdReference\="false" path\="/var/www/Website/t3lib" contentKind\="source" kind\="lib">\n</includepathentry>\n</includepath>\n
This diff is collapsed.
LFEditor V3.0
:: Benutzung der docheader wie in TYPO3 4.2 (Hinweis: template anstatt bigDoc)
:: Protokollierung von Stringänderungen (echtes fuzzy handling)
:: wie in llxml, aber als Attribut des Labels
:: Architektur: MVC-Modell + Smarty
:: Sprachenbaum (als iframe)
:: Root
|- Erweiterung
|- Sprachdatei
|- Konstante
:: merken des Status in einem Cookie oder DB
:: Kontextmenü wie bei Seitenbaum unter Web
:: Konstante verschieben wie bei der Seitenansicht (Ajax)
:: Konstante löschen (nur bei Konstanten)
:: neue Konstante... (nur bei Knoten)
:: Konstante umbenennen (bei beiden ermöglichen)
:: ergibt neue Funktion der Massenumbenennung von Konstanten
:: Konstante editieren (nur bei Konstanten) ... ebenfalls einfacher Klick
:: Ergebnisse der Hilfe immer in neuem Fenster
:: alte Funktionen herausnehmen, da alles über den Konstantenbaum machbar wird
:: Suche: AJAX verwenden (wie im PageBrowser in TYPO3 4.2)
LFEditor V4.0
:: Backup-XML und locallang.xml über DOM (PHP5)
:: Verwaltung fuer Uebersetzer (Teams, Leiter, Assistenten)
:: Informationen ueber Sprache und Kodierung einstellbar
:: Workflow (alle Aenderungen muessen vom Teamleiter freigegeben werden)
:: keine direkte Speicherung der Aenderungen der Assistenten (ähnlich Backup)
:: Rechteverwaltung (jeder Assistent erhält spezifische Rechte zur Funktionsfilterung)
:: Import von Exportdateien mit Auswahl bestimmter Konstanten/Sprachen
:: neues Diff-Merge-System
:: Anzeige von Unterschieden zwischen Base und XLL
:: Anzeige von Unterschieden zwischen 2 Sprachdateiversionen
:: Anzeige von Änderungen bei Import von Sprachdateien aus externen Quellen
:: Nutzung des Codes für Backup-Diff
:: Mergen von Änderungen (Wahl von kompletten Sprachen oder Konstanten)
:: Auswahlwerkzeug zur Übernahme bestimmter Konstanten in den lokalen Workspace
:: Erweiterung für Frontend (als externe TypoScript-Datei speichern)
##### RELEASED VERSIONS #####
LFEditor V2.5
DONE :: Eingabeswitch zwischen einfachen Texteingabebereichen und tinyMCE
DONE :: Verwaltung von Meta-Informationen
DONE :: Unterstützung für Typo3 4.0 (Ablage der Spracherweiterungen in typo3conf/l10n/<langKey>)
DONE :: CSS-Handling betreffend der unterschiedlichen Skins
DONE :: Reorganisation des XHTML-Contents unter Verwendung von bigDoc
DONE :: Integration von pmk_textarea
DONE :: parallele Bearbeitung zweier Sprachdateien (Sprache und Vorlage)
DONE :: Erfolgsnachrichten (Fehler[rot], Notiz[blau], Ok[grün])
DONE :: Export aller Sprachdateien einer Extension in Zip-Datei + Email an Author
DONE :: Korrekturen am lokalen Workspace
DONE :: Dokumentation (+Konfiguration), aktualisieren und überarbeiten
DONE :: $GLOBALS verwenden, "lfeditor." in labels entfernen
DONE :: tinyMCE auslagern
DONE :: zahlreiche kleinere Verbesserungen (z.B. direkte Konstanteneingabe beim Hinzufügen)
DONE :: Bugfixes, Bugfixes, Bugfixes...
LFEditor V2.0
DONE :: komplette Integration beider Workspaces (lokal und global)
DONE :: Integration eines WYSIWIG-Editors
DONE :: Aufteilung der Dateibearbeitung in Seiten (vor- und zurückblättern)
DONE :: Auswahlfeld zur Anzeige von speziellen Konstanten in der Dateibearbeitung
DONE :: mehr Information über Konstanten und Verbindung dieser in der allgemeinen Funktion
DONE :: komplette Überarbeitung der CSS-Datei (neues Look and Feel)
DONE :: Verbesserung der Performance des Konstantenbaumes (Fazit: ~300%)
DONE :: Integration eines dynamischen Explode-Tokens in den Konstantenbaum
DONE :: Integration einer Referenzsprachauswahl im Konstantenbaum zur Anzeige der Konstantentypen
DONE :: Integration von Auf- und Zuklapp-Buttons für den Konstantenbaumm
DONE :: Rewrite großer Bereiche des Codes für Stabilität, Performance, Wartbarkeit
DONE :: Verwendung von PHP5+ (keine Abwärtskompatibilität)
DONE :: Verhalten der Rename- und Delete-Methode verändert zur Vermeidung von Fehlern
DONE :: Dokumentation(+Screenshots und Konfiguration), Übersetzungen aktualisieren
DONE :: Integration einer dänischen Übersetzung (meinen Dank an Peter Klein)
DONE :: zahlreiche kleinere Verbesserungen (z.B. case-insensitive search)
DONE :: Erstellung einer stabilen Version (Bugfixes, Bugfixes, Bugfixes)
LFEditor V1.0
DONE :: Info ueber Dateien: Herkunftsort der Sprache (Datei) + weitere Informationen
DONE :: PHP und XML-Einlesefunktionen mit Support für gesplittete Dateien
DONE :: schreiben von XML- und PHP-Dateien mit Support von gesplitteten Dateien
DONE :: Auswahl von Extension und Sprachdatei
DONE :: Ermöglichen von Backups (Speicherung im XML-Format mit Meta-Datei)
DONE :: Anzeige von Änderungen von Backup zu Original
DONE :: Wiederherstellungsfunktion eines Backups
DONE :: Auto-delete von alten Backups ermöglichen (Konfiguration: max. erlaubte Anzahl einstellbar)
DONE :: löschen von Backups
DONE :: hinzufügen, löschen, umbenennen und editieren von Konstanten
DONE :: editieren von Sprachdateien
DONE :: Speicherortvergabe fuer Lokalisierungen im allgemeinen Menü
DONE :: Suche nach Werten von Konstanten
DONE :: Baumansicht fuer strukturierte Sprachkonstanten
DONE :: schreiben und lesen mit XLL-Support
DONE :: Workspace-Idee XLL/Original
DONE :: kopieren von kompletten Sprachen zu XLL
DONE :: deutsche und englische Übersetzung, Dokumentation, Funktionsindex
\ No newline at end of file
File added
######################### general informations ####################
# cat=basic; type=string; label=view languages: Please enter a list of languages do you like to edit (only the short name). Let this field empty if you want to view all languages (Warning: very long list!). Please note that the default language is always included.
viewLanguages =
# cat=basic; type=boolean; label=view local extensions: view local extensions
viewLocalExt = 1
# cat=basic; type=boolean; label=view global extensions: view global extensions
viewGlobalExt = 0
# cat=basic; type=boolean; label=view system extensions: view system extensions
viewSysExt = 0
# cat=basic; type=integer; label=view loaded and unloaded extensions: Please enter 0 for all extensions, 1 for loaded extensions and 2 for unloaded extensions.
viewStateExt = 1
# cat=basic; type=string; label=ignore extensions: Please modify the regular expression to limit the extension key list.
extIgnore = /^csh_.*$/
# cat=basic; type=integer; label=maximal amount of backup files: Set this value to zero if you like to keep all files else all old files will be deleted unto the given amount.
anzBackup = 5
# cat=basic; type=integer; label=amount of rows in text area: Please enter the amoung of rows you want in a normal textarea. This feature isnt supported if you use tinyMCE.
numTextAreaRows = 5
# cat=basic; type=integer; label=constants per site in language file edit mode: Please enter the amount of constants per site in the language file edit mode. This value has no influence if you use parallel edit or not.
numSiteConsts = 6
# cat=basic; type=boolean; label=Set to true if you want to hide the tree branches at start of the tree page.
treeHide = 1
######################### enable features #######################
# cat=basic/enable; type=boolean; label=enable backup: Set to true if you want enable the backup management (highly recommended)
execBackup = 1
######################### file configuration #######################
# cat=basic/file; type=string; label=backup directory: path to the backup directory
pathBackup = typo3conf/LFEditor/Backup/
# cat=basic/file; type=string; label=xll files directory: path to the xll files directory
pathXLLFiles = typo3conf/LFEditor/XLL/
# cat=basic/file; type=string; label=backup meta information file: location of the backup meta information file
metaFile = typo3conf/LFEditor/Backup/Meta.xml
<?php
########################################################################
# Extension Manager/Repository config file for ext: "lfeditor"
#
# Auto generated 08-10-2007 14:38
#
# Manual updates:
# Only the data in the array - anything else is removed by next write.
# "version" and "dependencies" must not be touched!
########################################################################
$EM_CONF[$_EXTKEY] = array(
'title' => 'Language File Editor',
'description' => 'This module serves several functions for editing of language files.
Translators, extension authors and simple users are supported with
special functions for each of them.
Following functions are implemented in this module:
* Formats: PHP and XML
* enhanced insert types (textarea, enhanced textarea, wysiwig)
* conversion from PHP to XML and vice versa
* splitting and merging of language files
* workspaces (local (only for backend modules) and global)
* simple editing of constants and languages
* flexible search and view of constants and values
* meta information handling
* backups, recovering and diff view',
'category' => 'module',
'shy' => 0,
'version' => '2.6.2',
'dependencies' => '',
'conflicts' => '',
'priority' => '',
'loadOrder' => '',
'module' => 'mod1',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
'clearcacheonload' => 0,
'lockType' => '',
'author' => 'Stefan Galinski',
'author_email' => 'Stefan.Galinski@gmail.com',
'author_company' => '',
'CGLcompliance' => '',
'CGLcompliance_note' => '',
'constraints' => array(
'depends' => array(
'php' => '5.0.0-5.2.99',
'typo3' => '3.8.0-4.2.99',
),
'conflicts' => array(
),
'suggests' => array(
),
),
'_md5_values_when_last_written' => 'a:48:{s:9:"ChangeLog";s:4:"8e74";s:8:"TODO.txt";s:4:"85d3";s:21:"ext_conf_template.txt";s:4:"9360";s:12:"ext_icon.gif";s:4:"9905";s:14:"ext_tables.php";s:4:"2c2d";s:26:"mod1/class.LFException.php";s:4:"85ea";s:20:"mod1/class.sgLib.php";s:4:"28d3";s:36:"mod1/class.tx_lfeditor_mod1_file.php";s:4:"8736";s:43:"mod1/class.tx_lfeditor_mod1_file_backup.php";s:4:"6339";s:41:"mod1/class.tx_lfeditor_mod1_file_base.php";s:4:"a9b3";s:44:"mod1/class.tx_lfeditor_mod1_file_basePHP.php";s:4:"1101";s:44:"mod1/class.tx_lfeditor_mod1_file_baseXML.php";s:4:"08c2";s:40:"mod1/class.tx_lfeditor_mod1_file_xll.php";s:4:"a63e";s:43:"mod1/class.tx_lfeditor_mod1_file_xllPHP.php";s:4:"87be";s:43:"mod1/class.tx_lfeditor_mod1_file_xllXML.php";s:4:"18c1";s:41:"mod1/class.tx_lfeditor_mod1_functions.php";s:4:"fda8";s:40:"mod1/class.tx_lfeditor_mod1_template.php";s:4:"a317";s:23:"mod1/class.typo3Lib.php";s:4:"2c35";s:13:"mod1/conf.php";s:4:"13c1";s:21:"mod1/de.locallang.xml";s:4:"c512";s:25:"mod1/de.locallang_mod.xml";s:4:"1ee6";s:21:"mod1/dk.locallang.xml";s:4:"c64c";s:25:"mod1/dk.locallang_mod.xml";s:4:"cb42";s:21:"mod1/fi.locallang.xml";s:4:"644f";s:25:"mod1/fi.locallang_mod.xml";s:4:"b778";s:14:"mod1/index.php";s:4:"f84c";s:18:"mod1/locallang.xml";s:4:"85de";s:22:"mod1/locallang_mod.xml";s:4:"d60a";s:19:"mod1/moduleicon.png";s:4:"f2a8";s:22:"mod1/textareaResize.js";s:4:"8100";s:21:"mod1/tinyMCEConfig.js";s:4:"9d06";s:24:"mod1/tx_lfeditor_mod1.js";s:4:"2d0b";s:29:"mod1/tx_lfeditor_mod1_css.css";s:4:"104a";s:14:"doc/manual.sxw";s:4:"d1a4";s:19:"res/zip/zip.lib.php";s:4:"46cd";s:19:"res/images/diff.gif";s:4:"3ba9";s:22:"res/images/garbage.gif";s:4:"5d02";s:19:"res/images/join.gif";s:4:"86ea";s:25:"res/images/joinBottom.gif";s:4:"3822";s:19:"res/images/line.gif";s:4:"d3d7";s:19:"res/images/mail.gif";s:4:"aa1c";s:22:"res/images/recover.gif";s:4:"ee1a";s:24:"res/images/treeMinus.gif";s:4:"dd7a";s:30:"res/images/treeMinusBottom.gif";s:4:"a1b6";s:23:"res/images/treePlus.gif";s:4:"86da";s:29:"res/images/treePlusBottom.gif";s:4:"6ac4";s:32:"res/phpCompat/array_diff_key.php";s:4:"acbb";s:37:"res/phpCompat/array_intersect_key.php";s:4:"8090";}',
);
?>
\ No newline at end of file
ext_icon.gif

182 Bytes

<?php
if (!defined('TYPO3_MODE'))
die('Access denied!!!');
if (TYPO3_MODE == 'BE')
t3lib_extMgm::addModule('user', 'txlfeditorM1', '', t3lib_extMgm::extPath($_EXTKEY) . 'mod1/');
?>
<?php
/***************************************************************
* Copyright notice
*
* (c) 2005-2008 Stefan Galinski (stefan.galinski@gmail.com)
* All rights reserved
*
* This script isnt part of any project. The script is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* adds a new error exception
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
/**
* adds a new error exception
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
* @package Typo3
* @subpackage tx_lfeditor
*/
class LFException extends Exception {
/**#@+
* @var string status wraps (i.e. "<p>|</p>" (without quotes))
* @see setWrap()
*/
private static $errorWrap = '|';
private static $noticeWrap = '|';
/**#@-*/
/**
* Constructor
*
* @param string error message (this message would be translated by TYPO3)
* @param integer type of wrap (0 = error (default), 1 = notice)
* @param string static message (appended at the localized string)
* @return void
*/
public function __construct($msg, $wrapType=0, $staticMsg='')
{
if(!empty($msg))
$msg = $GLOBALS['LANG']->getLL($msg);
if(empty($msg))
$msg = 'LFExeption: no error message given !!!';
parent::__construct($this->prepare($msg . ' ' . $staticMsg, $wrapType));
}
/**
* set the error wrap
*
* @param string error wrap
* @param string notice wrap
* @return void
*/
public static function setWrap($errorWrap, $noticeWrap)
{
self::$errorWrap = $errorWrap;
self::$noticeWrap = $noticeWrap;
}
/**
* preparation of the error message
*
* @param string error message (this message would be translated)
* @param integer type of wrap (0 = error (default), 1 = notice)
* @return string prepared message
*/
private function prepare($msg, $wrapType=0)
{
if(!$wrapType)
return str_replace('|', $msg, self::$errorWrap);
else
return str_replace('|', $msg, self::$noticeWrap);
}
}
?>
<?php
/***************************************************************
* Copyright notice
*
* (c) 2005-2008 Stefan Galinski (stefan.galinski@gmail.com)
* All rights reserved
*
* The script is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* personal library with lots of useful methods
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
/**
* personal library with lots of useful methods
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
* @package sgLib
*/
class sgLib {
###############################
######## http functions #######
###############################
/**
* forces download of a file
*
* @param string download file or data string
* @param string download filename
* @param string type of file
* @return void
*/
public static function download($file, $filename, $type='x-type/octtype')
{
if(is_file($file))
$content = readfile($file);
else
$content = $file;
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Pragma: public"); // needed for IE
header('Content-Type: ' . $type);
header('Content-Length: ' . strlen($content));
header('Content-Disposition: attachment; filename="' . $filename . '"');
echo $content;
}
/**
* sends email with php multibyte functions
*
* @throws Exception raised if something failed
* @param string subject
* @param string text
* @param string from header
* @param string email address
* @param string file attachement name or data string (optional)
* @param string send filename (optional)
* @param string language (default == unicode)
* @return void
*/
public static function sendMail($subject, $text, $fromAddress, $toAddress,
$attachement='', $sendFileName='', $mbLanguage='uni')
{
// checks
if(!preg_match('/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/', $toAddress) &&
!preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',
$toAddress))
throw new Exception('email address isnt valid: ' . $toAddress);
if(!preg_match('/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/', $fromAddress) &&
!preg_match('/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/',
$fromAddress))
throw new Exception('email address isnt valid: ' . $fromAddress);
// prepare data
$text = htmlspecialchars($text);
$subject = htmlspecialchars($subject);
if(is_file($attachement))
$fileContent = readfile($attachement);
else
$fileContent = $attachement;
// prepare header
$boundary = md5(uniqid(time()));
$header = 'From: ' . $fromAddress . "\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n";
if(!empty($fileContent)) {
$header .= 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-Type: multipart/mixed; boundary=' . $boundary . "\r\n\r\n";
$header .= '--' . $boundary . "\r\n";
$header .= 'Content-Type: text/plain' . "\r\n";
$header .= 'Content-Transfer-Encoding: 8bit' . "\r\n\r\n";
$header .= $text . "\r\n";
$header .= '--' . $boundary . "\r\n";
$header .= 'Content-Type: Application/Octet-Stream; name=' . $sendFileName . "\r\n";
$header .= 'Content-Transfer-Encoding: base64' . "\r\n";
$header .= 'Content-Disposition: attachment; filename=' . $sendFileName . "\r\n\r\n";
$header .= chunk_split(base64_encode($fileContent));
$header .= "\r\n";
$header .= '--' . $boundary . '--';
$text = '';
}
// send mail
if(!mb_language($mbLanguage))
throw new Exception('mb_language reported an error: "' . $mbLanguage . '"');
if(!mb_send_mail($toAddress, $subject, $text, $header))
throw new Exception('mail couldnt be sended to: ' . $toAddress);
}
#################################
######## string functions #######
#################################
/**
* trims some string from an given path
*
* @param string string part to delete
* @param string some path
* @param string some prefix for the new path
* @return string new path
*/
public static function trimPath($replace, $path, $prefix='')
{
return trim(str_replace($replace, '', $path), '/') . $prefix;
}
#####################################
######## filesystem functions #######
#####################################
/**
* reads the extension of a given filename
*
* @param string filename
* @return string extension of a given filename
*/
public static function getFileExtension($file)
{
return substr($file, strrpos($file, '.') + 1);
}
/**
* replaces the file extension in a given filename
*
* @param string new file extension
* @param string filename
* @return string new filename
*/
public static function setFileExtension($type, $file)
{
return substr($file, 0, strrpos($file, '.')+1) . $type;
}
/**
* checks write permission of a given file (checks directory permission if file doesnt exists)
*
* @param string file path
* @return boolean true or false
*/
public static function checkWritePerms($file)
{
if(!is_file($file))
$file = dirname($file);
if(!is_writable($file))
return false;
return true;
}
/**
* deletes given files
*
* @throws Exception raised, if some files cant be deleted (throwed after deletion of all)
* @param array files
* @return void
*/
public static function deleteFiles($files)
{
// delete all old files
$error = array();
foreach($files as $file)
if(is_file($file))
if(!unlink($file))
$error[] = $file;
if(count($error))
throw new Exception('following files cant be deleted: "' . implode(', ', $error) . '"');
}
/**
* creates a full path (all nonexistent directories will be created)
*
* @throws Exception raised if some path token cant be created
* @param string full path
* @param string protected path (i.e. /var/www -- needed for basedir restrictions)
* @return void
*/
public static function createDir($path, $protectArea)
{
unset($tmp);
if(!is_dir($path))
{
$path = explode('/', sgLib::trimPath($protectArea, $path));
foreach($path as $dir)
{
$tmp .= $dir . '/';
if(is_dir($protectArea . $tmp))
continue;
if(!mkdir($protectArea . $tmp))
throw new Exception('path "' . $protectArea . $tmp . '" cant be deleted');
}
}
}
/**
* deletes a directory (all subdirectories and files will be deleted)
*
* @throws Exception raised if a file or directory cant be deleted
* @param string full path
* @return void
*/
public static function deleteDir($path)
{
if(!$dh = @opendir($path))
throw new Exception('directory "' . $path . '" cant be readed');
while($file = readdir($dh))
{
$myFile = $path . '/' . $file;
// ignore links and point directories
if(preg_match('/\.{1,2}/', $file) || is_link($myFile))
continue;
if(is_file($myFile))
{
if(!unlink($myFile))
throw new Exception('file "' . $myFile . '" cant be deleted');
}
elseif(is_dir($myFile))
deldir($myFile);
}
closedir($dh);
if(!@rmdir($path))
throw new Exception('directory "' . $path . '" cant be deleted');
}
/**
* searches defined files in a given path recursivly
*
* @throws Exception raised if the search directory cant be read
* @param string search in this path
* @param string optional: regular expression for files
* @param integer optional: maximum search in this depth (0 is infinite)
* @return void
*/
public static function searchFiles($path, $searchRegex='', $pathDepth=0)
{
if(!$fhd = @opendir($path))
throw new Exception('directory "' . $path . '" cant be read');
$fileArray = array();
while($file = readdir($fhd))
{
$filePath = $path . '/' . $file;
// ignore links and point directories
if(preg_match('/^\.{1,2}$/', $file) || is_link($filePath))
continue;
// save path to file or continue
if(is_file($filePath))
{
if(empty($searchRegex))
$fileArray[] = $filePath;
elseif(preg_match($searchRegex, $file))
$fileArray[] = $filePath;
continue;
}
// breakpoint, if pathDepth is reached
if($pathDepth <= 1 && $pathDepth != 0)
continue;
// next dir
if(is_dir($filePath))
$fileArray = array_merge($fileArray,
sgLib::searchFiles($filePath, $searchRegex, $pathDepth-1));
}
closedir($fhd);
return $fileArray;
}
}
?>
<?php
/***************************************************************
* Copyright notice
*
* (c) 2005-2008 Stefan Galinski (stefan.galinski@gmail.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* include some general functions only usable for the 'lfeditor' module
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
*/
/** t3lib_install */
require_once(PATH_t3lib . 'class.t3lib_install.php');
/**
* include some general functions only usable for the 'lfeditor' module
*
* @author Stefan Galinski <stefan.galinski@gmail.com>
* @package Typo3
* @subpackage tx_lfeditor
*/
abstract class tx_lfeditor_mod1_file {
/**#@+
/** @var array content of parsed files and origin of every language */
protected $localLang = array();
protected $originLang = array();
/**#@-*/
/**#@+
/** @var string informations about some paths, current file type and workspace */
protected $absPath;
protected $relFile;
protected $absFile;
protected $fileType;
protected $workspace;
/**#@-*/
/** @var array header informations */
protected $meta;
/**#@+
/** abstract methods */
abstract protected function prepareFileContents();
abstract protected function readFile();
/**#@-*/
/**
* sets some variables
*
* @param string filename or relative path from second param to the language file
* @param string absolute path to the extension or language file
* @return void
*/
public function init($file, $path) {
$this->setVar(array('absPath' => $path, 'relFile' => $file));
}
/**
* sets informations