當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik::getJavascriptCode方法代碼示例

本文整理匯總了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();
 }
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:10,代碼來源:Controller.php

示例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();
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:11,代碼來源:Controller.php

示例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;
 }
開發者ID:0h546f6f78696342756e4e59,項目名稱:piwik,代碼行數:19,代碼來源:API.php

示例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);
 }
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:19,代碼來源:API.php

示例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();
 }
開發者ID:Gninety,項目名稱:Microweber,代碼行數:18,代碼來源:Controller.php

示例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();
	}
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:37,代碼來源:Controller.php


注:本文中的Piwik::getJavascriptCode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。