Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
import_size.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  * update list of available font style
9  *
10  * analyze sub-directories presents in STYLE directory
11  * @author Anakeen 2002
12  * @version $Id: import_size.php,v 1.2 2007/02/21 11:07:12 eric Exp $
13  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
14  * @package FDL
15  * @subpackage WSH
16  */
17 /**
18  */
19 // ---------------------------------------------------------------
20 // $Id: import_size.php,v 1.2 2007/02/21 11:07:12 eric Exp $
21 // $Source: /home/cvsroot/anakeen/freedom/core/Api/import_size.php,v $
22 // ---------------------------------------------------------------
23 include_once ("Class.Style.php");
24 include_once ("Lib.Color.php");
25 
26 $name = GetHttpVars("name");
27 
28 $param = new Param();
29 
30 if (file_exists($action->GetParam("CORE_PUBDIR", DEFAULT_PUBDIR) . "/WHAT/size.php")) {
31  global $size;
32  include ("WHAT/size.php");
33  /*
34  // delete first old parameters
35  $query=new QueryDb("", "Param");
36  $query->AddQuery("type='".PARAM_STYLE.$name."'");
37  $list=$query->Query();
38  if ($query->nb> 0) {
39  while(list($k,$v)=each($list)) {
40  $v->delete();
41  }
42  }
43  */
44 
45  if (isset($size)) {
46  // compute all fonct size
47  foreach ($size as $k => $v) {
48 
49  $stylename = "SIZE_" . strtoupper($k);
50 
51  print "stylename=$stylename\n";
52  $sty = new Style("", $stylename);
53 
54  foreach ($v as $kf => $vf) {
55  $kn = "SIZE_" . strtoupper($kf);
56  if ($k == "normal") $param->Set($kn, $vf, PARAM_GLB, 1); // put in default
57  $param->Set($kn, $vf, PARAM_STYLE . $stylename, 1);
58  $action->parent->SetVolatileParam($kn, $vf); // to compose css with new paramters
59 
60  }
61 
62  if (!$sty->isAffected()) {
63  $sty->name = $stylename;
64  $sty->Add();
65  } else $sty->Modify();
66 
67  $inputlay = new Layout("WHAT/Layout/size.css", $action);
68  $out = $inputlay->gen();
69  file_put_contents($action->GetParam("CORE_PUBDIR") . "/WHAT/Layout/size-$k.css", $out);
70  }
71  }
72 }
73 ?>
← centre documentaire © anakeen - published under CC License - Dynacase