PluginProbe
ShiftController Employee Shift Scheduling / 4.9.66
ShiftController Employee Shift Scheduling v4.9.66
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / hc3 / _wordpress / layout.php

layout.php in ShiftController Employee Shift Scheduling 4.9.66, at hc3/_wordpress/layout.php

112 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 class HC3_Layout implements HC3_ILayout
3 {
4 public $enqueuer;
5
6 public function __construct(
7 HC3_Enqueuer $enqueuer
8 )
9 {
10 $this->enqueuer = $enqueuer;
11 }
12
13 public function renderPrint( $content )
14 {
15 $content = '' . $content;
16
17 $content = str_replace( 'hc-table-header-wpadmin', '', $content );
18 $content = str_replace( 'hc-table-header', '', $content );
19
20 $body = array();
21 $body[] = '<body>';
22 $body[] = '<div class="hc-app-container" id="hc3">';
23 $body[] = $content;
24 $body[] = '</div>';
25 $body[] = '</body>';
26 $body = implode("\n", $body);
27
28 $head = array();
29 $head[] = '<head>';
30 $head[] = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
31 $head[] = '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
32
33 $styles = $this->enqueuer->getStyles();
34
35 foreach( $styles as $handle => $src ){
36 $head[] = '<link rel="stylesheet" type="text/css" id="hc3-style-' . $handle . '" href="' . $src . '">';
37 }
38
39 $head[] = '</head>';
40 $head = join("\n", $head) . "\n";
41
42 $out = array();
43 $out[] = '<!DOCTYPE html>';
44 $out[] = '<html xmlns="http://www.w3.org/1999/xhtml">';
45 $out[] = $head;
46 $out[] = $body;
47
48 if( ! (defined('HC3_DEV_INSTALL') && HC3_DEV_INSTALL) ){
49 $out[] = '<script language="JavaScript">';
50 $out[] = 'window.print();';
51 $out[] = '</script>';
52 }
53
54 $out[] = '</html>';
55
56 $out = implode("\n", $out);
57
58 return $out;
59 }
60
61 public function render( $content )
62 {
63 $content = '' . $content;
64
65 $body = array();
66 // $body[] = '<body>';
67 $body[] = '<div class="wrap">';
68 $body[] = '<div class="hc-app-container" id="hc3">';
69 $body[] = $content;
70 $body[] = '</div><!-- #hc3 -->';
71 $body[] = '</div>';
72 // $body[] = '</body>';
73 $body = implode("\n", $body);
74
75 $head = $this->head();
76
77 $out = array();
78 // $out[] = '<!DOCTYPE html>';
79 // $out[] = '<html xmlns="http://www.w3.org/1999/xhtml">';
80 // $out[] = $head;
81 $out[] = $body;
82 // $out[] = '</html>';
83
84 $out = implode("\n", $out);
85 return $out;
86 }
87
88 public function head()
89 {
90 $head = array();
91
92 // $head[] = '<head>';
93 // $head[] = '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
94 // $head[] = '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
95
96 $scripts = $this->enqueuer->getScripts();
97 $styles = $this->enqueuer->getStyles();
98 // echo "MAKING HEAD";
99 foreach( $styles as $handle => $src ){
100 // wp_enqueue_style( $handle, $src );
101 }
102
103 foreach( $scripts as $handle => $src ){
104 // wp_enqueue_script( $handle, $src );
105 }
106
107 // $head[] = '</head>';
108 // $head = join("\n", $head) . "\n";
109
110 return $head;
111 }
112 }