本文整理匯總了PHP中ilSelectInputGUI::setParent方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilSelectInputGUI::setParent方法的具體用法?PHP ilSelectInputGUI::setParent怎麽用?PHP ilSelectInputGUI::setParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilSelectInputGUI
的用法示例。
在下文中一共展示了ilSelectInputGUI::setParent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initFilter
/**
* Init filter
*/
function initFilter()
{
global $lng;
// most filters are only
if (!ilObjLanguageAccess::_isPageTranslation()) {
// pattern
include_once "./Services/Form/classes/class.ilTextInputGUI.php";
$ti = new ilTextInputGUI($lng->txt("search"), "pattern");
$ti->setParent($this->parent_obj);
$ti->setMaxLength(64);
$ti->setSize(20);
$this->addFilterItem($ti);
$ti->readFromSession();
// module
$options = array();
$options["all"] = $lng->txt("language_all_modules");
$modules = ilObjLanguageExt::_getModules($lng->getLangKey());
foreach ($modules as $mod) {
$options[$mod] = $mod;
}
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
$si = new ilSelectInputGUI(ucfirst($lng->txt("module")), "module");
$si->setParent($this->parent_obj);
$si->setOptions($options);
$this->addFilterItem($si);
$si->readFromSession();
if (!$si->getValue()) {
$si->setValue('administration');
}
// mode
$options = array();
$options["all"] = $lng->txt("language_scope_global");
$options["changed"] = $lng->txt("language_scope_local");
if ($this->params['langmode']) {
$options["added"] = $lng->txt("language_scope_added");
}
$options["unchanged"] = $lng->txt("language_scope_unchanged");
$options["equal"] = $lng->txt("language_scope_equal");
$options["different"] = $lng->txt("language_scope_different");
$options["commented"] = $lng->txt("language_scope_commented");
if ($this->params['langmode']) {
$options["dbremarks"] = $lng->txt("language_scope_dbremarks");
}
$options["conflicts"] = $lng->txt("language_scope_conflicts");
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
$si = new ilSelectInputGUI($lng->txt("filter"), "mode");
$si->setParent($this->parent_obj);
$si->setOptions($options);
$this->addFilterItem($si);
$si->readFromSession();
if (!$si->getValue()) {
$si->setValue('all');
}
}
//compare
$options = array();
$langlist = $lng->getInstalledLanguages();
foreach ($langlist as $lang_key) {
$options[$lang_key] = $lng->txt("meta_l_" . $lang_key);
}
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
$si = new ilSelectInputGUI($lng->txt("language_compare"), "compare");
$si->setParent($this->parent_obj);
$si->setOptions($options);
$this->addFilterItem($si);
$si->readFromSession();
if (!$si->getValue()) {
$si->setValue($lng->getDefaultLanguage());
}
}