Changeset 2211789
- Timestamp:
- 12/13/2019 07:10:13 PM (6 years ago)
- Location:
- widgetizer
- Files:
-
- 8 added
- 4 edited
-
tags/1.0.1/includes/elementor/class-elementor-builder.php (modified) (1 diff)
-
tags/1.0.1/includes/elementor/class-elementor-widget.php (modified) (7 diffs)
-
tags/1.0.1/widgets/elementor/widgetizer/empty (added)
-
tags/1.0.1/widgets/elementor/widgetizer/section (added)
-
tags/1.0.1/widgets/elementor/widgetizer/section/section.latte (added)
-
tags/1.0.1/widgets/elementor/widgetizer/section/section.neon (added)
-
trunk/includes/elementor/class-elementor-builder.php (modified) (1 diff)
-
trunk/includes/elementor/class-elementor-widget.php (modified) (7 diffs)
-
trunk/widgets/elementor/widgetizer/empty (added)
-
trunk/widgets/elementor/widgetizer/section (added)
-
trunk/widgets/elementor/widgetizer/section/section.latte (added)
-
trunk/widgets/elementor/widgetizer/section/section.neon (added)
Legend:
- Unmodified
- Added
- Removed
-
widgetizer/tags/1.0.1/includes/elementor/class-elementor-builder.php
r2211678 r2211789 206 206 'widget_styles' => array( $provider_name . '-' . $widget_name ), 207 207 'widget_scripts' => array( $provider_name . '-' . $widget_name ), 208 ' template_path'=> WP_CONTENT_DIR . $widget_content['path'],208 'widget_path' => WP_CONTENT_DIR . $widget_content['path'], 209 209 ); 210 210 $this->generate_widget_class( $class_name, $class_properties ); -
widgetizer/tags/1.0.1/includes/elementor/class-elementor-widget.php
r2211678 r2211789 9 9 10 10 use Latte\Engine; 11 use Nette\Neon\Exception;12 11 use Nette\Neon\Neon; 13 12 use Nette\Utils\FileSystem; 14 use Symfony\Component\Yaml\Yaml;15 13 16 14 /** … … 38 36 39 37 /** 38 * Widget title 39 * 40 * @var $widget_title 41 */ 42 protected $widget_title; 43 44 /** 40 45 * Widget icon 41 46 * … … 59 64 60 65 /** 61 * Base path of widget template directory66 * Base path of widget 62 67 * 63 * @var string $ template_path Templatepath.68 * @var string $widget_path Widget path. 64 69 */ 65 protected $ template_path;70 protected $widget_path; 66 71 67 72 … … 81 86 */ 82 87 public function get_name() { 83 return $this->widget_ name;88 return $this->widget_provider . '-' . $this->widget_name; 84 89 } 85 90 … … 112 117 113 118 /** 114 * Widget sc ipts array119 * Widget scripts array 115 120 * 116 121 * @return array Array of widget scripts. … … 124 129 */ 125 130 protected function _register_controls() { // phpcs:ignore 126 $value = FileSystem::read( $this->template_path . '/' . $this->widget_name . '.neon' ); 131 $config_file = $this->widget_path . '/' . $this->widget_name . '.neon'; 132 if ( ! is_readable( $config_file ) ) { 133 return false; 134 } 135 $value = FileSystem::read( $config_file ); 127 136 $neon = Neon::decode( $value ); 128 137 $controls = $neon['content']; … … 152 161 'content' => $this->get_settings_for_display(), 153 162 ); 154 $html = $latte->renderToString( $this-> template_path . '/' . $this->widget_name . '.latte', $parameters );163 $html = $latte->renderToString( $this->widget_path . '/' . $this->widget_name . '.latte', $parameters ); 155 164 echo $html; // phpcs:ignore 156 165 } -
widgetizer/trunk/includes/elementor/class-elementor-builder.php
r2211678 r2211789 206 206 'widget_styles' => array( $provider_name . '-' . $widget_name ), 207 207 'widget_scripts' => array( $provider_name . '-' . $widget_name ), 208 ' template_path'=> WP_CONTENT_DIR . $widget_content['path'],208 'widget_path' => WP_CONTENT_DIR . $widget_content['path'], 209 209 ); 210 210 $this->generate_widget_class( $class_name, $class_properties ); -
widgetizer/trunk/includes/elementor/class-elementor-widget.php
r2211678 r2211789 9 9 10 10 use Latte\Engine; 11 use Nette\Neon\Exception;12 11 use Nette\Neon\Neon; 13 12 use Nette\Utils\FileSystem; 14 use Symfony\Component\Yaml\Yaml;15 13 16 14 /** … … 38 36 39 37 /** 38 * Widget title 39 * 40 * @var $widget_title 41 */ 42 protected $widget_title; 43 44 /** 40 45 * Widget icon 41 46 * … … 59 64 60 65 /** 61 * Base path of widget template directory66 * Base path of widget 62 67 * 63 * @var string $ template_path Templatepath.68 * @var string $widget_path Widget path. 64 69 */ 65 protected $ template_path;70 protected $widget_path; 66 71 67 72 … … 81 86 */ 82 87 public function get_name() { 83 return $this->widget_ name;88 return $this->widget_provider . '-' . $this->widget_name; 84 89 } 85 90 … … 112 117 113 118 /** 114 * Widget sc ipts array119 * Widget scripts array 115 120 * 116 121 * @return array Array of widget scripts. … … 124 129 */ 125 130 protected function _register_controls() { // phpcs:ignore 126 $value = FileSystem::read( $this->template_path . '/' . $this->widget_name . '.neon' ); 131 $config_file = $this->widget_path . '/' . $this->widget_name . '.neon'; 132 if ( ! is_readable( $config_file ) ) { 133 return false; 134 } 135 $value = FileSystem::read( $config_file ); 127 136 $neon = Neon::decode( $value ); 128 137 $controls = $neon['content']; … … 152 161 'content' => $this->get_settings_for_display(), 153 162 ); 154 $html = $latte->renderToString( $this-> template_path . '/' . $this->widget_name . '.latte', $parameters );163 $html = $latte->renderToString( $this->widget_path . '/' . $this->widget_name . '.latte', $parameters ); 155 164 echo $html; // phpcs:ignore 156 165 }
Note: See TracChangeset
for help on using the changeset viewer.