本文整理匯總了PHP中CRM_Utils_System::evalUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Utils_System::evalUrl方法的具體用法?PHP CRM_Utils_System::evalUrl怎麽用?PHP CRM_Utils_System::evalUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Utils_System
的用法示例。
在下文中一共展示了CRM_Utils_System::evalUrl方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: gettingStartedUrl
/**
* Get the final, usable URL string (after interpolating any variables)
*
* @return FALSE|string
*/
public function gettingStartedUrl()
{
// Note: We use "*default*" as the default (rather than self::GETTING_STARTED_URL) so that future
// developers can change GETTING_STARTED_URL without needing to update {civicrm_setting}.
$url = Civi::settings()->get('gettingStartedUrl');
if ($url === '*default*') {
$url = self::GETTING_STARTED_URL;
}
return CRM_Utils_System::evalUrl($url);
}
示例2: getBlogUrl
/**
* Get the final, usable URL string (after interpolating any variables)
*
* @return FALSE|string
*/
public function getBlogUrl()
{
// Note: We use "*default*" as the default (rather than self::BLOG_URL) so that future
// developers can change BLOG_URL without needing to update {civicrm_setting}.
$url = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'blogUrl', NULL, '*default*');
if ($url === '*default*') {
$url = self::BLOG_URL;
}
return CRM_Utils_System::evalUrl($url);
}
示例3: getRenderedUrl
/**
* Get the final, usable URL string (after interpolating any variables)
*
* @return FALSE|string
*/
public function getRenderedUrl()
{
return CRM_Utils_System::evalUrl($this->messagesUrl);
}
示例4: getMenuName
/**
* Get Menu name.
*
* @param $value
* @param array $skipMenuItems
*
* @return bool|string
*/
public static function getMenuName(&$value, &$skipMenuItems)
{
// we need to localise the menu labels (CRM-5456) and don’t
// want to use ts() as it would throw the ts-extractor off
$i18n = CRM_Core_I18n::singleton();
$name = $i18n->crm_translate($value['attributes']['label'], array('context' => 'menu'));
$url = CRM_Utils_Array::value('url', $value['attributes']);
$permission = CRM_Utils_Array::value('permission', $value['attributes']);
$operator = CRM_Utils_Array::value('operator', $value['attributes']);
$parentID = CRM_Utils_Array::value('parentID', $value['attributes']);
$navID = CRM_Utils_Array::value('navID', $value['attributes']);
$active = CRM_Utils_Array::value('active', $value['attributes']);
$menuName = CRM_Utils_Array::value('name', $value['attributes']);
$target = CRM_Utils_Array::value('target', $value['attributes']);
if (in_array($parentID, $skipMenuItems) || !$active) {
$skipMenuItems[] = $navID;
return FALSE;
}
//we need to check core view/edit or supported acls.
if (in_array($menuName, array('Search...', 'Contacts'))) {
if (!CRM_Core_Permission::giveMeAllACLs()) {
$skipMenuItems[] = $navID;
return FALSE;
}
}
$config = CRM_Core_Config::singleton();
$makeLink = FALSE;
if (isset($url) && $url) {
if (substr($url, 0, 4) !== 'http') {
//CRM-7656 --make sure to separate out url path from url params,
//as we'r going to validate url path across cross-site scripting.
$urlParam = explode('?', $url);
if (empty($urlParam[1])) {
$urlParam[1] = NULL;
}
$url = CRM_Utils_System::url($urlParam[0], $urlParam[1], FALSE, NULL, TRUE);
} elseif (strpos($url, '&') === FALSE) {
$url = htmlspecialchars($url);
}
$makeLink = TRUE;
}
static $allComponents;
if (!$allComponents) {
$allComponents = CRM_Core_Component::getNames();
}
if (isset($permission) && $permission) {
$permissions = explode(',', $permission);
$hasPermission = FALSE;
foreach ($permissions as $key) {
$key = trim($key);
$showItem = TRUE;
//get the component name from permission.
$componentName = CRM_Core_Permission::getComponentName($key);
if ($componentName) {
if (!in_array($componentName, $config->enableComponents) || !CRM_Core_Permission::check($key)) {
$showItem = FALSE;
if ($operator == 'AND') {
$skipMenuItems[] = $navID;
return $showItem;
}
} else {
$hasPermission = TRUE;
}
} elseif (!CRM_Core_Permission::check($key)) {
$showItem = FALSE;
if ($operator == 'AND') {
$skipMenuItems[] = $navID;
return $showItem;
}
} else {
$hasPermission = TRUE;
}
}
if (!$showItem && !$hasPermission) {
$skipMenuItems[] = $navID;
return FALSE;
}
}
if ($makeLink) {
$url = CRM_Utils_System::evalUrl($url);
if ($target) {
$name = "<a href=\"{$url}\" target=\"{$target}\">{$name}</a>";
} else {
$name = "<a href=\"{$url}\">{$name}</a>";
}
}
return $name;
}
示例5: getRepositoryUrl
/**
* Determine the URL which provides a feed of available extensions.
*
* @return string|FALSE
*/
public function getRepositoryUrl()
{
if (empty($this->_repoUrl) && $this->_repoUrl !== FALSE) {
$url = Civi::settings()->get('ext_repo_url');
// boolean false means don't try to check extensions
// CRM-10575
if ($url === FALSE) {
$this->_repoUrl = FALSE;
} else {
$this->_repoUrl = CRM_Utils_System::evalUrl($url);
}
}
return $this->_repoUrl;
}
示例6: getRepositoryUrl
/**
* Determine the URL which provides a feed of available extensions.
*
* @return string|FALSE
*/
public function getRepositoryUrl()
{
if (empty($this->_repoUrl) && $this->_repoUrl !== FALSE) {
$config = CRM_Core_Config::singleton();
$url = CRM_Core_BAO_Setting::getItem('Extension Preferences', 'ext_repo_url', NULL, CRM_Extension_Browser::DEFAULT_EXTENSIONS_REPOSITORY);
// boolean false means don't try to check extensions
// http://issues.civicrm.org/jira/browse/CRM-10575
if ($url === FALSE) {
$this->_repoUrl = FALSE;
} else {
$this->_repoUrl = CRM_Utils_System::evalUrl($url);
}
}
return $this->_repoUrl;
}
示例7: testEvalUrl
public function testEvalUrl()
{
$this->assertEquals(FALSE, CRM_Utils_System::evalUrl(FALSE));
$this->assertEquals('http://example.com/', CRM_Utils_System::evalUrl('http://example.com/'));
$this->assertEquals('http://example.com/?cms=UnitTests', CRM_Utils_System::evalUrl('http://example.com/?cms={uf}'));
}