Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dannybd/courseroad
/ functions
Functions
93 in github.com/dannybd/courseroad
⨍
Functions
93
◇
Types & classes
1
↓ 25 callers
Function
dieJSON
* Set the header type to Javascript and JSON encode the result. */
functions.php:59
↓ 9 callers
Function
alertBadCSRF
()
js/cr.js:959
↓ 9 callers
Function
badCSRF
(data)
js/cr.js:955
↓ 8 callers
Method
_executeStatement
* Execute a given mysqli statement and return sucess & debug info * * Used for UPDATE/INSERT/DELETE statements, to make sure that they happened
CourseRoadDB.php:594
↓ 8 callers
Function
requireCSRF
()
functions.php:30
↓ 8 callers
Function
requirePostDataFields
()
functions.php:64
↓ 7 callers
Function
addAllWires
(reloadNotify)
js/cr.js:594
↓ 7 callers
Function
askBeforeLeaving
(startAsking)
js/cr.js:916
↓ 6 callers
Method
decrypt
* Decrypts content which was stored in the database * * The goal is to obfuscate some of the data in the database so it isn't * in plaintext
CourseRoadDB.php:129
↓ 6 callers
Function
getHash
()
js/cr.js:963
↓ 6 callers
Function
parseBoolStr
($str)
output.php:157
↓ 5 callers
Function
redirectHash
($hash)
functions.php:47
↓ 5 callers
Function
setNewHash
(hash)
js/cr.js:967
↓ 4 callers
Function
getRequisiteElement
($str, $is_coreq)
output.php:260
↓ 4 callers
Function
hashOwner
($hash)
functions.php:442
↓ 4 callers
Function
properYear
(classterm)
js/cr.js:659
↓ 4 callers
Function
unhighlightClasses
Helper functions
js/cr.js:844
↓ 3 callers
Function
applyCallbackFn
* Allows for supplying a callback function to run when a class is found which * successfully acts as a requisite for the requirements. The arguments
js/cr.js:159
↓ 3 callers
Function
buildCheckbox
(arr)
js/cr.js:760
↓ 3 callers
Function
classFromJSON
Course-loading functions
js/cr.js:624
↓ 3 callers
Function
fetchClassData
(postData, classterm, oldclass)
js/cr.js:664
↓ 3 callers
Function
getDefaultUserPrefs
()
functions.php:388
↓ 3 callers
Method
getUserPrefs
* Get a given user's preferences from the users table * * @param string $athena a string of the user's username * * @return array data of
CourseRoadDB.php:528
↓ 3 callers
Function
minclass
* Creates the storable string which holds our precious class data. * Used primarily in saved classes
js/cr.js:868
↓ 3 callers
Function
minmajors
(stringify)
js/cr.js:896
↓ 3 callers
Function
noCacheLink
($uri)
functions.php:450
↓ 3 callers
Function
pullClass
* Create an array of info on a particular class of a particular year. */
functions.php:79
↓ 2 callers
Function
checkRequisites
(arr, callback, callbackArgs, level)
js/cr.js:198
↓ 2 callers
Function
deGIR
(str)
js/cr.js:852
↓ 2 callers
Function
defaultOwnedHashName
($owner)
functions.php:446
↓ 2 callers
Function
draggableChecklist
()
js/cr.js:821
↓ 2 callers
Method
encrypt
* Encrypts content for storage in the database * * The goal is to obfuscate some of the data in the database so it isn't * in plaintext if th
CourseRoadDB.php:100
↓ 2 callers
Function
getCSRFToken
()
functions.php:15
↓ 2 callers
Function
getClasses
(classList, reloadNotify)
js/cr.js:712
↓ 2 callers
Function
getCurrentAcademicYear
()
js/cr.js:943
↓ 2 callers
Function
getMatchObject
* Builds match requirement object from requisites syntax. By default, you * expect something like "18.03", but you must also handle extra information
js/cr.js:139
↓ 2 callers
Function
getMatchParams
* Builds match parameters object from requisites syntax. Handles when the match * param is a number and when it is an object. Returns a match params
js/cr.js:113
↓ 2 callers
Method
getSavedRoads
* Pulls a list of saved roads and their data of a given user * * @param string $athena a string of the user's username * * @return array a
CourseRoadDB.php:360
↓ 2 callers
Method
hashExists
* Determines whether a hash maps to a road in the database * * Checks both the hash directly, and whether the hash is actually a user's * nam
CourseRoadDB.php:258
↓ 2 callers
Function
importUserPrefs
($athena)
functions.php:414
↓ 2 callers
Method
isHashSafe
* Checks whether a hash is safe to overwrite * * Make sure that the newly saved hash won't overwrite a prior road * with a different set of c
CourseRoadDB.php:287
↓ 2 callers
Function
makeUserSettingsHTML
()
functions.php:422
↓ 2 callers
Function
pullCustom
* Create an array of info on a custom-created class. */
functions.php:286
↓ 2 callers
Function
redirectToAuth
()
js/cr.js:977
↓ 2 callers
Function
setPageTitle
()
js/cr.js:973
↓ 2 callers
Function
swapClassYear
(oldclass, newyear)
js/cr.js:930
↓ 2 callers
Method
updateUserPrefs
* Update a given user's preferences * * @param string $athena a string of the user's username * @param array $userprefs an associative ar
CourseRoadDB.php:565
↓ 1 callers
Method
addUser
* Adds a user to the users table, with default values * * Use updateUserPrefs($athena, $userprefs) below to set other values * * @param st
CourseRoadDB.php:511
↓ 1 callers
Function
addWires
(div, addwires)
js/cr.js:414
↓ 1 callers
Function
assertValidHash
($hash)
functions.php:39
↓ 1 callers
Function
buildClassesArray
($hash)
functions.php:331
↓ 1 callers
Function
buildMajor
(branch, level)
js/cr.js:758
↓ 1 callers
Method
changeRoadHash
* Changes a road's hash when a user renames one of their saved roads * * @param string $oldhash a string of the old road hash * @param string
CourseRoadDB.php:429
↓ 1 callers
Function
checkCSRFToken
()
functions.php:23
↓ 1 callers
Function
checkClasses
()
js/cr.js:515
↓ 1 callers
Method
copyRoad
* Copies a road's hash when a user saves with login * * When a user logs in, we need to duplicate their just-saved road into a * road saved u
CourseRoadDB.php:489
↓ 1 callers
Method
deleteRoad
* Deletes a user's saved road * * @param string $hash a string of the road hash * @param string $athena a string of the user's username
CourseRoadDB.php:466
↓ 1 callers
Function
fetchDataFromLDAP
($user)
functions.php:398
↓ 1 callers
Method
getAutocompleteResults
* Fetches the top autocompleted subject ids from a given query * * @param string $query a string which is part/all of a course id * * @ret
CourseRoadDB.php:154
↓ 1 callers
Function
getBaseURL
()
functions.php:6
↓ 1 callers
Method
getBestClassInfo
* Fetches the class info for a course id as close to the desired year as * possible * * If no year is requested, we pull the class info from
CourseRoadDB.php:194
↓ 1 callers
Function
getClass
()
js/cr.js:679
↓ 1 callers
Method
getClassDataFromRoad
* Pulls class and major data for a given road * * Also accounts for whether the hash is actually a user's username (and that * user has a pub
CourseRoadDB.php:337
↓ 1 callers
Function
getCurrentAcademicYear
()
functions.php:384
↓ 1 callers
Function
getCurrentSemesterID
()
js/cr.js:948
↓ 1 callers
Method
getDB
* Accessor for the private database link (for __DEV__ mode only) * * @return object the database link * @throws die trying to load the db obj
CourseRoadDB.php:80
↓ 1 callers
Method
getYearsClassOffered
* Pulls a list of years a class has been offered * * @param string $class a string of a course id * * @return array<int> the years that cl
CourseRoadDB.php:230
↓ 1 callers
Method
hasPublicRoad
* Checks whether a given user has a public road set * * @param string $athena a string of the user's username * * @return bool whether the
CourseRoadDB.php:382
↓ 1 callers
Function
hideAutocomplete
()
js/cr.js:999
↓ 1 callers
Method
initialize
* Initializes the database link $_db with its variables * * Creates a new mysqli object and stores that database link for use in the * other
CourseRoadDB.php:61
↓ 1 callers
Function
makeClassInfoHTML
* Generate the innerHTML for the info box to be used for when the class is * highlighted. */
functions.php:238
↓ 1 callers
Function
makeYearRange
* Turn "2013" into "'12-'13" */
functions.php:230
↓ 1 callers
Function
makeYearsOfferedHTML
* Generate the HTML of the dropdown which holds the list of offered years for * a given class. */
functions.php:270
↓ 1 callers
Function
newCSRFToken
()
functions.php:11
↓ 1 callers
Function
parseRequisites
($str)
output.php:161
↓ 1 callers
Method
saveNewRoad
* Saves new road into database with given data * * Note that this method does NOT check if a hash is safe to overwrite before * running. *
CourseRoadDB.php:315
↓ 1 callers
Method
setPublicRoad
* Sets a hash as a public road for a given user * * Since only one road per user may be public, this also sets all of their * other roads to
CourseRoadDB.php:409
↓ 1 callers
Method
setRoadComment
* Sets a comment on a user's saved road * * @param string $oldhash a string of the road hash * @param string $comment a string of the road co
CourseRoadDB.php:448
↓ 1 callers
Function
updateWires
()
js/cr.js:495
↓ 1 callers
Method
userExists
* Check whether a given user exists * * @param string $athena a string of the user's username * * @return bool whether user exists * @a
CourseRoadDB.php:549
Function
Konami
(callback)
js/cr.js:1703
Method
__construct
* Overwrite the constructor to prevent CourseRoadDB singletons */
CourseRoadDB.php:25
Function
checkMajor
()
js/cr.js:729
Function
checkOff
Major/minor functions
js/cr.js:721
Function
crSetup
()
js/cr.js:1005
Function
explainBadLoginHelp
()
js/cr.js:983
Function
exportfunc
()
js/cr.js:1365
Function
filterRangeMatches
()
js/cr.js:214
Function
iterateClassMatches
()
js/cr.js:257
Function
iterateRangeMatches
()
js/cr.js:227
Function
newWire
* Defines new wire's properties (black/grey, straight/curved) * partially based on the relative semesters and terms of the two * would-be connected
js/cr.js:382
Function
requisiteBranchMatchParams
()
js/cr.js:211
Function
runBeforeUnload
UI/Page-loading functions
js/cr.js:909