Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFDefault.browser.folder.FolderView Class Reference
Inheritance diagram for CMFDefault.browser.folder.FolderView:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.browser.folder.FolderView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def has_local
def listItemInfos
def navigation_previous
def navigation_next
def summary_length
def summary_type
def summary_match

Private Member Functions

def _getItems

Detailed Description

View for IFolderish.

Definition at line 240 of file folder.py.


Member Function Documentation

Definition at line 248 of file folder.py.

00248 
00249     def _getItems(self):
00250         (key, reverse) = self.context.getDefaultSorting()
00251         items = self.context.contentValues()
00252         items = sequence.sort(items,
00253                               ((key, 'cmp', reverse and 'desc' or 'asc'),))
00254         return LazyFilter(items, skip='View')

Here is the caller graph for this function:

Definition at line 258 of file folder.py.

00258 
00259     def has_local(self):
00260         return 'local_pt' in self.context.objectIds()
00261 

Reimplemented in CMFDefault.browser.folder.FolderContentsView.

Definition at line 167 of file folder.py.

00167 
00168     def listItemInfos(self):
00169         batch_obj = self._getBatchObj()
00170         portal_url = self._getPortalURL()
00171 
00172         items = []
00173         for item in batch_obj:
00174             item_description = item.Description()
00175             item_icon = item.getIcon(1)
00176             item_title = item.Title()
00177             item_type = remote_type = item.Type()
00178             if item_type == 'Favorite' and not item_icon == 'p_/broken':
00179                 item = item.getObject()
00180                 item_description = item_description or item.Description()
00181                 item_title = item_title or item.Title()
00182                 remote_type = item.Type()
00183             is_file = remote_type in ('File', 'Image')
00184             is_link = remote_type == 'Link'
00185             items.append({'description': item_description,
00186                           'format': is_file and item.Format() or '',
00187                           'icon': item_icon and ('%s/%s' %
00188                                                (portal_url, item_icon)) or '',
00189                           'size': is_file and ('%0.0f kb' %
00190                                             (item.get_size() / 1024.0)) or '',
00191                           'title': item_title,
00192                           'type': item_type,
00193                           'url': is_link and item.getRemoteUrl() or
00194                                  item.absolute_url()})
00195         return tuple(items)

Here is the call graph for this function:

Definition at line 211 of file folder.py.

00211 
00212     def navigation_next(self):
00213         batch_obj = self._getBatchObj().next
00214         if batch_obj is None:
00215             return None
00216 
00217         length = len(batch_obj)
00218         url = self._getNavigationURL(batch_obj.first)
00219         if length == 1:
00220             title = _(u'Next item')
00221         else:
00222             title = _(u'Next ${count} items', mapping={'count': length})
00223         return {'title': title, 'url': url}

Here is the call graph for this function:

Definition at line 197 of file folder.py.

00197 
00198     def navigation_previous(self):
00199         batch_obj = self._getBatchObj().previous
00200         if batch_obj is None:
00201             return None
00202 
00203         length = len(batch_obj)
00204         url = self._getNavigationURL(batch_obj.first)
00205         if length == 1:
00206             title = _(u'Previous item')
00207         else:
00208             title = _(u'Previous ${count} items', mapping={'count': length})
00209         return {'title': title, 'url': url}

Here is the call graph for this function:

Definition at line 225 of file folder.py.

00225 
00226     def summary_length(self):
00227         length = self._getBatchObj().sequence_length
00228         return length and thousands_commas(length) or ''

Here is the call graph for this function:

Definition at line 236 of file folder.py.

00236 
00237     def summary_match(self):
00238         return self.request.form.get('SearchableText')
00239 

Definition at line 230 of file folder.py.

00230 
00231     def summary_type(self):
00232         length = self._getBatchObj().sequence_length
00233         return (length == 1) and _(u'item') or _(u'items')

Here is the call graph for this function:


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