Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Lib.portfolio.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  * Return portfolio context
9  * @param Doc $doc
10  * @return array
11  */
13 {
14 
15  $pfctx = $doc->getUTag("PORTFOLIOCTX");
16  if (!empty($pfctx) && !empty($pfctx->comment)) {
17  try {
18  $pfctx = unserialize($pfctx->comment);
19  }
20  catch(Exception $e) {
21  $pfctx = array();
22  }
23  }
24  if (empty($pfctx) || !is_array($pfctx)) {
25  $pfctx = array(
26  'listtype' => $doc->getParamValue('pfl_liststyle') ,
27  );
28  if (empty($pfctx['listtype'])) {
29  $pfctx['listtype'] = 'icon';
30  }
31  }
32  if (isset($_REQUEST['foliolisttype'])) {
33  $pfctx['listtype'] = $_REQUEST['foliolisttype'];
34  portfolio_set_context($doc, $pfctx);
35  }
36  //foreach(explode("\n", print_r($pfctx, true)) as $tmp){error_log($tmp);}
37  return $pfctx;
38 }
39 /**
40  * Set portfolio context
41  * @param Doc $doc
42  * @param array context
43  */
45 {
46 
47  $doc->addUTag($doc->userid, "PORTFOLIOCTX", serialize($context));
48 }
49 ?>
← centre documentaire © anakeen - published under CC License - Dynacase