本文整理汇总了PHP中CButton::addOption方法的典型用法代码示例。如果您正苦于以下问题:PHP CButton::addOption方法的具体用法?PHP CButton::addOption怎么用?PHP CButton::addOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::addOption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insert_value_mapping_form
function insert_value_mapping_form()
{
$frmValmap = new CFormTable(S_VALUE_MAP);
$frmValmap->SetHelp("web.mapping.php");
$frmValmap->addVar("config", get_request("config", 6));
if (isset($_REQUEST["valuemapid"])) {
$frmValmap->addVar("valuemapid", $_REQUEST["valuemapid"]);
$db_valuemaps = DBselect("select * FROM valuemaps" . " WHERE valuemapid=" . $_REQUEST["valuemapid"]);
$db_valuemap = DBfetch($db_valuemaps);
$frmValmap->SetTitle(S_VALUE_MAP . ' "' . $db_valuemap["name"] . '"');
}
if (isset($_REQUEST["valuemapid"]) && !isset($_REQUEST["form_refresh"])) {
$valuemap = array();
$mapname = $db_valuemap["name"];
$mappings = DBselect("select * FROM mappings WHERE valuemapid=" . $_REQUEST["valuemapid"]);
while ($mapping = DBfetch($mappings)) {
$value = array("value" => $mapping["value"], "newvalue" => $mapping["newvalue"]);
array_push($valuemap, $value);
}
} else {
$mapname = get_request("mapname", "");
$valuemap = get_request("valuemap", array());
}
$frmValmap->addRow(S_NAME, new CTextBox("mapname", $mapname, 40));
$i = 0;
$valuemap_el = array();
foreach ($valuemap as $value) {
array_push($valuemap_el, array(new CCheckBox("rem_value[]", 'no', null, $i), $value["value"] . SPACE . RARR . SPACE . $value["newvalue"]), BR());
$frmValmap->addVar("valuemap[{$i}][value]", $value["value"]);
$frmValmap->addVar("valuemap[{$i}][newvalue]", $value["newvalue"]);
$i++;
}
$saveButton = new CButton('save', S_SAVE);
if (count($valuemap_el) == 0) {
array_push($valuemap_el, S_NO_MAPPING_DEFINED);
$saveButton->addOption('disabled', 'true');
} else {
array_push($valuemap_el, new CButton('del_map', 'delete selected'));
}
$frmValmap->addRow(S_MAPPING, $valuemap_el);
$frmValmap->addRow(S_NEW_MAPPING, array(new CTextBox("add_value", "", 10), new CSpan(RARR, "rarr"), new CTextBox("add_newvalue", "", 10), SPACE, new CButton("add_map", S_ADD)), 'new');
$frmValmap->addItemToBottomRow($saveButton);
if (isset($_REQUEST["valuemapid"])) {
$frmValmap->addItemToBottomRow(SPACE);
$frmValmap->addItemToBottomRow(new CButtonDelete("Delete selected value mapping?", url_param("form") . url_param("valuemapid") . url_param("config")));
} else {
}
$frmValmap->addItemToBottomRow(SPACE);
$frmValmap->addItemToBottomRow(new CButtonCancel(url_param("config")));
$frmValmap->Show();
}