本文整理汇总了PHP中Tiki_Profile::replaceReferences方法的典型用法代码示例。如果您正苦于以下问题:PHP Tiki_Profile::replaceReferences方法的具体用法?PHP Tiki_Profile::replaceReferences怎么用?PHP Tiki_Profile::replaceReferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tiki_Profile
的用法示例。
在下文中一共展示了Tiki_Profile::replaceReferences方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doInstall
private function doInstall(Tiki_Profile $profile)
{
global $tikilib;
$this->installed[$profile->url] = $profile;
foreach ($profile->getPreferences() as $pref => $value) {
$tikilib->set_preference($pref, $value);
}
foreach ($profile->getObjects() as $object) {
$this->getInstallHandler($object)->install();
}
$permissions = $profile->getPermissions();
$profile->replaceReferences($permissions);
foreach ($permissions as $groupName => $info) {
$this->setupGroup($groupName, $info['general'], $info['permissions'], $info['objects']);
}
}
示例2: doInstall
private function doInstall(Tiki_Profile $profile)
{
global $tikilib, $prefs;
$this->setFeedback(tra('Applying profile') . ': ' . $profile->profile);
$this->installed[$profile->getProfileKey()] = $profile;
$preferences = $profile->getPreferences();
$profile->replaceReferences($preferences, $this->userData);
foreach ($preferences as $pref => $value) {
if ($this->allowedGlobalPreferences === false || in_array($pref, $this->allowedGlobalPreferences)) {
global $prefslib;
include_once 'lib/prefslib.php';
$pinfo = $prefslib->getPreference($pref);
if (!empty($pinfo['separator']) && !is_array($value)) {
$value = explode($pinfo['separator'], $value);
}
if ($prefs[$pref] != $value) {
$this->setFeedback(tra('Preference set') . ': ' . $pref . '=' . $value);
}
$tikilib->set_preference($pref, $value);
}
}
require_once 'lib/setup/events.php';
tiki_setup_events();
foreach ($profile->getObjects() as $object) {
$this->getInstallHandler($object)->install();
$this->setFeedback(tra('Added (or modified)') . ': ' . $object->getDescription());
}
$groupMap = $profile->getGroupMap();
$profile->replaceReferences($groupMap, $this->userData);
$permissions = $profile->getPermissions($groupMap);
$profile->replaceReferences($permissions, $this->userData);
foreach ($permissions as $groupName => $info) {
$this->setFeedback(tra('Group changed (or modified)') . ': ' . $groupName);
$this->setupGroup($groupName, $info['general'], $info['permissions'], $info['objects'], $groupMap);
}
tiki_setup_events();
}