Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
editdfld.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  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: editdfld.php,v 1.8 2008/11/27 14:18:33 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage GED
15  */
16 /**
17  */
18 // ---------------------------------------------------------------
19 // $Id: editdfld.php,v 1.8 2008/11/27 14:18:33 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/freedom/Action/Freedom/editdfld.php,v $
21 // ---------------------------------------------------------------
22 include_once ("FDL/Lib.Dir.php");
23 
24 function editdfld(&$action)
25 {
26  $dbaccess = $action->GetParam("FREEDOM_DB");
27  $docid = GetHttpVars("id", 0);
28  $firstfld = (GetHttpVars("current", "N") == "Y");
29 
30  $action->lay->Set("docid", $docid);
31 
32  $action->lay->Set("TITLE", _("change root folder"));
33 
35 
36  $action->lay->Set("doctitle", $doc->title);
37  $sqlfilters = array();
38  if ($firstfld) {
39  $fldid = $doc->cfldid;
40  $action->lay->Set("TITLE", _("Change default search"));
41  $action->lay->Set("current", "Y");
42 
43  $tclassdoc = getChildDoc($dbaccess, $doc->dfldid, "0", "ALL", $sqlfilters, $action->user->id, "TABLE", 5);
44  //$tclassdoc = array_merge($tclassdoc,getChildDoc($dbaccess,$doc->dfldid,"0","ALL",$sqlfilters, $action->user->id, "TABLE",2));
45 
46  } else {
47  $fldid = $doc->dfldid;
48  $action->lay->Set("TITLE", _("change root folder"));
49  $action->lay->Set("current", "N");
50  $sqlfilters[] = "doctype='D'";
51  $tclassdoc = getChildDoc($dbaccess, 0, "0", "ALL", $sqlfilters, $action->user->id, "TABLE", 2);
52  }
53 
54  $selectclass = array();
55  if (is_array($tclassdoc)) {
56  while (list($k, $pdoc) = each($tclassdoc)) {
57 
58  $selectclass[$k]["idpdoc"] = $pdoc["id"];
59  $selectclass[$k]["profname"] = $pdoc["title"];
60 
61  $selectclass[$k]["selected"] = ($pdoc["id"] == $fldid) ? "selected" : "";
62  }
63  }
64 
65  $action->lay->Set("autodisabled", $firstfld || ($fldid > 0) ? "disabled" : "");
66  $action->lay->Set("ROOTFOLDER", (!$firstfld));
67 
68  $action->lay->SetBlockData("SELECTFLD", $selectclass);
69 }
70 ?>
← centre documentaire © anakeen - published under CC License - Dynacase