Permalink
Browse files

Implémentation du tableau de bord

  • Loading branch information...
1 parent 26894c8 commit ad42cd6c120e6481295eaf89de6b57846f40f040 @vincentchalamon committed Dec 6, 2011
View
@@ -0,0 +1,18 @@
+all:
+ # Configuration du plugin
+ sf_admin_template:
+ # Configuration du menu
+ menus:
+ # Création d'un élément de menu "article"
+ dashboard:
+ label: Tableau de bord
+ credentials: [admin]
+ route_prefix: sf_admin_dashboard
+ # Configuration des templates (défaut : admin, clean)
+ templates: [admin, clean, myLayout]
+ # Configuration de GoogleAnalytics
+ google_analytics:
+ code: "UA-1234567-1"
+ login: monlogin
+ password: monpassword
+ profile: 12345678
View
@@ -0,0 +1,4 @@
+sf_admin_dashboard:
+ url: /admin/dashboard
+ param: { module: sfAdminDashboard, action: dashboard }
+ requirements: { sf_method: [get] }
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * sfAdminTemplatePlugin configuration.
+ *
+ * @package sfAdminTemplatePlugin
+ * @subpackage config
+ * @author Vincent CHALAMON <vincentchalamon@gmail.com>
+ */
+class sfAdminTemplatePluginConfiguration extends sfPluginConfiguration
+{
+ /**
+ * @see sfPluginConfiguration
+ */
+ public function initialize()
+ {
+ $config = sfConfig::get('app_sf_admin_template_google_analytics', array());
+ foreach($config as $key => $value) {
+ sfConfig::set('google_analytics_'.$key, $value);
+ }
+ }
+}
View
@@ -4,6 +4,64 @@
<file original="global" source-language="en" datatype="plaintext">
<header />
<body>
+ <!-- Dashboard -->
+ <trans-unit>
+ <source>Administration | Dashboard</source>
+ <target>Administration | Tableau de bord</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Dashboard</source>
+ <target>Tableau de bord</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Visits</source>
+ <target>Visites</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Popularity</source>
+ <target>Fréquentation du site</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Incoming sources</source>
+ <target>Sources du trafic</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Geografic synthesis</source>
+ <target>Synthèse géographique</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Visitors</source>
+ <target>Visiteurs</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Page views</source>
+ <target>Pages vues</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Average page views</source>
+ <target>Nombre moyen de pages vues</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Bouncing rate</source>
+ <target>Taux de rebond</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Average time on site</source>
+ <target>Temps moyen sur le site</target>
+ </trans-unit>
+ <trans-unit>
+ <source>New visits</source>
+ <target>Nouvelles visites</target>
+ </trans-unit>
+ <trans-unit>
+ <source>View on GoogleAnalytics</source>
+ <target>Consulter sur Google Analytics</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Unable to find website statistics. Maybe your GoogleAnalytics account is disabled or not accessible.</source>
+ <target>Impossible de récupérer les statistiques de votre site. Peut-être votre compte Google Analytics est-il désactivé ou inaccessible.</target>
+ </trans-unit>
+
<!-- Actions -->
<trans-unit>
<source>New</source>
@@ -0,0 +1,14 @@
+<?php
+
+require_once sfConfig::get('sf_plugins_dir').'/sfAdminTemplatePlugin/modules/sfAdminDashboard/lib/BasesfAdminDashboardActions.class.php';
+
+/**
+ *
+ * @package symfony
+ * @subpackage plugin
+ * @author Vincent CHALAMON <vincentchalamon@gmail.com>
+ * @version SVN: $Id: actions.class.php 23319 2009-10-25 12:22:23Z Kris.Wallsmith $
+ */
+class sfAdminDashboardActions extends BasesfAdminDashboardActions
+{
+}
@@ -0,0 +1,2 @@
+dashboard:
+ enabled: false
@@ -0,0 +1,2 @@
+dashboard:
+ is_secure: true
@@ -0,0 +1,2 @@
+default:
+ layout: admin
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ *
+ * @package symfony
+ * @subpackage plugin
+ * @author Vincent CHALAMON <vincentchalamon@gmail.com>
+ * @version SVN: $Id: actions.class.php 23319 2009-10-25 12:22:23Z Kris.Wallsmith $
+ */
+class BasesfAdminDashboardActions extends sfActions
+{
+ public function executeDashboard(sfWebRequest $request)
+ {
+ try
+ {
+ $this->ga = new gapi(sfConfig::get('google_analytics_login'), sfConfig::get('google_analytics_password'), sfConfig::get('google_analytics_profile'));
+ }
+ catch(Exception $e)
+ {
+ $this->ga = false;
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit ad42cd6

Please sign in to comment.