本文整理汇总了PHP中moodleform::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP moodleform::__construct方法的具体用法?PHP moodleform::__construct怎么用?PHP moodleform::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moodleform
的用法示例。
在下文中一共展示了moodleform::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(scheduler_appointment $appointment, $action, $editgrade, $distribute)
{
$this->appointment = $appointment;
$this->distribute = $distribute;
$this->editgrade = $editgrade;
parent::__construct($action, null);
}
示例2: __construct
public function __construct($actionurl, $context, $companyid, $deptid, $roleid, $showothermanagers)
{
global $USER;
$this->selectedcompany = $companyid;
$this->context = $context;
$this->departmentid = $deptid;
$this->roletype = $roleid;
/* GWL : */
if (!iomad::has_capability('block/iomad_company_admin:company_add', context_system::instance())) {
$this->showothermanagers = false;
} else {
$this->showothermanagers = $showothermanagers;
}
$company = new company($this->selectedcompany);
$parentlevel = company::get_company_parentnode($company->id);
$this->companydepartment = $parentlevel->id;
if (iomad::has_capability('block/iomad_company_admin:edit_all_departments', context_system::instance())) {
$userhierarchylevel = $parentlevel->id;
} else {
$userlevel = company::get_userlevel($USER);
$userhierarchylevel = $userlevel->id;
}
$this->subhierarchieslist = company::get_all_subdepartments($userhierarchylevel);
if ($this->departmentid == 0) {
$departmentid = $userhierarchylevel;
} else {
$departmentid = $this->departmentid;
}
$options = array('context' => $this->context, 'companyid' => $this->selectedcompany, 'departmentid' => $departmentid, 'roletype' => $this->roletype, 'subdepartments' => $this->subhierarchieslist, 'parentdepartmentid' => $parentlevel, 'showothermanagers' => $this->showothermanagers);
$this->potentialusers = new potential_department_user_selector('potentialmanagers', $options);
$this->currentusers = new current_department_user_selector('currentmanagers', $options);
parent::__construct($actionurl);
}
示例3: __construct
public function __construct($actionurl, $context, $companyid, $departmentid)
{
global $USER;
$this->selectedcompany = $companyid;
$this->context = $context;
$this->departmentid = $departmentid;
$company = new company($this->selectedcompany);
$parentlevel = company::get_company_parentnode($company->id);
$this->companydepartment = $parentlevel->id;
$syscontext = context_system::instance();
if (iomad::has_capability('block/iomad_company_admin:edit_all_departments', $syscontext)) {
$userhierarchylevel = $parentlevel->id;
} else {
$userlevel = company::get_userlevel($USER);
$userhierarchylevel = $userlevel->id;
}
$this->subhierarchieslist = company::get_all_subdepartments($userhierarchylevel);
if ($this->departmentid == 0) {
$departmentid = $userhierarchylevel;
} else {
$departmentid = $this->departmentid;
}
$options = array('context' => $this->context, 'companyid' => $this->selectedcompany, 'departmentid' => $departmentid, 'subdepartments' => $this->subhierarchieslist, 'parentdepartmentid' => $parentlevel, 'shared' => false, 'partialshared' => true);
$this->potentialcourses = new potential_company_course_selector('potentialcourses', $options);
$this->currentcourses = new current_company_course_selector('currentcourses', $options);
parent::__construct($actionurl);
}
示例4: __construct
/**
* Constructor.
* @param Command $command The Command to link to the form.
* @param int $mode The form mode.
*/
public function __construct(Command $command, $mode)
{
// Checking command.
if (is_null($command)) {
throw new Command_Exception('commandformnotlinked');
}
// Linking the command and her category.
$this->command = $command;
// Setting configuration.
$this->mode = $mode;
// Setting form action.
switch ($mode) {
case self::MODE_COMMAND_CHOICE:
$url = new moodle_url('/local/vmoodle/view.php', array('view' => 'sadmin', 'what' => 'validateassistedcommand'));
break;
case self::MODE_RETRIEVE_PLATFORM:
$url = new moodle_url('/local/vmoodle/view.php', array('view' => 'sadmin', 'what' => 'gettargetbyvalue'));
break;
case self::MODE_DISPLAY_COMMAND:
$url = new moodle_url('/local/vmoodle/view.php', array('view' => 'targetchoice'));
break;
default:
throw new Command_Exception('badformmode');
break;
}
// Calling parent's constructor.
parent::__construct($url->out());
}
示例5: __construct
public function __construct($actionurl, $isadding, $companyid, $classroomid)
{
$this->isadding = $isadding;
$this->classroomid = $classroomid;
$this->companyid = $companyid;
parent::__construct($actionurl);
}
示例6: __construct
/**
* Constructor.
* @param moodle_url $submiturl the form action URL.
* @param object course module object.
* @param object the quiz settings object.
* @param context the quiz context.
* @param bool editing group override (true) or user override (false).
* @param object $override the override being edited, if it already exists.
*/
public function __construct($submiturl, $cm, $virtualclass, $context) {
$this->cm = $cm;
$this->virtualclass = $virtualclass;
$this->context = $context;
parent::__construct($submiturl, null, 'post');
}
示例7: __construct
public function __construct($current, $section, $cm, $course)
{
global $CFG;
$this->current = $current;
$this->_instance = $current->instance;
$this->_section = $section;
$this->_cm = $cm;
if ($this->_cm) {
$this->context = context_module::instance($this->_cm->id);
} else {
$this->context = context_course::instance($course->id);
}
// Set the course format.
require_once $CFG->dirroot . '/course/format/lib.php';
$this->courseformat = course_get_format($course);
// Guess module name
$matches = array();
if (!preg_match('/^mod_([^_]+)_mod_form$/', get_class($this), $matches)) {
debugging('Use $modname parameter or rename form to mod_xx_mod_form, where xx is name of your module');
print_error('unknownmodulename');
}
$this->_modname = $matches[1];
$this->init_features();
parent::__construct('modedit.php');
}
示例8: __construct
public function __construct($url, $datafields, $cm, $data)
{
$this->_datafields = $datafields;
$this->_cm = $cm;
$this->_data = $data;
parent::__construct($url);
}
示例9: __construct
public function __construct($actionurl, $context, $companyid, $departmentid, $userid, $licenseid)
{
global $USER, $DB;
$this->selectedcompany = $companyid;
$this->context = $context;
$company = new company($this->selectedcompany);
$this->parentlevel = company::get_company_parentnode($company->id);
$this->companydepartment = $this->parentlevel->id;
$this->licenseid = $licenseid;
if (iomad::has_capability('block/iomad_company_admin:edit_all_departments', context_system::instance())) {
$userhierarchylevel = $this->parentlevel->id;
} else {
$userlevel = company::get_userlevel($USER);
$userhierarchylevel = $userlevel->id;
}
$this->subhierarchieslist = company::get_all_subdepartments($userhierarchylevel);
if ($departmentid == 0) {
$this->departmentid = $userhierarchylevel;
} else {
$this->departmentid = $departmentid;
}
$this->userid = $userid;
$this->user = $DB->get_record('user', array('id' => $this->userid));
parent::__construct($actionurl);
}
示例10: __construct
public function __construct($actionurl, $invoiceid)
{
global $CFG;
$this->invoiceid = $invoiceid;
$this->context = context_coursecat::instance($CFG->defaultrequestcategory);
parent::__construct($actionurl);
}
示例11: __construct
public function __construct($page, $number, $varid = -1)
{
//-1 if new variation
$this->number = $number;
$this->varid = $varid;
parent::__construct($page);
}
示例12:
function timetracker_hourlog_form($context, $userid, $courseid)
{
$this->context = $context;
$this->userid = $userid;
$this->courseid = $courseid;
parent::__construct();
}
示例13:
function timetracker_updateworkerinfo_form($context, $courseid, $mdluserid)
{
$this->context = $context;
$this->courseid = $courseid;
$this->mdluserid = $mdluserid;
parent::__construct();
}
示例14:
function __construct($actionurl, $block, $page)
{
global $CFG;
$this->block = $block;
$this->page = $page;
parent::__construct($actionurl);
}
示例15: __construct
/**
* Constructor.
* @param moodle_url $submiturl the form action URL.
* @param object course module object.
* @param object the congrea object.
* @param context the congrea context.
*/
public function __construct($submiturl, $cm, $congrea, $context)
{
$this->cm = $cm;
$this->congrea = $congrea;
$this->context = $context;
parent::__construct($submiturl, null, 'post');
}