/**
  * special install function
  *
  */
 function install()
 {
     if ($this->gid == 1) {
         if (!user_is_super_user()) {
             exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('plugin_phpwiki_lib_wikipagewrap', 'right_error'));
         }
     }
     $we = new PHPWikiEntry();
     $we->setGid($this->gid);
     $we->setLanguage_id($_REQUEST['language_id']);
     $name_fr = "Page d'accueil";
     $page_fr = "PageAccueil";
     $desc_fr = "Document initial du Wiki";
     $name_en = "Home Page";
     $page_en = "HomePage";
     $desc_en = "Initial wiki document";
     switch ($we->getLanguage_id()) {
         // English
         case 'en_US':
             define('WIKI_PGSRC', 'codendipgsrc');
             define('DEFAULT_WIKI_PGSRC', PHPWIKI_SRC_PATH . '/codendipgsrc');
             $we->setName($name_en);
             $we->setPage($page_en);
             $we->setDesc($desc_en);
             break;
             // French
         // French
         case 'fr_FR':
             define('WIKI_PGSRC', 'pgsrc');
             define('DEFAULT_WIKI_PGSRC', PHPWIKI_SRC_PATH . '/locale/fr/pgsrc');
             $we->setName($name_fr);
             $we->setPage($page_fr);
             $we->setDesc($desc_fr);
             break;
         default:
             define('WIKI_PGSRC', 'codendipgsrc');
             define('DEFAULT_WIKI_PGSRC', PHPWIKI_SRC_PATH . '/codendipgsrc');
             $we->setName($name_en);
             $we->setPage($page_en);
             $we->setDesc($desc_en);
     }
     $we->add();
     $this->render();
 }
 /**
  *
  */
 function update()
 {
     $page = $_POST['page'];
     if (!empty($_POST['upage'])) {
         $page = $_POST['upage'];
     }
     if ($this->checkPage($page)) {
         $we = new PHPWikiEntry();
         $we->setId($_POST['id']);
         $we->setGid($this->gid);
         $we->setName($_POST['name']);
         $we->setPage($page);
         $we->setDesc($_POST['desc']);
         $we->setRank($_POST['rank']);
         $we->setLanguage_id($_POST['language_id']);
         $we->update();
     }
 }