Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
onefam_root.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: onefam_root.php,v 1.9 2008/04/18 09:47:38 eric 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 ("GENERIC/generic_util.php");
20 {
21  // -----------------------------------
22  $mode = $action->getArgument("mode");
23  if (!$mode) $mode = $action->getParam("ONEFAM_DISPLAYMODE");
24  if ($mode == "extjs") {
25  include_once ("ONEFAM/onefam_ext.php");
26  $action->lay = new Layout(getLayoutFile("ONEFAM", "onefam_ext.xml") , $action);
27  onefam_ext($action);
28  } elseif (strtok($mode, ' ') == "ng") {
29  include_once ("ONEFAM/onefam_ng.php");
30  $action->lay = new Layout(getLayoutFile("ONEFAM", "onefam_ng.xml") , $action);
31  onefam_ng($action);
32  } else {
33  $action->lay->set("APP_TITLE", _($action->parent->description));
34 
35  $nbcol = intval($action->getParam("ONEFAM_LWIDTH", 1));
36 
37  $delta = 0;
38  if ($action->read("navigator") == "EXPLORER") $delta = 10;
39 
40  $iz = $action->getParam("CORE_ICONSIZE");
41 
42  $dbaccess = $action->GetParam("FREEDOM_DB");
43 
44  $izpx = intval($action->getParam("SIZE_IMG-SMALL")) + 2;
45  $action->lay->set("wcols", $izpx * $nbcol + $delta);
46  $action->lay->set("Title", _($action->parent->short_name));
47 
48  $openfam = $action->getParam("ONEFAM_FAMOPEN");
49  if (($openfam != "") && (!is_numeric($openfam))) $openfam = getFamIdFromName($dbaccess, $openfam);
50  if ($openfam > 0) {
51  $action->lay->set("OPENFAM", true);
52  $action->lay->set("openfam", $openfam);
53  } else {
54  $action->lay->set("OPENFAM", false);
55  }
56 
57  $action->parent->AddCssRef("ONEFAM:onefam.css", true);
58  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
59  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/resizeimg.js");
60 
61  $action->lay->Set("oneBgColor", (($action->getParam("ONEFAM_BGCOLOR") != 'inherit') && ($action->getParam("ONEFAM_BGCOLOR") != '')));
62 
63  $action->lay->SetBlockData("SELECTMASTER", getTableFamilyList($action->GetParam("ONEFAM_MIDS") , $izpx));
64 
65  if (($action->GetParam("ONEFAM_IDS") != "") && ($action->GetParam("ONEFAM_MIDS") != "")) {
66  $action->lay->SetBlockData("SEPARATOR", array(
67  array(
68  "zou"
69  )
70  ));
71  }
72 
73  if ($action->HasPermission("ONEFAM")) {
74  $action->lay->SetBlockData("CHOOSEUSERFAMILIES", array(
75  array(
76  "zou"
77  )
78  ));
79  $action->lay->SetBlockData("SELECTUSER", getTableFamilyList($action->GetParam("ONEFAM_IDS") , $izpx));
80  }
81  if ($action->HasPermission("ONEFAM_MASTER")) {
82  $action->lay->SetBlockData("CHOOSEMASTERFAMILIES", array(
83  array(
84  "zou"
85  )
86  ));
87  }
88  $iz = $action->getParam("CORE_ICONSIZE");
89  $izpx = intval($action->getParam("SIZE_IMG-SMALL"));
90 
91  $action->lay->set("izpx", $izpx);
92  }
93 }
94 function getTableFamilyList($idsfam, $izpx = null)
95 {
96  $selectclass = array();
97  if ($idsfam != "") {
98  $tidsfam = explode(",", $idsfam);
99 
100  $dbaccess = GetParam("FREEDOM_DB");
101 
102  foreach ($tidsfam as $k => $cid) {
103  $cdoc = new_Doc($dbaccess, $cid);
104  if ($cdoc->dfldid > 0) {
105 
106  if ($cdoc->control('view') == "") {
107  $selectclass[$k]["idcdoc"] = $cdoc->initid;
108  $selectclass[$k]["ftitle"] = $cdoc->title;
109  $selectclass[$k]["iconsrc"] = $cdoc->getIcon('', $izpx);
110  }
111  }
112  }
113  }
114  return $selectclass;
115 }
116 ?>
← centre documentaire © anakeen - published under CC License - Dynacase