本文整理汇总了PHP中ilObjUser::_getAllUserAssignedStyles方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjUser::_getAllUserAssignedStyles方法的具体用法?PHP ilObjUser::_getAllUserAssignedStyles怎么用?PHP ilObjUser::_getAllUserAssignedStyles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjUser
的用法示例。
在下文中一共展示了ilObjUser::_getAllUserAssignedStyles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStyles
/**
* Get styles
*
* @param
* @return
*/
function getStyles()
{
global $styleDefinition;
$all_styles = ilStyleDefinition::getAllSkinStyles();
// get all user assigned styles
$all_user_styles = ilObjUser::_getAllUserAssignedStyles();
// output "other" row for all users, that are not assigned to
// any existing style
$users_missing_styles = 0;
foreach ($all_user_styles as $style) {
if (!isset($all_styles[$style])) {
$style_arr = explode(":", $style);
$users_missing_styles += ilObjUser::_getNumberOfUsersForStyle($style_arr[0], $style_arr[1]);
}
}
if ($users_missing_styles > 0) {
$all_styles["other"] = array("title" => $this->lng->txt("other"), "id" => "other", "template_id" => "", "style_id" => "", "template_name" => "", "style_name" => "", "users" => $users_missing_styles);
}
$this->setData($all_styles);
}
示例2: testMiscellaneous
/**
* Miscellaneous
* @group IL_Init
*/
public function testMiscellaneous()
{
$value = "";
include_once "./Services/User/classes/class.ilObjUser.php";
ilObjUser::_getNumberOfUsersForStyle("default", "delos");
ilObjUser::_getAllUserAssignedStyles();
ilObjUser::_moveUsersToStyle("default", "delos", "default", "delos");
$this->assertEquals("", $value);
}
示例3: moveUserStylesObject
/**
* Move user styles
*
* @param
* @return
*/
function moveUserStylesObject()
{
global $ilCtrl, $lng;
$to = explode(":", $_POST["to_style"]);
if ($_POST["from_style"] != "other") {
$from = explode(":", $_POST["from_style"]);
ilObjUser::_moveUsersToStyle($from[0], $from[1], $to[0], $to[1]);
} else {
// get all user assigned styles
$all_user_styles = ilObjUser::_getAllUserAssignedStyles();
// move users that are not assigned to
// currently existing style
foreach ($all_user_styles as $style) {
if (!in_array($style, $all_styles)) {
$style_arr = explode(":", $style);
ilObjUser::_moveUsersToStyle($style_arr[0], $style_arr[1], $to[0], $to[1]);
}
}
}
ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "editSystemStyles");
}