Subversion Repositories Applications.wikini

Rev

Rev 46 | Rev 58 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 46 Rev 49
Line 18... Line 18...
18
	private $pageNom = null;
18
	private $pageNom = null;
19
	private $section = null;
19
	private $section = null;
20
	private $creerPage = false;
20
	private $creerPage = false;
21
	private $templateDefaut = null;
21
	private $templateDefaut = null;
Line 22... Line 22...
22
 
22
	
23
	private $retour = null;
23
	private $retour = 'txt';
24
	private $formats_retour = array('text/plain','text/html');
24
	private $formats_retour = array('text/plain','text/html');
Line 25... Line 25...
25
	private $format_texte;
25
	private $format_texte;
26
 
26
	
Line 119... Line 119...
119
		$wiki = $this->wiki;
119
		$wiki = $this->wiki;
120
		$this->wiki->setPageCourante($this->pageNom);
120
		$this->wiki->setPageCourante($this->pageNom);
121
		$page = $this->wiki->LoadPage($page);
121
		$page = $this->wiki->LoadPage($page);
Line 122... Line 122...
122
 
122
				
-
 
123
		if ($page != null) {
123
		if ($page != null) {
124
			// attention les wikis sont souvent en ISO !
124
			$page["body"] = $this->convertirTexteWikiVersEncodageAppli($page['body']);
125
			$page["body"] = $this->convertirTexteWikiVersEncodageAppli($page['body']);
-
 
126
			if($section != null) {
-
 
127
				$sections_tab = explode(',', $section);
-
 
128
				if(count($sections_tab) > 1) {
-
 
129
					foreach($sections_tab as $section_t) {
-
 
130
						$page["sections"][$section_t] = $this->decouperPageSection($page["body"], $section_t);
-
 
131
					}
125
			if($section != null) {
132
				} else {
126
				$page["body"] = $this->decouperPageSection($page["body"], $section);
133
					$page["body"] = $this->decouperPageSection($page["body"], $section);
-
 
134
				}
-
 
135
				
127
			}
136
			}
Line 128... Line 137...
128
		}
137
		}
129
 
138
	
Line 196... Line 205...
196
		$texte = '';
205
		$texte = '';
Line 197... Line 206...
197
 
206
		
198
		switch ($this->retour) {
207
		switch ($this->retour) {
199
			case self::MIME_HTML:
208
			case self::MIME_HTML:
-
 
209
				$texte = $this->wiki->Format($page["body"], "wakka");
-
 
210
				if(!empty($page["sections"])) {
-
 
211
					foreach($page["sections"] as &$page_section) {
-
 
212
						$page_section = $this->wiki->Format($page_section, "wakka");
-
 
213
					}
200
				$texte = $this->wiki->Format($page["body"], "wakka");
214
				}
201
				$mime = self::MIME_HTML;
215
				$mime = self::MIME_HTML;
202
				break;
216
				break;
203
			default:
217
			default:
204
				$texte = $page["body"];
218
				$texte = $page["body"];
Line 209... Line 223...
209
 
223
		
210
		$retour = array('id' => $this->pageNom,
224
		$retour = array('id' => $this->pageNom,
211
				'titre' => $this->pageNom,
225
				'titre' => $this->pageNom,
212
				'mime' => $mime,
226
				'mime' => $mime,
-
 
227
				'texte' => $texte,
213
				'texte' => $texte,
228
				'sections' => $page["sections"],
Line 214... Line 229...
214
				'href' => $url);
229
				'href' => $url);
215
 
230