當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilObjUser::_getNumberOfUsersForStyle方法代碼示例

本文整理匯總了PHP中ilObjUser::_getNumberOfUsersForStyle方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilObjUser::_getNumberOfUsersForStyle方法的具體用法?PHP ilObjUser::_getNumberOfUsersForStyle怎麽用?PHP ilObjUser::_getNumberOfUsersForStyle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilObjUser的用法示例。


在下文中一共展示了ilObjUser::_getNumberOfUsersForStyle方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:26,代碼來源:class.ilSystemStylesTableGUI.php

示例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);
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:13,代碼來源:ilObjUserTest.php

示例3: saveStyleSettingsObject

 /**
  * save skin and style settings
  */
 function saveStyleSettingsObject()
 {
     global $styleDefinition, $ilCtrl;
     // check if one style is activated
     if (count($_POST["st_act"]) < 1) {
         $this->ilias->raiseError($this->lng->txt("at_least_one_style"), $this->ilias->error_obj->MESSAGE);
     }
     //set default skin and style
     if ($_POST["default_skin_style"] != "") {
         $sknst = explode(":", $_POST["default_skin_style"]);
         if ($this->ilias->ini->readVariable("layout", "style") != $sknst[1] || $this->ilias->ini->readVariable("layout", "skin") != $sknst[0]) {
             $this->ilias->ini->setVariable("layout", "skin", $sknst[0]);
             $this->ilias->ini->setVariable("layout", "style", $sknst[1]);
         }
         $this->ilias->ini->write();
     }
     // check if a style should be deactivated, that still has
     // a user assigned to
     $all_styles = ilStyleDefinition::getAllSkinStyles();
     foreach ($all_styles as $st) {
         if (!isset($_POST["st_act"][$st["id"]])) {
             if (ilObjUser::_getNumberOfUsersForStyle($st["template_id"], $st["style_id"]) > 1) {
                 $this->ilias->raiseError($this->lng->txt("cant_deactivate_if_users_assigned"), $this->ilias->error_obj->MESSAGE);
             } else {
                 ilObjStyleSettings::_deactivateStyle($st["template_id"], $st["style_id"]);
             }
         } else {
             ilObjStyleSettings::_activateStyle($st["template_id"], $st["style_id"]);
         }
     }
     ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
     $ilCtrl->redirect($this, "editSystemStyles");
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:36,代碼來源:class.ilObjStyleSettingsGUI.php

示例4: getAllSkinStyles

 /**
  * Get all skins/styles
  *
  * @param
  * @return
  */
 public static function getAllSkinStyles()
 {
     global $styleDefinition;
     $all_styles = array();
     $templates = $styleDefinition->getAllTemplates();
     foreach ($templates as $template) {
         // get styles definition for template
         $styleDef = new ilStyleDefinition($template["id"]);
         $styleDef->startParsing();
         $styles = $styleDef->getStyles();
         foreach ($styles as $style) {
             $num_users = ilObjUser::_getNumberOfUsersForStyle($template["id"], $style["id"]);
             // default selection list
             $all_styles[$template["id"] . ":" . $style["id"]] = array("title" => $styleDef->getTemplateName() . " / " . $style["name"], "id" => $template["id"] . ":" . $style["id"], "template_id" => $template["id"], "style_id" => $style["id"], "template_name" => $styleDef->getTemplateName(), "substyle" => $style["substyle"], "style_name" => $style["name"], "users" => $num_users);
         }
     }
     return $all_styles;
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:24,代碼來源:class.ilStyleDefinition.php


注:本文中的ilObjUser::_getNumberOfUsersForStyle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。