Main Page | Directories | File List | File Members

wme_utils.inc.php File Reference


Functions

 _WME_CONNECT_DB ($server, $username, $password, $database)
 Connects to WME database. The constants here are defined in the WME configuration file.
 _WME_GET_BREADCRUMB ($delimiter=-1)
 Automatically generates breadcrumb navigation.
 _WME_USER_LOGIN ($username, $password, $referer_url="")
 Logs in a user with the provided login information.
 _WME_USER_LOGOUT ($referer_url="")
 Logs in a user out unconditionally.
 _WME_USER_IS_LOGGED_IN ()
 Checks if a user is logged in.
 _WME_PRINT_LOGIN_FORM ($action_url, $username_fieldname="WME_USERNAME", $passwd_fieldname="WME_PASSWORD", $submit_button_text="Login")
 Prints a generic login form.
 _WME_ADD_TM ($tm_name, $tm_version, $tm_author, $tm_image, $tm_location)
 Inserts a TM entry into the database.
 _WME_ADD_TLP ($parent_tmID, $tlp_name, $tlp_location, $tlp_sort_order)
 Inserts a TLP entry into the database.
 _WME_ADD_VSEC ($parent_tlpID, $vsec_content, $vsec_display=1, $vsec_sort_order=-1)
 Inserts a VSec entry into the database. Do not confuse with _WME_ADD_VSEC_CONTENT(...), as this is used during TM installation.
 _WME_ADD_QUESTION_SET ($parent_vsecID, $qset_name, $qset_display=1, $qset_sort_order=-1)
 Creates a question set within a specified Vsec.
 _WME_ADD_QUESTION ($parent_qsetID, $question_content, $question_display=1, $question_sort_order=-1)
 Creates a question within a specified question set.
 _WME_ADD_VSEC_CONTENT ($parent_tlpID, $map_sectionID, $vsec_content, $vsec_display=1, $vsec_sort_order=-1)
 Creates a VSec file and map the file to its relative course section Do not confuse with _WME_ADD_VSEC(...), as this is used when a new Vsec is introduced to an existent TM (most likely from customization).
 _WME_DEL_QUESTION_SET ($qsetID)
 Removes a specified question set.
 _WME_DEL_QUESTION ($questionID)
 Removes a specified question.
 _WME_REMOVE_VSEC ($vsecID=-1)
 Removes a specified VSec.
 _WME_GET_TM_LOCATION ($tmID=-1)
 Returns TM's relative location.
 _WME_GET_TLP_LOCATION ($tlpID=-1)
 Returns TLP's relative location.
 _WME_GET_TLP_LOCATION_INCL_TM ($tlpID=-1)
 Returns TLP's relative location, including the location of its respective TM.
 _WME_GET_VSEC_LOCATION ($vsecID=-1)
 Returns VSec's absolute path.
 _WME_GET_TMID_BY_VSEC ($vsecID=-1)
 Returns the primary ID of the specified VSec's parent TM.
 _WME_GET_TLPID_BY_VSEC ($vsecID=-1)
 Returns the primary ID of the specified VSec's parent TLP.
 _WME_GET_TMID_BY_TLP ($tlpID=-1)
 Returns the primary ID of the specified TLP's parent TM.
 _WME_GET_TMID_BY_FILENAME ($file)
 Returns the primary ID of the specified file's parent TM ID.
 _WME_GET_TLPID_BY_FILENAME ($file)
 Returns the primary ID of the specified file's TLP ID.
 _WME_GET_TLP_COUNT_BY_TM ($tmID)
 Get the number of TLPs within a TM.
 _WME_GET_TM_NAME ($tmID)
 Get the name of a TM.
 _WME_GET_TLP_NAME ($tlpID=-1)
 Get the name of a TLP.
 _WME_GET_VSEC_ID ()
 Gets the vsecID if passed via HTTP GET or POST.
 _WME_GET_ACTION_TYPE ()
 Gets the admin action type if passed via HTTP GET or POST.
 _WME_GET_QUESTION_SET_ID ()
 Gets the question_setID if passed via HTTP GET or POST.
 _WME_GET_QUESTION_ID ()
 Gets the questionID if passed via HTTP GET or POST.
 _WME_GET_GRADE_ID ()
 Gets the gradeID if passed via HTTP GET or POST.
 _WME_GET_COURSE_ID ()
 Gets the courseID if passed via HTTP GET or POST.
 _WME_GET_TM_ID ()
 Gets the tmID if passed via HTTP GET or POST.
 _WME_GET_TLP_ID ()
 Gets the tlpID if passed via HTTP GET or POST.
 _WME_GET_SECTION_ID ()
 Gets the sectionID if passed via HTTP GET or POST.
 _WME_GET_USER_ID ()
 Gets the userID if passed via HTTP GET or POST.
 _WME_GET_TEACHER_ID ()
 Gets the teacherID if passed via HTTP GET or POST.
 _WME_SET_SESSION_VAR ($key, $value)
 Registers a session variable.
 _WME_UNSET_SESSION_VAR ($key)
 Unregister a session variable.
 _WME_POPULATE_SESSION_VARS ()
 Populates session variables Executed automatically internally.
 _WME_GET_USER_FULLNAME ($userID=-1)
 Gets the full name of a specified user.
 _WME_GET_USER_STATUS_REF ($userID=-1)
 Gets a reference to a user's status Returns reference because a user can attain multiple statuses.
 _WME_GET_USER_REF ($userID=-1)
 Gets a reference of a specific user, or all users.
 _WME_GET_USER_REF_WITH_STATUS ($userID=-1, $status="")
 Gets a reference of a specific user, or all users with status specified.
 _WME_GET_USER_LOGIN ($userID=-1)
 Gets the username of a specified user.
 _WME_GET_TLP_REF_BY_TM ($tmID=-1)
 Gets a reference of all TLPs relative to a specific TM.
 _WME_GET_VSEC_REF_BY_TLP ($tlpID=-1)
 Gets a reference of all VSECs relative to a specific TLP.
 _WME_GET_TM_REF ($tmID=-1)
 Gets a reference of a specific TM, or all TMs.
 _WME_GET_TM_REF_BY_MAP ($mapID=-1)
 Gets a reference of all TMs relative to a specific course section.
 _WME_GET_GRADE_LEVEL_REF ($gradeLevelID=-1)
 Gets a reference of all or specific grade level.
 _WME_SECTION_IS_USING_TM ($sectionID, $tmID)
 Check if a course section is using a specified TM.
 _WME_SECTION_IS_USING_TLP ($sectionID, $tlpID)
 Check if a course section is using a specified TLP.
 _WME_IS_MY_TLP (&$sectionID, &$tlpID)
 Checks if specified TLP and section belongs to the session user.
 _WME_TM_SECTION_RECORD_EXISTS ($sectionID, $tmID)
 Checks if a TM to course section map exists.
 _WME_TLP_SECTION_RECORD_EXISTS ($sectionID, $tlpID)
 Checks if a TLP to course section map exists.
 _WME_GET_TM_REF_BY_SECTION ($sectionID)
 Gets reference to all TMs used by specified course section.
 _WME_GET_ACTIVE_TM_REF_BY_SECTION ($sectionID)
 Gets reference to all active TMs used by specified course section.
 _WME_GET_VSEC_CONTENT ($vsecID=-1)
 Get the file name of a specified VSec.
 _WME_IS_TEACHER ($userID=-1)
 Checks if user is a teacher.
 _WME_IS_ADMIN ($userID)
 Checks if user is an admin.
 _WME_IS_STUDENT ($userID)
 Checks if user is a student.
 _WME_GET_SECTION_REF ($sectionID=-1)
 Gets reference to all course sections or specified section.
 _WME_GET_SECTION_REF_BY_TM_MAP ($mapID=-1)
 Gets reference to course section(s) by TM mapping. Returns all sections that are using a TM.
 _WME_GET_TLP_REF_BY_TM_SECTION ($tmID=-1, $sectionID=-1, $getActive=-1)
 Gets reference to TLPs that are being used by a course section.
 _WME_GET_VSEC_REF_BY_TLP_SECTION ($tlpID=-1, $sectionID=-1)
 Gets reference to VSecs that are being used by a course section.
 _WME_GET_SECTION_REF_BY_USER ($userID=-1)
 Gets reference to course sections that are taught by a specified user.
 _WME_GET_SECTION_REF_BY_USER_COURSE ($userID=-1, $courseID=-1)
 Gets reference to course sections that are taught by a specified user, under a specified course.
 _WME_GET_SECTION_REF_BY_COURSE ($courseID=-1)
 Gets reference to course sections under a specified course.
 _WME_GET_SECTION_TEACHER_ID ($sectionID=-1)
 Gets user ID of the teacher who is instructing the specified course section.
 _WME_GET_SECTION_LOCATION ($sectionID=-1)
 Gets the location where a course section is being taught.
 _WME_GET_SECTION_TIME ($sectionID=-1)
 Gets the time when a course section is being taught.
 _WME_GET_COURSE_REF ($courseID=-1)
 Gets reference to all courses or a specific course.
 _WME_GET_COURSE_REF_BY_USER ($userID=-1)
 Gets reference to courses by teachers who teach one or more of its sections.
 _WME_GET_COURSE_REF_BY_SECTION ($sectionID=-1)
 Gets reference to a parent course by a section.
 _WME_GET_COURSE_REF_BY_GRADE ($gradeID=-1)
 Gets reference to course(s) under a specified grade level.
 _WME_GET_COURSE_NUMBER ($courseID=-1)
 Gets a course's course number.
 _WME_GET_COURSE_NAME ($courseID=-1)
 Gets a course's name.
 _WME_GET_QUESTION_SET_REF_BY_VSEC ($vsecID=-1)
 Gets reference to set of questions by its parent VSec.
 _WME_GET_DEFAULT_VSEC_REF ($tlpID)
 Gets reference to default versions of VSecs by their parent TLP.
 _WME_GET_CUSTOM_VSEC_REF ($tlpID, $sectionID)
 Gets reference to customized versions of VSecs by their parent TLP and course section.
 _WME_PRINT_VSEC_QUESTIONS ($vsecID, $answerable=1)
 Prints an XHTML form for user input to questions.
 _WME_GET_QUESTION_SET_NAME ($setID)
 Gets name of a question set.
 _WME_GET_QUESTION_CONTENT ($questionID=-1)
 Gets content of a question.
 _WME_GET_DISPLAYED_QUESTION_SET_REF ($vsecID)
 Gets reference to all displayed question sets of a VSec.
 _WME_GET_QUESTION_REF ($questionID)
 Gets reference to a specific question.
 _WME_GET_QUESTION_REF_BY_SET ($setID)
 Gets reference to questions by their parent question set.
 _WME_GET_DISPLAYED_QUESTION_REF ($setID)
 Gets reference to displayed questions by their parent question set.
 _WME_GET_QUESTION_REPLIES_REF ($setID)
 Gets reference to questions by their parent question set.
 _WME_GET_QUESTION_LAST_ORDER ($setID)
 Gets the highest numbered ordering of a question set.

Function Documentation

_WME_ADD_QUESTION parent_qsetID,
question_content,
question_display = 1,
question_sort_order = -1
 

Creates a question within a specified question set.

Parameters:
$parent_qsetID Primary ID of the parent question set
$question_content The question to be asked
$question_display Optional. 1 if displayed | 0 if hidden. Displayed by default.
$question_sort_order Optional. Questions are sorted ascendingly by this number. Placed last by default.
Returns:
integer The primary ID of the newly inserted row

_WME_ADD_QUESTION_SET parent_vsecID,
qset_name,
qset_display = 1,
qset_sort_order = -1
 

Creates a question set within a specified Vsec.

Parameters:
$parent_vsecID Primary ID of the question set's parent VSec
$qset_name Name of question set
$qset_display Optional. 1 if displayed | 0 if hidden. Displayed by default.
$qset_sort_order Optional. Question Sets are sorted ascendingly by this number. Placed last by default.
Returns:
integer The primary ID of the newly inserted row

_WME_ADD_TLP parent_tmID,
tlp_name,
tlp_location,
tlp_sort_order
 

Inserts a TLP entry into the database.

Parameters:
$parent_tmID Primary ID of the TLP's parent TM
$tlp_name 
$tlp_location 
$tlp_sort_order TLPs are sorted ascendingly by this number
Returns:
integer The primary ID of the newly inserted row

_WME_ADD_TM tm_name,
tm_version,
tm_author,
tm_image,
tm_location
 

Inserts a TM entry into the database.

Parameters:
$tm_name 
$tm_version 
$tm_author 
$tm_image 
$tm_location 
Returns:
integer The primary ID of the newly inserted row

_WME_ADD_VSEC parent_tlpID,
vsec_content,
vsec_display = 1,
vsec_sort_order = -1
 

Inserts a VSec entry into the database. Do not confuse with _WME_ADD_VSEC_CONTENT(...), as this is used during TM installation.

Parameters:
$parent_tlpID Primary ID of the VSec's parent TLP
$vsec_content Filename that holds Vsec's content
$vsec_display Optional. 1 if displayed | 0 if hidden. Displayed by default
$vsec_sort_order Optional. Vsecs are sorted ascendingly by this number. Placed last by default.
Returns:
integer The primary ID of the newly inserted row

_WME_ADD_VSEC_CONTENT parent_tlpID,
map_sectionID,
vsec_content,
vsec_display = 1,
vsec_sort_order = -1
 

Creates a VSec file and map the file to its relative course section Do not confuse with _WME_ADD_VSEC(...), as this is used when a new Vsec is introduced to an existent TM (most likely from customization).

Parameters:
$parent_tlpID Primary ID of the parent TLP of the VSec
$map_sectionID Primary ID of the course section that this VSec is available for
$vsec_content Content of the VSec (normally XHTML with or without scripting)
$vsec_display Optional. 1 if displayed | 0 if hidden. Displayed by default.
$vsec_sort_order Optional. VSecs are sorted ascendingly by this number. Placed last by default.
Returns:
integer The primary ID of the newly inserted row

_WME_CONNECT_DB server,
username,
password,
database
 

Connects to WME database. The constants here are defined in the WME configuration file.

Parameters:
$server The database server
$username 
$password 
$database Which database to use
Returns:
true|false true on success

_WME_DEL_QUESTION questionID  ) 
 

Removes a specified question.

Parameters:
$questionID Primary ID of the question to be removed
Returns:
NULL

_WME_DEL_QUESTION_SET qsetID  ) 
 

Removes a specified question set.

Parameters:
$qsetID Primary ID of the question set to be removed
Returns:
NULL

_WME_GET_ACTION_TYPE  ) 
 

Gets the admin action type if passed via HTTP GET or POST.

Returns:
string|NULL The passed action type on success, NULL string otherwise

_WME_GET_ACTIVE_TM_REF_BY_SECTION sectionID  ) 
 

Gets reference to all active TMs used by specified course section.

Parameters:
$sectionID Primary ID of a course section
Returns:
reference

_WME_GET_BREADCRUMB delimiter = -1  ) 
 

Automatically generates breadcrumb navigation.

Parameters:
$delimiter The breadcrumb delimiter. Defaults to "greater-than" sign.
Returns:
string The generated breadcrumb

_WME_GET_COURSE_ID  ) 
 

Gets the courseID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed courseID on success, NULL string otherwise

_WME_GET_COURSE_NAME courseID = -1  ) 
 

Gets a course's name.

Parameters:
$courseID Primary ID of a course
Returns:
string

_WME_GET_COURSE_NUMBER courseID = -1  ) 
 

Gets a course's course number.

Parameters:
$courseID Primary ID of a course
Returns:
string

_WME_GET_COURSE_REF courseID = -1  ) 
 

Gets reference to all courses or a specific course.

Parameters:
$courseID Optional primary ID of a course
Returns:
reference

_WME_GET_COURSE_REF_BY_GRADE gradeID = -1  ) 
 

Gets reference to course(s) under a specified grade level.

Parameters:
$gradeID Primary ID of a grade level
Returns:
reference

_WME_GET_COURSE_REF_BY_SECTION sectionID = -1  ) 
 

Gets reference to a parent course by a section.

Parameters:
$sectionID Primary ID of a course section
Returns:
reference

_WME_GET_COURSE_REF_BY_USER userID = -1  ) 
 

Gets reference to courses by teachers who teach one or more of its sections.

Parameters:
$userID Primary ID of a user
Returns:
reference

_WME_GET_CUSTOM_VSEC_REF tlpID,
sectionID
 

Gets reference to customized versions of VSecs by their parent TLP and course section.

Parameters:
$tlpID Primary ID of a TLP
$sectionID Primary ID of a course section
Returns:
reference

_WME_GET_DEFAULT_VSEC_REF tlpID  ) 
 

Gets reference to default versions of VSecs by their parent TLP.

Parameters:
$tlpID Primary ID of a TLP
Returns:
reference

_WME_GET_DISPLAYED_QUESTION_REF setID  ) 
 

Gets reference to displayed questions by their parent question set.

Parameters:
$setID Primary ID of a Question set
Returns:
reference

_WME_GET_DISPLAYED_QUESTION_SET_REF vsecID  ) 
 

Gets reference to all displayed question sets of a VSec.

Parameters:
$vsecID Primary ID of a VSec
Returns:
reference

_WME_GET_GRADE_ID  ) 
 

Gets the gradeID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed gradeID on success, NULL string otherwise

_WME_GET_GRADE_LEVEL_REF gradeLevelID = -1  ) 
 

Gets a reference of all or specific grade level.

Parameters:
$gradeLevelID Optional primary ID of a grade level. Returns reference to this TM if specified.
Returns:
reference Reference to user query

_WME_GET_QUESTION_CONTENT questionID = -1  ) 
 

Gets content of a question.

Parameters:
$questionID Primary ID of a Question
Returns:
string Content of the specified question

_WME_GET_QUESTION_ID  ) 
 

Gets the questionID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed questionID on success, NULL string otherwise

_WME_GET_QUESTION_LAST_ORDER setID  ) 
 

Gets the highest numbered ordering of a question set.

Parameters:
$setID Primary ID of a Question set
Returns:
integer

_WME_GET_QUESTION_REF questionID  ) 
 

Gets reference to a specific question.

Parameters:
$questionID Primary ID of a Question
Returns:
reference

_WME_GET_QUESTION_REF_BY_SET setID  ) 
 

Gets reference to questions by their parent question set.

Parameters:
$setID Primary ID of a Question set
Returns:
reference

_WME_GET_QUESTION_REPLIES_REF setID  ) 
 

Gets reference to questions by their parent question set.

Parameters:
$setID Primary ID of a Question set
Returns:
reference

_WME_GET_QUESTION_SET_ID  ) 
 

Gets the question_setID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed question_setID on success, NULL string otherwise

_WME_GET_QUESTION_SET_NAME setID  ) 
 

Gets name of a question set.

Parameters:
$setID Primary ID of a Question set
Returns:
string Name of the specified question set

_WME_GET_QUESTION_SET_REF_BY_VSEC vsecID = -1  ) 
 

Gets reference to set of questions by its parent VSec.

Parameters:
$vsecID Primary ID of a VSec
Returns:
reference

_WME_GET_SECTION_ID  ) 
 

Gets the sectionID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed sectionID on success, NULL string otherwise

_WME_GET_SECTION_LOCATION sectionID = -1  ) 
 

Gets the location where a course section is being taught.

Parameters:
$sectionID Primary ID of a section
Returns:
string

_WME_GET_SECTION_REF sectionID = -1  ) 
 

Gets reference to all course sections or specified section.

Parameters:
$sectionID Optional primary ID of a course section
Returns:
reference

_WME_GET_SECTION_REF_BY_COURSE courseID = -1  ) 
 

Gets reference to course sections under a specified course.

Parameters:
$courseID Primary ID of a course
Returns:
reference

_WME_GET_SECTION_REF_BY_TM_MAP mapID = -1  ) 
 

Gets reference to course section(s) by TM mapping. Returns all sections that are using a TM.

Parameters:
$mapID Primary ID of the TM-to-section mapping
Returns:
reference

_WME_GET_SECTION_REF_BY_USER userID = -1  ) 
 

Gets reference to course sections that are taught by a specified user.

Parameters:
$userID Primary ID of a user
Returns:
reference

_WME_GET_SECTION_REF_BY_USER_COURSE userID = -1,
courseID = -1
 

Gets reference to course sections that are taught by a specified user, under a specified course.

Parameters:
$userID Primary ID of a user
$courseID Primary ID of a course
Returns:
reference

_WME_GET_SECTION_TEACHER_ID sectionID = -1  ) 
 

Gets user ID of the teacher who is instructing the specified course section.

Parameters:
$sectionID Primary ID of a course section
Returns:
integer Returns a value of -1 if none is found

_WME_GET_SECTION_TIME sectionID = -1  ) 
 

Gets the time when a course section is being taught.

Parameters:
$sectionID Primary ID of a section
Returns:
string

_WME_GET_TEACHER_ID  ) 
 

Gets the teacherID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed teacherID on success, NULL string otherwise

_WME_GET_TLP_COUNT_BY_TM tmID  ) 
 

Get the number of TLPs within a TM.

Parameters:
$tmID Primary ID of the TM
Returns:
integer The TM's TLP count

_WME_GET_TLP_ID  ) 
 

Gets the tlpID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed tlpID on success, NULL string otherwise

_WME_GET_TLP_LOCATION tlpID = -1  ) 
 

Returns TLP's relative location.

Parameters:
$tlpID Primary ID of the TLP
Returns:
string Relative location of TLP

_WME_GET_TLP_LOCATION_INCL_TM tlpID = -1  ) 
 

Returns TLP's relative location, including the location of its respective TM.

Parameters:
$tlpID Primary ID of the TM
Returns:
string Relative location of TM

_WME_GET_TLP_NAME tlpID = -1  ) 
 

Get the name of a TLP.

Parameters:
$tlpID Primary ID of the TLP
Returns:
string Name of the TLP

_WME_GET_TLP_REF_BY_TM tmID = -1  ) 
 

Gets a reference of all TLPs relative to a specific TM.

Parameters:
$tmID Primary ID of a TM
Returns:
reference

_WME_GET_TLP_REF_BY_TM_SECTION tmID = -1,
sectionID = -1,
getActive = -1
 

Gets reference to TLPs that are being used by a course section.

Parameters:
$tmID Primary ID of a TM
$sectionID Primary ID of a course section
$getActive Optional boolean value to make sure only active TLPs are returned
Returns:
reference

_WME_GET_TLPID_BY_FILENAME file  ) 
 

Returns the primary ID of the specified file's TLP ID.

Parameters:
$file File name of a TLP
Returns:
integer Primary ID of the specified file's TLP ID

_WME_GET_TLPID_BY_VSEC vsecID = -1  ) 
 

Returns the primary ID of the specified VSec's parent TLP.

Parameters:
$vsecID Primary ID of the VSec
Returns:
integer Primary ID of the specified VSec's parent TLP

_WME_GET_TM_ID  ) 
 

Gets the tmID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed tmID on success, NULL string otherwise

_WME_GET_TM_LOCATION tmID = -1  ) 
 

Returns TM's relative location.

Parameters:
$tmID Primary ID of the TM
Returns:
string Relative location of TM

_WME_GET_TM_NAME tmID  ) 
 

Get the name of a TM.

Parameters:
$tmID Primary ID of the TM
Returns:
string Name of the TM

_WME_GET_TM_REF tmID = -1  ) 
 

Gets a reference of a specific TM, or all TMs.

Parameters:
$tmID Optional primary ID of a TM. Returns reference to this TM if specified.
Returns:
reference

_WME_GET_TM_REF_BY_MAP mapID = -1  ) 
 

Gets a reference of all TMs relative to a specific course section.

Parameters:
$mapID Primary ID of a TM to course section map. map_tm_section table in database.
Returns:
reference

_WME_GET_TM_REF_BY_SECTION sectionID  ) 
 

Gets reference to all TMs used by specified course section.

Parameters:
$sectionID Primary ID of a course section
Returns:
reference

_WME_GET_TMID_BY_FILENAME file  ) 
 

Returns the primary ID of the specified file's parent TM ID.

Parameters:
$file File name of a TLP
Returns:
integer Primary ID of the specified TLP's parent TM

_WME_GET_TMID_BY_TLP tlpID = -1  ) 
 

Returns the primary ID of the specified TLP's parent TM.

Parameters:
$tlpID Primary ID of the TLP
Returns:
integer Primary ID of the specified TLP's parent TM

_WME_GET_TMID_BY_VSEC vsecID = -1  ) 
 

Returns the primary ID of the specified VSec's parent TM.

Parameters:
$vsecID Primary ID of the VSec
Returns:
integer Primary ID of the specified VSec's parent TM

_WME_GET_USER_FULLNAME userID = -1  ) 
 

Gets the full name of a specified user.

Parameters:
$userID The primary ID of the user
Returns:
string Full name of the specified user

_WME_GET_USER_ID  ) 
 

Gets the userID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed userID on success, NULL string otherwise

_WME_GET_USER_LOGIN userID = -1  ) 
 

Gets the username of a specified user.

Parameters:
$userID Primary ID of a user
Returns:
integer|NULL The user's login name on success, NULL string otherwise

_WME_GET_USER_REF userID = -1  ) 
 

Gets a reference of a specific user, or all users.

Parameters:
$userID Optional primary ID of a user. Returns reference to this user if specified.
Returns:
reference Reference to user query

_WME_GET_USER_REF_WITH_STATUS userID = -1,
status = ""
 

Gets a reference of a specific user, or all users with status specified.

Parameters:
$userID Optional primary ID of a user. Returns reference to this user if specified.
$status Optional user status. Defaults to _WME_GET_USER_REF(...) if unspecified.
Returns:
reference

_WME_GET_USER_STATUS_REF userID = -1  ) 
 

Gets a reference to a user's status Returns reference because a user can attain multiple statuses.

Parameters:
$userID Primary ID of the specified user
Returns:
reference Reference to a user's status

_WME_GET_VSEC_CONTENT vsecID = -1  ) 
 

Get the file name of a specified VSec.

Parameters:
$vsecID Primary ID of the VSec
Returns:
string File name of the VSec

_WME_GET_VSEC_ID  ) 
 

Gets the vsecID if passed via HTTP GET or POST.

Returns:
integer|NULL The passed VSecID on success, NULL string otherwise

_WME_GET_VSEC_LOCATION vsecID = -1  ) 
 

Returns VSec's absolute path.

Parameters:
$vsecID Primary ID of the VSec
Returns:
string Absolute path of VSec

_WME_GET_VSEC_REF_BY_TLP tlpID = -1  ) 
 

Gets a reference of all VSECs relative to a specific TLP.

Parameters:
$tlpID Primary ID of a TLP
Returns:
reference

_WME_GET_VSEC_REF_BY_TLP_SECTION tlpID = -1,
sectionID = -1
 

Gets reference to VSecs that are being used by a course section.

Parameters:
$tlpID Primary ID of a TLP
$sectionID Primary ID of a course section
Returns:
reference

_WME_IS_ADMIN userID  ) 
 

Checks if user is an admin.

Parameters:
$userID Primary ID of the user
Returns:
true|false

_WME_IS_MY_TLP &$  sectionID,
&$  tlpID
 

Checks if specified TLP and section belongs to the session user.

Parameters:
&$sectionID Primary ID of a course section
&$tlpID Primary ID of a TLP
Returns:
true|false true on success

_WME_IS_STUDENT userID  ) 
 

Checks if user is a student.

Parameters:
$userID Primary ID of the user
Returns:
true|false

_WME_IS_TEACHER userID = -1  ) 
 

Checks if user is a teacher.

Parameters:
$userID Primary ID of the user
Returns:
true|false

_WME_POPULATE_SESSION_VARS  ) 
 

Populates session variables Executed automatically internally.

Returns:
NULL

_WME_PRINT_LOGIN_FORM action_url,
username_fieldname = "WME_USERNAME",
passwd_fieldname = "WME_PASSWORD",
submit_button_text = "Login"
 

Prints a generic login form.

Parameters:
$action_url The target script that will run this form
$username_fieldname Optional. The field name for username input. Defaults to "WME_USERNAME".
$passwd_fieldname Optional. The field name for password input. Defaults to "WME_PASSWORD".
$submit_button_text Optional. Defaults to "Login".
Returns:
NULL

_WME_PRINT_VSEC_QUESTIONS vsecID,
answerable = 1
 

Prints an XHTML form for user input to questions.

Parameters:
$vsecID Primary ID of a VSec
$answerable Optional. Allows users answer its questions if set. It is set true by default
Returns:
reference

_WME_REMOVE_VSEC vsecID = -1  ) 
 

Removes a specified VSec.

Parameters:
$vsecID Primary ID of the VSec to be removed
Returns:
NULL

_WME_SECTION_IS_USING_TLP sectionID,
tlpID
 

Check if a course section is using a specified TLP.

Parameters:
$sectionID Primary ID of the course section
$tlpID Primary ID of a TLP
Returns:
true|false true if TLP is being used, false otherwise

_WME_SECTION_IS_USING_TM sectionID,
tmID
 

Check if a course section is using a specified TM.

Parameters:
$sectionID Primary ID of the course section
$tmID Primary ID of a TM
Returns:
true|false true if TM is being used, false otherwise

_WME_SET_SESSION_VAR key,
value
 

Registers a session variable.

Returns:
NULL

_WME_TLP_SECTION_RECORD_EXISTS sectionID,
tlpID
 

Checks if a TLP to course section map exists.

Parameters:
$sectionID Primary ID of a course section
$tlpID Primary ID of a TLP
Returns:
true|false true on success

_WME_TM_SECTION_RECORD_EXISTS sectionID,
tmID
 

Checks if a TM to course section map exists.

Parameters:
$sectionID Primary ID of a course section
$tmID Primary ID of a TM
Returns:
true|false true on success

_WME_UNSET_SESSION_VAR key  ) 
 

Unregister a session variable.

Returns:
NULL

_WME_USER_IS_LOGGED_IN  ) 
 

Checks if a user is logged in.

Returns:
true|false true if logged in

_WME_USER_LOGIN username,
password,
referer_url = ""
 

Logs in a user with the provided login information.

Parameters:
$username 
$password 
$referer_url Optional parameter for page redirect
Returns:
NULL

_WME_USER_LOGOUT referer_url = ""  ) 
 

Logs in a user out unconditionally.

Parameters:
$referer_url Optional parameter for page redirect
Returns:
NULL


Generated on Tue Jun 7 04:57:32 2005 for WME Functions by  doxygen 1.4.3