public function createNewDashboardForUser($login, $dashboardName = '', $addDefaultWidgets = true)
    {
        Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);

        $layout = '{}';

        if ($addDefaultWidgets) {
            $layout = $this->dashboard->getDefaultLayout();
        }

        return $this->model->createNewDashboardForUser($login, $dashboardName, $layout);
    }
public function createNewDashboardForUser($login, $dashboardName = '', $addDefaultWidgets = true)
    {
        Piwik::checkUserHasSuperUserAccessOrIsTheUser($login);

        $layout = '{}';

        if ($addDefaultWidgets) {
            $layout = $this->dashboard->getDefaultLayout();
        }

        return $this->model->createNewDashboardForUser($login, $dashboardName, $layout);
    }
public function createNewDashboardForUser ( $ login , $ dashboardName = '' , $ addDefaultWidgets = true ) { Piwik :: checkUserHasSuperUserAccessOrIsTheUser ( $ login ) ; $ layout = '{}' ; if ( $ addDefaultWidgets ) { $ layout = $ this -> dashboard -> getDefaultLayout ( ) ; } return $ this -> model -> createNewDashboardForUser ( $ login , $ dashboardName , $ layout ) ; }
Creates a new dashboard for the given login

Note: Only a super user is able to create dashboards for other users

@param string $login login of the user that dashboard should be created for
@param string $dashboardName name of the new dashboard
@param bool $addDefaultWidgets  whether to add the current default widget collection or not
@return int|string
Creates a new dashboard for the given login