首页 \ 问答 \ 从Drupal升级到Pressflow(Upgrading from Drupal to Pressflow)

从Drupal升级到Pressflow(Upgrading from Drupal to Pressflow)

我有基于Drupal的网站(Drupal版本是6.19),它是非常重的内容网站(其中约400K条)。

按照使用Drupal的规则之一, 我没有对核心做任何改变 。 但我有很多启用的模块,其中一些是自定义的。

现在,我受到了表演的痛苦,我需要加强它。 我之前从未使用过Pressflow,但我已阅读过一些文章,指出pressflow比Drupal更好。 从Drupal升级到Pressflow安全吗? 如果是的话,该怎么做?

谢谢你的帮助


I have drupal based website (Drupal version is 6.19), it is very heavy content website (about 400K articles in it).

By following Rule one of using Drupal, I didnt make any change on the core. but i have a lot of enabled modules and some of them were customized.

Now, I am suffering of the performace and I need to enhance it. I never used Pressflow before, but I have read some articles saying that pressflow is better than Drupal. is it safe to upgrade from Drupal to Pressflow? and if so, how to do it?

Thanks for your help


原文:https://stackoverflow.com/questions/5417561
更新时间:2023-06-15 09:06

最满意答案

添加$ scope.ok方法并将其挂钩到editForm的提交按钮的ng-click

var editResourceModalController = function($scope, editItem, hierarchy, selectedFolder) {
    $scope.form = {};
    $scope.editItem = editItem;
    $scope.editListItems = [];
    $scope.listItems = 0;
    $scope.getNumber = function(n) {
        return new Array(n);
    }
    $scope.hierarchy = hierarchy;
    $scope.selectedFolder = selectedFolder;
    $scope.editModel = {
        name: $scope.editItem.name,
        description: $scope.editItem.description,
        hierarchyId: $scope.selectedFolder
    }
    $scope.ok = function () {
        editItem.close($scope.editForm.$dirty);
    };
}

将$ scope.edeitForm。$ dirty作为isDirty注入,并根据需要使用注入的值

$scope.openEditModal = function(editItem, hierarchy, selectedFolder) {
    $scope.modalInstance = $uibModal.open({
        animation: true,
        templateUrl: "edit.html",
        controller: ["$scope", "editItem", "hierarchy", "selectedFolder", editResourceModalController],
        resolve: {
            editItem: function() {
                return editItem;
            },
            hierarchy: function() {
                return hierarchy;
            },
            selectedFolder: function() {
                return selectedFolder;
            }
        }
    });

    $scope.modalInstance.result.catch(function(isDirty) {
        if (isDirty) {
            // confirmation code here

        }else{
            // other logic
        }
        // dismiss the modal
        editItem.dismiss('cancel');
    });
}

希望这对你有所帮助:D


I fixed it using $scope.$on, extensive example here

var editResourceModalController = function($scope, $uibModalInstance) {

    $scope.close = function() {
        $uibModalInstance.close();
    }

    $scope.$on('modal.closing', function(event) {
        if ($scope.editForm.$dirty) {
            if (!confirm("U sure bwah?")) {
                event.preventDefault();
            }
        }

    });
}

var uibModalInstance;
$scope.openEditModal = function(editItem, hierarchy, selectedFolder) {
    uibModalInstance = $uibModal.open({
        animation: true,
        templateUrl: "edit.html",
        controller: editResourceModalController           
    });
}

相关问答

更多
  • 添加$ scope.ok方法并将其挂钩到editForm的提交按钮的ng-click var editResourceModalController = function($scope, editItem, hierarchy, selectedFolder) { $scope.form = {}; $scope.editItem = editItem; $scope.editListItems = []; $scope.listItems = 0; $scope.g ...
  • 这样做你想要的吗? 在你的enter函数中我添加了var previous = $state.current.name; 然后改变$state.transitionTo(...); to $state.transitionTo(previous); 。