本文整理汇总了PHP中ilPropertyFormGUI::addCommandButton方法的典型用法代码示例。如果您正苦于以下问题:PHP ilPropertyFormGUI::addCommandButton方法的具体用法?PHP ilPropertyFormGUI::addCommandButton怎么用?PHP ilPropertyFormGUI::addCommandButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilPropertyFormGUI
的用法示例。
在下文中一共展示了ilPropertyFormGUI::addCommandButton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initSettingsForm
/**
* Init settings form
*/
protected function initSettingsForm()
{
global $ilCtrl;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($GLOBALS['lng']->txt('settings'));
$form->addCommandButton('update', $GLOBALS['lng']->txt('save'));
$form->addCommandButton('settings', $GLOBALS['lng']->txt('cancel'));
// activation
$active = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_active'), 'active');
$active->setInfo($GLOBALS['lng']->txt('fm_settings_active_info'));
$active->setValue(1);
$active->setChecked(ilFMSettings::getInstance()->isEnabled());
$form->addItem($active);
// one frame
$local = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_local'), 'local');
$local->setInfo($GLOBALS['lng']->txt('fm_settings_local_info'));
$local->setValue(1);
$local->setChecked(ilFMSettings::getInstance()->IsLocalFSEnabled());
$form->addItem($local);
$fs = new ilNumberInputGUI($GLOBALS['lng']->txt('fm_settings_filesize'), 'filesize');
$fs->setSuffix('MiB');
$fs->setSize(3);
$fs->setMaxLength(3);
$fs->setMinValue(1);
$fs->setMaxValue(999);
$fs->setInfo($GLOBALS['lng']->txt('fm_settings_filesize_info'));
$fs->setValue(ilFMSettings::getInstance()->getMaxFileSize());
$form->addItem($fs);
return $form;
}
示例2: initLicenseForm
protected function initLicenseForm()
{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "updateLicense"));
$form->setTitle($this->lng->txt('edit_license'));
$exist = new ilNumberInputGUI($this->lng->txt("existing_licenses"), "licenses");
$exist->setInfo($this->lng->txt("zero_licenses_explanation"));
$exist->setMaxLength(10);
$exist->setSize(10);
$exist->setValue($this->license->getLicenses());
$form->addItem($exist);
$info_used = new ilNonEditableValueGUI($this->lng->txt("used_licenses"));
$info_used->setInfo($this->lng->txt("used_licenses_explanation"));
$info_used->setValue($this->license->getAccesses());
$form->addItem($info_used);
$remaining_licenses = $this->license->getLicenses() == "0" ? $this->lng->txt("arbitrary") : $this->license->getRemainingLicenses();
$info_remain = new ilNonEditableValueGUI($this->lng->txt("remaining_licenses"));
$info_remain->setInfo($this->lng->txt("remaining_licenses_explanation"));
$info_remain->setValue($remaining_licenses);
$form->addItem($info_remain);
$info_potential = new ilNonEditableValueGUI($this->lng->txt("potential_accesses"));
$info_potential->setInfo($this->lng->txt("potential_accesses_explanation"));
$info_potential->setValue($this->license->getPotentialAccesses());
$form->addItem($info_potential);
$comm = new ilTextAreaInputGUI($this->lng->txt("comment"), "remarks");
$comm->setRows(5);
$comm->setValue($this->license->getRemarks());
$form->addItem($comm);
$form->addCommandButton('updateLicense', $this->lng->txt('save'));
return $form;
}
示例3: showPasswordFormCmd
private function showPasswordFormCmd()
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
require_once 'Services/Form/classes/class.ilPasswordInputGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt("tst_password_form"));
$form->setDescription($this->lng->txt("tst_password_introduction"));
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton(self::CMD_SAVE_ENTERED_PASSWORD, $this->lng->txt("submit"));
$form->addCommandButton(self::CMD_BACK_TO_INFO_SCREEN, $this->lng->txt("cancel"));
$inp = new ilPasswordInputGUI($this->lng->txt("tst_password"), 'password');
$inp->setRequired(true);
$inp->setRetype(false);
$form->addItem($inp);
$this->tpl->setVariable($this->parentGUI->getContentBlockName(), $this->ctrl->getHTML($form));
}
示例4: initFormSettings
/**
* Init property form
*
* @return ilPropertyFormGUI $form
*/
protected function initFormSettings()
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('tracking_settings'));
$form->setFormAction($this->ctrl->getFormAction($this));
// Mode
$mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
$mod->setRequired(true);
$mod->setValue($this->obj_lp->getCurrentMode());
$form->addItem($mod);
foreach ($this->obj_lp->getValidModes() as $mode_key) {
$opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key));
$opt->setValue($mode_key);
$mod->addOption($opt);
// :TODO: Subitem for visits ?!
if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) {
$vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
$vis->setSize(3);
$vis->setMaxLength(4);
$vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
$vis->setRequired(true);
$vis->setValue($this->obj_settings->getVisits());
$opt->addSubItem($vis);
}
}
$form->addCommandButton('saveSettings', $this->lng->txt('save'));
return $form;
}
示例5: getHTML
/**
* @return string
*/
public function getHTML()
{
global $tpl, $ilTabs, $ilCtrl, $lng;
$form = new ilPropertyFormGUI();
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, 'showContent'));
$form->setTitle($lng->txt('detail_view'));
// add link button if a link is defined in the settings
$set = new ilSetting("bibl");
$link = $set->get(strtolower($this->bibl_obj->getFiletype()));
if (!empty($link)) {
$form->addCommandButton('autoLink', 'Link');
}
$attributes = $this->entry->getAttributes();
//translate array key in order to sort by those keys
foreach ($attributes as $key => $attribute) {
//Check if there is a specific language entry
if ($lng->exists($key)) {
$strDescTranslated = $lng->txt($key);
} else {
$arrKey = explode("_", $key);
$is_standard_field = false;
switch ($arrKey[0]) {
case 'bib':
$is_standard_field = ilBibTex::isStandardField($arrKey[2]);
break;
case 'ris':
$is_standard_field = ilRis::isStandardField($arrKey[2]);
break;
}
// var_dump($is_standard_field); // FSX
if ($is_standard_field) {
$strDescTranslated = $lng->txt($arrKey[0] . "_default_" . $arrKey[2]);
} else {
$strDescTranslated = $arrKey[2];
}
}
unset($attributes[$key]);
$attributes[$strDescTranslated] = $attribute;
}
// sort attributes alphabetically by their array-key
ksort($attributes, SORT_STRING);
// render attributes to html
foreach ($attributes as $key => $attribute) {
$ci = new ilCustomInputGUI($key);
$ci->setHtml($attribute);
$form->addItem($ci);
}
// generate/render links to libraries
$settings = ilBibliographicSetting::getAll();
foreach ($settings as $set) {
$ci = new ilCustomInputGUI($set->getName());
$ci->setHtml($set->getButton($this->bibl_obj, $this->entry));
$form->addItem($ci);
}
$tpl->setPermanentLink("bibl", $this->bibl_obj->getRefId(), "_" . $_GET[ilObjBibliographicGUI::P_ENTRY_ID]);
// set content and title
return $form->getHTML();
//Permanent Link
}
示例6: _initForm
/**
* Init Social Bookmark edit/create Form
*
* @param ilObjectGUI $formhandlerObject taken as form target
* @param int $mode "create" / "edit"
*/
public static function _initForm($formhandlerObject, $mode = "create", $id = 0)
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setMultipart(true);
// File Title
$in_title = new ilTextInputGUI($lng->txt("title"), "title");
$in_title->setMaxLength(128);
$in_title->setSize(40);
$in_title->setRequired(true);
$form->addItem($in_title);
// Link
$in_link = new ilTextInputGUI($lng->txt("link"), "link");
$in_link->setMaxLength(300);
$in_link->setSize(40);
$in_link->setRequired(true);
$in_link->setInfo($lng->txt('socialbm_link_description'));
$form->addItem($in_link);
// File
$in_file = new ilFileInputGUI($lng->txt("file"), "image_file");
$in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png'));
$form->addItem($in_file);
// Activate on submit
$in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate");
$in_activate->setValue('1');
$form->addItem($in_activate);
// save and cancel commands
if ($mode == "create") {
$form->addCommandButton("createSocialBookmark", $lng->txt("create"));
$form->addCommandButton("editSocialBookmarks", $lng->txt("cancel"));
$form->setTitle($lng->txt("adm_social_bm_create"));
$in_file->setRequired(true);
} else {
if ($mode == "update") {
$in_hidden = new ilHiddenInputGUI("sbm_id", $id);
$form->addItem($in_hidden);
$form->addCommandButton("updateSocialBookmark", $lng->txt("update"));
$form->addCommandButton("cancel", $lng->txt("cancel"));
$form->setTitle($lng->txt("adm_social_bm_edit"));
$in_file->setRequired(false);
}
}
$form->setTableWidth("60%");
$form->setFormAction($ilCtrl->getFormAction($formhandlerObject));
return $form;
}
示例7: initFormRoleTemplate
/**
* Init create form
* @param bool creation mode
* @return ilPropertyFormGUI $form
*/
protected function initFormRoleTemplate($a_mode = self::FORM_MODE_CREATE)
{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
if ($this->creation_mode) {
$this->ctrl->setParameter($this, "new_type", 'rolt');
}
$form->setFormAction($this->ctrl->getFormAction($this));
if ($a_mode == self::FORM_MODE_CREATE) {
$form->setTitle($this->lng->txt('rolt_new'));
$form->addCommandButton('save', $this->lng->txt('rolt_new'));
} else {
$form->setTitle($this->lng->txt('rolt_edit'));
$form->addCommandButton('update', $this->lng->txt('save'));
}
$form->addCommandButton('cancel', $this->lng->txt('cancel'));
$title = new ilTextInputGUI($this->lng->txt('title'), 'title');
if ($a_mode != self::FORM_MODE_CREATE) {
if ($this->object->isInternalTemplate()) {
$title->setDisabled(true);
}
$title->setValue($this->object->getTitle());
}
$title->setSize(40);
$title->setMaxLength(70);
$title->setRequired(true);
$form->addItem($title);
$desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
if ($a_mode != self::FORM_MODE_CREATE) {
$desc->setValue($this->object->getDescription());
}
$desc->setCols(40);
$desc->setRows(3);
$form->addItem($desc);
if ($a_mode != self::FORM_MODE_CREATE) {
$ilias_id = new ilNonEditableValueGUI($this->lng->txt("ilias_id"), "ilias_id");
$ilias_id->setValue('il_' . IL_INST_ID . '_' . ilObject::_lookupType($this->object->getId()) . '_' . $this->object->getId());
$form->addItem($ilias_id);
}
$pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'protected');
$pro->setChecked($GLOBALS['rbacreview']->isProtected($this->rolf_ref_id, $this->object->getId()));
$pro->setValue(1);
$form->addItem($pro);
return $form;
}
示例8: initForm
/**
* Init creation from
*/
function initForm()
{
global $ilCtrl, $lng;
// edit form
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($this->lng->txt("cont_ed_insert_templ"));
$radg = new ilRadioGroupInputGUI($lng->txt("cont_template"), "page_templ");
$radg->setRequired(true);
$ts = $this->getPage()->getContentTemplates();
foreach ($ts as $t) {
$op = new ilRadioOption($t["title"], $t["id"] . ":" . $t["parent_type"]);
$radg->addOption($op);
}
$form->addItem($radg);
$form->addCommandButton("create_templ", $lng->txt("insert"));
$form->addCommandButton("cancelCreate", $lng->txt("cancel"));
return $form;
}
示例9: initConfigurationForm
/**
* Init configuration form.
*
* @return object form object
*/
public function initConfigurationForm()
{
global $lng, $ilCtrl;
$pl = $this->getPluginObject();
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->addCommandButton("save", $lng->txt("save"));
$form->setTitle($pl->txt("plugin_configuration"));
$form->setFormAction($ilCtrl->getFormAction($this));
return $form;
}
示例10: edit
/**
* Edit question overview form.
*/
function edit($a_insert = false)
{
global $ilCtrl, $tpl, $lng;
$this->displayValidationError();
// edit form
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
if ($a_insert) {
$form->setTitle($this->lng->txt("cont_ed_insert_qover"));
} else {
$form->setTitle($this->lng->txt("cont_edit_qover"));
}
// short message
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_short_message"), "short");
$cb->setInfo($this->lng->txt("cont_qover_short_message_info"));
if (!$a_insert) {
$cb->setChecked($this->content_obj->getShortMessage());
} else {
$cb->setChecked(true);
}
$form->addItem($cb);
// list wrong questions
$cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_list_wrong_q"), "wrong_questions");
$cb->setInfo($this->lng->txt("cont_qover_list_wrong_q_info"));
if (!$a_insert) {
$cb->setChecked($this->content_obj->getListWrongQuestions());
}
$form->addItem($cb);
// save/cancel buttons
if ($a_insert) {
$form->addCommandButton("create_qover", $lng->txt("save"));
$form->addCommandButton("cancelCreate", $lng->txt("cancel"));
} else {
$form->addCommandButton("update", $lng->txt("save"));
$form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
}
$html = $form->getHTML();
$tpl->setContent($html);
return $ret;
}
示例11: initUploadForm
public function initUploadForm()
{
global $ilCtrl, $lng;
include_once "./Services/Form/classes/class.ilDragDropFileInputGUI.php";
include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
$this->form = new ilPropertyFormGUI();
$this->form->setId("upload");
$this->form->setMultipart(true);
$this->form->setHideLabels();
$file = new ilDragDropFileInputGUI($lng->txt("cld_upload_flies"), "upload_files");
$file->setRequired(true);
$this->form->addItem($file);
$this->form->addCommandButton("uploadFiles", $lng->txt("upload"));
$this->form->addCommandButton("cancelAll", $lng->txt("cancel"));
$this->form->setTableWidth("100%");
$this->form->setTitle($lng->txt("upload_files_title"));
$this->form->setTitleIcon(ilUtil::getImagePath('icon_file.gif'), $lng->txt('obj_file'));
$this->form->setTitle($lng->txt("upload_files"));
$this->form->setFormAction($ilCtrl->getFormAction($this, "uploadFiles"));
$this->form->setTarget("cld_blank_target");
}
示例12: initSettingsForm
/**
*
*/
protected function initSettingsForm()
{
if (null == $this->form) {
$this->form = new ilPropertyFormGUI();
$this->form->setTitle($this->lng->txt('tos_tos_settings'));
$this->form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
$status = new ilCheckboxInputGUI($this->lng->txt('tos_status_enable'), 'tos_status');
$status->setInfo($this->lng->txt('tos_status_desc'));
$this->form->addItem($status);
$this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
}
}
示例13: initPropertiesForm
public function initPropertiesForm()
{
$this->form = new ilPropertyFormGUI();
// Title
$ti = new ilTextInputGUI($this->txt('title'), 'title');
$ti->setRequired(true);
$this->form->addItem($ti);
// Description
$ta = new ilTextAreaInputGUI($this->txt('description'), 'desc');
$this->form->addItem($ta);
$this->form->addCommandButton('updateProperties', $this->txt('save'));
$this->form->setTitle($this->txt('edit_properties'));
$this->form->setFormAction($this->ctrl->getFormAction($this));
}
示例14: showTopicForm
public function showTopicForm()
{
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
if ($this->objCurrentTopic->getId()) {
$this->ctrl->setParameter($this, 'topic_id', $this->objCurrentTopic->getId());
}
$form->setFormAction($this->ctrl->getFormAction($this, 'saveTopic'));
$form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ? 'edit_topic' : 'new_topic'));
$title = new ilTextInputGUI($this->lng->txt('title'), 'title');
$title->setValue($this->objCurrentTopic->getTitle());
$title->setRequired(true);
$form->addItem($title);
$sorting = new ilTextInputGUI($this->lng->txt('pay_sorting_value'), 'sorting');
$sorting->setValue($this->objCurrentTopic->getSorting());
$sorting->setMaxLength(11);
$sorting->setSize(11);
$form->addItem($sorting);
$form->addCommandButton('saveTopic', $this->lng->txt('save'));
$form->addCommandButton('showTopicsList', $this->lng->txt('cancel'));
$this->tpl->setVariable('FORM', $form->getHTML());
return true;
}
示例15: owner
function owner()
{
$this->__initSubTabs("owner");
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "owner"));
$form->setTitle($this->lng->txt("info_owner_of_object"));
$login = new ilTextInputGUI($this->lng->txt("login"), "owner");
$login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
$login->setRequired(true);
$login->setSize(50);
$login->setInfo($this->lng->txt("chown_warning"));
$login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
$form->addItem($login);
$form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
$this->tpl->setContent($form->getHTML());
}