1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-01 05:55:02 +03:00

merged with livestreet HEAD rev

This commit is contained in:
Stepan Tanasiychuk 2011-10-10 12:35:05 +03:00
commit 04ba72502a
40 changed files with 3599 additions and 2685 deletions

View file

@ -42,6 +42,7 @@ class ActionAdmin extends Action {
$this->AddEvent('plugins','EventPlugins');
$this->AddEvent('restorecomment','EventRestoreComment');
$this->AddEvent('userfields','EventUserfields');
$this->AddEvent('recalcfavourite','EventRecalculateFavourite');
}
@ -67,6 +68,20 @@ class ActionAdmin extends Action {
$this->SetTemplateAction('index');
}
/**
* Перестроение дерева комментариев, актуально при $config['module']['comment']['use_nested'] = true;
*
*/
protected function EventRecalculateFavourite() {
set_time_limit(0);
$this->Comment_RecalculateFavourite();
$this->Topic_RecalculateFavourite();
$this->Cache_Clean();
$this->Message_AddNotice($this->Lang_Get('admin_favourites_recalculated'),$this->Lang_Get('attention'));
$this->SetTemplateAction('index');
}
/**
* Страница со списком плагинов
*

View file

@ -428,9 +428,11 @@ class ActionAjax extends Action {
'target_publish' => $oTopic->getPublish()
)
);
if ($this->Topic_AddFavouriteTopic($oFavouriteTopicNew)) {
$oTopic->setCountFavourite($oTopic->getCountFavourite()+1);
if ($this->Topic_AddFavouriteTopic($oFavouriteTopicNew) and $this->Topic_UpdateTopic($oTopic)) {
$this->Message_AddNoticeSingle($this->Lang_Get('topic_favourite_add_ok'),$this->Lang_Get('attention'));
$this->Viewer_AssignAjax('bState',true);
$this->Viewer_AssignAjax('iCount', $oTopic->getCountFavourite());
} else {
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
return;
@ -445,9 +447,11 @@ class ActionAjax extends Action {
return;
}
if ($oFavouriteTopic and !$iType) {
if ($this->Topic_DeleteFavouriteTopic($oFavouriteTopic)) {
$oTopic->setCountFavourite($oTopic->getCountFavourite()-1);
if ($this->Topic_DeleteFavouriteTopic($oFavouriteTopic) and $this->Topic_UpdateTopic($oTopic)) {
$this->Message_AddNoticeSingle($this->Lang_Get('topic_favourite_del_ok'),$this->Lang_Get('attention'));
$this->Viewer_AssignAjax('bState',false);
$this->Viewer_AssignAjax('iCount', $oTopic->getCountFavourite());
} else {
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
return;
@ -488,9 +492,11 @@ class ActionAjax extends Action {
'target_publish' => $oComment->getPublish()
)
);
if ($this->Comment_AddFavouriteComment($oFavouriteCommentNew)) {
$oComment->setCountFavourite($oComment->getCountFavourite()+1);
if ($this->Comment_AddFavouriteComment($oFavouriteCommentNew) and $this->Comment_UpdateComment($oComment)) {
$this->Message_AddNoticeSingle($this->Lang_Get('comment_favourite_add_ok'),$this->Lang_Get('attention'));
$this->Viewer_AssignAjax('bState',true);
$this->Viewer_AssignAjax('iCount', $oComment->getCountFavourite());
} else {
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
return;
@ -505,9 +511,11 @@ class ActionAjax extends Action {
return;
}
if ($oFavouriteComment and !$iType) {
if ($this->Comment_DeleteFavouriteComment($oFavouriteComment)) {
$oComment->setCountFavourite($oComment->getCountFavourite()-1);
if ($this->Comment_DeleteFavouriteComment($oFavouriteComment) and $this->Comment_UpdateComment($oComment)) {
$this->Message_AddNoticeSingle($this->Lang_Get('comment_favourite_del_ok'),$this->Lang_Get('attention'));
$this->Viewer_AssignAjax('bState',false);
$this->Viewer_AssignAjax('iCount', $oComment->getCountFavourite());
} else {
$this->Message_AddErrorSingle($this->Lang_Get('system_error'),$this->Lang_Get('error'));
return;

View file

@ -886,5 +886,15 @@ class ModuleComment extends Module {
}
}
}
/**
* Пересчитывает счетчик избранных комментариев
*
* @return type
*/
public function RecalculateFavourite(){
return $this->oMapper->RecalculateFavourite();
}
}
?>

View file

@ -87,7 +87,11 @@ class ModuleComment_EntityComment extends Entity
}
public function getIsFavourite() {
return $this->_aData['comment_is_favourite'];
}
}
public function getCountFavourite() {
return $this->_aData['comment_count_favourite'];
}
@ -155,6 +159,9 @@ class ModuleComment_EntityComment extends Entity
}
public function setIsFavourite($data) {
$this->_aData['comment_is_favourite']=$data;
}
}
public function setCountFavourite($data) {
$this->_aData['comment_count_favourite']=$data;
}
}
?>

View file

@ -489,13 +489,14 @@ class ModuleComment_MapperComment extends Mapper {
comment_text= ?,
comment_rating= ?f,
comment_count_vote= ?d,
comment_count_favourite= ?d,
comment_delete = ?d ,
comment_publish = ?d ,
comment_text_hash = ?
WHERE
comment_id = ?d
";
if ($this->oDb->query($sql,$oComment->getText(),$oComment->getRating(),$oComment->getCountVote(),$oComment->getDelete(),$oComment->getPublish(),$oComment->getTextHash(),$oComment->getId())) {
if ($this->oDb->query($sql,$oComment->getText(),$oComment->getRating(),$oComment->getCountVote(),$oComment->getCountFavourite(),$oComment->getDelete(),$oComment->getPublish(),$oComment->getTextHash(),$oComment->getId())) {
return true;
}
return false;
@ -649,5 +650,25 @@ class ModuleComment_MapperComment extends Mapper {
}
return array();
}
public function RecalculateFavourite() {
$sql = "
UPDATE ".Config::Get('db.table.comment')." c
SET c.comment_count_favourite = (
SELECT count(f.user_id)
FROM ".Config::Get('db.table.favourite')." f
WHERE
f.target_id = c.comment_id
AND
f.target_publish = 1
AND
f.target_type = 'comment'
)
";
if ($this->oDb->query($sql)) {
return true;
}
return false;
}
}
?>

View file

@ -1635,6 +1635,15 @@ class ModuleTopic extends Module {
return $this->Image_GetWebPath($sFile);
}
/**
* Пересчитывает счетчик избранных топиков
*
* @return type
*/
public function RecalculateFavourite(){
return $this->oMapperTopic->RecalculateFavourite();
}
}
?>

View file

@ -130,6 +130,9 @@ class ModuleTopic_EntityTopic extends Entity
public function getIsFavourite() {
return $this->_aData['topic_is_favourite'];
}
public function getCountFavourite() {
return $this->_aData['topic_count_favourite'];
}
/***************************************************************************************************************************************************
* методы расширения типов топика
@ -394,6 +397,8 @@ class ModuleTopic_EntityTopic extends Entity
public function setIsFavourite($data) {
$this->_aData['topic_is_favourite']=$data;
}
public function setCountFavourite($data) {
$this->_aData['topic_count_favourite']=$data;
}
}
?>

View file

@ -383,13 +383,14 @@ class ModuleTopic_MapperTopic extends Mapper {
topic_count_vote= ?d,
topic_count_read= ?d,
topic_count_comment= ?d,
topic_count_favourite= ?d,
topic_cut_text = ? ,
topic_forbid_comment = ? ,
topic_text_hash = ?
WHERE
topic_id = ?d
";
if ($this->oDb->query($sql,$oTopic->getBlogId(),$oTopic->getTitle(),$oTopic->getTags(),$oTopic->getDateAdd(),$oTopic->getDateEdit(),$oTopic->getUserIp(),$oTopic->getPublish(),$oTopic->getPublishDraft(),$oTopic->getPublishIndex(),$oTopic->getRating(),$oTopic->getCountVote(),$oTopic->getCountRead(),$oTopic->getCountComment(),$oTopic->getCutText(),$oTopic->getForbidComment(),$oTopic->getTextHash(),$oTopic->getId())) {
if ($this->oDb->query($sql,$oTopic->getBlogId(),$oTopic->getTitle(),$oTopic->getTags(),$oTopic->getDateAdd(),$oTopic->getDateEdit(),$oTopic->getUserIp(),$oTopic->getPublish(),$oTopic->getPublishDraft(),$oTopic->getPublishIndex(),$oTopic->getRating(),$oTopic->getCountVote(),$oTopic->getCountRead(),$oTopic->getCountComment(),$oTopic->getCountFavourite(),$oTopic->getCutText(),$oTopic->getForbidComment(),$oTopic->getTextHash(),$oTopic->getId())) {
$this->UpdateTopicContent($oTopic);
return true;
}
@ -798,5 +799,25 @@ class ModuleTopic_MapperTopic extends Mapper {
id= ?d';
$this->oDb->query($sql, $iPhotoId);
}
public function RecalculateFavourite() {
$sql = "
UPDATE ".Config::Get('db.table.topic')." t
SET t.topic_count_favourite = (
SELECT count(f.user_id)
FROM ".Config::Get('db.table.favourite')." f
WHERE
f.target_id = t.topic_id
AND
f.target_publish = 1
AND
f.target_type = 'topic'
)
";
if ($this->oDb->query($sql)) {
return true;
}
return false;
}
}
?>

View file

@ -1,340 +1,177 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU LESSER GENERAL PUBLIC LICENSE
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Version 2.1, February 1999
Preamble
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
Preamble
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
* a) The modified work must itself be a software library.
* b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
* c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
* d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
NO WARRANTY
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
This program 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.
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
This program 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.
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
* a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
* b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
* c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
* d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
* e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
* a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
* b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice

28
engine/lib/external/CSSTidy-1.3/NEWS vendored Normal file
View file

@ -0,0 +1,28 @@
Changelog
Key: # = backwards incompatible change, ! = new feature, - = bugfix.
1.4, unknown release date
# CSSTidy is now licensed under LGPL!
! csstidy->set_cfg now accept a single parameter, an associative array, to
set all configuration options
! Templates can now be loaded via set_cfg using the 'template' config
parameter
! csstidy_print->formatted_page added, returns a full XHTML page based
off of csstidy_print->formatted
! cssparsed.css created, contains just the CSS for formatted CSS output
! New CSS 3 units "ch" and "turn" added
! Unit tests added, requires Text_Diff (PEAR) and SimpleTest
! Some invalid selectors are now removed during optimization, this can
be turned off by setting 'discard_invalid_selectors' to false
- Added localizations for css_optimiser.php
- Fixed bug with cookie setting for custom templates
- Minor security problem in css_optimiser.php fixed
- Fixed bug with float handling in exotic locales
- Fixed bug with non-functioning getenv in ASAPI
- Fixed bug with bad hexadecimal syntax recovery
- At-selectors optimized by removing unnecessary url()
- Fixed optimisation: 1.0 was not optimised to 1
- Fixed incorrect parsing of !imporant close to numbers
- Allowed Copy to Clipboard for Firefox if preference set (if not, gives
instructions on how to add and warning re: security)

View file

@ -1,28 +1,43 @@
CSSTidy
Changelog: http://cdburnerxp.se/cssparse/csstidy/changelog.php
css_optimiser.php is the web-interface, css_parser.php contains the PHP class (CSSTidy).
This class represents a CSS parser which reads CSS code and saves it in an array.
In opposite to most other CSS parsers, it does not use regular expressions and
thus has full CSS2 support and a higher reliability. The downside of not using regular expressions
is a lower speed though.
Additional to that it applies some optimisations and fixes to the CSS code.
An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
CSSTidy 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.
CSSTidy 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.
You should have received a copy of the GNU General Public License
along with CSSTidy; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
CSSTidy
---
CSSTidy is a CSS minifier
Since the original project (http://csstidy.sourceforge.net/index.php) has been suspended
here is the import of https://csstidy.svn.sourceforge.net/svnroot/csstidy on 2010-11-14
master branch corresponds to the trunk of svn repository and shoul be stabilized
v1.3 branch corresponds to the last stable relase published by the author.
It integrates some bugfixes and a 1.3.1 version has been taged
Only PHP version is here maintained
---
CSSTidy
Original Tracker :
http://sourceforge.net/tracker/?group_id=148404&atid=771415
css_optimiser.php is the web-interface, css_parser.php contains the PHP class (CSSTidy).
This class represents a CSS parser which reads CSS code and saves it in an array.
In opposite to most other CSS parsers, it does not use regular expressions and
thus has full CSS2 support and a higher reliability. The downside of not using regular expressions
is a lower speed though.
Additional to that it applies some optimisations and fixes to the CSS code.
An online version should be available here: http://cdburnerxp.se/cssparse/css_optimiser.php
Copyright 2005, 2006, 2007 Florian Schmitz
CSSTidy is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
CSSTidy 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,46 @@
<?php
/**
* CSSTidy - CSS Parser and Optimiser
*
* CSS ctype functions
* Defines some functions that can be not defined.
*
* This file is part of CSSTidy.
*
* CSSTidy 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.
*
* CSSTidy 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.
*
* You should have received a copy of the GNU General Public License
* along with CSSTidy; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @package csstidy
* @author Nikolay Matsievsky (speed at webo dot name) 2009-2010
* @version 1.0
*/
/* ctype_space Check for whitespace character(s) */
if (!function_exists('ctype_space')) {
function ctype_space($text) {
return!preg_match("/[^\s\r\n\t\f]/", $text);
}
}
/* ctype_alpha Check for alphabetic character(s) */
if (!function_exists('ctype_alpha')) {
function ctype_alpha($text) {
return preg_match("/[a-zA-Z]/", $text);
}
}
?>

File diff suppressed because it is too large Load diff

View file

@ -1,29 +1,33 @@
<?php
/**
* CSSTidy - CSS Parser and Optimiser
*
* CSS Printing class
* This class prints CSS data generated by csstidy.
*
* Copyright 2005, 2006, 2007 Florian Schmitz
*
* This file is part of CSSTidy.
*
* CSSTidy 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.
* CSSTidy is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* CSSTidy 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.
* CSSTidy 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You should have received a copy of the GNU General Public License
* along with CSSTidy; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2006
* @author Florian Schmitz (floele at gmail dot com) 2005-2007
* @author Brett Zamir (brettz9 at yahoo dot com) 2007
* @author Cedric Morin (cedric at yterium dot com) 2010
*/
/**
@ -33,317 +37,370 @@
*
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2006
* @version 1.0
* @version 1.0.1
*/
class csstidy_print {
class csstidy_print
{
/**
* Saves the input CSS string
* @var string
* @access private
*/
var $input_css = '';
/**
* Saves the input CSS string
* @var string
* @access private
*/
var $input_css = '';
/**
* Saves the formatted CSS string
* @var string
* @access public
*/
var $output_css = '';
/**
* Saves the formatted CSS string (plain text)
* @var string
* @access public
*/
var $output_css_plain = '';
/**
* Saves the formatted CSS string
* @var string
* @access public
*/
var $output_css = '';
/**
* Constructor
* @param array $css contains the class csstidy
* @access private
* @version 1.0
*/
function csstidy_print(&$css) {
$this->parser = & $css;
$this->css = & $css->css;
$this->template = & $css->template;
$this->tokens = & $css->tokens;
$this->charset = & $css->charset;
$this->import = & $css->import;
$this->namespace = & $css->namespace;
}
/**
* Saves the formatted CSS string (plain text)
* @var string
* @access public
*/
var $output_css_plain = '';
/**
* Resets output_css and output_css_plain (new css code)
* @access private
* @version 1.0
*/
function _reset() {
$this->output_css = '';
$this->output_css_plain = '';
}
/**
* Constructor
* @param array $css contains the class csstidy
* @access private
* @version 1.0
*/
function csstidy_print(&$css)
{
$this->parser =& $css;
$this->css =& $css->css;
$this->template =& $css->template;
$this->tokens =& $css->tokens;
$this->charset =& $css->charset;
$this->import =& $css->import;
$this->namespace =& $css->namespace;
}
/**
* Returns the CSS code as plain text
* @param string $default_media default @media to add to selectors without any @media
* @return string
* @access public
* @version 1.0
*/
function plain($default_media='') {
$this->_print(true, $default_media);
return $this->output_css_plain;
}
/**
* Resets output_css and output_css_plain (new css code)
* @access private
* @version 1.0
*/
function _reset()
{
$this->output_css = '';
$this->output_css_plain = '';
}
/**
* Returns the formatted CSS code
* @param string $default_media default @media to add to selectors without any @media
* @return string
* @access public
* @version 1.0
*/
function formatted($default_media='') {
$this->_print(false, $default_media);
return $this->output_css;
}
/**
* Returns the CSS code as plain text
* @return string
* @access public
* @version 1.0
*/
function plain()
{
$this->_print(true);
return $this->output_css_plain;
}
/**
* Returns the formatted CSS code to make a complete webpage
* @param string $doctype shorthand for the document type
* @param bool $externalcss indicates whether styles to be attached internally or as an external stylesheet
* @param string $title title to be added in the head of the document
* @param string $lang two-letter language code to be added to the output
* @return string
* @access public
* @version 1.4
*/
function formatted_page($doctype='xhtml1.1', $externalcss=true, $title='', $lang='en') {
switch ($doctype) {
case 'xhtml1.0strict':
$doctype_output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
break;
case 'xhtml1.1':
default:
$doctype_output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">';
break;
}
/**
* Returns the formatted CSS code
* @return string
* @access public
* @version 1.0
*/
function formatted()
{
$this->_print(false);
return $this->output_css;
}
$output = $cssparsed = '';
$this->output_css_plain = & $output;
/**
* Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
* @param bool $plain plain text or not
* @access private
* @version 2.0
*/
function _print($plain = false)
{
if ($this->output_css && $this->output_css_plain) {
return;
}
$output .= $doctype_output . "\n" . '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $lang . '"';
$output .= ( $doctype === 'xhtml1.1') ? '>' : ' lang="' . $lang . '">';
$output .= "\n<head>\n <title>$title</title>";
$output = '';
if (!$this->parser->get_cfg('preserve_css')) {
$this->_convert_raw_css();
}
if ($externalcss) {
$output .= "\n <style type=\"text/css\">\n";
$cssparsed = file_get_contents('cssparsed.css');
$output .= $cssparsed; // Adds an invisible BOM or something, but not in css_optimised.php
$output .= "\n</style>";
} else {
$output .= "\n" . ' <link rel="stylesheet" type="text/css" href="cssparsed.css" />';
// }
}
$output .= "\n</head>\n<body><code id=\"copytext\">";
$output .= $this->formatted();
$output .= '</code>' . "\n" . '</body></html>';
return $this->output_css_plain;
}
$template =& $this->template;
/**
* Returns the formatted CSS Code and saves it into $this->output_css and $this->output_css_plain
* @param bool $plain plain text or not
* @param string $default_media default @media to add to selectors without any @media
* @access private
* @version 2.0
*/
function _print($plain = false, $default_media='') {
if ($this->output_css && $this->output_css_plain) {
return;
}
if ($plain) {
$template = array_map('strip_tags', $template);
}
$output = '';
if (!$this->parser->get_cfg('preserve_css')) {
$this->_convert_raw_css($default_media);
}
if ($this->parser->get_cfg('timestamp')) {
array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
}
$template = & $this->template;
if (!empty($this->charset)) {
$output .= $template[0].'@charset '.$template[5].$this->charset.$template[6];
}
if ($plain) {
$template = array_map('strip_tags', $template);
}
if (!empty($this->import)) {
for ($i = 0, $size = count($this->import); $i < $size; $i ++) {
$output .= $template[0].'@import '.$template[5].$this->import[$i].$template[6];
}
}
if ($this->parser->get_cfg('timestamp')) {
array_unshift($this->tokens, array(COMMENT, ' CSSTidy ' . $this->parser->version . ': ' . date('r') . ' '));
}
if (!empty($this->namespace)) {
$output .= $template[0].'@namespace '.$template[5].$this->namespace.$template[6];
}
if (!empty($this->charset)) {
$output .= $template[0] . '@charset ' . $template[5] . $this->charset . $template[6];
}
$output .= $template[13];
$in_at_out = '';
$out =& $output;
if (!empty($this->import)) {
for ($i = 0, $size = count($this->import); $i < $size; $i++) {
if (substr($this->import[$i], 0, 4) === 'url(' && substr($this->import[$i], -1, 1) === ')') {
$this->import[$i] = '\'' . substr($this->import[$i], 4, -1) . '\'';
$this->parser->log('Optimised @import : Removed "url("', 'Information');
}
$output .= $template[0] . '@import ' . $template[5] . $this->import[$i] . $template[6];
}
}
foreach ($this->tokens as $key => $token)
{
switch ($token[0])
{
case AT_START:
$out .= $template[0].$this->_htmlsp($token[1], $plain).$template[1];
$out =& $in_at_out;
break;
if (!empty($this->namespace)) {
if (substr($this->namespace, 0, 4) === 'url(' && substr($this->namespace, -1, 1) === ')') {
$this->namespace = '\'' . substr($this->namespace, 4, -1) . '\'';
$this->parser->log('Optimised @namespace : Removed "url("', 'Information');
}
$output .= $template[0] . '@namespace ' . $template[5] . $this->namespace . $template[6];
}
case SEL_START:
if($this->parser->get_cfg('lowercase_s')) $token[1] = strtolower($token[1]);
$out .= ($token[1]{0} !== '@') ? $template[2].$this->_htmlsp($token[1], $plain) : $template[0].$this->_htmlsp($token[1], $plain);
$out .= $template[3];
break;
$output .= $template[13];
$in_at_out = '';
$out = & $output;
case PROPERTY:
if($this->parser->get_cfg('case_properties') == 2) $token[1] = strtoupper($token[1]);
if($this->parser->get_cfg('case_properties') == 1) $token[1] = strtolower($token[1]);
$out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
break;
foreach ($this->tokens as $key => $token) {
switch ($token[0]) {
case AT_START:
$out .= $template[0] . $this->_htmlsp($token[1], $plain) . $template[1];
$out = & $in_at_out;
break;
case VALUE:
$out .= $this->_htmlsp($token[1], $plain);
if($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
$out .= str_replace(';', '', $template[6]);
} else {
$out .= $template[6];
}
break;
case SEL_START:
if ($this->parser->get_cfg('lowercase_s'))
$token[1] = strtolower($token[1]);
$out .= ( $token[1]{0} !== '@') ? $template[2] . $this->_htmlsp($token[1], $plain) : $template[0] . $this->_htmlsp($token[1], $plain);
$out .= $template[3];
break;
case SEL_END:
$out .= $template[7];
if($this->_seeknocomment($key, 1) != AT_END) $out .= $template[8];
break;
case PROPERTY:
if ($this->parser->get_cfg('case_properties') === 2) {
$token[1] = strtoupper($token[1]);
} elseif ($this->parser->get_cfg('case_properties') === 1) {
$token[1] = strtolower($token[1]);
}
$out .= $template[4] . $this->_htmlsp($token[1], $plain) . ':' . $template[5];
break;
case AT_END:
$out =& $output;
$out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out);
$in_at_out = '';
$out .= $template[9];
break;
case VALUE:
$out .= $this->_htmlsp($token[1], $plain);
if ($this->_seeknocomment($key, 1) == SEL_END && $this->parser->get_cfg('remove_last_;')) {
$out .= str_replace(';', '', $template[6]);
} else {
$out .= $template[6];
}
break;
case COMMENT:
$out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
break;
}
}
case SEL_END:
$out .= $template[7];
if ($this->_seeknocomment($key, 1) != AT_END)
$out .= $template[8];
break;
$output = trim($output);
case AT_END:
$out = & $output;
$out .= $template[10] . str_replace("\n", "\n" . $template[10], $in_at_out);
$in_at_out = '';
$out .= $template[9];
break;
if (!$plain) {
$this->output_css = $output;
$this->_print(true);
} else {
$this->output_css_plain = $output;
}
}
case COMMENT:
$out .= $template[11] . '/*' . $this->_htmlsp($token[1], $plain) . '*/' . $template[12];
break;
}
}
/**
* Gets the next token type which is $move away from $key, excluding comments
* @param integer $key current position
* @param integer $move move this far
* @return mixed a token type
* @access private
* @version 1.0
*/
function _seeknocomment($key, $move) {
$go = ($move > 0) ? 1 : -1;
for ($i = $key + 1; abs($key-$i)-1 < abs($move); $i += $go) {
if (!isset($this->tokens[$i])) {
return;
}
if ($this->tokens[$i][0] == COMMENT) {
$move += 1;
continue;
}
return $this->tokens[$i][0];
}
}
$output = trim($output);
/**
* Converts $this->css array to a raw array ($this->tokens)
* @access private
* @version 1.0
*/
function _convert_raw_css()
{
$this->tokens = array();
if (!$plain) {
$this->output_css = $output;
$this->_print(true);
} else {
// If using spaces in the template, don't want these to appear in the plain output
$this->output_css_plain = str_replace('&#160;', '', $output);
}
}
foreach ($this->css as $medium => $val)
{
if ($this->parser->get_cfg('sort_selectors')) ksort($val);
if ($medium != DEFAULT_AT) {
$this->parser->_add_token(AT_START, $medium, true);
}
/**
* Gets the next token type which is $move away from $key, excluding comments
* @param integer $key current position
* @param integer $move move this far
* @return mixed a token type
* @access private
* @version 1.0
*/
function _seeknocomment($key, $move) {
$go = ($move > 0) ? 1 : -1;
for ($i = $key + 1; abs($key - $i) - 1 < abs($move); $i += $go) {
if (!isset($this->tokens[$i])) {
return;
}
if ($this->tokens[$i][0] == COMMENT) {
$move += 1;
continue;
}
return $this->tokens[$i][0];
}
}
foreach ($val as $selector => $vali)
{
if ($this->parser->get_cfg('sort_properties')) ksort($vali);
$this->parser->_add_token(SEL_START, $selector, true);
/**
* Converts $this->css array to a raw array ($this->tokens)
* @param string $default_media default @media to add to selectors without any @media
* @access private
* @version 1.0
*/
function _convert_raw_css($default_media='') {
$this->tokens = array();
foreach ($vali as $property => $valj)
{
$this->parser->_add_token(PROPERTY, $property, true);
$this->parser->_add_token(VALUE, $valj, true);
}
foreach ($this->css as $medium => $val) {
if ($this->parser->get_cfg('sort_selectors'))
ksort($val);
if (intval($medium) < DEFAULT_AT) {
$this->parser->_add_token(AT_START, $medium, true);
}
elseif ($default_media) {
$this->parser->_add_token(AT_START, $default_media, true);
}
foreach ($val as $selector => $vali) {
if ($this->parser->get_cfg('sort_properties'))
ksort($vali);
$this->parser->_add_token(SEL_START, $selector, true);
$this->parser->_add_token(SEL_END, $selector, true);
}
foreach ($vali as $property => $valj) {
$this->parser->_add_token(PROPERTY, $property, true);
$this->parser->_add_token(VALUE, $valj, true);
}
if ($medium != DEFAULT_AT) {
$this->parser->_add_token(AT_END, $medium, true);
}
}
}
$this->parser->_add_token(SEL_END, $selector, true);
}
/**
* Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
* @param string $string
* @param bool $plain
* @return string
* @see csstidy_print::_print()
* @access private
* @version 1.0
*/
function _htmlsp($string, $plain)
{
if (!$plain) {
return htmlspecialchars($string);
}
return $string;
}
if (intval($medium) < DEFAULT_AT) {
$this->parser->_add_token(AT_END, $medium, true);
}
elseif ($default_media) {
$this->parser->_add_token(AT_END, $default_media, true);
}
}
}
/**
* Get compression ratio
* @access public
* @return float
* @version 1.2
*/
function get_ratio()
{
if (!$this->output_css_plain) {
$this->formatted();
}
return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
}
/**
* Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes print_code() cleaner.
* @param string $string
* @param bool $plain
* @return string
* @see csstidy_print::_print()
* @access private
* @version 1.0
*/
function _htmlsp($string, $plain) {
if (!$plain) {
return htmlspecialchars($string, ENT_QUOTES, 'utf-8');
}
return $string;
}
/**
* Get difference between the old and new code in bytes and prints the code if necessary.
* @access public
* @return string
* @version 1.1
*/
function get_diff()
{
if (!$this->output_css_plain) {
$this->formatted();
}
/**
* Get compression ratio
* @access public
* @return float
* @version 1.2
*/
function get_ratio() {
if (!$this->output_css_plain) {
$this->formatted();
}
return round((strlen($this->input_css) - strlen($this->output_css_plain)) / strlen($this->input_css), 3) * 100;
}
$diff = strlen($this->output_css_plain) - strlen($this->input_css);
/**
* Get difference between the old and new code in bytes and prints the code if necessary.
* @access public
* @return string
* @version 1.1
*/
function get_diff() {
if (!$this->output_css_plain) {
$this->formatted();
}
if ($diff > 0) {
return '+' . $diff;
} elseif ($diff == 0) {
return '+-' . $diff;
}
$diff = strlen($this->output_css_plain) - strlen($this->input_css);
return $diff;
}
if ($diff > 0) {
return '+' . $diff;
} elseif ($diff == 0) {
return '+-' . $diff;
}
/**
* Get the size of either input or output CSS in KB
* @param string $loc default is "output"
* @access public
* @return integer
* @version 1.0
*/
function size($loc = 'output')
{
if ($loc == 'output' && !$this->output_css) {
$this->formatted();
}
return $diff;
}
/**
* Get the size of either input or output CSS in KB
* @param string $loc default is "output"
* @access public
* @return integer
* @version 1.0
*/
function size($loc = 'output') {
if ($loc === 'output' && !$this->output_css) {
$this->formatted();
}
if ($loc === 'input') {
return (strlen($this->input_css) / 1000);
} else {
return (strlen($this->output_css_plain) / 1000);
}
}
if ($loc == 'input') {
return (strlen($this->input_css) / 1000);
} else {
return (strlen($this->output_css_plain) / 1000);
}
}
}
?>

View file

@ -0,0 +1,478 @@
<?php
/**
* CSSTidy - CSS Optimiser Interface
* This file produces an XHTML interface for optimising CSS code
*
* Copyright 2005, 2006, 2007 Florian Schmitz
*
* This file is part of CSSTidy.
*
* CSSTidy is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* CSSTidy 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2007
* @author Brett Zamir (brettz9 at yahoo dot com) 2007
*/
require('class.csstidy.php');
require('lang.inc.php');
if (get_magic_quotes_gpc()) {
if (isset($_REQUEST['css_text'])) {
$_REQUEST['css_text'] = stripslashes($_REQUEST['css_text']);
}
if (isset($_REQUEST['custom'])) {
$_REQUEST['custom'] = stripslashes($_REQUEST['custom']);
}
if (isset($_COOKIE['custom_template'])) {
$_COOKIE['custom_template'] = stripslashes($_COOKIE['custom_template']);
}
}
function rmdirr($dirname,$oc=0)
{
// Sanity check
if (!file_exists($dirname)) {
return false;
}
// Simple delete for a file
if (is_file($dirname) && (time()-fileatime($dirname))>3600) {
return unlink($dirname);
}
// Loop through the folder
if(is_dir($dirname))
{
$dir = dir($dirname);
while (false !== $entry = $dir->read()) {
// Skip pointers
if ($entry === '.' || $entry === '..') {
continue;
}
// Recurse
rmdirr($dirname.'/'.$entry,$oc);
}
$dir->close();
}
// Clean up
if ($oc==1)
{
return rmdir($dirname);
}
}
function options($options, $selected = null, $labelIsValue = false)
{
$html = '';
settype($selected, 'array');
settype($options, 'array');
foreach ($options as $value=>$label)
{
if (is_array($label)) {
$value = $label[0];
$label = $label[1];
}
$label = htmlspecialchars($label, ENT_QUOTES, 'utf-8');
$value = $labelIsValue ? $label
: htmlspecialchars($value, ENT_QUOTES, 'utf-8');
$html .= '<option value="'.$value.'"';
if (in_array($value, $selected)) {
$html .= ' selected="selected"';
}
$html .= '>'.$label.'</option>';
}
if (!$html) {
$html .= '<option value="0">---</option>';
}
return $html;
}
$css = new csstidy();
$is_custom = isset($_REQUEST['custom']) && !empty($_REQUEST['custom']) && isset($_REQUEST['template']) && ($_REQUEST['template'] === '4');
if($is_custom)
{
setcookie ('custom_template', $_REQUEST['custom'], time()+360000);
}
rmdirr('temp');
if(isset($_REQUEST['case_properties'])) $css->set_cfg('case_properties',$_REQUEST['case_properties']);
if(isset($_REQUEST['lowercase'])) $css->set_cfg('lowercase_s',true);
if(!isset($_REQUEST['compress_c']) && isset($_REQUEST['post'])) $css->set_cfg('compress_colors',false);
if(!isset($_REQUEST['compress_fw']) && isset($_REQUEST['post'])) $css->set_cfg('compress_font-weight',false);
if(isset($_REQUEST['merge_selectors'])) $css->set_cfg('merge_selectors', $_REQUEST['merge_selectors']);
if(isset($_REQUEST['optimise_shorthands'])) $css->set_cfg('optimise_shorthands',$_REQUEST['optimise_shorthands']);
if(!isset($_REQUEST['rbs']) && isset($_REQUEST['post'])) $css->set_cfg('remove_bslash',false);
if(isset($_REQUEST['preserve_css'])) $css->set_cfg('preserve_css',true);
if(isset($_REQUEST['sort_sel'])) $css->set_cfg('sort_selectors',true);
if(isset($_REQUEST['sort_de'])) $css->set_cfg('sort_properties',true);
if(isset($_REQUEST['remove_last_sem'])) $css->set_cfg('remove_last_;',true);
if(isset($_REQUEST['discard'])) $css->set_cfg('discard_invalid_properties',true);
if(isset($_REQUEST['css_level'])) $css->set_cfg('css_level',$_REQUEST['css_level']);
if(isset($_REQUEST['timestamp'])) $css->set_cfg('timestamp',true);
// This by itself is enough since our scripts don't use DOM to create elements (in which case the namespace aware ones
// should be used when serving as application/xhtml+xml but not when served as text/html ;
// also, case will be different when retrieving element names, as HTML DOM returns in upper case,
// genuine XHTML DOM (when XHTML served as such) as lower
if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) {
$http_accept = 'application/xhtml+xml';
}
elseif (stristr($_SERVER['HTTP_ACCEPT'], 'application/xml')) {
$http_accept = 'application/xml';
}
elseif (stristr($_SERVER['HTTP_ACCEPT'], 'text/xml')) {
$http_accept = 'text/xml';
}
elseif (stristr($_SERVER['HTTP_USER_AGENT'], 'Opera ') || stristr($_SERVER['HTTP_USER_AGENT'], 'Opera/')) {
preg_match('@Opera/(\d)@', $_SERVER['HTTP_USER_AGENT'], $matches);
if (isset($matches[1]) && $matches[1] >= 7) {
$http_accept = 'application/xhtml+xml';
}
else {
$http_accept = 'text/html';
}
}
else {
$http_accept = 'text/html';
}
header('Content-Type: '.$http_accept.'; charset=utf-8');
if ($http_accept === 'text/html') {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
}
else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<?php
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $l; ?>">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>
<?php echo $lang[$l][0]; echo $css->version; ?>)
</title>
<link rel="stylesheet" href="cssparse.css" type="text/css" />
<script type="text/javascript"><!--/*--><![CDATA[/*><!--*/
function enable_disable_preserve()
{
var inputs = new Array('sort_sel', 'sort_de', 'optimise_shorthands', 'merge_selectors', 'none');
var inputs_v = new Array( true, true, true, true, false);
for(var i = 0; i < inputs.length; i++)
{
if(document.getElementById('preserve_css').checked) {
document.getElementById(inputs[i]).disabled = inputs_v[i];
} else {
document.getElementById(inputs[i]).disabled = !inputs_v[i];
}
}
}
function ClipBoard()
{
if (window.clipboardData) { // Feature testing
window.clipboardData.setData('Text',document.getElementById("copytext").innerText);
}
else if (navigator.userAgent.indexOf('Gecko') != -1
&& navigator.userAgent.indexOf('Apple') == -1
) {
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
const gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].
getService(Components.interfaces.nsIClipboardHelper);
gClipboardHelper.copyString(document.getElementById("copytext").innerHTML);
}
catch (e) {
alert(e+"\n\n"+"<?php echo $lang[$l][66] ?>");
}
}
else {
alert("<?php echo $lang[$l][60]; ?>");
}
}
/*]]>*/-->
</script>
</head>
<body onload="enable_disable_preserve()">
<div><h1 style="display:inline">
<?php echo $lang[$l][1]; ?>
</h1>
<?php echo $lang[$l][2]; ?> <a
href="http://csstidy.sourceforge.net/">csstidy</a> <?php echo $css->version; ?>)
</div><p>
<?php echo $lang[$l][39]; ?>: <a hreflang="en" href="?lang=en">English</a> <a hreflang="de" href="?lang=de">Deutsch</a> <a hreflang="fr" href="?lang=fr">French</a> <a hreflang="zh" href="?lang=zh">Chinese</a></p>
<p><?php echo $lang[$l][4]; ?>
<?php echo $lang[$l][6]; ?>
</p>
<form method="post" action="">
<div>
<fieldset id="field_input">
<legend><?php echo $lang[$l][8]; ?></legend> <label for="css_text"
class="block"><?php echo $lang[$l][9]; ?></label><textarea id="css_text" name="css_text" rows="20" cols="35"><?php if(isset($_REQUEST['css_text'])) echo htmlspecialchars($_REQUEST['css_text'], ENT_QUOTES, "utf-8"); ?></textarea>
<label for="url"><?php echo $lang[$l][10]; ?></label> <input type="text"
name="url" id="url" <?php if(isset($_REQUEST['url']) &&
!empty($_REQUEST['url'])) echo 'value="',htmlspecialchars($_REQUEST['url'], ENT_QUOTES, 'utf-8'),'"'; ?>
size="35" /><br />
<input type="submit" value="<?php echo $lang[$l][35]; ?>" id="submit" />
</fieldset>
<div id="rightcol">
<fieldset id="code_layout">
<legend><?php echo $lang[$l][11]; ?></legend> <label for="template"
class="block"><?php echo $lang[$l][12]; ?></label> <select
id="template" name="template" style="margin-bottom:1em;">
<?php
$num = (isset($_REQUEST['template'])) ? intval($_REQUEST['template']) : 1;
echo options(array(3 => $lang[$l][13], 2 => $lang[$l][14], 1 => $lang[$l][15], 0 => $lang[$l][16], 4 => $lang[$l][17]), $num);
?>
</select><br />
<label for="custom" class="block">
<?php echo $lang[$l][18]; ?> </label> <textarea id="custom"
name="custom" cols="33" rows="4"><?php
if($is_custom) echo
htmlspecialchars($_REQUEST['custom'], ENT_QUOTES, 'utf-8');
elseif(isset($_COOKIE['custom_template']) &&
!empty($_COOKIE['custom_template'])) echo
htmlspecialchars($_COOKIE['custom_template'], ENT_QUOTES, 'utf-8');
?></textarea>
</fieldset>
<fieldset id="options">
<legend><?php echo $lang[$l][19]; ?></legend>
<input onchange="enable_disable_preserve()" type="checkbox" name="preserve_css" id="preserve_css"
<?php if($css->get_cfg('preserve_css')) echo 'checked="checked"'; ?> />
<label for="preserve_css" title="<?php echo $lang[$l][52]; ?>" class="help"><?php echo $lang[$l][51]; ?></label><br />
<input type="checkbox" name="sort_sel" id="sort_sel"
<?php if($css->get_cfg('sort_selectors')) echo 'checked="checked"'; ?> />
<label for="sort_sel" title="<?php echo $lang[$l][41]; ?>" class="help"><?php echo $lang[$l][20]; ?></label><br />
<input type="checkbox" name="sort_de" id="sort_de"
<?php if($css->get_cfg('sort_properties')) echo 'checked="checked"'; ?> />
<label for="sort_de"><?php echo $lang[$l][21]; ?></label><br />
<label for="merge_selectors"><?php echo $lang[$l][22]; ?></label>
<select style="width:15em;" name="merge_selectors" id="merge_selectors">
<?php echo options(array('0' => $lang[$l][47], '1' => $lang[$l][48], '2' => $lang[$l][49]), $css->get_cfg('merge_selectors')); ?>
</select><br />
<label for="optimise_shorthands"><?php echo $lang[$l][23]; ?></label>
<select name="optimise_shorthands" id="optimise_shorthands">
<?php echo options(array($lang[$l][54], $lang[$l][55], $lang[$l][56]), $css->get_cfg('optimise_shorthands')); ?>
</select><br />
<input type="checkbox" name="compress_c" id="compress_c"
<?php if($css->get_cfg('compress_colors')) echo 'checked="checked"';?> />
<label for="compress_c"><?php echo $lang[$l][24]; ?></label><br />
<input type="checkbox" name="compress_fw" id="compress_fw"
<?php if($css->get_cfg('compress_font-weight')) echo 'checked="checked"';?> />
<label for="compress_fw"><?php echo $lang[$l][45]; ?></label><br />
<input type="checkbox" name="lowercase" id="lowercase" value="lowercase"
<?php if($css->get_cfg('lowercase_s')) echo 'checked="checked"'; ?> />
<label title="<?php echo $lang[$l][30]; ?>" class="help" for="lowercase"><?php echo $lang[$l][25]; ?></label><br />
<?php echo $lang[$l][26]; ?><br />
<input type="radio" name="case_properties" id="none" value="0"
<?php if($css->get_cfg('case_properties') === 0) echo 'checked="checked"'; ?> />
<label for="none"><?php echo $lang[$l][53]; ?></label>
<input type="radio" name="case_properties" id="lower_yes" value="1"
<?php if($css->get_cfg('case_properties') === 1) echo 'checked="checked"'; ?> />
<label for="lower_yes"><?php echo $lang[$l][27]; ?></label>
<input type="radio" name="case_properties" id="upper_yes" value="2"
<?php if($css->get_cfg('case_properties') === 2) echo 'checked="checked"'; ?> />
<label for="upper_yes"><?php echo $lang[$l][29]; ?></label><br />
<input type="checkbox" name="rbs" id="rbs"
<?php if($css->get_cfg('remove_bslash')) echo 'checked="checked"'; ?> />
<label for="rbs"><?php echo $lang[$l][31]; ?></label><br />
<input type="checkbox" id="remove_last_sem" name="remove_last_sem"
<?php if($css->get_cfg('remove_last_;')) echo 'checked="checked"'; ?> />
<label for="remove_last_sem"><?php echo $lang[$l][42]; ?></label><br />
<input type="checkbox" id="discard" name="discard"
<?php if($css->get_cfg('discard_invalid_properties')) echo 'checked="checked"'; ?> />
<label for="discard"><?php echo $lang[$l][43]; ?></label>
<select name="css_level"><?php echo options(array('CSS2.1','CSS2.0','CSS1.0'),$css->get_cfg('css_level'), true); ?></select><br />
<input type="checkbox" id="timestamp" name="timestamp"
<?php if($css->get_cfg('timestamp')) echo 'checked="checked"'; ?> />
<label for="timestamp"><?php echo $lang[$l][57]; ?></label><br />
<input type="checkbox" id="whole_file" name="whole_file"
<?php if(isset($_REQUEST['whole_file'])) echo 'checked="checked"'; ?> />
<label for="whole_file"><?php echo $lang[$l][63]; ?></label><br />
<input type="checkbox" name="file_output" id="file_output" value="file_output"
<?php if(isset($_REQUEST['file_output'])) echo 'checked="checked"'; ?> />
<label class="help" title="<?php echo $lang[$l][34]; ?>" for="file_output">
<strong><?php echo $lang[$l][33]; ?></strong>
</label><br />
</fieldset>
<input type="hidden" name="post" />
</div>
</div>
</form>
<?php
$file_ok = false;
$result = false;
$url = (isset($_REQUEST['url']) && !empty($_REQUEST['url'])) ? $_REQUEST['url'] : false;
if(isset($_REQUEST['template']))
{
switch($_REQUEST['template'])
{
case 4:
if($is_custom)
{
$css->load_template($_REQUEST['custom'],false);
}
break;
case 3:
$css->load_template('highest_compression');
break;
case 2:
$css->load_template('high_compression');
break;
case 0:
$css->load_template('low_compression');
break;
}
}
if($url)
{
if(substr($_REQUEST['url'],0,7) !== 'http://')
{
$_REQUEST['url'] = 'http://'.$_REQUEST['url'];
}
$result = $css->parse_from_url($_REQUEST['url'],0);
}
elseif(isset($_REQUEST['css_text']) && strlen($_REQUEST['css_text'])>5)
{
$result = $css->parse($_REQUEST['css_text']);
}
if($result)
{
$ratio = $css->print->get_ratio();
$diff = $css->print->get_diff();
if(isset($_REQUEST['file_output']))
{
$filename = md5(mt_rand().time().mt_rand());
if (!is_dir('temp')) {
$madedir = mkdir('temp');
if (!$madedir) {
print 'Could not make directory "temp" in '.dirname(__FILE__);
exit;
}
}
$handle = fopen('temp/'.$filename.'.css','w');
if($handle) {
if(fwrite($handle,$css->print->plain()))
{
$file_ok = true;
}
}
fclose($handle);
}
if($ratio>0) $ratio = '<span style="color:green;">'.$ratio.'%</span>
('.$diff.' Bytes)'; else $ratio = '<span
style="color:red;">'.$ratio.'%</span> ('.$diff.' Bytes)';
if(count($css->log) > 0): ?>
<fieldset id="messages"><legend>Messages</legend>
<div><dl><?php
foreach($css->log as $line => $array)
{
echo '<dt>',$line,'</dt>';
$array_size = count($array);
for($i = 0; $i < $array_size; ++$i)
{
echo '<dd class="',$array[$i]['t'],'">',$array[$i]['m'],'</dd>';
}
}
?></dl></div>
</fieldset>
<?php endif;
echo '<fieldset><legend>',$lang[$l][37],': ',$css->print->size('input'),'KB, ',$lang[$l][38],':',$css->print->size('output'),'KB, ',$lang[$l][36],': ',$ratio;
if($file_ok)
{
echo ' - <a href="temp/',$filename,'.css">Download</a>';
}
echo ' - <a href="javascript:ClipBoard()">',$lang[$l][58],'</a>';
echo '</legend>';
echo '<code id="copytext">';
echo $css->print->formatted();
echo '</code></fieldset><div><br /></div>';
echo '<fieldset class="code_output"><legend>',$lang[$l][64],'</legend>';
echo '<textarea rows="10" cols="80">';
if(isset($_REQUEST['whole_file'])) {
echo htmlspecialchars($css->print->formatted_page('xhtml1.1', false, '', 'en'), ENT_QUOTES, 'utf-8');
}
else {
echo htmlspecialchars('<code id="copytext">', ENT_QUOTES, 'utf-8'),"\n";
echo htmlspecialchars($css->print->formatted()."\n".'</code>', ENT_QUOTES, 'utf-8');
}
echo '</textarea></fieldset>';
echo '<fieldset class="code_output"><legend>',$lang[$l][65],'</legend>';
echo '<textarea rows="10" cols="30">';
echo file_get_contents('cssparsed.css');
echo '</textarea>';
echo '</fieldset><p><a href="javascript:scrollTo(0,0)">&#8593; ',$lang[$l][59],'</a></p>';
}
elseif(isset($_REQUEST['css_text']) || isset($_REQUEST['url'])) {
echo '<p class="important">',$lang[$l][28],'</p>';
}
?>
<p style="text-align:center;font-size:.8em;clear:both;">
<?php echo $lang[$l][61] ?> <a
href="http://csstidy.sourceforge.net/contact.php"><?php echo $lang[$l][62] ?></a>.
</p>
</body>
</html>

View file

@ -1,4 +1,6 @@
body {
@import url("cssparsed.css");
html, body {
font:0.8em Verdana,Helvetica,sans-serif;
background:#F8F8F6;
}
@ -17,6 +19,9 @@ margin:0.5em 0;
padding:1em;
border:solid #7284AB 2px;
}
fieldset.code_output {
display:inline;
}
h1 {
font-size:2em;
@ -55,30 +60,6 @@ padding:2px 4px;
border:dashed 1px;
}
span.at {
color:darkblue;
}
span.format {
color:gray;
}
span.property {
color:green;
}
span.selector {
color:blue;
}
span.value {
color:red;
}
span.comment {
color:orange;
}
textarea#css_text {
width:27em;
height:370px;

View file

@ -0,0 +1,29 @@
code#copytext {
white-space: pre;
font-family: Verdana;
}
.at {
color:darkblue;
}
.format {
color:gray;
}
.property {
color:green;
}
.selector {
color:blue;
}
.value {
color:red;
left: 500px;
}
.comment {
color:orange;
}

View file

@ -21,6 +21,7 @@
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005
* @author Nikolay Matsievsky (speed at webo dot name) 2010
*/
define('AT_START', 1);
@ -74,10 +75,10 @@ $GLOBALS['csstidy']['at_rules'] = array('page' => 'is','font-face' => 'is','char
* @version 1.2
*/
$GLOBALS['csstidy']['unit_values'] = array ('background', 'background-position', 'border', 'border-top', 'border-right', 'border-bottom', 'border-left', 'border-width',
'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing', 'font-size',
'height', 'left', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'max-height', 'max-width',
'min-height', 'min-width', 'outline-width', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left',
'position', 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width');
'border-top-width', 'border-right-width', 'border-left-width', 'border-bottom-width', 'bottom', 'border-spacing',
'font-size', 'height', 'left', 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', 'max-height',
'max-width', 'min-height', 'min-width', 'outline', 'outline-width', 'padding', 'padding-top', 'padding-right',
'padding-bottom', 'padding-left', 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width');
/**
* Properties that allow <color> as value
@ -97,7 +98,6 @@ $GLOBALS['csstidy']['color_values'][] = 'border-left-color';
$GLOBALS['csstidy']['color_values'][] = 'color';
$GLOBALS['csstidy']['color_values'][] = 'outline-color';
/**
* Default values for the background properties
*
@ -117,6 +117,21 @@ $GLOBALS['csstidy']['background_prop_default']['background-clip'] = 'border';
$GLOBALS['csstidy']['background_prop_default']['background-origin'] = 'padding';
$GLOBALS['csstidy']['background_prop_default']['background-color'] = 'transparent';
/**
* Default values for the font properties
*
* @global array $GLOBALS['csstidy']['font_prop_default']
* @see merge_fonts()
* @version 1.3
*/
$GLOBALS['csstidy']['font_prop_default'] = array();
$GLOBALS['csstidy']['font_prop_default']['font-style'] = 'normal';
$GLOBALS['csstidy']['font_prop_default']['font-variant'] = 'normal';
$GLOBALS['csstidy']['font_prop_default']['font-weight'] = 'normal';
$GLOBALS['csstidy']['font_prop_default']['font-size'] = '';
$GLOBALS['csstidy']['font_prop_default']['line-height'] = '';
$GLOBALS['csstidy']['font_prop_default']['font-family'] = '';
/**
* A list of non-W3C color names which get replaced by their hex-codes
*
@ -125,133 +140,132 @@ $GLOBALS['csstidy']['background_prop_default']['background-color'] = 'transparen
* @version 1.0
*/
$GLOBALS['csstidy']['replace_colors'] = array();
$GLOBALS['csstidy']['replace_colors']['aliceblue'] = '#F0F8FF';
$GLOBALS['csstidy']['replace_colors']['antiquewhite'] = '#FAEBD7';
$GLOBALS['csstidy']['replace_colors']['aquamarine'] = '#7FFFD4';
$GLOBALS['csstidy']['replace_colors']['azure'] = '#F0FFFF';
$GLOBALS['csstidy']['replace_colors']['beige'] = '#F5F5DC';
$GLOBALS['csstidy']['replace_colors']['bisque'] = '#FFE4C4';
$GLOBALS['csstidy']['replace_colors']['blanchedalmond'] = '#FFEBCD';
$GLOBALS['csstidy']['replace_colors']['blueviolet'] = '#8A2BE2';
$GLOBALS['csstidy']['replace_colors']['brown'] = '#A52A2A';
$GLOBALS['csstidy']['replace_colors']['burlywood'] = '#DEB887';
$GLOBALS['csstidy']['replace_colors']['cadetblue'] = '#5F9EA0';
$GLOBALS['csstidy']['replace_colors']['chartreuse'] = '#7FFF00';
$GLOBALS['csstidy']['replace_colors']['chocolate'] = '#D2691E';
$GLOBALS['csstidy']['replace_colors']['coral'] = '#FF7F50';
$GLOBALS['csstidy']['replace_colors']['cornflowerblue'] = '#6495ED';
$GLOBALS['csstidy']['replace_colors']['cornsilk'] = '#FFF8DC';
$GLOBALS['csstidy']['replace_colors']['crimson'] = '#DC143C';
$GLOBALS['csstidy']['replace_colors']['cyan'] = '#00FFFF';
$GLOBALS['csstidy']['replace_colors']['darkblue'] = '#00008B';
$GLOBALS['csstidy']['replace_colors']['darkcyan'] = '#008B8B';
$GLOBALS['csstidy']['replace_colors']['darkgoldenrod'] = '#B8860B';
$GLOBALS['csstidy']['replace_colors']['darkgray'] = '#A9A9A9';
$GLOBALS['csstidy']['replace_colors']['aliceblue'] = '#f0f8ff';
$GLOBALS['csstidy']['replace_colors']['antiquewhite'] = '#faebd7';
$GLOBALS['csstidy']['replace_colors']['aquamarine'] = '#7fffd4';
$GLOBALS['csstidy']['replace_colors']['azure'] = '#f0ffff';
$GLOBALS['csstidy']['replace_colors']['beige'] = '#f5f5dc';
$GLOBALS['csstidy']['replace_colors']['bisque'] = '#ffe4c4';
$GLOBALS['csstidy']['replace_colors']['blanchedalmond'] = '#ffebcd';
$GLOBALS['csstidy']['replace_colors']['blueviolet'] = '#8a2be2';
$GLOBALS['csstidy']['replace_colors']['brown'] = '#a52a2a';
$GLOBALS['csstidy']['replace_colors']['burlywood'] = '#deb887';
$GLOBALS['csstidy']['replace_colors']['cadetblue'] = '#5f9ea0';
$GLOBALS['csstidy']['replace_colors']['chartreuse'] = '#7fff00';
$GLOBALS['csstidy']['replace_colors']['chocolate'] = '#d2691e';
$GLOBALS['csstidy']['replace_colors']['coral'] = '#ff7f50';
$GLOBALS['csstidy']['replace_colors']['cornflowerblue'] = '#6495ed';
$GLOBALS['csstidy']['replace_colors']['cornsilk'] = '#fff8dc';
$GLOBALS['csstidy']['replace_colors']['crimson'] = '#dc143c';
$GLOBALS['csstidy']['replace_colors']['cyan'] = '#00ffff';
$GLOBALS['csstidy']['replace_colors']['darkblue'] = '#00008b';
$GLOBALS['csstidy']['replace_colors']['darkcyan'] = '#008b8b';
$GLOBALS['csstidy']['replace_colors']['darkgoldenrod'] = '#b8860b';
$GLOBALS['csstidy']['replace_colors']['darkgray'] = '#a9a9a9';
$GLOBALS['csstidy']['replace_colors']['darkgreen'] = '#006400';
$GLOBALS['csstidy']['replace_colors']['darkkhaki'] = '#BDB76B';
$GLOBALS['csstidy']['replace_colors']['darkmagenta'] = '#8B008B';
$GLOBALS['csstidy']['replace_colors']['darkolivegreen'] = '#556B2F';
$GLOBALS['csstidy']['replace_colors']['darkorange'] = '#FF8C00';
$GLOBALS['csstidy']['replace_colors']['darkorchid'] = '#9932CC';
$GLOBALS['csstidy']['replace_colors']['darkred'] = '#8B0000';
$GLOBALS['csstidy']['replace_colors']['darksalmon'] = '#E9967A';
$GLOBALS['csstidy']['replace_colors']['darkseagreen'] = '#8FBC8F';
$GLOBALS['csstidy']['replace_colors']['darkslateblue'] = '#483D8B';
$GLOBALS['csstidy']['replace_colors']['darkslategray'] = '#2F4F4F';
$GLOBALS['csstidy']['replace_colors']['darkturquoise'] = '#00CED1';
$GLOBALS['csstidy']['replace_colors']['darkviolet'] = '#9400D3';
$GLOBALS['csstidy']['replace_colors']['deeppink'] = '#FF1493';
$GLOBALS['csstidy']['replace_colors']['deepskyblue'] = '#00BFFF';
$GLOBALS['csstidy']['replace_colors']['darkkhaki'] = '#bdb76b';
$GLOBALS['csstidy']['replace_colors']['darkmagenta'] = '#8b008b';
$GLOBALS['csstidy']['replace_colors']['darkolivegreen'] = '#556b2f';
$GLOBALS['csstidy']['replace_colors']['darkorange'] = '#ff8c00';
$GLOBALS['csstidy']['replace_colors']['darkorchid'] = '#9932cc';
$GLOBALS['csstidy']['replace_colors']['darkred'] = '#8b0000';
$GLOBALS['csstidy']['replace_colors']['darksalmon'] = '#e9967a';
$GLOBALS['csstidy']['replace_colors']['darkseagreen'] = '#8fbc8f';
$GLOBALS['csstidy']['replace_colors']['darkslateblue'] = '#483d8b';
$GLOBALS['csstidy']['replace_colors']['darkslategray'] = '#2f4f4f';
$GLOBALS['csstidy']['replace_colors']['darkturquoise'] = '#00ced1';
$GLOBALS['csstidy']['replace_colors']['darkviolet'] = '#9400d3';
$GLOBALS['csstidy']['replace_colors']['deeppink'] = '#ff1493';
$GLOBALS['csstidy']['replace_colors']['deepskyblue'] = '#00bfff';
$GLOBALS['csstidy']['replace_colors']['dimgray'] = '#696969';
$GLOBALS['csstidy']['replace_colors']['dodgerblue'] = '#1E90FF';
$GLOBALS['csstidy']['replace_colors']['feldspar'] = '#D19275';
$GLOBALS['csstidy']['replace_colors']['firebrick'] = '#B22222';
$GLOBALS['csstidy']['replace_colors']['floralwhite'] = '#FFFAF0';
$GLOBALS['csstidy']['replace_colors']['forestgreen'] = '#228B22';
$GLOBALS['csstidy']['replace_colors']['gainsboro'] = '#DCDCDC';
$GLOBALS['csstidy']['replace_colors']['ghostwhite'] = '#F8F8FF';
$GLOBALS['csstidy']['replace_colors']['gold'] = '#FFD700';
$GLOBALS['csstidy']['replace_colors']['goldenrod'] = '#DAA520';
$GLOBALS['csstidy']['replace_colors']['greenyellow'] = '#ADFF2F';
$GLOBALS['csstidy']['replace_colors']['honeydew'] = '#F0FFF0';
$GLOBALS['csstidy']['replace_colors']['hotpink'] = '#FF69B4';
$GLOBALS['csstidy']['replace_colors']['indianred'] = '#CD5C5C';
$GLOBALS['csstidy']['replace_colors']['indigo'] = '#4B0082';
$GLOBALS['csstidy']['replace_colors']['ivory'] = '#FFFFF0';
$GLOBALS['csstidy']['replace_colors']['khaki'] = '#F0E68C';
$GLOBALS['csstidy']['replace_colors']['lavender'] = '#E6E6FA';
$GLOBALS['csstidy']['replace_colors']['lavenderblush'] = '#FFF0F5';
$GLOBALS['csstidy']['replace_colors']['lawngreen'] = '#7CFC00';
$GLOBALS['csstidy']['replace_colors']['lemonchiffon'] = '#FFFACD';
$GLOBALS['csstidy']['replace_colors']['lightblue'] = '#ADD8E6';
$GLOBALS['csstidy']['replace_colors']['lightcoral'] = '#F08080';
$GLOBALS['csstidy']['replace_colors']['lightcyan'] = '#E0FFFF';
$GLOBALS['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#FAFAD2';
$GLOBALS['csstidy']['replace_colors']['lightgrey'] = '#D3D3D3';
$GLOBALS['csstidy']['replace_colors']['lightgreen'] = '#90EE90';
$GLOBALS['csstidy']['replace_colors']['lightpink'] = '#FFB6C1';
$GLOBALS['csstidy']['replace_colors']['lightsalmon'] = '#FFA07A';
$GLOBALS['csstidy']['replace_colors']['lightseagreen'] = '#20B2AA';
$GLOBALS['csstidy']['replace_colors']['lightskyblue'] = '#87CEFA';
$GLOBALS['csstidy']['replace_colors']['lightslateblue'] = '#8470FF';
$GLOBALS['csstidy']['replace_colors']['dodgerblue'] = '#1e90ff';
$GLOBALS['csstidy']['replace_colors']['feldspar'] = '#d19275';
$GLOBALS['csstidy']['replace_colors']['firebrick'] = '#b22222';
$GLOBALS['csstidy']['replace_colors']['floralwhite'] = '#fffaf0';
$GLOBALS['csstidy']['replace_colors']['forestgreen'] = '#228b22';
$GLOBALS['csstidy']['replace_colors']['gainsboro'] = '#dcdcdc';
$GLOBALS['csstidy']['replace_colors']['ghostwhite'] = '#f8f8ff';
$GLOBALS['csstidy']['replace_colors']['gold'] = '#ffd700';
$GLOBALS['csstidy']['replace_colors']['goldenrod'] = '#daa520';
$GLOBALS['csstidy']['replace_colors']['greenyellow'] = '#adff2f';
$GLOBALS['csstidy']['replace_colors']['honeydew'] = '#f0fff0';
$GLOBALS['csstidy']['replace_colors']['hotpink'] = '#ff69b4';
$GLOBALS['csstidy']['replace_colors']['indianred'] = '#cd5c5c';
$GLOBALS['csstidy']['replace_colors']['indigo'] = '#4b0082';
$GLOBALS['csstidy']['replace_colors']['ivory'] = '#fffff0';
$GLOBALS['csstidy']['replace_colors']['khaki'] = '#f0e68c';
$GLOBALS['csstidy']['replace_colors']['lavender'] = '#e6e6fa';
$GLOBALS['csstidy']['replace_colors']['lavenderblush'] = '#fff0f5';
$GLOBALS['csstidy']['replace_colors']['lawngreen'] = '#7cfc00';
$GLOBALS['csstidy']['replace_colors']['lemonchiffon'] = '#fffacd';
$GLOBALS['csstidy']['replace_colors']['lightblue'] = '#add8e6';
$GLOBALS['csstidy']['replace_colors']['lightcoral'] = '#f08080';
$GLOBALS['csstidy']['replace_colors']['lightcyan'] = '#e0ffff';
$GLOBALS['csstidy']['replace_colors']['lightgoldenrodyellow'] = '#fafad2';
$GLOBALS['csstidy']['replace_colors']['lightgrey'] = '#d3d3d3';
$GLOBALS['csstidy']['replace_colors']['lightgreen'] = '#90ee90';
$GLOBALS['csstidy']['replace_colors']['lightpink'] = '#ffb6c1';
$GLOBALS['csstidy']['replace_colors']['lightsalmon'] = '#ffa07a';
$GLOBALS['csstidy']['replace_colors']['lightseagreen'] = '#20b2aa';
$GLOBALS['csstidy']['replace_colors']['lightskyblue'] = '#87cefa';
$GLOBALS['csstidy']['replace_colors']['lightslateblue'] = '#8470ff';
$GLOBALS['csstidy']['replace_colors']['lightslategray'] = '#778899';
$GLOBALS['csstidy']['replace_colors']['lightsteelblue'] = '#B0C4DE';
$GLOBALS['csstidy']['replace_colors']['lightyellow'] = '#FFFFE0';
$GLOBALS['csstidy']['replace_colors']['limegreen'] = '#32CD32';
$GLOBALS['csstidy']['replace_colors']['linen'] = '#FAF0E6';
$GLOBALS['csstidy']['replace_colors']['magenta'] = '#FF00FF';
$GLOBALS['csstidy']['replace_colors']['mediumaquamarine'] = '#66CDAA';
$GLOBALS['csstidy']['replace_colors']['mediumblue'] = '#0000CD';
$GLOBALS['csstidy']['replace_colors']['mediumorchid'] = '#BA55D3';
$GLOBALS['csstidy']['replace_colors']['mediumpurple'] = '#9370D8';
$GLOBALS['csstidy']['replace_colors']['mediumseagreen'] = '#3CB371';
$GLOBALS['csstidy']['replace_colors']['mediumslateblue'] = '#7B68EE';
$GLOBALS['csstidy']['replace_colors']['mediumspringgreen'] = '#00FA9A';
$GLOBALS['csstidy']['replace_colors']['mediumturquoise'] = '#48D1CC';
$GLOBALS['csstidy']['replace_colors']['mediumvioletred'] = '#C71585';
$GLOBALS['csstidy']['replace_colors']['lightsteelblue'] = '#b0c4de';
$GLOBALS['csstidy']['replace_colors']['lightyellow'] = '#ffffe0';
$GLOBALS['csstidy']['replace_colors']['limegreen'] = '#32cd32';
$GLOBALS['csstidy']['replace_colors']['linen'] = '#faf0e6';
$GLOBALS['csstidy']['replace_colors']['magenta'] = '#ff00ff';
$GLOBALS['csstidy']['replace_colors']['mediumaquamarine'] = '#66cdaa';
$GLOBALS['csstidy']['replace_colors']['mediumblue'] = '#0000cd';
$GLOBALS['csstidy']['replace_colors']['mediumorchid'] = '#ba55d3';
$GLOBALS['csstidy']['replace_colors']['mediumpurple'] = '#9370d8';
$GLOBALS['csstidy']['replace_colors']['mediumseagreen'] = '#3cb371';
$GLOBALS['csstidy']['replace_colors']['mediumslateblue'] = '#7b68ee';
$GLOBALS['csstidy']['replace_colors']['mediumspringgreen'] = '#00fa9a';
$GLOBALS['csstidy']['replace_colors']['mediumturquoise'] = '#48d1cc';
$GLOBALS['csstidy']['replace_colors']['mediumvioletred'] = '#c71585';
$GLOBALS['csstidy']['replace_colors']['midnightblue'] = '#191970';
$GLOBALS['csstidy']['replace_colors']['mintcream'] = '#F5FFFA';
$GLOBALS['csstidy']['replace_colors']['mistyrose'] = '#FFE4E1';
$GLOBALS['csstidy']['replace_colors']['moccasin'] = '#FFE4B5';
$GLOBALS['csstidy']['replace_colors']['navajowhite'] = '#FFDEAD';
$GLOBALS['csstidy']['replace_colors']['oldlace'] = '#FDF5E6';
$GLOBALS['csstidy']['replace_colors']['olivedrab'] = '#6B8E23';
$GLOBALS['csstidy']['replace_colors']['orangered'] = '#FF4500';
$GLOBALS['csstidy']['replace_colors']['orchid'] = '#DA70D6';
$GLOBALS['csstidy']['replace_colors']['palegoldenrod'] = '#EEE8AA';
$GLOBALS['csstidy']['replace_colors']['palegreen'] = '#98FB98';
$GLOBALS['csstidy']['replace_colors']['paleturquoise'] = '#AFEEEE';
$GLOBALS['csstidy']['replace_colors']['palevioletred'] = '#D87093';
$GLOBALS['csstidy']['replace_colors']['papayawhip'] = '#FFEFD5';
$GLOBALS['csstidy']['replace_colors']['peachpuff'] = '#FFDAB9';
$GLOBALS['csstidy']['replace_colors']['peru'] = '#CD853F';
$GLOBALS['csstidy']['replace_colors']['pink'] = '#FFC0CB';
$GLOBALS['csstidy']['replace_colors']['plum'] = '#DDA0DD';
$GLOBALS['csstidy']['replace_colors']['powderblue'] = '#B0E0E6';
$GLOBALS['csstidy']['replace_colors']['rosybrown'] = '#BC8F8F';
$GLOBALS['csstidy']['replace_colors']['royalblue'] = '#4169E1';
$GLOBALS['csstidy']['replace_colors']['saddlebrown'] = '#8B4513';
$GLOBALS['csstidy']['replace_colors']['salmon'] = '#FA8072';
$GLOBALS['csstidy']['replace_colors']['sandybrown'] = '#F4A460';
$GLOBALS['csstidy']['replace_colors']['seagreen'] = '#2E8B57';
$GLOBALS['csstidy']['replace_colors']['seashell'] = '#FFF5EE';
$GLOBALS['csstidy']['replace_colors']['sienna'] = '#A0522D';
$GLOBALS['csstidy']['replace_colors']['skyblue'] = '#87CEEB';
$GLOBALS['csstidy']['replace_colors']['slateblue'] = '#6A5ACD';
$GLOBALS['csstidy']['replace_colors']['mintcream'] = '#f5fffa';
$GLOBALS['csstidy']['replace_colors']['mistyrose'] = '#ffe4e1';
$GLOBALS['csstidy']['replace_colors']['moccasin'] = '#ffe4b5';
$GLOBALS['csstidy']['replace_colors']['navajowhite'] = '#ffdead';
$GLOBALS['csstidy']['replace_colors']['oldlace'] = '#fdf5e6';
$GLOBALS['csstidy']['replace_colors']['olivedrab'] = '#6b8e23';
$GLOBALS['csstidy']['replace_colors']['orangered'] = '#ff4500';
$GLOBALS['csstidy']['replace_colors']['orchid'] = '#da70d6';
$GLOBALS['csstidy']['replace_colors']['palegoldenrod'] = '#eee8aa';
$GLOBALS['csstidy']['replace_colors']['palegreen'] = '#98fb98';
$GLOBALS['csstidy']['replace_colors']['paleturquoise'] = '#afeeee';
$GLOBALS['csstidy']['replace_colors']['palevioletred'] = '#d87093';
$GLOBALS['csstidy']['replace_colors']['papayawhip'] = '#ffefd5';
$GLOBALS['csstidy']['replace_colors']['peachpuff'] = '#ffdab9';
$GLOBALS['csstidy']['replace_colors']['peru'] = '#cd853f';
$GLOBALS['csstidy']['replace_colors']['pink'] = '#ffc0cb';
$GLOBALS['csstidy']['replace_colors']['plum'] = '#dda0dd';
$GLOBALS['csstidy']['replace_colors']['powderblue'] = '#b0e0e6';
$GLOBALS['csstidy']['replace_colors']['rosybrown'] = '#bc8f8f';
$GLOBALS['csstidy']['replace_colors']['royalblue'] = '#4169e1';
$GLOBALS['csstidy']['replace_colors']['saddlebrown'] = '#8b4513';
$GLOBALS['csstidy']['replace_colors']['salmon'] = '#fa8072';
$GLOBALS['csstidy']['replace_colors']['sandybrown'] = '#f4a460';
$GLOBALS['csstidy']['replace_colors']['seagreen'] = '#2e8b57';
$GLOBALS['csstidy']['replace_colors']['seashell'] = '#fff5ee';
$GLOBALS['csstidy']['replace_colors']['sienna'] = '#a0522d';
$GLOBALS['csstidy']['replace_colors']['skyblue'] = '#87ceeb';
$GLOBALS['csstidy']['replace_colors']['slateblue'] = '#6a5acd';
$GLOBALS['csstidy']['replace_colors']['slategray'] = '#708090';
$GLOBALS['csstidy']['replace_colors']['snow'] = '#FFFAFA';
$GLOBALS['csstidy']['replace_colors']['springgreen'] = '#00FF7F';
$GLOBALS['csstidy']['replace_colors']['steelblue'] = '#4682B4';
$GLOBALS['csstidy']['replace_colors']['tan'] = '#D2B48C';
$GLOBALS['csstidy']['replace_colors']['thistle'] = '#D8BFD8';
$GLOBALS['csstidy']['replace_colors']['tomato'] = '#FF6347';
$GLOBALS['csstidy']['replace_colors']['turquoise'] = '#40E0D0';
$GLOBALS['csstidy']['replace_colors']['violet'] = '#EE82EE';
$GLOBALS['csstidy']['replace_colors']['violetred'] = '#D02090';
$GLOBALS['csstidy']['replace_colors']['wheat'] = '#F5DEB3';
$GLOBALS['csstidy']['replace_colors']['whitesmoke'] = '#F5F5F5';
$GLOBALS['csstidy']['replace_colors']['yellowgreen'] = '#9ACD32';
$GLOBALS['csstidy']['replace_colors']['snow'] = '#fffafa';
$GLOBALS['csstidy']['replace_colors']['springgreen'] = '#00ff7f';
$GLOBALS['csstidy']['replace_colors']['steelblue'] = '#4682b4';
$GLOBALS['csstidy']['replace_colors']['tan'] = '#d2b48c';
$GLOBALS['csstidy']['replace_colors']['thistle'] = '#d8bfd8';
$GLOBALS['csstidy']['replace_colors']['tomato'] = '#ff6347';
$GLOBALS['csstidy']['replace_colors']['turquoise'] = '#40e0d0';
$GLOBALS['csstidy']['replace_colors']['violet'] = '#ee82ee';
$GLOBALS['csstidy']['replace_colors']['violetred'] = '#d02090';
$GLOBALS['csstidy']['replace_colors']['wheat'] = '#f5deb3';
$GLOBALS['csstidy']['replace_colors']['whitesmoke'] = '#f5f5f5';
$GLOBALS['csstidy']['replace_colors']['yellowgreen'] = '#9acd32';
/**
* A list of all shorthand properties that are devided into four properties and/or have four subvalues

View file

@ -1,183 +1,248 @@
<?php
/**
* Localization of CSS Optimiser Interface of CSSTidy
*
* Copyright 2005, 2006, 2007 Florian Schmitz
*
* This file is part of CSSTidy.
*
* CSSTidy is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* CSSTidy 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
* @package csstidy
* @author Florian Schmitz (floele at gmail dot com) 2005-2007
* @author Brett Zamir (brettz9 at yahoo dot com) 2007
*/
if(isset($_GET['lang'])) {
$l = $_GET['lang'];
} else {
$l = getenv('HTTP_ACCEPT_LANGUAGE');
$l = strtolower(substr($l,0,2));
$l = $_GET['lang'];
}
$l = ($l == 'de' || $l == 'fr' || $l == 'zh') ? $l : 'en';
else if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$l = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$l = strtolower(substr($l, 0, 2));
}
else {
$l = '';
}
$l = (in_array($l, array('de', 'fr', 'zh'))) ? $l : 'en';
// note 5 in all but French, and 40 in all are orphaned
$lang = array();
$lang['en'][0] = 'CSS Formatter and Optimiser/Optimizer (based on CSSTidy ';
$lang['de'][0] = 'CSS Formatierer und Optimierer (basierend auf CSSTidy ';
$lang['en'][1] = 'CSS Formatter and Optimiser';
$lang['de'][1] = 'CSS Formatierer und Optimierer';
$lang['en'][2] = '(based on';
$lang['de'][2] = '(basierend auf';
$lang['en'][3] = '(plaintext)';
$lang['de'][3] = '(Textversion)';
$lang['en'][4] = 'Important Note:';
$lang['de'][4] = 'Wichtiger Hinweis:';
$lang['en'][6] = 'Your code should be well-formed. This is <strong>no validator</strong> which points out errors in your CSS code. To make sure that your code is valid, use the <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>.';
$lang['de'][6] = 'Der CSS Code sollte wohlgeformt sein. Der CSS Code wird <strong>nicht auf Gültigkeit überprüft</strong>. Um sicherzugehen dass dein Code valide ist, benutze den <a href="http://jigsaw.w3.org/css-validator/">W3C Validierungsservice</a>.';
$lang['en'][6] = 'Your code should be well-formed. This is <strong>not a validator</strong> which points out errors in your CSS code. To make sure that your code is valid, use the <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>.';
$lang['en'][7] = 'all comments are removed';
$lang['de'][7] = 'alle Kommentare werden entfernt';
$lang['en'][8] = 'CSS Input:';
$lang['de'][8] = 'CSS Eingabe:';
$lang['en'][9] = 'CSS-Code:';
$lang['de'][9] = 'CSS-Code:';
$lang['en'][10] = 'CSS from URL:';
$lang['de'][10] = 'CSS von URL:';
$lang['en'][11] = 'Code Layout:';
$lang['de'][11] = 'Code Layout:';
$lang['en'][12] = 'Compression&nbsp;(code&nbsp;layout):';
$lang['de'][12] = 'Komprimierung&nbsp;(Code&nbsp;Layout):';
$lang['en'][12] = 'Compression&#160;(code&#160;layout):';
$lang['en'][13] = 'Highest (no readability, smallest size)';
$lang['de'][13] = 'Höchste (keine Lesbarkeit, niedrigste Größe)';
$lang['en'][14] = 'High (moderate readability, smaller size)';
$lang['de'][14] = 'Hoch (mittelmäßige Lesbarkeit, geringe Größe)';
$lang['en'][15] = 'Standard (balance between readability and size)';
$lang['de'][15] = 'Standard (Kompromiss zwischen Lesbarkeit und Größe)';
$lang['en'][16] = 'Low (higher readability)';
$lang['de'][16] = 'Niedrig (höhere Lesbarkeit)';
$lang['en'][17] = 'Custom (enter below)';
$lang['de'][17] = 'Benutzerdefiniert (unten eingeben)';
$lang['en'][18] = 'Custom <a href="http://csstidy.sourceforge.net/templates.php">template</a>';
$lang['de'][18] = 'Benutzerdefinierte <a href="http://csstidy.sourceforge.net/templates.php">Vorlage</a>';
$lang['en'][19] = 'Options';
$lang['de'][19] = 'Optionen';
$lang['en'][20] = 'Sort Selectors (caution)';
$lang['de'][20] = 'Selektoren sortieren (Vorsicht)';
$lang['en'][21] = 'Sort Properties';
$lang['de'][21] = 'Eigenschaften sortieren';
$lang['en'][22] = 'Regroup selectors';
$lang['de'][22] = 'Selektoren umgruppieren';
$lang['en'][23] = 'Optimise shorthands';
$lang['de'][23] = 'Shorthands optimieren';
$lang['en'][24] = 'Compress colors';
$lang['de'][24] = 'Farben komprimieren';
$lang['en'][25] = 'Lowercase selectors';
$lang['de'][25] = 'Selektoren in Kleinbuchstaben';
$lang['en'][26] = 'Case for properties:';
$lang['de'][26] = 'Groß-/Kleinschreibung für Eigenschaften';
$lang['en'][27] = 'Lowercase';
$lang['de'][27] = 'Kleinbuchstaben';
$lang['en'][28] = 'No or invalid CSS input or wrong URL!';
$lang['de'][28] = 'Keine oder ungültige CSS Eingabe oder falsche URL!';
$lang['en'][28] = 'No or invalid CSS input or wrong URL!';
$lang['en'][29] = 'Uppercase';
$lang['de'][29] = 'Großbuchstaben';
$lang['en'][30] = 'lowercase elementnames needed for XHTML';
$lang['de'][30] = 'kleingeschriebene Elementnamen benötigt für XHTML';
$lang['en'][31] = 'Remove unnecessary backslashes';
$lang['de'][31] = 'Unnötige Backslashes entfernen';
$lang['en'][32] = 'convert !important-hack';
$lang['de'][32] = '!important-Hack konvertieren';
$lang['en'][33] = 'Output as file';
$lang['de'][33] = 'Als Datei ausgeben';
$lang['en'][34] = 'Bigger compression because of smaller newlines (copy &amp; paste doesn\'t work)';
$lang['de'][34] = 'Größere Komprimierung augrund von kleineren Neuezeile-Zeichen';
$lang['en'][34] = 'Bigger compression because of smaller newlines (copy &#38; paste doesn\'t work)';
$lang['en'][35] = 'Process CSS';
$lang['de'][35] = 'CSS verarbeiten';
$lang['en'][36] = 'Compression Ratio';
$lang['de'][36] = 'Komprimierungsrate';
$lang['en'][37] = 'Input';
$lang['de'][37] = 'Eingabe';
$lang['en'][38] = 'Output';
$lang['de'][38] = 'Ausgabe';
$lang['en'][39] = 'Language';
$lang['de'][39] = 'Sprache';
$lang['en'][41] = 'Attention: This may change the behaviour of your CSS Code!';
$lang['de'][41] = 'Achtung: Dies könnte das Verhalten ihres CSS-Codes verändern!';
$lang['en'][42] = 'Remove last ;';
$lang['de'][42] = 'Letztes ; entfernen';
$lang['en'][43] = 'Discard invalid properties';
$lang['de'][43] = 'Ungültige Eigenschaften entfernen';
$lang['en'][44] = 'Only safe optimisations';
$lang['de'][44] = 'Nur sichere Optimierungen';
$lang['en'][45] = 'Compress font-weight';
$lang['de'][45] = 'font-weight komprimieren';
$lang['en'][46] = 'Save comments';
$lang['de'][46] = 'Kommentare beibehalten';
$lang['en'][47] = 'Do not change anything';
$lang['en'][48] = 'Only seperate selectors (split at ,)';
$lang['en'][49] = 'Merge selectors with the same properties (fast)';
$lang['en'][50] = 'Merge selectors intelligently (slow)';
$lang['en'][51] = 'Preserve CSS';
$lang['en'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.';
$lang['en'][53] = 'None';
$lang['en'][54] = 'Don\'t optimise';
$lang['en'][55] = 'Safe optimisations';
$lang['en'][56] = 'All optimisations';
$lang['en'][57] = 'Add timestamp';
$lang['en'][58] = 'Copy to clipboard';
$lang['en'][59] = 'Back to top';
$lang['en'][60] = 'Your browser doesn\'t support copy to clipboard.';
$lang['en'][61] = 'For bugs and suggestions feel free to';
$lang['en'][62] = 'contact me';
$lang['en'][63] = 'Output CSS code as complete HTML document';
$lang['en'][64] = 'Code';
$lang['en'][65] = 'CSS to style CSS output';
$lang['en'][66] = 'You need to go to about:config in your URL bar, select \'signed.applets.codebase_principal_support\' in the filter field, and set its value to true in order to use this feature; however, be aware that doing so increases security risks.';
$lang['de'][0] = 'CSS Formatierer und Optimierer (basierend auf CSSTidy ';
$lang['de'][1] = 'CSS Formatierer und Optimierer';
$lang['de'][2] = '(basierend auf';
$lang['de'][3] = '(Textversion)';
$lang['de'][4] = 'Wichtiger Hinweis:';
$lang['de'][6] = 'Der CSS Code sollte wohlgeformt sein. Der CSS Code wird <strong>nicht auf Gültigkeit überprüft</strong>. Um sicherzugehen dass dein Code valide ist, benutze den <a href="http://jigsaw.w3.org/css-validator/">W3C Validierungsservice</a>.';
$lang['de'][7] = 'alle Kommentare werden entfernt';
$lang['de'][8] = 'CSS Eingabe:';
$lang['de'][9] = 'CSS-Code:';
$lang['de'][10] = 'CSS von URL:';
$lang['de'][11] = 'Code Layout:';
$lang['de'][12] = 'Komprimierung&#160;(Code&#160;Layout):';
$lang['de'][13] = 'Höchste (keine Lesbarkeit, niedrigste Größe)';
$lang['de'][14] = 'Hoch (mittelmäßige Lesbarkeit, geringe Größe)';
$lang['de'][15] = 'Standard (Kompromiss zwischen Lesbarkeit und Größe)';
$lang['de'][16] = 'Niedrig (höhere Lesbarkeit)';
$lang['de'][17] = 'Benutzerdefiniert (unten eingeben)';
$lang['de'][18] = 'Benutzerdefinierte <a href="http://csstidy.sourceforge.net/templates.php">Vorlage</a>';
$lang['de'][19] = 'Optionen';
$lang['de'][20] = 'Selektoren sortieren (Vorsicht)';
$lang['de'][21] = 'Eigenschaften sortieren';
$lang['de'][22] = 'Selektoren umgruppieren';
$lang['de'][23] = 'Shorthands optimieren';
$lang['de'][24] = 'Farben komprimieren';
$lang['de'][25] = 'Selektoren in Kleinbuchstaben';
$lang['de'][26] = 'Groß-/Kleinschreibung für Eigenschaften';
$lang['de'][27] = 'Kleinbuchstaben';
$lang['de'][28] = 'Keine oder ungültige CSS Eingabe oder falsche URL!';
$lang['de'][29] = 'Großbuchstaben';
$lang['de'][30] = 'kleingeschriebene Elementnamen benötigt für XHTML';
$lang['de'][31] = 'Unnötige Backslashes entfernen';
$lang['de'][32] = '!important-Hack konvertieren';
$lang['de'][33] = 'Als Datei ausgeben';
$lang['de'][34] = 'Größere Komprimierung augrund von kleineren Neuezeile-Zeichen';
$lang['de'][35] = 'CSS verarbeiten';
$lang['de'][36] = 'Komprimierungsrate';
$lang['de'][37] = 'Eingabe';
$lang['de'][38] = 'Ausgabe';
$lang['de'][39] = 'Sprache';
$lang['de'][41] = 'Achtung: Dies könnte das Verhalten ihres CSS-Codes verändern!';
$lang['de'][42] = 'Letztes ; entfernen';
$lang['de'][43] = 'Ungültige Eigenschaften entfernen';
$lang['de'][44] = 'Nur sichere Optimierungen';
$lang['de'][45] = 'font-weight komprimieren';
$lang['de'][46] = 'Kommentare beibehalten';
$lang['de'][47] = 'Nichts ändern';
$lang['de'][48] = 'Selektoren nur trennen (am Komma)';
$lang['de'][49] = 'Selektoren mit gleichen Eigenschaften zusammenfassen (schnell)';
$lang['de'][50] = 'Selektoren intelligent zusammenfassen (langsam!)';
$lang['en'][51] = 'Preserve CSS';
$lang['de'][51] = 'CSS erhalten';
$lang['en'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.';
$lang['de'][52] = 'Kommentare, Hacks, etc. speichern. Viele Optimierungen sind dann aber nicht mehr möglich.';
$lang['en'][53] = 'None';
$lang['de'][53] = 'Keine';
$lang['en'][54] = 'Don\'t optimise';
$lang['de'][54] = 'Nicht optimieren';
$lang['en'][55] = 'Safe optimisations';
$lang['de'][55] = 'Sichere Optimierungen';
$lang['en'][56] = 'All optimisations';
$lang['de'][56] = 'Alle Optimierungen';
$lang['en'][57] = 'Add timestamp';
$lang['de'][57] = 'Zeitstempel hinzufügen';
$lang['de'][58] = 'Copy to clipboard';
$lang['de'][59] = 'Back to top';
$lang['de'][60] = 'Your browser doesn\'t support copy to clipboard.';
$lang['de'][61] = 'For bugs and suggestions feel free to';
$lang['de'][62] = 'contact me';
$lang['de'][63] = 'Output CSS code as complete HTML document';
$lang['de'][64] = 'Code';
$lang['de'][65] = 'CSS to style CSS output';
$lang['de'][66] = 'You need to go to about:config in your URL bar, select \'signed.applets.codebase_principal_support\' in the filter field, and set its value to true in order to use this feature; however, be aware that doing so increases security risks.';
$lang['fr'][0] = 'CSS Formatteur et Optimiseur (basé sur CSSTidy ';
$lang['fr'][0] = 'CSS Formatteur et Optimiseur (basé sur CSSTidy ';
$lang['fr'][1] = 'CSS Formatteur et Optimiseur';
$lang['fr'][2] = '(basé sur ';
$lang['fr'][3] = '(Version Text)';
$lang['fr'][4] = 'notes Importantes:';
$lang['fr'][5] = 'les mêmes sélecteurs et les propriétés sont automatiquement fusionnés';
$lang['fr'][6] = 'votre code doit être Valide. Ce n\'est <strong>pas un validateur</strong> qui signale des erreurs dans votre code de CSS. Assurez-vous que votre code est correct en utilisant le le validateur : <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>';
$lang['fr'][3] = '(Version texte)';
$lang['fr'][4] = 'Note Importante&#160;:';
$lang['fr'][6] = 'Votre code doit être valide. Ce nest <strong>pas un validateur</strong> qui signale les erreurs dans votre code CSS. Pour être sûr que votre code est correct, utilisez le validateur&#160;: <a href="http://jigsaw.w3.org/css-validator/">W3C Validator</a>.';
$lang['fr'][7] = 'tous les commentaires sont enlevés';
$lang['fr'][8] = 'Champ CSS:';
$lang['fr'][9] = 'CSS-Code:';
$lang['fr'][10] = 'CSS en provenance d\'une URL:<br />';
$lang['fr'][11] = 'Mise en page du code:';
$lang['fr'][12] = 'Compression (Mise en page du code):';
$lang['fr'][13] = 'Le plus compact (aucune lisibilité, plus petite taille)';
$lang['fr'][14] = 'Trés compact (lisibilité modérée, plus petite taille)';
$lang['fr'][15] = 'Normale (équilibre entre la lisibilité et la taille)';
$lang['fr'][16] = 'Peu compact (une lisibilité plus élevée)';
$lang['fr'][8] = 'Champ CSS&#160;:';
$lang['fr'][9] = 'Code CSS&#160;:';
$lang['fr'][10] = 'CSS en provenance dune URL&#160;:<br />';
$lang['fr'][11] = 'Mise en page du code&#160;:';
$lang['fr'][12] = 'Compression (mise en page du code)&#160;:';
$lang['fr'][13] = 'La plus élevée (aucune lisibilité, taille minimale)';
$lang['fr'][14] = 'Élevée (lisibilité modérée, petite taille)';
$lang['fr'][15] = 'Normale (équilibre entre lisibilité et taille)';
$lang['fr'][16] = 'Faible (lisibilité élevée)';
$lang['fr'][17] = 'Sur mesure (entrer ci-dessous)';
$lang['fr'][18] = 'Sur mesure <a href="http://csstidy.sourceforge.net/templates.php">Gabarit</a>';
$lang['fr'][18] = '<a href="http://csstidy.sourceforge.net/templates.php">Gabarit</a> sur mesure';
$lang['fr'][19] = 'Options';
$lang['fr'][20] = 'Trier les sélecteurs (attention)';
$lang['fr'][21] = 'Trier les propriétés';
$lang['fr'][22] = 'Fusionner les sélecteurs';
$lang['fr'][23] = 'Optimise shorthands';
$lang['fr'][22] = 'Regrouper les sélecteurs';
$lang['fr'][23] = 'Propriétés raccourcies';
$lang['fr'][24] = 'Compresser les couleurs';
$lang['fr'][25] = 'Sélecteurs en minuscules';
$lang['fr'][26] = 'Cases (Minuscules &amp; Majuscule) pour les propriétés:';
$lang['fr'][27] = 'Minuscules';
$lang['fr'][28] = 'CSS non valide ou URL incorrecte!';
$lang['fr'][26] = 'Case pour les propriétés&#160;:';
$lang['fr'][27] = 'Minuscule';
$lang['fr'][28] = 'CSS non valide ou URL incorrecte&#160;!';
$lang['fr'][29] = 'Majuscule';
$lang['fr'][30] = 'les noms des éléments en minuscules (indispensables pour XHTML)';
$lang['fr'][31] = 'enlever les antislashs inutiles';
$lang['fr'][32] = 'convertir !important-hack';
$lang['fr'][33] = 'Sauver en tant que fichier';
$lang['fr'][34] = 'Une plus grande compression en raison de plus petits caractères';
$lang['fr'][35] = 'Compresser le CSS';
$lang['fr'][34] = 'Meilleure compression grâce aux caractères de saut de ligne plus petits (copier &#38; coller ne marche pas)';
$lang['fr'][35] = 'Compresser la CSS';
$lang['fr'][36] = 'Facteur de Compression';
$lang['fr'][37] = 'Entrée';
$lang['fr'][38] = 'Sortie';
$lang['fr'][39] = 'Language';
$lang['fr'][41] = 'Attention : ceci peut changer le comportement de votre code de CSS !';
$lang['fr'][39] = 'Langue';
$lang['fr'][41] = 'Attention&#160;: ceci peut changer le comportement de votre code CSS&#160;!';
$lang['fr'][42] = 'Enlever le dernier ;';
$lang['fr'][43] = 'Supprimer les propriétés non valide';
$lang['fr'][44] = 'Seulement les optimisations sûres';
$lang['fr'][45] = 'Compresser font-weight';
$lang['fr'][46] = 'Sauvegarder les commentaires ';
$lang['fr'][47] = 'Ne changer rien';
$lang['fr'][47] = 'Ne rien changer';
$lang['fr'][48] = 'Sépare les sélecteurs (sépare au niveau de ,)';
$lang['fr'][49] = 'Fusionne les sélecteurs avec les mêmes propriétés (rapides)';
$lang['fr'][49] = 'Fusionne les sélecteurs avec les mêmes propriétés (rapide)';
$lang['fr'][50] = 'Fusionne les sélecteurs intelligemment (lent)';
$lang['fr'][51] = 'Preserve CSS';
$lang['fr'][52] = 'Save comments, hacks, etc. Most optimisations can *not* be applied if this is enabled.';
$lang['fr'][53] = 'None';
$lang['fr'][54] = 'Don\'t optimise';
$lang['fr'][55] = 'Safe optimisations';
$lang['fr'][56] = 'All optimisations';
$lang['fr'][57] = 'Add timestamp';
$lang['fr'][51] = 'Préserver la CSS';
$lang['fr'][52] = 'Sauvegarder les commentaires, hacks, etc. La plupart des optimisations ne peuvent *pas* être appliquées si cela est activé.';
$lang['fr'][53] = 'Aucun';
$lang['fr'][54] = 'Ne pas optimiser';
$lang['fr'][55] = 'Optimisations sûres';
$lang['fr'][56] = 'Toutes les optimisations';
$lang['fr'][57] = 'Ajouter un timestamp';
$lang['fr'][58] = 'Copier dans le presse-papiers';
$lang['fr'][59] = 'Retour en haut';
$lang['fr'][60] = 'Votre navigateur ne suporte pas la copie vers le presse-papiers.';
$lang['fr'][61] = 'Pour signaler des bugs ou pour des suggestions,';
$lang['fr'][62] = 'contactez-moi';
$lang['fr'][63] = 'Sauver le code CSS comme document complet HTML';
$lang['fr'][64] = 'Code';
$lang['fr'][65] = 'CSS pour colorier la sortie CSS';
$lang['fr'][66] = 'Vous devez aller dans about:config dans votre barre dadresse, selectionner \'signed.applets.codebase_principal_support\' dans le champ Filtre et attribuez-lui la valeur \'true\' pour utiliser cette fonctionnalité; toutefois, soyez conscient que cela augmente les risques de sécurité.';
$lang['zh'][0] = 'CSS整形與最佳化工具(使用 CSSTidy ';
$lang['zh'][1] = 'CSS整形與最佳化工具';
@ -212,7 +277,7 @@ $lang['zh'][30] = 'XHTML必須使用小寫的元素名稱';
$lang['zh'][31] = '移除不必要的反斜線';
$lang['zh'][32] = '轉換 !important-hack';
$lang['zh'][33] = '輸出成檔案形式';
$lang['zh'][34] = '由於比較少換行字元, 會有更大的壓縮比率(複製&amp;貼上沒有用)';
$lang['zh'][34] = '由於比較少換行字元, 會有更大的壓縮比率(複製&#38;貼上沒有用)';
$lang['zh'][35] = '執行';
$lang['zh'][36] = '壓縮比率';
$lang['zh'][37] = '輸入';
@ -235,4 +300,12 @@ $lang['zh'][54] = '不做最佳化';
$lang['zh'][55] = '安全地最佳化';
$lang['zh'][56] = '全部最佳化';
$lang['zh'][57] = '加上時間戳記';
?>
$lang['zh'][58] = '复制到剪贴板';
$lang['zh'][59] = '回到页面上方';
$lang['zh'][60] = '你的浏览器不支持复制到剪贴板。';
$lang['zh'][61] = '如果程序有错误或你有建议,欢迎';
$lang['zh'][62] = '和我联系';
$lang['zh'][63] = 'Output CSS code as complete HTML document';
$lang['zh'][64] = '代码';
$lang['zh'][65] = 'CSS to style CSS output';
$lang['zh'][66] = 'You need to go to about:config in your URL bar, select \'signed.applets.codebase_principal_support\' in the filter field, and set its value to true in order to use this feature; however, be aware that doing so increases security risks.';

View file

@ -0,0 +1,2 @@
ALTER TABLE `prefix_topic` ADD `topic_count_favourite` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `topic_count_comment`;
ALTER TABLE `prefix_comment` ADD `comment_count_favourite` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `comment_count_vote`;

View file

@ -835,6 +835,7 @@ return array(
'admin_list_plugins' => 'Manage plugins',
'admin_list_userfields' => 'Configuring custom fields',
'admin_list_restorecomment' => 'Rebuilding a tree comments',
'admin_list_recalcfavourite' => 'Recalculate counters of favorites',
/**
@ -900,6 +901,7 @@ return array(
*/
'admin_title' => 'Admin',
'admin_comment_restore_tree' => 'Tree comments restore successful',
'admin_favourites_recalculated' => 'Favourites counters has been recalculated',
/**
* Plugin administration page

View file

@ -834,6 +834,7 @@ return array(
'admin_list_plugins' => 'Управление плагинами',
'admin_list_userfields' => 'Настройка пользовательских полей',
'admin_list_restorecomment' => 'Перестроение дерева комментариев',
'admin_list_recalcfavourite' => 'Пересчитать счетчики избранных',
/**
* Рейтинг TOP
@ -898,6 +899,7 @@ return array(
*/
'admin_title' => 'Админка',
'admin_comment_restore_tree' => 'Дерево комментариев перестроенно',
'admin_favourites_recalculated' => 'Счетчики избранных пересчитаны',
/**
* Страница администрирования плагинов

View file

@ -4,6 +4,7 @@
<li><a href="{router page="admin"}plugins">{$aLang.admin_list_plugins}</a></li>
<li><a href="{router page="admin"}userfields">{$aLang.admin_list_userfields}</a></li>
<li><a href="{router page="admin"}restorecomment">{$aLang.admin_list_restorecomment}</a></li>
<li><a href="{router page="admin"}recalcfavourite">{$aLang.admin_list_recalcfavourite}</a></li>
{hook run='admin_action_item'}
</ul>

View file

@ -16,7 +16,7 @@
{/if}
<li class="goto-comment-child"><a href="#" title="{$aLang.comment_goto_child}">↓</a></li>
{if $oUserCurrent and !$bNoCommentFavourites}
<li><a href="#" onclick="return ls.favourite.toggle({$oComment->getId()},this,'comment');" class="favourite {if $oComment->getIsFavourite()}active{/if}"></a></li>
<li><a href="#" onclick="return ls.favourite.toggle({$oComment->getId()},this,'comment');" class="favourite {if $oComment->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_comment_{$oComment->getId()}">{if $oComment->getCountFavourite()>0}{$oComment->getCountFavourite()}{else}&nbsp;{/if}</span></li>
{/if}
{if !$oComment->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
<li><a href="#" class="delete" onclick="ls.comments.toggle(this,{$oComment->getId()}); return false;">{$aLang.comment_delete}</a></li>

View file

@ -1,76 +1,77 @@
/* Voting */
.voting { overflow: hidden; zoom: 1; }
.voting .total { float: left; padding: 0 7px; font-weight: bold; color: #aaa; }
.voting .total a { text-decoration: none; color: #999; outline: none; }
.voting.positive .total { color: #390; }
.voting.negative .total { color: #f00; }
.voting .plus,
.voting .minus { width: 10px; height: 10px; float: left; display: block; background: url(../images/voting.png) no-repeat; position: relative; top: 4px; outline: none; }
.voting .plus { background-position: 0 0; }
.voting .minus { background-position: -20px 0; }
.voting .plus:hover { background-position: -10px 0; }
.voting .minus:hover { background-position: -30px 0; }
.voting.voted.plus .plus { background-position: -10px 0; }
.voting.voted.minus .minus { background-position: -30px 0; }
.voting.voted.plus .minus:hover { background-position: -20px 0; }
.voting.voted.minus .plus:hover { background-position: 0 0; }
.voting.guest .plus:hover { background-position: 0 0; }
.voting.guest .minus:hover { background-position: -20px 0; }
/* Favorite */
.favourite { background: url(../images/favorite.png) no-repeat; display: block; height: 16px; width: 16px; position: relative; top: 1px; }
.favourite:hover { background-position: 0 -16px !important; }
.favourite.active { background-position: 0 -16px; }
/* Pagination */
.pagination ul li { display: inline; margin-right: 5px; }
.pagination ul li.active { color: #aaa; }
.pagination.pagination-comments { margin-bottom: 15px; }
/* Switcher */
.switcher { overflow: hidden; zoom: 1; margin-bottom: 10px; }
.switcher li { float: left; margin-right: 3px; }
.switcher li a { float: left; padding: 1px 10px 2px; text-decoration: none; color: #777; background: #eee; }
.switcher li.active a { border: 0; color: #eee; background: #555; }
.switcher-block { overflow: hidden; zoom: 1; margin-bottom: 10px; }
.switcher-block li { float: left; padding: 1px 10px 2px; margin-right: 3px; color: #777; background: #eee; cursor: pointer; }
.switcher-block li:hover { background: #ddd; }
.switcher-block li.active { color: #eee; background: #555; }
/* System messages */
.system-message-error { background: #f0c8c8; color: #b22626; padding: 10px 15px; margin-bottom: 15px; }
.system-message-notice { background: #dafad8; color: #4bb23b; padding: 10px 15px; margin-bottom: 15px; }
/* Actions */
.actions { overflow: hidden; zoom: 1; margin-bottom: 10px; }
.actions li a { overflow: hidden; zoom: 1; margin-bottom: 10px; color: #333; text-decoration: none; }
.actions li { float: left; margin-right: 10px; }
.actions li .edit { padding-left: 15px; background: url(../images/edit.png) no-repeat 0 1px; }
.actions li .delete { padding-left: 14px; background: url(../images/delete.png) no-repeat 0 2px; }
.actions li .rss { padding-left: 15px; background: url(../images/rss.png) no-repeat 0 1px; }
.actions li a:hover { text-decoration: underline; }
/* Misc */
.user, .ls-user { padding-left: 12px; background: url(../images/user.png) no-repeat 0 2px; color: #555; }
.user.inactive { color: #888; }
.center { width: 300px; margin: 0 auto; }
.table { width: 100%; margin-bottom: 15px; }
.table thead td { background: #fafafa; }
.table td { border: 1px solid #eee; padding: 5px; }
.table tr.active td { background: #F1FCEF; }
/* Voting */
.voting { overflow: hidden; zoom: 1; }
.voting .total { float: left; padding: 0 7px; font-weight: bold; color: #aaa; }
.voting .total a { text-decoration: none; color: #999; outline: none; }
.voting.positive .total { color: #390; }
.voting.negative .total { color: #f00; }
.voting .plus,
.voting .minus { width: 10px; height: 10px; float: left; display: block; background: url(../images/voting.png) no-repeat; position: relative; top: 4px; outline: none; }
.voting .plus { background-position: 0 0; }
.voting .minus { background-position: -20px 0; }
.voting .plus:hover { background-position: -10px 0; }
.voting .minus:hover { background-position: -30px 0; }
.voting.voted.plus .plus { background-position: -10px 0; }
.voting.voted.minus .minus { background-position: -30px 0; }
.voting.voted.plus .minus:hover { background-position: -20px 0; }
.voting.voted.minus .plus:hover { background-position: 0 0; }
.voting.guest .plus:hover { background-position: 0 0; }
.voting.guest .minus:hover { background-position: -20px 0; }
/* Favorite */
.favourite { background: url(../images/favorite.png) no-repeat; display: block; height: 16px; width: 16px; position: relative; top: 1px; float: left;}
.favourite:hover { background-position: 0 -16px !important; }
.favourite.active { background-position: 0 -16px; }
.favourite-count { color: #333; font-weight: bold; float: left; margin-left: 2px; }
/* Pagination */
.pagination ul li { display: inline; margin-right: 5px; }
.pagination ul li.active { color: #aaa; }
.pagination.pagination-comments { margin-bottom: 15px; }
/* Switcher */
.switcher { overflow: hidden; zoom: 1; margin-bottom: 10px; }
.switcher li { float: left; margin-right: 3px; }
.switcher li a { float: left; padding: 1px 10px 2px; text-decoration: none; color: #777; background: #eee; }
.switcher li.active a { border: 0; color: #eee; background: #555; }
.switcher-block { overflow: hidden; zoom: 1; margin-bottom: 10px; }
.switcher-block li { float: left; padding: 1px 10px 2px; margin-right: 3px; color: #777; background: #eee; cursor: pointer; }
.switcher-block li:hover { background: #ddd; }
.switcher-block li.active { color: #eee; background: #555; }
/* System messages */
.system-message-error { background: #f0c8c8; color: #b22626; padding: 10px 15px; margin-bottom: 15px; }
.system-message-notice { background: #dafad8; color: #4bb23b; padding: 10px 15px; margin-bottom: 15px; }
/* Actions */
.actions { overflow: hidden; zoom: 1; margin-bottom: 10px; }
.actions li a { overflow: hidden; zoom: 1; margin-bottom: 10px; color: #333; text-decoration: none; }
.actions li { float: left; margin-right: 10px; }
.actions li .edit { padding-left: 15px; background: url(../images/edit.png) no-repeat 0 1px; }
.actions li .delete { padding-left: 14px; background: url(../images/delete.png) no-repeat 0 2px; }
.actions li .rss { padding-left: 15px; background: url(../images/rss.png) no-repeat 0 1px; }
.actions li a:hover { text-decoration: underline; }
/* Misc */
.user, .ls-user { padding-left: 12px; background: url(../images/user.png) no-repeat 0 2px; color: #555; }
.user.inactive { color: #888; }
.center { width: 300px; margin: 0 auto; }
.table { width: 100%; margin-bottom: 15px; }
.table thead td { background: #fafafa; }
.table td { border: 1px solid #eee; padding: 5px; }
.table tr.active td { background: #F1FCEF; }
.right { float: right; }

View file

@ -47,6 +47,8 @@ ls.favourite = (function ($) {
if (result.bState) {
this.objFavourite.addClass(this.options.active);
}
$('#fav_count_'+type+'_'+idTarget).text((result.iCount>0) ? result.iCount : '');
}
}.bind(this));
return false;

View file

@ -60,7 +60,7 @@
</li>
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a></li>
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else}&nbsp;{/if}</span></li>
<li><a href="{router page='link'}go/{$oTopic->getId()}/" title="{$aLang.topic_link_count_jump}: {$oTopic->getLinkCountJump()}">{$oTopic->getLinkUrl(true)}</a></li>
{if $bTopicList}
<li class="comments-link">

View file

@ -112,7 +112,7 @@ jQuery(window).load(function($) {
</li>
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a></li>
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else}&nbsp;{/if}</span></li>
{if $bTopicList}
<li class="comments-link">
{if $oTopic->getCountComment()>0}

View file

@ -91,7 +91,7 @@
</li>
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a></li>
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else}&nbsp;{/if}</span></li>
{if $bTopicList}
<li class="comments-link">
{if $oTopic->getCountComment()>0}

View file

@ -59,7 +59,7 @@
</li>
<li class="username"><a href="{$oUser->getUserWebPath()}">{$oUser->getLogin()}</a></li>
<li class="date">{date_format date=$oTopic->getDateAdd()}</li>
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a></li>
<li><a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else}&nbsp;{/if}</span></li>
{if $bTopicList}
<li class="comments-link">
{if $oTopic->getCountComment()>0}

View file

@ -4,7 +4,8 @@
<li><a href="{router page="admin"}plugins">{$aLang.admin_list_plugins}</a></li>
<li><a href="{router page="admin"}userfields">{$aLang.admin_list_userfields}</a></li>
<li><a href="{router page="admin"}restorecomment">{$aLang.admin_list_restorecomment}</a></li>
<li><a href="{router page="admin"}recalcfavourite">{$aLang.admin_list_recalcfavourite}</a></li>
{hook run='admin_action_item'}
</ul>
{include file='footer.tpl'}
{include file='footer.tpl'}

View file

@ -43,7 +43,7 @@
{/if}
<li class="goto-comment-child"><a href="#" title="{$aLang.comment_goto_child}">↓</a></li>
{if $oUserCurrent and !$bNoCommentFavourites}
<li><a href="#" onclick="return ls.favourite.toggle({$oComment->getId()},this,'comment');" class="favourite {if $oComment->getIsFavourite()}active{/if}"></a></li>
<li><a href="#" onclick="return ls.favourite.toggle({$oComment->getId()},this,'comment');" class="favourite {if $oComment->getIsFavourite()}active{/if}"><span class="favourite-count" id="fav_count_comment_{$oComment->getId()}">{if $oComment->getCountFavourite()>0}{$oComment->getCountFavourite()}{else}&nbsp;{/if}</span></a></li>
{/if}
{if !$oComment->getDelete() and $oUserCurrent and $oUserCurrent->isAdministrator()}
<li><a href="#" class="delete" onclick="ls.comments.toggle(this,{$oComment->getId()}); return false;">{$aLang.comment_delete}</a></li>

View file

@ -62,7 +62,8 @@
.comment .info li a.favourite { float: left; width: 10px; height: 8px; background: url(../images/icons.gif) -40px -40px no-repeat; position: relative; top: 4px; }
.comment .info li a.favourite.active { background-position: -50px -40px; }
.comment .info li a.favourite:hover { background-position: -50px -40px; }
.comment .info li a { }
.comment .info li span.favourite-count { color: #390; margin-left: 2px; position: relative; top: 1px; }
.comment .info li a { }
/* Content */
.comment .content { color: #000; margin: 0 30px 10px 0; border: 1px solid #DDDEDE; background: #f7f7f7; border-radius: 7px; padding: 8px 30px 9px 10px; position: relative; overflow: hidden; zoom: 1; }

View file

@ -2,7 +2,7 @@
/* Title */
.topic .title { margin-bottom: 3px; font-size: 22px; font-family: Verdana, sans-serif; }
.topic .title a { }
.topic .title a { }
/* Content */
.topic .content { overflow: hidden; zoom: 1; margin-bottom: 15px; font-size: 14px; font-family: Verdana, sans-serif; line-height: 20px; }
@ -42,9 +42,10 @@
.topic .info li.comments-link a:hover span { background: #390; color: #fff; }
.topic .info li.url a { padding-left: 16px; background: url(../images/topic_link.gif) 0 1px no-repeat; font-size: 11px; }
.topic .favourite { position: absolute; top: 8px; left: -8px; height: 16px; width: 20px; background: url(../images/icons.gif) no-repeat 0 -40px; }
.topic .favourite:hover { background: url(../images/icons.gif) no-repeat -20px -40px; }
.topic .favourite.active { background: url(../images/icons.gif) no-repeat -20px -40px; }
.topic .favourite { position: absolute; top: 8px; left: -8px; height: 16px; width: 20px; background: url(../images/icons.gif) no-repeat 0 -40px; text-align: center; font-weight: bold; text-decoration: none; }
.topic .favourite:hover { background: url(../images/icons.gif) no-repeat -20px -40px; color: #fff; }
.topic .favourite.active { background: url(../images/icons.gif) no-repeat -20px -40px; color: #fff; }
.topic .favourite-count { color: #390; position: absolute;top: 15px; left: -7px; width: 32px; }
/* Poll */
.topic .poll { margin-bottom: 15px; font-size: 14px; }
@ -65,7 +66,7 @@
.topic .poll .poll-total { color: #aaa; }
/* Topic Photo */
.topic.photo { }
.topic.photo { }
.topic.photo .topic-photo-preview { position: relative; margin-bottom: 15px; cursor: pointer; }
.topic.photo .topic-photo-preview img { vertical-align: top; }
.topic.photo .topic-photo-preview .topic-photo-count { display: none; cursor: pointer; position: absolute; top: 5px; right: 5px; background: #000; color: #6bd24b; padding: 4px 7px; background: rgba(0,0,0,.6); }

View file

@ -47,6 +47,8 @@ ls.favourite = (function ($) {
if (result.bState) {
this.objFavourite.addClass(this.options.active);
}
$('#fav_count_'+type+'_'+idTarget).text((result.iCount>0) ? result.iCount : '');
}
}.bind(this));
return false;

View file

@ -11,7 +11,9 @@
<img src="{cfg name='path.static.skin'}/images/topic_link_big.gif" title="{$aLang.topic_link}" alt="{$aLang.topic_link}" />
</h1>
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a>
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"><span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">
{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else}&nbsp;{/if}</span>
</a>
<div class="info-top">
@ -75,4 +77,4 @@
{if !$bTopicList}
{hook run='topic_show_end' topic=$oTopic}
{/if}
</div>
</div>

View file

@ -20,7 +20,9 @@
{/if}
</h1>
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a>
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}">
<span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else}&nbsp;{/if}</span>
</a>
@ -133,4 +135,4 @@
{if !$bTopicList}
{hook run='topic_show_end' topic=$oTopic}
{/if}
</div>
</div>

View file

@ -15,7 +15,9 @@
{/if}
</h1>
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a>
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}">
<span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else}&nbsp;{/if}</span>
</a>
@ -117,4 +119,4 @@
{if !$bTopicList}
{hook run='topic_show_end' topic=$oTopic}
{/if}
</div>
</div>

View file

@ -14,7 +14,9 @@
{/if}
</h1>
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}"></a>
<a href="#" onclick="return ls.favourite.toggle({$oTopic->getId()},this,'topic');" class="favourite {if $oUserCurrent && $oTopic->getIsFavourite()}active{/if}">
<span class="favourite-count" id="fav_count_topic_{$oTopic->getId()}">{if $oTopic->getCountFavourite()>0}{$oTopic->getCountFavourite()}{else}&nbsp;{/if}</span>
</a>
@ -81,4 +83,4 @@
{if !$bTopicList}
{hook run='topic_show_end' topic=$oTopic}
{/if}
</div>
</div>