本文整理汇总了PHP中Ajax::createModalWindow方法的典型用法代码示例。如果您正苦于以下问题:PHP Ajax::createModalWindow方法的具体用法?PHP Ajax::createModalWindow怎么用?PHP Ajax::createModalWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ajax
的用法示例。
在下文中一共展示了Ajax::createModalWindow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showProfileSelecter
/**
* Print the form used to select profile if several are available
*
* @param $target target of the form
*
* @return nothing
**/
static function showProfileSelecter($target)
{
global $CFG_GLPI;
if (count($_SESSION["glpiprofiles"]) > 1) {
echo '<li class="profile-selector"><form name="form" method="post" action="' . $target . '">';
$values = array();
foreach ($_SESSION["glpiprofiles"] as $key => $val) {
$values[$key] = $val['name'];
}
Dropdown::showFromArray('newprofile', $values, array('value' => $_SESSION["glpiactiveprofile"]["id"], 'width' => '150px', 'on_change' => 'submit()'));
Html::closeForm();
echo '</li>';
}
if (Session::isMultiEntitiesMode()) {
echo "<li class='profile-selector'>";
Ajax::createModalWindow('entity_window', $CFG_GLPI['root_doc'] . "/ajax/entitytree.php", array('title' => __('Select the desired entity'), 'extraparams' => array('target' => $target)));
echo "<a onclick='entity_window.dialog(\"open\");' href='#modal_entity_content' title=\"" . addslashes($_SESSION["glpiactive_entity_name"]) . "\" class='entity_select' id='global_entity_select'>" . $_SESSION["glpiactive_entity_shortname"] . "</a>";
echo "</li>";
}
}
示例2: displayAjaxValues
static function displayAjaxValues($config, $request_data, $rand, $mode)
{
global $CFG_GLPI;
$pfDeployPackage = new PluginFusioninventoryDeployPackage();
$pfDeployOrder = new PluginFusioninventoryDeployOrder();
if (isset($request_data['orders_id'])) {
$pfDeployOrder->getFromDB($request_data['orders_id']);
$pfDeployPackage->getFromDB($pfDeployOrder->fields['plugin_fusioninventory_deploypackages_id']);
} else {
$pfDeployPackage->getEmpty();
}
$p2p = 0;
$p2p_retention_duration = 0;
$uncompress = 0;
if ($mode === 'create') {
$source = $request_data['value'];
/**
* No need to continue if there is no selected source
*/
if ($source === '0') {
return;
}
} else {
$p2p = $config['data']['p2p'];
$p2p_retention_duration = $config['data']['p2p-retention-duration'];
$uncompress = $config['data']['uncompress'];
}
echo "<table class='package_item'>";
/*
* Display file upload input only in 'create' mode
*/
echo "<tr>";
echo "<th>" . __("File", 'fusioninventory') . "</th>";
echo "<td>";
if ($mode === 'create') {
switch ($source) {
case "Computer":
echo "<input type='file' name='file' value='" . __("filename", 'fusioninventory') . "' />";
echo "<i>" . self::getMaxUploadSize() . "</i>";
break;
case "Server":
echo "<input type='text' name='filename' id='server_filename{$rand}'" . " style='width:120px;float:left' />";
echo "<input type='button' class='submit' value='" . __("Choose", 'fusioninventory') . "' onclick='fileModal{$rand}.dialog(\"open\");' />";
Ajax::createModalWindow("fileModal{$rand}", $CFG_GLPI['root_doc'] . "/plugins/fusioninventory/ajax/deployfilemodal.php", array('title' => __('Select the file on server', 'fusioninventory'), 'extraparams' => array('rand' => $rand)));
break;
}
} else {
/*
* Display only name in 'edit' mode
*/
echo $config['data']['name'];
}
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<th>" . __("Uncompress", 'fusioninventory') . "<img style='float:right' " . "src='" . $CFG_GLPI["root_doc"] . "/plugins/fusioninventory//pics/uncompress.png' /></th>";
echo "<td>";
Html::showCheckbox(array('name' => 'uncompress', 'checked' => $uncompress));
echo "</td>";
echo "</tr><tr>";
echo "<th>" . __("P2P", 'fusioninventory') . "<img style='float:right' src='" . $CFG_GLPI["root_doc"] . "/plugins/fusioninventory//pics/p2p.png' /></th>";
echo "<td>";
Html::showCheckbox(array('name' => 'p2p', 'checked' => $p2p));
echo "</td>";
echo "</tr><tr>";
echo "<th>" . __("retention days", 'fusioninventory') . "</th>";
echo "<td>";
/*
* TODO: use task periodicity input to propose days, months and years
*/
Dropdown::showNumber('p2p-retention-duration', array('value' => $p2p_retention_duration, 'min' => 0, 'max' => 400));
echo "</td>";
echo "</tr><tr>";
echo "<td>";
echo "</td><td>";
if ($pfDeployPackage->can($pfDeployPackage->getID(), UPDATE)) {
if ($mode === 'edit') {
echo "<input type='submit' name='save_item' value=\"" . _sx('button', 'Save') . "\" class='submit' >";
} else {
echo "<input type='submit' name='add_item' value=\"" . _sx('button', 'Add') . "\" class='submit' >";
}
}
echo "</td>";
echo "</tr></table>";
}
示例3: plugin
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
$plugin = new plugin();
if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
if ($plugin->isActivated("environment")) {
Html::header(PluginAccountsAccount::getTypeName(2), '', "assets", "pluginenvironmentdisplay", "accounts");
} else {
Html::header(PluginAccountsAccount::getTypeName(2), '', "admin", "pluginaccountsmenu");
}
} else {
Html::helpHeader(PluginAccountsAccount::getTypeName(2));
}
$account = new PluginAccountsAccount();
$account->checkGlobal(READ);
if ($account->canView()) {
if (Session::haveRight("plugin_accounts_see_all_users", 1)) {
echo "<div align='center'>";
echo "<a onclick='add_file_modal.dialog(\"open\");' href='#modal_account_content' title='" . __s('Type view') . "'>" . __('Type view', 'accounts') . "</a>";
echo "</div>";
Ajax::createModalWindow('add_file_modal', $CFG_GLPI['root_doc'] . "/plugins/accounts/ajax/accounttree.php", array('title' => __('Type view', 'accounts'), 'width' => 800, 'height' => 400));
}
Search::show("PluginAccountsAccount");
} else {
Html::displayRightError();
}
if ($_SESSION['glpiactiveprofile']['interface'] == 'central') {
Html::footer();
} else {
Html::helpFooter();
}
示例4: showProfileSelecter
/**
* Print the form used to select profile if several are available
*
* @param $target target of the form
*
* @return nothing
**/
static function showProfileSelecter($target)
{
global $CFG_GLPI;
if (count($_SESSION["glpiprofiles"]) > 1) {
echo '<li><form name="form" method="post" action="' . $target . '">';
echo '<select name="newprofile" onChange="submit()">';
foreach ($_SESSION["glpiprofiles"] as $key => $val) {
echo '<option value="' . $key . '" ' . ($_SESSION["glpiactiveprofile"]["id"] == $key ? 'selected' : '') . '>' . $val['name'] . '</option>';
}
echo '</select>';
Html::closeForm();
echo '</li>';
}
if (Session::isMultiEntitiesMode()) {
echo "<li>";
Ajax::createModalWindow('entity_window', $CFG_GLPI['root_doc'] . "/ajax/entitytree.php", array('title' => __('Select the desired entity'), 'extraparams' => array('target' => $target)));
echo "<a onclick='entity_window.show();' href='#modal_entity_content' title=\"" . addslashes($_SESSION["glpiactive_entity_name"]) . "\" class='entity_select' id='global_entity_select'>" . $_SESSION["glpiactive_entity_shortname"] . "</a>";
echo "</li>";
}
}