本文整理匯總了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();
}