Path: blob/master/src/applications/differential/herald/DifferentialBlockHeraldAction.php
12256 views
<?php12final class DifferentialBlockHeraldAction3extends HeraldAction {45const ACTIONCONST = 'differential.block';67const DO_BLOCK = 'do.block';89public function getHeraldActionName() {10return pht('Block diff with message');11}1213public function getActionGroupKey() {14return HeraldApplicationActionGroup::ACTIONGROUPKEY;15}1617public function supportsObject($object) {18return ($object instanceof DifferentialDiff);19}2021public function supportsRuleType($rule_type) {22return ($rule_type != HeraldRuleTypeConfig::RULE_TYPE_PERSONAL);23}2425public function applyEffect($object, HeraldEffect $effect) {26// This rule intentionally has no direct effect: the caller handles it27// after executing Herald.28$this->logEffect(self::DO_BLOCK);29}3031public function getHeraldActionStandardType() {32return self::STANDARD_TEXT;33}3435public function renderActionDescription($value) {36return pht('Block diff with message: %s', $value);37}3839protected function getActionEffectMap() {40return array(41self::DO_BLOCK => array(42'icon' => 'fa-stop',43'color' => 'red',44'name' => pht('Blocked Diff'),45),46);47}4849protected function renderActionEffectDescription($type, $data) {50switch ($type) {51case self::DO_BLOCK:52return pht('Blocked diff.');53}54}55}565758