本文整理匯總了PHP中CRM_Core_BAO_Navigation::createNavigation方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_BAO_Navigation::createNavigation方法的具體用法?PHP CRM_Core_BAO_Navigation::createNavigation怎麽用?PHP CRM_Core_BAO_Navigation::createNavigation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Core_BAO_Navigation
的用法示例。
在下文中一共展示了CRM_Core_BAO_Navigation::createNavigation方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: getNavigationMenu
/**
* CRM-12337 Output navigation menu as executable javascript
* @see smarty_function_crmNavigationMenu
*/
static function getNavigationMenu()
{
$contactID = CRM_Core_Session::singleton()->get('userID');
if ($contactID) {
// Set headers to encourage browsers to cache for a long time
$year = 60 * 60 * 24 * 364;
header('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', time() + $year));
header('Content-Type: application/javascript');
header("Cache-Control: max-age={$year}, public");
print CRM_Core_Smarty::singleton()->fetchWith('CRM/common/navigation.js.tpl', array('navigation' => CRM_Core_BAO_Navigation::createNavigation($contactID)));
}
CRM_Utils_System::civiExit();
}
示例4: smarty_function_crmNavigationMenu
/**
* Generate the nav menu
*
* @param array $params
* - is_default: bool, true if this is normal/default instance of the menu (which may be subject to CIVICRM_DISABLE_DEFAULT_MENU)
* @param object $smarty the Smarty object
*
* @return string HTML
*/
function smarty_function_crmNavigationMenu($params, &$smarty)
{
//check if logged in user has access CiviCRM permission and build menu
$buildNavigation = !CRM_Core_Config::isUpgradeMode() && CRM_Core_Permission::check('access CiviCRM');
if (defined('CIVICRM_DISABLE_DEFAULT_MENU') && CRM_Utils_Array::value('is_default', $params, FALSE)) {
$buildNavigation = FALSE;
}
if ($buildNavigation) {
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if ($contactID) {
$navigation = CRM_Core_BAO_Navigation::createNavigation($contactID);
$smarty->assign('navigation', $navigation);
return $smarty->fetch('CRM/common/Navigation.tpl');
}
}
return '';
}
示例5: getNavigationMenu
/**
* CRM-12337 Output navigation menu as executable javascript
* @see smarty_function_crmNavigationMenu
*/
static function getNavigationMenu()
{
$session = CRM_Core_Session::singleton();
$contactID = $session->get('userID');
if ($contactID) {
// Set headers to encourage browsers to cache for a long time
// If we want to refresh the menu we will send a different url
$year = 60 * 60 * 24 * 364;
header('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', time() + $year));
header('Content-Type: application/javascript');
header("Cache-Control: max-age={$year}, public");
// Render template as a javascript file
$smarty = CRM_Core_Smarty::singleton();
$navigation = CRM_Core_BAO_Navigation::createNavigation($contactID);
$smarty->assign('timeGenerated', date('d M Y H:i:s'));
$smarty->assign('navigation', $navigation);
print $smarty->fetch('CRM/common/Navigation.tpl');
}
CRM_Utils_System::civiExit();
}
示例6: __construct
/**
* class constructor
*
* @return CRM_Core_Smarty
* @access private
*/
function __construct()
{
parent::__construct();
$config =& CRM_Core_Config::singleton();
if (isset($config->customTemplateDir) && $config->customTemplateDir) {
$this->template_dir = array($config->customTemplateDir, $config->templateDir);
} else {
$this->template_dir = $config->templateDir;
}
$this->compile_dir = $config->templateCompileDir;
//Check for safe mode CRM-2207
if (ini_get('safe_mode')) {
$this->use_sub_dirs = false;
} else {
$this->use_sub_dirs = true;
}
$this->plugins_dir = array($config->smartyDir . 'plugins', $config->pluginsDir);
// add the session and the config here
$session =& CRM_Core_Session::singleton();
$this->assign_by_ref('config', $config);
$this->assign_by_ref('session', $session);
// check default editor and assign to template, store it in session to reduce db calls
$defaultWysiwygEditor = $session->get('defaultWysiwygEditor');
if (!$defaultWysiwygEditor && !CRM_Core_Config::isUpgradeMode()) {
require_once 'CRM/Core/BAO/Preferences.php';
$defaultWysiwygEditor = CRM_Core_BAO_Preferences::value('editor_id');
$session->set('defaultWysiwygEditor', $defaultWysiwygEditor);
}
$this->assign('defaultWysiwygEditor', $defaultWysiwygEditor);
global $tsLocale;
$this->assign('langSwitch', CRM_Core_I18n::languages(true));
$this->assign('tsLocale', $tsLocale);
//check if logged in use has access CiviCRM permission and build menu
require_once 'CRM/Core/Permission.php';
$buildNavigation = CRM_Core_Permission::check('access CiviCRM');
$this->assign('buildNavigation', $buildNavigation);
if (!CRM_Core_Config::isUpgradeMode() && $buildNavigation) {
require_once 'CRM/Core/BAO/Navigation.php';
$contactID = $session->get('userID');
if ($contactID) {
$navigation =& CRM_Core_BAO_Navigation::createNavigation($contactID);
$this->assign('navigation', $navigation);
}
}
$this->register_function('crmURL', array('CRM_Utils_System', 'crmURL'));
$printerFriendly = CRM_Utils_System::makeURL('snippet', false, false) . '2';
$this->assign('printerFriendly', $printerFriendly);
}