Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.content.browser.reviewlist.ReviewListTable Class Reference

List of all members.

Public Member Functions

def __init__
def render
def items
def show_sort_column
def buttons
def setbuttonclass

Public Attributes

 context
 request
 table

Detailed Description

The review list table renders the table and its actions.

Definition at line 21 of file reviewlist.py.


Constructor & Destructor Documentation

def plone.app.content.browser.reviewlist.ReviewListTable.__init__ (   self,
  context,
  request,
  kwargs 
)

Definition at line 26 of file reviewlist.py.

00026 
00027     def __init__(self, context, request, **kwargs):
00028         self.context = context
00029         self.request = request
00030 
00031         url = self.context.absolute_url()
00032         view_url = url + '/full_review_list'
00033         self.table = Table(request, url, view_url, self.items,
00034                            buttons=self.buttons)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 112 of file reviewlist.py.

00112 
00113     def buttons(self):
00114         buttons = []
00115         portal_actions = getToolByName(self.context, 'portal_actions')
00116         button_actions = portal_actions.listActionInfos(object=aq_inner(self.context), categories=('folder_buttons', ))
00117 
00118         # Do not show buttons if there is no data, unless there is data to be
00119         # pasted
00120         if False:#not len(self.batch):
00121             if self.context.cb_dataValid():
00122                 for button in button_actions:
00123                     if button['id'] == 'paste':
00124                         return [self.setbuttonclass(button)]
00125             else:
00126                 return []
00127 
00128         for button in button_actions:
00129             # Make proper classes for our buttons
00130             if button['id'] != 'paste' or self.context.cb_dataValid():
00131                 buttons.append(self.setbuttonclass(button))
00132         return buttons

Here is the call graph for this function:

Definition at line 39 of file reviewlist.py.

00039 
00040     def items(self):
00041         plone_utils = getToolByName(self.context, 'plone_utils')
00042         portal_url = getToolByName(self.context, 'portal_url')
00043         plone_view = getMultiAdapter((self.context, self.request), name=u'plone')
00044         portal_workflow = getToolByName(self.context, 'portal_workflow')
00045         portal_properties = getToolByName(self.context, 'portal_properties')
00046         site_properties = portal_properties.site_properties
00047         
00048         use_view_action = site_properties.getProperty('typesUseViewActionInListings', ())
00049         browser_default = self.context.browserDefault()
00050 
00051         results = list()
00052         for i, obj in enumerate(self.context.my_worklist()):
00053             if i % 2 == 0:
00054                 table_row_class = "even"
00055             else:
00056                 table_row_class = "odd"
00057             
00058             url = obj.absolute_url()
00059             path = '/'.join(obj.getPhysicalPath())
00060             icon = plone_view.getIcon(obj);
00061             
00062             type_class = 'contenttype-' + plone_utils.normalizeString(
00063                 obj.portal_type)
00064 
00065             review_state = portal_workflow.getInfoFor( obj, 'review_state', '')
00066 
00067             state_class = 'state-' + plone_utils.normalizeString(review_state)
00068             relative_url = portal_url.getRelativeContentURL(obj)
00069             obj_type = obj.portal_type
00070 
00071             modified = plone_view.toLocalizedTime(
00072                 obj.ModificationDate(), long_format=1)
00073             
00074             if obj_type in use_view_action:
00075                 view_url = url + '/view'
00076             elif obj.is_folderish:
00077                 view_url = url + "/folder_contents"              
00078             else:
00079                 view_url = url
00080 
00081             is_browser_default = len(browser_default[1]) == 1 and (
00082                 obj.id == browser_default[1][0])
00083                                  
00084             results.append(dict(
00085                 url = url,
00086                 id  = obj.getId(),
00087                 quoted_id = urllib.quote_plus(obj.getId()),
00088                 path = path,
00089                 title_or_id = obj.pretty_title_or_id(),
00090                 description = obj.Description(),
00091                 obj_type = obj_type,
00092                 size = obj.getObjSize(),
00093                 modified = modified,
00094                 icon = icon.html_tag(),
00095                 type_class = type_class,
00096                 wf_state = review_state,
00097                 state_title = portal_workflow.getTitleForStateOnType(review_state,
00098                                                            obj_type),
00099                 state_class = state_class,
00100                 is_browser_default = is_browser_default,
00101                 folderish = obj.is_folderish,
00102                 relative_url = relative_url,
00103                 view_url = view_url,
00104                 table_row_class = table_row_class,
00105                 is_expired = self.context.isExpired(obj),
00106             ))
00107         return results

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 35 of file reviewlist.py.

00035 
00036     def render(self):
00037         return self.table.render()

Definition at line 133 of file reviewlist.py.

00133 
00134     def setbuttonclass(self, button):
00135         if button['id'] == 'paste':
00136             button['cssclass'] = 'standalone'
00137         else:
00138             button['cssclass'] = 'context'
00139         return button

Here is the caller graph for this function:

Definition at line 109 of file reviewlist.py.

00109 
00110     def show_sort_column(self):
00111         return False


Member Data Documentation

Definition at line 27 of file reviewlist.py.

Definition at line 28 of file reviewlist.py.

Definition at line 32 of file reviewlist.py.


The documentation for this class was generated from the following file: