@@ -3,34 +3,34 @@ |
||
3 | 3 | class Nip_View_XLS extends Nip_View |
4 | 4 | { |
5 | 5 | |
6 | - public function __construct() |
|
7 | - { |
|
8 | - $this->setBasePath(MODULES_PATH . Nip_Request::instance()->module . '/views/'); |
|
9 | - } |
|
6 | + public function __construct() |
|
7 | + { |
|
8 | + $this->setBasePath(MODULES_PATH . Nip_Request::instance()->module . '/views/'); |
|
9 | + } |
|
10 | 10 | |
11 | - public function output($view, $name) |
|
12 | - { |
|
13 | - header("Content-type: application/vnd.ms-excel"); |
|
14 | - header("Content-Disposition: attachment; filename=\"$name\""); |
|
15 | - header("Cache-Control: private, max-age=1, pre-check=1", true); |
|
16 | - header("Pragma: none", true); |
|
11 | + public function output($view, $name) |
|
12 | + { |
|
13 | + header("Content-type: application/vnd.ms-excel"); |
|
14 | + header("Content-Disposition: attachment; filename=\"$name\""); |
|
15 | + header("Cache-Control: private, max-age=1, pre-check=1", true); |
|
16 | + header("Pragma: none", true); |
|
17 | 17 | |
18 | - echo $this->load($view); |
|
19 | - exit(); |
|
20 | - } |
|
18 | + echo $this->load($view); |
|
19 | + exit(); |
|
20 | + } |
|
21 | 21 | |
22 | - /** |
|
23 | - * Singleton |
|
24 | - * |
|
25 | - * @return Nip_View_XLS |
|
26 | - */ |
|
27 | - public static function instance() |
|
28 | - { |
|
29 | - static $instance; |
|
30 | - if (!($instance instanceof self)) { |
|
31 | - $instance = new self(); |
|
32 | - } |
|
33 | - return $instance; |
|
34 | - } |
|
22 | + /** |
|
23 | + * Singleton |
|
24 | + * |
|
25 | + * @return Nip_View_XLS |
|
26 | + */ |
|
27 | + public static function instance() |
|
28 | + { |
|
29 | + static $instance; |
|
30 | + if (!($instance instanceof self)) { |
|
31 | + $instance = new self(); |
|
32 | + } |
|
33 | + return $instance; |
|
34 | + } |
|
35 | 35 | |
36 | 36 | } |
@@ -3,24 +3,24 @@ |
||
3 | 3 | class Nip_View_XML extends Nip_View |
4 | 4 | { |
5 | 5 | |
6 | - public function load($view = false, $variables = array(), $return = false) |
|
7 | - { |
|
8 | - header('Content-type: text/xml'); |
|
9 | - return parent::load($view, $variables, $return); |
|
10 | - } |
|
6 | + public function load($view = false, $variables = array(), $return = false) |
|
7 | + { |
|
8 | + header('Content-type: text/xml'); |
|
9 | + return parent::load($view, $variables, $return); |
|
10 | + } |
|
11 | 11 | |
12 | - /** |
|
13 | - * Singleton |
|
14 | - * |
|
15 | - * @return Nip_View_XML |
|
16 | - */ |
|
17 | - public static function instance() |
|
18 | - { |
|
19 | - static $instance; |
|
20 | - if (!($instance instanceof self)) { |
|
21 | - $instance = new self(); |
|
22 | - } |
|
23 | - return $instance; |
|
24 | - } |
|
12 | + /** |
|
13 | + * Singleton |
|
14 | + * |
|
15 | + * @return Nip_View_XML |
|
16 | + */ |
|
17 | + public static function instance() |
|
18 | + { |
|
19 | + static $instance; |
|
20 | + if (!($instance instanceof self)) { |
|
21 | + $instance = new self(); |
|
22 | + } |
|
23 | + return $instance; |
|
24 | + } |
|
25 | 25 | |
26 | 26 | } |
@@ -3,29 +3,29 @@ |
||
3 | 3 | class Nip_Object |
4 | 4 | { |
5 | 5 | |
6 | - protected $_data; |
|
6 | + protected $_data; |
|
7 | 7 | |
8 | - public function &__get($name) |
|
9 | - { |
|
10 | - if (!$this->__isset($name)) { |
|
11 | - $this->_data[$name] = null; |
|
12 | - } |
|
13 | - return $this->_data[$name]; |
|
14 | - } |
|
8 | + public function &__get($name) |
|
9 | + { |
|
10 | + if (!$this->__isset($name)) { |
|
11 | + $this->_data[$name] = null; |
|
12 | + } |
|
13 | + return $this->_data[$name]; |
|
14 | + } |
|
15 | 15 | |
16 | - public function __set($name, $value) |
|
17 | - { |
|
18 | - $this->_data[$name] = $value; |
|
19 | - } |
|
16 | + public function __set($name, $value) |
|
17 | + { |
|
18 | + $this->_data[$name] = $value; |
|
19 | + } |
|
20 | 20 | |
21 | - public function __isset($name) |
|
22 | - { |
|
23 | - return isset($this->_data[$name]); |
|
24 | - } |
|
21 | + public function __isset($name) |
|
22 | + { |
|
23 | + return isset($this->_data[$name]); |
|
24 | + } |
|
25 | 25 | |
26 | - public function __unset($name) |
|
27 | - { |
|
28 | - unset($this->_data[$name]); |
|
29 | - } |
|
26 | + public function __unset($name) |
|
27 | + { |
|
28 | + unset($this->_data[$name]); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | } |
32 | 32 | \ No newline at end of file |
@@ -90,13 +90,13 @@ |
||
90 | 90 | public function save() { |
91 | 91 | $expire = $this->getExpire(); |
92 | 92 | if (!$expire) { |
93 | - $timer = $this->getExpireTimer() ? $this->getExpireTimer() : 3*60*60; |
|
93 | + $timer = $this->getExpireTimer() ? $this->getExpireTimer() : 3 * 60 * 60; |
|
94 | 94 | $expire = time() + $timer; |
95 | 95 | |
96 | 96 | } |
97 | 97 | $domain = ($this->getDomain() != 'localhost') ? $this->getDomain() : false; |
98 | 98 | |
99 | - return setcookie ( |
|
99 | + return setcookie( |
|
100 | 100 | $this->getName(), |
101 | 101 | $this->getValue(), |
102 | 102 | $expire, |
@@ -2,7 +2,7 @@ |
||
2 | 2 | class Nip_Form_Renderer_Button_Button extends Nip_Form_Renderer_Button_Abstract { |
3 | 3 | |
4 | 4 | public function generateItem() { |
5 | - $return = '<button '.$this->renderAttributes().'> |
|
5 | + $return = '<button ' . $this->renderAttributes() . '> |
|
6 | 6 | ' . $this->getItem()->getLabel() . ' |
7 | 7 | </button>'; |
8 | 8 | return $return; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @return Nip_Form_Renderer_Abstract |
14 | - */ |
|
14 | + */ |
|
15 | 15 | public function getRenderer() { |
16 | 16 | return $this->_renderer; |
17 | 17 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @return Nip_Form_Button_Abstract |
26 | - */ |
|
26 | + */ |
|
27 | 27 | public function getItem() { |
28 | 28 | return $this->_item; |
29 | 29 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | public function renderItem() { |
40 | - $return = $this->generateItem(); |
|
40 | + $return = $this->generateItem(); |
|
41 | 41 | return $return; |
42 | 42 | } |
43 | 43 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | public function generateItem() { |
5 | 5 | $this->getItem()->setValue($this->getItem()->getLabel()); |
6 | - $return = '<input '.$this->renderAttributes().' />'; |
|
6 | + $return = '<input ' . $this->renderAttributes() . ' />'; |
|
7 | 7 | return $return; |
8 | 8 | } |
9 | 9 |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | { |
96 | 96 | } |
97 | 97 | |
98 | - public function renderLabel($label, $required = false, $error = false) |
|
99 | - { |
|
98 | + public function renderLabel($label, $required = false, $error = false) |
|
99 | + { |
|
100 | 100 | if (is_object($label)) { |
101 | 101 | $element = $label; |
102 | 102 | $label = $element->getLabel(); |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | $error = $element->isError(); |
105 | 105 | } |
106 | 106 | |
107 | - $return = '<label class="col-sm-3 ' . ($error ? ' error' : '') . '">'; |
|
108 | - $return .= $label. ':'; |
|
107 | + $return = '<label class="col-sm-3 ' . ($error ? ' error' : '') . '">'; |
|
108 | + $return .= $label. ':'; |
|
109 | 109 | |
110 | - if ($required) { |
|
111 | - $return .= '<span class="required">*</span>'; |
|
112 | - } |
|
110 | + if ($required) { |
|
111 | + $return .= '<span class="required">*</span>'; |
|
112 | + } |
|
113 | 113 | |
114 | - $return .= "</label>"; |
|
115 | - return $return; |
|
116 | - } |
|
114 | + $return .= "</label>"; |
|
115 | + return $return; |
|
116 | + } |
|
117 | 117 | |
118 | 118 | |
119 | 119 | public function renderButtons() |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | $return .= Nip_Helper_View_Errors::instance()->render($lines); |
145 | 145 | |
146 | 146 | } else { |
147 | - $return .= Nip_Helper_View_Messages::instance()->render($lines, $type); |
|
148 | - } |
|
147 | + $return .= Nip_Helper_View_Messages::instance()->render($lines, $type); |
|
148 | + } |
|
149 | 149 | } |
150 | 150 | return $return; |
151 | 151 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | $return = '<label class="col-sm-3 ' . ($error ? ' error' : '') . '">'; |
108 | - $return .= $label. ':'; |
|
108 | + $return .= $label . ':'; |
|
109 | 109 | |
110 | 110 | if ($required) { |
111 | 111 | $return .= '<span class="required">*</span>'; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | if ($buttons) { |
124 | 124 | $return .= '<div class="form-actions">'; |
125 | 125 | foreach ($buttons as $button) { |
126 | - $return .= $button->render()."\n"; |
|
126 | + $return .= $button->render() . "\n"; |
|
127 | 127 | } |
128 | 128 | $return .= ' <div class="clear"></div>'; |
129 | 129 | $return .= '</div>'; |
@@ -25,12 +25,12 @@ |
||
25 | 25 | { |
26 | 26 | $return = ''; |
27 | 27 | if (!$element->isRendered()) { |
28 | - $return .= '<p class="row row-'.$element->getUniqueId().($element->isError() ? ' error' : '').'">'; |
|
28 | + $return .= '<p class="row row-' . $element->getUniqueId() . ($element->isError() ? ' error' : '') . '">'; |
|
29 | 29 | |
30 | 30 | $return .= $this->renderLabel($element); |
31 | 31 | |
32 | 32 | $class = "value " . ($element->getType() == 'input' ? 'input' : ''); |
33 | - $return .= '<span class="'.$class.'">'; |
|
33 | + $return .= '<span class="' . $class . '">'; |
|
34 | 34 | $return .= $element->renderElement(); |
35 | 35 | $return .= '</span>'; |
36 | 36 |