Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
openfolio.php
Go to the documentation of this file.
1 <?php
2 /*
3  * Open port folio document
4  * @author Anakeen
5  * @package FDL
6 */
7 /**
8  */
9 include_once ("FDL/Class.Doc.php");
10 include_once ('FREEDOM/Lib.portfolio.php');
11 // -----------------------------------
12 // -----------------------------------
14 {
15  // -----------------------------------
16  // Set the globals elements
17  $docid = GetHttpVars("id", 0); // document to edit
18  $dbaccess = $action->dbaccess;
19 
20  $folio = new_Doc($dbaccess, $docid);
21 
22  if (!$folio->isAffected()) {
23  $action->exitError(sprintf(_("document %s not exists") , $docid));
24  }
25  $action->lay->rSet("docid", (int)$folio->id);
26  $action->lay->eSet("title", $folio->getTitle());
27 
28  $dir = new_Doc($dbaccess, $folio->initid);
29  $savedTab = $dir->getFamilyParameterValue('pfl_savetab');
30  $savedDispo = $dir->getFamilyParameterValue('pfl_savedispo', 1);
31  $pfctx = portfolio_get_context($dir);
32 
33  $action->lay->eSet("FRAMELISTWIDTH", '180');
34  $action->lay->rSet("VIEWSTATE", json_encode(2));
35  $action->lay->rSet("TABSELECTED", json_encode(''));
36  $action->lay->eSet("FRAME1", '&app=FDL&action=FDL_CARD&latest=Y&id=' . $folio->initid);
37  $action->lay->eSet("FRAME2", '&app=FREEDOM&action=FREEDOM_LOGO');
38  $action->lay->eSet("FRAMELIST", '&app=FREEDOM&action=FOLIOLIST&dirid=' . $folio->initid);
39 
40  if ($savedTab) {
41  if (isset($pfctx['tabselected'])) {
42  $action->lay->rSet("TABSELECTED", json_encode($pfctx['tabselected']));
43  }
44  if (isset($pfctx['framelist'])) {
45  $action->lay->eSet("FRAMELIST", '&app=FREEDOM&action=FOLIOLIST&dirid=' . urlencode($pfctx['framelist']['dirid']) . '&folioid=' . urlencode($pfctx['framelist']['folioid']));
46  }
47  }
48 
49  if ($savedDispo) {
50  if (isset($pfctx['framelistwidth'])) {
51  $action->lay->eSet("FRAMELISTWIDTH", $pfctx['framelistwidth']);
52  }
53 
54  if (isset($pfctx['viewstate'])) {
55  $action->lay->rSet("VIEWSTATE", json_encode($pfctx['viewstate']));
56  }
57  if (isset($pfctx['frame1'])) {
58  $doc1 = new_Doc($dbaccess, $pfctx['frame1']);
59  if ($doc1->isAlive()) {
60  $action->lay->eSet("FRAME1", '&app=FDL&action=FDL_CARD&latest=Y&id=' . urlencode($pfctx['frame1']));
61  }
62  }
63  if (isset($pfctx['frame2'])) {
64  $doc2 = new_Doc($dbaccess, $pfctx['frame2']);
65  if ($doc2->isAlive()) {
66  $action->lay->eSet("FRAME2", '&app=FDL&action=FDL_CARD&latest=Y&id=' . urlencode($pfctx['frame2']));
67  }
68  }
69  }
70 }
global $action
openfolio(Action &$action)
Definition: openfolio.php:13
portfolio_get_context($doc)
exitError($texterr, $exit=true, $code="")
$docid
Definition: cleanFamily.php:13
new_Doc($dbaccess, $id= '', $latest=false)
$dir
Definition: resizeimg.php:144
$dbaccess
Definition: checkVault.php:17
← centre documentaire © anakeen