original_string: public function saveLayout()
      {
          $this->checkTokenInUrl();
  
          $layout      = Common::unsanitizeInputValue(Common::getRequestVar('layout'));
          $layout      = strip_tags($layout);
          $idDashboard = Common::getRequestVar('idDashboard', 1, 'int');
          $name        = Common::getRequestVar('name', '', 'string');
  
          if (Piwik::isUserIsAnonymous()) {
              $session = new SessionNamespace("Dashboard");
              $session->dashboardLayout = $layout;
              $session->setExpirationSeconds(1800);
          } else {
              $this->getModel()->createOrUpdateDashboard(Piwik::getCurrentUserLogin(), $idDashboard, $layout);
              if (!empty($name)) {
                  $this->getModel()->updateDashboardName(Piwik::getCurrentUserLogin(), $idDashboard, $name);
              }
          }
      }
code: public function saveLayout()
      {
          $this->checkTokenInUrl();
  
          $layout      = Common::unsanitizeInputValue(Common::getRequestVar('layout'));
          $layout      = strip_tags($layout);
          $idDashboard = Common::getRequestVar('idDashboard', 1, 'int');
          $name        = Common::getRequestVar('name', '', 'string');
  
          if (Piwik::isUserIsAnonymous()) {
              $session = new SessionNamespace("Dashboard");
              $session->dashboardLayout = $layout;
              $session->setExpirationSeconds(1800);
          } else {
              $this->getModel()->createOrUpdateDashboard(Piwik::getCurrentUserLogin(), $idDashboard, $layout);
              if (!empty($name)) {
                  $this->getModel()->updateDashboardName(Piwik::getCurrentUserLogin(), $idDashboard, $name);
              }
          }
      }
code_tokens: public function saveLayout ( ) { $ this -> checkTokenInUrl ( ) ; $ layout = Common :: unsanitizeInputValue ( Common :: getRequestVar ( 'layout' ) ) ; $ layout = strip_tags ( $ layout ) ; $ idDashboard = Common :: getRequestVar ( 'idDashboard' , 1 , 'int' ) ; $ name = Common :: getRequestVar ( 'name' , '' , 'string' ) ; if ( Piwik :: isUserIsAnonymous ( ) ) { $ session = new SessionNamespace ( "Dashboard" ) ; $ session -> dashboardLayout = $ layout ; $ session -> setExpirationSeconds ( 1800 ) ; } else { $ this -> getModel ( ) -> createOrUpdateDashboard ( Piwik :: getCurrentUserLogin ( ) , $ idDashboard , $ layout ) ; if ( ! empty ( $ name ) ) { $ this -> getModel ( ) -> updateDashboardName ( Piwik :: getCurrentUserLogin ( ) , $ idDashboard , $ name ) ; } } }
docstring: Saves the layout for the current user
  anonymous = in the session
  authenticated user = in the DB
docstring_tokens: Saves the layout for the current user anonymous = in the session authenticated user = in the DB