Core  3.2
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  * @package FDL
5 */
6 /**
7  * Export edition
8  *
9  * @author Anakeen
10  * @version $Id: editexportchoosecols.php,v 1.2 2008/11/14 12:41:43 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ("FDL/Class.Doc.php");
18 include_once ("FDL/Lib.Dir.php");
19 include_once ("GENERIC/generic_util.php");
20 
22 {
23  $dbaccess = $action->dbaccess;
24  $docid = GetHttpVars("id");
25 
26  $doc = new_doc($dbaccess, $docid);
27  if (!$doc->isAlive()) $action->exitError(sprintf(_("family %s not exists") , $docid));
28 
29  $toa = $doc->getNormalAttributes();
30  $tattr = array();
31  $pref = getFamilyParameter($action, $doc->id, "FREEDOM_EXPORTCOLS");
32  $tpref = explode(";", $pref);
33 
34  $before = false;
35  $beforetab = false;
36  foreach ($toa as $k => $oa) {
37  if ($oa->type == "array") continue;
38  $newframe = false;
39  $newtab = false;
40  $tabname = $framename = false;
41  if (($before != $oa->fieldSet->id) && ($before != $oa->fieldSet->type = 'frame')) {
42  $newframe = ($before != $oa->fieldSet->id);
43  $framename = $oa->fieldSet->getLabel();
44  }
45  if ($oa->fieldSet->fieldSet && ($oa->fieldSet->fieldSet->type == 'tab')) {
46  $newtab = ($beforetab != $oa->fieldSet->fieldSet->id);
47  $beforetab = $oa->fieldSet->fieldSet->id;
48  $tabname = $oa->fieldSet->fieldSet->getLabel();
49  }
50 
51  $tattr[] = array(
52  "attrid" => $oa->id,
53  "newframe" => $newframe,
54  "newtab" => $newtab,
55  "need" => $oa->needed,
56  "hidden" => $oa->visibility == 'H',
57  "selected" => in_array($oa->id, $tpref) ,
58  "tabname" => $tabname,
59  "framename" => $framename,
60  "attrname" => $oa->getLabel()
61  );
62  $before = $oa->fieldSet->id;
63  }
64 
65  $action->lay->setBlockData("ATTRS", $tattr);
66  $action->lay->set("famid", $doc->id);
67  $action->lay->set("famtitle", $doc->getTitle());
68  $action->lay->set("famicon", $doc->getIcon());
69 }
global $action
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
getFamilyParameter(&$action, $famid, $key, $def="")
editexportchoosecols(Action &$action)
$dbaccess
Definition: checkVault.php:17
← centre documentaire © anakeen