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


PHP Profile::displayRightsChoiceMatrix方法代碼示例

本文整理匯總了PHP中Profile::displayRightsChoiceMatrix方法的典型用法代碼示例。如果您正苦於以下問題:PHP Profile::displayRightsChoiceMatrix方法的具體用法?PHP Profile::displayRightsChoiceMatrix怎麽用?PHP Profile::displayRightsChoiceMatrix使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Profile的用法示例。


在下文中一共展示了Profile::displayRightsChoiceMatrix方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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

 function showForm($ID, $options = array())
 {
     global $LANG;
     if (!Profile::canView()) {
         return false;
     }
     $canedit = self::canUpdate();
     $profile = new Profile();
     if ($ID) {
         //$this->getFromDBByProfile($ID);
         $profile->getFromDB($ID);
     }
     if ($canedit) {
         echo "<form action='" . $profile->getFormURL() . "' method='post'>";
     }
     $rights = $this->getAllRights();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2'));
     if ($canedit) {
         echo "<div class='center'>";
         echo "<input type='hidden' name='id' value=" . $ID . ">";
         echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
         echo "</div>";
     }
     Html::closeForm();
     $this->showLegend();
 }
開發者ID:jelacote,項目名稱:simcard,代碼行數:26,代碼來源:profile.class.php

示例3: 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

示例4: 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

示例5: 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

示例6: showForm

 function showForm($ID, $options = array())
 {
     global $DB;
     $profile = new Profile();
     if ($ID) {
         $this->getFromDB($ID);
         $profile->getFromDB($ID);
     } else {
         $this->getEmpty();
     }
     if ($canedit = self::canUpdate()) {
         $options['colspan'] = 1;
         $options['target'] = $profile->getFormURL();
         $this->fields["id"] = $ID;
         $this->showFormHeader($options);
     }
     $rights = $this->getGeneralRights();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2'));
     if ($canedit) {
         $options['candel'] = false;
         $this->showFormButtons($options);
     }
 }
開發者ID:pluginsGLPI,項目名稱:uninstall,代碼行數:23,代碼來源:profile.class.php

示例7: showForm

 function showForm($profiles_id, $options = array())
 {
     if (!Session::haveRight("profile", READ)) {
         return false;
     }
     $canedit = Session::haveRight("profile", UPDATE);
     //if ($id) {
     //   $this->getProfilesFromDB($id);
     //}
     //Ensure rights are defined in database
     self::installRights();
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     echo "<form action='" . Profile::getFormUrl() . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     $general_rights = self::getGeneralRights();
     $profile->displayRightsChoiceMatrix($general_rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General', 'genericobject')));
     $types_rights = self::getTypesRights();
     $title = __('Objects', 'genericobject');
     if (count($types_rights) == 0) {
         $title .= __(" (No types defined yet)", "genericobject");
     }
     $profile->displayRightsChoiceMatrix($types_rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => $title));
     $profile->showLegend();
     if ($canedit) {
         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:drTr0jan,項目名稱:genericobject,代碼行數:33,代碼來源:profile.class.php

示例8: 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 = $this->getRightsGeneral();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General', 'fusioninventory')));
     $rights = $this->getRightsRules();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => _n('Rule', 'Rules', 2)));
     $rights = $this->getRightsInventory();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Inventory', 'fusioninventory')));
     $rights = $this->getRightsDeploy();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('Software deployment', 'fusioninventory')));
     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>";
     $this->showLegend();
 }
開發者ID:korial29,項目名稱:fusioninventory-for-glpi,代碼行數:35,代碼來源: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, $options = array())
 {
     echo "<div class='firstbloc'>";
     $profile = new Profile();
     if ($profiles_id > 0) {
         $profile->check($profiles_id, READ);
     } else {
         // Create item
         $profile->check(-1, CREATE);
     }
     $profile->showFormHeader($options);
     $rights = $this->getAllRights();
     $profile->displayRightsChoiceMatrix($rights, array('default_class' => 'tab_bg_2', 'title' => __('General')));
     echo "<table class='tab_cadre_fixehov'>";
     echo "<tr class='tab_bg_1'><th colspan='4'>" . __('Advanced', 'consumables') . "</th></tr>\n";
     $effective_rights = ProfileRight::getProfileRights($profiles_id, array('plugin_consumables_user', 'plugin_consumables_group', 'plugin_consumables_validation', 'plugin_consumables_request'));
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Consumable validation', 'consumables') . "</td>";
     echo "<td>";
     Html::showCheckbox(array('name' => '_plugin_consumables_validation[1_0]', 'checked' => $effective_rights['plugin_consumables_validation']));
     echo "<td>" . __('Make a consumable request', 'consumables') . "</td>";
     echo "<td>";
     Html::showCheckbox(array('name' => '_plugin_consumables_request[1_0]', 'checked' => $effective_rights['plugin_consumables_request']));
     echo "</td>";
     echo "</tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Make a consumable request for all users', 'consumables') . "</td>";
     echo "<td>";
     Html::showCheckbox(array('name' => '_plugin_consumables_user[1_0]', 'checked' => $effective_rights['plugin_consumables_user']));
     echo "</td>";
     echo "<td>" . __('Make a consumable request for my groups', 'consumables') . "</td>";
     echo "<td>";
     Html::showCheckbox(array('name' => '_plugin_consumables_group[1_0]', 'checked' => $effective_rights['plugin_consumables_group']));
     echo "</td>";
     echo "</tr>\n";
     $profile->showFormButtons($options);
     echo "</div>";
 }
開發者ID:AircraftRu,項目名稱:consumables,代碼行數:46,代碼來源:profile.class.php

示例10: showForm

 public function showForm($profiles_id, $options = array())
 {
     global $LANG;
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     if ($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) {
         echo "<form action='" . $profile->getFormURL() . "' method='post'>";
     }
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     $rights = $this->getAllRights();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => $LANG['plugin_news']['title']));
     if ($canedit) {
         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();
     }
     HTML::closeForm();
 }
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:21,代碼來源:profile.class.php

示例11: 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)
 {
     global $DB, $CFG_GLPI;
     $profile = new Profile();
     $profile->getFromDB($profiles_id);
     echo "<div class='firstbloc'>";
     if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) {
         echo "<form action='" . $CFG_GLPI['root_doc'] . "/plugins/ocsinventoryng/front/profile.form.php' method='post'>";
     }
     //Delegating
     $effective_rights = ProfileRight::getProfileRights($profiles_id, array('plugin_ocsinventoryng'));
     echo "<table class='tab_cadre_fixehov'>";
     echo "<tr><th colspan='4' class='center b'>" . sprintf(__('%1$s - %2$s'), 'OcsinventoryNG', $profile->fields["name"]) . "</th>";
     echo "</tr>";
     $used = array();
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . sprintf(__('%1$s : %2$s'), _n('Allowed OCSNG server', 'Allowed OCSNG servers', 2, 'ocsinventoryng'), "&nbsp;");
     //$profile = $this->fields['id'];
     $crit = array('profiles_id' => $profiles_id);
     foreach ($DB->request("glpi_plugin_ocsinventoryng_ocsservers_profiles", $crit) as $data) {
         $used[$data['plugin_ocsinventoryng_ocsservers_id']] = $data['plugin_ocsinventoryng_ocsservers_id'];
         $configid[$data['plugin_ocsinventoryng_ocsservers_id']] = $data['id'];
     }
     if (Session::haveRight("profile", UPDATE)) {
         Dropdown::show('PluginOcsinventoryngOcsServer', array('width' => '50%', 'used' => $used, 'value' => '', 'condition' => "is_active = 1"));
         echo "&nbsp;&nbsp;<input type='hidden' name='profile' value='{$profiles_id}'>";
         echo "&nbsp;&nbsp;<input type='submit' name='addocsserver' value=\"" . _sx('button', 'Add') . "\" class='submit' >";
     }
     echo "</td><td>";
     echo "<table width='100%'><tr class='tab_bg_1'><td>";
     $nbservers = countElementsInTable('glpi_plugin_ocsinventoryng_ocsservers_profiles', "`profiles_id` = " . $profiles_id);
     $query = "SELECT `glpi_plugin_ocsinventoryng_ocsservers`.`id`,\n                       `glpi_plugin_ocsinventoryng_ocsservers`.`name`\n                FROM `glpi_plugin_ocsinventoryng_ocsservers_profiles`\n                LEFT JOIN `glpi_plugin_ocsinventoryng_ocsservers`\n                   ON `glpi_plugin_ocsinventoryng_ocsservers_profiles`.`plugin_ocsinventoryng_ocsservers_id` = `glpi_plugin_ocsinventoryng_ocsservers`.`id`\n                WHERE `profiles_id`= " . $_SESSION["glpiactiveprofile"]['id'] . "\n                ORDER BY `name` ASC";
     $result = $DB->query($query);
     if ($data = $DB->fetch_assoc($result)) {
         $ocsserver = new PluginOcsinventoryngOcsServer();
         foreach ($used as $id) {
             if ($ocsserver->getFromDB($id)) {
                 echo "<br>";
                 if (Session::haveRight("profile", UPDATE)) {
                     echo "<input type='checkbox' name='item[" . $configid[$id] . "]' value='1'>";
                 }
                 if ($data['id'] == $id) {
                     echo $ocsserver->getLink();
                 } else {
                     echo $ocsserver->getName();
                 }
             }
         }
     }
     if (!$nbservers) {
         _e('None');
     }
     echo "</td></tr>";
     if ($nbservers && Session::haveRight("profile", UPDATE)) {
         echo "<tr class='tab_bg_1 center'><td>";
         echo "<input type='submit' name='delete' value='Supprimer' class='submit' >";
         echo "</td></tr>";
     }
     echo "</table>";
     echo "</td></tr>";
     echo "</table>";
     Html::closeForm();
     if (($canedit = Session::haveRightsOr(self::$rightname, array(CREATE, UPDATE, PURGE))) && $openform) {
         echo "<form method='post' action='" . $profile->getFormURL() . "'>";
     }
     $rights = $this->getAllRights();
     $profile->displayRightsChoiceMatrix($rights, array('canedit' => $canedit, 'default_class' => 'tab_bg_2', 'title' => __('General')));
     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:JULIO8,項目名稱:respaldo_glpi,代碼行數:84,代碼來源:profile.class.php


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