Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
editexportchoosecols.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  * Export edition
9  *
10  * @author Anakeen 2007
11  * @version $Id: editexportchoosecols.php,v 1.2 2008/11/14 12:41:43 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 include_once ("FDL/Class.Doc.php");
20 include_once ("FDL/Lib.Dir.php");
21 include_once ("GENERIC/generic_util.php");
22 
24 {
25  $dbaccess = $action->GetParam("FREEDOM_DB");
26  $docid = GetHttpVars("id");
27 
28  $doc = new_doc($dbaccess, $docid);
29  if (!$doc->isAlive()) $action->exitError(sprintf(_("family %s not exists") , $docid));
30 
31  $toa = $doc->getNormalAttributes();
32  $tattr = array();
33  $pref = getFamilyParameter($action, $doc->id, "FREEDOM_EXPORTCOLS");
34  $tpref = explode(";", $pref);
35 
36  $before = false;
37  $beforetab = false;
38  foreach ($toa as $k => $oa) {
39  if ($oa->type == "array") continue;
40  $newframe = false;
41  $newtab = false;
42  if (($before != $oa->fieldSet->id) && ($before != $oa->fieldSet->type = 'frame')) {
43  $newframe = ($before != $oa->fieldSet->id);
44  $framename = $oa->fieldSet->getLabel();
45  }
46  if ($oa->fieldSet->fieldSet && ($oa->fieldSet->fieldSet->type == 'tab')) {
47  $newtab = ($beforetab != $oa->fieldSet->fieldSet->id);
48  $beforetab = $oa->fieldSet->fieldSet->id;
49  $tabname = $oa->fieldSet->fieldSet->getLabel();
50  }
51 
52  $tattr[] = array(
53  "attrid" => $oa->id,
54  "newframe" => $newframe,
55  "newtab" => $newtab,
56  "need" => $oa->needed,
57  "hidden" => $oa->visibility == 'H',
58  "selected" => in_array($oa->id, $tpref) ,
59  "tabname" => $tabname,
60  "framename" => $framename,
61  "attrname" => $oa->getLabel()
62  );
63  $before = $oa->fieldSet->id;
64  }
65 
66  $action->lay->setBlockData("ATTRS", $tattr);
67  $action->lay->set("famid", $doc->id);
68  $action->lay->set("famtitle", $doc->getTitle());
69  $action->lay->set("famicon", $doc->getIcon());
70 }
71 ?>
← centre documentaire © anakeen - published under CC License - Dynacase