PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 1.2
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v1.2
10.56 1.2.1 10 10.1 10.2 10.3 10.31 10.32 10.33 10.34 10.50 10.51 10.52 10.53 10.55 9.0 9.0.1 9.4 trunk 1.0.0 1.1 1.2
easy-code-manager / controllers / coupling / shortcode / shortcode.php

shortcode.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 1.2, at controllers/coupling/shortcode/shortcode.php

79 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 /**
10 *
11 *
12 * This is the first class name build for using autoload!
13 * Autoload is not being supported yet however this is the first
14 * class on the plain!!!!
15 */
16 class CJT_Controllers_Coupling_Shortcode extends CJTHookableClass {
17
18 /**
19 * put your comment there...
20 *
21 * @var mixed
22 */
23 protected $attributes;
24
25 /**
26 * put your comment there...
27 *
28 * @var mixed
29 */
30 protected $content = null;
31
32 /**
33 * put your comment there...
34 *
35 * @param mixed $attributes
36 * @param mixed $content
37 * @return CJT_Controllers_Coupling_Shortcode
38 */
39 public function __construct($attributes, $content) {
40 // Hookable initialization!
41 parent::__construct();
42 // Initialize.
43 $this->attributes = $attributes;
44 $this->content = $content;
45 }
46
47 /**
48 * put your comment there...
49 *
50 */
51 public function __toString() {
52 // Initialize.
53 $attributes =& $this->attributes;
54 // Default Class.
55 if (!isset($attributes['class'])) {
56 $shortcodeClass = 'Block';
57 }
58 // Get Shortcode class file, check existance!
59 $shortcodeClassFile = cssJSToolbox::resolvePath('controllers:coupling:shortcode:block:block.php');
60 if (!file_exists($shortcodeClassFile)) {
61 throw new Exception('Shortcode Type is not supported!! Only (block) type is currently available!!!');
62 }
63 // Import shortcodee handler file.
64 require_once $shortcodeClassFile;
65
66 // Import class.
67 $className = "CJT_Controllers_Coupling_Shortcode_{$shortcodeClass}";
68
69 // Load shortcode 'CLASS' handler.
70 $shortcode = new $className($this->attributes, $this->content);
71
72 // Return Shortcode replacements.
73 return ((string) $shortcode);
74 }
75
76 } // End class
77
78 // Hookable!
79 CJT_Controllers_Coupling_Shortcode::define('CJT_Controllers_Coupling_Shortcode');