Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
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
Layout is a template generator.
Definition:
Class.Layout.php:69
Param
Definition:
Class.Param.php:29
$size
$size
Definition:
resizeimg.php:110
$action
global $action
Definition:
import_size.php:21
DEFAULT_PUBDIR
const DEFAULT_PUBDIR
Definition:
Lib.Prefix.php:28
$out
$out
Definition:
Api/freedom_import.php:37
$usage
$usage
Definition:
import_size.php:25
Style
Definition:
Class.Style.php:16
Param\PARAM_STYLE
const PARAM_STYLE
Definition:
Class.Param.php:35
print
print
Definition:
checklist.php:49
Param\PARAM_GLB
const PARAM_GLB
Definition:
Class.Param.php:33
$vf
$vf
Definition:
geticon.php:28
$param
$param
Definition:
import_size.php:31
ApiUsage
Verify arguments for wsh programs.
Definition:
Class.ApiUsage.php:28
← centre documentaire
© anakeen