Register the breadcrumb for the create/edit page.

@param BannedEmail $bannedEmail
@throws \DaveJamesMiller\Breadcrumbs\Exception
510738
public function onForm(BannedEmail $bannedEmail)
    {
        $this->onIndex();

        $name = $bannedEmail->exists ? 'rule-' . $bannedEmail->getEmail() : 'rule-add';

        $this->breadcrumbs->register($name, function(Generator $breadcrumbs) use($bannedEmail) {
            $trans = 'antares/ban_management::messages.breadcrumbs';
            $name  = $bannedEmail->exists ? trans($trans . '.banned_email_edit', ['email' => $bannedEmail->getEmail()]) : trans($trans . '.banned_email_new');

            $breadcrumbs->parent(self::$name . '-bannedemails');
            $breadcrumbs->push($name);
        });

        $this->shareOnView($name);
    }
1139666
public function addNewUser($email, $sendEmail = true, $source = 'unknown', $referer = null, $checkEmail = true)
    {
        if ($checkEmail && !$this->emailValidator->isValid($email)) {
            throw new InvalidEmailException($email);
        }

        $password = $this->passwordGenerator->generatePassword();

        /** @var ActiveRow|bool $user */
        $user = $this->userBuilder->createNew()
            ->sendEmail($sendEmail)
            ->setEmail($email)
            ->setPassword($password)
            ->setReferer($referer)
            ->setSource($source)
            ->save();

        if (!$user) {
            throw new UserAlreadyExistsException('Fatalna chyba - nepodarilo sa vyrobit user v manageri: ' . Json::encode($this->userBuilder->getErrors()));
        }

        return $user;
    }
614970
public function warnBannedUser($post, $new_pid)
    {
        Container::get('hooks')->fire('model.post.warn_banned_user_start', $post, $new_pid);

        // Load the "banned email post" template
//        $mail_tpl = trim(file_get_contents(ForumEnv::get('FORUM_ROOT').'lang/'.User::get()->language.
//            '/mail_templates/banned_email_post.tpl'));
        $mail_tpl = Lang::getMailTemplate('banned_email_post')->text;
        $mail_tpl = Container::get('hooks')->fire('model.post.warn_banned_user_mail_tpl', $mail_tpl);

        // The first row contains the subject
        $first_crlf = strpos($mail_tpl, "\n");
        $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
        $mail_message = trim(substr($mail_tpl, $first_crlf));

        $mail_message = str_replace('<username>', $post['username'], $mail_message);
        $mail_message = str_replace('<email>', $post['email'], $mail_message);
        $mail_message = str_replace('<post_url>', Router::pathFor('viewPost', ['pid' => $new_pid]).'#p'.
            $new_pid, $mail_message);
        $mail_message = str_replace('<board_mailer>', ForumSettings::get('o_board_title'), $mail_message);
        $mail_message = Container::get('hooks')->fire('model.post.warn_banned_user_mail_message', $mail_message);

        Container::get('email')->dispatchMail(ForumSettings::get('o_mailing_list'), $mail_subject, $mail_message);
    }
1086872
public function Breadcrumbs($maxDepth = 20, $unlinked = false, $stopAtPageType = false, $showHidden = false)
    {
        $page = Controller::curr();
        $pages = array();
        $pages[] = $this->owner;
        while ($page
            && (!$maxDepth || count($pages) < $maxDepth)
            && (!$stopAtPageType || $page->ClassName != $stopAtPageType)
        ) {
            if ($showHidden || $page->ShowInMenus || ($page->ID == $this->owner->ID)) {
                $pages[] = $page;
            }
            $page = $page->Parent;
        }
        $template = new SSViewer('BreadcrumbsTemplate');

        return $template->process($this->owner->customise(new ArrayData(array(
            'Pages' => new ArrayList(array_reverse($pages)),
        ))));
    }
73987
public function registerEditorPage()
    {
        $this->register(
            $pageTitle = __('Modularity editor'),
            $menuTitle = __('Editor'),
            $capability = 'edit_posts',
            $menuSlug = 'modularity-editor',
            $iconUrl = null,
            $position = 1,
            $parent = 'options.php'
        );
    }
1239452
protected function addAddress()
    {
        if (!$this->isError()) {

            $id = $this->address->add($this->getSubmitted());

            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }

            $this->line($id);
        }
    }
778826
public function onForm(Rule $rule)
    {
        $this->onIndex();

        $name = $rule->exists ? 'rule-' . $rule->getValue() : 'rule-add';

        $this->breadcrumbs->register($name, function(Generator $breadcrumbs) use($rule) {
            $trans = 'antares/ban_management::messages.breadcrumbs';
            $name  = $rule->exists ? trans($trans . '.ip_edit', ['ip' => $rule->getValue()]) : trans($trans . '.ip_create');
            $breadcrumbs->parent(self::$name . '-rules');
            $breadcrumbs->push($name);
        });

        $this->shareOnView($name);
    }
101196
public function isEmailBanned($email)
    {
        $emailTemplates = $this->getEmailTemplates();

        foreach ($emailTemplates as $emailTemplate) {
            $emailRule = new Email($emailTemplate);
            if ($emailRule->check($email)) {
                return true;
            }
        }
        return false;
    }
619470
public function build(Presenter $listener, BannedEmail $bannedEmail)
    {
        return $this->form->of('antares.ban_management.banned-emails', function(FormGrid $form) use($listener, $bannedEmail) {
                    $url = $bannedEmail->exists ? route('bannedemails.update', compact('bannedEmail')) : route('bannedemails.store');

                    $attr = ['method' => $bannedEmail->exists ? 'PUT' : 'POST'];

                    $form->setup($listener, $url, $bannedEmail, $attr);
                    $form->name('Banned Emails Form');
                    $form->hidden('id');
                    $form->layout('antares/foundation::components.form');

                    $form->fieldset($bannedEmail->exists ? 'Edit Banned Email' : 'New Banned Email', function (Fieldset $fieldset) use($bannedEmail) {
                        $this->setupFieldset($fieldset, $bannedEmail);
                    });

                    $scenario   = $bannedEmail->exists ? 'update' : 'create';
                    $validation = $this->validation->on($scenario);

                    if (method_exists($validation, 'on' . ucfirst($scenario))) {
                        $validation->{'on' . ucfirst($scenario)}();
                    }

                    $form->ajaxable()->rules($validation->getValidationRules())->phrases($validation->getValidationPhrases());
                });
    }
33238
public function Breadcrumbs(
        $maxDepth = 20,
        $unlinked = false,
        $stopAtPageType = false,
        $showHidden = false,
        $delimiter = '&raquo;'
    ) {
        $page = $this;
        $pages = [];

        while ($page
            && (!$maxDepth || count($pages) < $maxDepth)
            && (!$stopAtPageType || $page->ClassName != $stopAtPageType)
        ) {
            if ($showHidden || $page->ShowInMenus || ($page->ID == $this->ID)) {
                $pages[] = $page;
            }

            $page = $page->Parent;
        }

        // Add on the item we're currently showing.
        $controller = Controller::curr();
        if ($controller) {
            $request = $controller->getRequest();
            if ($request->param('Action') == 'show') {
                $id = $request->param('ID');
                if ($id) {
                    $object = DataObject::get_by_id($this->getDataClass(), $id);
                    array_unshift($pages, $object);
                }
            }
        }

        $template = SSViewer::create('BreadcrumbsTemplate');

        return $template->process($this->customise(ArrayData::create([
            'Pages' => ArrayList::create(array_reverse($pages))
        ])));
    }
997900
public function onBeforeWrite() {
		parent::onBeforeWrite();
		$slug = singleton('SiteTree')->generateURLSegment($this->Identifier);
		$original_slug = $slug;
		$i = 0;
		while($t = PermamailTemplate::get()
			->filter(array("Identifier" => "$slug"))
			->exclude(array("ID" => $this->ID))
			->first()
		) {	
			$i++;
			$slug = $original_slug."-{$i}";
		}
		$this->Identifier = $slug;

		$reflector = EmailReflectionTemplate::create();
		$reflector->process($this->Content);

		$vars = array ();
		foreach($reflector->getTopLevelVars() as $var => $type) {
			$vars[$var] = false;
		}
		foreach($reflector->getTopLevelBlocks() as $block) {
			$vars[$block->getName()] = $block->isLoop();
		}
		// Remove any variables that are no longer in the template
		if($this->TestVariables()->exists()) {
			$this->TestVariables()->exclude(array('Variable' => array_keys($vars)))->removeAll();
		}
		
		$currentVars = $this->TestVariables()->column('Variable');

		foreach($vars as $var => $isList) {
			if(!in_array($var, $currentVars)) {
				$v = PermamailTemplateVariable::create(array(
					'Variable' => $var,
					'PermamailTemplateID' => $this->ID,
					'List' => $isList
				));
				$v->write();
			}
		}
	}
1256323
public function bind(string $routing_rule, string $filter, $event) : RouterInterface
    {
        $builder = new RouterNodeBuilder($routing_rule, $filter, $event);
        try{
            $builder->build($this->root_node);
        }
        catch(RouterNodeBuilderException $e){
            throw new RoutingRuleBindingException($routing_rule, $e);
        }
        return $this;
    }
415985
protected function validateBreadcrumb(array $breadcrumb)
    {
        foreach ($breadcrumb as $item) {
            if (!is_array($item) || !array_has($item, 'text')) {
                throw new  \Exception('Breadcrumb format error!');
            }
        }

        return true;
    }
650332
public function mail($fromEmail) {
		if (!filter_var($fromEmail, FILTER_VALIDATE_EMAIL)) {
			throw new SmtpException('smtp mail must be a valid email');
		}
		$verp = $this->useVerp ? ' XVERP' : '';
		$this->sendMessage("MAIL FROM:<{$fromEmail}>{$verp}", 250, 'SMTP MAIL not accepted from server');
	}
664965
public function create(array $aData = [], $bReturnObject = false)
    {
        $mResult = parent::create($aData, $bReturnObject);
        if ($mResult) {
            $this->saveBreadcrumbs($bReturnObject ? $mResult->id : $mResult);
            $this->saveOrder();
            //  Refresh object to get updated breadcrumbs/URL
            if ($bReturnObject) {
                $mResult = $this->getById($mResult->id);
            }
        }
        return $mResult;
    }
906151
protected function registerURLDirective()
    {
        $this->bladeCompiler->directive('url', function ($expression) {
            $expression = substr($expression, 1, - 1);

            $trailingSlash = ! str_contains($expression, '.') ? '/' : '';

            return "<?php echo str_replace(['///', '//'], '/', \$base_url.'/'.trim({$expression}, '/').'{$trailingSlash}');  ?>";
        });
    }
65621
def add_breadcrumb_to(name, url, trail_index)
      breadcrumb_trails
      @breadcrumb_trails[trail_index] ||= []
      @breadcrumb_trails[trail_index] << {
        name: case name
              when Proc then name.call(self)
              else name
              end,
        url:  case url
              when Proc then url.call(self)
              else url ? url_for(url) : nil
              end
      }
    end