Location: PHPKode > projects > Knowledge Box > knowledgebox/display/bases.php
<?php

  /*
   * Free IT Foundation
   * Free Technology Serving Knowledge
   * http://www.free-it-foundation.org
   * 
   * This file is part of Knowledge Box.
   * 
   * Knowledge Box is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   * 
   * Knowledge Box is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   * 
   * You should have received a copy of the GNU General Public License
   * along with Knowledge Box.  If not, see <http://www.gnu.org/licenses/>.
   */

  
  // title block
  $titleBlock = new CTitleBlock (utf8_encode (html_entity_decode ($AppUI->_('titleKnowledgeBox'))), KB_MODULE_ICON);

  // add cells if administrator
  if (KB_IS_ADMINISTRATOR)
  {
    // insertion
    $titleBlock->addCell ('<input type="submit" class="button" value="' . $AppUI->_('actionNewBase') . '">', '',
                          '<form action="index.php" method="get">
                           <input type="hidden" name="m" value="' . KB_MODULE . '" />
                           <input type="hidden" name="a" value="radix" />',
                          '</form>');

    // authentication
    /*
    $titleBlock->addCell ('<input type="submit" class="button" value="' . $AppUI->_('actionExternalAuthentication') . '">', '',
                          '<form action="index.php" method="get">
                           <input type="hidden" name="m" value="' . KB_MODULE . '" />
                           <input type="hidden" name="a" value="authentication" />',
                          '</form>');
    */
  }

  // show the title block
  $titleBlock->show ();

  // get bases
  $bases = KBModuleBase::getBases ();

?>

<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl">
<tr>
  <th width="35"><?= $AppUI->_('columnView') ?></th>
  <? if (KB_IS_ADMINISTRATOR) { ?>
    <th width="35"><?= $AppUI->_('columnEdit') ?></th>
  <? } ?>
  <th><?= $AppUI->_('columnBaseName') ?></th>
</tr>
<?

  // iterate over bases
  foreach ($bases as $base)
  {

?>
<tr>
  <td align="center">
    <a href="index.php?m=<?= KB_MODULE ?>&kbid=<?= $base->getId () ?>">
    <?= dPshowImage ('./images/next.gif', '16', '16') ?></a>
  </td>
  <? if (KB_IS_ADMINISTRATOR) { ?>
    <td align="center">
      <a href="index.php?m=<?= KB_MODULE ?>&a=radix&id=<?= $base->getId () ?>">
      <?= dPshowImage ('./images/icons/posticon.gif', '14', '11') ?></a>
    </td>
  <? } ?>
  <td>
    <a href="index.php?m=<?= KB_MODULE ?>&kbid=<?= $base->getId () ?>">
    <?= $base->getName () ?></a>
  </td>
</tr>
<?

  }
  // end iteration
  
  // empty list
  if (count ($bases) == 0)
  {

?>
<tr>
  <td></td>
  <? if (KB_IS_ADMINISTRATOR) { ?>
    <td></td>
  <? } ?>
  <td>
    <br />
    <?= $AppUI->_('noBaseAvailable') ?>
    <br />
    <a href="index.php?m=<?= KB_MODULE ?>&a=radix"><?= $AppUI->_('noBaseAtLeastOne') ?></a>

    <? if (!KB_IS_ADMINISTRATOR) { ?>
      <br /><br />
      <b><?= $AppUI->_('noBaseMustBeAdministrator') ?></b>
    <? } ?>
  </td>
</tr>
<?

  }
  // end empty list

?>
</table>
Return current item: Knowledge Box