Development

Changeset 18506 for plugins/nahoWikiPlugin

You must first sign up to be able to contribute.

Show
Ignore:
Timestamp:
05/21/09 14:45:08 (10 months ago)
Author:
naholyr
Message:

[nahoWikiPlugin] branch 1.2 - Release 1.2.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/nahoWikiPlugin/branches/1.2/README

    r18496 r18506  
    33== Overview == 
    44 
    5 This plugin allows you to embed a wiki within your symfony application with  
     5This plugin allows you to embed a wiki within your symfony application with 
    66the following features: 
    77  - Create/edit pages with full versionning 
     
    1919  - A bunch of helpers to provide total integration in your application 
    2020 
    21 Most features have been inspired from  
    22 [http://www.splitbrain.org/projects/dokuwiki DokuWiki] (e.g. namespaces and  
     21Most features have been inspired from 
     22[http://www.splitbrain.org/projects/dokuwiki DokuWiki] (e.g. namespaces and 
    2323Interwiki work the same way). 
    2424 
    25 It is not aimed at replacing full-featured wiki packages, but offers a  
    26 lightweight alternative for when you build a website that has to contain a  
    27 simple wiki. It is very easy to configure and adapt, so it should fulfill most  
     25It is not aimed at replacing full-featured wiki packages, but offers a 
     26lightweight alternative for when you build a website that has to contain a 
     27simple wiki. It is very easy to configure and adapt, so it should fulfill most 
    2828basic wiki requirements. 
    2929 
    30 Please note that this plugin is in active development. If you want to help and  
     30Please note that this plugin is in active development. If you want to help and 
    3131improve it, please contact Nicolas Chambrier (naholyr at yahoo dot fr). 
    3232 
    3333== Screenshots == 
    3434 
    35 [[Image(nahoWikiplugin_1.png, 30%)]]   
    36 [[Image(nahoWikiplugin_2.png, 30%)]]   
    37 [[Image(nahoWikiplugin_3.png, 30%)]]  
     35[[Image(nahoWikiplugin_1.png, 30%)]] 
     36[[Image(nahoWikiplugin_2.png, 30%)]] 
     37[[Image(nahoWikiplugin_3.png, 30%)]] 
    3838 
    3939== Requirements == 
    4040 
    4141The prerequisites for using the `nahoWiki` plugin are: 
    42  - As the plugin doesn't contain a user management module, the project where  
    43    you install it must have a table managing authors, or users (whatever the  
    44    name), and the related Propel class must have a `__toString()` method. Both  
    45    these conditions are satisfied by the  
    46    [http://trac.symfony-project.com/trac/wiki/sfGuardPlugin sfGuardPlugin], so  
     42 - As the plugin doesn't contain a user management module, the project where 
     43   you install it must have a table managing authors, or users (whatever the 
     44   name), and the related Propel class must have a `__toString()` method. Both 
     45   these conditions are satisfied by the 
     46   [http://trac.symfony-project.com/trac/wiki/sfGuardPlugin sfGuardPlugin], so 
    4747   installing this plugin is a good choice. 
    48  - You need the [http://trac.symfony-project.com/trac/wiki/sfMarkdownPlugin  
    49    sfMarkdownPlugin] which will provide the ability to convert from wiki syntax  
     48 - You need the [http://trac.symfony-project.com/trac/wiki/sfMarkdownPlugin 
     49   sfMarkdownPlugin] which will provide the ability to convert from wiki syntax 
    5050   to XHTML contents. 
    5151 
     
    5454=== PEAR Install === 
    5555 
    56 To install the plugin for a symfony project, the usual process is to use the  
     56To install the plugin for a symfony project, the usual process is to use the 
    5757symfony command line: 
    5858{{{ 
     
    6262=== SVN Install === 
    6363 
    64 If your project is not under subversion yet, you can simply checkout the  
     64If your project is not under subversion yet, you can simply checkout the 
    6565plugin in your plugins directory: 
    6666{{{ 
     
    6868}}} 
    6969 
    70 If your project is under version control, you can use the svn:externals  
     70If your project is under version control, you can use the svn:externals 
    7171property: 
    7272{{{ 
     
    7878}}} 
    7979 
    80 After you installed `nahoWikiPlugin` this way, you must copy (or symlink)  
     80After you installed `nahoWikiPlugin` this way, you must copy (or symlink) 
    8181`plugins/nahoWikiPlugin/web` to `web/nahoWikiPlugin`. 
    8282 
    8383== General instructions == 
    8484 
    85 Rebuild the model as you are used to, to create the new tables needed by the  
     85Rebuild the model as you are used to, to create the new tables needed by the 
    8686plugin. 
    8787{{{ 
     
    114114== Slots == 
    115115 
    116 The templates of the `nahoWiki` module define some slots that you can use  
     116The templates of the `nahoWiki` module define some slots that you can use 
    117117inside your layout: 
    118118  - wiki_page_actions : For the current page actions 
     
    120120  - wiki_breadcrumbs : For the wiki breadcrumbs 
    121121 
    122 If you want to insert the actions menu or the breadcrumbs in your layout at  
    123 the place you exactly want, simply disable the auto-inclusion of it (see  
     122If you want to insert the actions menu or the breadcrumbs in your layout at 
     123the place you exactly want, simply disable the auto-inclusion of it (see 
    124124app.yml configuration) and include the corresponding slot in your layout. 
    125125 
    126 Here is an example layout (in this example, options `include_page_actions` and  
     126Here is an example layout (in this example, options `include_page_actions` and 
    127127`include_page_name` have been disabled in app.yml): 
    128128 
     
    143143}}} 
    144144 
     145== Search with sfLucene == 
     146 
     147If you install `sfLucenePlugin`, you will be able to search through your wiki pages without any effort ;) 
     148 
     149=== Installing search feature === 
     150 
     151  * Case 1 : You did not have `sfLucenePlugin` installed before. 
     152    In this case, it will be extremely simple, just follow these instructions : 
     153    - Install [http://www.symfony-project.org/plugins/sfLucenePlugin sfLucenePlugin] 
     154    - In your app.yml, add {{{ lucene: { index: wiki } }}} to use the search configuration defined by `nahoWikiPlugin` 
     155 
     156  * Case 2 : You already use `sfLucenePlugin`. 
     157    In this case, you already have an index you use, and want to integrate wiki pages in those results. 
     158    For this, you have two solutions : 
     159    - Use index {{{ wiki }}} in a custom search form (how to do this is a question for sfLucene). 
     160    - Or copy configuration under `wiki` in `plugins/nahoWikiPlugin/config/search.yml` to your own `search.yml`. 
     161 
     162Once you integrated nahoWikiPlugin and sfLucenePlugin, you just have to rebuild your index 
     163with {{{ $ symfony lucene:rebuild application }}}, then go to `http://mysite/sfLucene/search` 
     164and check if your wiki pages appear in your search results. 
     165 
     166Note that only the last revision of a page is indexed. 
     167 
    145168== Configuration == 
    146169 
    147170=== Schema customization === 
    148171 
    149 If you install the `sfPropelAlternativeSchemaPlugin`, you can customize this  
    150 plugin's schema by creating a `nahoWikiPlugin_schema.custom.yml` file under  
    151 your project's `config/` directory. This allows you to customize the  
    152 connection name, table names, etc… Refer to the  
     172If you install the `sfPropelAlternativeSchemaPlugin`, you can customize this 
     173plugin's schema by creating a `nahoWikiPlugin_schema.custom.yml` file under 
     174your project's `config/` directory. This allows you to customize the 
     175connection name, table names, etc… Refer to the 
    153176[http://trac.symfony-project.com/wiki/sfPropelAlternativeSchemaPluginsfPropelAlternativeSchemaPlugin README file] for more information. 
    154177 
    155178=== Extending model, actions, or templates === 
    156179 
    157 If you want to extend a class of the model, just create an empty file  
     180If you want to extend a class of the model, just create an empty file 
    158181`lib/model/nahoWikiClass.php`, which will contain: 
    159182{{{ 
     
    167190}}} 
    168191 
    169 If you want to extend the actions, the process is similar: create a file named  
     192If you want to extend the actions, the process is similar: create a file named 
    170193`modules/nahoWiki/actions/actions.class.php` in your app's directory: 
    171194{{{ 
     
    183206}}} 
    184207 
    185 To override a template file named  
    186 `plugins/nahoWikiplugin/modules/nahoWiki/templates/theTemplate.php`, just copy  
    187 it to `modules/nahoWiki/templates/theTemplate.php` in your app's folder, and  
    188 then edit the copied file: it will be the one used by Symfony to render the  
     208To override a template file named 
     209`plugins/nahoWikiplugin/modules/nahoWiki/templates/theTemplate.php`, just copy 
     210it to `modules/nahoWiki/templates/theTemplate.php` in your app's folder, and 
     211then edit the copied file: it will be the one used by Symfony to render the 
    189212pages. 
    190 In most cases, you will want to override `_page_actions.php` or  
    191 `_breadcrumbs.php`, or `_toc.php`. Templates have been smartly exploded, you  
     213In most cases, you will want to override `_page_actions.php` or 
     214`_breadcrumbs.php`, or `_toc.php`. Templates have been smartly exploded, you 
    192215should be able to customize the rendering with a few efforts. 
    193216 
    194217=== Using another Wiki renderer === 
    195218 
    196 The default engine is [http://daringfireball.net/projects/markdown Markdown]  
    197 (if `sfMarkdownPlugin` is not installed, no conversion at all is done). If you  
    198 want to use another engine, just override the method  
     219The default engine is [http://daringfireball.net/projects/markdown Markdown] 
     220(if `sfMarkdownPlugin` is not installed, no conversion at all is done). If you 
     221want to use another engine, just override the method 
    199222`nahoWikiContentPeer::doConvert($content)`. 
    200223 
     
    216239=== app.yml === 
    217240 
    218 Some of the features of the plugin can be altered by configuration. To do so,  
     241Some of the features of the plugin can be altered by configuration. To do so, 
    219242add some of the following lines to your application's `app.yml`: 
    220243 
     
    234257    routes_register:        on            # Enable embedded routing rules ? 
    235258    wrap_class:             nahoWiki      # All pages are wrapped into a <div class="..."> tag. This is its class name. 
     259    compress_old_revisions: on            # With this option enabled, old revisions are stored as gzip-compressed (saves space) 
    236260 
    237261    # Rendering for internal links, you may need to customize the *_model options if you change rendering engine 
     
    265289=== Routing rules === 
    266290 
    267 The plugin comes with the following default rules. You can prevent those  
    268 routes to be added by disabling the option `routes_register`, and add  
     291The plugin comes with the following default rules. You can prevent those 
     292routes to be added by disabling the option `routes_register`, and add 
    269293your own routing rules. 
    270294 
     
    306330=== Look and Feel === 
    307331 
    308 The `nahoWiki` module comes with a default stylesheet. You can choose to use  
    309 your own stylesheet instead of the default one. To do so, you must create an  
    310 empty `nahoWiki` module inside your application with just one  
     332The `nahoWiki` module comes with a default stylesheet. You can choose to use 
     333your own stylesheet instead of the default one. To do so, you must create an 
     334empty `nahoWiki` module inside your application with just one 
    311335`config/view.yml` file in it, with the following content: 
    312336 
     
    320344=== Helpers === 
    321345 
    322 nahoWiki provides a bunch of helpers to help you integrate the wiki in your  
     346nahoWiki provides a bunch of helpers to help you integrate the wiki in your 
    323347application. 
    324348 
     
    346370 
    347371Note that the namespaces will be passed through __(). 
    348 Example : translate_namespaces('ns1:ns2:page', '  ') could return  
     372Example : translate_namespaces('ns1:ns2:page', '  ') could return 
    349373"My first namespace  My second namespace  page" depending on your app.yml. 
    350374 
     
    353377nahoWiki provides basic support for Interwiki. 
    354378 
    355 The main syntax is `[[Key>PageName Title]]`, and it outputs a link to the page  
    356 "PageName" of the wiki named "Key", preceded by a nice icon telling the user  
     379The main syntax is `[[Key>PageName Title]]`, and it outputs a link to the page 
     380"PageName" of the wiki named "Key", preceded by a nice icon telling the user 
    357381this is an Interwiki link. 
    358382 
    359 If the file named `web/nahoWikiPlugin/images/interwiki/key.gif` exists (or  
    360 `.png` or `.jpg`) it will be used, else we use the generic `interwiki.png`  
    361 [[Image(source:plugins/nahoWikiPlugin/trunk/web/images/interwiki.png,  
     383If the file named `web/nahoWikiPlugin/images/interwiki/key.gif` exists (or 
     384`.png` or `.jpg`) it will be used, else we use the generic `interwiki.png` 
     385[[Image(source:plugins/nahoWikiPlugin/trunk/web/images/interwiki.png, 
    362386image/x-trac-wiki)]] 
    363387 
    364 To add a new Interwiki, just create a file named `interwiki.yml` in your app's  
     388To add a new Interwiki, just create a file named `interwiki.yml` in your app's 
    365389folder, and add the key you want : 
    366390 
     
    378402Page names support namespaces. 
    379403 
    380 If an internal link points to a unexisting page, it's show to the user, using  
    381 different models : `internal_link_model` for links to existing pages,  
     404If an internal link points to a unexisting page, it's show to the user, using 
     405different models : `internal_link_model` for links to existing pages, 
    382406`internal_link_broken_model` for links to unexisting pages. 
    383407 
    384408==== Namespaces ==== 
    385409 
    386 Namespaces work just the same way than  
     410Namespaces work just the same way than 
    387411[http://www.splitbrain.org/projects/dokuwiki DokuWiki] 
    388412 
    389 == TODO == 
     413Not that you can "expand" namespaces by adding expanded name in app.yml's `namespaces` 
     414option. This will work with `translate_namespaces` helper. 
     415 
     416== Ideas for the future == 
    390417 
    391418 * User manual for advanced features (mainly namespaces and interwiki) 
  • plugins/nahoWikiPlugin/branches/1.2/config/app.yml

    r18496 r18506  
    1313#    routes_register:        on            # Enable embedded routing rules ? 
    1414#    wrap_class:             nahoWiki      # All pages are wrapped in a <div class="..."> tag. This is its class name. 
     15#    compress_old_revisions: on            # With this option enabled, old revisions are stored as gzip-compressed (saves space) 
    1516# 
    1617#    # Rendering for internal links, you may need to customize the *_model options if you change rendering engine 
     
    4142#      # Put here "human" names for your namespaces, example : 
    4243#      # ns: NameSpace 
     44# 
     45#    # Form names 
     46#    # You cannot change form names directly in the configure method : it would not impact the actions and forms wouldn't work anymore 
     47#    edit_form_name: wiki_edit 
     48#    diff_form_name: wiki_diff 
  • plugins/nahoWikiPlugin/branches/1.2/lib/actions/BasenahoWikiActions.php

    r18496 r18506  
    1717class BasenahoWikiActions extends sfActions 
    1818{ 
    19    
     19 
    2020  public function preExecute() 
    2121  { 
     
    2323    $this->startPage = sfConfig::get('app_nahoWikiPlugin_start_page', 'index'); 
    2424    $this->credentialsEdit = sfConfig::get('app_nahoWikiPlugin_credentials_edit', array()); 
    25   } 
    26    
    27   protected function setPage(sfWebRequest $request, $page_name = null) 
    28   { 
     25    $this->formName = null; 
     26 
     27    // Disable escaping 
     28    sfOutputEscaper::markClassesAsSafe(array( 
     29      'nahoWikiContent', 
     30      'nahoWikiPage', 
     31      'nahoWikiRevision', 
     32      'nahoWikiContentPeer', 
     33      'nahoWikiPagePeer', 
     34      'nahoWikiRevisionPeer', 
     35    )); 
     36  } 
     37 
     38  protected function setPage(sfWebRequest $request, $page_name = null, $formType = null) 
     39  { 
     40    if ($request->getMethod() == sfRequest::GET || is_null($formType)) 
     41    { 
     42      $params = $request->extractParameters(array('page', 'revision_old', 'revision_new', 'revision')); 
     43    } 
     44    else 
     45    { 
     46      $this->formName = sfConfig::get('app_nahoWikiPlugin_'.$formType.'_form_name', 'wiki_'.$formType); 
     47      $params = $request->getParameter($this->formName); 
     48    } 
     49 
    2950    // Get page from request if not given as parameter (default behaviour) 
    30     if (is_null($page_name))  
    31     { 
    32       $page_name = $request->getParameter('page', $this->startPage)
    33     } 
    34      
     51    if (is_null($page_name)) 
     52    { 
     53      $page_name = isset($params['page']) ? $params['page'] : $this->startPage
     54    } 
     55 
    3556    // Handle case insensitivity 
    3657    $page_name = strtolower($page_name); 
    37      
     58 
    3859    // Support default page if not specified in namespace 
    39     if (substr($page_name, -1) == ':')  
     60    if (substr($page_name, -1) == ':') 
    4061    { 
    4162      $page_name .= $this->startPage; 
    4263    } 
    43      
     64 
    4465    // Retrieve the page, or start a new one if cannot be found 
    4566    $this->page = nahoWikiPagePeer::retrieveByName($page_name); 
    46     if (!$this->page)  
     67    if (!$this->page) 
    4768    { 
    4869      $this->initNewPage($page_name); 
    4970    } 
    50      
     71 
    5172    // Retrieve the revision 
    5273    // Supports revision_old & revision_new, transformed into revision[old] & revision[new] 
    53     if (!is_null($request->getParameter('revision_old')) && !is_null($request->getParameter('revision_new'))) 
    54     { 
    55       $request->addRequestParameters(array('revision' => array( 
    56         'old' => $request->getParameter('revision_old'), 
    57         'new' => $request->getParameter('revision_new'), 
    58       ))); 
    59       $request->getParameterHolder()->remove('revision_old'); 
    60       $request->getParameterHolder()->remove('revision_new'); 
     74    // This trick is required because of sfRouting not recognizing [] in urls 
     75    if (isset($params['revision_old']) && isset($params['revision_new'])) 
     76    { 
     77      $params['revision'] = array('old' => $params['revision_old'], 'new' => $params['revision_new']); 
     78      // Cleans request 
     79      if (is_null($this->formName)) 
     80      { 
     81        $request->setParameter('revision', $params['revision']); 
     82      } 
     83      else 
     84      { 
     85        $request->addRequestParameters(array($this->formName => array('revision' => $params['revision']))); 
     86      } 
    6187    } 
    6288    // Can be "revision", "revision[new]", depending on how parameters are passed 
    63     $revision = $request->getParameter('revision', $this->page->getLatestRevision()); 
     89    $revision = isset($params['revision']) ? $params['revision'] : $this->page->getLatestRevision(); 
    6490    if (is_array($revision)) 
    6591    { 
     
    6793    } 
    6894    $this->revision = $this->page->getRevision($revision); 
    69     if (!$this->revision)  
     95    if (!$this->revision) 
    7096    { 
    7197      $this->initNewRevision(); 
    7298    } 
    73      
     99 
    74100    // Generate the URI parameters to keep trace of the requested page 
    75101    $this->uriParams = 'page=' . $this->page->getName(); 
    76     if ($this->revision->getRevision() != $this->page->getLatestRevision())  
     102    if ($this->revision->getRevision() != $this->page->getLatestRevision()) 
    77103    { 
    78104      $this->uriParams .= '&revision=' . $this->revision->getRevision(); 
    79105    } 
    80      
     106 
    81107    // Permissions management 
    82108    $this->canView = $this->page->canView($this->getUser()); 
    83109    $this->canEdit = $this->page->canEdit($this->getUser()); 
    84110  } 
    85    
     111 
    86112  protected function initNewRevision() 
    87113  { 
     
    89115    $this->revision->setnahoWikiPage($this->page); 
    90116    $this->revision->initUserName(); 
    91      
    92     if (!$this->page->isNew())  
     117 
     118    if (!$this->page->isNew()) 
    93119    { 
    94120      $this->revision->setRevision($this->page->getLatestRevision()+1); 
    95121    } 
    96122  } 
    97    
     123 
    98124  protected function initNewPage($page_name) 
    99125  { 
     
    102128  } 
    103129 
     130  protected function checkFormName(sfForm $form) 
     131  { 
     132    if ($form->getName() != $this->formName) 
     133    { 
     134      throw new Exception('nahoWikiPlugin configuration error - You changed form name without changing value of corresponding *_form_name option'); 
     135    } 
     136  } 
     137 
    104138  protected function forward403Unless($condition) 
    105139  { 
    106     if ($condition)  
    107     { 
    108        
     140    if ($condition) 
     141    { 
     142 
    109143      return; 
    110144    } 
    111145 
    112     if ($this->getUser()->isAuthenticated())  
     146    if ($this->getUser()->isAuthenticated()) 
    113147    { 
    114148      return $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action')); 
    115     }  
    116     else  
     149    } 
     150    else 
    117151    { 
    118152      return $this->forward(sfConfig::get('sf_login_module'), sfConfig::get('sf_login_action')); 
    119153    } 
    120154  } 
    121    
    122    
     155 
     156 
    123157  protected function updateBreadcrumbs() 
    124158  { 
    125     if (!$this->page->isNew())  
     159    if (!$this->page->isNew()) 
    126160    { 
    127161      $breadcrumbs = $this->getUser()->getAttribute('breadcrumbs', array(), 'nahoWiki'); 
    128       if (!in_array($this->page->getName(), $breadcrumbs))  
     162      if (!in_array($this->page->getName(), $breadcrumbs)) 
    129163      { 
    130164        $breadcrumbs[] = $this->page->getName(); 
    131165      } 
    132       if (count($breadcrumbs) > sfConfig::get('app_nahoWikiPlugin_max_breadcrumbs', 5))  
     166      if (count($breadcrumbs) > sfConfig::get('app_nahoWikiPlugin_max_breadcrumbs', 5)) 
    133167      { 
    134168        array_shift($breadcrumbs); 
     
    137171    } 
    138172  } 
    139    
    140    
     173 
     174 
    141175  public function executeIndex(sfWebRequest $request) 
    142176  { 
    143      
     177 
    144178    return $this->forward('nahoWiki', 'view'); 
    145179  } 
    146    
     180 
    147181  public function executeView(sfWebRequest $request) 
    148182  { 
    149183    $this->setPage($request); 
    150184    $this->forward403Unless($this->canView); 
    151      
     185 
    152186    $this->updateBreadcrumbs(); 
    153      
    154     return sfView::SUCCESS; 
    155   } 
    156    
     187 
     188    return sfView::SUCCESS; 
     189  } 
     190 
    157191  public function executeEdit(sfWebRequest $request) 
    158192  { 
    159     $this->setPage($request); 
     193    $this->setPage($request, null, 'edit'); 
    160194    $this->form = new nahoWikiEditForm($this->revision, array(), array('can-edit' => $this->canEdit)); 
    161      
     195 
    162196    // Do not reject here if not canEdit, cause it then fallbacks on "view source" feature 
    163     $this->forward403Unless($this->canView);  
    164      
     197    $this->forward403Unless($this->canView); 
     198 
    165199    // Generate the username (this is done by the Revision model) 
    166200    $tmp_revision = new nahoWikiRevision; 
    167201    $tmp_revision->initUserName(); 
    168202    $this->userName = $tmp_revision->getUserName(); 
    169      
     203 
    170204    // Save changes 
    171     if ($request->isMethod(sfRequest::POST))  
    172     { 
     205    $this->showPreview = false; 
     206    if ($request->isMethod(sfRequest::POST)) 
     207    { 
     208      // To prevent nahoWiki administrators to change form name without touching app.yml, force the behavior ! 
     209      $this->checkFormName($this->form); 
     210 
    173211      // Here we must be able to edit 
    174212      $this->forward403Unless($this->canEdit); 
    175       $this->form->bind($request->getPostParameters()); 
    176        
     213      $this->form->bind($request->getParameter($this->form->getName())); 
     214 
    177215      if ($this->form->isValid()) 
    178216      { 
    179         if ($this->form->save())  
     217        $this->showPreview = $this->form->getValue('request-preview'); 
     218        if ($this->form->save()) 
    180219        { 
    181220          $this->redirect('nahoWiki/view?page=' . $this->page->getName()); 
     
    183222      } 
    184223    } 
    185      
     224 
    186225    return sfView::SUCCESS; 
    187226  } 
     
    189228  public function executeHistory(sfWebRequest $request) 
    190229  { 
    191     $this->setPage($request); 
    192     $this->forward403Unless($this->canView); 
    193      
     230    $this->setPage($request, null, 'diff'); 
     231    $this->forward403Unless($this->canView); 
     232 
    194233    $this->form = new nahoWikiHistoryForm($this->page); 
    195      
     234 
    196235    return sfView::SUCCESS; 
    197236  } 
     
    199238  public function executeDiff(sfWebRequest $request) 
    200239  { 
    201     $this->setPage($request); // $this->revision is revision2 
    202     $this->forward403Unless($this->canView); 
    203      
     240    $this->setPage($request, null, 'diff'); // $this->revision is revision2 
     241    $this->forward403Unless($this->canView); 
     242 
    204243    $this->forward404If($this->page->isNew()); 
    205244    $this->forward404If($this->revision->isNew()); 
    206      
     245 
    207246    $this->form = new nahoWikiHistoryForm($this->page); 
    208     $this->form->bindToRequest($request); 
     247 
     248    if ($request->getMethod() == sfRequest::POST) 
     249    { 
     250      $this->form->bind($request->getParameter($this->form->getName())); 
     251      // To prevent nahoWiki administrators to change form name without touching app.yml, force the behavior ! 
     252      // Note : this has not to be done with GET method, as it must work with routing 
     253      $this->checkFormName($this->form); // Okay, it should ne be necessary as we should come from history, but still... 
     254    } 
     255    else 
     256    { 
     257      $this->form->bind($request->extractParameters($this->form->getWidgetSchema()->getPositions())); 
     258    } 
     259 
    209260    $this->forward404Unless($this->form->isValid()); 
    210      
     261 
    211262    $this->revision1 = $this->form->getRevision('old'); 
    212263    $this->forward404Unless($this->revision1); 
    213      
     264 
    214265    $this->revision2 = $this->form->getRevision('new'); 
    215266    $this->forward404Unless($this->revision2); 
    216      
    217     $this->diff = $this->form->renderDiff($request->getParameter('mode', 'inline')); 
    218      
     267 
     268    $this->diff = $this->form->renderDiff($this->form->getValue('mode')); 
     269 
    219270    // Direct download 
    220     if ($request->getParameter('raw'))  
     271    if ($request->getParameter('raw')) 
    221272    { 
    222273      $this->getResponse()->setContentType('text/plain'); 
    223274      $this->renderText($this->diff); 
    224        
     275 
    225276      return sfView::NONE; 
    226277    } 
    227      
    228     return sfView::SUCCESS; 
    229   } 
    230    
     278 
     279    return sfView::SUCCESS; 
     280  } 
     281 
    231282  public function executeUser(sfWebRequest $request) 
    232283  { 
    233284    $this->setPage($request, 'User:' . $request->getParameter('name')); 
    234285    $this->forward403Unless($this->canView); 
    235      
    236     return sfView::SUCCESS; 
    237   } 
    238    
     286 
     287    return sfView::SUCCESS; 
     288  } 
     289 
    239290  protected function buildIndexTree(&$tree, $path, $fullpath, $expanded) 
    240291  { 
    241     if (count($path) == 1)  
     292    if (count($path) == 1) 
    242293    { 
    243294      $tree[$path[0]] = $fullpath; 
    244     }  
    245     else  
     295    } 
     296    else 
    246297    { 
    247298      $category = array_shift($path) . ':'; 
    248       if (!isset($tree[$category]))  
     299      if (!isset($tree[$category])) 
    249300      { 
    250301        $tree[$category] = array(); 
    251302      } 
    252       if (count($expanded) && $category == $expanded[0] . ':')  
     303      if (count($expanded) && $category == $expanded[0] . ':') 
    253304      { 
    254305        array_shift($expanded); 
     
    257308    } 
    258309  } 
    259    
     310 
    260311  public function executeBrowse(sfWebRequest $request) 
    261312  { 
    262313    $this->setPage($request); 
    263      
     314 
    264315    $path = $request->getParameter('path'); 
    265316    $tree = array(); 
    266      
     317 
    267318    $c = new Criteria; 
    268319    $c->addAscendingOrderByColumn(nahoWikiPagePeer::NAME); 
    269320    $pages = nahoWikiPagePeer::doSelect($c); 
    270      
    271     foreach ($pages as $page)  
     321 
     322    foreach ($pages as $page) 
    272323    { 
    273324      $this->buildIndexTree($tree, explode(':', $page->getName()), $page->getName(), explode(':', $path)); 
    274325    } 
    275      
     326 
    276327    $this->tree = $tree; 
    277328    $this->uriParams = 'page=' . urlencode($request->getParameter('page')); 
    278      
    279     return sfView::SUCCESS; 
    280   } 
    281    
     329 
     330    return sfView::SUCCESS; 
     331  } 
     332 
    282333} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/actions/BasenahoWikiComponents.php

    r17862 r18506  
    44 * 
    55 * @package    symfony 
    6  * @subpackage plugin              
     6 * @subpackage plugin 
    77 * @version    SVN: $Id$ 
    88 */ 
     
    1010class BasenahoWikiComponents extends sfComponents 
    1111{ 
    12    
     12 
     13  public function preExecute() 
     14  { 
     15    // Disable escaping 
     16    sfOutputEscaper::markClassesAsSafe(array( 
     17      'nahoWikiContent', 
     18      'nahoWikiPage', 
     19      'nahoWikiRevision' 
     20    )); 
     21  } 
     22 
    1323  public function executeContent() 
    1424  { 
     
    1626      $this->hide_toc = !sfConfig::get('app_nahoWikiPlugin_include_toc', true); 
    1727    } 
    18      
     28 
    1929    $start = sfConfig::get('app_nahoWikiPlugin_start_page', 'index'); 
    2030    if (!($page_name = $this->pagename)) { 
    2131      $page_name = $start; 
    2232    } 
    23       
     33 
    2434    // Support default page if not specified in namespace 
    2535    if (substr($page_name, -1) == ':') { 
    2636      $page_name .= $start; 
    2737    } 
    28      
     38 
    2939    // Retrieve the page, or start a new one if cannot be found 
    3040    $this->page = nahoWikiPagePeer::retrieveByName($page_name); 
    31      
     41 
    3242    // Build page object 
    3343    if (!$this->page) { 
     
    4151      $this->revision = $this->page->getRevision($revision); 
    4252    } 
    43      
     53 
    4454    // Buil revision object 
    4555    if (!$this->revision) { 
     
    4757      $this->revision->setnahoWikiPage($this->page); 
    4858    } 
    49      
     59 
    5060    // Generate the URI parameters to keep trace of the requested page 
    5161    $this->uriParams = 'page=' . urlencode($this->page->getName()); 
     
    5363      $this->uriParams .= '&revision=' . urlencode($this->revision->getRevision()); 
    5464    } 
    55      
     65 
    5666    // Permissions 
    5767    $this->canView = $this->page->canView($this->getUser()); 
    5868    $this->canEdit = $this->page->canEdit($this->getUser()); 
    5969  } 
    60    
     70 
    6171} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/config/nahoWikiConfiguration.php

    r17862 r18506  
    3434    $r->prependRoute('wiki_diff_full',      new sfRoute('/wiki/diff.:mode/:page/:revision_old/:revision_new',     array('module' => 'nahoWiki', 'action' => 'diff', 'raw' => '0'))); 
    3535    $r->prependRoute('wiki_diff_raw',       new sfRoute('/wiki/diff.:mode.txt/:page/:revision_old/:revision_new', array('module' => 'nahoWiki', 'action' => 'diff', 'raw' => '1'))); 
     36     
     37    // Lucene route 
     38    $r->prependRoute('wiki_lucene',         new sfRoute('/wiki/view-result/:sf_highlight/:page', array('module' => 'nahoWiki', 'action' => 'view'))); 
    3639  } 
    3740   
  • plugins/nahoWikiPlugin/branches/1.2/lib/forms/nahoWikiEditForm.php

    r17862 r18506  
    1 <?php  
     1<?php 
    22 
    33class nahoWikiEditForm extends PluginnahoWikiEditForm 
    44{ 
    5    
     5 
     6  /** 
     7   * Default available options : 
     8   * 'form-name' => Name of the form, defines name format (default is 'wiki_edit') 
     9   * 'can-edit'  => Can the user edit the form, or just view it (default depends on user's permissions) 
     10   */ 
    611  public function configure() 
    712  { 
    8      
     13 
    914  } 
    10    
     15 
    1116} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/forms/nahoWikiHistoryForm.php

    r17862 r18506  
    33class nahoWikiHistoryForm extends PluginnahoWikiHistoryForm 
    44{ 
    5    
     5 
     6  /** 
     7   * Default available options : 
     8   * 'form-name' => Name of the form, defines name format (default is 'wiki_diff') 
     9   */ 
    610  public function configure() 
    711  { 
    8      
     12 
    913  } 
    10    
     14 
    1115} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/forms/nahoWikiRevisionsWidget.php

    r17862 r18506  
    33class nahoWikiRevisionsWidget extends sfWidgetForm 
    44{ 
    5    
     5 
    66  protected function configure($options = array(), $attributes = array()) 
    77  { 
    88    $this->addRequiredOption('page'); 
    99  } 
    10    
     10 
    1111  public function render($name, $value = null, $attributes = array(), $errors = array()) 
    1212  { 
     
    1616      throw new Exception('Option "page" must be instance of nahoWikiPage'); 
    1717    } 
    18      
     18 
    1919    sfApplicationConfiguration::getActive()->loadHelpers(array('Date', 'I18n', 'nahoWiki')); 
    20      
    21     $head = $this->renderContentTag('thead',  
    22       $this->renderContentTag('tr',  
     20 
     21    $head = $this->renderContentTag('thead', 
     22      $this->renderContentTag('tr', 
    2323        $this->renderContentTag('th', __('Compare'), array('colspan' => 2)). 
    2424        $this->renderContentTag('th', __('Revision')). 
     
    2828      ) 
    2929    ); 
    30      
     30 
    3131    $content = ''; 
    3232    foreach ($page->getRevisions() as $revision) 
     
    4242        $attrNew['checked'] = 'checked'; 
    4343      } 
    44       $content .= $this->renderContentTag('tr',  
     44      $content .= $this->renderContentTag('tr', 
    4545        $this->renderContentTag('td', $this->renderTag('input', $attrOld)). 
    4646        $this->renderContentTag('td', $this->renderTag('input', $attrNew)). 
     
    4848        $this->renderContentTag('td', format_datetime($revision->getCreatedAt('U'))). 
    4949        $this->renderContentTag('td', link_to_wiki_user(null, $revision->getUserName())). 
    50         $this->renderContentTag('td', $this->renderContentTag('em', $revision->getComment())) 
     50        $this->renderContentTag('td', $this->renderContentTag('em', sfOutputEscaper::escape(ESC_SPECIALCHARS, $revision->getComment()))) 
    5151      ); 
    5252    } 
    5353    $body = $this->renderContentTag('tbody', $content); 
    54      
     54 
    5555    return $this->renderContentTag('table', $head.$body, array('class' => 'wiki-history')); 
    5656  } 
    57    
     57 
    5858} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/forms/plugin/PluginnahoWikiEditForm.php

    r18496 r18506  
    33class PluginnahoWikiEditForm extends sfForm 
    44{ 
    5    
     5 
    66  /** 
    7    *  
     7   * 
    88   * @var nahoWikiRevision 
    99   */ 
    1010  protected $object; 
    11    
     11 
    1212  /** 
    13    *  
     13   * 
    1414   * @param $revision 
    1515   * @param $options 
     
    1919  public function __construct(nahoWikiRevision $revision, $defaults = array(), $options = array(), $CSRFSecret = null) 
    2020  { 
     21    var_dump($revision->getContent()); 
    2122    $this->object = $revision; 
    22      
     23 
    2324    parent::__construct($defaults, $options, $CSRFSecret); 
    2425  } 
    25    
     26 
    2627  /** 
    2728   * (non-PHPdoc) 
     
    3132  { 
    3233    sfApplicationConfiguration::getActive()->loadHelpers('I18N'); 
    33      
     34 
    3435    $this->setWidgets(array( 
     36      'page'            => new sfWidgetFormInputHidden(array('default' => $this->object->getnahoWikiPage()->getName())), 
     37      'revision'        => new sfWidgetFormInputHidden(array('default' => $this->object->getRevision())), 
    3538      'content'         => new sfWidgetFormTextarea(array('default' => strval($this->object->getContent())), array('rows' => 20, 'cols' => 80)), 
    3639      'comment'         => new sfWidgetFormInput(array('default' => $this->object->isNew() ? __('Creation') : $this->object->getComment()), array('size' => 80)), 
     
    3841      'request-preview' => new sfWidgetFormInput(array('type' => 'submit', 'label' => __('Preview')), array('class' => 'preview-button', 'value' => __('Preview'))), 
    3942    )); 
    40      
     43 
    4144    $this->setValidators(array( 
     45      'page'            => new sfValidatorPass(), 
     46      'revision'        => new sfValidatorPass(), 
    4247      'content'         => new sfValidatorString(array('required' => true), array('required' => __('The content cannot be left blank. Please enter some text...'))), 
    4348      'comment'         => new sfValidatorString(array('required' => true), array('required' => __('Please enter a comment describing your changes shortly.'))), 
     
    4550      'request-preview' => new sfValidatorPass(), 
    4651    )); 
    47      
    48     if (!$this->getOption('can-edit'))  
     52 
     53    if (!$this->getOption('can-edit')) 
    4954    { 
    5055      unset($this['submit'], $this['request-preview']); 
     
    5661      $this->setDefault('comment', ''); 
    5762    } 
     63 
     64    $this->widgetSchema->setNameFormat(sfConfig::get('app_nahoWikiPlugin_edit_form_name', 'wiki_edit').'[%s]'); 
    5865  } 
    59    
     66 
    6067  /** 
    61    *  
     68   * 
    6269   * @return unknown_type 
    6370   */ 
     
    6673    $revision = $this->object; 
    6774    $page = $revision->getnahoWikiPage(); 
    68      
     75 
    6976    if (!$page->isNew()) 
    7077    { 
    7178      $revision->archiveContent(); 
    72        
     79 
    7380      $revision = new nahoWikiRevision(); 
    7481      $revision->initUserName(); 
     
    7683      $page->addnahoWikiRevision($revision); 
    7784    } 
    78      
     85 
    7986    $revision->setContent($this->getValue('content')); 
    8087    $revision->setComment($this->getValue('comment')); 
    81      
    82     if (!$this->getValue('request-preview'))  
     88 
     89    if (!$this->getValue('request-preview')) 
    8390    { 
    8491      $page->setLatestRevision($revision->getRevision()); 
    8592      $page->save(); 
    86        
     93 
    8794      return true; 
    8895    } 
    89      
     96 
    9097    return false; 
    9198  } 
    92    
     99 
    93100  /** 
    94101   * Checks that the value has not changed 
    95    *  
     102   * 
    96103   * @param $value 
    97104   * @param $name 
     
    101108  { 
    102109    $objectValue = call_user_func($this->object, 'get'.ucfirst($name)); 
    103      
     110 
    104111    if (strval($value) != strval($objectValue)) 
    105112    { 
     
    107114    } 
    108115  } 
    109    
     116 
    110117} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/forms/plugin/PluginnahoWikiHistoryForm.php

    r18496 r18506  
    33class PluginnahoWikiHistoryForm extends sfForm 
    44{ 
    5    
     5 
    66  /** 
    7    *  
     7   * 
    88   * @var nahoWikiPage 
    99   */ 
    1010  protected $object; 
    11    
     11 
    1212  /** 
    13    *  
     13   * 
    1414   * @param $revision 
    1515   * @param $options 
     
    2020  { 
    2121    sfApplicationConfiguration::getActive()->loadHelpers('I18N'); 
    22      
     22 
    2323    $this->object = $page; 
    24      
     24 
    2525    parent::__construct($defaults, $options, $CSRFSecret); 
    2626  } 
    27    
     27 
    2828  /** 
    2929   * (non-PHPdoc) 
     
    3333  { 
    3434    $revisions = array('new' => $this->object->getLatestRevision(), 'old' => $this->object->getLatestRevision()-1); 
    35      
    3635    $this->setWidgets(array( 
    3736      'page'      => new sfWidgetFormInputHidden(array('default' => $this->object->getName())), 
     37      'mode'      => new sfWidgetFormInputHidden(array('default' => 'inline')), 
    3838      'revision'  => new nahoWikiRevisionsWidget(array('default' => $revisions, 'page' => $this->object, 'label' => __('History'))), 
    3939      'submit'    => new sfWidgetFormInput(array('type' => 'submit', 'label' => '&nbsp;'), array('class' => 'submit-button', 'value' => __('View changes between selected versions'))), 
    4040    )); 
    41      
     41 
    4242    $this->setValidators(array( 
    4343      'page'     => new sfValidatorPass(), 
     44      'mode'     => new sfValidatorPass(), 
    4445      'revision' => new sfValidatorPass(), 
    4546      'submit'   => new sfValidatorPass(), 
    4647    )); 
     48 
     49    $this->widgetSchema->setNameFormat(sfConfig::get('app_nahoWikiPlugin_diff_form_name', 'wiki_diff').'[%s]'); 
    4750  } 
    48    
     51 
    4952  /** 
    50    *  
     53   * 
    5154   * @var array of nahoWikiRevision 
    5255   */ 
    5356  protected $revisions = array(); 
    54    
     57 
    5558  /** 
    56    *  
     59   * 
    5760   * @return nahoWikiRevision 
    5861   */ 
     
    6467      throw new Exception('Revision "'.$type.'" is not defined'); 
    6568    } 
    66      
     69 
    6770    if (isset($this->revisions[$type])) 
    6871    { 
    6972      return $this->revisions[$type]; 
    7073    } 
    71      
     74 
    7275    // Note : we do not make a query here, we just ask to page all its revisions (cached), as the history widget will retrieve them anyway 
    7376    $page_revisions = $this->object->getRevisions(); 
     
    7982      } 
    8083    } 
    81      
     84 
    8285    throw new Exception('Revision "'.$type.'" cannot be found'); 
    8386  } 
    84    
     87 
    8588  /** 
    86    *  
     89   * 
    8790   * @var Text_Diff 
    8891   */ 
    8992  protected $diff = null; 
    90    
     93 
    9194  /** 
    92    *  
     95   * 
    9396   * @return Text_Diff 
    9497   */ 
     
    99102      return $this->diff; 
    100103    } 
    101      
     104 
    102105    $lines1 = explode("\n", $this->getRevision('old')->getContent()); 
    103106    $lines2 = explode("\n", $this->getRevision('new')->getContent()); 
    104      
     107 
    105108    return $this->diff = new Text_Diff('auto', array($lines1, $lines2)); 
    106109  } 
    107    
     110 
    108111  /** 
    109112   * Renders diff 
    110    *  
     113   * 
    111114   * @param $mode e.g. "inline", "context", or "unified" 
    112115   * @return string 
     
    115118  { 
    116119    $diff = $this->getDiff(); 
    117      
     120 
    118121    $class = 'Text_Diff_Renderer_' . $mode; 
    119122    if (!class_exists($class)) 
     
    121124      throw new Exception('Invalid diff renderer "'.$mode.'" (class "'.$class.'" not found)'); 
    122125    } 
    123      
     126 
    124127    $renderer = new $class(); 
    125      
     128 
    126129    return $renderer->render($diff); 
    127130  } 
    128    
    129   /** 
    130    * Binds the request to form, filtering extra values 
    131    *  
    132    * @param $request 
    133    */ 
    134   public function bindToRequest(sfRequest $request) 
    135   { 
    136     $this->bind($request->extractParameters($this->getWidgetSchema()->getPositions())); 
    137   } 
    138    
     131 
    139132} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/helper/nahoWikiHelper.php

    r18496 r18506  
    1111function link_to_diff($text, $page_name, $rev1, $rev2, $mode = 'inline') 
    1212{ 
    13   $url = nahoWikiPagePeer::url($page_name, null, 'diff'); 
    14    
    15   return link_to($text, $url . '&revision_old=' . $rev1 . '&revision_new=' . $rev2 . '&mode=' . $mode . '&raw=0'); 
     13  $url = nahoWikiPagePeer::url($page_name, null, 'diff', array( 
     14    'revision_old' => $rev1, 
     15    'revision_new' => $rev2, 
     16    'mode'         => $mode, 
     17    'raw'          => 0, 
     18  )); 
     19 
     20  return link_to($text, $url); 
    1621} 
    1722 
     
    2732function link_to_raw_diff($text, $page_name, $rev1, $rev2, $mode = 'unified') 
    2833{ 
    29   $url = nahoWikiPagePeer::url($page_name, null, 'diff'); 
    30    
    31   return link_to($text, $url . '&revision_old=' . $rev1 . '&revision_new=' . $rev2 . '&mode=' . $mode . '&raw=1'); 
     34  $url = nahoWikiPagePeer::url($page_name, null, 'diff', array( 
     35    'revision_old' => $rev1, 
     36    'revision_new' => $rev2, 
     37    'mode'         => $mode, 
     38    'raw'          => 1, 
     39  )); 
     40 
     41  return link_to($text, $url); 
    3242} 
    3343 
     
    4151 * @return string 
    4252 */ 
    43 function url_for_wiki($page_name, $revision = null, $absolute = false) 
    44 
    45   $url = nahoWikiPagePeer::url($page_name); 
    46   if (!is_null($revision)) { 
    47     $url .= '&revision=' . $revision; 
    48   } 
    49    
     53function url_for_wiki($page_name, $revision = null, $absolute = false, array $params = array()) 
     54
     55  if (!is_null($revision)) 
     56  { 
     57    $params['revision'] = $revision; 
     58  } 
     59 
     60  $url = nahoWikiPagePeer::url($page_name, null, 'view', $params); 
     61 
    5062  return url_for($url, $absolute); 
    5163} 
     
    6678    $options = sfToolkit::stringToArray($options); 
    6779  } 
    68    
    69   $url = nahoWikiPagePeer::url($page_name); 
    70   if (isset($options['revision']))  
    71   { 
    72     $url .= '&revision=' . $options['revision']; 
    73   } 
    74   if (is_null($text))  
     80 
     81  $params = array(); 
     82  if (isset($options['revision'])) 
     83  { 
     84    $params['revision'] = $options['revision']; 
     85  } 
     86  $url = nahoWikiPagePeer::url($page_name, null, 'view', $params); 
     87 
     88  if (is_null($text)) 
    7589  { 
    7690    $text = htmlspecialchars(nahoWikiPagePeer::getBasename($page_name)); 
    77     if (isset($options['revision']))  
     91    if (isset($options['revision'])) 
    7892    { 
    7993      $text .= ' rev. ' . $options['revision']; 
    8094    } 
    8195  } 
    82    
     96 
    8397  return link_to($text, $url, $options); 
    8498} 
     
    157171  $options['pagename'] = $page_name; 
    158172  $options['revision'] = $revision; 
    159    
     173 
    160174  include_component('nahoWiki', 'content', $options); 
    161175} 
     
    176190  $options['pagename'] = $page_name; 
    177191  $options['revision'] = $revision; 
    178    
     192 
    179193  return get_component('nahoWiki', 'content', $options); 
    180194} 
     
    193207function translate_namespaces($page_name, $new_separator = ':') { 
    194208  use_helper('I18N'); 
    195    
    196   if ($namespaces = sfConfig::get('app_nahoWikiPlugin_namespaces')) 
    197   { 
    198     $parts = explode(':', $page_name); 
    199     $page_name = array_pop($parts); // exclude page name 
    200     foreach ($parts as $ns) 
     209 
     210  $namespaces = sfConfig::get('app_nahoWikiPlugin_namespaces', array()); 
     211 
     212  $parts = explode(':', $page_name); 
     213  $page_name = array_pop($parts); // exclude page name 
     214  foreach ($parts as $ns) 
     215  { 
     216    if (isset($namespaces[$ns])) 
    201217    { 
    202       if (isset($namespaces[$ns])) 
    203       { 
    204         $ns = __($namespaces[$ns]); 
    205       } 
    206       $page_name = $ns . $new_separator . $page_name; 
     218      $ns = __($namespaces[$ns]); 
    207219    } 
    208   } 
    209    
     220    $page_name = $ns . $new_separator . $page_name; 
     221  } 
     222 
    210223  return $page_name; 
    211224} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/model/plugin/PluginnahoWikiContent.php

    r17844 r18506  
    44 * Subclass for representing a row from the 'sf_simple_wiki_content' table. 
    55 * 
    6  *  
     6 * 
    77 * 
    88 * @package plugins.nahoWikiPlugin.lib.model 
    9  */  
     9 */ 
    1010class PluginnahoWikiContent extends BasenahoWikiContent 
    1111{ 
    12    
     12 
     13  protected $gz_content_unstreamed = null; 
     14 
    1315  public function getGzContent() 
    1416  { 
    15     $v = parent::getGzContent(); 
    16      
    17     if (is_resource($v)) { 
    18       $str = ''; 
    19       while ($part = fread($v, 1024)) 
     17    if (is_null($this->gz_content_unstreamed)) 
     18    { 
     19      $v = parent::getGzContent(); 
     20 
     21      if (is_resource($v)) 
    2022      { 
    21         $str .= $part; 
     23        $str = ''; 
     24        while ($part = fread($v, 1024)) 
     25        { 
     26          $str .= $part; 
     27        } 
     28        $this->gz_content_unstreamed = $str; 
    2229      } 
    23        
    24       return $str; 
    25     } else { // it's already a stream 
    26        
    27       return strval($v); 
     30      else 
     31      { 
     32        // it's not a stream 
     33        $this->gz_content_unstreamed = strval($v); 
     34      } 
    2835    } 
     36 
     37    return $this->gz_content_unstreamed; 
    2938  } 
    30    
     39 
    3140} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/model/plugin/PluginnahoWikiPage.php

    r8377 r18506  
    168168  } 
    169169 
     170  /** 
     171   * Shortcut to get content 
     172   *  
     173   * @param $revision 
     174   * @return string 
     175   */ 
     176  public function getContent($revision = null) 
     177  { 
     178    return $this->getRevision($revision)->getContent(); 
     179  } 
     180   
    170181} 
     182 
     183// Lucene integration 
     184if (class_exists('sfLucene', true)) 
     185{ 
     186  sfLucenePropelBehavior::getInitializer()->setup('nahoWikiPage'); 
     187} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/model/plugin/PluginnahoWikiPagePeer.php

    r17862 r18506  
    44 * Subclass for performing query and update operations on the 'sf_simple_wiki_page' table. 
    55 * 
    6  *  
     6 * 
    77 * 
    88 * @package plugins.nahoWikiPlugin.lib.model 
    9  */  
     9 */ 
    1010class PluginnahoWikiPagePeer extends BasenahoWikiPagePeer 
    1111{ 
    12    
     12 
    1313  /** 
    1414   * Returns the URL to page named $page_name (from $page) 
     
    1818   * @return string 
    1919   */ 
    20   public static function url($page_name, $page = null, $action = 'view'
     20  public static function url($page_name, $page = null, $action = 'view', array $additionalParameters = array()
    2121  { 
    22     return 'nahoWiki/'.$action.'?page=' . $page_name; 
     22    $params = $additionalParameters + array('page' => $page_name); 
     23 
     24    if ($action == 'edit' || $action == 'diff') { 
     25      // Those actions are attached to corresponding forms 
     26      //$params = array(sfConfig::get('app_nahoWikiPlugin_'.$action.'_form_name', 'wiki_'.$action) => $params); 
     27    } 
     28 
     29    return 'nahoWiki/'.$action.'?'.http_build_query($params); 
    2330  } 
    24    
     31 
    2532  /** 
    2633   * Returns the PCRE mask that validates page names 
     
    3845    } 
    3946    $mask .= ']+'; 
    40      
     47 
    4148    return $mask; 
    4249  } 
    43    
     50 
    4451  /** 
    4552   * Gets basename from full pagename 
     
    5259    $ns_separator = sfConfig::get('app_nahoWikiPlugin_ns_separator', ':'); 
    5360    $parts = explode($ns_separator, $page_name); 
    54      
     61 
    5562    return array_pop($parts); 
    5663  } 
    57    
     64 
    5865  /** 
    5966   * Gets namespace from full pagename 
     
    6269   * @return string 
    6370   */ 
    64    
     71 
    6572  public static function getNamespace($page_name) 
    6673  { 
     
    6875    $parts = explode($ns_separator, $page_name); 
    6976    array_pop($parts); 
    70      
     77 
    7178    return implode($ns_separator, $parts); 
    7279  } 
    73    
     80 
    7481  /** 
    7582   * Retrieve a page from its name 
     
    7885   * @return nahoWikiPage 
    7986   */ 
    80    
     87 
    8188  public static function retrieveByName($name) 
    8289  { 
    8390    $c = new Criteria; 
    8491    $c->add(self::NAME, $name); 
    85      
     92 
    8693    return self::doSelectOne($c); 
    8794  } 
    88    
     95 
    8996  /** 
    9097   * Retrieve pages from their names 
     
    93100   * @return array 
    94101   */ 
    95    
     102 
    96103  public static function retrieveByNames($names) 
    97104  { 
    98105    $c = new Criteria; 
    99106    $c->add(self::NAME, $names, Criteria::IN); 
    100      
     107 
    101108    return self::doSelect($c); 
    102109  } 
    103    
     110 
    104111  /** 
    105112   * Retrieve a page from its name 
     
    108115   * @return nahoWikiPage 
    109116   */ 
    110    
     117 
    111118  public static function retrieveByNameJoinAll($name) 
    112119  { 
    113120    $result = self::retrieveByNamesJoinAll(array($name)); 
    114      
     121 
    115122    if (is_array($result) && count($result)) { 
    116123      return $result[0]; 
     
    119126    } 
    120127  } 
    121    
     128 
    122129  /** 
    123130   * Retrieve pages from their names 
     
    126133   * @return array 
    127134   */ 
    128    
     135 
    129136  public static function retrieveByNamesJoinAll($names) 
    130137  { 
    131138    $c = new Criteria; 
    132139    $c->add(self::NAME, $names, Criteria::IN); 
    133      
     140 
    134141    return nahoWikiRevisionPeer::doSelectJoinAll($c); 
    135142  } 
    136    
    137    
     143 
     144 
    138145} 
  • plugins/nahoWikiPlugin/branches/1.2/lib/model/plugin/PluginnahoWikiRevision.php

    r17847 r18506  
    44 * Subclass for representing a row from the 'sf_simple_wiki_revision' table. 
    55 * 
    6  *  
     6 * 
    77 * 
    88 * @package plugins.nahoWikiPlugin.lib.model 
    9  */  
     9 */ 
    1010class PluginnahoWikiRevision extends BasenahoWikiRevision 
    1111{ 
    12    
     12 
    1313  /** 
    1414  * Taken from sfIp2Country 
     
    4444    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 
    4545  } 
    46    
     46 
    4747  /** 
    4848   * Initializes username from context 
     
    5858    } 
    5959  } 
    60    
     60 
    6161  /** 
    6262   * Is current revision the latest for its page ? 
     
    6868    return $this->getRevision() == $this->getPage()->getLatestRevision(); 
    6969  } 
    70    
     70 
    7171  /** 
    7272   * Returns the attached page 
     
    7474   * @return nahoWikiPage 
    7575   */ 
    76    
     76 
    7777  public function getPage() 
    7878  { 
    7979    return $this->getnahoWikiPage(); 
    8080  } 
    81    
     81 
    8282  /** 
    8383   * Gets content 
     
    8585   * @return string 
    8686   */ 
    87    
     87 
    8888  public function getContent() 
    8989  { 
    9090    $content_storage = $this->getnahoWikiContent(); 
    91      
     91 
    9292    if (!$content_storage) { 
    9393      return null; 
    9494    } 
    95      
     95 
    9696    $uncompressed_content = $content_storage->getContent(); 
    9797    $compressed_content = $content_storage->getGzContent(); 
    98      
    99     /* Check archive state : shouldn't have to be done 
    100     if (!$this->isLatest() && $uncompressed_content) { // Old revision has uncompressed content : do archive ! 
    101       $this->archiveContent(); 
    102     } elseif ($this->isLatest() && $compressed_content) { // Latest revision has compressed content : unarchive ! 
    103       $this->unarchiveContent(); 
    104     } 
    105     */ 
    106      
    107     return $uncompressed_content ? $uncompressed_content : gzinflate($compressed_content); 
     98 
     99    return $uncompressed_content ? $uncompressed_content : ($compressed_content ? gzinflate($compressed_content) : ''); 
    108100  } 
    109    
     101 
    110102  /** 
    111103   * Gets converted content 
     
    113105   * @return string 
    114106   */ 
    115    
     107 
    116108  public function getXHTMLContent() 
    117109  { 
     
    120112    $content = nahoWikiContentPeer::doConvert($content); 
    121113    $content = nahoWikiContentPeer::postConvert($this->getPage(), $content); 
    122      
     114 
    123115    return $content; 
    124116  } 
    125    
     117 
    126118  /** 
    127119   * Defines content 
     
    129121   * @param string $content 
    130122   */ 
    131    
     123 
    132124  public function setContent($content) 
    133125  { 
     
    139131    $content_storage->setContent($content); 
    140132  } 
    141    
     133 
    142134  /** 
    143135   * Compress current content to save space 
     
    145137   * @return boolean 
    146138   */ 
    147    
     139 
    148140  public function archiveContent() 
    149141  { 
    150     $content_storage = $this->getnahoWikiContent(); 
    151      
    152     if (!$content_storage) { 
     142    if (!sfConfig::get('app_nahoWikiPlugin_compress_old_revisions', true)) 
     143    { 
    153144      return false; 
    154145    } 
    155      
     146 
     147    $content_storage = $this->getnahoWikiContent(); 
     148 
     149    if (!$content_storage) 
     150    { 
     151      return false; 
     152    } 
     153 
    156154    $uncompressed_content = $content_storage->getContent(); 
    157     if ($uncompressed_content) { 
     155    if ($uncompressed_content) 
     156    { 
    158157      $compressed_content = gzdeflate($uncompressed_content, 9); 
    159158      $content_storage->setGzContent($compressed_content); 
     
    161160      $content_storage->save(); 
    162161    } 
    163      
     162 
    164163    return true; 
    165164  } 
    166    
     165 
    167166  /** 
    168167   * Uncompress content 
     
    170169   * @return boolean 
    171170   */ 
    172    
     171 
    173172  public function unarchiveContent() 
    174173  { 
    175174    $content_storage = $this->getnahoWikiContent(); 
    176      
    177     if (!$content_storage) { 
     175 
     176    if (!$content_storage) 
     177    { 
    178178      return false; 
    179179    } 
    180      
     180 
    181181    $compressed_content = $content_storage->getGzContent(); 
    182     if ($compressed_content) { 
     182    if ($compressed_content) 
     183    { 
    183184      $uncompressed_content = gzinflate($compressed_content, 9); 
    184185      $content_storage->setGzContent(null); 
     
    186187      $content_storage->save(); 
    187188    } 
    188      
     189 
    189190    return true; 
    190191  } 
    191    
    192    
     192 
     193 
    193194} 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_breadcrumbs.php

    r18496 r18506  
    11<?php use_helper('nahoWiki') ?> 
     2 
     3<?php if ($breadcrumbs instanceof sfOutputEscaper) $breadcrumbs = $breadcrumbs->getRawValue() ?> 
    24 
    35<div class="wiki-breadcrumbs"> 
    46  <?php $first = true; foreach ($breadcrumbs as $breadcrumb): ?> 
    57    <?php if (!$first): ?><span class="wiki-breadcrumbs-separator"><?php echo $breadcrumbs_separator ?></span><?php endif ?> 
    6     <?php echo link_to_wiki(translate_namespaces($breadcrumb), $breadcrumb) ?> 
     8    <?php echo link_to_wiki(sfOutputEscaper::escape(ESC_SPECIALCHARS, translate_namespaces($breadcrumb)), $breadcrumb) ?> 
    79  <?php $first = false; endforeach ?> 
    810</div> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_content.php

    r7057 r18506  
    77  <h1 class="wiki-title"> 
    88    <?php if (@$preview): ?><em><?php echo __('Preview') ?></em> : <?php endif ?> 
    9     <?php echo $revision->getPage()->getName() ?> 
     9    <?php echo htmlspecialchars($revision->getPage()->getName()) ?> 
    1010  </h1> 
    1111<?php end_slot() ?> 
     
    1717    <p class="wiki-warning"> 
    1818      <?php echo __('There is no article here yet.') ?> 
    19       <?php echo link_to(__('Edit this page to contribute.'), 'nahoWiki/edit?' . $uriParams) ?> 
     19      <?php echo link_to(__('Edit this page to contribute.'), 'nahoWiki/edit?' . $sf_data->getRaw('uriParams')) ?> 
    2020    </p> 
    2121  <?php else: ?> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_diff.php

    r17850 r18506  
    99  <p class="wiki-diff-intro wiki-warning"><?php echo __('There is no difference between the selected revisions.') ?></p> 
    1010<?php else: ?> 
    11   <pre class="wiki-diff"><?php echo $diff ?></pre> 
     11  <pre class="wiki-diff"><?php echo $sf_data->getRaw('diff') ?></pre> 
    1212  <ul class="wiki-diff-links"> 
    1313    <li><?php echo link_to_diff(__('View reverse diff'), $page->getName(), $revision2->getRevision(), $revision1->getRevision()) ?></li> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_index.php

    r7062 r18506  
    11<ul> 
    2 <?php foreach ($tree as $name => $elements): ?> 
     2<?php foreach ($sf_data->getRaw('tree') as $name => $elements): ?> 
    33  <li> 
    44  <?php 
     5    $name = sfOutputEscaper::escape(ESC_SPECIALCHARS, $name); 
     6 
    57    if (is_array($elements)) { 
    68      $fullpath = ($base ? $base . ':' : '') . substr($name, 0, -1); 
    79      $class = 'wiki-link-category wiki-link-category-' . (count($elements) ? 'open' : 'closed'); 
    810      echo link_to($name, 'nahoWiki/browse?path=' . urlencode($fullpath) . '&' . $uriParams, 'class=' . $class); 
    9       include_partial('index', array('tree' => $elements, 'base' => $fullpath, 'uriParams' => $uriParams)); 
     11      include_partial('index', array('tree' => $elements, 'base' => $fullpath, 'uriParams' => $sf_data->getRaw('uriParams'))); 
    1012    } else { 
    1113      echo link_to_wiki($name, $elements, 'class=wiki-link-page'); 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_page.php

    r7057 r18506  
    11<?php use_helper('I18N') ?> 
    22 
    3 <?php include_partial('page_tools', array('uriParams' => $uriParams, 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
     3<?php include_partial('page_tools', array('uriParams' => $sf_data->getRaw('uriParams'), 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
    44 
    55<?php if (!$canView): ?> 
     
    1111  <?php endif ?> 
    1212 
    13   <?php include_partial('content', array('preview' => false, 'revision' => $revision, 'no_article' => $page->isNew(), 'uriParams' => $uriParams, 'hide_toc' => !sfConfig::get('app_nahoWikiPlugin_include_toc', true))) ?> 
     13  <?php include_partial('content', array('preview' => false, 'revision' => $revision, 'no_article' => $page->isNew(), 'uriParams' => $sf_data->getRaw('uriParams'), 'hide_toc' => !sfConfig::get('app_nahoWikiPlugin_include_toc', true))) ?> 
    1414 
    1515<?php endif ?> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_page_actions.php

    r7062 r18506  
    11<ul class="wiki-actions"> 
    22  <?php if ($canView): ?> 
    3     <li class="wiki-action-view<?php echo $action == 'view' ? ' active' : '' ?>"><?php  
    4       echo link_to(__('View'), 'nahoWiki/view?' . $uriParams) ?></li> 
    5     <li class="wiki-action-edit<?php echo $action == 'edit' ? ' active' : '' ?>"><?php  
    6       echo link_to(__($canEdit ? 'Edit' : 'View source'), 'nahoWiki/edit?' . $uriParams) ?></li> 
    7     <li class="wiki-action-history<?php echo $action == 'history' || $action == 'diff' ? ' active' : '' ?>"><?php  
    8       echo link_to(__('History'), 'nahoWiki/history?' . $uriParams) ?></li> 
     3    <li class="wiki-action-view<?php echo $action == 'view' ? ' active' : '' ?>"><?php 
     4      echo link_to(__('View'), 'nahoWiki/view?' . $sf_data->getRaw('uriParams')) ?></li> 
     5    <li class="wiki-action-edit<?php echo $action == 'edit' ? ' active' : '' ?>"><?php 
     6      echo link_to(__($canEdit ? 'Edit' : 'View source'), 'nahoWiki/edit?' . $sf_data->getRaw('uriParams')) ?></li> 
     7    <li class="wiki-action-history<?php echo $action == 'history' || $action == 'diff' ? ' active' : '' ?>"><?php 
     8      echo link_to(__('History'), 'nahoWiki/history?' . $sf_data->getRaw('uriParams')) ?></li> 
    99  <?php endif ?> 
    10   <li class="wiki-action-index<?php echo $action == 'browse' ? ' active' : '' ?>"><?php  
    11       echo link_to(__('Index'), 'nahoWiki/browse?' . $uriParams) ?></li> 
     10  <li class="wiki-action-index<?php echo $action == 'browse' ? ' active' : '' ?>"><?php 
     11      echo link_to(__('Index'), 'nahoWiki/browse?' . $sf_data->getRaw('uriParams')) ?></li> 
    1212</ul> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_page_edit.php

    r18496 r18506  
    1111  <?php endif ?> 
    1212 
    13   <form method="post" action="<?php echo url_for('nahoWiki/edit?' . $uriParams) ?>" name="edit_page" id="edit_page" class="wiki-form"> 
    14      
     13  <form method="post" action="<?php echo url_for('nahoWiki/edit') ?>" name="edit_page" id="edit_page" class="wiki-form"> 
     14 
    1515    <?php if ($canEdit): ?> 
    1616      <?php if (!$sf_user->isAuthenticated()): ?> 
     
    2020      <?php endif ?> 
    2121    <?php endif ?> 
    22      
     22 
    2323    <ul> 
    2424      <?php echo $form->renderUsing('list') ?> 
    2525    </ul> 
    26    
     26 
    2727  </form> 
    2828 
    29   <?php if ($sf_request->getParameter('request-preview')): ?> 
     29  <?php if ($showPreview): ?> 
    3030    <p class="wiki-warning"><?php echo __('This is a preview of how your text will look like. Remember: <strong>It is not saved yet</strong> !') ?></p> 
    31     <?php include_partial('content', array('preview' => true, 'revision' => $revision, 'uriParams' => $uriParams)) ?> 
     31    <?php include_partial('content', array('preview' => true, 'revision' => $page->getRevision(), 'uriParams' => $uriParams)) ?> 
    3232  <?php endif ?> 
    3333 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_page_history.php

    r17862 r18506  
    88 
    99<?php if (@$revision1 && @$revision2): ?> 
    10   <?php include_partial('diff', array('page' => $page, 'revision1' => $revision1, 'revision2' => $revision2, 'diff' => $diff)) ?> 
     10  <?php include_partial('diff', array('page' => $page, 'revision1' => $revision1, 'revision2' => $revision2, 'diff' => $sf_data->getRaw('diff'))) ?> 
    1111<?php endif ?> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_page_tools.php

    r7057 r18506  
    1212<?php slot('wiki_page_actions') ?> 
    1313  <?php $action = sfContext::getInstance()->getActionName() ?> 
    14   <?php include_partial('page_actions', array('action' => $action, 'uriParams' => $uriParams, 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
     14  <?php include_partial('page_actions', array('action' => $action, 'uriParams' => $sf_data->getRaw('uriParams'), 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
    1515<?php end_slot() ?> 
    1616<?php if ($include_actions_slot) include_slot('wiki_page_actions') ?> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/_toc.php

    r7057 r18506  
    22 
    33<ul class="wiki-toc-level<?php echo $i ?>"> 
    4   <?php foreach ($toc as $title): ?> 
     4  <?php foreach ($sf_data->getRaw('toc') as $title): ?> 
    55    <li class="wiki-toc-level<?php echo $i ?>"> 
    66      <?php if (@$title['title']): ?> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/browseSuccess.php

    r7057 r18506  
    22<div class="<?php echo sfConfig::get('app_nahoWikiPlugin_wrap_class', 'nahoWiki') ?>"> 
    33 
    4 <?php include_partial('page_tools', array('uriParams' => $uriParams, 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
     4<?php include_partial('page_tools', array('uriParams' => $sf_data->getRaw('uriParams'), 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
    55 
    66<h1 class="wiki-title"><?php echo __('Index by title') ?></h1> 
     
    88<div class="wiki-index"> 
    99  <p><?php echo __('All the pages of the wiki are listed here, sorted by category and name.') ?></p> 
    10   <?php include_partial('index', array('tree' => $tree, 'base' => '', 'uriParams' => $uriParams)) ?> 
     10  <?php include_partial('index', array('tree' => $sf_data->getRaw('tree'), 'base' => '', 'uriParams' => $sf_data->getRaw('uriParams'))) ?> 
    1111</div> 
    1212 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/diffSuccess.php

    r17862 r18506  
    33<?php include_partial('page_tools', array('uriParams' => 'page=' . urlencode($page->getName()), 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
    44 
    5 <?php include_partial('page_history', array('form' => $form, 'page' => $page, 'revision1' => $revision1, 'revision2' => $revision2, 'diff' => $diff, 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
     5<?php include_partial('page_history', array('form' => $form, 'page' => $page, 'revision1' => $revision1, 'revision2' => $revision2, 'diff' => $sf_data->getRaw('diff'), 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
    66 
    77</div> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/editSuccess.php

    r17844 r18506  
    11<div class="<?php echo sfConfig::get('app_nahoWikiPlugin_wrap_class', 'nahoWiki') ?>"> 
    22 
    3 <?php include_partial('page_tools', array('uriParams' => $uriParams, 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
     3<?php include_partial('page_tools', array('uriParams' => $sf_data->getRaw('uriParams'), 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
    44 
    5 <?php include_partial('page_edit', array('form' => $form, 'page' => $page, 'revision' => $revision, 'uriParams' => $uriParams, 'userName' => $userName, 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
     5<?php include_partial('page_edit', array('form' => $form, 'page' => $page, 'revision' => $revision, 'uriParams' => $sf_data->getRaw('uriParams'), 'userName' => $sf_data->getRaw('userName'), 'canView' => $canView, 'canEdit' => $canEdit, 'showPreview' => $showPreview)) ?> 
    66 
    77</div> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/userSuccess.php

    r7057 r18506  
    66<?php end_slot() ?> 
    77 
    8 <?php include_partial('page', array('page' => $page, 'revision' => $revision, 'uriParams' => $uriParams, 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
     8<?php include_partial('page', array('page' => $page, 'revision' => $revision, 'uriParams' => $sf_data->getRaw('uriParams'), 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
    99 
    1010</div> 
  • plugins/nahoWikiPlugin/branches/1.2/modules/nahoWiki/templates/viewSuccess.php

    r7057 r18506  
    11<div class="<?php echo sfConfig::get('app_nahoWikiPlugin_wrap_class', 'nahoWiki') ?>"> 
    22 
    3 <?php include_partial('page', array('page' => $page, 'revision' => $revision, 'uriParams' => $uriParams, 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
     3<?php include_partial('page', array('page' => $page, 'revision' => $revision, 'uriParams' => $sf_data->getRaw('uriParams'), 'canView' => $canView, 'canEdit' => $canEdit)) ?> 
    44 
    55</div> 
  • plugins/nahoWikiPlugin/branches/1.2/package.xml

    r17862 r18506  
    33  xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" 
    44  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    5   xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd  
     5  xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd 
    66http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> 
    77  <name>nahoWikiPlugin</name> 
     
    99  <summary>Simple Wiki system plugin.</summary> 
    1010  <description>A simple, but full-featured, Wiki system for Symfony applications. Provides following main features : 
    11    * I18n-ready (Embedded languages : en, fr). 
    12    * Full versionning of all changes. 
    13    * Pages can be contributed by anonymous or requires registered users. 
    14    * Support for InterWiki standard. 
    15    * Table of contents for each page. 
    16    * Support for page categories. 
    17    * Full index. 
    18    * External syntax engine : you can choose your engine freely (works well with sfMarkdownPlugin)</description> 
     11 
     12  * Search engine with sfLucene. 
     13  * I18n-ready (Embedded languages : en, fr). 
     14  * Full versionning of all changes. 
     15  * Pages can be contributed by anonymous or requires registered users. 
     16  * Support for InterWiki standard. 
     17  * Table of contents for each page. 
     18  * Support for page categories. 
     19  * Full index. 
     20  * External syntax engine : you can choose your engine freely (works well with sfMarkdownPlugin)</description> 
    1921  <lead> 
    2022    <name>Nicolas Chambrier (naholyr)</name> 
     
    2325    <active>yes</active> 
    2426  </lead> 
    25   <date>2009-05-02</date> 
     27  <date>2009-05-21</date> 
    2628  <version> 
    27     <release>1.2.0</release> 
    28     <api>1.2.0</api> 
     29    <release>1.2.1</release> 
     30    <api>1.2.1</api> 
    2931  </version> 
    3032  <stability> 
     
    7274        <dir name="nahoWiki"> 
    7375          <dir name="templates"> 
    74             <file role="data" name="_page_actions.php" /> 
    75             <file role="data" name="_toc.php" /> 
    76             <file role="data" name="_page_edit.php" /> 
    77             <file role="data" name="_page.php" /> 
    78             <file role="data" name="editSuccess.php" /> 
    79             <file role="data" name="_index.php" /> 
     76            <file role="data" name="_breadcrumbs.php" /> 
    8077            <file role="data" name="_content.php" /> 
    8178            <file role="data" name="_diff.php" /> 
     79            <file role="data" name="_index.php" /> 
     80            <file role="data" name="_page_actions.php" /> 
     81            <file role="data" name="_page_edit.php" /> 
     82            <file role="data" name="_page_history.php" /> 
    8283            <file role="data" name="_page_tools.php" /> 
     84            <file role="data" name="_page.php" /> 
     85            <file role="data" name="_searchResult.php" /> 
     86            <file role="data" name="_toc.php" /> 
    8387            <file role="data" name="browseSuccess.php" /> 
     88            <file role="data" name="diffSuccess.php" /> 
     89            <file role="data" name="editSuccess.php" /> 
    8490            <file role="data" name="historySuccess.php" /> 
    8591            <file role="data" name="userSuccess.php" /> 
    86             <file role="data" name="_page_history.php" /> 
    87             <file role="data" name="diffSuccess.php" /> 
    88             <file role="data" name="_breadcrumbs.php" /> 
    8992            <file role="data" name="viewSuccess.php" /> 
    9093          </dir> 
     
    194197        <file role="data" name="config_handlers.yml" /> 
    195198        <file role="data" name="interwiki.yml" /> 
     199        <file role="data" name="search.yml" /> 
    196200      </dir> 
    197201      <!-- Embedded languages files --> 
    198202      <dir name="i18n"> 
     203        <file role="data" name="messages.de.xml" /> 
    199204        <file role="data" name="messages.en.xml" /> 
    200205        <file role="data" name="messages.fr.xml" /> 
     
    227232    <release> 
    228233      <version> 
     234        <release>1.2.1</release> 
     235        <api>1.2.1</api> 
     236      </version> 
     237      <stability> 
     238        <release>stable</release> 
     239        <api>stable</api> 
     240      </stability> 
     241      <date>2009-05-21</date> 
     242      <license uri="http://www.opensource.org/licenses/mit-license.html">MIT</license> 
     243      <notes>  * naholyr : integration of sfLucene, add option to disable gzip compression. 
     244  * naholyr (thanks to Jens Schulze) : bugfixes and Deutsch translation. 
     245  * naholyr (thanks to Julien Muetton) : added a name to forms, fixed output escaping.</notes> 
     246    </release> 
     247    <release> 
     248      <version> 
    229249        <release>1.2.0</release> 
    230250        <api>1.2.0</api> 
     
    236256      <date>2009-05-02</date> 
    237257      <license uri="http://www.opensource.org/licenses/mit-license.html">MIT</license> 
    238       <notes>* naholyr : first release for Symfony 1.2, based on version 1.0.0.</notes> 
     258      <notes>  * naholyr : first release for Symfony 1.2, based on version 1.0.0.</notes> 
    239259    </release> 
    240260  </changelog> 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.