PluginProbe
CSS & JavaScript Toolbox / 12.0.3
CSS & JavaScript Toolbox v12.0.3
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / includes / templates / templates.class.php

templates.class.php in CSS & JavaScript Toolbox 12.0.3, at includes/templates/templates.class.php

43 lines 898 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @version $ Id; ?FILE_NAME ?DATE ?TIME ?AUTHOR $
4 */
5
6 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 /**
10 *
11 */
12 abstract class CJTTemplates {
13
14 /**
15 * Get templates types mapped by extensions of the type file.
16 *
17 * @return array
18 */
19 public static function getExtensionTypeMap() {
20 // Initialize!
21 static $map = null;
22 if (!$map) {
23 // Us extension as key and type-name as value.
24 foreach (cssJSToolbox::$config->templates->types as $type => $data) {
25 $map[$data->extension] = $type;
26 }
27 }
28 return $map;
29 }
30
31 /**
32 * Get template type extension name.
33 *
34 * @param mixed $typeName
35 */
36 public static function getExtensionType($extension) {
37 // Get extensions->types map.
38 $map = self::getExtensionTypeMap();
39 // Return Type if Extension exists or FALSE otherwise.
40 return isset($map[$extension]) ? $map[$extension] : FALSE;
41 }
42
43 } // End class.