本文整理汇总了PHP中ilCustomInputGUI::setAlert方法的典型用法代码示例。如果您正苦于以下问题:PHP ilCustomInputGUI::setAlert方法的具体用法?PHP ilCustomInputGUI::setAlert怎么用?PHP ilCustomInputGUI::setAlert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilCustomInputGUI
的用法示例。
在下文中一共展示了ilCustomInputGUI::setAlert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fillMembershipLimitation
/**
* Show membership limitations
*
* @access protected
* @return
*/
protected function fillMembershipLimitation()
{
global $ilAccess, $ilCtrl;
include_once 'Modules/Course/classes/class.ilObjCourseGrouping.php';
if (!($items = ilObjCourseGrouping::_getGroupingItems($this->container))) {
return true;
}
$mem = new ilCustomInputGUI($this->lng->txt('groupings'));
$tpl = new ilTemplate('tpl.membership_limitation_form.html', true, true, 'Services/Membership');
$tpl->setVariable('LIMIT_INTRO', $this->lng->txt($this->type . '_grp_info_reg'));
foreach ($items as $ref_id) {
$obj_id = ilObject::_lookupObjId($ref_id);
$type = ilObject::_lookupType($obj_id);
$title = ilObject::_lookupTitle($obj_id);
if ($ilAccess->checkAccess('visible', '', $ref_id, $type)) {
include_once './Services/Link/classes/class.ilLink.php';
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
$tpl->setVariable('LINK_ITEM', $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
$ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
$tpl->setVariable('ITEM_LINKED_TITLE', $title);
} else {
$tpl->setVariable('ITEM_TITLE');
}
$tpl->setCurrentBlock('items');
$tpl->setVariable('TYPE_ICON', ilObject::_getIcon($obj_id, tiny, $type));
$tpl->setVariable('ALT_ICON', $this->lng->txt('obj_' . $type));
$tpl->parseCurrentBlock();
}
$mem->setHtml($tpl->get());
if (!ilObjCourseGrouping::_checkGroupingDependencies($this->container)) {
$mem->setAlert($this->container->getMessage());
$this->enableRegistration(false);
}
$this->form->addItem($mem);
}
示例2: fillRegistrationType
/**
* fill registration type
*
* @access protected
* @return
*/
protected function fillRegistrationType()
{
global $ilUser;
if ($this->container->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_DEACTIVATED) {
$reg = new ilCustomInputGUI($this->lng->txt('mem_reg_type'));
#$reg->setHtml($this->lng->txt('crs_info_reg_deactivated'));
$reg->setAlert($this->lng->txt('crs_info_reg_deactivated'));
#ilUtil::sendFailure($this->lng->txt('crs_info_reg_deactivated'));
#$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
#$reg->setValue($this->lng->txt('crs_info_reg_deactivated'));
#$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
$this->form->addItem($reg);
// Disable registration
$this->enableRegistration(false);
return true;
}
switch ($this->container->getSubscriptionType()) {
case IL_CRS_SUBSCRIPTION_DIRECT:
// no "request" info if waiting list is active
if ($this->isWaitingListActive()) {
return true;
}
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_info_reg_direct'));
$this->form->addItem($txt);
break;
case IL_CRS_SUBSCRIPTION_PASSWORD:
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_subscription_options_password'));
$pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
$pass->setInputType('password');
$pass->setSize(12);
$pass->setMaxLength(32);
#$pass->setRequired(true);
$pass->setInfo($this->lng->txt('crs_info_reg_password'));
$txt->addSubItem($pass);
$this->form->addItem($txt);
break;
case IL_CRS_SUBSCRIPTION_CONFIRMATION:
// no "request" info if waiting list is active
if ($this->isWaitingListActive()) {
return true;
}
$txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
$txt->setValue($this->lng->txt('crs_subscription_options_confirmation'));
$sub = new ilTextAreaInputGUI($this->lng->txt('crs_reg_subject'), 'subject');
$sub->setValue($_POST['subject']);
$sub->setInfo($this->lng->txt('crs_info_reg_confirmation'));
$sub->setCols(40);
$sub->setRows(5);
if ($this->participants->isSubscriber($ilUser->getId())) {
$sub_data = $this->participants->getSubscriberData($ilUser->getId());
$sub->setValue($sub_data['subject']);
$sub->setInfo('');
ilUtil::sendFailure($this->lng->txt('crs_reg_user_already_subscribed'));
$this->enableRegistration(false);
}
$txt->addSubItem($sub);
$this->form->addItem($txt);
break;
default:
return true;
}
return true;
}