当前位置: 首页>>代码示例>>PHP>>正文


PHP Html::submit方法代码示例

本文整理汇总了PHP中Html::submit方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::submit方法的具体用法?PHP Html::submit怎么用?PHP Html::submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Html的用法示例。


在下文中一共展示了Html::submit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showForm

 /**
  * Show profile form
  *
  * @param $items_id integer id of the profile
  * @param $target value url of target
  *
  * @return nothing
  **/
 function showForm($profiles_id = 0, $openform = TRUE, $closeform = TRUE)
 {
     echo "<div class='firstbloc'>";
     if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) {
         $profile = new Profile();
         echo "<form method='post' action='" . $profile->getFormURL() . "'>";
     }
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     $rights = array(array('itemtype' => 'PluginAddressingAddressing', 'label' => __('Generate reports', 'addressing'), 'field' => 'plugin_addressing'));
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General')));
     echo "<table class='tab_cadre_fixehov'>";
     $effective_rights = ProfileRight::getProfileRights($profiles_id, array('plugin_addressing_use_ping_in_equipment'));
     echo "<tr class='tab_bg_2'>";
     echo "<td width='20%'>" . __('Use ping on equipment form', 'addressing') . "</td>";
     echo "<td colspan='5'>";
     Html::showCheckbox(array('name' => '_plugin_addressing_use_ping_in_equipment[1_0]', 'checked' => $effective_rights['plugin_addressing_use_ping_in_equipment']));
     echo "</td></tr>\n";
     echo "</table>";
     if ($canedit && $closeform) {
         echo "<div class='center'>";
         echo Html::hidden('id', array('value' => $profiles_id));
         echo Html::submit(_sx('button', 'Save'), array('name' => 'update'));
         echo "</div>\n";
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:36,代码来源:profile.class.php

示例2: showForm

 /**
  * Show profile form
  *
  * @param $items_id integer id of the profile
  * @param $target value url of target
  *
  * @return nothing
  **/
 function showForm($profiles_id = 0, $openform = TRUE, $closeform = TRUE)
 {
     echo "<div class='firstbloc'>";
     if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) {
         $profile = new Profile();
         echo "<form method='post' action='" . $profile->getFormURL() . "'>";
     }
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     if ($profile->getField('interface') == 'central') {
         $rights = $this->getAllRights();
         $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General')));
     }
     echo "<table class='tab_cadre_fixehov'>";
     echo "<tr class='tab_bg_1'><th colspan='4'>" . __('Helpdesk') . "</th></tr>\n";
     $effective_rights = ProfileRight::getProfileRights($profiles_id, array('plugin_racks_open_ticket'));
     echo "<tr class='tab_bg_2'>";
     echo "<td width='20%'>" . __('Associable items to a ticket') . "</td>";
     echo "<td colspan='5'>";
     Html::showCheckbox(array('name' => '_plugin_racks_open_ticket', 'checked' => $effective_rights['plugin_racks_open_ticket']));
     echo "</td></tr>\n";
     echo "</table>";
     if ($canedit && $closeform) {
         echo "<div class='center'>";
         echo Html::hidden('id', array('value' => $profiles_id));
         echo Html::submit(_sx('button', 'Save'), array('name' => 'update'));
         echo "</div>\n";
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:39,代码来源:profile.class.php

示例3: showForm

 function showForm()
 {
     $this->getfromDB(1);
     $target = self::getFormURL();
     echo "<div align='center'><form method='post'  action=\"{$target}\">";
     echo "<table class='tab_cadre' cellpadding='5'><tr ><th colspan='2'>";
     echo self::getTypeName(0) . "</th></tr>";
     echo "<tr class='tab_bg_1'><td>";
     echo "<select name=\"unit\" size=\"1\"> ";
     echo "<option ";
     if ($this->isMetricUnit()) {
         echo "selected ";
     }
     echo "value='" . self::METRIC_UNIT . "'>" . __('metric', 'racks') . "</option>";
     echo "<option ";
     if (!$this->isMetricUnit()) {
         echo "selected ";
     }
     echo "value='" . self::NON_METRIC_UNIT . "'>" . __('English', 'racks') . "</option>";
     echo "</select> ";
     echo "</td>";
     echo "<td>";
     echo Html::hidden('id', array('value' => 1));
     echo Html::submit(_sx('button', 'Post'), array('name' => 'update'));
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:28,代码来源:config.class.php

示例4: showMassiveActionsSubForm

 /**
  * @since version 0.85
  *
  * @see CommonDBTM::showMassiveActionsSubForm()
  **/
 static function showMassiveActionsSubForm(MassiveAction $ma)
 {
     switch ($ma->getAction()) {
         case 'import_email':
             Entity::dropdown();
             echo "<br><br>";
             echo Html::submit(_x('button', 'Import'), array('name' => 'massiveaction'));
             return true;
     }
     return parent::showMassiveActionsSubForm($ma);
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:16,代码来源:notimportedemail.class.php

示例5: showMassiveActionsSubForm

 /**
  * @since version 0.85
  *
  * @see CommonDBTM::showMassiveActionsSubForm()
  **/
 static function showMassiveActionsSubForm(MassiveAction $ma)
 {
     switch ($ma->getAction()) {
         case 'updatepages':
             $input = $ma->getInput();
             if (!isset($input['maxpages'])) {
                 $input['maxpages'] = '';
             }
             echo "<input type='text' name='pages' value=\"" . $input['maxpages'] . "\" size='6'>";
             echo "<br><br>" . Html::submit(_x('button', 'Update'), array('name' => 'massiveaction'));
             return true;
     }
     return parent::showMassiveActionsSubForm($ma);
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:19,代码来源:cartridge.class.php

示例6: showMassiveActionsSubForm

 /**
  * @since version 0.85
  *
  * @see CommonDBTM::showMassiveActionsSubForm()
  **/
 static function showMassiveActionsSubForm(MassiveAction $ma)
 {
     global $UNINSTALL_TYPES;
     foreach ($ma->getItems() as $itemtype => $data) {
         if (!in_array($itemtype, $UNINSTALL_TYPES)) {
             return "";
         }
     }
     switch ($ma->getAction()) {
         case 'uninstall':
             $uninst = new PluginUninstallUninstall();
             $uninst->dropdownUninstallModels("model_id", $_SESSION["glpiID"], $_SESSION["glpiactive_entity"]);
             echo "&nbsp;" . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
             return true;
     }
     return "";
 }
开发者ID:pluginsGLPI,项目名称:uninstall,代码行数:22,代码来源:uninstall.class.php

示例7: showForm

 function showForm()
 {
     $this->getfromDB(1);
     $target = self::getFormURL();
     echo "<div align='center'><form method='post'  action=\"{$target}\">";
     echo "<table class='tab_cadre' cellpadding='5'><tr ><th colspan='2'>";
     echo self::getTypeName(0) . "</th></tr>";
     echo "<tr class='tab_bg_1'><td>" . __('Configuration of units', 'racks') . "</td><td>";
     echo "<select name=\"unit\" size=\"1\"> ";
     echo "<option ";
     if ($this->isMetricUnit()) {
         echo "selected ";
     }
     echo "value='" . self::METRIC_UNIT . "'>" . __('metric', 'racks') . "</option>";
     echo "<option ";
     if (!$this->isMetricUnit()) {
         echo "selected ";
     }
     echo "value='" . self::NON_METRIC_UNIT . "'>" . __('English', 'racks') . "</option>";
     echo "</select> ";
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __("Copy rack's location when adding a new asset in the rack", "racks");
     echo "</td>";
     echo "<td style='width: 150px;'>";
     Dropdown::showYesNo('add_location_on_new_item', $this->fields['add_location_on_new_item']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __("Forward rack's location to linked assets on change", "racks");
     echo "</td>";
     echo "<td style='width: 150px;'>";
     Dropdown::showYesNo('forward_location_on_change', $this->fields['forward_location_on_change']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td colspan='2' align='center'>";
     echo Html::hidden('id', array('value' => 1));
     echo Html::submit(_sx('button', 'Post'), array('name' => 'update'));
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:sx3052,项目名称:racks,代码行数:46,代码来源:config.class.php

示例8: showForProfile

 /**
  * @param $prof   Profile object
  **/
 static function showForProfile(Profile $prof)
 {
     global $DB;
     $canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE));
     if ($canedit) {
         echo "<form method='post' action='" . $prof->getFormURL() . "'>";
     }
     $rights = self::getAllRights();
     $prof->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Rights management by profil', 'reports')));
     if ($canedit) {
         echo "<div class='center'>";
         echo Html::hidden('id', array('value' => $prof->getField('id')));
         echo Html::submit(_sx('button', 'Save'), array('name' => 'update'));
         echo "</div>\n";
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:21,代码来源:profile.class.php

示例9: showForm

 /**
  * Show profile form
  *
  * @param $items_id integer id of the profile
  * @param $target value url of target
  *
  * @return nothing
  **/
 function showForm($profiles_id = 0, $openform = TRUE, $closeform = TRUE)
 {
     $profile = new Profile();
     echo "<div class='firstbloc'>";
     if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) {
         echo "<form method='post' action='" . $profile->getFormURL() . "'>";
     }
     $profile->getFromDB($profiles_id);
     $rights = $this->getAllRights();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Reforme', 'reforme')));
     if ($canedit && $closeform) {
         echo "<div class='center'>";
         echo Html::hidden('id', array('value' => $profiles_id));
         echo Html::submit(_sx('button', 'Save'), array('name' => 'update'));
         echo "</div>\n";
         echo Html::closeForm(false);
     }
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:27,代码来源:profile.class.php

示例10: showMassiveActionsSubForm

 /**
  * @since version 0.85
  *
  * @see CommonDBTM::showMassiveActionsSubForm()
  **/
 static function showMassiveActionsSubForm(MassiveAction $ma)
 {
     switch ($ma->getAction()) {
         case 'duplicate':
             Entity::dropdown();
             echo "<br><br>";
             echo Html::submit(_x('button', 'Duplicate'), array('name' => 'massiveaction')) . "</span>";
             return true;
     }
     return parent::showMassiveActionsSubForm($ma);
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:16,代码来源:calendar.class.php

示例11: showMassiveActionsSubForm

 /**
  * @since version 0.85
  *
  * @see CommonDBTM::showMassiveActionsSubForm()
  **/
 static function showMassiveActionsSubForm(MassiveAction $ma)
 {
     global $UNINSTALL_TYPES;
     switch ($ma->getAction()) {
         case 'transfert':
             Entity::dropdown();
             echo "&nbsp;" . Html::submit(_x('button', 'Post'), array('name' => 'massiveaction'));
             return true;
     }
     return "";
 }
开发者ID:pluginsGLPI,项目名称:order,代码行数:16,代码来源:order.class.php

示例12: showMassiveActionsSubForm

 static function showMassiveActionsSubForm(MassiveAction $ma)
 {
     switch ($ma->getAction()) {
         case "add_model":
             echo "<input type=\"text\" name=\"model_name\">&nbsp;";
             echo Html::submit(_sx('button', 'Post'), array('name' => 'massiveaction'));
             return true;
             break;
     }
     return parent::showMassiveActionsSubForm($ma);
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:11,代码来源:model.class.php

示例13: showForItem

 /**
  * Show notepads for an item
  *
  * @param $item                  CommonDBTM object
  * @param $withtemplate integer  template or basic item (default '')
  **/
 static function showForItem(CommonDBTM $item, $withtemplate = '')
 {
     global $CFG_GLPI;
     if (!Session::haveRight($item::$rightname, READNOTE)) {
         return false;
     }
     $notes = static::getAllForItem($item);
     $rand = mt_rand();
     $canedit = Session::haveRight($item::$rightname, UPDATENOTE);
     $showuserlink = 0;
     if (User::canView()) {
         $showuserlink = 1;
     }
     if ($canedit) {
         echo "<div class='boxnote center'>";
         echo "<div class='boxnoteleft'></div>";
         echo "<form name='addnote_form{$rand}' id='addnote_form{$rand}' ";
         echo " method='post' action='" . Toolbox::getItemTypeFormURL('Notepad') . "'>";
         echo Html::hidden('itemtype', array('value' => $item->getType()));
         echo Html::hidden('items_id', array('value' => $item->getID()));
         echo "<div class='boxnotecontent'>";
         echo "<div class='floatleft'>";
         echo "<textarea name='content' rows=5 cols=100></textarea>";
         echo "</div>";
         echo "</div>";
         // box notecontent
         echo "<div class='boxnoteright'><br>";
         echo Html::submit(_x('button', 'Add'), array('name' => 'add'));
         echo "</div>";
         Html::closeForm();
         echo "</div>";
         // boxnote
     }
     if (count($notes)) {
         foreach ($notes as $note) {
             $id = 'note' . $note['id'] . $rand;
             $classtoadd = '';
             if ($canedit) {
                 $classtoadd = " pointer";
             }
             echo "<div class='boxnote' id='view{$id}'>";
             echo "<div class='boxnoteleft'>";
             echo "<img class='user_picture_verysmall' alt=\"" . __s('Picture') . "\" src='" . User::getThumbnailURLForPicture($note['picture']) . "'>";
             echo "</div>";
             // boxnoteleft
             echo "<div class='boxnotecontent'>";
             echo "<div class='boxnotefloatright'>";
             $username = NOT_AVAILABLE;
             if ($note['users_id_lastupdater']) {
                 $username = getUserName($note['users_id_lastupdater'], $showuserlink);
             }
             $update = sprintf(__('Last update by %1$s on %2$s'), $username, Html::convDateTime($note['date_mod']));
             $username = NOT_AVAILABLE;
             if ($note['users_id']) {
                 $username = getUserName($note['users_id'], $showuserlink);
             }
             $create = sprintf(__('Create by %1$s on %2$s'), $username, Html::convDateTime($note['date']));
             printf(__('%1$s / %2$s'), $update, $create);
             echo "</div>";
             // floatright
             echo "<div class='boxnotetext {$classtoadd}' ";
             if ($canedit) {
                 echo "onclick=\"" . Html::jsHide("view{$id}") . " " . Html::jsShow("edit{$id}") . "\"";
             }
             echo ">";
             $content = nl2br($note['content']);
             if (empty($content)) {
                 $content = NOT_AVAILABLE;
             }
             echo $content . '</div>';
             // boxnotetext
             echo "</div>";
             // boxnotecontent
             echo "<div class='boxnoteright'>";
             if ($canedit) {
                 Html::showSimpleForm(Toolbox::getItemTypeFormURL('Notepad'), array('purge' => 'purge'), _x('button', 'Delete permanently'), array('id' => $note['id']), $CFG_GLPI["root_doc"] . "/pics/delete.png", '', __('Confirm the final deletion?'));
             }
             echo "</div>";
             // boxnoteright
             echo "</div>";
             // boxnote
             if ($canedit) {
                 echo "<div class='boxnote starthidden' id='edit{$id}'>";
                 echo "<form name='update_form{$id}{$rand}' id='update_form{$id}{$rand}' ";
                 echo " method='post' action='" . Toolbox::getItemTypeFormURL('Notepad') . "'>";
                 echo "<div class='boxnoteleft'></div>";
                 echo "<div class='boxnotecontent'>";
                 echo Html::hidden('id', array('value' => $note['id']));
                 echo "<textarea name='content' rows=5 cols=100>" . $note['content'] . "</textarea>";
                 echo "</div>";
                 // boxnotecontent
                 echo "<div class='boxnoteright'><br>";
                 echo Html::submit(_x('button', 'Update'), array('name' => 'update'));
                 echo "</div>";
//.........这里部分代码省略.........
开发者ID:stweil,项目名称:glpi,代码行数:101,代码来源:notepad.class.php

示例14: showMassiveActionsSubForm

 /**
  * @since version 0.85
  *
  * @see CommonDBTM::showMassiveActionsSubForm()
  **/
 static function showMassiveActionsSubForm(MassiveAction $ma)
 {
     global $CFG_GLPI;
     $specificities = static::getRelationMassiveActionsSpecificities();
     $action = $ma->getAction();
     // First, get normalized action : add or remove
     if (in_array($action, $specificities['normalized']['add'])) {
         $normalized_action = 'add';
     } else {
         if (in_array($action, $specificities['normalized']['remove'])) {
             $normalized_action = 'remove';
         } else {
             // If we cannot get normalized action, then, its not for this method !
             return parent::showMassiveActionsSubForm($ma);
         }
     }
     switch ($normalized_action) {
         case 'add':
         case 'remove':
             // Get the peer number. For Document_Item, it depends of the action's name
             $peer_number = static::getRelationMassiveActionsPeerForSubForm($ma);
             switch ($peer_number) {
                 case 1:
                     $peertype = static::$itemtype_1;
                     $peers_id = static::$items_id_1;
                     break;
                 case 2:
                     $peertype = static::$itemtype_2;
                     $peers_id = static::$items_id_2;
                     break;
                 default:
                     exit;
             }
             if ($normalized_action == 'remove' && $specificities['only_remove_all_at_once']) {
                 // If we just want to remove all the items, then just set hidden fields
                 echo Html::hidden('peer_' . $peertype, array('value' => ''));
                 echo Html::hidden('peer_' . $peers_id, array('value' => -1));
             } else {
                 // Else, it depends if the peer is an itemtype or not
                 $options = $specificities['select_items_options_' . $peer_number];
                 // Do we allow to remove all the items at once ? Then, rename the default value !
                 if ($normalized_action == 'remove' && $specificities['can_remove_all_at_once']) {
                     $options['emptylabel'] = __('Remove all at once');
                 }
                 if (preg_match('/^itemtype/', $peertype)) {
                     if (count($specificities['itemtypes']) > 0) {
                         $options['itemtype_name'] = 'peer_' . $peertype;
                         $options['items_id_name'] = 'peer_' . $peers_id;
                         $options['itemtypes'] = $specificities['itemtypes'];
                         // At least, if not forced by user, 'checkright' == true
                         if (!isset($options['checkright'])) {
                             $options['checkright'] = true;
                         }
                         Dropdown::showSelectItemFromItemtypes($options);
                     }
                 } else {
                     $options['name'] = 'peer_' . $peers_id;
                     $dropdown_method = $specificities['dropdown_method_' . $peer_number];
                     $peertype::$dropdown_method($options);
                 }
             }
             // Allow any relation to display its own fields (Networkport_Vlan for tagged ...)
             static::showRelationMassiveActionsSubForm($ma, $peer_number);
             echo "<br><br>" . Html::submit($specificities['button_labels'][$action], array('name' => 'massiveaction'));
             return true;
     }
     return parent::showMassiveActionsSubForm($ma);
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:73,代码来源:commondbrelation.class.php

示例15: 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);
 }
开发者ID:pvasener,项目名称:glpi,代码行数:44,代码来源:rule.class.php


注:本文中的Html::submit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。