wiki:PrevTechDoc

Version 9 (modified by Pan Luo, 11 years ago) ( diff )

--

iPeer v2 Technical Documentation

Based on file: iPeer-v2-Technical-Documentation.doc

rdAuth Components:

rdAuth components monitors the current user’s information such as id, role, username, fullname. To get the current user’s attribute, we can call: From View: $rdAuth->id From Controller: $this->rdAuth->id

Sys_Parameter Settings:

System Parameters are loaded once the users has login successfully. There are 2 core parameters that control the iPeer integration with UBC CWL:

For General version:

Parameter CodeParameter Value
custom.login_controlipeer
custom.login_page_pathnameLeave it as empty

For UBC CWL customization:

Parameter CodeParameter Value
custom.login_controlUBC_CWL
custom.login_page_pathnamecustom_ubc_cwl_login

To check whether the iPeer is UBC CWL integrated or not:

if (isset($this->rdAuth->customIntegrateCWL) && $this->rdAuth->customIntegrateCWL) {
// ipeer is integrated with CWL
}

Get Sys_Parameter from iPeer:

e.g. Get the parameter code ‘system.upload_dir’:

		$uploadDir = $this->sysContainer->getParamByParamCode('system.upload_dir');
		$uploadFile = APP.$uploadDir['parameter_value'] . $filename;

Some useful functions:

1.Get all accessible courses:

$courseList = $this->sysContainer->getMyCourseList(); 

2.Get no. of members within a group:

$numMembers=$event['Event']['self_eval'] ? 
    $this->GroupsMembers->findCount('group_id='.$groupId) : 
    $this->GroupsMembers->findCount('group_id='.$groupId) - 1; 

Caution: To upgrade CakePHP library for iPeer, please also look into the following files to change for iPeer customization:

  1. replace all thtml -> tpl.php, since iPeer use php extension instead of thtml
  2. change the controller.php in \cake\libs\controller
  3. change html.php helper in \cake\libs\view\helpers
  4. change dbo_source.php in \cake\libs\model\datasources
Note: See TracWiki for help on using the wiki.