protected function getDefaultDates()
    {
        $dates = array(
            'today'      => $this->translator->translate('Intl_Today'),
            'yesterday'  => $this->translator->translate('Intl_Yesterday'),
            'previous7'  => $this->translator->translate('General_PreviousDays', 7),
            'previous30' => $this->translator->translate('General_PreviousDays', 30),
            'last7'      => $this->translator->translate('General_LastDays', 7),
            'last30'     => $this->translator->translate('General_LastDays', 30),
            'week'       => $this->translator->translate('General_CurrentWeek'),
            'month'      => $this->translator->translate('General_CurrentMonth'),
            'year'       => $this->translator->translate('General_CurrentYear'),
        );

        $mappingDatesToPeriods = array(
            'today' => 'day',
            'yesterday' => 'day',
            'previous7' => 'range',
            'previous30' => 'range',
            'last7' => 'range',
            'last30' => 'range',
            'week' => 'week',
            'month' => 'month',
            'year' => 'year',
        );

        // assertion
        if (count($dates) != count($mappingDatesToPeriods)) {
            throw new Exception("some metadata is missing in getDefaultDates()");
        }

        $allowedPeriods = self::getEnabledPeriodsInUI();
        $allowedDates = array_intersect($mappingDatesToPeriods, $allowedPeriods);
        $dates = array_intersect_key($dates, $allowedDates);

        /**
         * Triggered when the list of available dates is requested, for example for the
         * User Settings > Report date to load by default.
         *
         * @param array &$dates Array of (date => translation)
         */
        Piwik::postEvent('UsersManager.getDefaultDates', array(&$dates));

        return $dates;
    }
protected function getDefaultDates()
    {
        $dates = array(
            'today'      => $this->translator->translate('Intl_Today'),
            'yesterday'  => $this->translator->translate('Intl_Yesterday'),
            'previous7'  => $this->translator->translate('General_PreviousDays', 7),
            'previous30' => $this->translator->translate('General_PreviousDays', 30),
            'last7'      => $this->translator->translate('General_LastDays', 7),
            'last30'     => $this->translator->translate('General_LastDays', 30),
            'week'       => $this->translator->translate('General_CurrentWeek'),
            'month'      => $this->translator->translate('General_CurrentMonth'),
            'year'       => $this->translator->translate('General_CurrentYear'),
        );

        $mappingDatesToPeriods = array(
            'today' => 'day',
            'yesterday' => 'day',
            'previous7' => 'range',
            'previous30' => 'range',
            'last7' => 'range',
            'last30' => 'range',
            'week' => 'week',
            'month' => 'month',
            'year' => 'year',
        );

        // assertion
        if (count($dates) != count($mappingDatesToPeriods)) {
            throw new Exception("some metadata is missing in getDefaultDates()");
        }

        $allowedPeriods = self::getEnabledPeriodsInUI();
        $allowedDates = array_intersect($mappingDatesToPeriods, $allowedPeriods);
        $dates = array_intersect_key($dates, $allowedDates);

        /**
         * Triggered when the list of available dates is requested, for example for the
         * User Settings > Report date to load by default.
         *
         * @param array &$dates Array of (date => translation)
         */
        Piwik::postEvent('UsersManager.getDefaultDates', array(&$dates));

        return $dates;
    }
protected function getDefaultDates ( ) { $ dates = array ( 'today' => $ this -> translator -> translate ( 'Intl_Today' ) , 'yesterday' => $ this -> translator -> translate ( 'Intl_Yesterday' ) , 'previous7' => $ this -> translator -> translate ( 'General_PreviousDays' , 7 ) , 'previous30' => $ this -> translator -> translate ( 'General_PreviousDays' , 30 ) , 'last7' => $ this -> translator -> translate ( 'General_LastDays' , 7 ) , 'last30' => $ this -> translator -> translate ( 'General_LastDays' , 30 ) , 'week' => $ this -> translator -> translate ( 'General_CurrentWeek' ) , 'month' => $ this -> translator -> translate ( 'General_CurrentMonth' ) , 'year' => $ this -> translator -> translate ( 'General_CurrentYear' ) , ) ; $ mappingDatesToPeriods = array ( 'today' => 'day' , 'yesterday' => 'day' , 'previous7' => 'range' , 'previous30' => 'range' , 'last7' => 'range' , 'last30' => 'range' , 'week' => 'week' , 'month' => 'month' , 'year' => 'year' , ) ; // assertion if ( count ( $ dates ) != count ( $ mappingDatesToPeriods ) ) { throw new Exception ( "some metadata is missing in getDefaultDates()" ) ; } $ allowedPeriods = self :: getEnabledPeriodsInUI ( ) ; $ allowedDates = array_intersect ( $ mappingDatesToPeriods , $ allowedPeriods ) ; $ dates = array_intersect_key ( $ dates , $ allowedDates ) ; /**
         * Triggered when the list of available dates is requested, for example for the
         * User Settings > Report date to load by default.
         *
         * @param array &$dates Array of (date => translation)
         */ Piwik :: postEvent ( 'UsersManager.getDefaultDates' , array ( & $ dates ) ) ; return $ dates ; }
Returns the enabled dates that users can select,
in their User Settings page "Report date to load by default"

@throws
@return array
Returns the enabled dates that users can select in their User Settings page Report date to load by default