/**
  * Hook to list pending documents and/or versions of documents in site admin page
  *
  * @param array $params
  */
 function show_pending_documents($params)
 {
     $request = HTTPRequest::instance();
     $limit = 25;
     //return all pending versions for given group id
     $offsetVers = $request->getValidated('offsetVers', 'uint', 0);
     if (!$offsetVers || $offsetVers < 0) {
         $offsetVers = 0;
     }
     $linkToLogMsg = '<p>When an element is deleted, the action appears in <a href="/project/stats/source_code_access.php/?who=allusers&span=14&view=daily&group_id=' . $params['group_id'] . '">the access log</a>.</p>';
     require_once 'Docman_VersionFactory.class.php';
     $version = new Docman_VersionFactory();
     $res = $version->listPendingVersions($params['group_id'], $offsetVers, $limit);
     $params['id'][] = 'version';
     $params['nom'][] = $GLOBALS['Language']->getText('plugin_docman', 'deleted_version');
     $html = '';
     $html .= '<div class="contenu_onglet" id="contenu_onglet_version">';
     $html .= $linkToLogMsg;
     if (isset($res) && $res) {
         $html .= $this->showPendingVersions($res['versions'], $params['group_id'], $res['nbVersions'], $offsetVers, $limit);
     } else {
         $html .= 'No restorable versions found';
     }
     $html .= '</div>';
     $params['html'][] = $html;
     //return all pending items for given group id
     $offsetItem = $request->getValidated('offsetItem', 'uint', 0);
     if (!$offsetItem || $offsetItem < 0) {
         $offsetItem = 0;
     }
     require_once 'Docman_ItemFactory.class.php';
     $item = new Docman_ItemFactory($params['group_id']);
     $res = $item->listPendingItems($params['group_id'], $offsetItem, $limit);
     $params['id'][] = 'item';
     $params['nom'][] = $GLOBALS['Language']->getText('plugin_docman', 'deleted_item');
     $html = '';
     $html .= '<div class="contenu_onglet" id="contenu_onglet_item">';
     $html .= $linkToLogMsg;
     if (isset($res) && $res) {
         $html .= $this->showPendingItems($res['items'], $params['group_id'], $res['nbItems'], $offsetItem, $limit);
     } else {
         $html .= 'No restorable items found';
     }
     $html .= '</div>';
     $params['html'][] = $html;
 }