本文整理汇总了PHP中user_selector_base::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP user_selector_base::__construct方法的具体用法?PHP user_selector_base::__construct怎么用?PHP user_selector_base::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类user_selector_base
的用法示例。
在下文中一共展示了user_selector_base::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create instance.
*
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct($name = null, $options = array())
{
if (is_null($name)) {
$name = 'removeselect';
}
$options['multiselect'] = false;
parent::__construct($name, $options);
}
示例2: __construct
public function __construct($name, $options)
{
$this->companyid = $options['companyid'];
if (isset($options['courseid'])) {
$this->courseid = $options['courseid'];
}
parent::__construct($name, $options);
}
示例3: __construct
/**
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct($name, $options) {
global $CFG;
$options['accesscontext'] = context_system::instance();
parent::__construct($name, $options);
$this->classid = $options['classid'];
$this->context = $options['accesscontext'];
require_once($CFG->dirroot . '/group/lib.php');
}
示例4: __construct
/**
* Create instance.
*
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct($name = null, $options = array())
{
global $CFG;
if (is_null($name)) {
$name = 'addselect';
}
$options['multiselect'] = false;
$options['exclude'] = explode(',', $CFG->siteadmins);
parent::__construct($name, $options);
}
示例5: __construct
public function __construct($name, $options)
{
parent::__construct($name, $options);
if (!empty($options['serviceid'])) {
$this->serviceid = $options['serviceid'];
} else {
throw new moodle_exception('serviceidnotfound');
}
$this->displayallowedusers = !empty($options['displayallowedusers']);
}
示例6: __construct
/**
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct($name, $options) {
global $CFG;
$options['accesscontext'] = context_system::instance();
parent::__construct($name, $options);
$this->teammanagerid = $options['teammanagerid'];
if(isset($options['costcenterid']))
$this->costcenterid = $options['costcenterid'];
$this->context = $options['accesscontext'];
require_once($CFG->dirroot . '/group/lib.php');
}
示例7: __construct
/**
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct($name, $options)
{
global $CFG;
if (isset($options['context'])) {
$this->context = $options['context'];
} else {
$this->context = context::instance_by_id($options['contextid']);
}
$options['accesscontext'] = $this->context;
parent::__construct($name, $options);
$this->roleid = $options['roleid'];
require_once $CFG->dirroot . '/group/lib.php';
}
示例8: __construct
/**
* Constructor.
*
* @param string $name the control name/id for use in the HTML.
* @param array $options other options needed to construct this selector.
* You must be able to clone a userselector by doing new get_class($us)($us->get_name(), $us->get_options());
*/
public function __construct($name, $options)
{
if (!isset($options['multiselect'])) {
$options['multiselect'] = false;
}
parent::__construct($name, $options);
$coursecontext = $this->accesscontext->get_course_context(false);
if ($coursecontext and $coursecontext->id != SITEID and !has_capability('moodle/role:manage', $coursecontext)) {
// Prevent normal teachers from looking up all users.
$this->onlyenrolled = true;
} else {
$this->onlyenrolled = false;
}
}
示例9: __construct
/**
* Constructor method
* @param string $name
* @param array $options
*/
public function __construct($name, $options)
{
$options['accesscontext'] = $options['context'];
parent::__construct($name, $options);
if (isset($options['context'])) {
$this->context = $options['context'];
}
if (isset($options['currentgroup'])) {
$this->currentgroup = $options['currentgroup'];
}
if (isset($options['forumid'])) {
$this->forumid = $options['forumid'];
}
}
示例10: __construct
/**
* Constructor method
* @param string $name
* @param array $options
*/
public function __construct($name, array $options)
{
$options['accesscontext'] = $options['context'];
parent::__construct($name, $options);
if (isset($options['context'])) {
if ($options['context'] instanceof context_system) {
// If it is a site badge, we need to get context of frontpage.
$this->context = context_course::instance(SITEID);
} else {
$this->context = $options['context'];
}
}
if (isset($options['badgeid'])) {
$this->badgeid = $options['badgeid'];
}
if (isset($options['issuerid'])) {
$this->issuerid = $options['issuerid'];
}
if (isset($options['issuerrole'])) {
$this->issuerrole = $options['issuerrole'];
}
}
示例11: __construct
/**
* @param string $name control name
* @param array $options should have two elements with keys groupid and courseid.
*/
public function __construct()
{
global $CFG, $USER;
parent::__construct('removeselect', array('multiselect' => false));
}
示例12: __construct
public function __construct($name, $options)
{
$this->sessionid = $options['sessionid'];
parent::__construct($name, $options);
}
示例13: __construct
public function __construct($name, $options)
{
$this->cohortid = $options['cohortid'];
parent::__construct($name, $options);
}
示例14: __construct
public function __construct($name, $options)
{
$this->enrolid = $options['enrolid'];
parent::__construct($name, $options);
}
示例15: __construct
public function __construct($name, $options,$skillset,$position) {
$this->skillset = $skillset;
$this->position = $position;
$this->enrolid = $options['enrolid'];
parent::__construct($name, $options);
}