My website needs to deal with private content shared (but not copied) across spacess, so I am now experimenting with the new idea of paragraphs and related content. So far, using custom paragraph bundles and panalizer I was getting what I wanted and some missing bits I was able to code myself. Dealing with files though is not looking easy.

I am now trying to generate a file/document tree menu in a different space and I noticed it is impossible as the rendering function has the space context hardcoded to the "current space".

line122: oa_files_treeview.inc

function oa_files_treeview_render($subtype, $conf, $args, $context) {
  static $js_instance = 0;
  drupal_add_js('misc/ajax.js', array('group' => JS_LIBRARY, 'weight' => 2));
  $base = drupal_get_path('module', 'oa_files');
  $space_id = oa_core_get_space_context();

Would it be possible to add an optional argument to this function, allowing custom space_id?

function oa_files_treeview_render($subtype, $conf, $args, $context, $space_id = -1) 

Comments

mpotter’s picture

Category: Feature request » Support request
Status: Active » Fixed

If you edit the widget configuration (via Customize Page or in your panels template) you will see options for Space and Section that can be changed.

The hardcoded space_id you mention about is only for determining if the "Add Files" and "Add Folders" buttons should appear based on the user's permissions in the current space. It has nothing to do with the actual files shown in the widget which is controlled by filters and query alters later in the code.

Note: This is a Ctools Pane plugin. You are not supposed to call the render routine directly so your suggestion about adding a space_id argument isn't valid. The pane configuration is passed in the existing $conf array.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.