Ejemplo n.º 1
0
 /** 
  * Get wiki language (set at creation time)
  * return 0 if no wiki document exist
  */
 function getLanguage_id()
 {
     // The language of the wiki is the language of all its wiki documents.
     if (!$this->language_id) {
         // We only support one language for all the wiki documents of a project.
         $wei =& WikiEntry::getEntryIterator($this->gid);
         if ($wei->valid()) {
             $we =& $wei->current();
             // get first element
             $this->language_id = $we->getLanguage_id();
         }
     }
     return $this->language_id;
 }
Ejemplo n.º 2
0
 /**
  *
  */
 function _browseWikiDocuments()
 {
     $wei =& WikiEntry::getEntryIterator($this->gid);
     print '<ul class="WikiEntries">';
     while ($wei->valid()) {
         $we = $wei->current();
         $href = $this->_buildPageLink($we->wikiPage, $we->getName());
         if (!empty($href)) {
             print $GLOBALS['Language']->getText('wiki_views_wikiserviceviews', 'wikientries', array($href, $we->getDesc()));
         }
         $wei->next();
     }
     print '</ul>';
 }
 /**
  * _browseWikiDocument - private
  */
 function _browseWikiDocument()
 {
     $purifier = Codendi_HTMLPurifier::instance();
     $wei = WikiEntry::getEntryIterator($this->gid);
     print $GLOBALS['Language']->getText('wiki_views_wkserviews', 'browsedoc');
     print html_build_list_table_top(array($GLOBALS['Language']->getText('wiki_views_wkserviews', 'doc_name'), $GLOBALS['Language']->getText('wiki_views_wkserviews', 'doc_page'), $GLOBALS['Language']->getText('wiki_views_wkserviews', 'doc_rank'), $GLOBALS['Language']->getText('wiki_views_wkserviews', 'doc_delete')));
     $i = 0;
     while ($wei->valid()) {
         $we = $wei->current();
         print '<tr class="' . html_get_alt_row_color($i) . '">';
         print '<td>
            <a href="' . $this->wikiAdminLink . '&view=updateWikiDocument&id=' . $we->getId() . '">' . $purifier->purify($we->getName()) . '</a>
         </td>';
         print '<td>';
         print $purifier->purify($we->getPage());
         print ' - ';
         print '<a href="' . $this->wikiAdminLink . '&view=docPerms&id=' . $we->wikiPage->getId() . '">';
         $status = $GLOBALS['Language']->getText('wiki_views_wkserviews', 'define_perms');
         if ($we->wikiPage->permissionExist()) {
             $status = $GLOBALS['Language']->getText('wiki_views_wkserviews', 'edit_perms');
         }
         print '[' . $purifier->purify($status) . ']';
         print '</a>';
         print '</td>';
         print '<td align="center">' . $we->getRank() . '</td>';
         print '<td align="center">';
         $alt = $GLOBALS['Language']->getText('wiki_views_wkserviews', 'deletedoc', array($purifier->purify($we->getName())));
         print html_trash_link($this->wikiAdminLink . '&view=wikiDocuments&action=delete&id=' . $we->getId(), $GLOBALS['Language']->getText('common_mvc_view', 'warn', $alt), $alt);
         print '</td>';
         print '</tr>';
         $i++;
         $wei->next();
     }
     print '</table>';
 }