# Path: nive_cms/i18n.py



from nive.utils.utils import ConvertToNumberList
from nive_cms.i18n import _
from nive.definitions import implements, ISort
from nive.definitions import ViewConf
from nive.definitions import IContainer, IPage, IObject, IRoot
        sort = self.GetFormValue(u"sort")
        if sort != u"1":
            result[u"sortelements"] = self.context.GetSortElements("elements")
            return result
        ids = ConvertToNumberList(ids)
        if not ids:
            result[u"sortelements"] = self.context.GetSortElements("elements")
            result[u"msgs"] = [_(u"Nothing to sort.")]
            return result
        user = self.User()
        ok, msgs = self.context.UpdateSort(ids, user=user)
        result[u"msgs"] = [msgs]
        result[u"result"] = ok
        result[u"sortelements"] = self.context.GetSortElements("elements")
        return result


    def moveup(self):
        """
        move pageelement one position up in container
        redirect to request.url
        parameter: id, url in request
        """
        self.ResetFlashMessages()
        try:
            id = int(self.GetFormValue(u"id"))
        except:
            id = 0
        if not id:
            ok = False

# Path: nive_cms/i18n.py



# Path: nive_cms/cmsview/sort.py
from nive.utils.utils import ConvertToNumberList
from nive_cms.i18n import _
from nive.definitions import implements, ISort
from nive.definitions import ViewConf
from nive.definitions import IContainer, IPage, IObject, IRoot

        sort = self.GetFormValue(u"sort")
        if sort != u"1":
            result[u"sortelements"] = self.context.GetSortElements("elements")
            return result
        ids = ConvertToNumberList(ids)
        if not ids:
            result[u"sortelements"] = self.context.GetSortElements("elements")
            result[u"msgs"] = [_(u"Nothing to sort.")]
            return result
        user = self.User()
        ok, msgs = self.context.UpdateSort(ids, user=user)
        result[u"msgs"] = [msgs]
        result[u"result"] = ok
        result[u"sortelements"] = self.context.GetSortElements("elements")
        return result


    def moveup(self):
        """
        move pageelement one position up in container
        redirect to request.url
        parameter: id, url in request
        """
        self.ResetFlashMessages()
        try:
            id = int(self.GetFormValue(u"id"))
        except:
            id = 0
        if not id:
            ok = False

            msgs = _(u"Not found")