Пример #1
0
              datatype="list",
              size=10,
              default="raw",
              name=_(u"Type"),
              listItems=ct,
              fulltext=False,
              description=u""),
    FieldConf(id="codeblock",
              datatype="code",
              size=50000,
              default="",
              name=_(u"Code"),
              fulltext=False,
              description=u""),
]

fields = ["title", "codeblock", "pool_groups"]
configuration.forms = {
    "create": {
        "fields": fields
    },
    "edit": {
        "fields": fields
    }
}

jsonfields = fields + ["pool_type", "pool_filename"]
configuration.toJson = tuple(jsonfields)

configuration.views = []
Пример #2
0
    name="Article",
    dbparam="article_adv",
    context=MyArticle,
    template="nive_tmpl_element_advanced:article.pt",
    selectTag=20,
    icon = "nive_cms.cmsview:static/images/types/element.png",
    description=""
)

category = (
    {"id": "politics", "name": "Politics"},
    {"id": "music", "name": "Music"},
    {"id": "tech", "name": "Technical"},
)

configuration.data = (
    FieldConf(id="textblock", datatype="htext", size=10000, default="", name="Text", fulltext=1, description=""),
    FieldConf(id="image",     datatype="file",  size=0,     default="", name="Image file",       description=""),
    FieldConf(id="link",      datatype="url",   size=255,   default="", name="Link",             description=""),
    FieldConf(id="topic",     datatype="list",  size=10,    default="music", name="Topic",       description=""),
)

configuration.forms = {
    "create": {"fields":["topic", "title", "textblock", "image"]}, 
    "edit":   {"fields":["title", "textblock", "image"]}
}

configuration.views = (
    ViewConf(name="astext", context=MyArticle, view=astext)
)
Пример #3
0
        text = ConvertHTMLToText(self.data.get("textblock"), removeReST=True)
        self.meta["title"] = CutText(text, self.titleLen, postfix=u"")
        return True
    


# note type definition ------------------------------------------------------------------
#@nive_module
configuration = ObjectConf(
    id = "note",
    name = _(u"Note"),
    dbparam = "notes",
    context = "nive_cms.note.note",
    template = "note.pt",
    selectTag = StagPageElement,
    icon = "nive_cms.cmsview:static/images/types/note.png",
    description = _(u"Simple text note for authors. The note is only visible to cms authors and not published.")
)

configuration.data = [
    FieldConf(id="textblock", datatype="htext", size=50000, default=u"", name=_(u"Note"), description=u"")
]

fields = ["textblock", "pool_groups"]
configuration.forms = {"create": {"fields":fields}, "edit": {"fields":fields}}

jsonfields = fields + ["pool_type","pool_filename"]
configuration.toJson = tuple(jsonfields)

configuration.views = []
Пример #4
0
    FieldConf(id="mailtitle",
              datatype="string",
              size=100,
              default="",
              name="Mail title",
              description="")
]

# define the fields actually to be used in the cms element add and edit forms
fields = [
    "title", "topics", "receiver", "receiverName", "mailtitle", "pool_groups"
]
configuration.forms = {
    "create": {
        "fields": fields
    },
    "edit": {
        "fields": fields
    }
}

# define a new view to link our custom view class (ContactView) with the contact obj (ContactObj)
# this is required to call contact() from the template and process the form
configuration.views = [
    ViewConf(id="contactview",
             name="",
             attr="view",
             context=ContactObj,
             view=ContactView)
]
Пример #5
0
    icon = "nive.cms.cmsview:static/images/types/element.png",
    description = __doc__,
    # contact specific configuration
    # the form to be displayed on the web page 
    contactForm = [
       FieldConf(id="name",    datatype="string", size=   50, default="", required=1, name="Name", description=""),
       FieldConf(id="email",   datatype="email",  size=  200, default="", required=1, name="E-Mail", description=""),
       FieldConf(id="company", datatype="string", size=  200, default="", required=0, name="Company", description=""),
       FieldConf(id="message", datatype="text",   size= 2000, default="", required=1, name="Message", description=""),
    ],
    mailtmpl = "nive_contact:contactmail.pt"
)

# these are the contact element fields
configuration.data = [
    FieldConf(id="topics",        datatype="text",   size=200, default="", name="Topics by line",description=""),
    FieldConf(id="receiver",      datatype="email",  size=100, default="", name="Receiver",      description=""),
    FieldConf(id="receiverName",  datatype="string", size=100, default="", name="Receiver name", description=""),
    FieldConf(id="mailtitle",     datatype="string", size=100, default="", name="Mail title",    description="")
]

# define the fields actually to be used in the cms element add and edit forms 
fields = ["title", "topics", "receiver", "receiverName", "mailtitle", "pool_groups"]
configuration.forms = {"create": {"fields":fields}, "edit": {"fields":fields}}

# define a new view to link our custom view class (ContactView) with the contact obj (ContactObj)
# this is required to call contact() from the template and process the form
configuration.views = [
    ViewConf(id="contactview", name="", attr="view", context=ContactObj, view=ContactView)
]
Пример #6
0
configuration.data = [
    FieldConf(id="mailtitle",    datatype="string",    size=255,  default="",  name="Activation mail title",description="Used as email title."),
    FieldConf(id="mailtext",     datatype="htext",     size=5000, default="",  name="Activation mail text", description="Added to the activation mail as header."),
    FieldConf(id="mailfooter",   datatype="htext",     size=5000, default="",  name="Activation mail footer",description="Added to the activation mail as footer."),
    FieldConf(id="notify",       datatype="bool",      size= 4,   default=1,   name="Notify by mail",       description="Can be used to assign different levels of notification."),
    FieldConf(id="newsgroup",    datatype="string",    size= 4,   default="",  name="Newsgroup assignment", description="If you have multiple sections on your website, you can automatically assign different newsgroups by filling the field. The user cannot change this value."),
]

# define the fields actually to be used in the cms element add and edit forms 
fields = ["title", "mailtitle", "mailtext", "mailfooter", "newsgroup", "pool_groups"]
configuration.forms = {"create": {"fields":fields}, "edit": {"fields":fields}}

# define a new view to link our custom view class (SubscriptionView) with the form obj (CmsFormObj)
# this is required to call subscribe() from the template and process the form
configuration.views = [
    ViewConf(id="subscriptionview", name="", attr="view", context=CmsFormObj, view=SubscriptionView)
]


# newsuser definition ------------------------------------------------------------------

class NewsuserObj(ObjectBase):

    def Activate(self, currentUser):
        """
        Activate newsuser and remove activation id
        calls workflow commit, if possible
        
        signals event: activate
        """
        wf = self.GetWf()
Пример #7
0
    FieldConf(id="image",
              datatype="file",
              size=0,
              default="",
              name="Image file",
              description=""),
    FieldConf(id="link",
              datatype="url",
              size=255,
              default="",
              name="Link",
              description=""),
    FieldConf(id="topic",
              datatype="list",
              size=10,
              default="music",
              name="Topic",
              description=""),
)

configuration.forms = {
    "create": {
        "fields": ["topic", "title", "textblock", "image"]
    },
    "edit": {
        "fields": ["title", "textblock", "image"]
    }
}

configuration.views = (ViewConf(name="astext", context=MyArticle, view=astext))
Пример #8
0
]
configuration.forms = {
    "create": {
        "fields": fields
    },
    "edit": {
        "fields": fields
    }
}

# define a new view to link our custom view class (SubscriptionView) with the form obj (CmsFormObj)
# this is required to call subscribe() from the template and process the form
configuration.views = [
    ViewConf(id="subscriptionview",
             name="",
             attr="view",
             context=CmsFormObj,
             view=SubscriptionView)
]

# newsuser definition ------------------------------------------------------------------


class NewsuserObj(ObjectBase):
    def Activate(self, currentUser):
        """
        Activate newsuser and remove activation id
        calls workflow commit, if possible
        
        signals event: activate
        """