本文整理汇总了PHP中Piwik::getJavascriptCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::getJavascriptCode方法的具体用法?PHP Piwik::getJavascriptCode怎么用?PHP Piwik::getJavascriptCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::getJavascriptCode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayJavascriptCode
function displayJavascriptCode()
{
$idSite = Piwik_Common::getRequestVar('idsite', 1);
Piwik::checkUserHasViewAccess($idSite);
$jsTag = Piwik::getJavascriptCode($idSite, Piwik_Url::getCurrentUrlWithoutFileName());
$view = new Piwik_View('SitesManager/templates/DisplayJavascriptCode.tpl');
$view->menu = Piwik_GetAdminMenu();
$view->jsTag = $jsTag;
echo $view->render();
}
示例2: displayJavascriptCode
function displayJavascriptCode()
{
$idSite = Piwik_Common::getRequestVar('idsite', 1);
Piwik::checkUserHasViewAccess($idSite);
$jsTag = Piwik::getJavascriptCode($idSite, Piwik_Url::getCurrentUrlWithoutFileName());
$view = Piwik_View::factory('DisplayJavascriptCode');
$this->setGeneralVariablesView($view);
$view->menu = Piwik_GetAdminMenu();
$view->jsTag = $jsTag;
echo $view->render();
}
示例3: getJavascriptTag
/**
* Returns the javascript tag for the given idSite.
* This tag must be included on every page to be tracked by Piwik
*
* @param int $idSite
* @param string $customTitle Custom title given to the pageview
* @return string The Javascript tag ready to be included on the HTML pages
*/
public function getJavascriptTag($idSite, $piwikUrl = '')
{
Piwik::checkUserHasViewAccess($idSite);
if (empty($piwikUrl)) {
$piwikUrl = Piwik_Url::getCurrentUrlWithoutFileName();
}
$piwikUrl = Piwik_Common::sanitizeInputValues($piwikUrl);
$htmlEncoded = Piwik::getJavascriptCode($idSite, $piwikUrl);
$htmlEncoded = str_replace(array('<br>', '<br />', '<br/>'), '', $htmlEncoded);
return $htmlEncoded;
}
示例4: getJavascriptTag
/**
* Returns the javascript tag for the given idSite.
* This tag must be included on every page to be tracked by Piwik
*
* @param int $idSite
* @return string The Javascript tag ready to be included on the HTML pages
*/
public static function getJavascriptTag($idSite, $piwikUrl = '', $actionName = '')
{
Piwik::checkUserHasViewAccess($idSite);
$actionName = "'" . addslashes(Piwik_Common::sanitizeInputValues($actionName)) . "'";
if (empty($piwikUrl)) {
$piwikUrl = Piwik_Url::getCurrentUrlWithoutFileName();
}
$piwikUrl = addslashes(Piwik_Common::sanitizeInputValues($piwikUrl));
$htmlEncoded = Piwik::getJavascriptCode($idSite, $piwikUrl, $actionName);
$htmlEncoded = str_replace(array('<br>', '<br />', '<br/>'), '', $htmlEncoded);
return html_entity_decode($htmlEncoded);
}
示例5: displayJavascriptCode
/**
* Displays the admin UI page showing all tracking tags
* @return unknown_type
*/
function displayJavascriptCode()
{
$idSite = Piwik_Common::getRequestVar('idSite');
Piwik::checkUserHasViewAccess($idSite);
$jsTag = Piwik::getJavascriptCode($idSite, Piwik_Url::getCurrentUrlWithoutFileName());
$view = Piwik_View::factory('Tracking');
$this->setBasicVariablesView($view);
$view->menu = Piwik_GetAdminMenu();
$view->idSite = $idSite;
$site = new Piwik_Site($idSite);
$view->displaySiteName = $site->getName();
$view->jsTag = $jsTag;
echo $view->render();
}
示例6: displayJavascriptCode
/**
* Installation Step 8: Display JavaScript tracking code
*/
public function displayJavascriptCode()
{
$this->checkPreviousStepIsValid( __FUNCTION__ );
$view = new Piwik_Installation_View(
$this->pathView . 'displayJavascriptCode.tpl',
$this->getInstallationSteps(),
__FUNCTION__
);
$this->skipThisStep( __FUNCTION__ );
if( !isset($this->session->firstWebsiteSetupSuccessMessage))
{
$view->displayfirstWebsiteSetupSuccess = true;
$this->session->firstWebsiteSetupSuccessMessage = true;
}
$siteName = $this->session->site_name;
$idSite = $this->session->site_idSite;
// Load the Tracking code and help text from the SitesManager
$viewTrackingHelp = new Piwik_View('SitesManager/templates/DisplayJavascriptCode.tpl');
$viewTrackingHelp->displaySiteName = $siteName;
$viewTrackingHelp->jsTag = Piwik::getJavascriptCode($idSite, Piwik_Url::getCurrentUrlWithoutFileName());
$viewTrackingHelp->idSite = $idSite;
// Assign the html output to a smarty variable
$view->trackingHelp = $viewTrackingHelp->render();
$view->displaySiteName = urldecode($siteName);
$view->showNextStep = true;
$this->session->currentStepDone = __FUNCTION__;
echo $view->render();
}