master
Jean-Christian Paul Denis 2021-08-20 17:44:19 +02:00
commit b38ca38b09
16 changed files with 2276 additions and 0 deletions

41
CHANGELOG 100644
View File

@ -0,0 +1,41 @@
fac 0.7 - 2013-11-11
===========================================================
* Switch to Dotclear 2.6
* Fix missing feed description
fac 0.6.1 - 2010-11-12
===========================================================
* Fixed install on nightly build
fac 0.6 - 2010-08-16
===========================================================
* Added compatibility with plugin muppet
fac 0.5 - 2010-06-05
===========================================================
* Switched to DC 2.2
* Added predefined format (thx to Jean-Michel) (closes #459)
fac 0.4.1 - 2010-04-10
===========================================================
* Fixed typo (thx to Jean-Michel) (closes #458)
fac 0.4 - 2010-05-25
===========================================================
* Fixed Timeout error
* Fixed DC 2.1.7
fac 0.3 - 2010-04-10
===========================================================
* Added options to format feed
* Added DC 2.2 compatibility
* Removed class and used metadata
* Changed admin page design
fac 0.2 - 2010-02-17
===========================================================
* Fixed some fields in admin
fac 0.1 - 2010-02-16
===========================================================
* First lab release

339
LICENSE 100644
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 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.
Preamble
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 Lesser General Public License instead.) You can apply it to
your programs, too.
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.
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.
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.
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.
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.
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.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
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".
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.
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.
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.
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:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
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.
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.
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.
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.
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:
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,
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,
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.)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
NO WARRANTY
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.
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.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
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.
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.
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.
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 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:
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.
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 Lesser General
Public License instead of this License.

35
README.md 100644
View File

@ -0,0 +1,35 @@
# README
## WHAT IS FAC ?
"Feed After Content" is a plugin for the open-source
web publishing software called Dotclear.
It add options to the sidebar of post edition page
to link en extenal feed to the bottom of an entry.
## REQUIREMENTS
fac requires:
* admin permissions to configure plugin
* usage,contentadmin permissions to link feeds
* Dotclear 2.6
* A theme that contents behavior publicEntryAfterContent
## USAGE
First install fac, manualy from a zip package or from
Dotaddict repository. (See Dotclear's documentation to know how do this)
When you edit a post you have a new sidebar menu called "Linked feed"
to link a feed to this post.
You can also add or remove feed to multiple post from posts actions page.
This plugins also supports pages from plugin "muppet".
## MORE
* License : GNU GPL v2
* Source & contribution : [GitHub Page](https://github.com/JcDenis/fac)
* Packages & details: [Dotaddict Page](https://plugins.dotaddict.org/dc2/details/fac)

351
_admin.php 100644
View File

@ -0,0 +1,351 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of fac, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
# contact@jcdenis.fr http://jcd.lv
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
return null;
}
$core->blog->settings->addNamespace('fac');
# Not active
if (!$core->blog->settings->fac->fac_active) {
return null;
}
# Admin behaviors
$core->addBehavior(
'adminPostHeaders',
array('facAdmin', 'adminPostHeaders')
);
$core->addBehavior(
'adminPostFormItems',
array('facAdmin', 'adminPostFormItems')
);
$core->addBehavior(
'adminAfterPostCreate',
array('facAdmin', 'adminAfterPostSave')
);
$core->addBehavior(
'adminAfterPostUpdate',
array('facAdmin', 'adminAfterPostSave')
);
$core->addBehavior(
'adminBeforePostDelete',
array('facAdmin', 'adminBeforePostDelete')
);
$core->addBehavior(
'adminPostsActionsPage',
array('facAdmin', 'adminPostsActionsPage')
);
/**
* @ingroup DC_PLUGIN_FAC
* @brief Linked feed to entries - admin methods.
* @since 2.6
*/
class facAdmin
{
/**
* Add javascript (toggle)
*
* @return string HTML head
*/
public static function adminPostHeaders()
{
return dcPage::jsLoad('index.php?pf=fac/js/admin.js');
}
/**
* Add form to post sidebar
*
* @param ArrayObject $main_items Main items
* @param ArrayObject $sidebar_items Sidebar items
* @param record $post Post record or null
*/
public static function adminPostFormItems(ArrayObject $main_items, ArrayObject $sidebar_items, $post)
{
global $core;
# Get existing linked feed
$fac_url = $fac_format = '';
if ($post) {
$rs = $core->meta->getMetadata(array(
'meta_type' => 'fac',
'post_id' => $post->post_id,
'limit' => 1
));
$fac_url = $rs->isEmpty() ? '' : $rs->meta_id;
$rs = $core->meta->getMetadata(array(
'meta_type' => 'facformat',
'post_id' => $post->post_id,
'limit' => 1
));
$fac_format = $rs->isEmpty() ? '' : $rs->meta_id;
}
# Set linked feed form items
$sidebar_items['options-box']['items']['fac'] =
self::formFeed($core, $fac_url, $fac_format);
}
/**
* Save linked feed
*
* @param cursor $cur Current post cursor
* @param integer $post_id Post id
*/
public static function adminAfterPostSave(cursor $cur, $post_id)
{
global $core;
if (!isset($_POST['fac_url'])
|| !isset($_POST['fac_format'])
) {
return null;
}
# Delete old linked feed
self::delFeed($core, $post_id);
# Add new linked feed
self::addFeed($core, $post_id, $_POST);
}
/**
* Delete linked feed on post edition
*
* @param integer $post_id Post id
*/
public static function adminBeforePostDelete($post_id)
{
self::delFeed($GLOBALS['core'], $post_id);
}
/**
* Add actions to posts page combo
*
* @param dcCore $core dcCore instance
* @param dcPostsActionsPage $ap dcPostsActionsPage instance
*/
public static function adminPostsActionsPage(dcCore $core, dcPostsActionsPage $pa)
{
$pa->addAction(
array(
__('Linked feed') => array(
__('Add feed') => 'fac_add'
)
),
array('facAdmin', 'callbackAdd')
);
if (!$core->auth->check('delete,contentadmin', $core->blog->id)) {
return null;
}
$pa->addAction(
array(
__('Linked feed') => array(
__('Remove feed') => 'fac_remove'
)
),
array('facAdmin', 'callbackRemove')
);
}
/**
* Posts actions callback to remove linked feed
*
* @param dcCore $core dcCore instance
* @param dcPostsActionsPage $pa dcPostsActionsPage instance
* @param ArrayObject $post _POST actions
*/
public static function callbackRemove(dcCore $core, dcPostsActionsPage $pa, ArrayObject $post)
{
# No entry
$posts_ids = $pa->getIDs();
if (empty($posts_ids)) {
throw new Exception(__('No entry selected'));
}
# No right
if (!$core->auth->check('delete,contentadmin',$core->blog->id)) {
throw new Exception(__('No enough right'));
}
# Delete expired date
foreach($posts_ids as $post_id) {
self::delFeed($core, $post_id);
}
dcPage::addSuccessNotice(__('Linked feed deleted.'));
$pa->redirect(true);
}
/**
* Posts actions callback to add linked feed
*
* @param dcCore $core dcCore instance
* @param dcPostsActionsPage $pa dcPostsActionsPage instance
* @param ArrayObject $post _POST actions
*/
public static function callbackAdd(dcCore $core, dcPostsActionsPage $pa, ArrayObject $post)
{
# No entry
$posts_ids = $pa->getIDs();
if (empty($posts_ids)) {
throw new Exception(__('No entry selected'));
}
# Save action
if (!empty($post['fac_url'])
&& !empty($post['fac_format'])
) {
foreach($posts_ids as $post_id) {
self::delFeed($core, $post_id);
self::addFeed($core, $post_id, $post);
}
dcPage::addSuccessNotice(__('Linked feed added.'));
$pa->redirect(true);
}
# Display form
else {
$pa->beginPage(
dcPage::breadcrumb(array(
html::escapeHTML($core->blog->name) => '',
$pa->getCallerTitle() => $pa->getRedirection(true),
__('Linked feed to this selection') => ''
))
);
echo
'<form action="'.$pa->getURI().'" method="post">'.
$pa->getCheckboxes().
self::formFeed($core).
'<p>'.
$core->formNonce().
$pa->getHiddenFields().
form::hidden(array('action'), 'fac_add').
'<input type="submit" value="'.__('Save').'" /></p>'.
'</form>';
$pa->endPage();
}
}
/**
* Linked feed form field
*
* @param dcCore $core dcCore instance
* @param string $url Feed URL
* @param string $format Feed format
* @return string Feed form content
*/
protected static function formFeed(dcCore $core, $url='', $format='')
{
return
'<div id="fac">'.
'<h5>'.__('Linked feed').'</h5>'.
'<p><label for="fac_url">'.
__('Feed URL:').'</label>'.
form::field(
'fac_url',
60,
255,
$url,
'maximal'
).'</p>'.
'<p><label for="fac_format">'.
__('Format:').'</label>'.
form::combo(
'fac_format',
self::comboFac($core),
$format,
'maximal'
).'</p>'.
($url ? '<p><a href="'.$url.'" title="'.$url.'">'.__('view feed').'</a></p>' : '').
'</div>';
}
/**
* List of fac formats
*
* @param dcCore $core dcCore instance
* @return array List of fac formats
*/
protected static function comboFac(dcCore $core)
{
$formats = @unserialize($core->blog->settings->fac->fac_formats);
if (!is_array($formats) || empty($formats)) {
return array();
}
$res = array();
foreach($formats as $uid => $f) {
$res[$f['name']] = $uid;
}
return $res;
}
/**
* Delete linked feed
*
* @param dcCore $core dcCore instance
* @param integer $post_id Post id
*/
protected static function delFeed(dcCore $core, $post_id)
{
$post_id = (integer) $post_id;
$core->meta->delPostMeta($post_id, 'fac');
$core->meta->delPostMeta($post_id, 'facformat');
}
/**
* Add linked feed
*
* @param dcCore $core dcCore instance
* @param integer $post_id Post id
* @param array $options Feed options
*/
protected static function addFeed($core, $post_id, $options)
{
if (empty($options['fac_url'])
|| empty($options['fac_format'])
) {
return null;
}
$post_id = (integer) $post_id;
$core->meta->setPostMeta(
$post_id,
'fac',
$options['fac_url']
);
$core->meta->setPostMeta(
$post_id,
'facformat',
$options['fac_format']
);
}
}

567
_config.php 100644
View File

@ -0,0 +1,567 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of fac, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
# contact@jcdenis.fr http://jcd.lv
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_MODULE')) {
return null;
}
$redir = empty($_REQUEST['redir']) ?
$list->getURL().'#plugins' : $_REQUEST['redir'];
# -- Combos of types of supported public pages --
$types = array(
__('home page') => 'default',
__('post pages') => 'post',
__('tags pages') => 'tag',
__('archives pages') => 'archive',
__('category pages') => 'category',
__('entries feed') => 'feed'
);
if ($core->plugins->moduleExists('muppet')) {
foreach(muppet::getPostTypes() as $k => $v) {
$types[sprintf(
__('"%s" pages from extension muppet'),
$v['name']
)] = $k;
}
}
# -- Get settings --
$core->blog->settings->addNamespace('fac');
$s = $core->blog->settings->fac;
$fac_active = (boolean) $s->fac_active;
$fac_defaultfeedtitle = (string) $s->fac_defaultfeedtitle;
$fac_showfeeddesc = (boolean) $s->fac_showfeeddesc;
$fac_public_tpltypes = @unserialize($s->fac_public_tpltypes);
$fac_formats = @unserialize($s->fac_formats);
if (!is_array($fac_public_tpltypes)) {
$fac_public_tpltypes = array();
}
if (!is_array($fac_formats)) {
$fac_formats = array();
}
# -- Set settings --
if (!empty($_POST['save'])) {
try {
$fac_active = !empty($_POST['fac_active']);
$fac_defaultfeedtitle = (string) $_POST['fac_defaultfeedtitle'];
$fac_showfeeddesc = !empty($_POST['fac_showfeeddesc']);
$fac_public_tpltypes = $_POST['fac_public_tpltypes'];
$fac_formats = array();
foreach($_POST['fac_formats'] as $uid => $f) {
if (!empty($f['name'])) {
$fac_formats[$uid] = $f;
}
}
$s->put('fac_active', $fac_active);
$s->put('fac_defaultfeedtitle', $fac_defaultfeedtitle);
$s->put('fac_showfeeddesc', $fac_showfeeddesc);
$s->put('fac_public_tpltypes', serialize($fac_public_tpltypes));
$s->put('fac_formats', serialize($fac_formats));
$core->blog->triggerBlog();
dcPage::addSuccessNotice(
__('Configuration has been successfully updated.')
);
http::redirect(
$list->getURL('module=fac&conf=1&redir='.
$list->getRedir())
);
}
catch (Exception $e) {
$core->error->add($e->getMessage());
}
}
# -- Display form --
echo '
<div class="fieldset">
<h4>'.__('Activation').'</h4>
<p><label class="classic" for="fac_active">'.
form::checkbox('fac_active', 1, $fac_active).
__('Enable plugin').'</label></p>
<h5>'.__('Show feed after content on:').'</h5>';
foreach($types as $k => $v) {
echo '
<p><label class="classic" for="fac_public_tpltypes'.$k.'">'.
form::checkbox(
array('fac_public_tpltypes[]', 'fac_public_tpltypes'.$k),
$v,
in_array($v,$fac_public_tpltypes)
).__($k).'</label></p>';
}
echo '
</div>
<div class="fieldset">
<h4>'.__('Feed').'</h4>
<p><label for="fac_defaultfeedtitle">'.__('Default title').'</label>'.
form::field('fac_defaultfeedtitle', 65, 255, $fac_defaultfeedtitle).'</p>
<p class="form-note">'.__('Use %T to insert title of feed.').'</p>
<p><label class="classic" for="fac_showfeeddesc">'.
form::checkbox('fac_showfeeddesc', 1, $fac_showfeeddesc).
__('Show description of feed').'</label></p>
</div>';
$i = 1;
foreach($fac_formats as $uid => $f) {
if (empty($f['name'])) {
continue;
}
echo '
<div class="fieldset">
<h4>'.sprintf(__('Format %s'), $i).'</h4>
<div class="two-boxes"><h5>'.__('General').'</h5>
<p><label for="fac_formats_'.$uid.'_name">'.
__('Name:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][name]',
'fac_formats_'.$uid.'_name'
),
20,
255,
empty($f['name']) ? '' : $f['name'],
'maximal'
).'</p>
<p class="form-note">'.
__('In order to remove a format, leave its name empty.').
'</p>
<p><label for="fac_formats_'.$uid.'_dateformat">'.
__('Date format:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][dateformat]',
'fac_formats_'.$uid.'_dateformat'
),
20,
255,
empty($f['dateformat']) ? '' : $f['dateformat'],
'maximal'
).'</p>
<p class="form-note">'.
__('Use date format of Dotclear or leave empty to use default date format of blog.').
'</p>
<p><label for="fac_formats_'.$uid.'_lineslimit">'.
__('Entries limit:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][lineslimit]',
'fac_formats_'.$uid.'_lineslimit'
),
5,
4,
empty($f['lineslimit']) ? '' : $f['lineslimit'],
'maximal'
).'</p>
<p class="form-note">'.
__('Leave lengh empty for no limit.').
'</p>
</div><div class="two-boxes"><h5>'.__('Title').'</h5>
<p><label for="fac_formats_'.$uid.'_linestitletext">'.
__('Title format:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linestitletext]',
'fac_formats_'.$uid.'_linestitletext'
),
20,
255,
empty($f['linestitletext']) ? '' : $f['linestitletext'],
'maximal'
).'</p>
<p class="form-note">'.
__('Format can be:').
'%D : '.__('Date').
', %T : '.__('Title').
', %A : '.__('Author').
', %E : '.__('Description').
', %C : '.__('Content').
'</p>
<p><label for="fac_formats_'.$uid.'_linestitleover">'.
__('Over title format:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linestitleover]',
'fac_formats_'.$uid.'_linestitleover'
),
20,
255,
empty($f['linestitleover']) ? '' : $f['linestitleover'],
'maximal'
).'</p>
<p class="form-note">'.
__('Format can be:').
'%D : '.__('Date').
', %T : '.__('Title').
', %A : '.__('Author').
', %E : '.__('Description').
', %C : '.__('Content').
'</p>
<p><label for="fac_formats_'.$uid.'_linestitlelength">'.
__('Maximum length of title:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linestitlelength]',
'fac_formats_'.$uid.'_linestitlelength'
),
5,
4,
empty($f['linestitlelength']) ? '' : $f['linestitlelength'],
'maximal'
).'</p>
<p class="form-note">'.
__('Leave lengh empty for no limit.').
'</p>
</div><div class="two-boxes"><h5>'.__('Description').'</h5>
<p><label for="fac_formats_'.$uid.'_showlinesdescription">'.
form::checkbox(
array(
'fac_formats['.$uid.'][showlinesdescription]',
'fac_formats_'.$uid.'_showlinesdescription'
),
1,
!empty($f['showlinesdescription'])
).
__('Show description of entries').'</label></p>
<p><label for="fac_formats_'.$uid.'_linesdescriptionnohtml">'.
form::checkbox(
array(
'fac_formats['.$uid.'][linesdescriptionnohtml]',
'fac_formats_'.$uid.'_linesdescriptionnohtml'
),
1,
!empty($f['linesdescriptionnohtml'])
).
__('Remove html of description').'</label></p>
<p><label for="fac_formats_'.$uid.'_linesdescriptionlength">'.
__('Maximum length of description:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linesdescriptionlength]',
'fac_formats_'.$uid.'_linesdescriptionlength'
),
5,
4,
empty($f['linesdescriptionlength']) ? '' : $f['linesdescriptionlength'],
'maximal'
).'</p>
<p class="form-note">'.
__('Leave lengh empty for no limit.').
'</p>
</div><div class="two-boxes"><h5>'.__('Content').'</h5>
<p><label for="fac_formats_'.$uid.'_showlinescontent">'.
form::checkbox(
array(
'fac_formats['.$uid.'][showlinescontent]',
'fac_formats_'.$uid.'_showlinescontent'
),
1,
!empty($f['showlinescontent'])
).
__('Show content of entries').'</label></p>
<p><label for="fac_formats_'.$uid.'_linescontentnohtml">'.
form::checkbox(
array(
'fac_formats['.$uid.'][linescontentnohtml]',
'fac_formats_'.$uid.'_linescontentnohtml'
),
1,
!empty($f['linescontentnohtml'])
).
__('Remove html of content').'</label></p>
<p><label for="fac_formats_'.$uid.'_linescontentlength">'.
__('Maximum length of content:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linescontentlength]',
'fac_formats_'.$uid.'_linescontentlength'
),
5,
4,
empty($f['linescontentlength']) ? '' : $f['linescontentlength'],
'maximal'
).'</p>
<p class="form-note">'.
__('Leave lengh empty for no limit.').
'</p>
</div>
</div>';
$i++;
}
$uid = uniqid();
echo '
<div class="fieldset">
<h4>'.__('New format').'</h4>
<div class="two-boxes"><h5>'.__('General').'</h5>
<p><label for="fac_formats_'.$uid.'_name">'.
__('Name:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][name]',
'fac_formats_'.$uid.'_name'
),
20,
255,
'',
'maximal'
).'</p>
<p class="form-note">'.
__('In order to remove a format, leave its name empty.').
'</p>
<p><label for="fac_formats_'.$uid.'_dateformat">'.
__('Date format:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][dateformat]',
'fac_formats_'.$uid.'_dateformat'
),
20,
255,
'',
'maximal'
).'</p>
<p class="form-note">'.
__('Use date format of Dotclear or leave empty to use default date format of blog.').
'</p>
<p><label for="fac_formats_'.$uid.'_lineslimit">'.
__('Entries limit:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][lineslimit]',
'fac_formats_'.$uid.'_lineslimit'
),
5,
4,
5,
'maximal'
).'</p>
<p class="form-note">'.
__('Leave lengh empty for no limit.').
'</p>
</div><div class="two-boxes"><h5>'.__('Title').'</h5>
<p><label for="fac_formats_'.$uid.'_linestitletext">'.
__('Title format:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linestitletext]',
'fac_formats_'.$uid.'_linestitletext'
),
20,
255,
'%T',
'maximal'
).'</p>
<p class="form-note">'.
__('Format can be:').
'%D : '.__('Date').
', %T : '.__('Title').
', %A : '.__('Author').
', %E : '.__('Description').
', %C : '.__('Content').
'</p>
<p><label for="fac_formats_'.$uid.'_linestitleover">'.
__('Over title format:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linestitleover]',
'fac_formats_'.$uid.'_linestitleover'
),
20,
255,
'%D',
'maximal'
).'</p>
<p class="form-note">'.
__('Format can be:').
'%D : '.__('Date').
', %T : '.__('Title').
', %A : '.__('Author').
', %E : '.__('Description').
', %C : '.__('Content').
'</p>
<p><label for="fac_formats_'.$uid.'_linestitlelength">'.
__('Maximum length of title:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linestitlelength]',
'fac_formats_'.$uid.'_linestitlelength'
),
5,
4,
150,
'maximal'
).'</p>
<p class="form-note">'.
__('Leave lengh empty for no limit.').
'</p>
</div><div class="two-boxes"><h5>'.__('Description').'</h5>
<p><label for="fac_formats_'.$uid.'_showlinesdescription">'.
form::checkbox(
array(
'fac_formats['.$uid.'][showlinesdescription]',
'fac_formats_'.$uid.'_showlinesdescription'
),
1,
0
).
__('Show description of entries').'</label></p>
<p><label for="fac_formats_'.$uid.'_linesdescriptionnohtml">'.
form::checkbox(
array(
'fac_formats['.$uid.'][linesdescriptionnohtml]',
'fac_formats_'.$uid.'_linesdescriptionnohtml'
),
1,
1
).
__('Remove html of description').'</label></p>
<p><label for="fac_formats_'.$uid.'_linesdescriptionlength">'.
__('Maximum length of description:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linesdescriptionlength]',
'fac_formats_'.$uid.'_linesdescriptionlength'
),
5,
4,
350,
'maximal'
).'</p>
<p class="form-note">'.
__('Leave lengh empty for no limit.').
'</p>
</div><div class="two-boxes"><h5>'.__('Content').'</h5>
<p><label for="fac_formats_'.$uid.'_showlinescontent">'.
form::checkbox(
array(
'fac_formats['.$uid.'][showlinescontent]',
'fac_formats_'.$uid.'_showlinescontent'
),
1,
0
).
__('Show content of entries').'</label></p>
<p><label for="fac_formats_'.$uid.'_linescontentnohtml">'.
form::checkbox(
array(
'fac_formats['.$uid.'][linescontentnohtml]',
'fac_formats_'.$uid.'_linescontentnohtml'
),
1,
1
).
__('Remove html of content').'</label></p>
<p><label for="fac_formats_'.$uid.'_linescontentlength">'.
__('Maximum length of content:').'</label>'.
form::field(
array(
'fac_formats['.$uid.'][linescontentlength]',
'fac_formats_'.$uid.'_linescontentlength'
),
5,
4,
350,
'maximal'
).'</p>
<p class="form-note">'.
__('Leave lengh empty for no limit.').
'</p>
</div>
</div>
<div class="fieldset">
<h4>'.__('Informations').'</h4>
<div class="two-boxes">
<h5>'.__('Theme').'</h5>
<p>'.
__('Theme must have behavoir publicEntryAfterContent.').' '.
__('To add feed to an entry edit this entry and put in sidebar the url of the feed and select a format.').
'</p>
</div><div class="two-boxes">
<h5>'.__('Structure').'</h5>
<pre>'.html::escapeHTML('
<div class="post-fac">
<h3>'.__('Title of feed').'</h3>
<p>'.__('Description of feed').'</p>
<dl>
<dt>'.__('Title of entry').'</dt>
<dd>'.__('Description of entry').'</dd>
</dl>
</div>
').'</pre>
</div>
</div>';

37
_define.php 100644
View File

@ -0,0 +1,37 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of fac, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
# contact@jcdenis.fr http://jcd.lv
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) {
return null;
}
$this->registerModule(
/* Name */
"fac",
/* Description*/
"Add RSS/Atom feeds after entries content",
/* Author */
"Jean-Christian Denis",
/* Version */
'0.7',
/* Properies */
array(
'permissions' => 'usage,contentadmin',
'type' => 'plugin',
'dc_min' => '2.6',
'support' => 'http://jcd.lv/q=fac',
'details' => 'http://plugins.dotaddict.org/dc2/details/fac'
)
);

128
_install.php 100644
View File

@ -0,0 +1,128 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of fac, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
# contact@jcdenis.fr http://jcd.lv
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
return null;
}
# -- Module specs --
$dc_min = '2.6';
$mod_id = 'fac';
$mod_conf = array(
array(
'fac_active',
'Enabled fac plugin',
false,
'boolean'
),
array(
'fac_public_tpltypes',
'List of templates types which used fac',
serialize(array('post', 'tag', 'archive')),
'string'
),
array(
'fac_formats',
'Formats of feeds contents',
serialize(array(
uniqid() => array(
'name' => 'default',
'dateformat' => '',
'lineslimit' => '5',
'linestitletext' => '%T',
'linestitleover' => '%D',
'linestitlelength' => '150',
'showlinesdescription' => '0',
'linesdescriptionlength' => '350',
'linesdescriptionnohtml' => '1',
'showlinescontent' => '0',
'linescontentlength' => '350',
'linescontentnohtml' => '1'
),
uniqid() => array(
'name' => 'full',
'dateformat' => '',
'lineslimit' => '20',
'linestitletext' => '%T',
'linestitleover' => '%D - %E',
'linestitlelength' => '',
'showlinesdescription' => '1',
'linesdescriptionlength' => '',
'linesdescriptionnohtml' => '1',
'showlinescontent' => '1',
'linescontentlength' => '',
'linescontentnohtml' => '1'
)
)),
'string'
),
array(
'fac_defaultfeedtitle',
'Default title of feed',
'%T',
'string'
),
array(
'fac_showfeeddesc',
'Show description of feed',
1,
'boolean'
)
);
# -- Nothing to change below --
try {
# Check module version
if (version_compare(
$core->getVersion($mod_id),
$core->plugins->moduleInfo($mod_id, 'version'),
'>='
)) {
return null;
}
# Check Dotclear version
if (!method_exists('dcUtils', 'versionsCompare')
|| dcUtils::versionsCompare(DC_VERSION, $dc_min, '<', false)) {
throw new Exception(sprintf(
'%s requires Dotclear %s', $mod_id, $dc_min
));
}
# Set module settings
$core->blog->settings->addNamespace($mod_id);
foreach($mod_conf as $v) {
$core->blog->settings->{$mod_id}->put(
$v[0], $v[2], $v[3], $v[1], false, true
);
}
# Set module version
$core->setVersion(
$mod_id,
$core->plugins->moduleInfo($mod_id, 'version')
);
return true;
}
catch (Exception $e) {
$core->error->add($e->getMessage());
return false;
}

265
_public.php 100644
View File

@ -0,0 +1,265 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of fac, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
# contact@jcdenis.fr http://jcd.lv
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) {
return null;
}
$core->addBehavior(
'publicEntryAfterContent',
array('facPublic', 'publicEntryAfterContent')
);
/**
* @ingroup DC_PLUGIN_FAC
* @brief Linked feed to entries - public methods.
* @since 2.6
*/
class facPublic
{
/**
* Add feed after entry
*
* @param dcCore $core dcCore instance
* @param context $_ctx context instance
*/
public static function publicEntryAfterContent(dcCore $core, context $_ctx)
{
$core->blog->settings->addNamespace('fac');
# Not active or not a post
if (!$core->blog->settings->fac->fac_active
|| !$_ctx->exists('posts')
) {
return null;
}
# Not in page to show
$types = @unserialize($core->blog->settings->fac->fac_public_tpltypes);
if (!is_array($types)
|| !in_array($core->url->type,$types)
) {
return null;
}
# Get related feed
$fac_url = $core->meta->getMetadata(array(
'meta_type' => 'fac',
'post_id' => $_ctx->posts->post_id,
'limit' => 1
));
if ($fac_url->isEmpty()) {
return null;
}
# Get related format
$fac_format = $core->meta->getMetadata(array(
'meta_type' => 'facformat',
'post_id' => $_ctx->posts->post_id,
'limit' => 1
));
if ($fac_format->isEmpty()) {
return null;
}
# Get format info
$default_format = array(
'name' => 'default',
'dateformat' => '',
'lineslimit' => '5',
'linestitletext' => '%T',
'linestitleover' => '%D',
'linestitlelength' => '150',
'showlinesdescription' => '0',
'linesdescriptionlength' => '350',
'linesdescriptionnohtml' => '1',
'showlinescontent' => '0',
'linescontentlength' => '350',
'linescontentnohtml' => '1'
);
$formats = @unserialize($core->blog->settings->fac->fac_formats);
if (empty($formats)
|| !is_array($formats)
|| !isset($formats[$fac_format->meta_id])
) {
$format = $default_format;
}
else {
$format = array_merge(
$default_format,
$formats[$fac_format->meta_id]
);
}
# Read feed url
$cache = is_dir(DC_TPL_CACHE.'/fac') ? DC_TPL_CACHE.'/fac' : null;
try {
$feed = feedReader::quickParse($fac_url->meta_id,$cache);
}
catch (Exception $e) {
$feed = null;
}
# No entries
if (!$feed) {
return null;
}
# Feed title
$feedtitle = '';
if ('' != $core->blog->settings->fac->fac_defaultfeedtitle) {
$feedtitle = '<h3>'.html::escapeHTML(empty($feed->title) ?
str_replace(
'%T',
__('a related feed'),
$core->blog->settings->fac->fac_defaultfeedtitle
) :
str_replace(
'%T',
$feed->title,
$core->blog->settings->fac->fac_defaultfeedtitle
)
).'</h3>';
}
# Feed desc
$feeddesc = '';
if ($core->blog->settings->fac->fac_showfeeddesc
&& '' != $feed->description
) {
$feeddesc =
'<p>'.context::global_filter($feed->description,1,1,0,0,0).'</p>';
}
# Date format
$dateformat = '' != $format['dateformat'] ?
$format['dateformat'] :
$core->blog->settings->system->date_format.','.$core->blog->settings->system->time_format;
# Enrties limit
$entrieslimit = abs((integer) $format['lineslimit']);
$uselimit = $entrieslimit > 0 ? true : false;
echo
'<div class="post-fac">'.
$feedtitle.$feeddesc.
'<dl>';
$i = 0;
foreach ($feed->items as $item) {
# Format date
$date = dt::dt2str($dateformat, $item->pubdate);
# Entries title
$title = context::global_filter(
str_replace(
array(
'%D',
'%T',
'%A',
'%E',
'%C'
),
array(
$date,
$item->title,
$item->creator,
$item->description,
$item->content
),
$format['linestitletext']
),
0,
1,
abs((integer) $format['linestitlelength']),
0,
0
);
# Entries over title
$overtitle = context::global_filter(
str_replace(
array(
'%D',
'%T',
'%A',
'%E',
'%C'
),
array(
$date,
$item->title,
$item->creator,
$item->description,
$item->content
),
$format['linestitleover']
),
0,
1,
350,
0,
0
);
# Entries description
$description = '';
if ($format['showlinesdescription']
&& '' != $item->description
) {
$description = '<dd>'.
context::global_filter(
$item->description,
0,
(integer) $format['linesdescriptionnohtml'],
abs((integer) $format['linesdescriptionlength']),
0,0
).'</dd>';
}
# Entries content
$content = '';
if ($format['showlinescontent']
&& '' != $item->content
) {
$content = '<dd>'.
context::global_filter(
$item->content,
0,
(integer) $format['linescontentnohtml'],
abs((integer) $format['linescontentlength']),
0,
0
).'</dd>';
}
echo
'<dt><a href="'.$item->link.'" '.
'title="'.$overtitle.'">'.$title.'</a></dt>'.
$description.$content;
$i++;
if ($uselimit && $i == $entrieslimit) {
break;
}
}
echo '</dl></div>';
}
}

BIN
icon.png 100644

Binary file not shown.

After

Width:  |  Height:  |  Size: 875 B

18
js/admin.js 100644
View File

@ -0,0 +1,18 @@
/* -- BEGIN LICENSE BLOCK ----------------------------------
* This file is part of fac, a plugin for Dotclear 2.
*
* Copyright (c) 2009-2010 JC Denis and contributors
* jcdenis@gdwd.com
*
* Licensed under the GPL version 2.0 license.
* A copy of this license is available in LICENSE file or at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* -- END LICENSE BLOCK ------------------------------------*/
$(function(){
/* toogle admin form sidebar */
$('#fac h5').toggleWithLegend(
$('#fac').children().not('h5'),
{cookie:'dcx_fac_admin_form_sidebar',legend_click:true}
);
});

View File

@ -0,0 +1,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>fac</title>
</head>
<body>
<p>If you want some help or contribute to the plugin fac, follow these links.</p>
<ul>
<li><a href="http://forum.dotclear.org/viewtopic.php?id=43171">Post on Dotclear's forum</a></li>
<li><a href="http://lab.dotclear.org/wiki/plugin/fac">SVN repository</a></li>
<li><a href="https://bitbucket.org/JcDenis/fac">HG repository</a></li>
<li><a href="http://jcd.lv/q=fac">Post on author's blog</a></li>
</ul>
</body>
</html>

View File

@ -0,0 +1,18 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of fac, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
# contact@jcdenis.fr http://jcd.lv
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) { return; }
$__resources['help']['fac'] = dirname(__FILE__).'/help/help.html';
?>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>fac</title>
</head>
<body>
<h3>Support</h3>
<p>Si vous souhaitez plus d'aide ou apporter votre contribution à cette extension, voici quelques liens utiles.</p>
<ul>
<li><a href="http://forum.dotclear.org/viewtopic.php?id=43171">Sujet sur le forum Dotclear</a></li>
<li><a href="http://lab.dotclear.org/wiki/plugin/fac">Dépôt svn</a></li>
<li><a href="https://bitbucket.org/JcDenis/fac">Dépôt hg</a></li>
<li><a href="http://jcd.lv/q=fac">Billet dédié sur le blog de l'auteur</a></li>
</ul>
</body>
</html>

View File

@ -0,0 +1,181 @@
<?php
// Language: Français
// Module: fac - 0.7
// Date: 2013-11-11 09:32:36
// Translated with dcTranslater - 2013.05.11
#_admin.php:149
#_admin.php:162
#_admin.php:266
$GLOBALS['__l10n']['Linked feed'] = 'Flux lié';
#_admin.php:150
$GLOBALS['__l10n']['Add feed'] = 'Ajouter un flux';
#_admin.php:163
$GLOBALS['__l10n']['Remove feed'] = 'Retirer un flux';
#_admin.php:195
$GLOBALS['__l10n']['Linked feed deleted.'] = 'Flux lié effacé.';
#_admin.php:223
$GLOBALS['__l10n']['Linked feed added.'] = 'Flux lié ajouté.';
#_admin.php:233
$GLOBALS['__l10n']['Linked feed to this selection'] = 'Lié un flux a cette selection';
#_admin.php:277
$GLOBALS['__l10n']['Format:'] = 'Format :';
#_admin.php:284
$GLOBALS['__l10n']['view feed'] = 'Voir le flux';
#_config.php:25
$GLOBALS['__l10n']['home page'] = 'la page d\'accueil';
#_config.php:26
$GLOBALS['__l10n']['post pages'] = 'la page d\'un billet';
#_config.php:27
$GLOBALS['__l10n']['tags pages'] = 'les pages d\'un tag';
#_config.php:28
$GLOBALS['__l10n']['archives pages'] = 'les pages des archives';
#_config.php:29
$GLOBALS['__l10n']['category pages'] = 'les pages de catégorie';
#_config.php:30
$GLOBALS['__l10n']['entries feed'] = 'le flux des billets';
#_config.php:35
$GLOBALS['__l10n']['"%s" pages from extension muppet'] = 'la page de type "%s" de l\'extension muppet';
#_config.php:83
$GLOBALS['__l10n']['Configuration has been successfully updated.'] = 'La configuration a été mise à jour avec succés.';
#_config.php:103
$GLOBALS['__l10n']['Enable plugin'] = 'Activer le plugin';
#_config.php:105
$GLOBALS['__l10n']['Show feed after content on:'] = 'Afficher le flux après le contenu sur :';
#_config.php:121
$GLOBALS['__l10n']['Feed'] = 'Flux';
#_config.php:123
$GLOBALS['__l10n']['Default title'] = 'Titre par défaut';
#_config.php:125
$GLOBALS['__l10n']['Use %T to insert title of feed.'] = 'Utiliser %T pour insérer le titre du flux';
#_config.php:129
$GLOBALS['__l10n']['Show description of feed'] = 'Afficher la description';
#_config.php:142
$GLOBALS['__l10n']['Format %s'] = 'Format %s';
#_config.php:159
#_config.php:361
$GLOBALS['__l10n']['In order to remove a format, leave its name empty.'] = 'Pour retirer un format, laisser son nom vide.';
#_config.php:175
#_config.php:377
$GLOBALS['__l10n']['Use date format of Dotclear or leave empty to use default date format of blog.'] = 'Utiliser le formatage des dates de Dotclear ou laisser vide pour utiliser le format par défaut du blog.';
#_config.php:191
#_config.php:251
#_config.php:291
#_config.php:331
#_config.php:393
#_config.php:453
#_config.php:493
#_config.php:533
$GLOBALS['__l10n']['Leave lengh empty for no limit.'] = 'Laisser vide pour ne pas mettre de limite.';
#_config.php:197
#_config.php:399
$GLOBALS['__l10n']['Title format:'] = 'Format du titre :';
#_config.php:209
#_config.php:230
#_config.php:411
#_config.php:432
$GLOBALS['__l10n']['Format can be:'] = 'Le format peut-être :';
#_config.php:214
#_config.php:235
#_config.php:294
#_config.php:416
#_config.php:437
#_config.php:496
$GLOBALS['__l10n']['Content'] = 'Contenu';
#_config.php:218
#_config.php:420
$GLOBALS['__l10n']['Over title format:'] = 'Format au survole du titre :';
#_config.php:239
#_config.php:441
$GLOBALS['__l10n']['Maximum length of title:'] = 'Longueur maximum du titre :';
#_config.php:265
#_config.php:467
$GLOBALS['__l10n']['Show description of entries'] = 'Afficher la description des billets';
#_config.php:276
#_config.php:478
$GLOBALS['__l10n']['Remove html of description'] = 'Retirer le code HTML de la description';
#_config.php:279
#_config.php:481
$GLOBALS['__l10n']['Maximum length of description:'] = 'Longueur maximum de la description :';
#_config.php:305
#_config.php:507
$GLOBALS['__l10n']['Show content of entries'] = 'Afficher le contenu du flux';
#_config.php:316
#_config.php:518
$GLOBALS['__l10n']['Remove html of content'] = 'Retirer le code HTML du contenu';
#_config.php:319
#_config.php:521
$GLOBALS['__l10n']['Maximum length of content:'] = 'Longueur maximum du contenu :';
#_config.php:344
$GLOBALS['__l10n']['New format'] = 'Nouveau format';
#_config.php:541
$GLOBALS['__l10n']['Informations'] = 'Informations';
#_config.php:545
$GLOBALS['__l10n']['Theme'] = 'Thème';
#_config.php:547
$GLOBALS['__l10n']['Theme must have behavoir publicEntryAfterContent.'] = 'Le thème doit avoir le behavior pulicEnryAfterContent.';
#_config.php:548
$GLOBALS['__l10n']['To add feed to an entry edit this entry and put in sidebar the url of the feed and select a format.'] = 'Pour ajouter un flux à un billet, modifier ce billet et dans son menu latéral ajouter l\'URL du flux et le format.';
#_config.php:553
$GLOBALS['__l10n']['Structure'] = 'Structure';
#_config.php:556
$GLOBALS['__l10n']['Title of feed'] = 'Titre du flux';
#_config.php:557
$GLOBALS['__l10n']['Description of feed'] = 'Descritpion du flux';
#_config.php:559
$GLOBALS['__l10n']['Title of entry'] = 'Titre du billet';
#_config.php:560
$GLOBALS['__l10n']['Description of entry'] = 'Description du billet';
#_public.php:130
$GLOBALS['__l10n']['a related feed'] = 'un flux lié';
$GLOBALS['__l10n']['Add RSS/Atom feeds after entries content'] = 'Ajouter des flux RSS/Atom après le contenu des billets';
?>

239
locales/fr/main.po 100644
View File

@ -0,0 +1,239 @@
# Language: Français
# Module: fac - 0.7
# Date: 2013-11-11 09:32:36
# Translated with translater 2013.05.11
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: fac 0.7\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2013-11-11T09:32:36+00:00\n"
"Last-Translator: Jean-Christian Denis\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
#: _admin.php:149
#: _admin.php:162
#: _admin.php:266
msgid "Linked feed"
msgstr "Flux lié"
#: _admin.php:150
msgid "Add feed"
msgstr "Ajouter un flux"
#: _admin.php:163
msgid "Remove feed"
msgstr "Retirer un flux"
#: _admin.php:195
msgid "Linked feed deleted."
msgstr "Flux lié effacé."
#: _admin.php:223
msgid "Linked feed added."
msgstr "Flux lié ajouté."
#: _admin.php:233
msgid "Linked feed to this selection"
msgstr "Lié un flux a cette selection"
#: _admin.php:277
msgid "Format:"
msgstr "Format :"
#: _admin.php:284
msgid "view feed"
msgstr "Voir le flux"
#: _config.php:25
msgid "home page"
msgstr "la page d'accueil"
#: _config.php:26
msgid "post pages"
msgstr "la page d'un billet"
#: _config.php:27
msgid "tags pages"
msgstr "les pages d'un tag"
#: _config.php:28
msgid "archives pages"
msgstr "les pages des archives"
#: _config.php:29
msgid "category pages"
msgstr "les pages de catégorie"
#: _config.php:30
msgid "entries feed"
msgstr "le flux des billets"
#: _config.php:35
msgid "\"%s\" pages from extension muppet"
msgstr "la page de type \"%s\" de l'extension muppet"
#: _config.php:83
msgid "Configuration has been successfully updated."
msgstr "La configuration a été mise à jour avec succés."
#: _config.php:103
msgid "Enable plugin"
msgstr "Activer le plugin"
#: _config.php:105
msgid "Show feed after content on:"
msgstr "Afficher le flux après le contenu sur :"
#: _config.php:121
msgid "Feed"
msgstr "Flux"
#: _config.php:123
msgid "Default title"
msgstr "Titre par défaut"
#: _config.php:125
msgid "Use %T to insert title of feed."
msgstr "Utiliser %T pour insérer le titre du flux"
#: _config.php:129
msgid "Show description of feed"
msgstr "Afficher la description"
#: _config.php:142
msgid "Format %s"
msgstr "Format %s"
#: _config.php:159
#: _config.php:361
msgid "In order to remove a format, leave its name empty."
msgstr "Pour retirer un format, laisser son nom vide."
#: _config.php:175
#: _config.php:377
msgid "Use date format of Dotclear or leave empty to use default date format of blog."
msgstr "Utiliser le formatage des dates de Dotclear ou laisser vide pour utiliser le format par défaut du blog."
#: _config.php:191
#: _config.php:251
#: _config.php:291
#: _config.php:331
#: _config.php:393
#: _config.php:453
#: _config.php:493
#: _config.php:533
msgid "Leave lengh empty for no limit."
msgstr "Laisser vide pour ne pas mettre de limite."
#: _config.php:197
#: _config.php:399
msgid "Title format:"
msgstr "Format du titre :"
#: _config.php:209
#: _config.php:230
#: _config.php:411
#: _config.php:432
msgid "Format can be:"
msgstr "Le format peut-être :"
#: _config.php:214
#: _config.php:235
#: _config.php:294
#: _config.php:416
#: _config.php:437
#: _config.php:496
msgid "Content"
msgstr "Contenu"
#: _config.php:218
#: _config.php:420
msgid "Over title format:"
msgstr "Format au survole du titre :"
#: _config.php:239
#: _config.php:441
msgid "Maximum length of title:"
msgstr "Longueur maximum du titre :"
#: _config.php:265
#: _config.php:467
msgid "Show description of entries"
msgstr "Afficher la description des billets"
#: _config.php:276
#: _config.php:478
msgid "Remove html of description"
msgstr "Retirer le code HTML de la description"
#: _config.php:279
#: _config.php:481
msgid "Maximum length of description:"
msgstr "Longueur maximum de la description :"
#: _config.php:305
#: _config.php:507
msgid "Show content of entries"
msgstr "Afficher le contenu du flux"
#: _config.php:316
#: _config.php:518
msgid "Remove html of content"
msgstr "Retirer le code HTML du contenu"
#: _config.php:319
#: _config.php:521
msgid "Maximum length of content:"
msgstr "Longueur maximum du contenu :"
#: _config.php:344
msgid "New format"
msgstr "Nouveau format"
#: _config.php:541
msgid "Informations"
msgstr "Informations"
#: _config.php:545
msgid "Theme"
msgstr "Thème"
#: _config.php:547
msgid "Theme must have behavoir publicEntryAfterContent."
msgstr "Le thème doit avoir le behavior pulicEnryAfterContent."
#: _config.php:548
msgid "To add feed to an entry edit this entry and put in sidebar the url of the feed and select a format."
msgstr "Pour ajouter un flux à un billet, modifier ce billet et dans son menu latéral ajouter l'URL du flux et le format."
#: _config.php:553
msgid "Structure"
msgstr "Structure"
#: _config.php:556
msgid "Title of feed"
msgstr "Titre du flux"
#: _config.php:557
msgid "Description of feed"
msgstr "Descritpion du flux"
#: _config.php:559
msgid "Title of entry"
msgstr "Titre du billet"
#: _config.php:560
msgid "Description of entry"
msgstr "Description du billet"
#: _public.php:130
msgid "a related feed"
msgstr "un flux lié"
msgid "Add RSS/Atom feeds after entries content"
msgstr "Ajouter des flux RSS/Atom après le contenu des billets"

View File

@ -0,0 +1,18 @@
<?php
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of fac, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2013 Jean-Christian Denis and contributors
# contact@jcdenis.fr http://jcd.lv
#
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_RC_PATH')) { return; }
$__resources['help']['fac'] = dirname(__FILE__).'/help/help.html';
?>