Dotclear

Changeset 2171


Ignore:
Timestamp:
04/10/10 12:15:54 (13 years ago)
Author:
JcDenis
Message:

fac 0.3:

  • Added options to format feed
  • Added DC 2.2 compatibility
  • Removed class and used metadata
  • Changed admin page design
Location:
plugins/fac
Files:
9 added
9 edited

Legend:

Unmodified
Added
Removed
  • plugins/fac/_admin.php

    r2087 r2171  
    2323 
    2424# Admin behaviors 
    25 if ($core->blog->settings->fac_active) 
     25$s = facSettings($core); 
     26if ($s->fac_active) 
    2627{ 
    2728     $core->addBehavior('adminPostFormSidebar',array('facAdmin','facField')); 
     
    3940     public static function facField($post) 
    4041     { 
     42          $fac_url = ''; 
    4143          if ($post) { 
    42                $f = new fac($GLOBALS['core']); 
    43                $rs = $f->getFac($post->post_id,null,1); 
     44               $meta = new dcMeta($GLOBALS['core']); 
     45               $rs = $meta->getMeta('fac',1,null,$post->post_id); 
    4446               $fac_url = $rs->isEmpty() ? '' : $rs->meta_id; 
    45           } else { 
    46                $fac_url = ''; 
    4747          } 
    4848 
     
    6666 
    6767          $post_id = (integer) $post_id; 
    68           $f = new fac($GLOBALS['core']); 
    69           $f->delFac($post_id); 
     68          $meta = new dcMeta($GLOBALS['core']); 
     69          $meta->delPostMeta($post_id,'fac'); 
    7070 
    7171          if (!empty($_POST['fac_url'])) { 
    72                $f->setFac($post_id,$_POST['fac_url']); 
     72               $meta->setPostMeta($post_id,'fac',$_POST['fac_url']); 
    7373          } 
    7474     } 
     
    7777     { 
    7878          $post_id = (integer) $post_id; 
    79           $f = new fac($GLOBALS['core']); 
    80           $f->delFac($post_id); 
    81      } 
    82       
     79          $meta = new dcMeta($GLOBALS['core']); 
     80          $meta->delPostMeta($post_id,'fac'); 
     81     } 
     82 
    8383     public static function adminPostsActionsCombo(&$args) 
    8484     { 
    85           $args[0][__('add fac')] = 'fac_add'; 
    86            
     85          if ($GLOBALS['core']->auth->check('usage,contentadmin',$GLOBALS['core']->blog->id)) { 
     86               $args[0][__('fac')][__('add fac')] = 'fac_add'; 
     87          } 
    8788          if ($GLOBALS['core']->auth->check('delete,contentadmin',$GLOBALS['core']->blog->id)) { 
    88                $args[0][__('remove fac')] = 'fac_remove'; 
    89           } 
    90      } 
    91       
     89               $args[0][__('fac')][__('remove fac')] = 'fac_remove'; 
     90          } 
     91     } 
     92 
    9293     public static function adminPostsActions(&$core,$posts,$action,$redir) 
    9394     { 
    94           if ($action == 'fac_add' && !empty($_POST['new_fac_url'])) 
     95          if ($action == 'fac_add' && !empty($_POST['new_fac_url'])  
     96           && $core->auth->check('usage,contentadmin',$core->blog->id)) 
    9597          { 
    9698               try { 
    97                     $f = new fac($core); 
     99                    $meta = new dcMeta($core); 
    98100                    $new_fac_url = $_POST['new_fac_url']; 
    99101                     
    100102                    while ($posts->fetch()) 
    101103                    { 
    102                          $rs = $f->getFac($posts->post_id,null,1); 
    103                          if (!$rs->isEmpty()) { 
    104                               if ($new_fac_url != $rs->meta_id) { 
    105                                    $f->setFac($posts->post_id,$new_fac_url); 
    106                               } 
     104                         $rs = $meta->getMeta('fac',1,null,$posts->post_id); 
     105                         if ($rs->isEmpty()) { 
     106                              $meta->setPostMeta($posts->post_id,'fac',$new_fac_url); 
    107107                         } 
    108108                    } 
     
    113113               } 
    114114          } 
    115           elseif ($action == 'fac_remove' && !empty($_POST['meta_id']) && $core->auth->check('delete,contentadmin',$core->blog->id)) 
     115          elseif ($action == 'fac_remove' && !empty($_POST['meta_id'])  
     116           && $core->auth->check('delete,contentadmin',$core->blog->id)) 
    116117          { 
    117118               try { 
    118                     $f = new fac($core); 
     119                    $meta = new dcMeta($core); 
    119120                    while ($posts->fetch()) 
    120121                    { 
    121122                         foreach ($_POST['meta_id'] as $v) 
    122123                         { 
    123                               $f->delFac($posts->post_id,$v); 
     124                              $meta->delPostMeta($posts->post_id,'fac',$v); 
    124125                         } 
    125126                    } 
     
    142143               '<label for="new_fac_url">'.__('fac to add:').'<br />'. 
    143144               form::field('new_fac_url',32,255,'').'</label>'. 
    144                '</p><p>'. 
     145               '</p>'. 
     146               '<p class="form-note">'.__('It will be added only if there is no feed on entry.').'<p>'. 
    145147               $hidden_fields. 
    146148               $core->formNonce(). 
     
    151153          elseif ($action == 'fac_remove') 
    152154          { 
    153                $f = new fac($core); 
     155               $meta = new dcMeta($core); 
    154156               $facs = array(); 
    155157                
    156158               foreach ($_POST['entries'] as $id) { 
    157                     $rs = $f->getFac($id); 
     159                    $rs = $meta->getMeta('fac',1,null,$id); 
    158160                    if ($rs->isEmpty()) continue; 
    159161                     
  • plugins/fac/_define.php

    r2087 r2171  
    1717     /* Description*/         "Add RSS/Atom feeds after entries content", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.2', 
    20      /* Permissions */        'admin' 
     19     /* Version */            '0.3', 
     20     /* Permissions */        'usage,contentadmin' 
    2121); 
    22      /* date */          #20100217 
     22     /* date */          #20100410 
    2323?> 
  • plugins/fac/_install.php

    r2084 r2171  
    2727          throw new Exception('Plugin called "fac" requires Dotclear 2.1.6 or higher.'); 
    2828     } 
    29      # Check DC version (new settings) 
    30      if (version_compare(DC_VERSION,'2.2','>=')) 
    31      { 
    32           throw new Exception('Plugin called "fac" requires Dotclear up to 2.2.'); 
    33      } 
    3429     # Need metadata 
    3530     if (!$core->plugins->moduleExists('metadata')) 
     
    3833     } 
    3934     # Settings 
    40      $s =& $core->blog->settings; 
    41      $s->setNameSpace('fac'); 
     35     if (!version_compare(DC_VERSION,'2.1.6','<=')) {  
     36          $core->blog->settings->addNamespace('fac');  
     37          $s =& $core->blog->settings->fac;  
     38     } else {  
     39          $core->blog->settings->setNamespace('fac');  
     40          $s =& $core->blog->settings;  
     41     } 
    4242     $s->put('fac_active',false,'boolean','Enabled fac plugin',false,true); 
    4343     $s->put('fac_public_tpltypes',serialize(array('post','tag','archive')),'string','List of templates types which used fac',false,true); 
    44      $s->put('fac_public_limit',5,'integer','Number of feeds to show',false,true); 
    45      $s->put('fac_public_title','','string','Title of feed',false,true); 
    46      $s->setNameSpace('system'); 
     44     $s->put('fac_defaultfeedtitle','%T','string','Default title of feed',false,true); 
     45     $s->put('fac_showfeeddesc',1,'boolean','Show description of feed',false,true); 
     46     $s->put('fac_dateformat','','string','Date format',false,true); 
     47     $s->put('fac_lineslimit',5,'integer','Number of entries to show',false,true); 
     48     $s->put('fac_linestitletext','%T','string','Title of entries',false,true); 
     49     $s->put('fac_linestitleover','%D - %E','string','Over title of entries',false,true); 
     50     $s->put('fac_linestitlelength',150,'integer','Maximum length of title of entries',false,true); 
     51     $s->put('fac_showlinesdescription',0,'boolean','Show description of entries',false,true); 
     52     $s->put('fac_linesdescriptionlength',350,'integer','Maximum length of description of entries',false,true); 
     53     $s->put('fac_linesdescriptionnohtml',1,'boolean','Remove html of description of entries',false,true); 
     54     $s->put('fac_showlinescontent',0,'boolean','Show content of entries',false,true); 
     55     $s->put('fac_linescontentlength',350,'integer','Maximum length of content of entries',false,true); 
     56     $s->put('fac_linescontentnohtml',1,'boolean','Remove html of content of entries',false,true); 
     57     if (version_compare(DC_VERSION,'2.1.6','<=')) {  
     58          $s->setNamespace('system');  
     59     } 
    4760     # Version 
    4861     $core->setVersion('fac',$new_version); 
  • plugins/fac/_prepend.php

    r2084 r2171  
    1313if (!defined('DC_RC_PATH')){return;} 
    1414if (!$GLOBALS['core']->plugins->moduleExists('metadata')){return;} 
    15 $GLOBALS['__autoload']['fac'] = dirname(__FILE__).'/inc/class.fac.php'; 
     15 
     16function facSettings($core) { 
     17     if (!version_compare(DC_VERSION,'2.1.6','<=')) {  
     18          $core->blog->settings->addNamespace('fac');  
     19          $s =& $core->blog->settings->fac;  
     20     } else {  
     21          $core->blog->settings->setNamespace('fac');  
     22          $s =& $core->blog->settings;  
     23     } 
     24     return $s; 
     25} 
    1626?> 
  • plugins/fac/_public.php

    r2084 r2171  
    2020     public static function publicEntryAfterContent($core,$_ctx) 
    2121     { 
    22           if (!$core->blog->settings->fac_active || !$_ctx->exists('posts') || $_ctx->posts->post_type != 'post') return; 
     22          $s = facSettings($core); 
    2323 
    24           $title = (string) $core->blog->settings->fac_public_title; 
    25           if (empty($title)) $title = __('Related feed'); 
    26           $limit = (integer) $core->blog->settings->fac_public_limit; 
    27           if ($limit < 1) $limit = 10; 
    28           $types = @unserialize($core->blog->settings->fac_public_tpltypes); 
    29           if (!is_array($types) || !in_array($core->url->type,$types)) return; 
    30  
    31           $f = new fac($core); 
    32           $url = $f->getFac($_ctx->posts->pots_id); 
    33           if ($url->isEmpty()) return; 
    34  
     24          # Not active or not a post 
     25          if (!$s->fac_active  
     26           || !$_ctx->exists('posts') || $_ctx->posts->post_type != 'post') { 
     27               return; 
     28          } 
     29          # Not in page to show 
     30          $types = @unserialize($s->fac_public_tpltypes); 
     31          if (!is_array($types) || !in_array($core->url->type,$types)) { 
     32               return; 
     33          } 
     34          # Get related feed 
     35          $meta = new dcMeta($core); 
     36          $rs = $meta->getMeta('fac',1,null,$_ctx->posts->post_id); 
     37          # No feed 
     38          if ($rs->isEmpty()) { 
     39               return; 
     40          } 
     41          # Read feed url 
    3542          $cache = is_dir(DC_TPL_CACHE.'/fac') ? DC_TPL_CACHE.'/fac' : null; 
    36  
    37           $url = $url->meta_id; 
    38           $feed = feedReader::quickParse($url,$cache); 
    39           if (!$feed) return; 
    40  
    41           $feed_title = empty($feed->title) ? __('Related feed') : $feed->title; 
    42           $title = str_replace('%s',$feed_title,$title); 
     43          $feed = feedReader::quickParse($rs->meta_id,$cache); 
     44          # No entries 
     45          if (!$feed) { 
     46               return; 
     47          } 
     48          # Feed title 
     49          $feedtitle = ''; 
     50          if ('' != $s->fac_defaultfeedtitle) { 
     51               $feedtitle = '<h3>'.html::escapeHTML( 
     52                    empty($feed->title) ?  
     53                         str_replace('%T',__('a related feed'),$s->fac_defaultfeedtitle) :  
     54                         str_replace('%T',$feed->title,$s->fac_defaultfeedtitle) 
     55               ).'</h3>'; 
     56          } 
     57          # Feed desc 
     58          $feeddesc = ''; 
     59          if ($s->fac_showfeeddesc && '' != $feed->description) { 
     60               '<p>'.context::global_filter($feed->description,1,1,0,0,0).'</p>'; 
     61          } 
     62          # Date format 
     63          $dateformat = '' != $s->fac_dateformat ?  
     64               $s->fac_dateformat : 
     65               $core->blog->settings->date_format.','.$core->blog->settings->time_format; 
     66          # Enrties limit 
     67          $entrieslimit = abs((integer) $s->fac_lineslimit); 
     68          $uselimit = $entrieslimit > 0 ? true : false; 
    4369 
    4470          echo  
    45           '<div class="post_fac">'. 
    46           '<h2>'.$title.'</h2>'. 
    47           '<ul>'; 
     71          '<div class="post-fac">'. 
     72          $feedtitle.$feeddesc. 
     73          '<dl>'; 
    4874          foreach ($feed->items as $item) 
    4975          { 
    50                echo  
    51                '<li>'. 
    52                '<a href="'.$item->link.'" title="'.dt::str($core->blog->settings->date_format.', '.$core->blog->settings->time_format,$item->TS).'">'. 
    53                ($item->title ? $item->title : text::cutString(html::clean($item->content ? $item->content : $item->description),60)).'</a></li>'; 
     76               # Format date 
     77               $date = dt::dt2str($dateformat,$item->pubdate); 
     78               # Entries title 
     79               $title = context::global_filter( 
     80                    str_replace( 
     81                         array('%D','%T','%A','%E','%C'), 
     82                         array($date,$item->title,$item->creator,$item->description,$item->content), 
     83                         $s->fac_linestitletext 
     84                    ), 
     85                    0,1,abs((integer) $s->fac_linestitlelength),0,0 
     86               ); 
     87               # Entries over title 
     88               $overtitle = context::global_filter( 
     89                    str_replace( 
     90                         array('%D','%T','%A','%E','%C'), 
     91                         array($date,$item->title,$item->creator,$item->description,$item->content), 
     92                         $s->fac_linestitleover 
     93                    ), 
     94                    0,1,350,0,0 
     95               ); 
     96               # Entries description 
     97               $description = ''; 
     98               if ($s->fac_showlinesdescription && '' != $item->description) { 
     99                    $description = '<dd>'. 
     100                    context::global_filter( 
     101                         $item->description, 
     102                         0, 
     103                         (integer) $s->fac_linesdescriptionnohtml, 
     104                         abs((integer) $s->fac_linesdescriptionlength), 
     105                         0,0 
     106                    ).'</dd>'; 
     107               } 
     108               # Entries content 
     109               $content = ''; 
     110               if ($s->fac_showlinescontent && '' != $item->content) { 
     111                    $content = '<dd>'. 
     112                    context::global_filter( 
     113                         $item->content, 
     114                         0, 
     115                         (integer) $s->fac_linescontentnohtml, 
     116                         abs((integer) $s->fac_linescontentlength), 
     117                         0,0 
     118                    ).'</dd>'; 
     119               } 
     120 
     121               echo '<dt><a href="'.$item->link.'" title="'.$overtitle.'">'.$title.'</a></dt>'.$description.$content; 
     122 
    54123               $i++; 
    55                if ($i == $limit) break; 
     124               if ($uselimit && $i == $entrieslimit) break; 
    56125          } 
    57           echo '</ul></div>'; 
     126          echo '</dl></div>'; 
    58127     } 
    59128} 
  • plugins/fac/index.php

    r2084 r2171  
    1717 
    1818# Settings 
    19 $s =& $core->blog->settings; 
    20 $_active = (boolean) $s->fac_active; 
    21 $_public_limit = (integer) $s->fac_public_limit; 
    22 $_public_title = (string) $s->fac_public_title; 
    23 $_public_tpltypes = @unserialize($s->fac_public_tpltypes); 
    24 if (!is_array($_public_tpltypes)) $_public_tpltypes = array(); 
     19$s =& facSettings($core); 
     20$s_active = (boolean) $s->fac_active; 
     21$action = isset($_POST['action']) ? $_POST['action'] : ''; 
     22$section = isset($_REQUEST['section']) ? $_REQUEST['section'] : ''; 
     23 
     24$s_defaultfeedtitle = (string) $s->fac_defaultfeedtitle; 
     25$s_showfeeddesc = (integer) $s->fac_showfeeddesc; 
     26$s_dateformat = (string) $s->fac_dateformat; 
     27$s_lineslimit = (integer) $s->fac_lineslimit; 
     28$s_linestitletext = (string) $s->fac_linestitletext; 
     29$s_linestitleover = (string) $s->fac_linestitleover; 
     30$s_linestitlelength = (integer) $s->fac_linestitlelength; 
     31$s_showlinesdescription = (integer) $s->fac_showlinesdescription; 
     32$s_linesdescriptionlength = (integer) $s->fac_linesdescriptionlength; 
     33$s_linesdescriptionnohtml = (boolean) $s->fac_linesdescriptionnohtml; 
     34$s_showlinescontent = (integer) $s->fac_showlinescontent; 
     35$s_linescontentlength = (integer) $s->fac_linescontentlength; 
     36$s_linescontentnohtml = (boolean) $s->fac_linescontentnohtml; 
     37 
     38$s_public_tpltypes = @unserialize($s->fac_public_tpltypes); 
     39if (!is_array($s_public_tpltypes)) $s_public_tpltypes = array(); 
    2540 
    2641$types = array( 
     
    3449 
    3550# Settings 
    36 if (!empty($_POST['save'])) 
     51if ($action == 'savesetting') 
    3752{ 
    38      $s->setNameSpace('fac'); 
    39      $s->put('fac_active',!empty($_POST['_active'])); 
    40      $s->put('fac_public_title',$_POST['_public_title']); 
    41      $s->put('fac_public_limit',(integer) $_POST['_public_limit']); 
    42      $s->put('fac_public_tpltypes',serialize($_POST['_public_tpltypes'])); 
    43      $s->setNameSpace('system'); 
     53     $s->put('fac_active',!empty($_POST['s_active'])); 
     54     $s->put('fac_public_tpltypes',serialize($_POST['s_public_tpltypes'])); 
     55     $s->put('fac_defaultfeedtitle',(string) $_POST['s_defaultfeedtitle']); 
     56     $s->put('fac_showfeeddesc',!empty($_POST['s_showfeeddesc'])); 
     57     $s->put('fac_dateformat',(string) $_POST['s_dateformat']); 
     58     $s->put('fac_lineslimit',(integer) $_POST['s_lineslimit']); 
     59     $s->put('fac_linestitletext',(string) $_POST['s_linestitletext']); 
     60     $s->put('fac_linestitleover',(string) $_POST['s_linestitleover']); 
     61     $s->put('fac_linestitlelength',(integer) $_POST['s_linestitlelength']); 
     62     $s->put('fac_showlinesdescription',!empty($_POST['s_showlinesdescription'])); 
     63     $s->put('fac_linesdescriptionlength',(integer) $_POST['s_linesdescriptionlength']); 
     64     $s->put('fac_linesdescriptionnohtml',!empty($_POST['s_linesdescriptionnohtml'])); 
     65     $s->put('fac_showlinescontent',!empty($_POST['s_showlinescontent'])); 
     66     $s->put('fac_linescontentlength',(integer) $_POST['s_linescontentlength']); 
     67     $s->put('fac_linescontentnohtml',!empty($_POST['s_linescontentnohtml'])); 
     68     if (version_compare(DC_VERSION,'2.1.6','<=')) {  
     69          $s->setNamespace('system');  
     70     } 
    4471     $core->blog->triggerBlog(); 
    4572 
    46      http::redirect('plugin.php?p=fac&msg=settingdone'); 
     73     http::redirect('plugin.php?p=fac&section='.$section.'&msg='.$action); 
    4774} 
    4875 
    49 # Vars 
    50 $img_green = '<img src="images/check-on.png" alt="ok" />'; 
    51 $img_red = '<img src="images/check-off.png" alt="fail" />'; 
    52 $msg = empty($_REQUEST['msg']) ? '' : $msg; 
    53  
    54 if ($msg == 'settingdone') { 
    55      $msg = __('Configuration successfully saved'); 
    56 } 
     76# Messages 
     77$msg = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : ''; 
     78$msg_list = array( 
     79     'savesetting' => __('Configuration successfully saved') 
     80); 
     81if (isset($msg_list[$msg])) { 
     82     $msg = sprintf('<p class="message">%s</p>',$msg_list[$msg]); 
     83} else { $msg = ''; } 
    5784 
    5885echo ' 
    59 <html><head><title>'.__('fac').' - '.__('Feed after content').'</title>'.dcPage::jsToolBar().'</head> 
     86<html><head><title>'.__('fac').' - '.__('Feed after content').'</title>'. 
     87dcPage::jsToolBar(). 
     88dcPage::jsLoad('index.php?pf=fac/js/fac.js'). 
     89'<script type="text/javascript">'."\n//<![CDATA[\n". 
     90dcPage::jsVar('jcToolsBox.prototype.text_wait',__('Please wait')). 
     91dcPage::jsVar('jcToolsBox.prototype.section',$section). 
     92"\n//]]>\n</script>\n". 
     93'</head> 
    6094<body> 
    6195<h2>'.__('fac').' - '.__('Feed after content').'</h2> 
    6296'.$msg.' 
    63 <form method="post" action="plugin.php"> 
    64 <div class="two-cols"> 
    65 <div class="col"> 
    66 <p><label class="classic">'.form::checkbox(array('_active'),'1',$_active).' '.__('Enable extension').'</label></p> 
    67 <p><label class="classic">'.__('Title:').'<br />'. 
    68 form::field(array('_public_title'),65,255,$_public_title).'</label></p> 
    69 <p><label class="classic">'.__('Number of feeds to show:').'<br />'. 
    70 form::field(array('_public_limit'),5,4,$_public_limit).'</label></p> 
    71 </div><div class="col">'; 
     97<form method="post" action="'.$p_url.'" id="setting-form"> 
     98 
     99 
     100<fieldset id="plugin"><legend>'. __('Plugin activation').'</legend> 
     101<p class="field"><label>'. 
     102form::checkbox(array('s_active'),'1',$s_active). 
     103__('Enable extension').'</label></p> 
     104</fieldset> 
     105 
     106<fieldset id="feed"><legend>'. __('Feed').'</legend> 
     107<div class="two-cols"><div class="col"> 
     108<p class="field"><label>'.__('Default title').' *<br />'. 
     109form::field(array('s_defaultfeedtitle'),65,255,$s_defaultfeedtitle).'</label></p> 
     110<p class="field"><label>'. 
     111form::checkbox(array('s_showfeeddesc'),'1',$s_showfeeddesc). 
     112__('Show description of feed').'</label></p> 
     113</div><div class="col"> 
     114<h3>'.__('Format').'</h3> 
     115<p>* '.__('Use %T to insert title of feed.').'</p> 
     116</div></div> 
     117</fieldset> 
     118 
     119<fieldset id="entries"><legend>'. __('Entries').'</legend> 
     120<div class="two-cols"><div class="col"> 
     121<p class="field"><label>'.__('Date format').' *<br />'. 
     122form::field(array('s_dateformat'),20,255,$s_dateformat).'</label></p> 
     123<p class="field"><label>'.__('Entries limit').'<br />'. 
     124form::field(array('s_lineslimit'),5,4,$s_lineslimit).'</label></p> 
     125<p class="field"><label>'.__('Title format').' **<br />'. 
     126form::field(array('s_linestitletext'),20,255,$s_linestitletext).'</label></p> 
     127<p class="field"><label>'.__('Over title format').' **<br />'. 
     128form::field(array('s_linestitleover'),20,255,$s_linestitleover).'</label></p> 
     129<p class="field"><label>'.__('Maximum length of title').' ***<br />'. 
     130form::field(array('s_linestitlelength'),5,4,$s_linestitlelength).'</label></p> 
     131<p class="field"><label>'. 
     132form::checkbox(array('s_showlinesdescription'),'1',$s_showlinesdescription). 
     133__('Show description of entries').'</label></p> 
     134<p class="field"><label>'.__('Maximum length of description').' ***<br />'. 
     135form::field(array('s_linesdescriptionlength'),5,4,$s_linesdescriptionlength).'</label></p> 
     136<p class="field"><label>'. 
     137form::checkbox(array('s_linesdescriptionnohtml'),'1',$s_linesdescriptionnohtml). 
     138__('Remove html of description').'</label></p> 
     139<p class="field"><label>'. 
     140form::checkbox(array('s_showlinescontent'),'1',$s_showlinescontent). 
     141__('Show content of entries').'</label></p> 
     142<p class="field"><label>'.__('Maximum length of content').' ***<br />'. 
     143form::field(array('s_linescontentlength'),5,4,$s_linescontentlength).'</label></p> 
     144<p class="field"><label>'. 
     145form::checkbox(array('s_linescontentnohtml'),'1',$s_linescontentnohtml). 
     146__('Remove html of content').'</label></p> 
     147</div><div class="col"> 
     148<h3>'.__('Format').'</h3> 
     149<p>* '.__('Use Dotclear date format or leave empty to use default date format of blog.').'</p> 
     150<p>** '.__('Format of "Title", "Over title" can be:').'</p> 
     151<ul> 
     152<li>%D : '.__('Date').'</li> 
     153<li>%T : '.__('Title').'</li> 
     154<li>%A : '.__('Author').'</li> 
     155<li>%E : '.__('Description').'</li> 
     156<li>%C : '.__('Content').'</li> 
     157</ul> 
     158<p>*** '.__('Leave empty for no limit.').'</p> 
     159</div></div> 
     160</fieldset> 
     161 
     162<fieldset id="display"><legend>'. __('Display').'</legend> 
     163<p>'.__('Show on:').'</p>'; 
    72164 
    73165foreach($types as $k => $v) 
    74166{ 
    75167     echo ' 
    76      <p><label class="classic">'. 
    77      form::checkbox(array('_public_tpltypes[]'),$v,in_array($v,$_public_tpltypes)).' '. 
    78      sprintf(__('Show feed on %s'),__($k)).'</label></p>'; 
     168     <p class="field"><label>'. 
     169     form::checkbox(array('s_public_tpltypes[]'),$v,in_array($v,$s_public_tpltypes)). 
     170     sprintf(__($k)).'</label></p>'; 
    79171} 
    80172echo ' 
    81 </div></div> 
    82 <p><input type="submit" name="save" value="'.__('save').'" />'. 
    83 $core->formNonce().form::hidden(array('p'),'fac').' 
    84 </p> 
    85 </form> 
    86 <fieldset><legend>'.__('help').'</legend> 
     173</fieldset> 
     174 
     175<fieldset id="info"><legend>'. __('Information').'</legend> 
     176<div class="two-cols"><div class="col"> 
     177<h3>'.__('Theme').'</h3> 
    87178<ul> 
    88179<li>'.__('Theme must have behavoir publicEntryAfterContent').'</li> 
    89180<li>'.__('Feeds are inserted after post content').'</li> 
    90 <li>'.__('Feeds are encapsuled in a html tag "div" of class "post-fac".').'</li> 
    91 <li>'.__('Title of the feed is in a html tag "h2" without class.').'</li> 
    92 <li>'.__('You can insert in feed title the name of the feed by using wildcard "%s".').'</li> 
    93 <li>'.__('Each line of a feed is in a html tag "li" without class.').'</li> 
    94181<li>'.__('To add feed to an entry edit this entry and put in sidebar the url of the feed.').'</li> 
    95182</lu> 
    96 </fieldset> 
    97 <hr class="clear"/> 
    98 <p class="right">fac - '.$core->plugins->moduleInfo('fac','version').'&nbsp;<img alt="fac" src="index.php?pf=fac/icon.png" /></p> 
     183</div><div class="col"> 
     184<h3>'.__('Structure').'</h3> 
     185<pre>'.html::escapeHTML(' 
     186<div class="post-fac"> 
     187<h3>'.__('Title of feed').'</h3> 
     188<p>'.__('Description of feed').'</p> 
     189<dl> 
     190<dt>'.__('Title of entry').'</dt> 
     191<dd>'.__('Description of entry').'</dd> 
     192</dl> 
     193</div> 
     194').'</pre> 
     195</div></div> 
     196</fieldset> 
     197 
     198<div class="clear"> 
     199<p><input type="submit" name="save" value="'.__('save').'" />'. 
     200$core->formNonce(). 
     201form::hidden(array('p'),'fac'). 
     202form::hidden(array('action'),'savesetting'). 
     203form::hidden(array('section'),$section).' 
     204</p></div> 
     205</form>'; 
     206dcPage::helpBlock('fac'); 
     207echo ' 
     208<hr class="clear"/><p class="right"> 
     209fac - '.$core->plugins->moduleInfo('fac','version').'&nbsp; 
     210<img alt="'.__('Feed after content').'" src="index.php?pf=fac/icon.png" /> 
     211</p> 
    99212</body> 
    100213</html>'; 
  • plugins/fac/locales/fr/main.lang.php

    r2084 r2171  
    11<?php 
    22// Language: français  
    3 // Module: fac - 0.1 
    4 // Date: 2010-02-16 11:17:20  
     3// Module: fac - 0.3 
     4// Date: 2010-04-10 10:06:37  
    55// Translated with dcTranslater - 1.3  
    66 
    7 #_admin.php:54 
     7#_admin.php:53 
    88$GLOBALS['__l10n']['change RSS/ATOM feed:'] = 'changer le flux RSS/Atom :'; 
    99 
    10 #_admin.php:54 
     10#_admin.php:53 
    1111$GLOBALS['__l10n']['Add RSS/Atom feed:'] = 'Ajouter un flux RSS/Atom :'; 
    1212 
    13 #_admin.php:61 
     13#_admin.php:59 
    1414$GLOBALS['__l10n']['view feed'] = 'Voir le flux'; 
    1515 
    16 #_admin.php:87 
     16#_admin.php:86 
    1717$GLOBALS['__l10n']['add fac'] = 'ajouter un flux'; 
    1818 
    19 #_admin.php:90 
     19#_admin.php:89 
    2020$GLOBALS['__l10n']['remove fac'] = 'effacer un flux'; 
    2121 
    22 #_admin.php:141 
     22#_admin.php:140 
    2323$GLOBALS['__l10n']['Add fac to entries'] = 'Ajouter un flux au billets :'; 
    2424 
    2525#_admin.php:143 
    2626$GLOBALS['__l10n']['fac to add:'] = 'flux à ajouter :'; 
     27 
     28#_admin.php:146 
     29$GLOBALS['__l10n']['It will be added only if there is no feed on entry.'] = 'Il sera jouter uniquement si le billet n\'a pas de flux.'; 
    2730 
    2831#_admin.php:169 
     
    3538$GLOBALS['__l10n']['Following facs have been found in selected entries:'] = 'Les flux suivant ont été trouvé pour les billets selectionnés :'; 
    3639 
    37 #_public.php:26 
    38 #_public.php:45 
    39 $GLOBALS['__l10n']['Related feed'] = 'Flux liés'; 
    40  
    41 #index.php:26 
     40#index.php:42 
    4241$GLOBALS['__l10n']['home page'] = 'la page d\'accueil'; 
    4342 
    44 #index.php:27 
     43#index.php:43 
    4544$GLOBALS['__l10n']['post pages'] = 'la page d\'un billet'; 
    4645 
    47 #index.php:28 
     46#index.php:44 
    4847$GLOBALS['__l10n']['tags pages'] = 'les pages d\'un tag'; 
    4948 
    50 #index.php:29 
     49#index.php:45 
    5150$GLOBALS['__l10n']['archives pages'] = 'les pages des archives'; 
    5251 
    53 #index.php:30 
     52#index.php:46 
    5453$GLOBALS['__l10n']['category pages'] = 'les pages de catégorie'; 
    5554 
    56 #index.php:31 
     55#index.php:47 
    5756$GLOBALS['__l10n']['entries feed'] = 'le flux des billets'; 
    5857 
    59 #index.php:54 
     58#index.php:79 
    6059$GLOBALS['__l10n']['Configuration successfully saved'] = 'Configuration sauvegardée avec succès'; 
    6160 
    62 #index.php:65 
     61#index.php:90 
     62$GLOBALS['__l10n']['Please wait'] = 'Veuillez patienter'; 
     63 
     64#index.php:100 
     65$GLOBALS['__l10n']['Plugin activation'] = 'Activation de l\'extension'; 
     66 
     67#index.php:103 
    6368$GLOBALS['__l10n']['Enable extension'] = 'Activer l\'extension'; 
    6469 
    65 #index.php:68 
    66 $GLOBALS['__l10n']['Number of feeds to show:'] = 'Nombre de flux à afficher :'; 
     70#index.php:106 
     71$GLOBALS['__l10n']['Feed'] = 'Flux'; 
    6772 
    68 #index.php:77 
    69 $GLOBALS['__l10n']['Show feed on %s'] = 'Afficher les flux sur %s'; 
     73#index.php:108 
     74$GLOBALS['__l10n']['Default title'] = 'Titre par défaut'; 
    7075 
    71 #index.php:87 
     76#index.php:112 
     77$GLOBALS['__l10n']['Show description of feed'] = 'Afficher la description'; 
     78 
     79#index.php:114 
     80#index.php:148 
     81$GLOBALS['__l10n']['Format'] = 'Format'; 
     82 
     83#index.php:115 
     84$GLOBALS['__l10n']['Use %T to insert title of feed.'] = 'Utiliser %T pour insèrer le tirte du flux'; 
     85 
     86#index.php:121 
     87$GLOBALS['__l10n']['Date format'] = 'Format de date'; 
     88 
     89#index.php:123 
     90$GLOBALS['__l10n']['Entries limit'] = 'Nombre de billets maximum'; 
     91 
     92#index.php:125 
     93$GLOBALS['__l10n']['Title format'] = 'Format du titre'; 
     94 
     95#index.php:127 
     96$GLOBALS['__l10n']['Over title format'] = 'Format du survole du titre'; 
     97 
     98#index.php:129 
     99$GLOBALS['__l10n']['Maximum length of title'] = 'Longueur maximum du titre'; 
     100 
     101#index.php:133 
     102$GLOBALS['__l10n']['Show description of entries'] = 'Afficher la description des billets'; 
     103 
     104#index.php:134 
     105$GLOBALS['__l10n']['Maximum length of description'] = 'Longueur maximum de la description'; 
     106 
     107#index.php:138 
     108$GLOBALS['__l10n']['Remove html of description'] = 'Retirer le code HTML de la description'; 
     109 
     110#index.php:141 
     111$GLOBALS['__l10n']['Show content of entries'] = 'Afficher le contenu du flux'; 
     112 
     113#index.php:142 
     114$GLOBALS['__l10n']['Maximum length of content'] = 'Longueur maximum du contenu'; 
     115 
     116#index.php:146 
     117$GLOBALS['__l10n']['Remove html of content'] = 'Retirer le code HTML du contenu'; 
     118 
     119#index.php:149 
     120$GLOBALS['__l10n']['Use Dotclear date format 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.'; 
     121 
     122#index.php:150 
     123$GLOBALS['__l10n']['Format of "Title", "Over title" can be:'] = 'Format de "Titre" et de "Survole du titre" :'; 
     124 
     125#index.php:156 
     126$GLOBALS['__l10n']['Content'] = 'Contenu'; 
     127 
     128#index.php:158 
     129$GLOBALS['__l10n']['Leave empty for no limit.'] = 'Laiser vide pour pas de limite'; 
     130 
     131#index.php:162 
     132$GLOBALS['__l10n']['Display'] = 'Affichage'; 
     133 
     134#index.php:163 
     135$GLOBALS['__l10n']['Show on:'] = 'Afficher sur :'; 
     136 
     137#index.php:177 
     138$GLOBALS['__l10n']['Theme'] = 'Thème'; 
     139 
     140#index.php:179 
    72141$GLOBALS['__l10n']['Theme must have behavoir publicEntryAfterContent'] = 'Le thème doit avoir le behavoir publicEntryAfterContent'; 
    73142 
    74 #index.php:88 
     143#index.php:180 
    75144$GLOBALS['__l10n']['Feeds are inserted after post content'] = 'Les flux sont inserrés après le contenu d\'un billets'; 
    76145 
    77 #index.php:89 
    78 $GLOBALS['__l10n']['Feeds are encapsuled in a html tag "div" of class "post-fac".'] = 'Les flux sont inserrés dans une balise html "div" de classe "post-fac".'; 
    79  
    80 #index.php:90 
    81 $GLOBALS['__l10n']['Title of the feed is in a html tag "h2" without class.'] = 'Le titre des flux est inserré dans une balise html "h2" sans classe.'; 
    82  
    83 #index.php:91 
    84 $GLOBALS['__l10n']['You can insert in feed title the name of the feed by using wildcard "%s".'] = 'Vous pouvez inserrer dans le titre d\'un flux le nom du flux en utilisant "%s".'; 
    85  
    86 #index.php:92 
    87 $GLOBALS['__l10n']['Each line of a feed is in a html tag "li" without class.'] = 'Chaque ligne d\'un flux est dans une balise html "li" sans classe.'; 
    88  
    89 #index.php:93 
     146#index.php:181 
    90147$GLOBALS['__l10n']['To add feed to an entry edit this entry and put in sidebar the url of the feed.'] = 'Pour ajouter un flux à un billet, éditer le billet et ajouter dans la barre latérale l\'URL du flux.'; 
    91148 
     149#index.php:184 
     150$GLOBALS['__l10n']['Structure'] = 'Structure'; 
     151 
     152#index.php:187 
     153$GLOBALS['__l10n']['Title of feed'] = 'Titre du flux'; 
     154 
     155#index.php:188 
     156$GLOBALS['__l10n']['Description of feed'] = 'Descritpion du flux'; 
     157 
     158#index.php:190 
     159$GLOBALS['__l10n']['Title of entry'] = 'Titre du billet'; 
     160 
     161#index.php:191 
     162$GLOBALS['__l10n']['Description of entry'] = 'Description du billet'; 
     163 
    92164?> 
  • plugins/fac/locales/fr/main.po

    r2084 r2171  
    11# Language: français 
    2 # Module: fac - 0.1 
    3 # Date: 2010-02-16 11:17:20 
     2# Module: fac - 0.3 
     3# Date: 2010-04-10 10:06:38 
    44# Translated with translater 1.3 
    55 
     
    77msgstr "" 
    88"Content-Type: text/plain; charset=UTF-8\n" 
    9 "Project-Id-Version: fac 0.1\n" 
     9"Project-Id-Version: fac 0.3\n" 
    1010"POT-Creation-Date: \n" 
    11 "PO-Revision-Date: 2010-02-16T11:17:20+00:00\n" 
     11"PO-Revision-Date: 2010-04-10T10:06:38+00:00\n" 
    1212"Last-Translator: JC Denis\n" 
    1313"Language-Team: \n" 
     
    1515"Content-Transfer-Encoding: 8bit\n" 
    1616 
    17 #: _admin.php:54 
     17#: _admin.php:53 
    1818msgid "change RSS/ATOM feed:" 
    1919msgstr "changer le flux RSS/Atom :" 
    2020 
    21 #: _admin.php:54 
     21#: _admin.php:53 
    2222msgid "Add RSS/Atom feed:" 
    2323msgstr "Ajouter un flux RSS/Atom :" 
    2424 
    25 #: _admin.php:61 
     25#: _admin.php:59 
    2626msgid "view feed" 
    2727msgstr "Voir le flux" 
    2828 
    29 #: _admin.php:87 
     29#: _admin.php:86 
    3030msgid "add fac" 
    3131msgstr "ajouter un flux" 
    3232 
    33 #: _admin.php:90 
     33#: _admin.php:89 
    3434msgid "remove fac" 
    3535msgstr "effacer un flux" 
    3636 
    37 #: _admin.php:141 
     37#: _admin.php:140 
    3838msgid "Add fac to entries" 
    3939msgstr "Ajouter un flux au billets :" 
     
    4343msgstr "flux à ajouter :" 
    4444 
     45#: _admin.php:146 
     46msgid "It will be added only if there is no feed on entry." 
     47msgstr "Il sera jouter uniquement si le billet n'a pas de flux." 
     48 
    4549#: _admin.php:169 
    4650msgid "Remove selected facs from entries" 
     
    5559msgstr "Les flux suivant ont été trouvé pour les billets selectionnés :" 
    5660 
    57 #: _public.php:26 
    58 #: _public.php:45 
    59 msgid "Related feed" 
    60 msgstr "Flux liés" 
    61  
    62 #: index.php:26 
     61#: index.php:42 
    6362msgid "home page" 
    6463msgstr "la page d'accueil" 
    6564 
    66 #: index.php:27 
     65#: index.php:43 
    6766msgid "post pages" 
    6867msgstr "la page d'un billet" 
    6968 
    70 #: index.php:28 
     69#: index.php:44 
    7170msgid "tags pages" 
    7271msgstr "les pages d'un tag" 
    7372 
    74 #: index.php:29 
     73#: index.php:45 
    7574msgid "archives pages" 
    7675msgstr "les pages des archives" 
    7776 
    78 #: index.php:30 
     77#: index.php:46 
    7978msgid "category pages" 
    8079msgstr "les pages de catégorie" 
    8180 
    82 #: index.php:31 
     81#: index.php:47 
    8382msgid "entries feed" 
    8483msgstr "le flux des billets" 
    8584 
    86 #: index.php:54 
     85#: index.php:79 
    8786msgid "Configuration successfully saved" 
    8887msgstr "Configuration sauvegardée avec succès" 
    8988 
    90 #: index.php:65 
     89#: index.php:90 
     90msgid "Please wait" 
     91msgstr "Veuillez patienter" 
     92 
     93#: index.php:100 
     94msgid "Plugin activation" 
     95msgstr "Activation de l'extension" 
     96 
     97#: index.php:103 
    9198msgid "Enable extension" 
    9299msgstr "Activer l'extension" 
    93100 
    94 #: index.php:68 
    95 msgid "Number of feeds to show:" 
    96 msgstr "Nombre de flux à afficher :" 
    97  
    98 #: index.php:77 
    99 msgid "Show feed on %s" 
    100 msgstr "Afficher les flux sur %s" 
    101  
    102 #: index.php:87 
     101#: index.php:106 
     102msgid "Feed" 
     103msgstr "Flux" 
     104 
     105#: index.php:108 
     106msgid "Default title" 
     107msgstr "Titre par défaut" 
     108 
     109#: index.php:112 
     110msgid "Show description of feed" 
     111msgstr "Afficher la description" 
     112 
     113#: index.php:114 
     114#: index.php:148 
     115msgid "Format" 
     116msgstr "Format" 
     117 
     118#: index.php:115 
     119msgid "Use %T to insert title of feed." 
     120msgstr "Utiliser %T pour insèrer le tirte du flux" 
     121 
     122#: index.php:121 
     123msgid "Date format" 
     124msgstr "Format de date" 
     125 
     126#: index.php:123 
     127msgid "Entries limit" 
     128msgstr "Nombre de billets maximum" 
     129 
     130#: index.php:125 
     131msgid "Title format" 
     132msgstr "Format du titre" 
     133 
     134#: index.php:127 
     135msgid "Over title format" 
     136msgstr "Format du survole du titre" 
     137 
     138#: index.php:129 
     139msgid "Maximum length of title" 
     140msgstr "Longueur maximum du titre" 
     141 
     142#: index.php:133 
     143msgid "Show description of entries" 
     144msgstr "Afficher la description des billets" 
     145 
     146#: index.php:134 
     147msgid "Maximum length of description" 
     148msgstr "Longueur maximum de la description" 
     149 
     150#: index.php:138 
     151msgid "Remove html of description" 
     152msgstr "Retirer le code HTML de la description" 
     153 
     154#: index.php:141 
     155msgid "Show content of entries" 
     156msgstr "Afficher le contenu du flux" 
     157 
     158#: index.php:142 
     159msgid "Maximum length of content" 
     160msgstr "Longueur maximum du contenu" 
     161 
     162#: index.php:146 
     163msgid "Remove html of content" 
     164msgstr "Retirer le code HTML du contenu" 
     165 
     166#: index.php:149 
     167msgid "Use Dotclear date format or leave empty to use default date format of blog." 
     168msgstr "Utiliser le formatage des dates de Dotclear ou laisser vide pour utiliser le format par défaut du blog." 
     169 
     170#: index.php:150 
     171msgid "Format of \"Title\", \"Over title\" can be:" 
     172msgstr "Format de \"Titre\" et de \"Survole du titre\" :" 
     173 
     174#: index.php:156 
     175msgid "Content" 
     176msgstr "Contenu" 
     177 
     178#: index.php:158 
     179msgid "Leave empty for no limit." 
     180msgstr "Laiser vide pour pas de limite" 
     181 
     182#: index.php:162 
     183msgid "Display" 
     184msgstr "Affichage" 
     185 
     186#: index.php:163 
     187msgid "Show on:" 
     188msgstr "Afficher sur :" 
     189 
     190#: index.php:177 
     191msgid "Theme" 
     192msgstr "Thème" 
     193 
     194#: index.php:179 
    103195msgid "Theme must have behavoir publicEntryAfterContent" 
    104196msgstr "Le thème doit avoir le behavoir publicEntryAfterContent" 
    105197 
    106 #: index.php:88 
     198#: index.php:180 
    107199msgid "Feeds are inserted after post content" 
    108200msgstr "Les flux sont inserrés après le contenu d'un billets" 
    109201 
    110 #: index.php:89 
    111 msgid "Feeds are encapsuled in a html tag \"div\" of class \"post-fac\"." 
    112 msgstr "Les flux sont inserrés dans une balise html \"div\" de classe \"post-fac\"." 
    113  
    114 #: index.php:90 
    115 msgid "Title of the feed is in a html tag \"h2\" without class." 
    116 msgstr "Le titre des flux est inserré dans une balise html \"h2\" sans classe." 
    117  
    118 #: index.php:91 
    119 msgid "You can insert in feed title the name of the feed by using wildcard \"%s\"." 
    120 msgstr "Vous pouvez inserrer dans le titre d'un flux le nom du flux en utilisant \"%s\"." 
    121  
    122 #: index.php:92 
    123 msgid "Each line of a feed is in a html tag \"li\" without class." 
    124 msgstr "Chaque ligne d'un flux est dans une balise html \"li\" sans classe." 
    125  
    126 #: index.php:93 
     202#: index.php:181 
    127203msgid "To add feed to an entry edit this entry and put in sidebar the url of the feed." 
    128204msgstr "Pour ajouter un flux à un billet, éditer le billet et ajouter dans la barre latérale l'URL du flux." 
    129205 
     206#: index.php:184 
     207msgid "Structure" 
     208msgstr "Structure" 
     209 
     210#: index.php:187 
     211msgid "Title of feed" 
     212msgstr "Titre du flux" 
     213 
     214#: index.php:188 
     215msgid "Description of feed" 
     216msgstr "Descritpion du flux" 
     217 
     218#: index.php:190 
     219msgid "Title of entry" 
     220msgstr "Titre du billet" 
     221 
     222#: index.php:191 
     223msgid "Description of entry" 
     224msgstr "Description du billet" 
     225 
  • plugins/fac/release.txt

    r2087 r2171  
     10.3 20100410 
     2 * Added options to format feed 
     3 * Added DC 2.2 compatibility 
     4 * Removed class and used metadata 
     5 * Changed admin page design 
     6 
    170.2 20100217: 
    28 * Fixed some fields in admin 
Note: See TracChangeset for help on using the changeset viewer.

Sites map