PluginProbe
CSS & JavaScript Toolbox / 11.3
CSS & JavaScript Toolbox v11.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 / framework / developer / interface / block / shortcode / segments / segments.php

segments.php in CSS & JavaScript Toolbox 11.3, at framework/developer/interface/block/shortcode/segments/segments.php

52 lines 1.2 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 class CJT_Framework_Developer_Interface_Block_Shortcode_Segments_Segments
13 extends CJT_Framework_Developer_Interface_Block_Parameters_Parameters {
14
15 /**
16 * put your comment there...
17 *
18 * @var mixed
19 */
20 protected $content = null;
21
22 /**
23 * put your comment there...
24 *
25 * @param mixed $content
26 * @return CJT_Framework_Developer_Interface_Block_Shortcode_Segments
27 */
28 public function __construct(& $content) {
29 // Initialize.
30 $this->content =& $content;
31 // Initialize parent.
32 parent::__construct(array());
33 }
34
35 /**
36 * put your comment there...
37 *
38 */
39 public function validate() {
40 // Read segments from Shortcode content.
41 $segments = preg_split('/(\w+)\=\:\s+/', $this->content, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
42 // All even indexes if for segment names and
43 // odd index for values.
44 for ($index = 0; $index < count($segments); $index+=2) {
45 // Get key from current item and value from the next.
46 $this->uParams[$segments[$index]] = $segments[$index + 1];
47 }
48 // Parent vaidation.
49 return parent::validate();
50 }
51
52 } // End class.