Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
onefam_list.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  * list available families
9  *
10  * @author Anakeen 2003
11  * @version $Id: onefam_list.php,v 1.13 2007/01/03 19:38:59 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 
19 include_once ("FDL/Class.Doc.php");
20 include_once ("FDL/Lib.Dir.php");
21 
22 function onefam_list(&$action)
23 {
24  $action->lay->set("APP_TITLE", _($action->parent->description));
25 
26  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/subwindow.js");
27  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/resizeimg.js");
28 
29  $action->lay->SetBlockData("SELECTMASTER", getTableFamilyList($action->GetParam("ONEFAM_MIDS")));
30 
31  if (($action->GetParam("ONEFAM_IDS") != "") && ($action->GetParam("ONEFAM_MIDS") != "")) {
32  $action->lay->SetBlockData("SEPARATOR", array(
33  array(
34  "zou"
35  )
36  ));
37  }
38 
39  if ($action->HasPermission("ONEFAM")) {
40  $action->lay->SetBlockData("CHOOSEUSERFAMILIES", array(
41  array(
42  "zou"
43  )
44  ));
45  $action->lay->SetBlockData("SELECTUSER", getTableFamilyList($action->GetParam("ONEFAM_IDS")));
46  }
47  if ($action->HasPermission("ONEFAM_MASTER")) {
48  $action->lay->SetBlockData("CHOOSEMASTERFAMILIES", array(
49  array(
50  "zou"
51  )
52  ));
53  }
54  $iz = $action->getParam("CORE_ICONSIZE");
55  $izpx = intval($action->getParam("SIZE_IMG-SMALL"));
56 
57  $action->lay->set("izpx", $izpx);
58 }
59 
60 function getTableFamilyList($idsfam)
61 {
62  $selectclass = array();
63  if ($idsfam != "") {
64  $tidsfam = explode(",", $idsfam);
65 
66  $dbaccess = GetParam("FREEDOM_DB");
67 
68  foreach ($tidsfam as $k => $cid) {
69  $cdoc = new_Doc($dbaccess, $cid);
70  if ($cdoc->dfldid > 0) {
71  if ($cdoc->control('view') == "") {
72  $selectclass[$k]["idcdoc"] = $cdoc->initid;
73  $selectclass[$k]["ftitle"] = $cdoc->title;
74  $selectclass[$k]["iconsrc"] = $cdoc->getIcon();
75  }
76  }
77  }
78  }
79  return $selectclass;
80 }
81 ?>
← centre documentaire © anakeen - published under CC License - Dynacase