示例#1
0
    def getVars(self):
        vars = wcomponents.WTemplated.getVars(self)
        wc = wcomponents.WAccessControlFrame()
        vars["accessControlFrame"] = wc.getHTML(
            self._session,
            urlHandlers.UHSessionSetVisibility.getURL(self._session),
            "Session")
        if not self._session.isProtected():
            df = wcomponents.WDomainControlFrame(self._session)
            vars["accessControlFrame"] += "<br>%s" % df.getHTML()
        wc = wcomponents.WModificationControlFrame()
        vars["modifyControlFrame"] = wc.getHTML(self._session)

        vars["confId"] = self._session.getConference().getId()
        vars["sessionId"] = self._session.getId()
        vars["managers"] = self._getSessionChairList("manager")
        vars["coordinators"] = self._getSessionChairList("coordinator")
        return vars
示例#2
0
    def getVars(self):
        vars = wcomponents.WTemplated.getVars(self)
        mcf = wcomponents.WModificationControlFrame()
        vars["modifyControlFrame"] = mcf.getHTML(self._contrib)
        acf = wcomponents.WAccessControlFrame()
        visURL = urlHandlers.UHContributionSetVisibility.getURL(self._contrib)

        if isinstance(self._contrib.getOwner(), conference.Session):
            vars["accessControlFrame"] = acf.getHTML(self._contrib, visURL,
                                                     "InSessionContribution")
        else:
            vars["accessControlFrame"] = acf.getHTML(self._contrib, visURL,
                                                     "Contribution")

        if not self._contrib.isProtected():
            df = wcomponents.WDomainControlFrame(self._contrib)
            vars["accessControlFrame"] += "<br>%s" % df.getHTML()
        vars["confId"] = self._contrib.getConference().getId()
        vars["contribId"] = self._contrib.getId()
        vars["eventType"] = self._contrib.getConference().getType()
        vars["managers"] = self._getManagersList()
        vars["submitters"] = self._getSubmittersList()
        return vars
示例#3
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     if self.__target.getAccessProtectionLevel() == -1:
         vars["privacy"] = "ABSOLUTELY PUBLIC%s" % wcomponents.WInlineContextHelp(
             'The object will stay public regardless of the protection of its parent (no more inheritance)'
         ).getHTML()
         vars[
             "changePrivacy"] = """make it simply <input type="submit" class="btn" name="visibility" value="PUBLIC">%s<br/>""" % wcomponents.WInlineContextHelp(
                 'It will then be public by default but will inherit from the potential protection of its parent'
             ).getHTML()
         vars[
             "changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself%s<br/>""" % wcomponents.WInlineContextHelp(
                 'It will then be private').getHTML()
     elif self.__target.isItselfProtected():
         vars["privacy"] = "PRIVATE%s" % wcomponents.WInlineContextHelp(
             'The object is private by itself').getHTML()
         vars[
             "changePrivacy"] = """make it simply <input type="submit" class="btn" name="visibility" value="PUBLIC">%s<br/>""" % wcomponents.WInlineContextHelp(
                 'It will then be public by default but will inherit from the potential protection of its parent'
             ).getHTML()
         vars[
             "changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % wcomponents.WInlineContextHelp(
                 'The object will stay public regardless of the protection of its parent'
             ).getHTML()
     elif self.__target.hasProtectedOwner():
         vars[
             "privacy"] = "PRIVATE by inheritance%s" % wcomponents.WInlineContextHelp(
                 'Private because a parent object is private').getHTML()
         vars[
             "changePrivacy"] = """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself%s<br/>""" % wcomponents.WInlineContextHelp(
                 'It will then remain private even if the parent object goes public'
             ).getHTML()
         vars[
             "changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % wcomponents.WInlineContextHelp(
                 'The object will stay public regardless of the protection of its parent'
             ).getHTML()
     else:
         vars["privacy"] = "PUBLIC%s" % wcomponents.WInlineContextHelp(
             'the object is currently public because its parent is public but might inherit from the potential protection of its parent if it changes one day'
         ).getHTML()
         vars[
             "changePrivacy"] = """make it <input type="submit" class="btn" name="visibility" value="PRIVATE"> by itself<br/>"""
         vars[
             "changePrivacy"] += """make it <input type="submit" class="btn" name="visibility" value="ABSOLUTELY PUBLIC">%s""" % wcomponents.WInlineContextHelp(
                 'The object will stay public regardless of the protection of its parent'
             ).getHTML()
     vars["visibility"] = "VISIBLE"
     oppVisibility = "HIDDEN"
     if self.__material.isHidden():
         vars["visibility"] = _("HIDDEN")
         oppVisibility = _("VISIBLE")
     #Privacy of the current target can only be changed if the target
     #   owner is not protected
     vars["changeVisibility"] = _(
         """( _("make it") <input type="submit" class="btn" name="visibility" value="%s">)"""
     ) % oppVisibility
     vars["locator"] = self.__material.getLocator().getWebForm()
     vars["userTable"] = wcomponents.WPrincipalTable().getHTML(
         self.__material.getAllowedToAccessList(), self.__material,
         vars["addAllowedURL"], vars["removeAllowedURL"])
     vars["accessKey"] = self.__material.getAccessKey()
     vars["setAccessKeyURL"] = urlHandlers.UHMaterialSetAccessKey.getURL()
     if not self.__material.isProtected():
         df = wcomponents.WDomainControlFrame(self.__material)
         vars["domainControlFrame"] = "<br>%s"%df.getHTML( \
                                                 vars["addDomainURL"], \
                                                 vars["removeDomainURL"] )
     else:
         vars["domainControlFrame"] = ""
     return vars