PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 1.2.1
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v1.2.1
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 / framework / view / block / parameter / base / abstract.php

abstract.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 1.2.1, at framework/view/block/parameter/base/abstract.php

129 lines 2.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 /**
7 *
8 */
9 abstract class CJT_Framework_View_Block_Parameter_Base_Abstract
10 extends CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Base_Abstract
11 implements CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Interface_Type,
12 CJT_Framework_View_Block_Parameter_Interface_Type {
13
14 /**
15 * put your comment there...
16 *
17 */
18 public function __toString() {
19 // Get class file name.
20 $content = $this->getTypeObject()->getFactory()->getClassFile(get_class($this), 'index.phtml');
21 // Get content on output buffer.
22 ob_start();
23 include $content;
24 return ob_get_clean();
25 }
26
27 /**
28 * put your comment there...
29 *
30 */
31 public function enqueueScripts() {return array();}
32
33 /**
34 * put your comment there...
35 *
36 */
37 public function enqueueStyles() {return array();}
38
39 /**
40 * put your comment there...
41 *
42 * @param mixed $parameter
43 */
44 public function getBaseTypeFactory($parameter) {
45 // Hold local instance!
46 static $baseTypeFactory;
47 if (!$baseTypeFactory) {
48 $baseTypeFactory = new CJT_Framework_Developer_Interface_Block_Shortcode_Parameters_Factory();
49 }
50 // Type factory
51 return array(
52 'factory' => $baseTypeFactory,
53 'typeName' => $parameter->getOriginalType(),
54 );
55 }
56
57 /**
58 * put your comment there...
59 *
60 */
61 protected function getControlName() {
62 return $this->getDefinition()->getName(true);
63 }
64
65 /**
66 * put your comment there...
67 *
68 */
69 protected function getElementId() {
70 // Get element name.
71 $name = $this->getName();
72 // Replace all [ and ] to dashes!
73 $id = str_replace(array('[', ']'), '-', $name);
74 return $id;
75 }
76
77 /**
78 * put your comment there...
79 *
80 */
81 public function getName() {
82 // Initialize.
83 $name = '';
84 $names = array();
85 // Add current parameter name as first.
86 $names[] = $this->getControlName();
87 // Unshift all the parent names at the begning of the names list!
88 $parent = $this;
89 while ($parent = $parent->getParent()) {
90 array_unshift($names, $parent->getControlName());
91 }
92 // Use first item as the name and everything else as array.
93 $name = 'form-data';
94 // Get everything else as array.
95 if (!empty($names)) {
96 $name .= '[' . implode('][', $names) . ']';
97 }
98 // Return string name
99 return $name;
100 }
101
102 /**
103 * put your comment there...
104 *
105 * @param mixed $name
106 */
107 protected function getTemplate($name) {
108 // Get RENDERER class name.
109 $path = explode('_', get_class($this));
110 $rendererName = array_pop($path);
111 // For now it only support getting standard templates
112 // from the abstract class.
113 // In the future it might used to get template overrided in the
114 // $this object class.
115 ob_start();
116 include "abstract/template/{$name}.phtml";
117 return ob_get_clean();
118 }
119
120 /**
121 * put your comment there...
122 *
123 */
124 public function shortcode() {
125 return $this->getTypeObject()->shortcode();
126 }
127
128 } // End class.
129