X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fperl%2Futil.pl;fp=httemplate%2Felements%2Ffckeditor%2Feditor%2Ffilemanager%2Fconnectors%2Fperl%2Futil.pl;h=c245a040231a357abbdeb84aa63dc79c28429229;hb=7a7bcda9d75c951df9c911ce60d5b0551765daf2;hp=0000000000000000000000000000000000000000;hpb=c86fe9ea75d23d3d0c3536b709ac1e086f15a5de;p=freeside.git diff --git a/httemplate/elements/fckeditor/editor/filemanager/connectors/perl/util.pl b/httemplate/elements/fckeditor/editor/filemanager/connectors/perl/util.pl new file mode 100644 index 000000000..c245a0402 --- /dev/null +++ b/httemplate/elements/fckeditor/editor/filemanager/connectors/perl/util.pl @@ -0,0 +1,66 @@ +##### +# FCKeditor - The text editor for Internet - http://www.fckeditor.net +# Copyright (C) 2003-2010 Frederico Caldeira Knabben +# +# == BEGIN LICENSE == +# +# Licensed under the terms of any of the following licenses at your +# choice: +# +# - GNU General Public License Version 2 or later (the "GPL") +# http://www.gnu.org/licenses/gpl.html +# +# - GNU Lesser General Public License Version 2.1 or later (the "LGPL") +# http://www.gnu.org/licenses/lgpl.html +# +# - Mozilla Public License Version 1.1 or later (the "MPL") +# http://www.mozilla.org/MPL/MPL-1.1.html +# +# == END LICENSE == +# +# This is the File Manager Connector for Perl. +##### + +sub RemoveFromStart +{ + local($sourceString, $charToRemove) = @_; + $sPattern = '^' . $charToRemove . '+' ; + $sourceString =~ s/^$charToRemove+//g; + return $sourceString; +} + +sub RemoveFromEnd +{ + local($sourceString, $charToRemove) = @_; + $sPattern = $charToRemove . '+$' ; + $sourceString =~ s/$charToRemove+$//g; + return $sourceString; +} + +sub ConvertToXmlAttribute +{ + local($value) = @_; + return(&specialchar_cnv($value)); +} + +sub specialchar_cnv +{ + local($ch) = @_; + + $ch =~ s/&/&/g; # & + $ch =~ s/\"/"/g; #" + $ch =~ s/\'/'/g; # ' + $ch =~ s//>/g; # > + return($ch); +} + +sub JS_cnv +{ + local($ch) = @_; + + $ch =~ s/\"/\\\"/g; #" + return($ch); +} + +1;