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


PHP Url::getCurrentQueryStringWithParametersModified方法代码示例

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


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

示例1: getInformation

 public function getInformation()
 {
     $suffix = ' Debug: <a href="' . Url::getCurrentQueryStringWithParametersModified(array('module' => 'ImageGraph', 'action' => 'index')) . '">All images</a>';
     $info = parent::getInformation();
     $info['description'] .= ' ' . $suffix;
     return $info;
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:7,代码来源:ImageGraph.php

示例2: addReport

 /**
  * Adds a report to the list of reports to display.
  *
  * @param string $category The report's category. Can be a i18n token.
  * @param string $title The report's title. Can be a i18n token.
  * @param string $action The controller action used to load the report, ie, Referrers.getAll
  * @param array $params The list of query parameters to use when loading the report.
  *                      This list overrides query parameters currently in use. For example,
  *                        array('idSite' => 2, 'viewDataTable' => 'goalsTable')
  *                      would mean the goals report for site w/ ID=2 will always be loaded.
  */
 public function addReport($category, $title, $action, $params = array())
 {
     list($module, $action) = explode('.', $action);
     $params = array('module' => $module, 'action' => $action) + $params;
     $categories = $this->dimensionCategories;
     $categories[$category][] = array('title' => $title, 'params' => $params, 'url' => Url::getCurrentQueryStringWithParametersModified($params));
     $this->dimensionCategories = $categories;
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:19,代码来源:ReportsByDimension.php

示例3: testAllMethods

 /**
  * @group Core
  */
 public function testAllMethods()
 {
     $this->assertEquals(Url::getCurrentQueryStringWithParametersModified(array()), Url::getCurrentQueryString());
     $this->assertEquals(Url::getCurrentUrl(), Url::getCurrentUrlWithoutQueryString());
     $this->assertEquals(Url::getCurrentUrl(), Url::getCurrentScheme() . '://' . Url::getCurrentHost() . Url::getCurrentScriptName());
     $_SERVER['QUERY_STRING'] = 'q=test';
     $parameters = array_keys(Url::getArrayFromCurrentQueryString());
     $parametersNameToValue = array();
     foreach ($parameters as $name) {
         $parametersNameToValue[$name] = null;
     }
     $this->assertEquals('', Url::getCurrentQueryStringWithParametersModified($parametersNameToValue));
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:16,代码来源:UrlTest.php

示例4: notifyAnyInvalidPlugin

 private static function notifyAnyInvalidPlugin()
 {
     $missingPlugins = \Piwik\Plugin\Manager::getInstance()->getMissingPlugins();
     if (empty($missingPlugins)) {
         return;
     }
     if (!Piwik::hasUserSuperUserAccess()) {
         return;
     }
     $pluginsLink = Url::getCurrentQueryStringWithParametersModified(array('module' => 'CorePluginsAdmin', 'action' => 'plugins'));
     $invalidPluginsWarning = Piwik::translate('CoreAdminHome_InvalidPluginsWarning', array(self::getPiwikVersion(), '<strong>' . implode('</strong>,&nbsp;<strong>', $missingPlugins) . '</strong>')) . "<br/>" . Piwik::translate('CoreAdminHome_InvalidPluginsYouCanUninstall', array('<a href="' . $pluginsLink . '"/>', '</a>'));
     $notification = new Notification($invalidPluginsWarning);
     $notification->raw = true;
     $notification->context = Notification::CONTEXT_WARNING;
     $notification->title = Piwik::translate('General_Warning');
     Notification\Manager::notify('ControllerAdmin_InvalidPluginsWarning', $notification);
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:17,代码来源:ControllerAdmin.php

示例5: checkIfNoDataForGeoIpReport

 /**
  * Checks if a datatable for a view is empty and if so, displays a message in the footer
  * telling users to configure GeoIP.
  */
 protected function checkIfNoDataForGeoIpReport(ViewDataTable $view)
 {
     $view->config->filters[] = function ($dataTable) use($view) {
         // if there's only one row whose label is 'Unknown', display a message saying there's no data
         if ($dataTable->getRowsCount() == 1 && $dataTable->getFirstRow()->getColumn('label') == Piwik::translate('General_Unknown')) {
             $footerMessage = Piwik::translate('UserCountry_NoDataForGeoIPReport1');
             $userCountry = new UserCountry();
             // if GeoIP is working, don't display this part of the message
             if (!$userCountry->isGeoIPWorking()) {
                 $params = array('module' => 'UserCountry', 'action' => 'adminIndex');
                 $footerMessage .= ' ' . Piwik::translate('UserCountry_NoDataForGeoIPReport2', array('<a target="_blank" href="' . Url::getCurrentQueryStringWithParametersModified($params) . '">', '</a>', '<a target="_blank" href="http://dev.maxmind.com/geoip/geolite?rId=piwik">', '</a>'));
             } else {
                 $footerMessage .= ' ' . Piwik::translate('UserCountry_ToGeolocateOldVisits', array('<a target="_blank" href="http://piwik.org/faq/how-to/#faq_167">', '</a>'));
             }
             $view->config->show_footer_message = $footerMessage;
         }
     };
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:22,代码来源:Base.php

示例6: addFilter_urlRewriteWithParameters

 protected function addFilter_urlRewriteWithParameters()
 {
     $urlRewriteFilter = new Twig_SimpleFilter('urlRewriteWithParameters', function ($parameters) {
         $parameters['updated'] = null;
         $url = Url::getCurrentQueryStringWithParametersModified($parameters);
         return $url;
     });
     $this->twig->addFilter($urlRewriteFilter);
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:9,代码来源:Twig.php

示例7: getOptOutView

 /**
  * @return View
  * @throws \Exception
  */
 public function getOptOutView()
 {
     if ($this->view) {
         return $this->view;
     }
     $trackVisits = !IgnoreCookie::isIgnoreCookieFound();
     $dntFound = $this->getDoNotTrackHeaderChecker()->isDoNotTrackFound();
     $setCookieInNewWindow = Common::getRequestVar('setCookieInNewWindow', false, 'int');
     if ($setCookieInNewWindow) {
         $reloadUrl = Url::getCurrentQueryStringWithParametersModified(array('showConfirmOnly' => 1, 'setCookieInNewWindow' => 0));
     } else {
         $reloadUrl = false;
         $nonce = Common::getRequestVar('nonce', false);
         if ($nonce !== false && Nonce::verifyNonce('Piwik_OptOut', $nonce)) {
             Nonce::discardNonce('Piwik_OptOut');
             IgnoreCookie::setIgnoreCookie();
             $trackVisits = !$trackVisits;
         }
     }
     $language = Common::getRequestVar('language', '');
     $lang = APILanguagesManager::getInstance()->isLanguageAvailable($language) ? $language : LanguagesManager::getLanguageCodeForCurrentUser();
     $this->addQueryParameters(array('module' => 'CoreAdminHome', 'action' => 'optOut', 'language' => $lang, 'setCookieInNewWindow' => 1), false);
     $this->view = new View("@CoreAdminHome/optOut");
     $this->view->setXFrameOptions('allow');
     $this->view->dntFound = $dntFound;
     $this->view->trackVisits = $trackVisits;
     $this->view->nonce = Nonce::getNonce('Piwik_OptOut', 3600);
     $this->view->language = $lang;
     $this->view->showConfirmOnly = Common::getRequestVar('showConfirmOnly', false, 'int');
     $this->view->reloadUrl = $reloadUrl;
     $this->view->javascripts = $this->getJavascripts();
     $this->view->stylesheets = $this->getStylesheets();
     $this->view->title = $this->getTitle();
     $this->view->queryParameters = $this->getQueryParameters();
     return $this->view;
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:40,代码来源:OptOutManager.php

示例8: getCurrentUrlWithoutGenericFilters

 /**
  * Returns the current URL without generic filter query parameters.
  *
  * @param array $params Query parameter values to override in the new URL.
  * @return string
  */
 public static function getCurrentUrlWithoutGenericFilters($params)
 {
     // unset all filter query params so the related report will show up in its default state,
     // unless the filter param was in $queryParams
     $genericFiltersInfo = DataTableGenericFilter::getGenericFiltersInformation();
     foreach ($genericFiltersInfo as $filter) {
         foreach ($filter[1] as $queryParamName => $queryParamInfo) {
             if (!isset($params[$queryParamName])) {
                 $params[$queryParamName] = null;
             }
         }
     }
     return Url::getCurrentQueryStringWithParametersModified($params);
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:20,代码来源:Request.php

示例9: redirectToModule

 /**
  * Redirects the current request to a new module and action.
  *
  * @param string $newModule The target module, eg, `'UserCountry'`.
  * @param string $newAction The target controller action, eg, `'index'`.
  * @param array $parameters The query parameter values to modify before redirecting.
  * @api
  */
 public static function redirectToModule($newModule, $newAction = '', $parameters = array())
 {
     $newUrl = 'index.php' . Url::getCurrentQueryStringWithParametersModified(array('module' => $newModule, 'action' => $newAction) + $parameters);
     Url::redirectToUrl($newUrl);
 }
开发者ID:GovanifY,项目名称:piwik,代码行数:13,代码来源:Piwik.php

示例10: getUserCountryMapUrlForVisitorProfile

 private function getUserCountryMapUrlForVisitorProfile()
 {
     $params = array('module' => 'UserCountryMap', 'action' => 'realtimeMap', 'segment' => self::getSegmentWithVisitorId(), 'visitorId' => false, 'changeVisitAlpha' => 0, 'removeOldVisits' => 0, 'realtimeWindow' => 'false', 'showFooterMessage' => 0, 'showDateTime' => 0, 'doNotRefreshVisits' => 1);
     return Url::getCurrentQueryStringWithParametersModified($params);
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:5,代码来源:Controller.php

示例11: getUrlSparkline

 /**
  * Returns a URL to a sparkline image for a report served by the current plugin.
  *
  * The result of this URL should be used with the [sparkline()](/api-reference/Piwik/View#twig) twig function.
  *
  * The current site ID and period will be used.
  *
  * @param array $customParameters The array of query parameter name/value pairs that
  *                                should be set in result URL.
  * @return string The generated URL.
  */
 private function getUrlSparkline($customParameters = array())
 {
     $customParameters['viewDataTable'] = 'sparkline';
     $params = $this->getGraphParamsModified($customParameters);
     // convert array values to comma separated
     foreach ($params as &$value) {
         if (is_array($value)) {
             $value = rawurlencode(implode(',', $value));
         }
     }
     $url = Url::getCurrentQueryStringWithParametersModified($params);
     return $url;
 }
开发者ID:piwik,项目名称:piwik,代码行数:24,代码来源:Config.php

示例12: activate

 public function activate($redirectAfter = true)
 {
     $pluginName = $this->initPluginModification(static::ACTIVATE_NONCE);
     $this->dieIfPluginsAdminIsDisabled();
     $this->pluginManager->activatePlugin($pluginName);
     if ($redirectAfter) {
         $message = $this->translator->translate('CorePluginsAdmin_SuccessfullyActicated', array($pluginName));
         if ($this->settingsProvider->getSystemSettings($pluginName)) {
             $target = sprintf('<a href="index.php%s#%s">', Url::getCurrentQueryStringWithParametersModified(array('module' => 'CoreAdminHome', 'action' => 'generalSettings')), $pluginName);
             $message .= ' ' . $this->translator->translate('CorePluginsAdmin_ChangeSettingsPossible', array($target, '</a>'));
         }
         $notification = new Notification($message);
         $notification->raw = true;
         $notification->title = $this->translator->translate('General_WellDone');
         $notification->context = Notification::CONTEXT_SUCCESS;
         Notification\Manager::notify('CorePluginsAdmin_PluginActivated', $notification);
         $redirectTo = Common::getRequestVar('redirectTo', '', 'string');
         if (!empty($redirectTo) && $redirectTo === 'marketplace') {
             $this->redirectToIndex('Marketplace', 'overview');
         } elseif (!empty($redirectTo) && $redirectTo === 'referrer') {
             $this->redirectAfterModification($redirectAfter);
         } else {
             $plugin = $this->pluginManager->loadPlugin($pluginName);
             $actionToRedirect = 'plugins';
             if ($plugin->isTheme()) {
                 $actionToRedirect = 'themes';
             }
             $this->redirectToIndex('CorePluginsAdmin', $actionToRedirect);
         }
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:31,代码来源:Controller.php

示例13: getSubscritionSummaryMessage

 private function getSubscritionSummaryMessage()
 {
     $url = Url::getCurrentQueryStringWithParametersModified(array('module' => 'Marketplace', 'action' => 'subscriptionOverview'));
     $link = '<a href="' . $url . '">';
     return "<br/>" . $this->translator->translate('Marketplace_ViewSubscriptionsSummary', array($link, '</a>'));
 }
开发者ID:piwik,项目名称:piwik,代码行数:6,代码来源:InvalidLicenses.php

示例14: configureView

 public function configureView(ViewDataTable $view)
 {
     $idGoal = Common::getRequestVar('idGoal', 0, 'string');
     $idSite = $this->getIdSite();
     if ($view->isViewDataTableId(Sparklines::ID)) {
         /** @var Sparklines $view */
         $isEcommerceEnabled = $this->isEcommerceEnabled($idSite);
         $onlySummary = Common::getRequestVar('only_summary', 0, 'int');
         if ($onlySummary && !empty($idGoal)) {
             if (is_numeric($idGoal)) {
                 $view->config->title_attributes = array('piwik-goal-page-link' => $idGoal);
             }
             // in Goals overview summary we show proper title for a goal
             $goal = $this->getGoal($idGoal);
             if (!empty($goal['name'])) {
                 $view->config->title = Piwik::translate('Goals_GoalX', "'" . $goal['name'] . "'");
             }
         } else {
             $view->config->title = '';
         }
         $numberFormatter = NumberFormatter::getInstance();
         $view->config->filters[] = function (DataTable $table) use($numberFormatter, $idSite) {
             $firstRow = $table->getFirstRow();
             if ($firstRow) {
                 $revenue = $firstRow->getColumn('revenue');
                 $currencySymbol = Site::getCurrencySymbolFor($idSite);
                 $revenue = $numberFormatter->formatCurrency($revenue, $currencySymbol, GoalManager::REVENUE_PRECISION);
                 $firstRow->setColumn('revenue', $revenue);
                 $conversionRate = $firstRow->getColumn('conversion_rate');
                 if (false !== $conversionRate) {
                     $firstRow->setColumn('conversion_rate', $numberFormatter->formatPercent($conversionRate, $precision = 1));
                 }
                 $conversions = $firstRow->getColumn('nb_conversions');
                 if (false !== $conversions) {
                     $firstRow->setColumn('nb_conversions', $numberFormatter->formatNumber($conversions));
                 }
                 $visitsConverted = $firstRow->getColumn('nb_visits_converted');
                 if (false !== $visitsConverted) {
                     $firstRow->setColumn('nb_visits_converted', $numberFormatter->formatNumber($visitsConverted));
                 }
             }
         };
         $view->config->addTranslations(array('nb_visits' => Piwik::translate('VisitsSummary_NbVisitsDescription'), 'nb_conversions' => Piwik::translate('Goals_ConversionsDescription'), 'nb_visits_converted' => Piwik::translate('General_NVisits'), 'conversion_rate' => Piwik::translate('Goals_OverallConversionRate'), 'revenue' => Piwik::translate('Goals_OverallRevenue')));
         $allowMultiple = Common::getRequestVar('allow_multiple', 0, 'int');
         if ($allowMultiple) {
             $view->config->addSparklineMetric(array('nb_conversions', 'nb_visits_converted'), $order = 10);
         } else {
             $view->config->addSparklineMetric(array('nb_conversions'), $order = 10);
         }
         $view->config->addSparklineMetric(array('conversion_rate'), $order = 20);
         if (empty($idGoal)) {
             // goals overview sparklines below evolution graph
             if ($isEcommerceEnabled) {
                 // this would be ideally done in Ecommerce plugin but then it is hard to keep same order
                 $view->config->addSparklineMetric(array('revenue'), $order = 30);
             }
         } else {
             if ($onlySummary) {
                 // in Goals Overview we list an overview for each goal....
                 $view->config->addTranslation('conversion_rate', Piwik::translate('Goals_ConversionRate'));
             } elseif ($isEcommerceEnabled) {
                 // in Goals detail page...
                 $view->config->addSparklineMetric(array('revenue'), $order = 30);
             }
         }
     } else {
         if ($view->isViewDataTableId(Evolution::ID)) {
             if (!empty($idSite) && Piwik::isUserHasAdminAccess($idSite)) {
                 $view->config->title_edit_entity_url = 'index.php' . Url::getCurrentQueryStringWithParametersModified(array('module' => 'Goals', 'action' => 'manage', 'forceView' => null, 'viewDataTable' => null, 'showtitle' => null, 'random' => null));
             }
             $goal = $this->getGoal($idGoal);
             if (!empty($goal['name'])) {
                 $view->config->title = Piwik::translate('Goals_GoalX', "'" . $goal['name'] . "'");
                 if (!empty($goal['description'])) {
                     $view->config->description = $goal['description'];
                 }
             } else {
                 $view->config->title = Piwik::translate('General_EvolutionOverPeriod');
             }
             if (empty($view->config->columns_to_display)) {
                 $view->config->columns_to_display = array('nb_conversions');
             }
         }
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:85,代码来源:Get.php

示例15: setHostValidationVariablesView

    /**
     * Checks if the current host is valid and sets variables on the given view, including:
     *
     * - **isValidHost** - true if host is valid, false if otherwise
     * - **invalidHostMessage** - message to display if host is invalid (only set if host is invalid)
     * - **invalidHost** - the invalid hostname (only set if host is invalid)
     * - **mailLinkStart** - the open tag of a link to email the Super User of this problem (only set
     *                       if host is invalid)
     *
     * @param View $view
     * @api
     */
    public static function setHostValidationVariablesView($view)
    {
        // check if host is valid
        $view->isValidHost = Url::isValidHost();
        if (!$view->isValidHost) {
            // invalid host, so display warning to user
            $validHosts = Url::getTrustedHostsFromConfig();
            $validHost = $validHosts[0];
            $invalidHost = Common::sanitizeInputValue($_SERVER['HTTP_HOST']);
            $emailSubject = rawurlencode(Piwik::translate('CoreHome_InjectedHostEmailSubject', $invalidHost));
            $emailBody = rawurlencode(Piwik::translate('CoreHome_InjectedHostEmailBody'));
            $superUserEmail = implode(',', Piwik::getAllSuperUserAccessEmailAddresses());
            $mailToUrl = "mailto:{$superUserEmail}?subject={$emailSubject}&body={$emailBody}";
            $mailLinkStart = "<a href=\"{$mailToUrl}\">";
            $invalidUrl = Url::getCurrentUrlWithoutQueryString($checkIfTrusted = false);
            $validUrl = Url::getCurrentScheme() . '://' . $validHost . Url::getCurrentScriptName();
            $invalidUrl = Common::sanitizeInputValue($invalidUrl);
            $validUrl = Common::sanitizeInputValue($validUrl);
            $changeTrustedHostsUrl = "index.php" . Url::getCurrentQueryStringWithParametersModified(array('module' => 'CoreAdminHome', 'action' => 'generalSettings')) . "#trustedHostsSection";
            $warningStart = Piwik::translate('CoreHome_InjectedHostWarningIntro', array('<strong>' . $invalidUrl . '</strong>', '<strong>' . $validUrl . '</strong>')) . ' <br/>';
            if (Piwik::hasUserSuperUserAccess()) {
                $view->invalidHostMessage = $warningStart . ' ' . Piwik::translate('CoreHome_InjectedHostSuperUserWarning', array("<a href=\"{$changeTrustedHostsUrl}\">", $invalidHost, '</a>', "<br/><a href=\"{$validUrl}\">", $validHost, '</a>'));
            } else {
                if (Piwik::isUserIsAnonymous()) {
                    $view->invalidHostMessage = $warningStart . ' ' . Piwik::translate('CoreHome_InjectedHostNonSuperUserWarning', array("<br/><a href=\"{$validUrl}\">", '</a>', '<span style="display:none">', '</span>'));
                } else {
                    $view->invalidHostMessage = $warningStart . ' ' . Piwik::translate('CoreHome_InjectedHostNonSuperUserWarning', array("<br/><a href=\"{$validUrl}\">", '</a>', $mailLinkStart, '</a>'));
                }
            }
            $view->invalidHostMessageHowToFix = '<p><b>How do I fix this problem and how do I login again?</b><br/> The Piwik Super User can manually edit the file piwik/config/config.ini.php
						and add the following lines: <pre>[General]' . "\n" . 'trusted_hosts[] = "' . $invalidHost . '"</pre>After making the change, you will be able to login again.</p>
						<p>You may also <i>disable this security feature (not recommended)</i>. To do so edit config/config.ini.php and add:
						<pre>[General]' . "\n" . 'enable_trusted_host_check=0</pre>';
            $view->invalidHost = $invalidHost;
            // for UserSettings warning
            $view->invalidHostMailLinkStart = $mailLinkStart;
        }
    }
开发者ID:brienomatty,项目名称:elmsln,代码行数:50,代码来源:Controller.php


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