source: sipes/cord/modules/block/block.module @ b354002

stableversion-3.0
Last change on this file since b354002 was b354002, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio del cord

  • Propiedad mode establecida a 100755
File size: 23.7 KB
Línea 
1<?php
2
3/**
4 * @file
5 * Controls the boxes that are displayed around the main content.
6 */
7
8/**
9 * Denotes that a block is not enabled in any region and should not
10 * be shown.
11 */
12define('BLOCK_REGION_NONE', -1);
13
14/**
15 * Constants defining cache granularity for blocks.
16 *
17 * Modules specify the caching patterns for their blocks using binary
18 * combinations of these constants in their hook_block(op 'list'):
19 *   $block[delta]['cache'] = BLOCK_CACHE_PER_ROLE | BLOCK_CACHE_PER_PAGE;
20 * BLOCK_CACHE_PER_ROLE is used as a default when no caching pattern is
21 * specified.
22 *
23 * The block cache is cleared in cache_clear_all(), and uses the same clearing
24 * policy than page cache (node, comment, user, taxonomy added or updated...).
25 * Blocks requiring more fine-grained clearing might consider disabling the
26 * built-in block cache (BLOCK_NO_CACHE) and roll their own.
27 *
28 * Note that user 1 is excluded from block caching.
29 */
30
31/**
32 * The block should not get cached. This setting should be used:
33 * - for simple blocks (notably those that do not perform any db query),
34 * where querying the db cache would be more expensive than directly generating
35 * the content.
36 * - for blocks that change too frequently.
37 */
38define('BLOCK_NO_CACHE', -1);
39
40/**
41 * The block can change depending on the roles the user viewing the page belongs to.
42 * This is the default setting, used when the block does not specify anything.
43 */
44define('BLOCK_CACHE_PER_ROLE', 0x0001);
45
46/**
47 * The block can change depending on the user viewing the page.
48 * This setting can be resource-consuming for sites with large number of users,
49 * and thus should only be used when BLOCK_CACHE_PER_ROLE is not sufficient.
50 */
51define('BLOCK_CACHE_PER_USER', 0x0002);
52
53/**
54 * The block can change depending on the page being viewed.
55 */
56define('BLOCK_CACHE_PER_PAGE', 0x0004);
57
58/**
59 * The block is the same for every user on every page where it is visible.
60 */
61define('BLOCK_CACHE_GLOBAL', 0x0008);
62
63/**
64 * Implementation of hook_help().
65 */
66function block_help($path, $arg) {
67  switch ($path) {
68    case 'admin/help#block':
69      $output = '<p>'. t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) .'</p>';
70      $output .= '<p>'. t('Although blocks are usually generated automatically by modules (like the <em>User login</em> block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available <a href="@input-format">input format</a>.', array('@input-format' => url('admin/settings/filters'))) .'</p>';
71      $output .= '<p>'. t('When working with blocks, remember that:') .'</p>';
72      $output .= '<ul><li>'. t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') .'</li>';
73      $output .= '<li>'. t('disabled blocks, or blocks not in a region, are never shown.') .'</li>';
74      $output .= '<li>'. t('when throttle module is enabled, throttled blocks (blocks with the <em>Throttle</em> checkbox selected) are hidden during high server loads.') .'</li>';
75      $output .= '<li>'. t('blocks can be configured to be visible only on certain pages.') .'</li>';
76      $output .= '<li>'. t('blocks can be configured to be visible only when specific conditions are true.') .'</li>';
77      $output .= '<li>'. t('blocks can be configured to be visible only for certain user roles.') .'</li>';
78      $output .= '<li>'. t('when allowed by an administrator, specific blocks may be enabled or disabled on a per-user basis using the <em>My account</em> page.') .'</li>';
79      $output .= '<li>'. t('some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.') .'</li></ul>';
80      $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@block">Block module</a>.', array('@block' => 'http://drupal.org/handbook/modules/block/')) .'</p>';
81      return $output;
82    case 'admin/build/block':
83      $throttle = module_exists('throttle');
84      $output = '<p>'. t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the <em>Block</em> column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page.') .'</p>';
85      if ($throttle) {
86        $output .= '<p>'. t('To reduce CPU usage, database traffic or bandwidth, blocks may be automatically disabled during high server loads by selecting their <em>Throttle</em> checkbox. Adjust throttle thresholds on the <a href="@throttleconfig">throttle configuration page</a>.', array('@throttleconfig' => url('admin/settings/throttle'))) .'</p>';
87      }
88      $output .= '<p>'. t('Click the <em>configure</em> link next to each block to configure its specific title and visibility settings. Use the <a href="@add-block">add block page</a> to create a custom block.', array('@add-block' => url('admin/build/block/add'))) .'</p>';
89      return $output;
90    case 'admin/build/block/add':
91      return '<p>'. t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the <a href="@blocks">blocks administration page</a> to be visible.', array('@blocks' => url('admin/build/block'))) .'</p>';
92  }
93}
94
95/**
96 * Implementation of hook_theme()
97 */
98function block_theme() {
99  return array(
100    'block_admin_display_form' => array(
101      'template' => 'block-admin-display-form',
102      'file' => 'block.admin.inc',
103      'arguments' => array('form' => NULL),
104    ),
105  );
106}
107
108/**
109 * Implementation of hook_perm().
110 */
111function block_perm() {
112  return array('administer blocks', 'use PHP for block visibility');
113}
114
115/**
116 * Implementation of hook_menu().
117 */
118function block_menu() {
119  $items['admin/build/block'] = array(
120    'title' => 'Blocks',
121    'description' => 'Configure what block content appears in your site\'s sidebars and other regions.',
122    'page callback' => 'block_admin_display',
123    'access arguments' => array('administer blocks'),
124    'file' => 'block.admin.inc',
125  );
126  $items['admin/build/block/list'] = array(
127    'title' => 'List',
128    'type' => MENU_DEFAULT_LOCAL_TASK,
129    'weight' => -10,
130  );
131  $items['admin/build/block/list/js'] = array(
132    'title' => 'JavaScript List Form',
133    'page callback' => 'block_admin_display_js',
134    'access arguments' => array('administer blocks'),
135    'type' => MENU_CALLBACK,
136    'file' => 'block.admin.inc',
137  );
138  $items['admin/build/block/configure'] = array(
139    'title' => 'Configure block',
140    'page callback' => 'drupal_get_form',
141    'page arguments' => array('block_admin_configure'),
142    'access arguments' => array('administer blocks'),
143    'type' => MENU_CALLBACK,
144    'file' => 'block.admin.inc',
145  );
146  $items['admin/build/block/delete'] = array(
147    'title' => 'Delete block',
148    'page callback' => 'drupal_get_form',
149    'page arguments' => array('block_box_delete'),
150    'access arguments' => array('administer blocks'),
151    'type' => MENU_CALLBACK,
152    'file' => 'block.admin.inc',
153  );
154  $items['admin/build/block/add'] = array(
155    'title' => 'Add block',
156    'page callback' => 'drupal_get_form',
157    'page arguments' => array('block_add_block_form'),
158    'access arguments' => array('administer blocks'),
159    'type' => MENU_LOCAL_TASK,
160    'file' => 'block.admin.inc',
161  );
162  $default = variable_get('theme_default', 'garland');
163  foreach (list_themes() as $key => $theme) {
164    $items['admin/build/block/list/'. $key] = array(
165      'title' => check_plain($theme->info['name']),
166      'page arguments' => array($key),
167      'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
168      'weight' => $key == $default ? -10 : 0,
169      'file' => 'block.admin.inc',
170      'access callback' => '_block_themes_access',
171      'access arguments' => array($theme),
172    );
173  }
174  return $items;
175}
176
177/**
178 * Menu item access callback - only admin or enabled themes can be accessed
179 */
180function _block_themes_access($theme) {
181  return user_access('administer blocks') && ($theme->status || $theme->name == variable_get('admin_theme', '0'));
182}
183
184/**
185 * Implementation of hook_block().
186 *
187 * Generates the administrator-defined blocks for display.
188 */
189function block_block($op = 'list', $delta = 0, $edit = array()) {
190  switch ($op) {
191    case 'list':
192      $blocks = array();
193
194      $result = db_query('SELECT bid, info FROM {boxes} ORDER BY info');
195      while ($block = db_fetch_object($result)) {
196        $blocks[$block->bid]['info'] = $block->info;
197        // Not worth caching.
198        $blocks[$block->bid]['cache'] = BLOCK_NO_CACHE;
199      }
200      return $blocks;
201
202    case 'configure':
203      $box = array('format' => FILTER_FORMAT_DEFAULT);
204      if ($delta) {
205        $box = block_box_get($delta);
206      }
207      if (filter_access($box['format'])) {
208        return block_box_form($box);
209      }
210      break;
211
212    case 'save':
213      block_box_save($edit, $delta);
214      break;
215
216    case 'view':
217      $block = db_fetch_object(db_query('SELECT body, format FROM {boxes} WHERE bid = %d', $delta));
218      $data['content'] = check_markup($block->body, $block->format, FALSE);
219      return $data;
220  }
221}
222
223/**
224 * Update the 'blocks' DB table with the blocks currently exported by modules.
225 *
226 * @param $theme
227 *   The theme to rehash blocks for. If not provided, defaults to the currently
228 *   used theme.
229 *
230 * @return
231 *   Blocks currently exported by modules.
232 */
233function _block_rehash($theme = NULL) {
234  global $theme_key;
235
236  init_theme();
237  if (!isset($theme)) {
238    $theme = $theme_key;
239  }
240
241  $result = db_query("SELECT * FROM {blocks} WHERE theme = '%s'", $theme);
242  $old_blocks = array();
243  while ($old_block = db_fetch_array($result)) {
244    $old_blocks[$old_block['module']][$old_block['delta']] = $old_block;
245  }
246
247  $blocks = array();
248  // Valid region names for the theme.
249  $regions = system_region_list($theme);
250
251  foreach (module_list() as $module) {
252    $module_blocks = module_invoke($module, 'block', 'list');
253    if ($module_blocks) {
254      foreach ($module_blocks as $delta => $block) {
255        if (empty($old_blocks[$module][$delta])) {
256          // If it's a new block, add identifiers.
257          $block['module'] = $module;
258          $block['delta']  = $delta;
259          $block['theme']  = $theme;
260          if (!isset($block['pages'])) {
261            // {block}.pages is type 'text', so it cannot have a
262            // default value, and not null, so we need to provide
263            // value if the module did not.
264            $block['pages']  = '';
265          }
266          // Add defaults and save it into the database.
267          drupal_write_record('blocks', $block);
268          // Set region to none if not enabled.
269          $block['region'] = $block['status'] ? $block['region'] : BLOCK_REGION_NONE;
270          // Add to the list of blocks we return.
271          $blocks[] = $block;
272        }
273        else {
274          // If it's an existing block, database settings should overwrite
275          // the code. The only exceptions are 'cache' which is only definable
276          // and updatable in the code, and 'info' which is not stored in
277          // the database.
278          // Update the cache mode only; the other values don't need to change.
279          if (isset($block['cache']) && $block['cache'] != $old_blocks[$module][$delta]['cache']) {
280            db_query("UPDATE {blocks} SET cache = %d WHERE bid = %d", $block['cache'], $old_blocks[$module][$delta]['bid']);
281          }
282          // Add 'info' to this block.
283          $old_blocks[$module][$delta]['info'] = $block['info'];
284          // If the region name does not exist, disable the block and assign it to none.
285          if (!empty($old_blocks[$module][$delta]['region']) && !isset($regions[$old_blocks[$module][$delta]['region']])) {
286            drupal_set_message(t('The block %info was assigned to the invalid region %region and has been disabled.', array('%info' => $old_blocks[$module][$delta]['info'], '%region' => $old_blocks[$module][$delta]['region'])), 'warning');
287            $old_blocks[$module][$delta]['status'] = 0;
288            $old_blocks[$module][$delta]['region'] = BLOCK_REGION_NONE;
289          }
290          else {
291            $old_blocks[$module][$delta]['region'] = $old_blocks[$module][$delta]['status'] ? $old_blocks[$module][$delta]['region'] : BLOCK_REGION_NONE;
292          }
293          // Add this block to the list of blocks we return.
294          $blocks[] = $old_blocks[$module][$delta];
295          // Remove this block from the list of blocks to be deleted.
296          unset($old_blocks[$module][$delta]);
297        }
298      }
299    }
300  }
301
302  // Remove blocks that are no longer defined by the code from the database.
303  foreach ($old_blocks as $module => $old_module_blocks) {
304    foreach ($old_module_blocks as $delta => $block) {
305      db_query("DELETE FROM {blocks} WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $module, $delta, $theme);
306    }
307  }
308  return $blocks;
309}
310
311/**
312 * Implementation of hook_flush_caches().
313 */
314function block_flush_caches() {
315  // Rehash blocks for active themes. We don't use list_themes() here,
316  // because if MAINTENANCE_MODE is defined it skips reading the database,
317  // and we can't tell which themes are active.
318  $result = db_query("SELECT name FROM {system} WHERE type = 'theme' AND status = 1");
319  while ($theme = db_result($result)) {
320    _block_rehash($theme);
321  }
322}
323
324/**
325 * Returns information from database about a user-created (custom) block.
326 *
327 * @param $bid
328 *   ID of the block to get information for.
329 * @return
330 *   Associative array of information stored in the database for this block.
331 *   Array keys:
332 *   - bid: Block ID.
333 *   - info: Block description.
334 *   - body: Block contents.
335 *   - format: Filter ID of the filter format for the body.
336 */
337function block_box_get($bid) {
338  return db_fetch_array(db_query("SELECT * FROM {boxes} WHERE bid = %d", $bid));
339}
340
341/**
342 * Define the custom block form.
343 */
344function block_box_form($edit = array()) {
345  $edit += array(
346    'info' => '',
347    'body' => '',
348  );
349  $form['info'] = array(
350    '#type' => 'textfield',
351    '#title' => t('Block description'),
352    '#default_value' => $edit['info'],
353    '#maxlength' => 64,
354    '#description' => t('A brief description of your block. Used on the <a href="@overview">block overview page</a>.', array('@overview' => url('admin/build/block'))),
355    '#required' => TRUE,
356    '#weight' => -19,
357  );
358  $form['body_field']['#weight'] = -17;
359  $form['body_field']['body'] = array(
360    '#type' => 'textarea',
361    '#title' => t('Block body'),
362    '#default_value' => $edit['body'],
363    '#rows' => 15,
364    '#description' => t('The content of the block as shown to the user.'),
365    '#weight' => -17,
366  );
367  if (!isset($edit['format'])) {
368    $edit['format'] = FILTER_FORMAT_DEFAULT;
369  }
370  $form['body_field']['format'] = filter_form($edit['format'], -16);
371
372  return $form;
373}
374
375/**
376 * Saves a user-created block in the database.
377 *
378 * @param $edit
379 *   Associative array of fields to save. Array keys:
380 *   - info: Block description.
381 *   - body: Block contents.
382 *   - format: Filter ID of the filter format for the body.
383 * @param $delta
384 *   Block ID of the block to save.
385 * @return
386 *   Always returns TRUE.
387 */
388function block_box_save($edit, $delta) {
389  if (!filter_access($edit['format'])) {
390    $edit['format'] = FILTER_FORMAT_DEFAULT;
391  }
392
393  db_query("UPDATE {boxes} SET body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['body'], $edit['info'], $edit['format'], $delta);
394
395  return TRUE;
396}
397
398/**
399 * Implementation of hook_user().
400 *
401 * Allow users to decide which custom blocks to display when they visit
402 * the site.
403 */
404function block_user($type, $edit, &$account, $category = NULL) {
405  switch ($type) {
406    case 'form':
407      if ($category == 'account') {
408        $rids = array_keys($account->roles);
409        $result = db_query("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL) ORDER BY b.weight, b.module", $rids);
410        $form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE);
411        while ($block = db_fetch_object($result)) {
412          $data = module_invoke($block->module, 'block', 'list');
413          if ($data[$block->delta]['info']) {
414            $return = TRUE;
415            $form['block'][$block->module][$block->delta] = array('#type' => 'checkbox', '#title' => check_plain($data[$block->delta]['info']), '#default_value' => isset($account->block[$block->module][$block->delta]) ? $account->block[$block->module][$block->delta] : ($block->custom == 1));
416          }
417        }
418
419        if (!empty($return)) {
420          return $form;
421        }
422      }
423
424      break;
425    case 'validate':
426      if (empty($edit['block'])) {
427        $edit['block'] = array();
428      }
429      return $edit;
430  }
431}
432
433/**
434 * Return all blocks in the specified region for the current user.
435 *
436 * @param $region
437 *   The name of a region.
438 *
439 * @return
440 *   An array of block objects, indexed with <i>module</i>_<i>delta</i>.
441 *   If you are displaying your blocks in one or two sidebars, you may check
442 *   whether this array is empty to see how many columns are going to be
443 *   displayed.
444 *
445 * @todo
446 *   Now that the blocks table has a primary key, we should use that as the
447 *   array key instead of <i>module</i>_<i>delta</i>.
448 */
449function block_list($region) {
450  global $user, $theme_key;
451
452  static $blocks = array();
453
454  if (!count($blocks)) {
455    $rids = array_keys($user->roles);
456    $result = db_query(db_rewrite_sql("SELECT DISTINCT b.* FROM {blocks} b LEFT JOIN {blocks_roles} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (". db_placeholders($rids) .") OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", 'b', 'bid'), array_merge(array($theme_key), $rids));
457    while ($block = db_fetch_object($result)) {
458      if (!isset($blocks[$block->region])) {
459        $blocks[$block->region] = array();
460      }
461      // Use the user's block visibility setting, if necessary
462      if ($block->custom != 0) {
463        if ($user->uid && isset($user->block[$block->module][$block->delta])) {
464          $enabled = $user->block[$block->module][$block->delta];
465        }
466        else {
467          $enabled = ($block->custom == 1);
468        }
469      }
470      else {
471        $enabled = TRUE;
472      }
473
474      // Match path if necessary
475      if ($block->pages) {
476        if ($block->visibility < 2) {
477          $path = drupal_get_path_alias($_GET['q']);
478          // Compare with the internal and path alias (if any).
479          $page_match = drupal_match_path($path, $block->pages);
480          if ($path != $_GET['q']) {
481            $page_match = $page_match || drupal_match_path($_GET['q'], $block->pages);
482          }
483          // When $block->visibility has a value of 0, the block is displayed on
484          // all pages except those listed in $block->pages. When set to 1, it
485          // is displayed only on those pages listed in $block->pages.
486          $page_match = !($block->visibility xor $page_match);
487        }
488        else {
489          $page_match = drupal_eval($block->pages);
490        }
491      }
492      else {
493        $page_match = TRUE;
494      }
495      $block->enabled = $enabled;
496      $block->page_match = $page_match;
497      $blocks[$block->region]["{$block->module}_{$block->delta}"] = $block;
498    }
499  }
500
501  // Create an empty array if there were no entries
502  if (!isset($blocks[$region])) {
503    $blocks[$region] = array();
504  }
505
506  foreach ($blocks[$region] as $key => $block) {
507    // Render the block content if it has not been created already.
508    if (!isset($block->content)) {
509      // Erase the block from the static array - we'll put it back if it has content.
510      unset($blocks[$region][$key]);
511      if ($block->enabled && $block->page_match) {
512        // Check the current throttle status and see if block should be displayed
513        // based on server load.
514        if (!($block->throttle && (module_invoke('throttle', 'status') > 0))) {
515          // Try fetching the block from cache. Block caching is not compatible with
516          // node_access modules. We also preserve the submission of forms in blocks,
517          // by fetching from cache only if the request method is 'GET'.
518          if (!count(module_implements('node_grants')) && $_SERVER['REQUEST_METHOD'] == 'GET' && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) {
519            $array = $cache->data;
520          }
521          else {
522            $array = module_invoke($block->module, 'block', 'view', $block->delta);
523            if (isset($cid)) {
524              cache_set($cid, $array, 'cache_block', CACHE_TEMPORARY);
525            }
526          }
527
528          if (isset($array) && is_array($array)) {
529            foreach ($array as $k => $v) {
530              $block->$k = $v;
531            }
532          }
533        }
534        if (isset($block->content) && $block->content) {
535          // Override default block title if a custom display title is present.
536          if ($block->title) {
537            // Check plain here to allow module generated titles to keep any markup.
538            $block->subject = $block->title == '<none>' ? '' : check_plain($block->title);
539          }
540          if (!isset($block->subject)) {
541            $block->subject = '';
542          }
543          $blocks[$block->region]["{$block->module}_{$block->delta}"] = $block;
544        }
545      }
546    }
547  }
548  return $blocks[$region];
549}
550
551/**
552 * Assemble the cache_id to use for a given block.
553 *
554 * The cache_id string reflects the viewing context for the current block
555 * instance, obtained by concatenating the relevant context information
556 * (user, page, ...) according to the block's cache settings (BLOCK_CACHE_*
557 * constants). Two block instances can use the same cached content when
558 * they share the same cache_id.
559 *
560 * Theme and language contexts are automatically differenciated.
561 *
562 * @param $block
563 * @return
564 *   The string used as cache_id for the block.
565 */
566function _block_get_cache_id($block) {
567  global $theme, $base_root, $user;
568
569  // User 1 being out of the regular 'roles define permissions' schema,
570  // it brings too many chances of having unwanted output get in the cache
571  // and later be served to other users. We therefore exclude user 1 from
572  // block caching.
573  if (variable_get('block_cache', 0) && $block->cache != BLOCK_NO_CACHE && $user->uid != 1) {
574    $cid_parts = array();
575
576    // Start with common sub-patterns: block identification, theme, language.
577    $cid_parts[] = $block->module;
578    $cid_parts[] = $block->delta;
579    $cid_parts[] = $theme;
580    if (module_exists('locale')) {
581      global $language;
582      $cid_parts[] = $language->language;
583    }
584
585    // 'PER_ROLE' and 'PER_USER' are mutually exclusive. 'PER_USER' can be a
586    // resource drag for sites with many users, so when a module is being
587    // equivocal, we favor the less expensive 'PER_ROLE' pattern.
588    if ($block->cache & BLOCK_CACHE_PER_ROLE) {
589      $cid_parts[] = 'r.'. implode(',', array_keys($user->roles));
590    }
591    elseif ($block->cache & BLOCK_CACHE_PER_USER) {
592      $cid_parts[] = "u.$user->uid";
593    }
594
595    if ($block->cache & BLOCK_CACHE_PER_PAGE) {
596      $cid_parts[] = $base_root . request_uri();
597    }
598
599    return implode(':', $cid_parts);
600  }
601}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.