本文整理汇总了PHP中CRM_Utils_System::getSiteID方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_System::getSiteID方法的具体用法?PHP CRM_Utils_System::getSiteID怎么用?PHP CRM_Utils_System::getSiteID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_System
的用法示例。
在下文中一共展示了CRM_Utils_System::getSiteID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* @return string
*/
public function run()
{
CRM_Utils_System::setTitle(ts("Configuration Checklist"));
$this->assign('recentlyViewed', FALSE);
$destination = CRM_Utils_System::url('civicrm/admin/configtask', 'reset=1', FALSE, NULL, FALSE);
$destination = urlencode($destination);
$this->assign('destination', $destination);
$this->assign('registerSite', htmlspecialchars('https://civicrm.org/register-your-site?src=iam&sid=' . CRM_Utils_System::getSiteID()));
return parent::run();
}
示例2: run
/**
* Run page.
*
* @return string
*/
public function run()
{
Civi::resources()->addStyleFile('civicrm', 'css/admin.css');
$this->assign('registerSite', htmlspecialchars('https://civicrm.org/register-your-site?src=iam&sid=' . CRM_Utils_System::getSiteID()));
$groups = array('Customize Data and Screens' => ts('Customize Data and Screens'), 'Communications' => ts('Communications'), 'Localization' => ts('Localization'), 'Users and Permissions' => ts('Users and Permissions'), 'System Settings' => ts('System Settings'));
$config = CRM_Core_Config::singleton();
if (in_array('CiviContribute', $config->enableComponents)) {
$groups['CiviContribute'] = ts('CiviContribute');
}
if (in_array('CiviMember', $config->enableComponents)) {
$groups['CiviMember'] = ts('CiviMember');
}
if (in_array('CiviEvent', $config->enableComponents)) {
$groups['CiviEvent'] = ts('CiviEvent');
}
if (in_array('CiviMail', $config->enableComponents)) {
$groups['CiviMail'] = ts('CiviMail');
}
if (in_array('CiviCase', $config->enableComponents)) {
$groups['CiviCase'] = ts('CiviCase');
}
if (in_array('CiviReport', $config->enableComponents)) {
$groups['CiviReport'] = ts('CiviReport');
}
if (in_array('CiviCampaign', $config->enableComponents)) {
$groups['CiviCampaign'] = ts('CiviCampaign');
}
$values = CRM_Core_Menu::getAdminLinks();
$this->_showHide = new CRM_Core_ShowHideBlocks();
foreach ($groups as $group => $title) {
$groupId = str_replace(' ', '_', $group);
$this->_showHide->addShow("id_{$groupId}_show");
$this->_showHide->addHide("id_{$groupId}");
$v = CRM_Core_ShowHideBlocks::links($this, $groupId, '', '', FALSE);
if (isset($values[$group])) {
$adminPanel[$groupId] = $values[$group];
$adminPanel[$groupId]['show'] = $v['show'];
$adminPanel[$groupId]['hide'] = $v['hide'];
$adminPanel[$groupId]['title'] = $title;
} else {
$adminPanel[$groupId] = array();
$adminPanel[$groupId]['show'] = '';
$adminPanel[$groupId]['hide'] = '';
$adminPanel[$groupId]['title'] = $title;
}
}
$this->assign('adminPanel', $adminPanel);
$this->_showHide->addToTemplate();
return parent::run();
}
示例3: runFinish
/**
* Display any final messages, clear caches, etc
*/
public function runFinish()
{
$upgrade = new CRM_Upgrade_Form();
$template = CRM_Core_Smarty::singleton();
// If we're redirected from queue-runner, then isUpgradePending=true.
// If user then reloads the finish page, the isUpgradePending will be unset. (Because the session has been cleared.)
if ($this->get('isUpgradePending')) {
// TODO: Use structured message store
$postUpgradeMessage = file_get_contents($this->get('postUpgradeMessageFile'));
// This destroys $session, so do it after get('postUpgradeMessageFile')
CRM_Upgrade_Form::doFinish();
} else {
$postUpgradeMessage = '';
// Session was destroyed! Can't recover messages.
}
// do a version check - after doFinish() sets the final version
list($currentVer, $latestVer) = $upgrade->getUpgradeVersions();
if ($error = $upgrade->checkCurrentVersion($currentVer, $latestVer)) {
CRM_Core_Error::fatal($error);
}
$template->assign('message', $postUpgradeMessage);
$template->assign('upgraded', TRUE);
$template->assign('sid', CRM_Utils_System::getSiteID());
// Render page header
if (!defined('CIVICRM_UF_HEAD') && ($region = CRM_Core_Region::instance('html-header', FALSE))) {
CRM_Utils_System::addHTMLHead($region->render(''));
}
$content = $template->fetch('CRM/common/success.tpl');
echo CRM_Utils_System::theme($content, $this->_print, TRUE);
}
示例4: evalMarkup
/**
* @param string $markup
* @return string
*/
public static function evalMarkup($markup)
{
$config = CRM_Core_Config::singleton();
$vals = array('resourceUrl' => rtrim($config->resourceBase, '/'), 'ver' => CRM_Utils_System::version(), 'uf' => $config->userFramework, 'php' => phpversion(), 'sid' => CRM_Utils_System::getSiteID(), 'baseUrl' => $config->userFrameworkBaseURL, 'lang' => $config->lcMessages, 'co' => $config->defaultContactCountry);
$vars = array();
foreach ($vals as $k => $v) {
$vars['%%' . $k . '%%'] = $v;
$vars['{{' . $k . '}}'] = urlencode($v);
}
return strtr($markup, $vars);
}
示例5: run
/**
* @return string
*/
public function run()
{
$errorMessage = '';
// ensure that all CiviCRM tables are InnoDB, else abort
// this is not a very fast operation, so we do it randomly 10% of the times
// but we do it for most / all tables
// http://bugs.mysql.com/bug.php?id=43664
if (rand(1, 10) == 3 && CRM_Core_DAO::isDBMyISAM(150)) {
$errorMessage = ts('Your database is configured to use the MyISAM database engine. CiviCRM requires InnoDB. You will need to convert any MyISAM tables in your database to InnoDB. Using MyISAM tables will result in data integrity issues.');
CRM_Core_Session::setStatus($errorMessage, ts('Warning'), "alert");
}
if (!CRM_Utils_System::isDBVersionValid($errorMessage)) {
CRM_Core_Session::setStatus($errorMessage, ts('Warning'), "alert", array('expires' => 0));
}
$this->assign('registerSite', htmlspecialchars('https://civicrm.org/register-your-site?src=iam&sid=' . CRM_Utils_System::getSiteID()));
$groups = array('Customize Data and Screens' => ts('Customize Data and Screens'), 'Communications' => ts('Communications'), 'Localization' => ts('Localization'), 'Users and Permissions' => ts('Users and Permissions'), 'System Settings' => ts('System Settings'));
$config = CRM_Core_Config::singleton();
if (in_array('CiviContribute', $config->enableComponents)) {
$groups['CiviContribute'] = ts('CiviContribute');
}
if (in_array('CiviMember', $config->enableComponents)) {
$groups['CiviMember'] = ts('CiviMember');
}
if (in_array('CiviEvent', $config->enableComponents)) {
$groups['CiviEvent'] = ts('CiviEvent');
}
if (in_array('CiviMail', $config->enableComponents)) {
$groups['CiviMail'] = ts('CiviMail');
}
if (in_array('CiviCase', $config->enableComponents)) {
$groups['CiviCase'] = ts('CiviCase');
}
if (in_array('CiviReport', $config->enableComponents)) {
$groups['CiviReport'] = ts('CiviReport');
}
if (in_array('CiviCampaign', $config->enableComponents)) {
$groups['CiviCampaign'] = ts('CiviCampaign');
}
$values = CRM_Core_Menu::getAdminLinks();
$this->_showHide = new CRM_Core_ShowHideBlocks();
foreach ($groups as $group => $title) {
$groupId = str_replace(' ', '_', $group);
$this->_showHide->addShow("id_{$groupId}_show");
$this->_showHide->addHide("id_{$groupId}");
$v = CRM_Core_ShowHideBlocks::links($this, $groupId, '', '', FALSE);
if (isset($values[$group])) {
$adminPanel[$groupId] = $values[$group];
$adminPanel[$groupId]['show'] = $v['show'];
$adminPanel[$groupId]['hide'] = $v['hide'];
$adminPanel[$groupId]['title'] = $title;
} else {
$adminPanel[$groupId] = array();
$adminPanel[$groupId]['show'] = '';
$adminPanel[$groupId]['hide'] = '';
$adminPanel[$groupId]['title'] = $title;
}
}
$this->assign('adminPanel', $adminPanel);
$this->_showHide->addToTemplate();
return parent::run();
}