當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Ajax::createModalWindow方法代碼示例

本文整理匯總了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>";
     }
 }
開發者ID:OlivierLM,項目名稱:glpi,代碼行數:27,代碼來源:html.class.php

示例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>";
 }
開發者ID:korial29,項目名稱:fusioninventory-for-glpi,代碼行數:85,代碼來源:deployfile.class.php

示例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();
}
開發者ID:puchadesc,項目名稱:accounts,代碼行數:31,代碼來源:account.php

示例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>";
     }
 }
開發者ID:geldarr,項目名稱:hack-space,代碼行數:27,代碼來源:html.class.php


注:本文中的Ajax::createModalWindow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。