Skip to content
Snippets Groups Projects
AmosSondaggi.php 3.56 KiB
Newer Older
  • Learn to ignore specific revisions
  • Marcello Pivanti's avatar
    Marcello Pivanti committed
    <?php
    
    /**
     * Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
     * OPEN 2.0
     *
     *
    
    waltermazza's avatar
    waltermazza committed
     * @package    arter\amos\sondaggi
    
    Marcello Pivanti's avatar
    Marcello Pivanti committed
     * @category   CategoryName
     * @author     Elite Division S.r.l.
     */
    
    
    waltermazza's avatar
    waltermazza committed
    namespace arter\amos\sondaggi;
    
    Marcello Pivanti's avatar
    Marcello Pivanti committed
    
    
    waltermazza's avatar
    waltermazza committed
    use arter\amos\core\module\AmosModule;
    use arter\amos\core\module\ModuleInterface;
    use arter\amos\sondaggi\widgets\icons\WidgetIconAmministraSondaggi;
    use arter\amos\sondaggi\widgets\icons\WidgetIconCompilaSondaggi;
    use arter\amos\sondaggi\widgets\icons\WidgetIconPubblicaSondaggi;
    use arter\amos\sondaggi\widgets\icons\WidgetIconSondaggi;
    
    Marcello Pivanti's avatar
    Marcello Pivanti committed
    use Yii;
    use yii\db\Connection;
    use yii\helpers\ArrayHelper;
    
    /**
     * Class AmosSondaggi
    
    waltermazza's avatar
    waltermazza committed
     * @package arter\amos\sondaggi
    
    Marcello Pivanti's avatar
    Marcello Pivanti committed
     */
    class AmosSondaggi extends AmosModule implements ModuleInterface
    {
        public static $CONFIG_FOLDER = 'config';
    
    waltermazza's avatar
    waltermazza committed
        public $controllerNamespace = 'arter\amos\sondaggi\controllers';
    
    Marcello Pivanti's avatar
    Marcello Pivanti committed
        public $newFileMode = 0666;
        public $newDirMode = 0777;
    
        /**
         * In the case of a private poll for role, it is possible to send the notification to the users who can fill out the survey.
         * @var boolean
         */
        public $enableNotificationEmailByRoles = false;
    
        /**
         * Default email for the sender
         * @var string
         */
        public $defaultEmailSender;
    
        /**
         * It allows to show in the first page of the results the geoChart based on the province of domicile.
         * @var boolean
         */
        public $enableGeoChart = false;
    
        /**
         * It allows to show in the first page of the results a partecipant report if available.
         * @var boolean
         */
        public $enablePartecipantsReport = false;
    
        /**
         * The fields that will be displayed in the participant's //TO-DO
         * @var array
         */
        public $fieldsByPartecipants = [];
    
        /**
         * @var string|boolean the layout that should be applied for views within this module. This refers to a view name
         * relative to [[layoutPath]]. If this is not set, it means the layout value of the [[module|parent module]]
         * will be taken. If this is false, layout will be disabled within this module.
         */
        public $layout = 'main';
        public $name = 'Sondaggi';
    
        /**
         * @var Connection|array|string the DB connection object or the application component ID of the DB connection.
         */
        public $db = 'db';
        
        /**
         * Hide the Option wheel in the graphic widget
         * @var bool|false $hideWidgetGraphicsActions
         */
        public $hideWidgetGraphicsActions = false;
    
        /**
         * @inheritdoc
         */
        public function init()
        {
            parent::init();
            $this->db = Yii::$app->db;
    
    
    waltermazza's avatar
    waltermazza committed
            \Yii::setAlias('@arter/amos/' . static::getModuleName() . '/controllers/', __DIR__ . '/controllers/');
    
    Marcello Pivanti's avatar
    Marcello Pivanti committed
            // initialize the module with the configuration loaded from config.php
            $config = require(__DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php');
            Yii::configure($this, ArrayHelper::merge($config, $this));
        }
        
    
        /**
         * @inheritdoc
         */
        public static function getModuleName()
        {
            return "sondaggi";
        }
    
        /**
         * @inheritdoc
         */
        public function getWidgetIcons()
        {
            return [
                WidgetIconSondaggi::className(),
                WidgetIconCompilaSondaggi::className(),
                WidgetIconPubblicaSondaggi::className(),
                WidgetIconAmministraSondaggi::className(),
            ];
        }
    
        /**
         * @inheritdoc
         */
        public function getWidgetGraphics()
        {
            return [
            ];
        }
    
        /**
         * @inheritdoc
         */
        protected function getDefaultModels()
        {
            return [];
        }
    }