本文整理汇总了PHP中Rule::dropdown方法的典型用法代码示例。如果您正苦于以下问题:PHP Rule::dropdown方法的具体用法?PHP Rule::dropdown怎么用?PHP Rule::dropdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rule
的用法示例。
在下文中一共展示了Rule::dropdown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showSpecificMassiveActionsParameters
/**
* @see CommonDBTM::showSpecificMassiveActionsParameters()
**/
function showSpecificMassiveActionsParameters($input = array())
{
switch ($input['action']) {
case "move_rule":
echo "<select name='move_type'>";
echo "<option value='after' selected>" . __('After') . "</option>";
echo "<option value='before'>" . __('Before') . "</option>";
echo "</select> ";
if (isset($input['entity_restrict'])) {
$condition = $input['entity_restrict'];
} else {
$condition = "";
}
Rule::dropdown(array('sub_type' => $input['itemtype'], 'name' => "ranking", 'entity_restrict' => $condition));
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Move') . "'>\n";
return true;
default:
return parent::showSpecificMassiveActionsParameters($input);
}
return false;
}
示例2: showMassiveActionsSubForm
/**
* @since version 0.85
*
* @see CommonDBTM::showMassiveActionsSubForm()
**/
static function showMassiveActionsSubForm(MassiveAction $ma)
{
switch ($ma->getAction()) {
case 'duplicate':
$entity_assign = False;
foreach ($ma->getitems() as $itemtype => $ids) {
if ($item = getItemForItemtype($itemtype)) {
if ($item->isEntityAssign()) {
$entity_assign = true;
break;
}
}
}
if ($entity_assign) {
Entity::dropdown();
}
echo "<br><br>" . Html::submit(_x('button', 'Duplicate'), array('name' => 'massiveaction'));
return true;
case 'move_rule':
$input = $ma->getInput();
$values = array('after' => __('After'), 'before' => __('Before'));
Dropdown::showFromArray('move_type', $values, array('width' => '20%'));
if (isset($input['entity'])) {
$entity = $input['entity'];
} else {
$entity = "";
}
if (isset($input['condition'])) {
$condition = $input['condition'];
} else {
$condition = 0;
}
echo Html::hidden('rule_class_name', array('value' => $input['rule_class_name']));
Rule::dropdown(array('sub_type' => $input['rule_class_name'], 'name' => "ranking", 'condition' => $condition, 'entity' => $entity, 'width' => '50%'));
echo "<br><br><input type='submit' name='massiveaction' class='submit' value='" . _sx('button', 'Move') . "'>\n";
return true;
}
return parent::showMassiveActionsSubForm($ma);
}
示例3: array
break;
case 'merge':
echo " " . $_SESSION['glpiactive_entity_shortname'];
echo " <input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>\n";
break;
case "move_rule":
echo "<select name='move_type'>";
echo "<option value='after' selected>" . $LANG['buttons'][47] . "</option>";
echo "<option value='before'>" . $LANG['buttons'][46] . "</option>";
echo "</select> ";
if (isset($_POST['entity_restrict'])) {
$condition = $_POST['entity_restrict'];
} else {
$condition = "";
}
Rule::dropdown(array('sub_type' => $_POST['sub_type'], 'name' => "ranking", 'entity_restrict' => $condition));
echo "<input type='submit' name='massiveaction' class='submit' value='" . $LANG['buttons'][2] . "'>\n";
break;
case "add_followup":
TicketFollowup::showFormMassiveAction();
break;
case "add_task":
TicketTask::showFormMassiveAction();
break;
case "add_actor":
$types = array(0 => DROPDOWN_EMPTY_VALUE, Ticket::REQUESTER => $LANG['job'][4], Ticket::OBSERVER => $LANG['common'][104], Ticket::ASSIGN => $LANG['job'][5]);
$rand = Dropdown::showFromArray('actortype', $types);
$paramsmassaction = array('actortype' => '__VALUE__');
ajaxUpdateItemOnSelectEvent("dropdown_actortype{$rand}", "show_massiveaction_field", $CFG_GLPI["root_doc"] . "/ajax/dropdownMassiveActionAddActor.php", $paramsmassaction);
echo "<span id='show_massiveaction_field'> </span>\n";
break;