Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
fdl_forumcreate.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * FDL Forum creation
9  *
10  * @author Anakeen 2000
11  * @version $Id: fdl_forumcreate.php,v 1.2 2007/10/17 10:15:39 marc Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 include_once ("FDL/Class.Doc.php");
19 include_once ("FDL/freedom_util.php");
20 
22 {
23 
24  $docid = GetHttpVars("docid", "");
25 
26  $dbaccess = GetParam("FREEDOM_DB");
27 
28  if ($docid == "") $action->exitError(_("no document reference"));
30  if (!$doc->isAffected()) $action->exitError(sprintf(_("cannot see unknow reference %s") , $docid));
31 
32  if ($doc->Control("edit") != "" && $doc->Control("forum") != "") $action->exitError(sprintf(_("you don't have privilege to edit forum for document %s") , $doc->title));
33 
34  $doc->disableEditControl();
35 
36  $forum = createDoc($dbaccess, "FORUM");
37  $forum->setValue("forum_docid", $doc->id);
38  $forum->setProfil($doc->profid);
39  $forum->Add();
40  $forum->postModify();
41 
42  $doc->forumid = $forum->id;
43  $doc->modify(true, array(
44  "forumid"
45  ));
46 
47  redirect($action, "FDL", "FDL_CARD&sole=Y&id=" . $doc->id);
48 }
49 ?>
← centre documentaire © anakeen - published under CC License - Dynacase