Development

Changeset 7037

You must first sign up to be able to contribute.

Changeset 7037

Show
Ignore:
Timestamp:
01/14/08 04:12:12 (8 months ago)
Author:
kupokomapa
Message:

[nahoWikiPlugin] First attempt for i18n support.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/nahoWikiPlugin/branches/kupokomapa/config/schema.yml

    r6324 r7037  
    66    id:               ~ 
    77    name:             { type: varchar, size: 255, index: unique } 
    8     latest_revision:  { type: integer, required: true, default: 1 } 
    9    
     8 
    109  naho_wiki_revision: 
    1110    _attributes:      { phpName: nahoWikiRevision } 
     11    id:               ~ 
     12    page_id:          { type: integer, foreignTable: naho_wiki_page, foreignReference: id, required: true, onDelete: cascade } 
     13    revision:         { type: integer, required: true, default: 1} 
    1214    created_at:       ~ 
    13     page_id:          { type: integer, foreignTable: naho_wiki_page, foreignReference: id, required: true, onDelete: cascade, primaryKey: true } 
    14     revision:         { type: integer, required: true, default: 1, primaryKey: true } 
    15     user_name:        { type: varchar, size: 255, required: true } 
     15    _uniques: 
     16      naho_wiki_revision_unique: [page_id, revision] 
     17 
     18  naho_wiki_revision_i18n: 
     19    _attributes:      { phpName: nahoWikiRevisionI18n } 
     20    id:               ~ 
     21    username:         { type: varchar, size: 255, required: true } 
    1622    comment:          { type: varchar, size: 255 } 
    17     content_id:       { type: integer, foreignTable: naho_wiki_content, foreignReference: id, required: true, onDelete: cascade, primaryKey: true } 
    18    
    19   naho_wiki_content: 
    20     _attributes:      { phpName: nahoWikiContent } 
    21     id:               ~ 
    22     content:          { type: longvarchar } # uncompressed content 
    23     gz_content:       { type: blob } # compressed content 
     23    content:          { type: longvarchar } 
     24    gz_content:       { type: blob } 
  • plugins/nahoWikiPlugin/branches/kupokomapa/lib/model/nahoWikiPage.php

    r6324 r7037  
    11<?php 
    2  
    3 /** 
    4  * Subclass for representing a row from the 'sf_simple_wiki_page' table. 
    5  * 
    6  *  
    7  * 
    8  * @package plugins.nahoWikiPlugin.lib.model 
    9  */ 
    102 
    113require_once sfConfig::get('sf_plugins_dir') . '/nahoWikiPlugin/lib/model/plugin/PluginnahoWikiPage.php'; 
  • plugins/nahoWikiPlugin/branches/kupokomapa/lib/model/nahoWikiPagePeer.php

    r6324 r7037  
    22 
    33/** 
    4  * Subclass for performing query and update operations on the 'sf_simple_wiki_page' table. 
    5  * 
    6  *  
    7  * 
    84 * @package plugins.nahoWikiPlugin.lib.model 
    95 */ 
  • plugins/nahoWikiPlugin/branches/kupokomapa/lib/model/nahoWikiRevision.php

    r6324 r7037  
    22 
    33/** 
    4  * Subclass for representing a row from the 'sf_simple_wiki_revision' table. 
    5  * 
    6  *  
    7  * 
    84 * @package plugins.nahoWikiPlugin.lib.model 
    95 */ 
  • plugins/nahoWikiPlugin/branches/kupokomapa/lib/model/nahoWikiRevisionPeer.php

    r6324 r7037  
    22 
    33/** 
    4  * Subclass for performing query and update operations on the 'sf_simple_wiki_revision' table. 
    5  * 
    6  *  
    7  * 
    84 * @package plugins.nahoWikiPlugin.lib.model 
    95 */ 
  • plugins/nahoWikiPlugin/branches/kupokomapa/lib/model/plugin/PluginnahoWikiPage.php

    r6324 r7037  
    22 
    33/** 
    4  * Subclass for representing a row from the 'sf_simple_wiki_page' table. 
    5  * 
    6  *  
    7  * 
    84 * @package plugins.nahoWikiPlugin.lib.model 
    9  */  
     5 */ 
     6 
    107class PluginnahoWikiPage extends BasenahoWikiPage 
    118{ 
    12    
    13   public function getRevision($revision = null) 
     9  public function getRevision($revision = null, $culture = 'en') 
    1410  { 
     11    $revisions = $this->getRevisions($culture); 
     12     
    1513    $latest_revision = null; 
    16     foreach ($this->getRevisions() as $rev) { 
     14    foreach ($revisions as $rev)  
     15    { 
    1716      if (is_null($latest_revision) || $latest_revision->getRevision() < $rev->getRevision()) { 
    1817        $latest_revision = $rev; 
    1918      } 
    20       if ($rev->getRevision() == $revision) { 
     19      if ($rev->getRevision() == $revision)  
     20      { 
     21        $rev->setCulture($culture); 
    2122        return $rev; 
    2223      } 
     24    } 
     25     
     26    if ($latest_revision) { 
     27      $latest_revision->setCulture($culture); 
    2328    } 
    2429     
     
    2631  } 
    2732   
    28   public function getRevisions($criteria= null
     33  public function getRevisions($culture = 'en'
    2934  { 
    30     if ($criteria === null) { 
    31       $criteria = new Criteria(); 
    32     } elseif ($criteria instanceof Criteria) { 
    33       $criteria = clone $criteria; 
    34     } 
    35     $criteria->addDescendingOrderByColumn(nahoWikiRevisionPeer::CREATED_AT); 
    36     return $this->getnahoWikiRevisions($criteria); 
     35    $c = new Criteria(); 
     36    $c->addJoin(nahoWikiRevisionPeer::ID, nahoWikiRevisionI18nPeer::ID, Criteria::RIGHT_JOIN); 
     37    $c->add(nahoWikiRevisionI18nPeer::CULTURE, $culture); 
     38    $c->addDescendingOrderByColumn(nahoWikiRevisionPeer::ID); 
     39     
     40    return $this->getnahoWikiRevisions($c); 
     41  } 
     42 
     43  public function getLatestRevision($culture = 'en') 
     44  { 
     45    $c = new Criteria(); 
     46    $c->add(nahoWikiRevisionPeer::PAGE_ID, $this->getId()); 
     47    $c->addJoin(nahoWikiRevisionPeer::ID, nahoWikiRevisionI18nPeer::ID, Criteria::RIGHT_JOIN); 
     48    $c->add(nahoWikiRevisionI18nPeer::CULTURE, $culture); 
     49    $c->addDescendingOrderByColumn(nahoWikiRevisionPeer::ID); 
     50     
     51    $revision = nahoWikiRevisionPeer::doSelectOne($c); 
     52     
     53    return ($revision)?$revision->getRevision():0; 
    3754  } 
    3855   
     
    4259  public function optimizeRevisions() 
    4360  { 
    44     foreach ($this->getRevisions() as $revision) { 
     61    foreach ($this->getRevisions() as $revision)  
     62    { 
    4563      if ($revision->isLatest()) { 
    4664        $revision->unarchiveContent(); 
     
    5068    } 
    5169  } 
    52  
    5370} 
  • plugins/nahoWikiPlugin/branches/kupokomapa/lib/model/plugin/PluginnahoWikiPagePeer.php

    r6324 r7037  
    22 
    33/** 
    4  * Subclass for performing query and update operations on the 'sf_simple_wiki_page' table. 
    5  * 
    6  *  
    7  * 
    84 * @package plugins.nahoWikiPlugin.lib.model 
    9  */  
     5 */ 
     6 
    107class PluginnahoWikiPagePeer extends BasenahoWikiPagePeer 
    118{ 
  • plugins/nahoWikiPlugin/branches/kupokomapa/lib/model/plugin/PluginnahoWikiRevision.php

    r6324 r7037  
    22 
    33/** 
    4  * Subclass for representing a row from the 'sf_simple_wiki_revision' table. 
    5  * 
    6  *  
    7  * 
    84 * @package plugins.nahoWikiPlugin.lib.model 
    9  */  
     5 */ 
     6 
    107class PluginnahoWikiRevision extends BasenahoWikiRevision 
    118{ 
    12    
    13   /** 
    14   * Taken from sfIp2Country 
    15   * 
    16   * Determines the remote IP address. 
    17   * If called via a CLI script (batch) the local 
    18   * loopback address will be returned. 
    19   * 
    20   * @return string 
    21   * @author     Sacha Telgenhof Oude Koehorst <s.telgenhof@xs4all.nl> 
    22   */ 
    23   private function getRemoteIP() 
     9  public function setUsername($username) 
    2410  { 
    25     $ip = false; 
    26  
    27     // User is behind a proxy and check that we discard RFC1918 IP addresses. 
    28     // If these address are behind a proxy then only figure out which IP belongs to the user. 
    29     if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { 
    30       // put the IP's octets into an array 
    31       $ips = explode(', ', $_SERVER['HTTP_X_FORWARDED_FOR']); 
    32       $no = count($ips); 
    33  
    34       for ($i = 0 ; $i < $no ; $i++) { 
    35         // Skip RFC 1918 IP's 10.0.0.0/8, 172.16.0.0/12 and 
    36         // 192.168.0.0/16 
    37         if (!eregi('^(10|172\.16|192\.168)\.', $ips[$i])) { 
    38           $ip = $ips[$i]; 
    39           break; 
    40         } 
     11    if (!is_null($username))  
     12    { 
     13      parent::setUsername($username); 
     14      return; 
     15    } 
     16     
     17    $user = sfContext::getInstance()->getUser(); 
     18    if ($user->isAuthenticated())  
     19    { 
     20      $username = $user->__toString(); 
     21    } 
     22    else  
     23    { 
     24      if (class_exists('ip2Country')) { 
     25        $username = ip2Country::getInstance()->getRemoteAddress(); 
     26      } else { 
     27        $username = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1'; 
    4128      } 
    4229    } 
    43  
    44     return ($ip ? $ip : isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1'); // Return with the found IP, the remote address or the local loopback address 
    45   } 
    46    
    47   public function initUserName() 
    48   { 
    49     $user = sfContext::getInstance()->getUser(); 
    50     if ($user->isAuthenticated()) { 
    51       $this->setUserName($user->__toString()); 
    52     } else { 
    53       $this->setUserName($this->getRemoteIP()); 
    54     } 
     30     
     31    parent::setUsername($username); 
    5532  } 
    5633   
    5734  public function isLatest() 
    5835  { 
    59     return $this->getRevision() == $this->getPage()->getLatestRevision(); 
     36    return $this->getRevision() >= $this->getPage()->getLatestRevision($this->getCulture()); 
    6037  } 
    6138   
     
    6441    return $this->getnahoWikiPage(); 
    6542  } 
    66    
     43 
    6744  public function getContent() 
    6845  { 
    69     $content_storage = $this->getnahoWikiContent(); 
     46    $uncompressed_content = parent::getContent(); 
     47    $compressed_content = $this->getGzContent(); 
    7048     
    71     if (!$content_storage) { 
    72       return null; 
    73     } 
    74      
    75     $uncompressed_content = $content_storage->getContent(); 
    76     $compressed_content = $content_storage->getGzContent(); 
    77      
    78     /* Check archive state : shouldn't have to be done 
    79     if (!$this->isLatest() && $uncompressed_content) { // Old revision has uncompressed content : do archive ! 
    80       $this->archiveContent(); 
    81     } elseif ($this->isLatest() && $compressed_content) { // Latest revision has compressed content : unarchive ! 
    82       $this->unarchiveContent(); 
    83     } 
    84     */ 
    85      
    86     return $uncompressed_content ? $uncompressed_content : gzinflate($compressed_content); 
     49    return $uncompressed_content ? $uncompressed_content : @gzuncompress($compressed_content); 
    8750  } 
    8851   
     
    9154    return sfMarkdown::doConvert($this->getContent()); 
    9255  } 
    93    
    94   public function setContent($content) 
    95   { 
    96     $content_storage = $this->getnahoWikiContent(); 
    97     if (!$content_storage) { 
    98       $content_storage = new nahoWikiContent; 
    99       $this->setnahoWikiContent($content_storage); 
    100     } 
    101     $content_storage->setContent($content); 
    102      
    103     return $content_storage->save(); 
    104   } 
    105    
     56 
    10657  public function archiveContent() 
    10758  { 
    108     $content_storage = $this->getnahoWikiContent(); 
    109      
    110     if (!$content_storage) { 
    111       return false; 
    112     } 
    113      
    114     $uncompressed_content = $content_storage->getContent(); 
    115     if ($uncompressed_content) { 
    116       $compressed_content = gzdeflate($uncompressed_content, 9); 
    117       $content_storage->setGzContent($compressed_content); 
    118       $content_storage->setContent(null); 
    119       $content_storage->save(); 
    120     } 
     59    $content = $this->getContent(); 
     60    $this->setGzContent(@gzcompress($content)); 
     61    $this->setContent(null); 
     62    $this->save(); 
    12163     
    12264    return true; 
    12365  } 
    124    
    125   public function unarchiveContent() 
    126   { 
    127     $content_storage = $this->getnahoWikiContent(); 
    128      
    129     if (!$content_storage) { 
    130       return false; 
    131     } 
    132      
    133     $compressed_content = $content_storage->getGzContent(); 
    134     if ($compressed_content) { 
    135       $uncompressed_content = gzinflate($compressed_content, 9); 
    136       $content_storage->setGzContent(null); 
    137       $content_storage->setContent($uncompressed_content); 
    138       $content_storage->save(); 
    139     } 
    140      
    141     return true; 
    142   } 
    143    
    14466} 
  • plugins/nahoWikiPlugin/branches/kupokomapa/lib/model/plugin/PluginnahoWikiRevisionPeer.php

    r6324 r7037  
    22 
    33/** 
    4  * Subclass for performing query and update operations on the 'sf_simple_wiki_revision' table. 
    5  * 
    6  *  
    7  * 
    84 * @package plugins.nahoWikiPlugin.lib.model 
    9  */  
     5 */ 
     6 
    107class PluginnahoWikiRevisionPeer extends BasenahoWikiRevisionPeer 
    118{ 
  • plugins/nahoWikiPlugin/branches/kupokomapa/modules/nahoWiki/lib/BasenahoWikiActions.class.php

    r6324 r7037  
    1717class BasenahoWikiActions extends sfActions 
    1818{ 
    19    
    2019  public function preExecute() 
    2120  { 
    22   } 
    23    
    24   protected function setPage($page_name = null) 
    25   { 
    26     if (is_null($page_name)) { 
    27       $page_name = ucfirst(sfInflector::camelize($this->getRequestParameter('page'))); 
    28     } 
    29     $c = new Criteria; 
    30     $c->add(nahoWikiPagePeer::NAME, $page_name); 
    31     $this->page = nahoWikiPagePeer::doSelectOne($c); 
    32     if (!$this->page) { 
    33       $this->initNewPage($page_name); 
     21    $this->culture = $this->getRequestParameter('sf_culture', $this->getUser()->getCulture()); 
     22    if (!$this->culture) { 
     23      $this->culture = 'en'; 
    3424    } 
    3525     
    36     $revision = $this->getRequestParameter('revision', $this->page->getLatestRevision()); 
    37     $this->revision = $this->page->getRevision($revision); 
    38     if (!$this->revision) { 
    39       $this->initNewRevision(); 
     26    $page = ucfirst(sfInflector::camelize($this->getRequestParameter('page'))); 
     27     
     28    $c = new Criteria; 
     29    $c->add(nahoWikiPagePeer::NAME, $page); 
     30    $this->page = nahoWikiPagePeer::doSelectOne($c); 
     31    if (!$this->page)  
     32    { 
     33      $this->page = new nahoWikiPage(); 
     34      $this->page->setName($page); 
     35    } 
     36     
     37    $revision = $this->getRequestParameter('revision', $this->page->getLatestRevision($this->culture)); 
     38    $this->revision = $this->page->getRevision($revision, $this->culture); 
     39    if (!$this->revision)  
     40    { 
     41      $this->_initNewRevision(); 
    4042    } 
    4143     
    4244    $this->uriParams = 'page=' . urlencode($this->page->getName()); 
    43     if ($this->revision->getRevision() != $this->page->getLatestRevision()) { 
     45    if ($this->revision->getRevision() != $this->page->getLatestRevision($this->culture)) { 
    4446      $this->uriParams .= '&revision=' . urlencode($this->revision->getRevision()); 
    4547    } 
    4648  } 
    47      
    48   protected function initNewRevision() 
    49   { 
    50     $this->revision = new nahoWikiRevision; 
    51     $this->revision->setnahoWikiPage($this->page); 
    52     $this->revision->initUserName(); 
    53     if (!$this->page->isNew()) { 
    54       $this->revision->setRevision($this->page->getLatestRevision()+1); 
    55     } 
    56   } 
    57    
    58   protected function initNewPage($page_name) 
    59   { 
    60     $this->page = new nahoWikiPage; 
    61     $this->page->setName($page_name); 
    62   } 
    6349 
    64   protected function forward403Unless($condition) 
    65   { 
    66     if ($condition) { 
    67       return; 
    68     } 
    69  
    70     if ($this->getUser()->isAuthenticated()) { 
    71       $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action')); 
    72     } else { 
    73       $this->forward(sfConfig::get('sf_login_module'), sfConfig::get('sf_login_action')); 
    74     } 
    75   } 
    76    
    7750  public function executeIndex() 
    7851  { 
     
    8760  public function executeView() 
    8861  { 
    89     $this->setPage(); 
    90      
    9162    return sfView::SUCCESS; 
    9263  } 
     
    9869    return sfView::SUCCESS; 
    9970  } 
     71   
    10072  public function executeEdit() 
    101   { 
    102     $this->setPage(); 
    103      
    104     // Generate the username (this is done by the Revision model) 
    105     $tmp_revision = new nahoWikiRevision; 
    106     $tmp_revision->initUserName(); 
    107     $this->userName = $tmp_revision->getUserName(); 
    108      
     73  {   
    10974    // Save changes 
    110     if ($this->getRequest()->getMethod() == sfRequest::POST) { 
    111       if (!$this->page->isNew()) { 
     75    if ($this->getRequest()->getMethod() == sfRequest::POST)  
     76    { 
     77      if (!$this->page->isNew())  
     78      { 
    11279        $this->revision->archiveContent(); 
    113         $this->initNewRevision(); 
    114       } 
     80        $this->_initNewRevision();  
     81      }       
     82       
     83      $this->revision->setCulture($this->culture); 
    11584      $this->revision->setContent($this->getRequestParameter('content')); 
    11685      $this->revision->setComment($this->getRequestParameter('comment')); 
    11786      $this->revision->save(); 
    118       $this->page->setLatestRevision($this->revision->getRevision()); 
     87 
    11988      $this->page->save(); 
     89       
    12090      $this->redirect('nahoWiki/view?page=' . $this->page->getName()); 
    12191    } 
     
    12696  public function executeHistory() 
    12797  { 
    128     $this->setPage(); 
    129  
    13098    return sfView::SUCCESS; 
    13199  } 
     
    133101  public function executeDiff() 
    134102  { 
    135     $this->setPage(); // $this->revision is revision2 
    136  
    137103    $this->forward404If($this->page->isNew()); 
    138104    $this->forward404If($this->revision->isNew()); 
     
    142108    $c->add(nahoWikiRevisionPeer::PAGE_ID, $this->page->getId()); 
    143109    $c->add(nahoWikiRevisionPeer::REVISION, $this->getRequestParameter('oldRevision')); 
     110    $c->addJoin(nahoWikiRevisionPeer::ID, nahoWikiRevisionI18n::ID, Criteria::RIGHT_JOIN); 
     111    $c->add(nahoWikiRevisionI18nPeer::CULTURE, $this->culture); 
    144112    $this->revision1 = nahoWikiRevisionPeer::doSelectOne($c); 
    145113    $this->forward404Unless($this->revision1); 
     
    178146  public function executeUser() 
    179147  { 
    180     $this->setPage('User:' . $this->getRequestParameter('name')); 
    181      
    182148    return sfView::SUCCESS; 
    183149  } 
    184150   
     151  protected function _initNewRevision() 
     152  { 
     153    $c = new Criteria(); 
     154    $c->add(nahoWikiRevisionPeer::PAGE_ID, $this->page->getId()); 
     155    $c->add(nahoWikiRevisionPeer::REVISION, $this->page->getLatestRevision($this->culture)+1); 
     156    $this->revision = nahoWikiRevisionPeer::doSelectOne($c); 
     157 
     158    if (!$this->revision)  
     159    { 
     160      $this->revision = new nahoWikiRevision(); 
     161      $this->revision->setnahoWikiPage($this->page); 
     162      $this->revision->setRevision($this->page->getLatestRevision($this->culture)+1); 
     163      $this->revision->setCulture($this->culture); 
     164      $this->revision->setUsername(null); 
     165    } else { 
     166      $this->revision->setCulture($this->culture); 
     167      $this->revision->setUsername(null); 
     168    } 
     169  } 
     170   
     171  protected function forward403Unless($condition) 
     172  { 
     173    if ($condition) { 
     174      return; 
     175    } 
     176 
     177    if ($this->getUser()->isAuthenticated()) { 
     178      $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action')); 
     179    } else { 
     180      $this->forward(sfConfig::get('sf_login_module'), sfConfig::get('sf_login_action')); 
     181    } 
     182  }  
    185183} 
  • plugins/nahoWikiPlugin/branches/kupokomapa/modules/nahoWiki/templates/_page.php

    r6324 r7037  
    1 <?php include_partial('page_tools', array('uriParams' => $uriParams)) ?> 
    2  
    31<?php if (!$revision->isLatest()): ?> 
    4   <p class="wiki-warning"><?php echo __('You are currently viewing an old revision of this page.') ?> <?php echo link_to(__('Don\'t you want to see the latest version of this page ?'), 'nahoWiki/view?page=' . $page->getName()) ?></p> 
     2  <p class="wiki-warning"> 
     3    <?php echo __('You are currently viewing an old revision of this page.') ?>  
     4    <?php echo link_to(__('Don\'t you want to see the latest version of this page?'), 'nahoWiki/view?page=' . $page->getName()) ?> 
     5  </p> 
    56<?php endif ?> 
    67 
    78<div class="wiki-page"> 
    89  <?php if (has_slot('wiki_page_header')) echo get_slot('wiki_page_header') ?> 
    9   <?php if ($page->isNew()): ?> 
     10  <?php if (!$revision->getContent()): ?> 
    1011    <p class="wiki-warning"><?php echo __(isset($nopage_msg) ? $nopage_msg : 'There is no article here yet. Edit this page to contribute.') ?></p> 
    1112  <?php else: ?> 
  • plugins/nahoWikiPlugin/branches/kupokomapa/modules/nahoWiki/templates/_page_edit.php

    r6324 r7037  
    1 <?php include_partial('page_tools', array('uriParams' => $uriParams)) ?> 
    2  
    31<?php if (!$revision->isLatest()): ?> 
    42  <p class="wiki-warning"><?php echo __('You are currently editing an old revision of this page. If you save these changes, all changed made since this revision will be lost !!') ?> <?php echo link_to(__('Don\'t you want to edit the latest version of this page ?'), 'nahoWiki/edit?page=' . $page->getName()) ?></p> 
     
    86   
    97  <?php if (!$sf_user->isAuthenticated()): ?> 
    10     <p><?php echo __('You are not authenticated. Your IP address will be stored : %ip%.', array('%ip%' => '<strong>' . $userName . '</strong>')) ?></p> 
     8    <p><?php echo __('You are not authenticated. Your IP address will be stored : %ip%.', array('%ip%' => '<strong>' . $revision->getUsername() . '</strong>')) ?></p> 
    119  <?php else: ?> 
    12     <p><?php echo __('You are authenticated. Your username will be stored : %username%.', array('%username%' => '<strong>' . $userName . '</strong>')) ?></p> 
     10    <p><?php echo __('You are authenticated. Your username will be stored : %username%.', array('%username%' => '<strong>' . $revision->getUsername() . '</strong>')) ?></p> 
    1311  <?php endif ?> 
    1412   
  • plugins/nahoWikiPlugin/branches/kupokomapa/modules/nahoWiki/templates/_page_history.php

    r7031 r7037  
    11<?php use_helper('Date') ?> 
    2  
    3 <?php include_partial('page_tools', array('uriParams' => 'page=' . urlencode($page->getName()))) ?> 
    42 
    53<?php if (@$compare): ?> 
     
    2018  </thead> 
    2119  <tbody> 
    22   <?php $revisions = $page->getRevisions() ?> 
     20  <?php $revisions = $page->getRevisions($culture) ?> 
    2321  <?php $rev2 = $sf_request->getParameter('revision', @$revisions[0] ? $revisions[0]->getRevision() : null) ?> 
    2422  <?php $rev1 = $sf_request->getParameter('oldRevision', @$revisions[1] ? ($rev2 == $revisions[0]->getRevision() ? $revisions[1]->getRevision() : $revisions[0]->getRevision()): null) ?> 
  • plugins/nahoWikiPlugin/branches/kupokomapa/modules/nahoWiki/templates/editSuccess.php

    r6324 r7037  
    1 <?php include_partial('page_edit', array('page' => $page, 'revision' => $revision, 'uriParams' => $uriParams, 'userName' => $userName)) ?> 
     1<div id="wiki"> 
     2  <?php include_partial('page_tools', array('uriParams' => $uriParams)) ?> 
     3  <?php include_partial('page_edit', array('page' => $page, 'culture' => $culture, 'revision' => $revision, 'uriParams' => $uriParams)) ?> 
     4</div> 
  • plugins/nahoWikiPlugin/branches/kupokomapa/modules/nahoWiki/templates/historySuccess.php

    r6324 r7037  
    1 <?php include_partial('page_history', array('page' => $page, 'compare' => true)) ?> 
     1<div id="wiki"> 
     2  <?php include_partial('page_tools', array('uriParams' => 'page=' . urlencode($page->getName()))) ?> 
     3  <?php include_partial('page_history', array('page' => $page, 'culture' => $culture, 'compare' => true)) ?> 
     4</div> 
  • plugins/nahoWikiPlugin/branches/kupokomapa/modules/nahoWiki/templates/userSuccess.php

    r6324 r7037  
    1 <?php slot('wiki_page_header') ?> 
    2   coucou gamin 
    3 <?php end_slot() ?> 
    4  
    5 <?php include_partial('page', array('page' => $page, 'revision' => $revision, 'uriParams' => $uriParams)) ?> 
  • plugins/nahoWikiPlugin/branches/kupokomapa/modules/nahoWiki/templates/viewSuccess.php

    r6324 r7037  
    1 <?php include_partial('page', array('page' => $page, 'revision' => $revision, 'uriParams' => $uriParams)) ?> 
     1<div id="wiki"> 
     2  <?php include_partial('page_tools', array('uriParams' => $uriParams)) ?> 
     3  <?php include_partial('page', array('page' => $page, 'culture' => $culture, 'revision' => $revision, 'uriParams' => $uriParams)) ?> 
     4</div>