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


PHP RuleAction::getActionByID方法代码示例

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


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

示例1: plugin_reports_rulelist

function plugin_reports_rulelist($rulecollection, $title)
{
    Session::checkRight($rulecollection::$rightname, READ);
    $rulecollection->getCollectionDatas(true, true);
    echo "<div class='center'>";
    echo "<table class='tab_cadre' cellpadding='5'>\n";
    echo "<tr><th colspan='6'><a href='" . $_SERVER["PHP_SELF"] . "'>" . __('rules_report_title', 'reports') . "</a> - " . $title . "</th></tr>";
    echo "<tr><th>" . __('Name') . "</th>";
    echo "<th>" . __('Description') . "</th>";
    echo "<th colspan='2'>" . _n('Criterion', 'Criteria', 2) . "</th>";
    echo "<th>" . _n('Action', 'Actions', 2) . "</th>";
    echo "<th>" . __('Active') . "</th></tr>\n";
    foreach ($rulecollection->RuleList->list as $rule) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $rule->fields["name"] . "</td>";
        echo "<td>" . $rule->fields["description"] . "</td>";
        if ($rule->fields["match"] == Rule::AND_MATCHING) {
            echo "<td>" . __('and') . "</td>";
        } else {
            echo "<td>" . __('or') . "</td>";
        }
        echo "<td>";
        foreach ($rule->criterias as $criteria) {
            echo $rule->getCriteriaName($criteria->fields["criteria"]) . " " . RuleCriteria::getConditionByID($criteria->fields["condition"], get_class($rule)) . " " . $rule->getCriteriaDisplayPattern($criteria->fields["criteria"], $criteria->fields["condition"], $criteria->fields["pattern"]) . "<br>";
        }
        echo "</td>";
        echo "<td>";
        foreach ($rule->actions as $action) {
            echo $rule->getActionName($action->fields["field"]) . " " . RuleAction::getActionByID($action->fields["action_type"]) . " " . stripslashes($rule->getActionValue($action->fields["field"], $action->fields["action_type"], $action->fields["value"])) . "<br>";
        }
        echo "</td>";
        if ($rule->fields["is_active"]) {
            echo "<td>" . __('Yes') . "</td>";
        } else {
            echo "<td>" . __('No') . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</table></div>\n";
}
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:40,代码来源:rules.php

示例2: getMinimalActionText

 /**
  * @param $fields
  **/
 function getMinimalActionText($fields)
 {
     $text = "<td>" . $this->getActionName($fields["field"]) . "</td>";
     $text .= "<td>" . RuleAction::getActionByID($fields["action_type"]) . "</td>";
     $text .= "<td>" . $this->getActionValue($fields["field"], $fields['action_type'], $fields["value"]) . "</td>";
     return $text;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:10,代码来源:rule.class.php

示例3: getMinimalActionText

 /**
  * @param $fields
  * @param $addtotd   (default '')
  **/
 function getMinimalActionText($fields, $addtotd = '')
 {
     $text = "<td {$addtotd}>" . $this->getActionName($fields["field"]) . "</td>";
     $text .= "<td {$addtotd}>" . RuleAction::getActionByID($fields["action_type"]) . "</td>";
     if (isset($fields["value"])) {
         $text .= "<td {$addtotd}>" . $this->getActionValue($fields["field"], $fields['action_type'], $fields["value"]) . "</td>";
     } else {
         $text .= "<td {$addtotd}>&nbsp;</td>";
     }
     return $text;
 }
开发者ID:pvasener,项目名称:glpi,代码行数:15,代码来源:rule.class.php

示例4: previewImportRules


//.........这里部分代码省略.........
         echo "<th>" . __('Name') . "</th>";
         echo "<th>" . __('Reason of rejection') . "</th>";
         echo "</tr>";
         $odd = true;
         foreach ($rules_refused as $k_rule => $refused) {
             $odd = !$odd;
             if ($odd) {
                 $class = " class='tab_bg_1' ";
             } else {
                 $class = " class='tab_bg_2' ";
             }
             $sub_type = $rules['rule'][$k_rule]['sub_type'];
             $item = new $sub_type();
             echo "<tr {$class}>";
             echo "<td>" . $item->getTitle() . "</td>";
             echo "<td>" . $rules['rule'][$k_rule]['name'] . "</td>";
             echo "<td>";
             echo "<table class='tab_cadre' style='width:100%'>";
             //show entity select
             if (!isset($refused['criterias']) && !isset($refused['actions'])) {
                 if (isset($refused['entity'])) {
                     echo "<tr class='tab_bg_1_2'>";
                     echo "<td>";
                     printf(__('%1$s (%2$s)'), __('Entity not found'), $rules['rule'][$k_rule]['entities_id']);
                     echo "</td>";
                     echo "<td>";
                     echo __('Select the desired entity') . "&nbsp;";
                     Dropdown::show('Entity', array('comments' => false, 'name' => "new_entities[" . $rules['rule'][$k_rule]['uuid'] . "]"));
                     echo "</td>";
                     echo "</tr>";
                 }
             }
             //show criterias refused for this rule
             if (isset($refused['criterias'])) {
                 echo "<tr class='tab_bg_1_2'>";
                 echo "<td>" . __('Criteria refused') . "</td>";
                 echo "<td>";
                 echo "<table class='tab_cadre' style='width:100%'>";
                 echo "<tr class='tab_bg_2'>";
                 echo "<th class='center b'>" . _n('Criterion', 'Criteria', 1) . "</th>\n";
                 echo "<th class='center b'>" . __('Condition') . "</th>\n";
                 echo "<th class='center b'>" . __('Reason') . "</th>\n";
                 echo "</tr>\n";
                 foreach ($refused['criterias'] as $k_criteria) {
                     $criteria = $rules['rule'][$k_rule]['rulecriteria'][$k_criteria];
                     //fix empty empty array values
                     if (empty($criteria['value'])) {
                         $criteria['value'] = null;
                     }
                     echo "<tr class='tab_bg_1'>";
                     echo "<td>" . $item->getCriteriaName($criteria["criteria"]) . "</td>";
                     echo "<td>" . RuleCriteria::getConditionByID($criteria["condition"], get_class($item), $criteria["criteria"]) . "</td>";
                     echo "<td>" . $criteria["pattern"] . "</td>";
                     echo "</tr>";
                 }
                 echo "</table>\n";
                 echo "</td>";
                 echo "</tr>";
             }
             //show actions refused for this rule
             if (isset($refused['actions'])) {
                 echo "<tr class='tab_bg_1_2'>";
                 echo "<td>" . __('Actions refused') . "</td>";
                 echo "<td>";
                 echo "<table class='tab_cadre' style='width:100%'>";
                 echo "<tr class='tab_bg_2'>";
                 echo "<th class='center b'>" . _n('Field', 'Fields', Session::getPluralNumber()) . "</th>";
                 echo "<th class='center b'>" . __('Action type') . "</th>";
                 echo "<th class='center b'>" . __('Value') . "</th>";
                 echo "</tr>\n";
                 foreach ($refused['actions'] as $k_action) {
                     $action = $rules['rule'][$k_rule]['ruleaction'][$k_action];
                     //fix empty empty array values
                     if (empty($action['value'])) {
                         $action['value'] = null;
                     }
                     echo "<tr class='tab_bg_1'>";
                     echo "<td>" . $item->getActionName($action["field"]) . "</td>";
                     echo "<td>" . RuleAction::getActionByID($action["action_type"]) . "</td>";
                     echo "<td>" . $action["value"] . "</td>";
                     echo "</tr>";
                 }
                 echo "</table>\n";
                 echo "</td>";
                 echo "</tr>";
             }
             echo "</table>\n";
             echo "</td></tr>";
         }
         //display buttons
         $class = $odd ? " class='tab_bg_1' " : " class='tab_bg_2' ";
         echo "<tr {$class}><td colspan='3' class='center'>";
         echo "<input type='submit' name='import' value=\"" . _sx('button', 'Post') . "\" class='submit'>";
         echo "</td></tr>";
         // Close for Form
         echo "</table></div>";
         Html::closeForm();
     }
     return true;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:101,代码来源:rulecollection.class.php


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