本文整理汇总了PHP中Piwik_View::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik_View::factory方法的具体用法?PHP Piwik_View::factory怎么用?PHP Piwik_View::factory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik_View
的用法示例。
在下文中一共展示了Piwik_View::factory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
Piwik::checkUserIsSuperUser();
$plugins = array();
$listPlugins = array_merge(Piwik_PluginsManager::getInstance()->readPluginsDirectory(), Piwik_Config::getInstance()->Plugins['Plugins']);
$listPlugins = array_unique($listPlugins);
foreach ($listPlugins as $pluginName) {
$oPlugin = Piwik_PluginsManager::getInstance()->loadPlugin($pluginName);
$plugins[$pluginName] = array('activated' => Piwik_PluginsManager::getInstance()->isPluginActivated($pluginName), 'alwaysActivated' => Piwik_PluginsManager::getInstance()->isPluginAlwaysActivated($pluginName));
}
Piwik_PluginsManager::getInstance()->loadPluginTranslations();
$loadedPlugins = Piwik_PluginsManager::getInstance()->getLoadedPlugins();
foreach ($loadedPlugins as $oPlugin) {
$pluginName = $oPlugin->getPluginName();
$plugins[$pluginName]['info'] = $oPlugin->getInformation();
}
foreach ($plugins as $pluginName => &$plugin) {
if (!isset($plugin['info'])) {
$plugin['info'] = array('description' => '<strong><em>' . Piwik_Translate('CorePluginsAdmin_PluginCannotBeFound') . '</strong></em>', 'version' => Piwik_Translate('General_Unknown'));
}
}
$view = Piwik_View::factory('manage');
$view->pluginsName = $plugins;
$this->setBasicVariablesView($view);
$view->menu = Piwik_GetAdminMenu();
if (!Piwik_Config::getInstance()->isFileWritable()) {
$view->configFileNotWritable = true;
}
echo $view->render();
}
示例2: index
public function index()
{
$view = Piwik_View::factory('index');
$view->dataTableVisitInformationPerLocalTime = $this->getVisitInformationPerLocalTime(true);
$view->dataTableVisitInformationPerServerTime = $this->getVisitInformationPerServerTime(true);
echo $view->render();
}
示例3: getSearchEnginesAndKeywords
function getSearchEnginesAndKeywords()
{
$view = Piwik_View::factory('searchEngines_Keywords');
$view->searchEngines = $this->getSearchEngines(true);
$view->keywords = $this->getKeywords(true);
echo $view->render();
}
示例4: index
function index()
{
$view = Piwik_View::factory('index');
$view->dataTableNumberOfVisitsPerVisitDuration = $this->getNumberOfVisitsPerVisitDuration(true);
$view->dataTableNumberOfVisitsPerPage = $this->getNumberOfVisitsPerPage(true);
echo $view->render();
}
示例5: index
function index()
{
$view = Piwik_View::factory('structure');
$this->setGeneralVariablesView($view);
$view->visitors = $this->getLastVisits($fetch = true);
echo $view->render();
}
示例6: worldMap
function worldMap()
{
if (!Piwik_PluginsManager::getInstance()->isPluginActivated('UserCountry')) {
return '';
}
$idSite = Piwik_Common::getRequestVar('idSite', 1, 'int');
Piwik::checkUserHasViewAccess($idSite);
$period = Piwik_Common::getRequestVar('period');
$date = Piwik_Common::getRequestVar('date');
$token_auth = Piwik::getCurrentUserTokenAuth();
$view = Piwik_View::factory('worldmap');
$view->dataUrl = "?module=API" . "&method=API.getProcessedReport&format=XML" . "&apiModule=UserCountry&apiAction=getCountry" . "&idSite=" . $idSite . "&period=" . $period . "&date=" . $date . "&token_auth=" . $token_auth . "&segment=" . Piwik_Common::unsanitizeInputValue(Piwik_Common::getRequestVar('segment', '')) . "&filter_limit=-1";
// definition of the color scale
$view->hueMin = 218;
$view->hueMax = 216;
$view->satMin = "0.285";
$view->satMax = "0.9";
$view->lgtMin = ".97";
$view->lgtMax = ".44";
$request = new Piwik_API_Request('method=API.getMetadata&format=PHP' . '&apiModule=UserCountry&apiAction=getCountry' . '&idSite=' . $idSite . '&period=' . $period . '&date=' . $date . '&token_auth=' . $token_auth . '&filter_limit=-1');
$metaData = $request->process();
$metrics = array();
foreach ($metaData[0]['metrics'] as $id => $val) {
if (Piwik_Common::getRequestVar('period') == 'day' || $id != 'nb_uniq_visitors') {
$metrics[] = array($id, $val);
}
}
foreach ($metaData[0]['processedMetrics'] as $id => $val) {
$metrics[] = array($id, $val);
}
$view->metrics = $metrics;
$view->defaultMetric = 'nb_visits';
echo $view->render();
}
示例7: getSparklines
public function getSparklines()
{
$view = Piwik_View::factory('sparklines');
$this->setPeriodVariablesView($view);
$this->setSparklinesAndNumbers($view);
echo $view->render();
}
示例8: index
function index()
{
Piwik::checkUserIsNotAnonymous();
$view = Piwik_View::factory('Settings');
$view->isSuperUser = Piwik::isUserIsSuperUser();
$mobileMessagingAPI = Piwik_MobileMessaging_API::getInstance();
$view->delegatedManagement = $mobileMessagingAPI->getDelegatedManagement();
$view->credentialSupplied = $mobileMessagingAPI->areSMSAPICredentialProvided();
$view->accountManagedByCurrentUser = $view->isSuperUser || $view->delegatedManagement;
$view->strHelpAddPhone = Piwik_Translate('MobileMessaging_Settings_PhoneNumbers_HelpAdd', array(Piwik_Translate('UserSettings_SubmenuSettings'), Piwik_Translate('MobileMessaging_SettingsMenu')));
if ($view->credentialSupplied && $view->accountManagedByCurrentUser) {
$view->provider = $mobileMessagingAPI->getSMSProvider();
$view->creditLeft = $mobileMessagingAPI->getCreditLeft();
}
$view->smsProviders = Piwik_MobileMessaging_SMSProvider::$availableSMSProviders;
// construct the list of countries from the lang files
$countries = array();
foreach (Piwik_Common::getCountriesList() as $countryCode => $continentCode) {
if (isset(Piwik_MobileMessaging_CountryCallingCodes::$countryCallingCodes[$countryCode])) {
$countries[$countryCode] = array('countryName' => Piwik_CountryTranslate($countryCode), 'countryCallingCode' => Piwik_MobileMessaging_CountryCallingCodes::$countryCallingCodes[$countryCode]);
}
}
$view->countries = $countries;
$view->defaultCountry = Piwik_Common::getCountry(Piwik_LanguagesManager::getLanguageCodeForCurrentUser(), true, Piwik_IP::getIpFromHeader());
$view->phoneNumbers = $mobileMessagingAPI->getPhoneNumbers();
$this->setBasicVariablesView($view);
$view->menu = Piwik_GetAdminMenu();
echo $view->render();
}
示例9: sendFeedback
/**
* send email to Piwik team and display nice thanks
*/
function sendFeedback()
{
$email = Piwik_Common::getRequestVar('email', '', 'string');
$body = Piwik_Common::getRequestVar('body', '', 'string');
$category = Piwik_Common::getRequestVar('category', '', 'string');
$nonce = Piwik_Common::getRequestVar('nonce', '', 'string');
$view = Piwik_View::factory('sent');
$view->feedbackEmailAddress = Zend_Registry::get('config')->General->feedback_email_address;
try {
$minimumBodyLength = 35;
if (strlen($body) < $minimumBodyLength) {
throw new Exception(Piwik_TranslateException('Feedback_ExceptionBodyLength', array($minimumBodyLength)));
}
if (!Piwik::isValidEmailString($email)) {
throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidEmail'));
}
if (preg_match('/https?:/i', $body)) {
throw new Exception(Piwik_TranslateException('Feedback_ExceptionNoUrls'));
}
if (!Piwik_Nonce::verifyNonce('Piwik_Feedback.sendFeedback', $nonce)) {
throw new Exception(Piwik_TranslateException('General_ExceptionNonceMismatch'));
}
Piwik_Nonce::discardNonce('Piwik_Feedback.sendFeedback');
$mail = new Piwik_Mail();
$mail->setFrom(Piwik_Common::unsanitizeInputValue($email));
$mail->addTo($view->feedbackEmailAddress, 'Piwik Team');
$mail->setSubject('[ Feedback form - Piwik ] ' . $category);
$mail->setBodyText(Piwik_Common::unsanitizeInputValue($body) . "\n" . 'Piwik ' . Piwik_Version::VERSION . "\n" . 'IP: ' . Piwik_Common::getIpString() . "\n" . 'URL: ' . Piwik_Url::getReferer() . "\n");
@$mail->send();
} catch (Exception $e) {
$view->ErrorString = $e->getMessage();
$view->message = $body;
}
echo $view->render();
}
示例10: 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();
}
示例11: exportImageWindow
/**
* Display the "Export Image" window.
*
* @deprecated 1.5.1
*
* @param string $imageData Base-64 encoded image data (via $_POST)
*/
public static function exportImageWindow()
{
Piwik::checkUserHasSomeViewAccess();
$view = Piwik_View::factory('exportImage');
$view->imageData = 'data:image/png;base64,' . Piwik_Common::getRequestVar('imageData', self::TRANSPARENT_PNG_PIXEL, 'string', $_POST);
echo $view->render();
}
示例12: showLanguagesSelector
/**
* Show styled language selection drop-down list
*
* @param string $url The form action. Default is to save language.
*/
function showLanguagesSelector()
{
$view = Piwik_View::factory("languages");
$view->languages = Piwik_LanguagesManager_API::getAvailableLanguageNames();
$view->currentLanguageCode = self::getLanguageCodeForCurrentUser();
$view->currentLanguageName = self::getLanguageNameForCurrentUser();
echo $view->render();
}
示例13: index
function index()
{
$view = Piwik_View::factory('DBStats');
$view->tablesStatus = Piwik_DBStats_API::getAllTablesStatus();
$this->setGeneralVariablesView($view);
$view->menu = Piwik_GetAdminMenu();
echo $view->render();
}
示例14: getDefaultIndexView
protected function getDefaultIndexView()
{
$view = Piwik_View::factory('index');
$this->setGeneralVariablesView($view);
$view->menu = Piwik_GetMenu();
$view->content = '';
return $view;
}
示例15: index
function index()
{
$view = Piwik_View::factory('index');
$view->urlSparklineCountries = $this->getUrlSparkline('getLastDistinctCountriesGraph');
$view->numberDistinctCountries = $this->getNumberOfDistinctCountries(true);
$view->dataTableCountry = $this->getCountry(true);
$view->dataTableContinent = $this->getContinent(true);
echo $view->render();
}