403Webshell
Server IP : 185.252.147.100  /  Your IP : 216.73.216.196
Web Server : nginx/1.27.3
System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64
User : mitr ( 1000)
PHP Version : 8.2.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/html/kanboard/app/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/html/kanboard/app/Model/NotificationTypeModel.php
<?php

namespace Kanboard\Model;

use Pimple\Container;
use Kanboard\Core\Base;

/**
 * Notification Type
 *
 * @package  model
 * @author   Frederic Guillot
 */
abstract class NotificationTypeModel extends Base
{
    /**
     * Container
     *
     * @access private
     * @var \Pimple\Container
     */
    private $classes;

    /**
     * Notification type labels
     *
     * @access private
     * @var array
     */
    private $labels = array();

    /**
     * Hidden notification types
     *
     * @access private
     * @var array
     */
    private $hiddens = array();

    /**
     * Constructor
     *
     * @access public
     * @param  \Pimple\Container   $container
     */
    public function __construct(Container $container)
    {
        parent::__construct($container);
        $this->classes = new Container;
    }

    /**
     * Add a new notification type
     *
     * @access public
     * @param  string  $type
     * @param  string  $label
     * @param  string  $class
     * @param  boolean $hidden
     * @return NotificationTypeModel
     */
    public function setType($type, $label, $class, $hidden = false)
    {
        $container = $this->container;

        if ($hidden) {
            $this->hiddens[] = $type;
        } else {
            $this->labels[$type] = $label;
        }

        $this->classes[$type] = function () use ($class, $container) {
            return new $class($container);
        };

        return $this;
    }

    /**
     * Get mail notification type instance
     *
     * @access public
     * @param  string  $type
     * @return \Kanboard\Core\Notification\NotificationInterface
     */
    public function getType($type)
    {
        return $this->classes[$type];
    }

    /**
     * Get all notification types with labels
     *
     * @access public
     * @return array
     */
    public function getTypes()
    {
        return $this->labels;
    }

    /**
     * Get all hidden notification types
     *
     * @access public
     * @return array
     */
    public function getHiddenTypes()
    {
        return $this->hiddens;
    }

    /**
     * Keep only loaded notification types
     *
     * @access public
     * @param  string[] $types
     * @return array
     */
    public function filterTypes(array $types)
    {
        $classes = $this->classes;

        return array_filter($types, function ($type) use ($classes) {
            return isset($classes[$type]);
        });
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit