App Settings

Site Settings

Adding

On function setSettings add following code

<?php
public function setSettings()
{
    $this->settings = [
        'td_can_user_privacy' => [
            'var_name' => 'td_can_user_privacy',
            'info' => 'Allow user add privacy',
            'description' => 'Enable this setting in case you want your user can use privacy during adding new todo list',
            'type' => Core\App\Install\Setting\Site::TYPE_RADIO,
            'value' => '1',
        ],
    ];
}

Which:

For now (4.5.*), we supported follow type of setting

You can check you setting by go to AdminCP -> App -> TodoList (this app) -> Settings

Using

We use function setting to get value of a setting

<?php
$value = setting('td_can_user_privacy');

 

User Group Settings

Adding

On function setUserGroupSettings add following code

<?php
public function setUserGroupSettings()
{
    $this->user_group_settings = [
        'td_can_add_new_todo_list'          => [
            'var_name' => 'td_can_add_new_todo_list',
            'info'     => 'Can add new todo list?',
            'type'     => \Core\App\Install\Setting\Groups::TYPE_RADIO,
            'value'    => [
                "1" => "1",
                "2" => "1",
                "3" => "1",
                "4" => "1",
                "5" => "0"
            ],
            'options'  => \Core\App\Install\Setting\Groups::$OPTION_YES_NO
        ],
    ];
}

Which:

For now (4.5.*), we supported follow type of user group setting

 

User Group ID note:

!https://docs.phpfox.com/download/attachments/851993/todolist_usergroupsettings.png?api=v2!

Using

We use function user to get value of a user group setting

<?php
$value = user('td_can_add_new_todo_list');