Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
folioparams.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  *
9  *
10  * @author Anakeen 2003
11  * @version $Id: foliolist.php,v 1.16 2007/10/19 15:20:14 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 include_once ('FREEDOM/freedom_view.php');
19 include_once ('FREEDOM/Lib.portfolio.php');
20 /**
21  *
22  * @param Action &$action current action
23  * @global dirid Http var : separator identificator to see
24  * @global folioid Http var : portfolio of separator
25  */
26 function folioparams(&$action)
27 {
28 
29  $docid = GetHttpVars("id", 0); // document to edit
30  $dbaccess = $action->GetParam("FREEDOM_DB");
31 
32  $folio = new_Doc($dbaccess, $docid);
33 
34  if (!$folio->isAffected()) {
35  $action->exitError(sprintf(_("document %s not exists") , $docid));
36  } else {
37 
38  $dir = new_Doc($dbaccess, $folio->initid);
39  $pfctx = portfolio_get_context($dir);
40 
41  $var = GetHttpVars("viewstate", -1);
42  if (is_numeric($var) && $var >= 0 && $var <= 4) {
43  $pfctx['viewstate'] = $var;
44  }
45 
46  $var = GetHttpVars("framelist", '');
47  if (!empty($var) && preg_match('/^([0-9]+),([0-9]+)$/i', $var, $matches)) {
48  $pfctx['framelist'] = array(
49  'dirid' => $matches[1],
50  'folioid' => $matches[2],
51  );
52  }
53 
54  foreach (array(
55  'tabselected',
56  'frame1',
57  'frame2',
58  'framelistwidth'
59  ) as $param) {
60  $var = GetHttpVars($param, '');
61  if (!empty($var) && is_numeric($var)) {
62  //error_log("SET $param => $var");
63  if ($pfctx['viewstate'] == 0 && in_array($param, array(
64  'frame1',
65  'frame2'
66  ))) {
67  $pfctx['frame1'] = $var;
68  $pfctx['frame2'] = $var;
69  } else {
70  $pfctx[$param] = $var;
71  }
72  }
73  }
74  //foreach(explode("\n", print_r($pfctx, true)) as $tmp ) {error_log($tmp);}
75  portfolio_set_context($dir, $pfctx);
76  }
77 }
78 ?>
← centre documentaire © anakeen - published under CC License - Dynacase