Path: blob/master/src/applications/diffusion/herald/DiffusionBlockHeraldAction.php
12242 views
<?php12final class DiffusionBlockHeraldAction3extends HeraldAction {45const ACTIONCONST = 'diffusion.block';67const DO_BLOCK = 'do.block';89public function getHeraldActionName() {10return pht('Block push with message');11}1213public function getActionGroupKey() {14return HeraldApplicationActionGroup::ACTIONGROUPKEY;15}1617public function supportsObject($object) {18return ($object instanceof PhabricatorRepositoryPushLog);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 push 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 Push'),45),46);47}4849protected function renderActionEffectDescription($type, $data) {50switch ($type) {51case self::DO_BLOCK:52return pht('Blocked push.');53}54}55}565758