Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
onefam_editpref.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  * Edit preferences for onefam list
9  *
10  * @author Anakeen 2000
11  * @version $Id: onefam_editpref.php,v 1.11 2008/08/11 16:29:44 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_editpref(&$action, $idsattr = "ONEFAM_IDS", $modaction = "ONEFAM_MODPREF")
23 {
24  $dbaccess = $action->GetParam("FREEDOM_DB");
25 
26  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/geometry.js");
27  $action->parent->AddJsRef($action->GetParam("CORE_JSURL") . "/resizeimg.js");
28  $action->parent->AddJsRef($action->GetParam("CORE_PUBURL") . "/FDL/Layout/common.js");
29 
30  $tcdoc = GetClassesDoc($dbaccess, $action->user->id, 0, "TABLE");
31 
32  $idsfam = $action->GetParam($idsattr);
33  $tidsfam = explode(",", $idsfam);
34  foreach ($tidsfam as $k => $v) {
35  if (!is_numeric($v)) $tidsfam[$k] = getFamIdFromName($dbaccess, $v);
36  }
37 
38  $openfam = $action->getParam("ONEFAM_FAMOPEN");
39  $action->lay->set("openfirst", $openfam);
41 
42  $selectclass = array();
43  if (is_array($tcdoc)) {
44  while (list($k, $pdoc) = each($tcdoc)) {
45  if ($pdoc["dfldid"] > 0) {
46  $selectclass[$k]["cid"] = $pdoc["id"];
47  $selectclass[$k]["ctitle"] = $pdoc["title"];
48  $selectclass[$k]["iconsrc"] = $doc->getIcon($pdoc["icon"]);
49  $selectclass[$k]["selected"] = (in_array($pdoc["id"], $tidsfam)) ? "checked" : "";
50  }
51  }
52  }
53 
54  $action->lay->SetBlockData("SELECTPREF", $selectclass);
55  $action->lay->Set("modaction", $modaction);
56 }
57 
59 {
60  onefam_editpref($action, "ONEFAM_MIDS", "ONEFAM_MODMASTERPREF");
61 }
62 ?>
← centre documentaire © anakeen - published under CC License - Dynacase