Dotclear

Changeset 207


Ignore:
Timestamp:
06/19/08 11:34:21 (15 years ago)
Author:
olivier
Message:

Piwik update. Added a summary in admin page and FR translation update.

Location:
plugins/piwik
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • plugins/piwik/class.dc.piwik.php

    r203 r207  
    2323class dcPiwik extends netHttp 
    2424{ 
     25     protected $api_path; 
     26     protected $api_token; 
     27      
    2528     public function __construct($uri) 
    2629     { 
     
    5760          $get = $this->methodCall('SitesManager.getSitesWithAdminAccess'); 
    5861          $this->get($get['path'],$get['data']); 
    59           return $this->readResponse(); 
     62          $rsp = $this->readResponse(); 
     63          $res = array(); 
     64          foreach ($rsp as $v) { 
     65               $res[$v['idsite']] = $v; 
     66          } 
     67          return $res; 
    6068     } 
    6169      
     
    144152     } 
    145153      
     154     public static function getVisitSummaryGraph($uri,$token,$site) 
     155     { 
     156          $flash_movie = dirname($uri).'/libs/open-flash-chart/open-flash-chart.swf'; 
     157          $flash_vars = array( 
     158               'module=VisitsSummary', 
     159               'action=getLastVisitsGraph', 
     160               'idSite='.$site, 
     161               'period=day', 
     162               'date='.date('Y-m-d',strtotime('-1 month')).','.date('Y-m-d'), 
     163               'viewDataTable=generateDataChartEvolution', 
     164               'token_auth='.$token 
     165          ); 
     166           
     167          $flash_vars = $uri.'?'.implode('&',$flash_vars); 
     168           
     169          return 
     170          '<object height="150" width="100%" type="application/x-shockwave-flash" '. 
     171          'data="'.$flash_movie.'">'. 
     172          '<param name="movie" value="'.$flash_movie.'" />'. 
     173          '<param name="quality" value="high" />'. 
     174          '<param name="allowScriptAccess" value="samedomain" />'. 
     175          '<param name="flashvars" value="data='.urlencode($flash_vars).'" />'. 
     176          '</object>'; 
     177     } 
     178      
    146179     public static function getScriptCode($uri,$idsite,$action='') 
    147180     { 
     
    152185          return 
    153186          "<!-- Piwik -->\n". 
    154           '<script language="javascript" src="'.html::escapeURL($js).'" type="text/javascript"></script>'."\n". 
     187          '<script type="text/javascript" src="'.html::escapeURL($js).'"></script>'."\n". 
    155188          '<script type="text/javascript">'. 
    156189          "//<![CDATA[\n". 
  • plugins/piwik/index.php

    r205 r207  
    9494           
    9595          # Get sites list 
    96           $sites = $o->getSitesWithAdminAccess(); 
     96          $piwik_sites = $o->getSitesWithAdminAccess(); 
    9797           
    98           if (count($sites) < 1) { 
     98          if (count($piwik_sites) < 1) { 
    9999               throw new Exception(__('No Piwik sites configured.')); 
    100100          } 
    101101           
    102           foreach ($sites as $v) { 
    103                $sites_combo[$v['idsite'].' - '.$v['name']] = $v['idsite']; 
     102          foreach ($piwik_sites as $k => $v) { 
     103               $sites_combo[html::escapeHTML($k.' - '.$v['name'])] = $k; 
     104          } 
     105           
     106          if ($piwik_site && !isset($piwik_sites[$piwik_site])) { 
     107               $piwik_site = ''; 
    104108          } 
    105109     } 
     
    150154'</form>'; 
    151155 
     156if ($piwik_site && $piwik_uri) 
     157{ 
     158     echo 
     159     '<h3>'.sprintf(__('Last visits graph on %s'),html::escapeHTML($piwik_sites[$piwik_site]['name'])). 
     160     ' - <a href="'.$piwik_uri.'">'.__('View your blog statistics').'</a></h3>'. 
     161     '<p>'.dcPiwik::getVisitSummaryGraph($piwik_uri,$piwik_token,$piwik_site).'</p>'; 
     162} 
     163 
    152164if ($piwik_uri) 
    153165{ 
  • plugins/piwik/locales/_pot/main.pot

    r203 r207  
    88"Project-Id-Version: Dotclear 2 piwik module\n" 
    99"Report-Msgid-Bugs-To: \n" 
    10 "POT-Creation-Date: 2008-06-18 11:19+0200\n" 
     10"POT-Creation-Date: 2008-06-19 11:13+0200\n" 
    1111"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 
    1212"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 
     
    1616"Content-Transfer-Encoding: 8bit\n" 
    1717 
    18 #: plugins-test/piwik//class.dc.piwik.php:30 
     18#: plugins-test/piwik//class.dc.piwik.php:33 
    1919msgid "Unable to read Piwik URI." 
    2020msgstr "" 
    2121 
    22 #: plugins-test/piwik//class.dc.piwik.php:89 
     22#: plugins-test/piwik//class.dc.piwik.php:97 
    2323msgid "Invalid Piwik Response." 
    2424msgstr "" 
    2525 
    26 #: plugins-test/piwik//class.dc.piwik.php:100 
     26#: plugins-test/piwik//class.dc.piwik.php:108 
    2727#, php-format 
    2828msgid "Piwik returned an error: %s" 
    2929msgstr "" 
    3030 
    31 #: plugins-test/piwik//class.dc.piwik.php:122 
     31#: plugins-test/piwik//class.dc.piwik.php:130 
    3232msgid "Invalid Service URI." 
    3333msgstr "" 
     
    4545msgstr "" 
    4646 
    47 #: plugins-test/piwik//index.php:119 
     47#: plugins-test/piwik//index.php:123 
    4848msgid "Piwik configuration" 
    4949msgstr "" 
    5050 
    51 #: plugins-test/piwik//index.php:123 
     51#: plugins-test/piwik//index.php:127 
    5252msgid "Your Piwik configuration" 
    5353msgstr "" 
    5454 
    55 #: plugins-test/piwik//index.php:127 
     55#: plugins-test/piwik//index.php:131 
    5656msgid "Your Piwik URL:" 
    5757msgstr "" 
    5858 
    59 #: plugins-test/piwik//index.php:129 
     59#: plugins-test/piwik//index.php:133 
    6060msgid "Your Piwik Token:" 
    6161msgstr "" 
    6262 
    63 #: plugins-test/piwik//index.php:134 
     63#: plugins-test/piwik//index.php:138 
    6464msgid "Your Piwik installation is not configured yet." 
    6565msgstr "" 
    6666 
    67 #: plugins-test/piwik//index.php:139 
     67#: plugins-test/piwik//index.php:143 
    6868msgid "Piwik website to track:" 
    6969msgstr "" 
    7070 
    71 #: plugins-test/piwik//index.php:141 
     71#: plugins-test/piwik//index.php:145 
    7272msgid "Do not track following IP addresses:" 
    7373msgstr "" 
    7474 
    75 #: plugins-test/piwik//index.php:143 
     75#: plugins-test/piwik//index.php:147 
    7676msgid "Use fancy page names:" 
    7777msgstr "" 
    7878 
    79 #: plugins-test/piwik//index.php:153 
     79#: plugins-test/piwik//index.php:159 
     80#, php-format 
     81msgid "Last visits graph on %s" 
     82msgstr "" 
     83 
     84#: plugins-test/piwik//index.php:160 
     85msgid "View your blog statistics" 
     86msgstr "" 
     87 
     88#: plugins-test/piwik//index.php:167 
    8089msgid "Create a new Piwik site for this blog" 
    8190msgstr "" 
    8291 
    83 #: plugins-test/piwik//index.php:155 
     92#: plugins-test/piwik//index.php:169 
    8493msgid "Site name:" 
    8594msgstr "" 
    8695 
    87 #: plugins-test/piwik//index.php:157 
     96#: plugins-test/piwik//index.php:171 
    8897msgid "Site URL:" 
    8998msgstr "" 
    9099 
    91 #: plugins-test/piwik//index.php:159 
     100#: plugins-test/piwik//index.php:173 
    92101msgid "create site" 
    93102msgstr "" 
  • plugins/piwik/locales/en/help.html

    r206 r207  
    1 <p>Piwik is an open source (GPL license) web analytics software. It gives 
     1<p><em>Piwik is an open source (GPL license) web analytics software. It gives 
    22interesting reports on your website visitors, your popular pages, the search 
    3 engines keywords they used, the language they speak and so much more.</p> 
     3engines keywords they used, the language they speak and so much more.</em></p> 
    44<p>Please visit <a href="http://piwik.org/">piwik.org</a> for download and more 
    55information.</p> 
  • plugins/piwik/locales/fr/main.po

    r203 r207  
    77"Project-Id-Version: Dotclear 2 piwik module\n" 
    88"Report-Msgid-Bugs-To: \n" 
    9 "POT-Creation-Date: 2008-06-18 11:18+0200\n" 
    10 "PO-Revision-Date: 2008-06-18 11:19+0100\n" 
     9"POT-Creation-Date: 2008-06-19 11:13+0200\n" 
     10"PO-Revision-Date: 2008-06-19 11:14+0100\n" 
    1111"Last-Translator: Olivier Meunier <olivier@dotclear.net>\n" 
    1212"Language-Team: \n" 
     
    2222msgstr "Réponse Piwik invalide." 
    2323 
    24 #, fuzzy, php-format 
     24#, php-format 
    2525msgid "Piwik returned an error: %s" 
    2626msgstr "Piwik a renvoyé une erreur : %s" 
     
    6262msgstr "Utiliser des noms de page améliorés :" 
    6363 
     64#, php-format 
     65msgid "Last visits graph on %s" 
     66msgstr "Graphique des dernières visites sur %s" 
     67 
     68msgid "View your blog statistics" 
     69msgstr "Voir les statistiques de votre blog" 
     70 
    6471msgid "Create a new Piwik site for this blog" 
    6572msgstr "Créer un nouveau site Piwik pour ce blog" 
Note: See TracChangeset for help on using the changeset viewer.

Sites map