Core  3.2
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  * @package FDL
5 */
6 /**
7  * update list of available font style
8  *
9  * analyze sub-directories presents in STYLE directory
10  * @author Anakeen
11  * @version $Id: import_size.php,v 1.2 2007/02/21 11:07:12 eric Exp $
12  * @package FDL
13  * @subpackage WSH
14  */
15 /**
16  */
17 // ---------------------------------------------------------------
18 // $Id: import_size.php,v 1.2 2007/02/21 11:07:12 eric Exp $
19 // $Source: /home/cvsroot/anakeen/freedom/core/Api/import_size.php,v $
20 // ---------------------------------------------------------------
21 include_once ("Class.Style.php");
22 include_once ("Lib.Color.php");
23 global $action;
24 
25 $usage = new ApiUsage();
26 
27 $usage->setDefinitionText("update list of available font style");
28 
29 $usage->verify();
30 
31 $param = new Param();
32 
33 if (file_exists(DEFAULT_PUBDIR . "/WHAT/size.php")) {
34  global $size;
35  include ("WHAT/size.php");
36  /*
37  // delete first old parameters
38  $query=new QueryDb("", "Param");
39  $query->AddQuery("type='".PARAM_STYLE.$name."'");
40  $list=$query->Query();
41  if ($query->nb> 0) {
42  foreach($list as $k => $v) {
43  $v->delete();
44  }
45  }
46  */
47 
48  if (isset($size)) {
49  // compute all fonct size
50  foreach ($size as $k => $v) {
51 
52  $stylename = "SIZE_" . strtoupper($k);
53 
54  print "stylename=$stylename\n";
55  $sty = new Style("", $stylename);
56 
57  foreach ($v as $kf => $vf) {
58  $kn = "SIZE_" . strtoupper($kf);
59  if ($k == "normal") $param->Set($kn, $vf, Param::PARAM_GLB, 1); // put in default
60  $param->Set($kn, $vf, Param::PARAM_STYLE . $stylename, 1);
61  $action->parent->SetVolatileParam($kn, $vf); // to compose css with new paramters
62 
63  }
64 
65  if (!$sty->isAffected()) {
66  $sty->name = $stylename;
67  $sty->Add();
68  } else $sty->Modify();
69 
70  $inputlay = new Layout("WHAT/Layout/size.css", $action);
71  $out = $inputlay->gen();
72  file_put_contents(DEFAULT_PUBDIR . "/WHAT/Layout/size-$k.css", $out);
73  }
74  }
75 }
Layout is a template generator.
$size
Definition: resizeimg.php:110
global $action
Definition: import_size.php:21
const DEFAULT_PUBDIR
Definition: Lib.Prefix.php:28
$usage
Definition: import_size.php:25
const PARAM_STYLE
Definition: Class.Param.php:35
print
Definition: checklist.php:49
const PARAM_GLB
Definition: Class.Param.php:33
$vf
Definition: geticon.php:28
$param
Definition: import_size.php:31
Verify arguments for wsh programs.
← centre documentaire © anakeen