本文整理匯總了PHP中ilObjStyleSheet::_getStyleParameterInputType方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilObjStyleSheet::_getStyleParameterInputType方法的具體用法?PHP ilObjStyleSheet::_getStyleParameterInputType怎麽用?PHP ilObjStyleSheet::_getStyleParameterInputType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ilObjStyleSheet
的用法示例。
在下文中一共展示了ilObjStyleSheet::_getStyleParameterInputType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initTagStyleForm
/**
* Init tag style editing form
*
* @param int $a_mode Form Edit Mode (IL_FORM_EDIT | IL_FORM_CREATE)
*/
public function initTagStyleForm($a_mode, $a_cur_tag)
{
global $lng, $ilCtrl;
$ilCtrl->saveParameter($this, array("mq_id"));
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form_gui = new ilPropertyFormGUI();
$avail_pars = $this->object->getAvailableParameters();
$groups = $this->object->getStyleParameterGroups();
// output select lists
foreach ($groups as $k => $group) {
// filter groups of properties that should only be
// displayed with matching tag
$filtered_groups = ilObjStyleSheet::_getFilteredGroups();
if (is_array($filtered_groups[$k]) && !in_array($a_cur_tag, $filtered_groups[$k])) {
continue;
}
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt("sty_" . $k));
$this->form_gui->addItem($sh);
foreach ($group as $par) {
$basepar = explode(".", $par);
$basepar = $basepar[0];
$var = str_replace("-", "_", $basepar);
$up_par = strtoupper($var);
switch (ilObjStyleSheet::_getStyleParameterInputType($par)) {
case "select":
$sel_input = new ilSelectInputGUI($lng->txt("sty_" . $var), $basepar);
$options = array("" => "");
foreach ($avail_pars[$par] as $p) {
$options[$p] = $p;
}
$sel_input->setOptions($options);
$this->form_gui->addItem($sel_input);
break;
case "text":
$text_input = new ilTextInputGUI($lng->txt("sty_" . $var), $basepar);
$text_input->setMaxLength(200);
$text_input->setSize(20);
$this->form_gui->addItem($text_input);
break;
case "fontsize":
include_once "./Services/Style/classes/class.ilFontSizeInputGUI.php";
$fs_input = new ilFontSizeInputGUI($lng->txt("sty_" . $var), $basepar);
$this->form_gui->addItem($fs_input);
break;
case "numeric_no_perc":
case "numeric":
include_once "./Services/Style/classes/class.ilNumericStyleValueInputGUI.php";
$num_input = new ilNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
if (ilObjStyleSheet::_getStyleParameterInputType($par) == "numeric_no_perc") {
$num_input->setAllowPercentage(false);
}
$this->form_gui->addItem($num_input);
break;
case "percentage":
$per_input = new ilNumberInputGUI($lng->txt("sty_" . $var), $basepar);
$per_input->setMinValue(0);
$per_input->setMaxValue(100);
$per_input->setMaxLength(3);
$per_input->setSize(3);
$this->form_gui->addItem($per_input);
break;
case "color":
//include_once("./Services/Style/classes/class.ilNumericStyleValueInputGUI.php");
$col_input = new ilColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
$col_input->setDefaultColor("");
$col_input->setAcceptNamedColors(true);
$this->form_gui->addItem($col_input);
break;
case "trbl_numeric":
include_once "./Services/Style/classes/class.ilTRBLNumericStyleValueInputGUI.php";
$num_input = new ilTRBLNumericStyleValueInputGUI($lng->txt("sty_" . $var), $basepar);
if (ilObjStyleSheet::_getStyleParameterInputType($par) == "trbl_numeric_no_perc") {
$num_input->setAllowPercentage(false);
}
$this->form_gui->addItem($num_input);
break;
case "border_width":
include_once "./Services/Style/classes/class.ilTRBLBorderWidthInputGUI.php";
$bw_input = new ilTRBLBorderWidthInputGUI($lng->txt("sty_" . $var), $basepar);
$this->form_gui->addItem($bw_input);
break;
case "border_style":
include_once "./Services/Style/classes/class.ilTRBLBorderStyleInputGUI.php";
$bw_input = new ilTRBLBorderStyleInputGUI($lng->txt("sty_" . $var), $basepar);
$this->form_gui->addItem($bw_input);
break;
case "trbl_color":
include_once "./Services/Style/classes/class.ilTRBLColorPickerInputGUI.php";
$col_input = new ilTRBLColorPickerInputGUI($lng->txt("sty_" . $var), $basepar);
$col_input->setAcceptNamedColors(true);
$this->form_gui->addItem($col_input);
break;
case "background_image":
include_once "./Services/Style/classes/class.ilBackgroundImageInputGUI.php";
//.........這裏部分代碼省略.........