Subversion Repositories Applications.papyrus

Rev

Rev 556 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 556 Rev 954
Line 378... Line 378...
378
 
378
 
379
 
379
 
380
 
-
 
381
	// FORMS
-
 
382
	function FormOpen($method = "", $tag = "", $formMethod = "post") {
-
 
383
	/* Debut de la modif ACeditor */
-
 
384
	// ACEditor: id=\"ACEditor\" name=\"ACEditor\" ci-dessous le if a été ajouté (initialement, seule la ligne du else existait)
-
 
385
	// si l'url se termine par edit (expression régulière edit$), on est en mode édition et dans ce cas on donne les id et name au formulaire
-
 
386
	// Sinon surtout pas car ça marche plus dans la mesure ou plusieurs formulaires auraient ces ID et name et dans ce cas
-
 
387
	// il semble que le dernier soit considéré, c'est à dire pas le bon :o(
-
 
388
 
-
 
389
		if (ereg('edit$', $this->href($method, $tag))) {
380
 
390
			$result = "<form id=\"ACEditor\" name=\"ACEditor\" action=\"".$this->href($method, $tag)."\" method=\"".$formMethod."\">\n";
-
 
391
		} else {
-
 
392
		$result = "<form action=\"".$this->href($method, $tag)."\" method=\"".$formMethod."\">\n";
-
 
393
		}
381
	// FORMS
394
 
382
	function FormOpen($method = "", $tag = "", $formMethod = "post") {
395
/* fin de la modif ACeditor */
383
		$result = "<form action=\"".$this->href($method, $tag)."\" method=\"".$formMethod."\">\n";
396
		if (!$this->config["rewrite_mode"]) $result .= "<input type=\"hidden\" name=\"wiki\" value=\"".$this->MiniHref($method, $tag)."\" />\n";
384
		if (!$this->config["rewrite_mode"]) $result .= "<input type=\"hidden\" name=\"wiki\" value=\"".$this->MiniHref($method, $tag)."\" />\n";
397
		return $result;
385
		return $result;
Line 522... Line 510...
522
		$pages=array();
510
		$pages=array();
523
		$comments=array();
511
		$comments=array();
524
		if ($ids = $this->LoadAll("select min(id) as id from ".$this->config["table_prefix"]."pages where comment_on != '' group by tag order by id desc"))
512
		if ($ids = $this->LoadAll("select min(id) as id from ".$this->config["table_prefix"]."pages where comment_on != '' group by tag order by id desc"))
525
		{
513
		{
526
			// load complete comments
514
			// load complete comments
-
 
515
			$num=0;
527
			foreach ($ids as $id)
516
			foreach ($ids as $id)
528
			{
517
			{
529
				$comment = $this->LoadSingle("select * from ".$this->config["table_prefix"]."pages where id = '".$id["id"]."' limit 1");
518
				$comment = $this->LoadSingle("select * from ".$this->config["table_prefix"]."pages where id = '".$id["id"]."' limit 1");
530
				$num=0;
-
 
531
				if (!isset($comments[$comment["comment_on"]])) $comments[$comment["comment_on"]]='';
-
 
532
				if (!$comments[$comment["comment_on"]] && $num < $limit)
519
				if (!isset($comments[$comment["comment_on"]]) && $num < $limit)
533
				{
520
				{
534
					$comments[$comment["comment_on"]] = $comment;
521
					$comments[$comment["comment_on"]] = $comment;
535
					$num++;
522
					$num++;
536
				}
523
				}
537
			}
524
			}
Line 733... Line 720...
733
	"referrers_purge_time"	=> 24,
720
	"referrers_purge_time"	=> 24,
734
	"pages_purge_time"	=> 90,
721
	"pages_purge_time"	=> 90,
735
	"default_write_acl"	=> "*",
722
	"default_write_acl"	=> "*",
736
	"default_read_acl"	=> "*",
723
	"default_read_acl"	=> "*",
737
	"default_comment_acl"	=> "*",
724
	"default_comment_acl"	=> "*",
738
	"menu_page"	 	=> "PageMenu",
-
 
739
	"preview_before_save"	=> "0");
725
	"preview_before_save"	=> "0");
Line 740... Line 726...
740
 
726
 
741
// load config
727
// load config
742
if (!$configfile = GetEnv("WAKKA_CONFIG")) $configfile = "wakka.config.php";
728
if (!$configfile = GetEnv("WAKKA_CONFIG")) $configfile = "wakka.config.php";
Line 837... Line 823...
837
// Security (quick hack)  : Check method syntax
823
// Security (quick hack)  : Check method syntax
838
if (!(preg_match('#^[A-Za-z0-9_]*$#',$method))) {
824
if (!(preg_match('#^[A-Za-z0-9_]*$#',$method))) {
839
	$method='';
825
	$method='';
840
}
826
}
Line -... Line 827...
-
 
827
 
841
 
828
include('tools/prepend.php');
-
 
829
$wiki->Run($page, $method);
-
 
830
 
842
$wiki->Run($page, $method);
831