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


PHP EfrontLesson::setOptions方法代碼示例

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


在下文中一共展示了EfrontLesson::setOptions方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: serialize

 mb_internal_encoding('utf-8');
 //This must be put here due to PHP bug #48697
 if ($visibility) {
     $positions = serialize(array('first' => array_unique($firstlist), 'second' => array_unique($secondlist), 'visibility' => $visibility));
 } else {
     $positions = serialize(array('first' => array_unique($firstlist), 'second' => array_unique($secondlist)));
 }
 //Dashboard positions
 if ($_POST['dashboard']) {
     eF_updateTableData("users", array('dashboard_positions' => $positions), "login='" . $currentUser->user['login'] . "'");
 } else {
     if ($currentUser->user['user_type'] == 'administrator' && !isset($_POST['lessons_ID'])) {
         EfrontConfiguration::setValue($currentUser->user['login'] . "_positions", $positions);
     } else {
         if (isset($_POST['set_default']) && ($currentUser->user['user_type'] == 'administrator' || $roles[$currentLesson->getRole($currentUser->user['login'])] == 'professor')) {
             $currentLesson->setOptions(array("default_positions" => $positions));
             $positions = serialize(array('first' => array_unique($firstlist), 'second' => array_unique($secondlist), 'visibility' => $visibility, 'update' => true));
             $lessonStudents = $currentLesson->getUsers('student');
             if (sizeof($lessonStudents) > 0) {
                 $users = implode("','", array_keys($lessonStudents));
                 eF_updateTableData("users_to_lessons", array('positions' => $positions), "users_LOGIN in ('" . $users . "') and lessons_ID=" . $currentLesson->lesson['id']);
             }
         } else {
             if (!$visibility) {
                 $result = eF_getTableData("users_to_lessons", "positions", "lessons_ID=" . $currentLesson->lesson['id'] . " AND users_LOGIN='" . $currentUser->user['login'] . "'");
                 $result = unserialize($result[0]['positions']);
                 $visibility = $result['visibility'];
                 if (isset($result['visibility'])) {
                     $positions = serialize(array('first' => array_unique($firstlist), 'second' => array_unique($secondlist), 'visibility' => $visibility));
                 }
             }
開發者ID:bqq1986,項目名稱:efront,代碼行數:31,代碼來源:set_positions.php


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