FooterPanel.php (2127B)
1 <?php 2 3 namespace Materialis\Customizer\Panels; 4 5 class FooterPanel extends \Materialis\Customizer\BasePanel 6 { 7 8 public function init() 9 { 10 $this->companion()->customizer()->registerScripts(array($this, 'addScripts')); 11 12 $this->addSections( 13 array( 14 "footer_layout"=>array( 15 "wp_data"=>array( 16 "priority"=>20, 17 "panel" => $this->id, 18 "title"=> "Header Presets" 19 ), 20 ) 21 ) 22 ); 23 24 $this->addSettings( 25 array( 26 "footer_presets"=> array( 27 "class"=> false, 28 "section"=> "footer_layout", 29 "wp_data"=> array( 30 "transport"=> "postMessage" 31 ), 32 "control"=> array( 33 "class"=> "\\Materialis\\Customizer\\Controls\\RowsListControl", 34 "insertText"=> "Apply Preset", 35 "wp_data"=> array(), 36 "type"=> "presets_changer", 37 "dataSource"=> "data:footers" 38 ) 39 ) 40 ) 41 ); 42 } 43 44 public function addScripts() 45 { 46 $jsUrl = $this->companion()->assetsRootURL() . "/js/customizer/"; 47 wp_enqueue_script('cp-customizer-footer', $jsUrl . "customizer-footer.js", array(), false, true); 48 } 49 50 public function render_template() 51 { 52 ?> 53 <li id="accordion-panel-{{ data.id }}" data-name="{{{ data.id }}}" class="accordion-section control-section control-panel control-panel-{{ data.type }}"> 54 <h3 class="accordion-section-title no-chevron" tabindex="0"> 55 {{ data.title }} 56 <span title="<?php _e('Change Footer', 'cloudpress-companion'); ?>" data-name="change" class="open-right section-icon"></span> 57 </h3> 58 <ul class="accordion-sub-container control-panel-content"></ul> 59 </li> 60 <?php 61 62 } 63 }