PluginProbe
Depicter — Popup & Slider Builder / trunk
Depicter — Popup & Slider Builder vtrunk
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Document / Models / Elements / Rating.php

Rating.php in Depicter — Popup & Slider Builder trunk, at app/src/Document/Models/Elements/Rating.php

60 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Document\Models\Elements;
3
4 use Depicter\Front\Symbols;
5 use Depicter\Html\Html;
6
7 class Rating extends Svg {
8
9 /**
10 * Render arrow markup
11 *
12 * @return \TypeRocket\Html\Html|void
13 * @throws \JsonMapper_Exception
14 */
15 public function render() {
16
17 \Depicter::symbolsProvider()->add( $this->options->rating->symbol );
18
19 $args = $this->getDefaultAttributes();
20 $args['data-rate-value'] = $this->maybeReplaceDataSheetTags( $this->options->content );
21 if ( $this->options->rating->round ) {
22 $args['data-rate-value'] = round( $args['data-rate-value'] );
23 }
24 $args['data-symbol'] = $this->options->rating->symbol;
25
26 return Html::div( $args, "\n" );
27 }
28
29
30 /**
31 * Get list of selector and CSS for element
32 *
33 * @return array
34 * @throws \JsonMapper_Exception
35 */
36 public function getSelectorAndCssList(){
37 $this->selectorCssList = parent::getSelectorAndCssList();
38
39 foreach ( $this->devices as $device ) {
40 if ( !empty( $this->options->rating->styles->trackColor->{$device} ) ){
41 $this->selectorCssList[ '.' . $this->getSelector() . ' .depicter-track-container' ][$device]['fill'] = $this->options->rating->styles->trackColor->{$device};
42 }
43
44 if ( !empty( $this->options->rating->hover->trackColor->{$device} ) ){
45 $this->selectorCssList[ '.' . $this->getSelector() . ':hover .depicter-track-container' ][$device]['fill'] = $this->options->rating->hover->trackColor->{$device};
46 }
47
48 if ( !empty( $this->options->rating->styles->patternColor->{$device} ) ){
49 $this->selectorCssList[ '.' . $this->getSelector() . ' .depicter-symbol-container' ][$device]['fill'] = $this->options->rating->styles->patternColor->{$device};
50 }
51
52 if ( !empty( $this->options->rating->hover->patternColor->{$device} ) ){
53 $this->selectorCssList[ '.' . $this->getSelector() . ':hover .depicter-symbol-container' ][$device]['fill'] = $this->options->rating->hover->patternColor->{$device};
54 }
55 }
56
57 return $this->selectorCssList;
58 }
59 }
60