Dotclear

Changeset 1519


Ignore:
Timestamp:
09/27/09 22:13:53 (14 years ago)
Author:
JcDenis
Message:

activityReport 0.3:

  • Added atom/rss2 feeds
  • Moved some class
Location:
plugins/activityReport
Files:
7 added
9 edited

Legend:

Unmodified
Added
Removed
  • plugins/activityReport/_admin.php

    r1457 r1519  
    2121     $core->auth->check('admin',$core->blog->id) 
    2222); 
     23 
     24# Dashboarditems 
     25if ($core->activityReport->getSetting('dashboardItem')) 
     26{ 
     27     $core->addBehavior( 
     28          'adminDashboardHeaders', 
     29          array('activityReportBehaviors','dashboardHeaders') 
     30     ); 
     31     $core->addBehavior( 
     32          'adminDashboardItems', 
     33          array('activityReportBehaviors','dashboardItems') 
     34     ); 
     35} 
     36 
     37class activityReportAdmin 
     38{ 
     39     # Add CSS to dashboardHeaders for items 
     40     public static function dashboardHeaders() 
     41     { 
     42          return 
     43          "\n<!-- CSS for activityReport --> \n". 
     44          "<style type=\"text/css\"> \n". 
     45          "#dashboard-items #report dt { font-weight: bold; margin: 0 0 0.4em 0; } \n". 
     46          "#dashboard-items #report dd { font-size: 0.9em; margin: 0 0 1em 0; } \n". 
     47          "#dashboard-items #report dd p { margin: 0.2em 0 0 0; } \n". 
     48          "</style> \n"; 
     49     } 
     50 
     51     # Add report to dashboardItems 
     52     public static function dashboardItems($core, $__dashboard_items) 
     53     { 
     54          $r = $core->activityReport->getSetting('requests'); 
     55          $g = $core->activityReport->getGroups(); 
     56 
     57          $p = array(); 
     58          $p['limit'] = 20; 
     59          $p['order'] = 'activity_dt DESC'; 
     60          $p['sql'] = $core->activityReport->requests2params($r); 
     61 
     62          $rs = $core->activityReport->getLogs($p); 
     63          if (!$rs->isEmpty()) 
     64          { 
     65               $res = ''; 
     66               while($rs->fetch()) 
     67               { 
     68                    $group = $rs->activity_group; 
     69 
     70                    $res .=  
     71                    '<dd><p title="'.__($g[$group]['title']).'"><strong>'. 
     72                    __($g[$group]['actions'][$rs->activity_action]['title']). 
     73                    '</p></strong><em>'. 
     74                    vsprintf( 
     75                         __($g[$group]['actions'][$rs->activity_action]['msg']), 
     76                         $core->activityReport->decode($rs->activity_logs) 
     77                    ).              
     78                    '</em></dd>'; 
     79               } 
     80 
     81               if (!empty($res)) 
     82               { 
     83                    $__dashboard_items[1][] =  
     84                         '<h3>'.__('Activity report').'</h3>'. 
     85                         '<dl id="report">'.$res.'</dl>'; 
     86               } 
     87          } 
     88     } 
     89} 
    2390?> 
  • plugins/activityReport/_define.php

    r1457 r1519  
    1717     /* Description*/         "Recieve your blog activity by email", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.2', 
    20      /* Permissions */        'admin' 
     19     /* Version */            '0.3', 
     20     /* Permissions */        'admin', 
     21     /* Priority */           100000 
    2122); 
    22      /* date */          #20090915 
     23     /* date */          #20090927 
    2324?> 
  • plugins/activityReport/_prepend.php

    r1457 r1519  
    1818     dirname(__FILE__).'/inc/class.activity.report.php'; 
    1919 
    20 $__autoload['activityReportAdmin'] =  
    21      dirname(__FILE__).'/inc/class.activity.report.php'; 
    22  
    2320try 
    2421{ 
    2522     $core->activityReport = new activityReport($core); 
     23 
     24     $core->url->register( 
     25          'activityReport', 
     26          'reports', 
     27          '^reports/(atom|rss2)$', 
     28          array('activityReportPublicUrl','feed') 
     29     ); 
     30 
     31     require_once dirname(__FILE__).'/inc/class.activity.report.behaviors.php'; 
    2632} 
    27 catch (Exception $e) 
    28 { 
    29      // 
    30 } 
    31  
    32 require_once dirname(__FILE__).'/inc/class.activity.report.behaviors.php'; 
     33catch (Exception $e) {} 
    3334?> 
  • plugins/activityReport/inc/class.activity.report.behaviors.php

    r1459 r1519  
    201201class activityReportBehaviors 
    202202{ 
    203      # Add CSS to dashboardHeaders for items 
    204      public static function dashboardHeaders() 
    205      { 
    206           return 
    207           "\n<!-- CSS for activityReport --> \n". 
    208           "<style type=\"text/css\"> \n". 
    209           "#dashboard-items #report dt { font-weight: bold; margin: 0 0 0.4em 0; } \n". 
    210           "#dashboard-items #report dd { font-size: 0.9em; margin: 0 0 1em 0; } \n". 
    211           "#dashboard-items #report dd p { margin: 0.2em 0 0 0; } \n". 
    212           "</style> \n"; 
    213      } 
    214  
    215      # Add report to dashboardItems 
    216      public static function dashboardItems($core, $__dashboard_items) 
    217      { 
    218           $r = $core->activityReport->getSetting('requests'); 
    219           $g = $core->activityReport->getGroups(); 
    220  
    221           $p = array(); 
    222           $p['limit'] = 20; 
    223           $p['order'] = 'activity_dt DESC'; 
    224           $p['sql'] = $core->activityReport->requests2params($r); 
    225  
    226           $rs = $core->activityReport->getLogs($p); 
    227           if (!$rs->isEmpty()) 
    228           { 
    229                $res = ''; 
    230                while($rs->fetch()) 
    231                { 
    232                     $group = $rs->activity_group; 
    233  
    234                     $res .=  
    235                     '<dd><p title="'.__($g[$group]['title']).'"><strong>'. 
    236                     __($g[$group]['actions'][$rs->activity_action]['title']). 
    237                     '</p></strong><em>'. 
    238                     vsprintf( 
    239                          __($g[$group]['actions'][$rs->activity_action]['msg']), 
    240                          $core->activityReport->decode($rs->activity_logs) 
    241                     ).              
    242                     '</em></dd>'; 
    243                } 
    244  
    245                if (!empty($res)) 
    246                { 
    247                     $__dashboard_items[1][] =  
    248                          '<h3>'.__('Activity report').'</h3>'. 
    249                          '<dl id="report">'.$res.'</dl>'; 
    250                } 
    251           } 
    252      } 
    253  
    254203     public static function blogUpdate($cur,$blog_id) 
    255204     { 
  • plugins/activityReport/inc/class.activity.report.php

    r1457 r1519  
    251251                    $r .= 'AND E.blog_id'.$this->con->in($p['blog_id']); 
    252252               } 
    253                elseif (!empty($p['blog_id'])) 
     253               else 
    254254               { 
    255255                    $r .= "AND E.blog_id = '".$this->con->escape($p['blog_id'])."' "; 
     
    425425                         dt::str('%Y-%m-%d %H:%M:%S', 
    426426                              $from, 
    427                               $core->blog->settings->blog_timezone 
     427                              $this->core->blog->settings->blog_timezone 
    428428                         ), 
    429429                         dt::str( 
    430430                              '%Y-%m-%d %H:%M:%S', 
    431431                              $to, 
    432                               $core->blog->settings->blog_timezone 
     432                              $this->core->blog->settings->blog_timezone 
    433433                         ) 
    434434                    )."\n"; 
  • plugins/activityReport/inc/lib.activity.report.index.php

    r1457 r1519  
    9090          ?> 
    9191          <div class="multi-part" id="<?php echo $t; ?>_settings" title="<?php echo $title; ?>"> 
     92          <p><img alt=="<?php echo __('RSS feed'); ?>" src="index.php?pf=activityReport/inc/img/feed.png" /> 
     93          <a title="<?php echo __('RSS feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport'); ?>/rss2"> 
     94          <?php echo __('Rss2 feed for activity on this blog'); ?></a> 
     95          <br /> 
     96          <img alt=="<?php echo __('Atom feed'); ?>" src="index.php?pf=activityReport/inc/img/feed.png" /> 
     97          <a title="<?php echo __('Atom feed'); ?>" href="<?php echo $core->blog->url.$core->url->getBase('activityReport'); ?>/atom"> 
     98          <?php echo __('Atom feed for activity on this blog'); ?></a></p> 
    9299          <form method="post" action="plugin.php"> 
    93100 
  • plugins/activityReport/locales/fr/main.lang.php

    r1457 r1519  
    11<?php 
    22// Language: français  
    3 // Module: activityReport - 0.2 
    4 // Date: 2009-09-14 23:00:37  
     3// Module: activityReport - 0.3 
     4// Date: 2009-09-27 20:10:03  
    55// Author: , jcdenis@gdwd.com 
    6 // Translated with dcTranslater - 0.2.4  
     6// Translated with dcTranslater - 0.2.5  
    77 
    88#index.php:37 
     
    147147$GLOBALS['__l10n']['on new activity'] = 'lors d\'une nouvelle activité'; 
    148148 
     149#inc/lib.activity.report.index.php:93 
     150$GLOBALS['__l10n']['RSS feed'] = 'Flux RSS'; 
     151 
     152#inc/lib.activity.report.index.php:94 
     153$GLOBALS['__l10n']['Rss2 feed for activity on this blog'] = 'Flux Rss2 pour l\'activité de ce blog'; 
     154 
     155#inc/lib.activity.report.index.php:97 
     156$GLOBALS['__l10n']['Atom feed'] = 'Flux Atom'; 
     157 
     158#inc/lib.activity.report.index.php:98 
     159$GLOBALS['__l10n']['Atom feed for activity on this blog'] = 'Flux Atom pour l\'activité de ce blog'; 
     160 
    149161#index.php:41 
    150162$GLOBALS['__l10n']['Settings'] = 'Paramètres'; 
    151163 
    152 #inc/lib.activity.report.index.php:100 
     164#inc/lib.activity.report.index.php:107 
    153165$GLOBALS['__l10n']['Enable super administrator report'] = 'Autoriser le rapport de super administrateur'; 
    154166 
    155 #inc/lib.activity.report.index.php:101 
     167#inc/lib.activity.report.index.php:108 
    156168$GLOBALS['__l10n']['Enable report on this blog'] = 'Autoriser le rapport sur ce blog'; 
    157169 
    158 #inc/lib.activity.report.index.php:113 
     170#inc/lib.activity.report.index.php:120 
    159171$GLOBALS['__l10n']['Add activity report on dashboard items'] = 'Ajouter le rapport d\'activité au tableau de bord'; 
    160172 
    161 #inc/lib.activity.report.index.php:120 
     173#inc/lib.activity.report.index.php:127 
    162174$GLOBALS['__l10n']['Send report:'] = 'Rapport envoyé :'; 
    163175 
    164 #inc/lib.activity.report.index.php:124 
     176#inc/lib.activity.report.index.php:131 
    165177$GLOBALS['__l10n']['Recipients:'] = 'Destinataires :'; 
    166178 
    167 #inc/lib.activity.report.index.php:127 
     179#inc/lib.activity.report.index.php:134 
    168180$GLOBALS['__l10n']['Separate multiple email addresses with a semicolon ";"'] = 'Séparer les adresses multiples par un point-virgule ";"'; 
    169181 
    170 #inc/lib.activity.report.index.php:130 
     182#inc/lib.activity.report.index.php:137 
    171183$GLOBALS['__l10n']['Last report by email:'] = 'Dernier rapport par email :'; 
    172184 
    173 #inc/lib.activity.report.index.php:131 
     185#inc/lib.activity.report.index.php:138 
    174186$GLOBALS['__l10n']['Next report by email:'] = 'Prochain rapport par email :'; 
    175187 
    176 #inc/lib.activity.report.index.php:170 
     188#inc/lib.activity.report.index.php:177 
    177189$GLOBALS['__l10n']['Report'] = 'Rapport'; 
    178190 
    179 #inc/lib.activity.report.index.php:211 
     191#inc/lib.activity.report.index.php:218 
    180192$GLOBALS['__l10n']['Send report by email now'] = 'Envoyer un rapport par email maintenant'; 
    181193 
    182 #inc/lib.activity.report.index.php:217 
     194#inc/lib.activity.report.index.php:224 
    183195$GLOBALS['__l10n']['Delete all logs'] = 'Supprimer tous les enregistrements'; 
    184196 
    185 #inc/lib.activity.report.index.php:254 
     197#inc/lib.activity.report.index.php:261 
    186198$GLOBALS['__l10n']['No log'] = 'Pas d\'enregistrement'; 
    187199 
    188 #inc/lib.activity.report.index.php:264 
     200#inc/lib.activity.report.index.php:271 
    189201$GLOBALS['__l10n']['Message'] = 'Message'; 
    190202 
  • plugins/activityReport/locales/fr/main.po

    r1457 r1519  
    11# Language: français 
    2 # Module: activityReport - 0.2 
    3 # Date: 2009-09-14 23:00:37 
     2# Module: activityReport - 0.3 
     3# Date: 2009-09-27 20:10:03 
    44# Author: , jcdenis@gdwd.com 
    5 # Translated with dcTranslater - 0.2.4 
     5# Translated with dcTranslater - 0.2.5 
    66 
    77msgid "" 
     
    196196msgstr "lors d'une nouvelle activité" 
    197197 
     198#: inc/lib.activity.report.index.php:93 
     199msgid "RSS feed" 
     200msgstr "Flux RSS" 
     201 
     202#: inc/lib.activity.report.index.php:94 
     203msgid "Rss2 feed for activity on this blog" 
     204msgstr "Flux Rss2 pour l'activité de ce blog" 
     205 
     206#: inc/lib.activity.report.index.php:97 
     207msgid "Atom feed" 
     208msgstr "Flux Atom" 
     209 
     210#: inc/lib.activity.report.index.php:98 
     211msgid "Atom feed for activity on this blog" 
     212msgstr "Flux Atom pour l'activité de ce blog" 
     213 
    198214#: index.php:41 
    199215msgid "Settings" 
    200216msgstr "Paramètres" 
    201217 
    202 #: inc/lib.activity.report.index.php:100 
     218#: inc/lib.activity.report.index.php:107 
    203219msgid "Enable super administrator report" 
    204220msgstr "Autoriser le rapport de super administrateur" 
    205221 
    206 #: inc/lib.activity.report.index.php:101 
     222#: inc/lib.activity.report.index.php:108 
    207223msgid "Enable report on this blog" 
    208224msgstr "Autoriser le rapport sur ce blog" 
    209225 
    210 #: inc/lib.activity.report.index.php:113 
     226#: inc/lib.activity.report.index.php:120 
    211227msgid "Add activity report on dashboard items" 
    212228msgstr "Ajouter le rapport d'activité au tableau de bord" 
    213229 
    214 #: inc/lib.activity.report.index.php:120 
     230#: inc/lib.activity.report.index.php:127 
    215231msgid "Send report:" 
    216232msgstr "Rapport envoyé :" 
    217233 
    218 #: inc/lib.activity.report.index.php:124 
     234#: inc/lib.activity.report.index.php:131 
    219235msgid "Recipients:" 
    220236msgstr "Destinataires :" 
    221237 
    222 #: inc/lib.activity.report.index.php:127 
     238#: inc/lib.activity.report.index.php:134 
    223239msgid "Separate multiple email addresses with a semicolon ";"" 
    224240msgstr "Séparer les adresses multiples par un point-virgule \";\"" 
    225241 
    226 #: inc/lib.activity.report.index.php:130 
     242#: inc/lib.activity.report.index.php:137 
    227243msgid "Last report by email:" 
    228244msgstr "Dernier rapport par email :" 
    229245 
    230 #: inc/lib.activity.report.index.php:131 
     246#: inc/lib.activity.report.index.php:138 
    231247msgid "Next report by email:" 
    232248msgstr "Prochain rapport par email :" 
    233249 
    234 #: inc/lib.activity.report.index.php:170 
     250#: inc/lib.activity.report.index.php:177 
    235251msgid "Report" 
    236252msgstr "Rapport" 
    237253 
    238 #: inc/lib.activity.report.index.php:211 
     254#: inc/lib.activity.report.index.php:218 
    239255msgid "Send report by email now" 
    240256msgstr "Envoyer un rapport par email maintenant" 
    241257 
    242 #: inc/lib.activity.report.index.php:217 
     258#: inc/lib.activity.report.index.php:224 
    243259msgid "Delete all logs" 
    244260msgstr "Supprimer tous les enregistrements" 
    245261 
    246 #: inc/lib.activity.report.index.php:254 
     262#: inc/lib.activity.report.index.php:261 
    247263msgid "No log" 
    248264msgstr "Pas d'enregistrement" 
    249265 
    250 #: inc/lib.activity.report.index.php:264 
     266#: inc/lib.activity.report.index.php:271 
    251267msgid "Message" 
    252268msgstr "Message" 
  • plugins/activityReport/release.txt

    r1457 r1519  
     10.3 20090927 
     2 * Added atom/rss2 feeds 
     3 * Moved some class 
     4 
    150.2 20090915 
    26 * First public release 
Note: See TracChangeset for help on using the changeset viewer.

Sites map