当前位置: 首页>>代码示例>>PHP>>正文


PHP Piwik::getCurrentUserEmail方法代码示例

本文整理汇总了PHP中Piwik::getCurrentUserEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::getCurrentUserEmail方法的具体用法?PHP Piwik::getCurrentUserEmail怎么用?PHP Piwik::getCurrentUserEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik的用法示例。


在下文中一共展示了Piwik::getCurrentUserEmail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     Piwik::checkUserIsNotAnonymous();
     $view = Piwik_View::factory('index');
     $this->setGeneralVariablesView($view);
     $view->currentUserEmail = Piwik::getCurrentUserEmail();
     $availableReports = Piwik_API_API::getInstance()->getReportMetadata($this->idSite);
     $reportsByCategory = array();
     foreach ($availableReports as $report) {
         $reportsByCategory[$report['category']][] = $report;
     }
     unset($reportsByCategory['API']);
     $reports = Piwik_PDFReports_API::getInstance()->getReports($this->idSite, $period = false, $idReport = false, $ifSuperUserReturnOnlySuperUserReports = true);
     $reportsById = array();
     foreach ($reports as &$report) {
         $report['additional_emails'] = str_replace(',', "\n", $report['additional_emails']);
         $report['reports'] = explode(',', str_replace('.', '_', $report['reports']));
         $reportsById[$report['idreport']] = $report;
     }
     $view->downloadOutputType = Piwik_PDFReports_API::OUTPUT_DOWNLOAD;
     $columnsCount = 2;
     $view->newColumnAfter = ceil(count($reportsByCategory) / $columnsCount);
     $view->reportsByCategory = $reportsByCategory;
     $view->reportsJSON = Piwik_Common::json_encode($reportsById);
     $view->periods = array_merge(array('never' => Piwik_Translate('General_Never')), Piwik_PDFReports_API::getPeriodToFrequency());
     $view->defaultFormat = Piwik_PDFReports::DEFAULT_FORMAT;
     $view->formats = Piwik_ReportRenderer::$availableReportRenderers;
     $view->aggregateReportsFormats = Piwik_PDFReports_API::getAggregateReportsFormats();
     $view->reports = $reports;
     $view->language = Piwik_LanguagesManager::getLanguageCodeForCurrentUser();
     echo $view->render();
 }
开发者ID:neolf,项目名称:PIWIK4MOBILE,代码行数:32,代码来源:Controller.php

示例2: sendEmailReport

 public function sendEmailReport($idReport, $idSite, $period = false, $date = false)
 {
     Piwik::checkUserIsNotAnonymous();
     $reports = $this->getReports($idSite, false, $idReport);
     $report = reset($reports);
     if ($report['period'] == 'never') {
         $report['period'] = 'day';
     }
     if (!empty($period)) {
         $report['period'] = $period;
     }
     if (empty($date)) {
         $date = Piwik_Date::now()->subPeriod(1, $report['period'])->toString();
     }
     // Get user emails and languages
     $emails = self::getEmailsFromString($report['additional_emails']);
     if ($report['email_me'] == 1) {
         if (Piwik::getCurrentUserLogin() == $report['login']) {
             $emails[] = Piwik::getCurrentUserEmail();
         } elseif ($report['login'] == Piwik_Config::getInstance()->superuser['login']) {
             $emails[] = Piwik::getSuperUserEmail();
         } else {
             try {
                 $user = Piwik_UsersManager_API::getInstance()->getUser($report['login']);
             } catch (Exception $e) {
                 return;
             }
             $emails[] = $user['email'];
         }
     }
     $language = Piwik_LanguagesManager_API::getInstance()->getLanguageForUser($report['login']);
     list($outputFilename, $prettyDate, $websiteName, $reportFormat, $additionalFiles) = $this->generateReport($idReport, $date, $idSite, $language, self::OUTPUT_SAVE_ON_DISK, $report['period']);
     $this->sendReportEmail($emails, $outputFilename, $prettyDate, $websiteName, $report, $reportFormat, $additionalFiles);
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:34,代码来源:API.php

示例3: template_reportParametersPDFReports

 /**
  * @param Piwik_Event_Notification $notification notification object
  */
 public static function template_reportParametersPDFReports($notification)
 {
     $out =& $notification->getNotificationObject();
     $view = Piwik_View::factory('report_parameters');
     $view->currentUserEmail = Piwik::getCurrentUserEmail();
     $view->displayFormats = self::getDisplayFormats();
     $view->reportType = self::EMAIL_TYPE;
     $view->defaultDisplayFormat = self::DEFAULT_DISPLAY_FORMAT;
     $view->defaultEmailMe = self::EMAIL_ME_PARAMETER_DEFAULT_VALUE;
     $out .= $view->render();
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:14,代码来源:PDFReports.php

示例4: sendEmailReport

 public function sendEmailReport($idReport, $idSite)
 {
     $reports = $this->getReports($idSite, $period = false, $idReport);
     $report = reset($reports);
     if ($report['period'] == 'never') {
         $report['period'] = 'day';
     }
     // Get user emails and languages
     $emails = self::getEmailsFromString($report['additional_emails']);
     if ($report['email_me'] == 1) {
         if (Piwik::getCurrentUserLogin() == $report['login']) {
             $emails[] = Piwik::getCurrentUserEmail();
         } elseif ($report['login'] == Zend_Registry::get('config')->superuser->login) {
             $emails[] = Zend_Registry::get('config')->superuser->email;
         } else {
             try {
                 $user = Piwik_UsersManager_API::getInstance()->getUser($report['login']);
             } catch (Exception $e) {
                 return;
             }
             $emails[] = $user['email'];
         }
     }
     $language = Piwik_LanguagesManager_API::getInstance()->getLanguageForUser($report['login']);
     list($outputFilename, $prettyDate, $websiteName) = $this->generateReport($idReport, Piwik_Date::now()->subPeriod(1, $report['period'])->toString(), $idSite, $language, $outputType = Piwik_PDFReports_API::OUTPUT_PDF_SAVE_ON_DISK);
     $this->sendReportEmailPdfAttached($emails, $outputFilename, $prettyDate, $websiteName, $report);
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:27,代码来源:API.php


注:本文中的Piwik::getCurrentUserEmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。