# 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
        
            else:
                title = u"<img src='%s' align='top'> %s" % (src, t)
                blocks.write(elHtml % {u"title": title, u"link": self.FolderUrl(el)+defaultview, u"options": self.editBlockList(obj=el, showCCP=showCCP)})
        if not len(elements):
            blocks.write(localizer(_(u"<p><i>empty</i></p>")))
        data = html % {u"blocks": blocks.getvalue(), u"id": str(obj.GetID()), u"title": localizer(_(u"Page elements"))}
        if addResponse:
            r = Response(content_type="text/html", conditional_response=True)
            r.unicode_body = data
            return r
        return data
        

    def pageListWidget(self, page=None, pages=None, showCCP=False, defaultview=u""):
        """
        Widget with existing pages list and edit options
        call with page = current page
        """
        if not page:
            page=self.context
        html = u"""<div class="subpages"> %(blocks)s </div>"""
        
        pHtml = u"""<div class="element">
  <div class="el_title">%(workflow)s <a href="%(url)s" title="%(aTitle)s">%(title)s </a> </div>
  <div class="el_options">%(options)s</div>
  <br style="clear:both">
</div>"""
        
        useworkflow = 1

# 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

        
            else:
                title = u"<img src='%s' align='top'> %s" % (src, t)
                blocks.write(elHtml % {u"title": title, u"link": self.FolderUrl(el)+defaultview, u"options": self.editBlockList(obj=el, showCCP=showCCP)})
        if not len(elements):
            blocks.write(localizer(_(u"<p><i>empty</i></p>")))
        data = html % {u"blocks": blocks.getvalue(), u"id": str(obj.GetID()), u"title": localizer(_(u"Page elements"))}
        if addResponse:
            r = Response(content_type="text/html", conditional_response=True)
            r.unicode_body = data
            return r
        return data
        

    def pageListWidget(self, page=None, pages=None, showCCP=False, defaultview=u""):
        """
        Widget with existing pages list and edit options
        call with page = current page
        """
        if not page:
            page=self.context
        html = u"""<div class="subpages"> %(blocks)s </div>"""
        
        pHtml = u"""<div class="element">
  <div class="el_title">%(workflow)s <a href="%(url)s" title="%(aTitle)s">%(title)s </a> </div>
  <div class="el_options">%(options)s</div>
  <br style="clear:both">
</div>"""
        
        useworkflow = 1

        localizer = translator(self.request)