PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
blog
/
post
define([], function() { return function($scope, communication,popup_news) { $scope.max_post_count = window.max_post_count; $scope.post_count = 0; communication.api('getPostCount', {},'blog.post').then(function(pc) { $scope.post_count = pc; }); var statuses = [ t('LBL_CMS_CONTENT_STATUS_DRAFTED'), t('LBL_CMS_CONTENT_STATUS_PUBLISHED')]; $scope.showStatus = function(a) { return statuses[a]; } $scope.news_categories_list = []; communication.api('getList', {name:'news_categories'},'blog.post').then(function(json) { $scope.news_categories_list = json; }); $scope.news_months_list = []; communication.api('getList', {name:'news_months'},'blog.post').then(function(json) { $scope.news_months_list = json; }); $scope.add = function() { if($scope.max_post_count>= 0 && $scope.max_post_count <= $scope.post_count) { alert(window.t("LBL_MAX_POST_LIMITED")); return; } popup_news.open().result.then(function(data) { $scope.gridInstance.instance.reloadData(); $scope.post_count++; }); } $scope.filters = {}; $scope.delete = function() { var rows = $scope.gridInstance.selections; if(rows.length > 0) { $dialog.confirm({ title:'', message:window.t('LBL_DELETE_NEWS_CONFIRM_MESSAGE') }).result.then(function() { communication.api('deleteItems', {ids:rows},'blog.post').then(function() { $scope.gridInstance.instance.reloadData(); $scope.post_count--; }); }); } } $scope.gridOptions={ data:[] }; $scope.gridInstance={}; $scope.RowButtonClickHandler = { edit : function(id) { if($scope.max_post_count>= 0 && $scope.max_post_count < $scope.post_count) { alert(window.t("LBL_MAX_POST_LIMITED")); return; } communication.api('getFormData',{name:'news', id:id}).then(function(data) { popup_news.open( { data:data }).result.then(function(data) { $scope.gridInstance.instance.reloadData(); }); }) }, }; } });
[+]
..
[-] category.js
[edit]
[-] post.js
[edit]