本文整理汇总了PHP中Rule::getTypeName方法的典型用法代码示例。如果您正苦于以下问题:PHP Rule::getTypeName方法的具体用法?PHP Rule::getTypeName怎么用?PHP Rule::getTypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rule
的用法示例。
在下文中一共展示了Rule::getTypeName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RuleAction
$ruleaction = new RuleAction(get_class($rule));
if (isset($_POST["add_action"])) {
$rulecollection->checkGlobal(CREATE);
$ruleaction->add($_POST);
Html::back();
} else {
if (isset($_POST["update"])) {
$rulecollection->checkGlobal(UPDATE);
$rule->update($_POST);
Event::log($_POST['id'], "rules", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::back();
} else {
if (isset($_POST["add"])) {
$rulecollection->checkGlobal(CREATE);
$newID = $rule->add($_POST);
Event::log($newID, "rules", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID));
Html::redirect($_SERVER['HTTP_REFERER'] . "?id={$newID}");
} else {
if (isset($_POST["purge"])) {
$rulecollection->checkGlobal(PURGE);
$rulecollection->deleteRuleOrder($_POST["ranking"]);
$rule->delete($_POST, 1);
Event::log($_POST["id"], "rules", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
$rule->redirectToList();
}
}
}
}
Html::header(Rule::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'admin', $rulecollection->menu_type, $rulecollection->menu_option);
$rule->display(array('id' => $_GET["id"]));
Html::footer();
示例2: sprintf
if (isset($_POST["add_action"])) {
$rulecollection->checkGlobal('w');
$ruleaction->add($_POST);
Html::back();
} else {
if (isset($_POST["update"])) {
$rulecollection->checkGlobal('w');
$rule->update($_POST);
Event::log($_POST['id'], "rules", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
Html::back();
} else {
if (isset($_POST["add"])) {
$rulecollection->checkGlobal('w');
$newID = $rule->add($_POST);
Event::log($newID, "rules", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID));
Html::redirect($_SERVER['HTTP_REFERER'] . "?id={$newID}");
} else {
if (isset($_POST["delete"])) {
$rulecollection->checkGlobal('w');
$rulecollection->deleteRuleOrder($_POST["ranking"]);
$rule->delete($_POST);
Event::log($_POST["id"], "rules", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
$rule->redirectToList();
}
}
}
}
}
Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], 'admin', $rulecollection->menu_type, $rulecollection->menu_option);
$rule->showForm($_GET["id"]);
Html::footer();
示例3: sprintf
GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkCentralAccess();
Html::header(Rule::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "admin", "rule", -1);
RuleCollection::titleBackup();
echo "<table class='tab_cadre'>";
echo "<tr><th>" . __('Rule type') . "</th></tr>";
foreach ($CFG_GLPI["rulecollections_types"] as $rulecollectionclass) {
$rulecollection = new $rulecollectionclass();
if ($rulecollection->canList()) {
if ($plug = isPluginItemType($rulecollectionclass)) {
$title = sprintf(__('%1$s - %2$s'), Plugin::getInfo($plug['plugin'], 'name'), $rulecollection->getTitle());
} else {
$title = $rulecollection->getTitle();
}
echo "<tr class='tab_bg_1'><td class='center b'>";
echo "<a href='" . Toolbox::getItemTypeSearchURL($rulecollection->getRuleClassName()) . "'>";
echo $title . "</a></td></tr>";
}
示例4: sprintf
GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkCentralAccess();
Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "rule", -1);
echo "<table class='tab_cadre'>";
echo "<tr><th>" . __('Rule type') . "</th></tr>";
foreach ($CFG_GLPI["rulecollections_types"] as $rulecollectionclass) {
$rulecollection = new $rulecollectionclass();
if ($rulecollection->canList()) {
if ($plug = isPluginItemType($rulecollectionclass)) {
$title = sprintf(__('%1$s - %2$s'), Plugin::getInfo($plug['plugin'], 'name'), $rulecollection->getTitle());
} else {
$title = $rulecollection->getTitle();
}
echo "<tr class='tab_bg_1'><td class='center b'>";
echo "<a href='" . Toolbox::getItemTypeSearchURL($rulecollection->getRuleClassName()) . "'>";
echo $title . "</a></td></tr>";
}
}
示例5:
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
if (!defined('GLPI_ROOT')) {
include '../inc/includes.php';
}
Session::checkCentralAccess();
if (!strpos($_SERVER['PHP_SELF'], "popup")) {
Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "dictionnary", "cache");
}
if (isset($_GET["sub_type"])) {
echo "<br>";
$rulecollection = RuleCollection::getClassByType($_GET["sub_type"]);
if ($rulecollection->canView()) {
if (!isset($_GET["rules_id"])) {
$rulecollection->showCacheStatusForRuleType();
} else {
if ($rule = getItemForItemtype($_GET["sub_type"])) {
$rule->getRuleWithCriteriasAndActions($_GET["rules_id"], 0, 0);
$rule->showCacheStatusByRule($_SERVER["HTTP_REFERER"]);
}
}
}
}