Core  3.2
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  * @package FDL
5 */
6 /**
7  *
8  *
9  * @author Anakeen
10  * @version $Id: foliolist.php,v 1.16 2007/10/19 15:20:14 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 include_once ('FREEDOM/freedom_view.php');
17 include_once ('FREEDOM/Lib.portfolio.php');
18 /**
19  *
20  * @param Action &$action current action
21  * @global dirid int Http var : separator identifier to see
22  * @global folioid int Http var : portfolio of separator
23  */
25 {
26 
27  $docid = GetHttpVars("id", 0); // document to edit
28  $dbaccess = $action->dbaccess;
29 
30  $folio = new_Doc($dbaccess, $docid);
31 
32  if (!$folio->isAffected()) {
33  $action->exitError(sprintf(_("document %s not exists") , $docid));
34  } else {
35 
36  $dir = new_Doc($dbaccess, $folio->initid);
37  $pfctx = portfolio_get_context($dir);
38 
39  $var = GetHttpVars("viewstate", -1);
40  if (is_numeric($var) && $var >= 0 && $var <= 4) {
41  $pfctx['viewstate'] = $var;
42  }
43 
44  $var = GetHttpVars("framelist", '');
45  if (!empty($var) && preg_match('/^([0-9]+),([0-9]+)$/i', $var, $matches)) {
46  $pfctx['framelist'] = array(
47  'dirid' => $matches[1],
48  'folioid' => $matches[2],
49  );
50  }
51 
52  foreach (array(
53  'tabselected',
54  'frame1',
55  'frame2',
56  'framelistwidth'
57  ) as $param) {
58  $var = GetHttpVars($param, '');
59  if (!empty($var) && is_numeric($var)) {
60  //error_log("SET $param => $var");
61  if ($pfctx['viewstate'] == 0 && in_array($param, array(
62  'frame1',
63  'frame2'
64  ))) {
65  $pfctx['frame1'] = $var;
66  $pfctx['frame2'] = $var;
67  } else {
68  $pfctx[$param] = $var;
69  }
70  }
71  }
72  //foreach(explode("\n", print_r($pfctx, true)) as $tmp ) {error_log($tmp);}
73  portfolio_set_context($dir, $pfctx);
74  }
75 }
global $action
portfolio_get_context($doc)
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
portfolio_set_context($doc, $context)
new_Doc($dbaccess, $id= '', $latest=false)
$dir
Definition: resizeimg.php:144
folioparams(Action &$action)
Definition: folioparams.php:24
$dbaccess
Definition: checkVault.php:17
$param
Definition: import_size.php:31
← centre documentaire © anakeen