当前位置: 首页>>代码示例>>PHP>>正文


PHP eF_multiSort函数代码示例

本文整理汇总了PHP中eF_multiSort函数的典型用法代码示例。如果您正苦于以下问题:PHP eF_multiSort函数的具体用法?PHP eF_multiSort怎么用?PHP eF_multiSort使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了eF_multiSort函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: filterSortPage

function filterSortPage($dataSource)
{
    isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
    if (isset($_GET['sort']) && $_GET['sort'] && eF_checkParameter($_GET['sort'], 'text')) {
        $sort = $_GET['sort'];
        isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
    } else {
        $sort = key(current($dataSource));
        //The first field of the data array is the default sorting field
        $order = 'desc';
    }
    $dataSource = eF_multiSort($dataSource, $sort, $order);
    if (isset($_GET['filter'])) {
        $filter = explode("||||", $_GET['filter']);
        $actual_filter = $filter[0];
        $dataSource = eF_filterData($dataSource, $actual_filter);
        //$dataSource = eF_filterData($dataSource, $_GET['filter']);
    }
    $tableSize = sizeof($dataSource);
    if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
        isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
        $dataSource = array_slice($dataSource, $offset, $limit, true);
    }
    return array($tableSize, $dataSource);
}
开发者ID:kaseya-university,项目名称:efront,代码行数:25,代码来源:tools-backup.php

示例2: getModule

 /**
  * The main functionality
  *
  * (non-PHPdoc)
  * @see libraries/EfrontModule#getModule()
  */
 public function getModule()
 {
     $smarty = $this->getSmartyVar();
     $currentUser = $this->getCurrentUser();
     $directionsTree = new EfrontDirectionsTree();
     $directionsPaths = $directionsTree->toPathString();
     $smarty->assign("T_MODULE_OUTLOOK_INVITATION_DIRECTION_PATHS", $directionsPaths);
     $temp = eF_getTableData("module_outlook_invitation as m,courses as c", "m.*,c.name,c.directions_ID", "m.courses_ID=c.id");
     $events = array();
     foreach ($temp as $value) {
         $events[$value['courses_ID']] = $value;
     }
     if (isset($_GET['delete_event']) && eF_checkParameter($_GET['delete_event'], 'id') && in_array($_GET['delete_event'], array_keys($events))) {
         try {
             $event = $events[$_GET['delete_event']];
             $course = new EfrontCourse($event['courses_ID']);
             $users = $course->getCourseUsers(array('active' => true, archive => false, 'return_objects' => false));
             $recipients = array();
             foreach ($users as $value) {
                 $recipients[] = $value['email'];
             }
             $this->cancelInvitation($course->course['id'], $recipients);
             eF_deleteTableData("module_outlook_invitation", "courses_ID=" . $_GET['delete_event']);
         } catch (Exception $e) {
             header("HTTP/1.0 500 ");
             echo $e->getMessage() . ' (' . $e->getCode() . ')';
         }
         exit;
     }
     if ($_SESSION['s_type'] != 'administrator') {
         $userCourses = $currentUser->getUserCourses(array('archive' => 0, 'active' => true, 'return_objects' => false));
         if (G_VERSIONTYPE == 'enterprise') {
             if ($_SESSION['s_current_branch']) {
                 $result = eF_getTableData("module_hcd_course_to_branch", "courses_ID", "branches_ID='{$_SESSION['s_current_branch']}'");
             } else {
                 if ($currentUser->aspects['hcd']->isSupervisor()) {
                     $result = eF_getTableData("module_hcd_course_to_branch", "courses_ID", "branches_ID in (select branches_ID from module_hcd_employee_works_at_branch where users_login='{$currentUser->user['login']}' and supervisor=1)");
                 }
             }
             $branchCourses = array();
             foreach ($result as $value) {
                 $branchCourses[$value['courses_ID']] = $value['courses_ID'];
             }
             foreach ($events as $key => $value) {
                 if (!isset($branchCourses[$key]) && !isset($userCourses[$key])) {
                     unset($events[$key]);
                 }
             }
         } else {
             foreach ($events as $key => $value) {
                 if (!isset($userCourses[$key])) {
                     unset($events[$key]);
                 }
             }
         }
     }
     if (!isset($_GET['course'])) {
         $dataSource = $events;
         $tableName = 'outlookInvitationsTable';
         isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
         if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
             $sort = $_GET['sort'];
             isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
         } else {
             $sort = 'login';
         }
         $dataSource = eF_multiSort($dataSource, $sort, $order);
         $smarty->assign("T_TABLE_SIZE", sizeof($dataSource));
         if (isset($_GET['filter'])) {
             $dataSource = eF_filterData($dataSource, $_GET['filter']);
         }
         if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
             isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
             $dataSource = array_slice($dataSource, $offset, $limit);
         }
         $smarty->assign("T_DATA_SOURCE", $dataSource);
     } else {
         $course = new EfrontCourse($_GET['course']);
         $form = new HTML_QuickForm("import_outlook_invitation_form", "post", $this->moduleBaseUrl . "&course={$course->course['id']}&add_event=1" . (isset($_GET['popup']) ? '&popup=1' : ''), "", null, true);
         $form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
         //Register this rule for checking user input with our function, eF_checkParameter
         $form->addElement('text', 'email', _SENDER, 'class = "inputText"');
         $form->addElement('text', 'location', _LOCATION, 'class = "inputText"');
         $form->addElement('text', 'subject', _SUBJECT, 'class = "inputText"');
         $form->addElement('textarea', 'description', _DESCRIPTION, 'class = "inputTestTextarea" style = "width:80%;height:6em;"');
         //$form -> addElement('checkbox', 'calendar', _MODULE_OUTLOOK_INVITATION_CREATE_CALENDAR);
         //$form -> addElement('static', 'static', _MODULE_OUTLOOK_INVITATION_INFO);
         $form->addElement('submit', 'submit_event_all', _MODULE_OUTLOOK_INVITATION_SENDALL, 'class=flatButton');
         $form->addElement('submit', 'submit_event_new', _MODULE_OUTLOOK_INVITATION_SENDNEW, 'class=flatButton');
         if (empty($events[$course->course['id']])) {
             //new invitation
             $currentEvent = null;
             $form->setDefaults(array('email' => $currentUser->user['email'], 'subject' => 'Invitation to attend training: ' . $course->course['name']));
         } else {
//.........这里部分代码省略.........
开发者ID:kaseya-university,项目名称:efront,代码行数:101,代码来源:module_outlook_invitation.class.php

示例3: getAjaxResults

 private function getAjaxResults()
 {
     $smarty = $this->getSmartyVar();
     $vLabData = eF_getTableData("module_vLab_data", "*");
     isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
     if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
         $sort = $_GET['sort'];
         isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
     } else {
         $sort = 'login';
     }
     $vLabData = eF_multiSort($vLabData, $sort, $order);
     $smarty->assign("T_TABLE_SIZE", sizeof($vLabData));
     if (isset($_GET['filter'])) {
         $vLabData = eF_filterData($vLabData, $_GET['filter']);
     }
     if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
         isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
         $vLabData = array_slice($vLabData, $offset, $limit);
     }
     $smarty->assign("T_DATA_SOURCE", $vLabData);
 }
开发者ID:kaseya-university,项目名称:efront,代码行数:22,代码来源:module_vLab.class.php

示例4: EfrontDirectionsTree

 */
 if (isset($_GET['ajax']) && $_GET['ajax'] == 'lessonsTable') {
     $directionsTree = new EfrontDirectionsTree();
     $directionPaths = $directionsTree->toPathString();
     $smarty->assign("T_DIRECTIONS_PATHS", $directionPaths);
     $constraints = array('archive' => false, 'condition' => "creator_LOGIN='{$_SESSION['s_login']}'") + createConstraintsFromSortedTable();
     $dataSource = EfrontLesson::getAllLessons($constraints);
     $totalEntries = EfrontLesson::countAllLessons($constraints);
     $tableName = $_GET['ajax'];
     $alreadySorted = 1;
     $smarty->assign("T_TABLE_SIZE", $totalEntries);
     include "sorted_table.php";
     isset($_GET['limit']) ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
     if (isset($_GET['sort'])) {
         isset($_GET['order']) ? $order = $_GET['order'] : ($order = 'asc');
         $lessons = eF_multiSort($lessons, $_GET['sort'], $order);
     }
     if (isset($_GET['filter'])) {
         $lessons = eF_filterData($lessons, $_GET['filter']);
     }
     $smarty->assign("T_LESSONS_SIZE", sizeof($lessons));
     if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
         isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
         $lessons = array_slice($lessons, $offset, $limit);
     }
     foreach ($lessons as $key => $lesson) {
         $obj = new EfrontLesson($lesson);
         //$lessons[$key]['link'] = $obj -> toHTMLTooltipLink(basename($_SERVER['PHP_SELF']).'?ctg=professor_lessons&edit_lesson='.$lesson['id']);
         $lessons[$key]['direction_name'] = $directionPaths[$lesson['directions_ID']];
         $lessons[$key]['price_string'] = $obj->lesson['price_string'];
         //$lessons[$key]['students']       = sizeof($obj -> getUsers('student'));
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:professor_lessons.php

示例5: eF_updateTableData

     }
     eF_updateTableData("f_personal_messages", array("viewed" => 1), "id=" . $currentMessage['id']);
 } else {
     $smarty->assign("T_LAYOUT_CLASS", $currentTheme->options['toolbar_position'] == "left" ? "hideRight" : "hideLeft");
     //Whether to show the sidemenu on the left or on the right
     $folderMessages = eF_getTableData("f_personal_messages", "*", "users_LOGIN='" . $currentUser->user['login'] . "' and f_folders_ID=" . $currentFolder, "priority desc, viewed,timestamp desc");
     if (isset($_GET['ajax']) && $_GET['ajax'] == 'messagesTable') {
         isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
         if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
             $sort = $_GET['sort'];
             isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
         } else {
             $sort = 'priority';
         }
         $smarty->assign("T_MESSAGES_SIZE", sizeof($folderMessages));
         $folderMessages = eF_multiSort($folderMessages, $_GET['sort'], $order);
         if (isset($_GET['filter'])) {
             $folderMessages = eF_filterData($folderMessages, $_GET['filter']);
         }
         if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
             isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
             $folderMessages = array_slice($folderMessages, $offset, $limit);
         }
         foreach ($folderMessages as $key => $value) {
             $recipients = explode(",", $folderMessages[$key]['recipient']);
             foreach ($recipients as $k => $login) {
                 $recipients[$k] = formatLogin(trim($login));
             }
             $folderMessages[$key]['recipient'] = implode(", ", $recipients);
         }
         $smarty->assign("T_MESSAGES", $folderMessages);
开发者ID:kaseya-university,项目名称:efront,代码行数:31,代码来源:messages.php

示例6: eF_getTableData

 if (isset($_GET['ajax']) && $_GET['ajax'] == 'pendingTable') {
     if (!empty($testIds)) {
         if (!$skillgap_tests) {
             $recentTests = eF_getTableData("completed_tests ct, tests t, users u, users_to_lessons ul", "t.name, u.name as username, u.surname, ct.id, ct.status, ct.tests_ID, ct.score, ct.time_end, ct.users_LOGIN, ct.pending", "u.login=ul.users_login and ul.archive=0 and ul.lessons_ID=t.lessons_ID and ct.status != 'deleted' and ct.status != 'incomplete' and t.id = ct.tests_ID AND ct.users_login = u.login AND u.archive=0 and ct.tests_id IN ('" . implode("','", $testIds) . "')", "ct.pending DESC");
         } else {
             $recentTests = eF_getTableData("completed_tests JOIN tests ON tests_id = tests.id JOIN users ON completed_tests.users_LOGIN = users.login JOIN users_to_skillgap_tests ON completed_tests.users_LOGIN = users_to_skillgap_tests.users_LOGIN AND users_to_skillgap_tests.tests_ID = tests.id AND users_to_skillgap_tests.solved = 1", "completed_tests.id, completed_tests.score, users.name as username, users.surname, completed_tests.tests_ID, tests.name, completed_tests.timestamp, completed_tests.users_LOGIN", "completed_tests.status != 'deleted' and completed_tests.tests_id IN ('" . implode("','", $testIds) . "')", "timestamp DESC");
         }
     }
     isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
     if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
         $sort = $_GET['sort'];
         isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
     } else {
         $sort = 'text';
     }
     $recentTests = eF_multiSort($recentTests, $sort, $order);
     if (isset($_GET['filter'])) {
         $recentTests = eF_filterData($recentTests, $_GET['filter']);
     }
     if ($_SESSION['s_type'] != 'administrator' && $_SESSION['s_current_branch']) {
         //this applies to supervisors only
         $currentBranch = new EfrontBranch($_SESSION['s_current_branch']);
         $branchTreeUsers = array_keys($currentBranch->getBranchTreeUsers());
         foreach ($recentTests as $key => $value) {
             if (!in_array($value['users_LOGIN'], $branchTreeUsers)) {
                 unset($recentTests[$key]);
             }
         }
     }
     $smarty->assign("T_PENDING_SIZE", sizeof($recentTests));
     if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
开发者ID:kaseya-university,项目名称:efront,代码行数:31,代码来源:module_tests.php

示例7: getGlossaryWords

 /**
  * Get glossary words
  *
  * This function is used to return an array of words, divided per initial letter, given an array of
  * glossary entries.
  *
  * @return array An array of words, divided in subarrays per letter
  * @since 3.6.0
  * @access public
  * @static
  */
 public static function getGlossaryWords($words)
 {
     $initials = array();
     $returnValue = preg_match("/^\\p{L}.*\$/u", 'a');
     foreach ($words as $key => $value) {
         $letter = mb_strtoupper(mb_substr($value['name'], 0, 1));
         //echo "LETTER: ".$letter." ASCII: ".ord($letter)."<br/>";
         if (preg_match("/[0-9]/", $letter)) {
             $initials["0-9"][$letter][] = $words[$key];
         } else {
             if (!preg_match("/\\p{L}/u", $letter) && $returnValue !== false) {
                 $initials["Symbols"][$letter][] = $words[$key];
             } else {
                 if (!preg_match("/\\w/", $letter) && $returnValue === false) {
                     $initials["Symbols"][$letter][] = $words[$key];
                 } else {
                     $initials[$letter][] = $words[$key];
                 }
             }
         }
     }
     //Added lines to sort terms in each tab (#1460)
     foreach ($initials as $key => $value) {
         $initials[$key] = eF_multiSort($value, 'name');
     }
     $setNum = isset($initials["0-9"]);
     $setSym = isset($initials["Symbols"]);
     if ($setNum || $setSym) {
         $tempNum = $initials["0-9"];
         $tempSym = $initials["Symbols"];
         unset($initials["0-9"]);
         unset($initials["Symbols"]);
         ksort($initials);
         if ($setNum) {
             $initials["0-9"] = $tempNum;
         }
         if ($setSym) {
             $initials["Symbols"] = $tempSym;
         }
     } else {
         ksort($initials);
     }
     return $initials;
 }
开发者ID:bqq1986,项目名称:efront,代码行数:55,代码来源:glossary.class.php

示例8: array

            break;
        default:
            $mode = true;
            $filter = array();
            break;
    }
    $filesystem = new FileSystemTree($directory['path'], true);
    //$directory != $rootDir ? $tree = $filesystem -> seekNode($directory['path']) : $tree = $filesystem -> tree; // Changed because of #2634
    $tree = $filesystem->tree;
    foreach (new EfrontDirectoryOnlyFilterIterator(new EfrontNodeFilterIterator(new ArrayIterator($tree, RecursiveIteratorIterator::SELF_FIRST))) as $key => $value) {
        $value['image'] = $value->getTypeImage();
        $folders[] = (array) $value;
    }
    foreach (new EfrontFileOnlyFilterIterator(new EfrontFileTypeFilterIterator(new EfrontNodeFilterIterator(new ArrayIterator($tree, RecursiveIteratorIterator::SELF_FIRST)), $filter, $mode)) as $key => $value) {
        $value['image'] = $value->getTypeImage();
        $files[] = (array) $value;
    }
    //for sorting files
    $folders = eF_multiSort($folders, 'name');
    $files = eF_multiSort($files, 'name');
    $files = array_merge((array) $folders, (array) $files);
    //pr($files);
    $smarty->assign("T_FILES", $files);
} catch (Exception $e) {
    $smarty->assign("T_EXCEPTION_TRACE", $e->getTraceAsString());
    $message = $e->getMessage() . ' (' . $e->getCode() . ') &nbsp;<a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>';
    $message_type = 'failure';
}
$smarty->assign("T_MESSAGE", $message);
$smarty->assign("T_MESSAGE_TYPE", $message_type);
$smarty->display("browse.tpl");
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:browse.php

示例9: toHTML


//.........这里部分代码省略.........
        } catch (Exception $e) {
            echo "<script>if (top && top.mainframe) {w=top.mainframe} else {w=parent;}w.document.getElementById('messageError').innerHTML = '" . $e->getMessage() . "';parent.\$('uploading_image').hide();</script>";
            //Don't halt for uploading and create directory errors
            $GLOBALS['smarty']->assign("T_EXCEPTION_TRACE", $e->getTraceAsString());
            $GLOBALS['message'] = $e->getMessage() . ' (' . $e->getCode() . ') &nbsp;<a href = "javascript:void(0)" onclick = "eF_js_showDivPopup(event, \'' . _ERRORDETAILS . '\', 2, \'error_details\')">' . _MOREINFO . '</a>';
        }
        $files = array();
        $fileArrays = array();
        $foldersArray = array();
        $filesArray = array();
        if ($options['folders']) {
            $iterator = new EfrontDirectoryOnlyFilterIterator(new ArrayIterator($currentDir));
            //Plain ArrayIterator so that it iterates only on the current's folder files
            if ($options['db_files_only']) {
                //Filter out directories without database representation
                $iterator = new EfrontDBOnlyFilterIterator($iterator);
            }
            foreach ($iterator as $key => $value) {
                //We convert iterator to a complete array of files, so we can apply sorting, filtering etc more easily
                $current = (array) $iterator->current();
                foreach ($current as $k => $v) {
                    //Remove child elements, such files, directories etc from the array, so we can successfully apply operations on to them, such as filtering
                    if ($v instanceof ArrayObject) {
                        unset($current[$k]);
                    }
                }
                $current['size'] = 0;
                $current['extension'] = '';
                $current['shared'] = 10;
                //Add these 3 parameters, so that sorting below works correctly (10 means nothing, since a folder cannot be shared, but it is handy for sorting)
                $foldersArray[] = (array) $current;
                //Array representation of directory objects, on which we can apply sorting, filtering, etc
            }
            $foldersArray = eF_multiSort($foldersArray, 'name', 'asc');
        }
        if ($defaultIterator) {
            $iterator = $defaultIterator;
        } else {
            $iterator = new EfrontFileOnlyFilterIterator(new EfrontNodeFilterIterator(new ArrayIterator($currentDir)));
            //Plain ArrayIterator so that it iterates only on the current folder's files
            if ($options['db_files_only']) {
                //Filter out directories without database representation
                $iterator = new EfrontDBOnlyFilterIterator($iterator);
            }
        }
        foreach ($iterator as $key => $value) {
            //We convert iterator to a complete array of files, so we can apply sorting, filtering etc more easily
            $current = (array) $iterator->current();
            foreach ($current as $k => $v) {
                //Remove child elements, such files, directories etc from the array, so we can successfully apply operations on to them, such as filtering
                if ($v instanceof ArrayObject) {
                    unset($current[$k]);
                }
            }
            $filesArray[] = (array) $current;
            //Array representation of file objects, on which we can apply sorting, filtering, etc
        }
        $filesArray = eF_multiSort($filesArray, 'name', 'asc');
        $fileArrays = array_merge($foldersArray, $filesArray);
        isset($ajaxOptions['order']) && $ajaxOptions['order'] == 'asc' ? $ajaxOptions['order'] = 'asc' : ($ajaxOptions['order'] = 'desc');
        !isset($ajaxOptions['sort']) ? $ajaxOptions['sort'] = 'name' : null;
        !isset($ajaxOptions['limit']) ? $ajaxOptions['limit'] = 20 : null;
        !isset($ajaxOptions['offset']) ? $ajaxOptions['offset'] = 0 : null;
        !isset($ajaxOptions['filter']) ? $ajaxOptions['filter'] = '' : null;
        $size = sizeof($fileArrays);
        if ($size) {
开发者ID:kaseya-university,项目名称:efront,代码行数:67,代码来源:filesystem.class.php

示例10: array

 		}
 	}	
 	arsort($scores, SORT_NUMERIC);		
 	$result = array();	
 	foreach ($scores as $key => $value) {
 		$result[$key] = $search_results_lessons[$key];
 	}
 	$search_results_lessons = $result;
 */
 foreach ($search_results_current_lesson as $key => $value) {
     $search_results_current_lesson[$key] = eF_multiSort($search_results_current_lesson[$key], 'score', 'asc', true);
 }
 foreach ($search_results_courses as $key => $value) {
     $search_results_courses[$key] = eF_multiSort($search_results_courses[$key], 'score', 'asc', true);
 }
 $search_results_forum = eF_multiSort($search_results_forum, 'body', 'desc');
 if (extension_loaded('xapian')) {
     $results_filesystem = EfrontXapian::getInstance()->search($_POST['search_text']);
     if ($currentUser->user['user_type'] != 'administrator') {
         //non-admins don't have access to files outside their lessons
         $paths = array();
         foreach ($currentUser->getLessons(true) as $lesson) {
             if ($lesson->lesson['active'] && !$lesson->lesson['archive']) {
                 $paths[] = str_replace(G_ROOTPATH, '', $lesson->getDirectory());
             }
         }
         foreach ($results_filesystem as $key => $value) {
             $keep = false;
             foreach ($paths as $path) {
                 if (strpos($value['path'], $path) !== false) {
                     $keep = true;
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:module_search.php

示例11: eF_getTableData

                         }
                     }
                 }
             }
         }
     }
 }
 if ($found) {
     $employees = eF_getTableData($dif_tables, "users.*", $search_string, "");
     // @todo: problem with professors in one and students in another course
     foreach ($employees as $userId => $employee) {
         if ($employee['user_type'] != 'student') {
             unset($employees[$userId]);
         }
     }
     $employees = eF_multiSort($employees, $_GET['sort'], $order);
     if (isset($_GET['filter'])) {
         $employees = eF_filterData($employees, $_GET['filter']);
     }
     $smarty->assign("T_EMPLOYEES_SIZE", sizeof($employees));
     if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
         isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
         $employees = array_slice($employees, $offset, $limit);
     }
 } else {
     $employees = array();
 }
 $recipients = basename($_SERVER['PHP_SELF']) . "?ctg=messages&add=1&recipient=";
 $first = 1;
 foreach ($employees as $employee) {
     if ($first) {
开发者ID:kaseya-university,项目名称:efront,代码行数:31,代码来源:search_courses.php

示例12: getModule


//.........这里部分代码省略.........
             } else {
                 $this->setMessageVar(_BBBMEETINGHASFINISHED, "failure");
             }
         } else {
             $this->setMessageVar(_BBB_NOBBBSERVERDEFINED, "failure");
         }
     }
     if (isset($_GET['finished_meeting']) && eF_checkParameter($_GET['finished_meeting'], 'id')) {
         if ($userRole == "professor") {
             eF_updateTableData("module_BBB", array('status' => '2'), "id=" . $_GET['finished_meeting']);
         }
         $currentLesson = $this->getCurrentLesson();
         $_SESSION['previousSideUrl'] = G_SERVERNAME . "new_sidebar.php?new_lesson_id=" . $currentLesson->lesson['id'];
         $_SESSION['previousMainUrl'] = G_SERVERNAME . $currentUser->getType() . ".php?ctg=control_panel";
         header("location:" . $currentUser->getType() . "page.php");
     }
     if (isset($_GET['delete_BBB']) && eF_checkParameter($_GET['delete_BBB'], 'id') && $userRole == "professor") {
         eF_deleteTableData("module_BBB", "id=" . $_GET['delete_BBB']);
         eF_deleteTableData("module_BBB_users_to_meeting", "meeting_ID=" . $_GET['delete_BBB']);
         header("location:" . $this->moduleBaseUrl . "&message=" . urlencode(_BBB_SUCCESFULLYDELETEDBBBENTRY) . "&message_type=success");
     } else {
         if ($userRole == "professor" && (isset($_GET['add_BBB']) || isset($_GET['edit_BBB']) && eF_checkParameter($_GET['edit_BBB'], 'id'))) {
             // Create ajax enabled table for meeting attendants
             if (isset($_GET['edit_BBB'])) {
                 if (isset($_GET['ajax']) && $_GET['ajax'] == 'BBBUsersTable') {
                     isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
                     if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
                         $sort = $_GET['sort'];
                         isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
                     } else {
                         $sort = 'login';
                     }
                     $users = eF_getTableData("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN\n                                                    JOIN module_BBB ON module_BBB.lessons_ID = users_to_lessons.lessons_ID\n                                                    LEFT OUTER JOIN module_BBB_users_to_meeting ON module_BBB.id = module_BBB_users_to_meeting.meeting_ID AND users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login, users.name, users.surname, users.email, meeting_ID", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND users.login <> '" . $currentUser->user['login'] . "' AND module_BBB.id = '" . $_GET['edit_BBB'] . "'");
                     $users = eF_multiSort($users, $_GET['sort'], $order);
                     if (isset($_GET['filter'])) {
                         $users = eF_filterData($users, $_GET['filter']);
                     }
                     $smarty->assign("T_USERS_SIZE", sizeof($users));
                     if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
                         isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
                         $users = array_slice($users, $offset, $limit);
                     }
                     $smarty->assign("T_USERS", $users);
                     $smarty->display($this->getSmartyTpl());
                     exit;
                 } else {
                     $users = eF_getTableData("users JOIN users_to_lessons ON users.login = users_to_lessons.users_LOGIN\n                                                    JOIN module_BBB ON module_BBB.lessons_ID = users_to_lessons.lessons_ID\n                                                    LEFT OUTER JOIN module_BBB_users_to_meeting ON module_BBB.id = module_BBB_users_to_meeting.meeting_ID AND users.login = module_BBB_users_to_meeting.users_LOGIN", "users.login, users.name, users.surname, meeting_ID", "users_to_lessons.lessons_ID = '" . $_SESSION['s_lessons_ID'] . "' AND users.login <> '" . $currentUser->user['login'] . "' AND module_BBB.id = '" . $_GET['edit_BBB'] . "'");
                     $smarty->assign("T_USERS", $users);
                 }
             }
             $form = new HTML_QuickForm("BBB_entry_form", "post", $_SERVER['REQUEST_URI'] . "&tab=users", "", null, true);
             $form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
             //Register this rule for checking user input with our function, eF_checkParameter
             $form->addElement('text', 'name', null, 'class = "inputText"');
             $form->addRule('name', _BBBTHEFIELDNAMEISMANDATORY, 'required', null, 'client');
             // Dates
             $days = array();
             for ($i = 1; $i < 32; $i++) {
                 $days[$i] = $i;
             }
             $months = array();
             for ($i = 1; $i <= 12; $i++) {
                 $months[$i] = $i;
             }
             $years = array();
             for ($i = 2008; $i < 2015; $i++) {
开发者ID:bqq1986,项目名称:efront,代码行数:67,代码来源:module_bbb.class.php

示例13: professorLessonToExcel

 private function professorLessonToExcel($lessonID, $lessonName, $workBook, $workSheet)
 {
     $headerFormat =& $workBook->addFormat(array('border' => 0, 'bold' => '1', 'size' => '12', 'color' => 'black', 'fgcolor' => 22, 'align' => 'center'));
     $titleCenterFormat =& $workBook->addFormat(array('HAlign' => 'center', 'Size' => 11, 'Bold' => 1));
     $fieldCenterFormat =& $workBook->addFormat(array('HAlign' => 'center', 'Size' => 10));
     $lessonColumns = $this->getLessonColumns($lessonID);
     $allUsers = $this->getLessonUsers($lessonID, $lessonColumns);
     $currentLesson = $this->getCurrentLesson();
     $lessonUsers = $currentLesson->getUsers('student');
     foreach ($allUsers as $key => $value) {
         if (!isset($lessonUsers[$value['users_LOGIN']])) {
             unset($allUsers[$key]);
         }
     }
     $allUsers = eF_multiSort($allUsers, 'surname', 'desc');
     $columnsNr = $this->getNumberOfColumns($lessonID);
     $workSheet->setInputEncoding('utf-8');
     $workSheet->write(0, 0, $lessonName, $headerFormat);
     $workSheet->mergeCells(0, 0, 0, 3 + $columnsNr - 1);
     $workSheet->setColumn(0, 1 + $columnsNr - 1, 30);
     $workSheet->setColumn($columnsNr + 1, $columnsNr + 2, 15);
     $col = 1;
     $workSheet->write(2, 0, _GRADEBOOK_STUDENT_NAME, $titleCenterFormat);
     foreach ($lessonColumns as $key => $value) {
         $workSheet->write(2, $col++, $value['name'] . ' (' . _GRADEBOOK_COLUMN_WEIGHT_DISPLAY . ': ' . $value['weight'] . ')', $titleCenterFormat);
     }
     $workSheet->write(2, $col++, _GRADEBOOK_SCORE, $titleCenterFormat);
     $workSheet->write(2, $col++, _GRADEBOOK_GRADE, $titleCenterFormat);
     $col = 0;
     $row = 3;
     foreach ($allUsers as $key => $student) {
         $user = EfrontUserFactory::factory($student['users_LOGIN']);
         $workSheet->write($row, $col++, $user->user['name'] . ' ' . $user->user['surname'] . ' (' . $user->user['login'] . ')', $fieldCenterFormat);
         foreach ($student['grades'] as $key2 => $grade) {
             $workSheet->write($row, $col++, $grade['grade'], $fieldCenterFormat);
         }
         $workSheet->write($row, $col++, $student['score'], $fieldCenterFormat);
         $workSheet->write($row, $col++, $student['grade'], $fieldCenterFormat);
         $col = 0;
         $row++;
     }
 }
开发者ID:kaseya-university,项目名称:efront,代码行数:42,代码来源:module_gradebook.class.php

示例14: unset

     }
     if ($_GET['ctg'] == 'feedback' && $question['type'] == 'true_false') {
         unset($questions[$qid]);
     }
 }
 foreach ($testQuestions as $gid => $question) {
     $questions[$gid]['partof'] = 1;
 }
 isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'uint') ? $limit = $_GET['limit'] : ($limit = G_DEFAULT_TABLE_SIZE);
 if (isset($_GET['sort']) && eF_checkParameter($_GET['sort'], 'text')) {
     $sort = $_GET['sort'];
     isset($_GET['order']) && $_GET['order'] == 'desc' ? $order = 'desc' : ($order = 'asc');
 } else {
     $sort = 'text';
 }
 $questions = eF_multiSort($questions, $sort, $order);
 if (isset($_GET['filter'])) {
     $questions = eF_filterData($questions, $_GET['filter']);
 }
 $smarty->assign("T_QUESTIONS_SIZE", sizeof($questions));
 if (isset($_GET['limit']) && eF_checkParameter($_GET['limit'], 'int')) {
     isset($_GET['offset']) && eF_checkParameter($_GET['offset'], 'int') ? $offset = $_GET['offset'] : ($offset = 0);
     $questions = array_slice($questions, $offset, $limit, true);
 }
 foreach ($questions as $gid => $question) {
     if (!empty($testQuestions[$gid])) {
         $form->setDefaults(array('questions[' . $gid . ']' => 1, 'question_weight[' . $gid . ']' => $testQuestions[$gid]['weight']));
     } else {
         $form->setDefaults(array('question_weight[' . $gid . ']' => $question['weight']));
     }
 }
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:add_test.php

示例15: foreach

     }
 }
 foreach ($forumTree as $key => $value) {
     //Calculate recursively the number of topics and messages in each forum, as well as the last post in each forum
     $stats = f_forums::calculateForumStats($forumTree, $key, $forum_topics, $forum_polls, $forum_messages, $last_post);
     $forums[$key]['topics'] = $stats['topics'];
     $forums[$key]['polls'] = $stats['polls'];
     $forums[$key]['messages'] = $stats['messages'];
     $forums[$key]['last_post'] = $stats['last_post'];
     $forums[$key]['last_post_timestamp'] = $stats['last_post']['timestamp'];
     $forums[$key]['subforums'] = sizeof($forumTree[$key]);
     $forums[$key]['activity'] = sizeof($forumTree[$key]) . $stats['topics'] . $stats['messages'];
 }
 unset($forums[0]);
 //Unset node with id 0, since this refers to the root node (which does not exist)
 $forums = eF_multiSort($forums, 'title');
 //Show forums in alphabetical order
 //remove inactive and archived lessons
 $result = eF_getTableDataFlat("lessons", "id", "active=0 OR archive!=''");
 if (!empty($result['id'])) {
     foreach ($forums as $key => $value) {
         if (in_array($value['lessons_ID'], $result['id']) !== false) {
             unset($forums[$key]);
         }
     }
 }
 //pr($forums);
 $dataSource = $forums;
 $tableName = 'forumsTable';
 /**Handle sorted table's sorting and filtering*/
 include "sorted_table.php";
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:31,代码来源:forum.php


注:本文中的eF_multiSort函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。