diff --git a/assets/piwikicon.gif b/assets/piwikicon.gif deleted file mode 100644 index 49213d6..0000000 Binary files a/assets/piwikicon.gif and /dev/null differ diff --git a/bepiwikcharts.php b/bepiwikcharts.php index 2d80e03..8ebbfe2 100644 --- a/bepiwikcharts.php +++ b/bepiwikcharts.php @@ -41,12 +41,14 @@ class bepiwikcharts extends BackendModule { public $url = "http://demo.piwik.org/"; // inkl. http(s), mit / am Ende public $piwik_IDsite = 3; public $piwik_TOKENauth = "anonymous"; + public $piwik_period = 30; private $tableMaxRows = 10; public $modus = 0; // 0 = Demo, 1 = normal private $username = ""; private $password = ""; private $error = FALSE; private $errorCode = 0; + private $version_installed = ""; public function compile() { @@ -64,6 +66,9 @@ function __construct() { $this->url = $GLOBALS["TL_CONFIG"]['piwikchartsURL']; $this->piwik_IDsite = $GLOBALS["TL_CONFIG"]['piwikchartsSiteID']; $this->piwik_TOKENauth = $GLOBALS["TL_CONFIG"]['piwikchartsAuthCode']; + if ($GLOBALS["TL_CONFIG"]['piwikchartsPeriod'] != "") { + $this->piwik_period = intval($GLOBALS["TL_CONFIG"]['piwikchartsPeriod']); + } $this->username = $GLOBALS["TL_CONFIG"]['piwikchartsUsername']; $this->password = $GLOBALS["TL_CONFIG"]['piwikchartsPassword']; $this->modus = 1; //1 = Normalmodus; @@ -72,19 +77,20 @@ function __construct() { /** * checkUpdate - prüft auf Updates - * @return wenn neue Version vorliegt: neue Versionsnummer. Wenn keine neue Version vorliegt: Leerstring + * @return String - wenn neue Version vorliegt: neue Versionsnummer. Wenn keine neue Version vorliegt: Leerstring */ function checkUpdate() { if ($this->modus == 1) { + // nur im Produktivmodus nutzen. nicht im Demo-Modus try { // aktuelle Version vom Server lesen $xml = new SimpleXMLElement($this->readfile($this->url . "index.php?module=API&method=API.getPiwikVersion&format=xml&token_auth=" . $this->piwik_TOKENauth)); - $version_installed = trim($xml[0]); + $this->version_installed = trim($xml[0]); // neuste Version vom Piwik-Server lesen $version_newest = trim($this->readfile("http://api.piwik.org/1.0/getLatestVersion/")); - if ($version_newest == $version_installed) { + if ($version_newest == $this->version_installed) { return ""; } else { return $version_newest; @@ -310,12 +316,13 @@ function dashboardWelcomePage() { return ""; } - $strBuffer = '
'; + //$strBuffer = '
'; + $strBuffer = '
'; $objTemplate_head = new BackendTemplate('ce_headline'); $objTemplate_head->hl = 'h2'; $objTemplate_head->class = 'ce_headline'; - $objTemplate_head->style = 'background:none repeat scroll 0 0 #F6F6F6;border: solid #E9E9E9; border-width: 1px 0px 1px 0px; margin:18px 0px 6px; padding: 2px 6px 3px;'; + //$objTemplate_head->style = 'background:none repeat scroll 0 0 #F6F6F6;border: solid #E9E9E9; border-width: 1px 0px 1px 0px; margin:18px 0px 6px; padding: 2px 6px 3px;'; $objTemplate_head->headline = $GLOBALS['TL_LANG']['be_piwikcharts']['template']['dashboard']['headline']; $strBuffer .= $objTemplate_head->parse(); @@ -341,8 +348,8 @@ function dashboardWelcomePage() { $objTemplate_content->lang = (object) $GLOBALS['TL_LANG']['be_piwikcharts']['template']['dashboard']; // Diagramme - $objTemplate_content->chart_evolutionVisitsSummaryDay .= $this->printChart("evolution", "VisitsSummary", "day", "previous30", 400, 180, 80, "get", "", "margin-right:20px;"); - $objTemplate_content->chart_evolutionVisitsSummaryMonth .= $this->printChart("evolution", "VisitsSummary", "month", "previous24", 400, 100, 80, "get", "&colors=,,ff0000", "margin-bottom: 10px;"); + $objTemplate_content->chart_evolutionVisitsSummaryDay .= $this->printChart("evolution", "VisitsSummary", "day", "previous".$this->piwik_period, 400, 180, 80, "get", "", ""); + $objTemplate_content->chart_evolutionVisitsSummaryMonth .= $this->printChart("evolution", "VisitsSummary", "month", "previous24", 400, 100, 80, "get", "&colors=,,ff0000", ""); //im Demo-Modus (0) ist die Anzeige letzte 30Min/24h deaktivert if ($this->modus > 0) { @@ -416,6 +423,8 @@ public function generate() { } $objTemplate->link_server = $this->url; + + $objTemplate->piwik_period = $this->piwik_period; $objTemplate->piwik_IDsite = $this->piwik_IDsite; @@ -424,28 +433,35 @@ public function generate() { $objTemplate->showUpdate = $this->User->isAdmin || $GLOBALS["TL_CONFIG"]['piwikchartsWelcomePageUpdate']; // 30 Tage Besuchergraf - $objTemplate->chart_evolutionVisitsSummaryDay = $this->printChart("evolution", "VisitsSummary", "day", "previous30", 400, 200, 80, "get"); + $objTemplate->chart_evolutionVisitsSummaryDay = $this->printChart("evolution", "VisitsSummary", "day", "previous".$this->piwik_period, 400, 200, 80, "get"); // 24 Monate Besuchergraf $objTemplate->chart_evolutionVisitsSummaryMonth = $this->printChart("evolution", "VisitsSummary", "month", "previous24", 400, 200, 80, "get", "&colors=,,ff0000"); // Diagramm Besuchszeiten - $objTemplate->chart_verticalBarVisitsPerServerTime = $this->printChart("verticalBar", "VisitTime", "range", "previous30", 400, 200, 80, "getVisitInformationPerServerTime"); + $objTemplate->chart_verticalBarVisitsPerServerTime = $this->printChart("verticalBar", "VisitTime", "range", "previous".$this->piwik_period, 400, 200, 80, "getVisitInformationPerServerTime"); // Diagramm Besuchertage - $objTemplate->chart_verticalBarVisitTimeByDayOfWeek = $this->printChart("verticalBar", "VisitTime", "range", "previous30", 400, 200, 80, "getByDayOfWeek"); + $objTemplate->chart_verticalBarVisitTimeByDayOfWeek = $this->printChart("verticalBar", "VisitTime", "range", "previous".$this->piwik_period, 400, 200, 80, "getByDayOfWeek"); // Diagramm Browser - $objTemplate->chart_horizontalBarUserBrowser = $this->printChart("horizontalBar", "UserSettings", "range", "previous30", 400, 200, 80, "getBrowser"); - + $objTemplate->chart_horizontalBarUserBrowser = $this->printChart("horizontalBar", "DevicesDetection", "range", "previous".$this->piwik_period, 400, 200, 80, "getBrowsers"); + + $version = explode(".", $this->version_installed); + + if (intval($version[0])<2 || (intval($version[0])<2 && intval($version[1])<10) ) { + // in der Piwik Version 2.10 wurde die API angepasst. Ab Version 2.14 wurde "UserSettings" abgeschaltet. Fuer die Rueckwaertskompatibilitaet + $objTemplate->chart_horizontalBarUserBrowser = $this->printChart("horizontalBar", "UserSettings", "range", "previous".$this->piwik_period, 400, 200, 80, "getBrowser"); + } + // Diagramm Länder - $objTemplate->chart_horizontalBarUserCountry = $this->printChart("horizontalBar", "UserCountry", "range", "previous30", 400, 200, 80, "getCountry"); + $objTemplate->chart_horizontalBarUserCountry = $this->printChart("horizontalBar", "UserCountry", "range", "previous".$this->piwik_period, 400, 200, 80, "getCountry"); //Tabelle: Suchworte von Suchmaschinen $objTemplate->table_keywords = $this->printTable( $this->PHPload( $this->buildURL( - "Referers.getKeywords", "range", "previous30", "&format=php&filter_limit=20" + "Referers.getKeywords", "range", "previous".$this->piwik_period, "&format=php&filter_limit=20" ), array("label", "nb_visits") ), array( $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_header_keyword'], @@ -457,7 +473,7 @@ public function generate() { $objTemplate->table_fromWebsite = $this->printTable( $this->PHPload( $this->buildURL( - "Referers.getWebsites", "range", "previous30", "&format=php&filter_limit=20" + "Referers.getWebsites", "range", "previous".$this->piwik_period, "&format=php&filter_limit=20" ), array("label", "nb_visits") ), array( $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_header_website'], @@ -469,7 +485,7 @@ public function generate() { $objTemplate->table_visitedPages = $this->printTable( $this->PHPload( $this->buildURL( - "Actions.getPageUrls", "range", "previous30", "&format=php&filter_limit=20" + "Actions.getPageUrls", "range", "previous".$this->piwik_period, "&format=php&filter_limit=20" ), array("label", "nb_visits") ), array( $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_header_page'], @@ -481,7 +497,7 @@ public function generate() { $objTemplate->table_downloads = $this->printTable_downloads( $this->PHPload( $this->buildURL( - "Actions.getDownloads", "range", "previous30", "&format=php&filter_limit=20&expanded=1&filter_limit=10" + "Actions.getDownloads", "range", "previous".$this->piwik_period, "&format=php&filter_limit=20&expanded=1&filter_limit=10" ), array("label", "subtable") ), "downloads" ); diff --git a/config/config.php b/config/config.php index 8adad66..19a7cbc 100644 --- a/config/config.php +++ b/config/config.php @@ -60,15 +60,21 @@ $GLOBALS['TL_CONFIG']['dashboardAccess'] = 'public'; $GLOBALS['TL_CONFIG']['dashboardLimit'] = '0'; +/** + * Hooks + */ +$GLOBALS['TL_HOOKS']['getSystemMessages'][] = array('bepiwikcharts', 'dashboardWelcomePage'); $GLOBALS['TL_HOOKS']['addCustomRegexp'][] = array('bepiwikcharts', 'myRegexp_checkPiwikUrl'); $GLOBALS['TL_HOOKS']['addCustomRegexp'][] = array('bepiwikcharts', 'myRegexp_checkAuthCode'); + + array_insert($GLOBALS['BE_MOD']['system'], 98, array( 'be_piwikcharts' => array( 'callback' => 'bepiwikcharts', 'stylesheet' => 'system/modules/be_piwikcharts/assets/bepiwikcharts.css', - 'icon' => 'system/modules/be_piwikcharts/assets/piwikicon.gif' + 'icon' => 'system/modules/be_piwikcharts/assets/piwikicon.png' ) )); diff --git a/dca/tl_settings.php b/dca/tl_settings.php index 7da4f0f..c6cc64c 100644 --- a/dca/tl_settings.php +++ b/dca/tl_settings.php @@ -33,7 +33,7 @@ /** * Add to palette */ -$GLOBALS['TL_DCA']['tl_settings']['palettes']['default'] .= ';{piwikcharts_legend:hide},piwikchartsURL,piwikchartsSiteID,piwikchartsAuthCode,piwikchartsUsername,piwikchartsPassword,piwikchartsWelcomePageAdmin,piwikchartsWelcomePage,piwikchartsWelcomePageUpdate,piwikchartsWelcomePageOptout,piwikchartsRedirect;'; +$GLOBALS['TL_DCA']['tl_settings']['palettes']['default'] .= ';{piwikcharts_legend:hide},piwikchartsURL,piwikchartsSiteID,piwikchartsAuthCode,piwikchartsPeriod,piwikchartsUsername,piwikchartsPassword,piwikchartsWelcomePageAdmin,piwikchartsWelcomePage,piwikchartsWelcomePageUpdate,piwikchartsWelcomePageOptout,piwikchartsRedirect;'; $GLOBALS['TL_DCA']['tl_settings']['fields']['piwikchartsURL'] = array ( @@ -56,7 +56,15 @@ 'label' => &$GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['authCode'], 'inputType' => 'text', 'exclude' => true, - 'eval' => array('mandatory' => false, 'rgxp' => 'checkAuthCode', 'tl_class' => 'long clr') + 'eval' => array('mandatory' => false, 'rgxp' => 'checkAuthCode', 'tl_class' => 'w50') +); + +$GLOBALS['TL_DCA']['tl_settings']['fields']['piwikchartsPeriod'] = array + ( + 'label' => &$GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['period'], + 'inputType' => 'text', + 'exclude' => true, + 'eval' => array('mandatory' => false, 'rgxp' => 'natural', 'tl_class' => 'w50') ); $GLOBALS['TL_DCA']['tl_settings']['fields']['piwikchartsUsername'] = array @@ -72,7 +80,7 @@ 'label' => &$GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['password'], 'inputType' => 'text', 'exclude' => true, - 'eval' => array('mandatory' => false, 'hideInput' => true, 'encrypt' => true) + 'eval' => array('mandatory' => false, 'hideInput' => true, 'encrypt' => true, 'tl_class' => 'w50') ); $GLOBALS['TL_DCA']['tl_settings']['fields']['piwikchartsWelcomePageAdmin'] = array diff --git a/languages/de/default.php b/languages/de/default.php index 3e99d12..e4b143c 100644 --- a/languages/de/default.php +++ b/languages/de/default.php @@ -60,26 +60,26 @@ $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['menu']['update'] = "Update verfügbar"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['menu']['update_title'] = "Ein neues Update der Piwik-Software ist verfügbar"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_last30days_headline'] = "letzte 30 Tage"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_last30days_headline'] = "Zeitraum: letzte %d Tage"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_last24months_headline'] = "letzte 24 Monate"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_visitsPerServerTime_headline'] = "Besuchszeiten (Serverzeit)"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_visitTimeByDayOfWeek_headline'] = "Besuchertage"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_userBrowser_headline'] = "Browser"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_userCountry_headline'] = "Besucher aus"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_headline'] = "Top-Suchwörter, die auf die Webseite geführten hatten (Zeitraum: letzte 30 Tage)"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_headline'] = "Top-Suchwörter, die auf die Webseite geführten hatten"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_header_keyword'] = "Suchwort"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_header_count'] = "Aufrufe"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_headline'] = "Von diesen Webseiten kamen Ihre Besucher auf Ihre Webseite (Zeitraum: letzte 30 Tage)"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_headline'] = "Von diesen Webseiten kamen Ihre Besucher auf Ihre Webseite"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_header_website'] = "Von Webseite"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_header_count'] = "Aufrufe"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_headline'] = "Die am häufigsten besuchten Seiten (Zeitraum: letzte 30 Tage)"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_headline'] = "Die am häufigsten besuchten Seiten"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_header_page'] = "Seite"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_header_count'] = "Aufrufe"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_headline'] = "Die häufigsten Downloads (Zeitraum: letzte 30 Tage)"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_headline'] = "Die häufigsten Downloads"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_header_domain'] = "Domain"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_header_file'] = "Datei"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_header_count'] = "Downloads"; @@ -94,11 +94,11 @@ /** * Load on be_welcome */ -if (TL_MODE == 'BE') { - if (!strlen($_GET['do']) && ($GLOBALS['TL_LANGUAGE'] == "de") ) { - $bepiwikcharts = new bepiwikcharts(); - $GLOBALS['TL_LANG']['MSC']['welcomeTo'] .= '' . $bepiwikcharts->dashboardWelcomePage() . '

 '; - } -} +//if (TL_MODE == 'BE') { +// if (!strlen($_GET['do']) && ($GLOBALS['TL_LANGUAGE'] == "de") ) { +// $bepiwikcharts = new bepiwikcharts(); +// $GLOBALS['TL_LANG']['MSC']['welcomeTo'] .= '

' . $bepiwikcharts->dashboardWelcomePage() . '

 '; +// } +//} diff --git a/languages/de/modules.php b/languages/de/modules.php index 0843c96..4098f04 100644 --- a/languages/de/modules.php +++ b/languages/de/modules.php @@ -7,7 +7,7 @@ */ -$GLOBALS['TL_LANG']['MOD']['be_piwikcharts'] = array('Statistiken Besucher', 'Statistiken Besucher anzeigen'); +$GLOBALS['TL_LANG']['MOD']['be_piwikcharts'] = array('Besucher-Statistiken', '[Piwik] Besucher-Statistiken anzeigen'); ?> \ No newline at end of file diff --git a/languages/de/tl_settings.php b/languages/de/tl_settings.php index 6cf761a..01e1580 100644 --- a/languages/de/tl_settings.php +++ b/languages/de/tl_settings.php @@ -40,6 +40,7 @@ $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['siteID'] = array("SiteID", "Webseiten-ID: idSite-Variable aus der Piwik-Installation. Bei Piwik-Installationen, die nur eine Webseite erfassen ist 1 der Standard. Den Wert der idSite-Variabe findet man in der URL, wenn man sich das Dashboards auf dem Piwik-Server anschaut."); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['authCode'] = array("AuthCode", "AuthCode für die Verbindung mit Piwik um die Statistiken im Backendmodul anzeigen zu können."); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['authCode']['rgxp'] = "Mit diesem AuthCode ist keine Verbindung mit der Piwik-Installation möglich."; +$GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['period'] = array("Zeitraum", "Zeitaum in Tagen, der statistisch ausgewertet werden soll. (optional, default: 30 Tage)"); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['username'] = array("Benutzername", "Benutzername für den Auto-Login in Piwik (optional)"); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['password'] = array("Passwort", "Passwort für den Auto-Login mit Piwik (optional)"); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['welcomePageAdmin'] = array("BE-Startseite: Statistiken anzeigen (nur für Admins)", "Nur für Admin-User: Zeigt eine Auswahl von Statistiken auf der ersten Seite nach dem Login an. Zusätzlich wird geprüft ob ein Update von Piwik bereit steht."); diff --git a/languages/en/default.php b/languages/en/default.php index c17f68d..93cf32c 100644 --- a/languages/en/default.php +++ b/languages/en/default.php @@ -64,26 +64,26 @@ $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['menu']['update'] = "Update available"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['menu']['update_title'] = "New Piwik software update is available"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_last30days_headline'] = "last 30 days"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_last30days_headline'] = "period: last %d days"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_last24months_headline'] = "last 24 months"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_visitsPerServerTime_headline'] = "visit time (server time)"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_visitTimeByDayOfWeek_headline'] = "visit days"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_userBrowser_headline'] = "browser"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['graph']['visitors_userCountry_headline'] = "visitors from"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_headline'] = "Top keywords, that leads to your website (period: last 30 days)"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_headline'] = "Top keywords, that leads to your website"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_header_keyword'] = "Keyword"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['keywords_header_count'] = "Visits"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_headline'] = "From this websites your visitors came from (period: last 30 days)"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_headline'] = "From this websites your visitors came from"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_header_website'] = "From website"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['fromWebsite_header_count'] = "Visits"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_headline'] = "Most visited pages (period: last 30 days)"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_headline'] = "Most visited pages"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_header_page'] = "Page"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['visitedPages_header_count'] = "Visits"; -$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_headline'] = "Most downloaded content (period: last 30 days)"; +$GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_headline'] = "Most downloaded content"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_header_domain'] = "Domain"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_header_file'] = "File"; $GLOBALS['TL_LANG']['be_piwikcharts']['template']['sheet']['table']['downloads_header_count'] = "Downloads"; @@ -98,11 +98,11 @@ /** * Load on be_welcome */ -if (TL_MODE == 'BE') { - if (!strlen($_GET['do']) && ($GLOBALS['TL_LANGUAGE'] != "de") ) { - $bepiwikcharts = new bepiwikcharts(); - $GLOBALS['TL_LANG']['MSC']['welcomeTo'] .= '

' . $bepiwikcharts->dashboardWelcomePage() . '

 '; - } -} +//if (TL_MODE == 'BE') { +// if (!strlen($_GET['do']) && ($GLOBALS['TL_LANGUAGE'] != "de") ) { +// $bepiwikcharts = new bepiwikcharts(); +// $GLOBALS['TL_LANG']['MSC']['welcomeTo'] .= '

' . $bepiwikcharts->dashboardWelcomePage() . '

 '; +// } +//} diff --git a/languages/en/modules.php b/languages/en/modules.php index 716a28d..152ed55 100644 --- a/languages/en/modules.php +++ b/languages/en/modules.php @@ -7,7 +7,7 @@ */ -$GLOBALS['TL_LANG']['MOD']['be_piwikcharts'] = array('Stats Visitors', 'Shows visitor stats'); +$GLOBALS['TL_LANG']['MOD']['be_piwikcharts'] = array('Stats Visitors', '[Piwik] Shows visitor stats'); ?> \ No newline at end of file diff --git a/languages/en/tl_settings.php b/languages/en/tl_settings.php index 4d98164..f4597a4 100644 --- a/languages/en/tl_settings.php +++ b/languages/en/tl_settings.php @@ -40,6 +40,7 @@ $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['siteID'] = array("SiteID", "Website-ID: idSite-variable from Piwik installation. Piwik installationen, that only track one website siteID is usualy 1. idSite value can found in URL of Piwik dashboard."); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['authCode'] = array("AuthCode", "AuthCode for authenticated connection to Piwik to show stats at the Contao backend."); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['authCode']['rgxp'] = "No Connection to Piwik installation possible with this AuthCode."; +$GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['period'] = array("Period", "Period in days, that the stats are shown. (optional, default: 30 days)"); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['username'] = array("Username", "Username for Auto-Login to Piwik (optional)"); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['password'] = array("Password", "Password for Auto-Login to Piwik (optional)"); $GLOBALS['TL_LANG']['tl_settings']['be_piwikcharts']['welcomePageAdmin'] = array("Backend welcome page: Stats shown (only for admins)", "Only for admin users: Shows any stats on first page after backend login. Additionally it checks for new available updates."); diff --git a/templates/be_piwikcharts.html5 b/templates/be_piwikcharts.html5 index 202b3d5..b9eafcf 100644 --- a/templates/be_piwikcharts.html5 +++ b/templates/be_piwikcharts.html5 @@ -51,42 +51,45 @@
- - - - - - - - - -
lang->graph['visitors_last30days_headline']; ?>:lang->graph['visitors_last24months_headline']; ?>:
chart_evolutionVisitsSummaryDay; ?>chart_evolutionVisitsSummaryMonth; ?>
+ + +
+ lang->graph['visitors_last30days_headline'], $this->piwik_period); ?>:
+ chart_evolutionVisitsSummaryDay; ?> +
+ +
+ lang->graph['visitors_last24months_headline']; ?>:
+ chart_evolutionVisitsSummaryMonth; ?> +

- - - - - - - - - -
lang->graph['visitors_visitsPerServerTime_headline']; ?>:lang->graph['visitors_visitTimeByDayOfWeek_headline']; ?>:
chart_verticalBarVisitsPerServerTime; ?>chart_verticalBarVisitTimeByDayOfWeek; ?>
+
+ lang->graph['visitors_visitsPerServerTime_headline']; ?>:
+ chart_verticalBarVisitsPerServerTime; ?> +
+ +
+ lang->graph['visitors_visitTimeByDayOfWeek_headline']; ?>:
+ chart_verticalBarVisitTimeByDayOfWeek; ?> +
+ + +
+ +
+ lang->graph['visitors_userBrowser_headline']; ?>:
+ chart_horizontalBarUserBrowser; ?> +
+ +
+ lang->graph['visitors_userCountry_headline']; ?>:
+ chart_horizontalBarUserCountry; ?> +
- - - - - - - - - -
lang->graph['visitors_userBrowser_headline']; ?>:lang->graph['visitors_userCountry_headline']; ?>:
chart_horizontalBarUserBrowser; ?>chart_horizontalBarUserCountry; ?>

diff --git a/templates/be_piwikcharts.tpl b/templates/be_piwikcharts.tpl index 202b3d5..b9eafcf 100644 --- a/templates/be_piwikcharts.tpl +++ b/templates/be_piwikcharts.tpl @@ -51,42 +51,45 @@
- - - - - - - - - -
lang->graph['visitors_last30days_headline']; ?>:lang->graph['visitors_last24months_headline']; ?>:
chart_evolutionVisitsSummaryDay; ?>chart_evolutionVisitsSummaryMonth; ?>
+ + +
+ lang->graph['visitors_last30days_headline'], $this->piwik_period); ?>:
+ chart_evolutionVisitsSummaryDay; ?> +
+ +
+ lang->graph['visitors_last24months_headline']; ?>:
+ chart_evolutionVisitsSummaryMonth; ?> +

- - - - - - - - - -
lang->graph['visitors_visitsPerServerTime_headline']; ?>:lang->graph['visitors_visitTimeByDayOfWeek_headline']; ?>:
chart_verticalBarVisitsPerServerTime; ?>chart_verticalBarVisitTimeByDayOfWeek; ?>
+
+ lang->graph['visitors_visitsPerServerTime_headline']; ?>:
+ chart_verticalBarVisitsPerServerTime; ?> +
+ +
+ lang->graph['visitors_visitTimeByDayOfWeek_headline']; ?>:
+ chart_verticalBarVisitTimeByDayOfWeek; ?> +
+ + +
+ +
+ lang->graph['visitors_userBrowser_headline']; ?>:
+ chart_horizontalBarUserBrowser; ?> +
+ +
+ lang->graph['visitors_userCountry_headline']; ?>:
+ chart_horizontalBarUserCountry; ?> +
- - - - - - - - - -
lang->graph['visitors_userBrowser_headline']; ?>:lang->graph['visitors_userCountry_headline']; ?>:
chart_horizontalBarUserBrowser; ?>chart_horizontalBarUserCountry; ?>

diff --git a/templates/be_piwikcharts_welcome.html5 b/templates/be_piwikcharts_welcome.html5 index b9e9c60..033ad6e 100644 --- a/templates/be_piwikcharts_welcome.html5 +++ b/templates/be_piwikcharts_welcome.html5 @@ -6,17 +6,30 @@ if ($this->errorMessage) { }else{ ?> -
+
+ showOptOut): ?> + + + update && $this->showUpdate): ?> + + + moreLinkAccess): ?> + + + +
+ +
chart_evolutionVisitsSummaryDay; ?>
-
+
chart_evolutionVisitsSummaryMonth; ?> -
- - +
- +
@@ -32,22 +45,7 @@ if ($this->errorMessage) {
lang->live['headline']; ?>
-
- -
- showOptOut): ?> - - - update && $this->showUpdate): ?> - - - moreLinkAccess): ?> - - - -
+
diff --git a/templates/be_piwikcharts_welcome.tpl b/templates/be_piwikcharts_welcome.tpl index b9e9c60..033ad6e 100644 --- a/templates/be_piwikcharts_welcome.tpl +++ b/templates/be_piwikcharts_welcome.tpl @@ -6,17 +6,30 @@ if ($this->errorMessage) { }else{ ?> -
+
+ showOptOut): ?> + + + update && $this->showUpdate): ?> + + + moreLinkAccess): ?> + + + +
+ +
chart_evolutionVisitsSummaryDay; ?>
-
+
chart_evolutionVisitsSummaryMonth; ?> -
- - +
- +
@@ -32,22 +45,7 @@ if ($this->errorMessage) {
lang->live['headline']; ?>
-
- -
- showOptOut): ?> - - - update && $this->showUpdate): ?> - - - moreLinkAccess): ?> - - - -
+