本文整理汇总了PHP中CRM_Core_Page_AJAX::setJsHeaders方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Page_AJAX::setJsHeaders方法的具体用法?PHP CRM_Core_Page_AJAX::setJsHeaders怎么用?PHP CRM_Core_Page_AJAX::setJsHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Page_AJAX
的用法示例。
在下文中一共展示了CRM_Core_Page_AJAX::setJsHeaders方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNavigationMenu
/**
* CRM-12337 Output navigation menu as executable javascript
* @see smarty_function_crmNavigationMenu
*/
public static function getNavigationMenu()
{
$contactID = CRM_Core_Session::singleton()->get('userID');
if ($contactID) {
CRM_Core_Page_AJAX::setJsHeaders();
print CRM_Core_Smarty::singleton()->fetchWith('CRM/common/navigation.js.tpl', array('navigation' => CRM_Core_BAO_Navigation::createNavigation($contactID)));
}
CRM_Utils_System::civiExit();
}
示例2: getNavigationMenu
/**
* CRM-12337 Output navigation menu as executable javascript.
*
* @see smarty_function_crmNavigationMenu
*/
public static function getNavigationMenu()
{
$contactID = CRM_Core_Session::singleton()->get('userID');
if ($contactID) {
CRM_Core_Page_AJAX::setJsHeaders();
$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('includeEmail', civicrm_api3('setting', 'getvalue', array('name' => 'includeEmailInName', 'group' => 'Search Preferences')));
print $smarty->fetchWith('CRM/common/navigation.js.tpl', array('navigation' => CRM_Core_BAO_Navigation::createNavigation($contactID)));
}
CRM_Utils_System::civiExit();
}
示例3: outputLocalizationJS
/**
* Create dynamic script for localizing js widgets.
*/
public static function outputLocalizationJS()
{
CRM_Core_Page_AJAX::setJsHeaders();
$config = CRM_Core_Config::singleton();
$vars = array('moneyFormat' => json_encode(CRM_Utils_Money::format(1234.56)), 'contactSearch' => json_encode($config->includeEmailInName ? ts('Start typing a name or email...') : ts('Start typing a name...')), 'otherSearch' => json_encode(ts('Enter search term...')), 'entityRef' => array('contactCreate' => CRM_Core_BAO_UFGroup::getCreateLinks(), 'filters' => self::getEntityRefFilters()), 'ajaxPopupsEnabled' => self::singleton()->ajaxPopupsEnabled);
print CRM_Core_Smarty::singleton()->fetchWith('CRM/common/l10n.js.tpl', $vars);
CRM_Utils_System::civiExit();
}
示例4: json_encode
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*/
require_once '../civicrm.config.php';
require_once 'CRM/Core/Config.php';
$config = CRM_Core_Config::singleton();
$template = CRM_Core_Smarty::singleton();
require_once 'CRM/Utils/Request.php';
$cpageId = CRM_Utils_Request::retrieve('cpageId', 'Positive', CRM_Core_DAO::$_nullObject);
$widgetId = CRM_Utils_Request::retrieve('widgetId', 'Positive', CRM_Core_DAO::$_nullObject);
$format = CRM_Utils_Request::retrieve('format', 'Positive', CRM_Core_DAO::$_nullObject);
$includePending = CRM_Utils_Request::retrieve('includePending', 'Boolean', CRM_Core_DAO::$_nullObject);
require_once 'CRM/Contribute/BAO/Widget.php';
$jsonvar = 'jsondata';
if (isset($format)) {
$jsonvar .= $cpageId;
}
$data = CRM_Contribute_BAO_Widget::getContributionPageData($cpageId, $widgetId, $includePending);
$output = '
var ' . $jsonvar . ' = ' . json_encode($data) . ';
';
CRM_Core_Page_AJAX::setJsHeaders(60);
echo $output;
CRM_Utils_System::civiExit();