CMS  Version 3.9
svg_manager.inc
Go to the documentation of this file.
1 <?php
14 {
15  function SvgManager()
16  {
17 
18  }
19 
20  static function setDefaults()
21  {
22  Settings::setDefaultValue("svg", "svg_directory", "/templates/svg/", String, "The directory that contains your SVG assets");
23  }
24 
25  static function substituteTags($content)
26  {
27  global $config;
28  preg_match_all("/\\[svg:(.*?)\\]/", $content, $matches, PREG_PATTERN_ORDER);
29  $dir = Settings::getValue("svg", "svg_directory");
30 
31  foreach($matches[1] as $file)
32  {
33  $c = file_get_contents($config['homedir'] . $dir . $file);
34 
35  $content = str_replace("[svg:$file]", $c, $content);
36  }
37 
38  return $content;
39  }
40 
41 }
42 ?>
$dir
Definition: delete.inc:44
$file
Definition: delete.inc:47
static getValue($component, $name)
Retrieve the value of the specified Setting.
Definition: settings.inc:104
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
Definition: settings.inc:174
Provides a central management class for event handlers and common functionality for the svg component...
Definition: svg_manager.inc:14
static setDefaults()
Definition: svg_manager.inc:20
static substituteTags($content)
Definition: svg_manager.inc:25
if(!checkRole("admin")) $c
global $config
Definition: import.inc:4
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content
Definition: styles.css.inc:24