# Path: nive_cms/i18n.py

# 
# Path: nive_cms/i18n.py

# 
# Path: nive_cms/cmsview/cutcopy.py
# class ObjCopy:
# class ContainerCopy:
# class CopyView:
#     def CanCopy(self):
#     def CanPaste(self):
#     def CanCopy(self):
#     def CanPaste(self):
#     def Paste(self, ids, pos, user):
#     def Move(self, ids, pos, user):
#     def cut(self):
#     def copy(self):
#     def paste(self):
#     def SetCopyInfo(self, action, ids, context):
#     def GetCopyInfo(self):
#     def ClipboardEmpty(self):
#     def DeleteCopyInfo(self):    
# 
# Path: nive_cms/cmsview/sort.py
# class Sort:
# class SortView:
#     def GetSort(self):
#     def GetSortElements(self, selection=None):
#     def GetMaxSort(self):
#     def UpdateSort(self, objs, user):
#     def InsertAtPosition(self, id, position, user, selection=None):
#     def InsertBefore(self, id, position, user, selection=None):
#     def InsertAfter(self, id, position, user, selection=None):
#     def MoveUp(self, id, user, selection=None):
#     def MoveDown(self, id, user, selection=None):
#     def MoveStart(self, id, user, selection=None):
#     def MoveEnd(self, id, user, selection=None):
#     def sortpages(self):
#     def sortelements(self):
#     def moveup(self):
#     def movedown(self):
#     def movetop(self):
#     def movebottom(self):


from StringIO import StringIO
from pyramid.response import Response
from pyramid.renderers import get_renderer, render, render_to_response
from nive.definitions import ViewModuleConf, ViewConf, WidgetConf, FieldConf, Conf
from nive.definitions import IContainer, IApplication, IPortal, IPage, IObject, IRoot, IPageElementContainer, IFile
from nive.definitions import IToolboxWidgetConf, IEditorWidgetConf, IViewModuleConf, ICMSRoot, IColumn
from nive.utils.utils import SortConfigurationList
from nive.helper import ResolveName
from nive.security import Allow, Deny, Everyone
from nive.forms import HTMLForm, ObjectForm
from nive.views import BaseView
from nive_cms.i18n import _
from nive_cms.i18n import translator
from nive_cms.cmsview import cutcopy
from nive_cms.cmsview import sort
    # widgets
    ViewConf(name="@elementListWidget", attr="elementListWidget", context = IContainer, permission="edit"),
    ViewConf(name="@elementAddWidget",  attr="elementAddWidget",  context = IObject, permission = "add"),
    ViewConf(name="@elementAddWidget",  attr="elementAddWidget",  context = IRoot, permission = "add"),
    ViewConf(name="@editblock",         attr="editBlockElement",  context = IObject, permission = "edit"),
    
    # container
    ViewConf(name="@add",       attr="add",    context = IContainer, renderer = t+"add.pt", permission="add"),
    ViewConf(name="@delete",    attr="delete", context = IContainer, renderer = t+"delete.pt", permission = "delete"),
    
    # widgets
    ViewConf(name="@addpageWidget",  attr="tmpl", renderer = t+"widgets/widget_addpage.pt",    context = IContainer, permission="add"),
    ViewConf(name="@editpageWidget", attr="tmpl", renderer = t+"widgets/widget_editpage.pt",   context = IContainer, permission="edit"),
    ViewConf(name="@editrootWidget", attr="tmpl", renderer = t+"widgets/widget_editroot.pt",   context = IContainer, permission="edit"),
    ViewConf(name="@subpagesWidget", attr="tmpl", renderer = t+"widgets/widget_subpages.pt",   context = IContainer),
    ViewConf(name="@settingsWidget", attr="tmpl", renderer = t+"widgets/widget_settings.pt",   context = IContainer)
] + sort.views + cutcopy.views


# toolbox and editor widgets ----------------------------------------------------------------------------------
configuration.widgets = [
    WidgetConf(name=_(u"Add new page"),         widgetType=IToolboxWidgetConf, apply=(IContainer,), viewmapper="@addpageWidget",  id="cms.addpage", sort=100),
    WidgetConf(name=_(u"Edit page"),            widgetType=IToolboxWidgetConf, apply=(IPage,),      viewmapper="@editpageWidget", id="cms.editpage", sort=200),
    WidgetConf(name=_(u"Edit root"),            widgetType=IToolboxWidgetConf, apply=(IRoot,),      viewmapper="@editrootWidget", id="cms.editroot", sort=200),
    WidgetConf(name=_(u"Sub pages and parent"), widgetType=IToolboxWidgetConf, apply=(IContainer,), viewmapper="@subpagesWidget", id="cms.subpages", sort=300),
    WidgetConf(name=_(u"Settings"),             widgetType=IToolboxWidgetConf, apply=(IApplication,IContainer), viewmapper="@settingsWidget", id="cms.settings", sort=400),
    
    WidgetConf(name=_(u"Contents"),      widgetType=IEditorWidgetConf, apply=(IContainer,),  viewmapper="@view",      id="editor.view", sort=0),
    WidgetConf(name=_(u"Add"),           widgetType=IEditorWidgetConf, apply=(IContainer,),  viewmapper="@add",       id="editor.add",  sort=100),
    WidgetConf(name=_(u"Edit"),          widgetType=IEditorWidgetConf, apply=(IObject,IRoot),viewmapper="@edit",      id="editor.edit", sort=200),

# Path: nive_cms/i18n.py

# 
# Path: nive_cms/i18n.py

# 
# Path: nive_cms/cmsview/cutcopy.py
# class ObjCopy:
# class ContainerCopy:
# class CopyView:
#     def CanCopy(self):
#     def CanPaste(self):
#     def CanCopy(self):
#     def CanPaste(self):
#     def Paste(self, ids, pos, user):
#     def Move(self, ids, pos, user):
#     def cut(self):
#     def copy(self):
#     def paste(self):
#     def SetCopyInfo(self, action, ids, context):
#     def GetCopyInfo(self):
#     def ClipboardEmpty(self):
#     def DeleteCopyInfo(self):    
# 
# Path: nive_cms/cmsview/sort.py
# class Sort:
# class SortView:
#     def GetSort(self):
#     def GetSortElements(self, selection=None):
#     def GetMaxSort(self):
#     def UpdateSort(self, objs, user):
#     def InsertAtPosition(self, id, position, user, selection=None):
#     def InsertBefore(self, id, position, user, selection=None):
#     def InsertAfter(self, id, position, user, selection=None):
#     def MoveUp(self, id, user, selection=None):
#     def MoveDown(self, id, user, selection=None):
#     def MoveStart(self, id, user, selection=None):
#     def MoveEnd(self, id, user, selection=None):
#     def sortpages(self):
#     def sortelements(self):
#     def moveup(self):
#     def movedown(self):
#     def movetop(self):
#     def movebottom(self):


# Path: nive_cms/cmsview/view.py
from StringIO import StringIO
from pyramid.response import Response
from pyramid.renderers import get_renderer, render, render_to_response
from nive.definitions import ViewModuleConf, ViewConf, WidgetConf, FieldConf, Conf
from nive.definitions import IContainer, IApplication, IPortal, IPage, IObject, IRoot, IPageElementContainer, IFile
from nive.definitions import IToolboxWidgetConf, IEditorWidgetConf, IViewModuleConf, ICMSRoot, IColumn
from nive.utils.utils import SortConfigurationList
from nive.helper import ResolveName
from nive.security import Allow, Deny, Everyone
from nive.forms import HTMLForm, ObjectForm
from nive.views import BaseView
from nive_cms.i18n import _
from nive_cms.i18n import translator
from nive_cms.cmsview import cutcopy
from nive_cms.cmsview import sort

    # widgets
    ViewConf(name="@elementListWidget", attr="elementListWidget", context = IContainer, permission="edit"),
    ViewConf(name="@elementAddWidget",  attr="elementAddWidget",  context = IObject, permission = "add"),
    ViewConf(name="@elementAddWidget",  attr="elementAddWidget",  context = IRoot, permission = "add"),
    ViewConf(name="@editblock",         attr="editBlockElement",  context = IObject, permission = "edit"),
    
    # container
    ViewConf(name="@add",       attr="add",    context = IContainer, renderer = t+"add.pt", permission="add"),
    ViewConf(name="@delete",    attr="delete", context = IContainer, renderer = t+"delete.pt", permission = "delete"),
    
    # widgets
    ViewConf(name="@addpageWidget",  attr="tmpl", renderer = t+"widgets/widget_addpage.pt",    context = IContainer, permission="add"),
    ViewConf(name="@editpageWidget", attr="tmpl", renderer = t+"widgets/widget_editpage.pt",   context = IContainer, permission="edit"),
    ViewConf(name="@editrootWidget", attr="tmpl", renderer = t+"widgets/widget_editroot.pt",   context = IContainer, permission="edit"),
    ViewConf(name="@subpagesWidget", attr="tmpl", renderer = t+"widgets/widget_subpages.pt",   context = IContainer),
    ViewConf(name="@settingsWidget", attr="tmpl", renderer = t+"widgets/widget_settings.pt",   context = IContainer)
] + sort.views + cutcopy.views


# toolbox and editor widgets ----------------------------------------------------------------------------------
configuration.widgets = [
    WidgetConf(name=_(u"Add new page"),         widgetType=IToolboxWidgetConf, apply=(IContainer,), viewmapper="@addpageWidget",  id="cms.addpage", sort=100),
    WidgetConf(name=_(u"Edit page"),            widgetType=IToolboxWidgetConf, apply=(IPage,),      viewmapper="@editpageWidget", id="cms.editpage", sort=200),
    WidgetConf(name=_(u"Edit root"),            widgetType=IToolboxWidgetConf, apply=(IRoot,),      viewmapper="@editrootWidget", id="cms.editroot", sort=200),
    WidgetConf(name=_(u"Sub pages and parent"), widgetType=IToolboxWidgetConf, apply=(IContainer,), viewmapper="@subpagesWidget", id="cms.subpages", sort=300),
    WidgetConf(name=_(u"Settings"),             widgetType=IToolboxWidgetConf, apply=(IApplication,IContainer), viewmapper="@settingsWidget", id="cms.settings", sort=400),
    
    WidgetConf(name=_(u"Contents"),      widgetType=IEditorWidgetConf, apply=(IContainer,),  viewmapper="@view",      id="editor.view", sort=0),
    WidgetConf(name=_(u"Add"),           widgetType=IEditorWidgetConf, apply=(IContainer,),  viewmapper="@add",       id="editor.add",  sort=100),
    WidgetConf(name=_(u"Edit"),          widgetType=IEditorWidgetConf, apply=(IObject,IRoot),viewmapper="@edit",      id="editor.edit", sort=200),

    WidgetConf(name=_(u"Sort sub pages"),widgetType=IEditorWidgetConf, apply=(IPage,IRoot),  viewmapper="@sortpages", id="editor.sortpages", sort=300),