Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Class.Style.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  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: Class.Style.php,v 1.5 2003/08/18 15:46:42 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage CORE
15  */
16 /**
17  */
18 
19 include_once ('Class.DbObj.php');
20 include_once ('Class.QueryDb.php');
21 include_once ('Class.Param.php');
22 
23 class Style extends DbObj
24 {
25  var $fields = array(
26  "name",
27  "description",
28  "parsable"
29  );
30 
31  var $id_fields = array(
32  "name"
33  );
34 
35  var $sqlcreate = "
36  create table style (
37  name text not null,
38  primary key (name),
39  description text,
40  parsable char default 'N'
41  );
42  create sequence SEQ_ID_STYLE start 10000;
43 ";
44 
45  var $dbtable = "style";
46 
47  function Set(&$parent)
48  {
49  $this->parent = & $parent;
50  }
51 
52  function GetImageUrl($img, $default)
53  {
54  $root = $this->parent->Getparam("CORE_PUBDIR");
55 
56  $socStyle = $this->parent->Getparam("CORE_SOCSTYLE");
57  // first see if i have an society style
58  if (($socStyle != "") && file_exists($root . "/STYLE/" . $socStyle . "/Images/" . $img)) {
59  return ("STYLE/" . $socStyle . "/Images/" . $img);
60  }
61 
62  if (file_exists($root . "/STYLE/" . $this->name . "/Images/" . $img)) {
63  return ("STYLE/" . $this->name . "/Images/" . $img);
64  } else {
65  return ($default);
66  }
67  }
68 
69  function GetLayoutFile($layname, $default = "")
70  {
71  $root = $this->parent->Getparam("CORE_PUBDIR");
72 
73  $socStyle = $this->parent->Getparam("CORE_SOCSTYLE");
74  // first see if i have an society style
75  if ($socStyle != "") {
76  $file = $root . "/STYLE/" . $socStyle . "/Layout/" . $layname;
77  if (file_exists($file)) return ($file);
78  }
79 
80  $file = $root . "/STYLE/" . $this->name . "/Layout/" . $layname;
81  if (file_exists($file)) return ($file);
82 
83  return ($default);
84  }
85 }
86 ?>
← centre documentaire © anakeen - published under CC License - Dynacase