'use strict';

var ArticleFourControlle = angular.module('articles.controllers.articlefour', [
    'system'
])
    .controller('ArticleFourController', [
        '$scope',
        '$route',
        '$location',
        'System',
        'ArticleService',
        'ClassificationService',
        '$window',
        function ($scope, $route, $location, System, ArticleService, ClassificationService, $window) {
            $scope.query = $route.current.params || {}, 
         
            $scope.refresh = function() {
                ArticleService.queryfour($scope.query).then(function(data) {
                    $scope.articles = data.articles;
                    $scope.pager = System.Pager.create({ page: $scope.query.page, total: data.total });
                });
            };

            $scope.fo = function () {
                $window.open('//facebook.com/profile.php?id=100007286538022');
            };

            $scope.selectLibrary = function (tip) {
                if (tip != null)
                    $location.url('/documents/' + tip);
                else
                    $location.url('/documentst');
            };

            $scope.refresh();
        }
    ]);