Completed
Pull Request — master (#9084)
by Julius
32:10 queued 13:43
created
core/templates/layout.public.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 	<meta charset="utf-8">
5 5
 	<title>
6 6
 		<?php
7
-		p(!empty($_['application'])?$_['application'].' - ':'');
8
-		p($theme->getTitle());
9
-		?>
7
+        p(!empty($_['application'])?$_['application'].' - ':'');
8
+        p($theme->getTitle());
9
+        ?>
10 10
 	</title>
11 11
 	<meta http-equiv="X-UA-Compatible" content="IE=edge">
12 12
 	<meta name="referrer" content="never">
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
 		</div>
43 43
 
44 44
 		<?php
45
-		/** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
46
-		if($template->getActionCount() !== 0) {
47
-			$primary = $template->getPrimaryAction();
48
-			$others = $template->getOtherActions();
49
-			?>
45
+        /** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
46
+        if($template->getActionCount() !== 0) {
47
+            $primary = $template->getPrimaryAction();
48
+            $others = $template->getOtherActions();
49
+            ?>
50 50
 		<div class="header-right">
51 51
 			<span id="header-primary-action" class="<?php if($template->getActionCount() === 1) {  p($primary->getIcon()); } ?>">
52 52
 				<a href="<?php p($primary->getLink()); ?>">
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
 				<div id="header-actions-menu" class="popovermenu menu">
60 60
 					<ul>
61 61
 						<?php
62
-							/** @var \OCP\AppFramework\Http\Template\IMenuAction $action */
63
-							foreach($template->getOtherActions() as $action) {
64
-								print_unescaped($action->render());
65
-							}
66
-						?>
62
+                            /** @var \OCP\AppFramework\Http\Template\IMenuAction $action */
63
+                            foreach($template->getOtherActions() as $action) {
64
+                                print_unescaped($action->render());
65
+                            }
66
+                        ?>
67 67
 					</ul>
68 68
 				</div>
69 69
 			</div>
Please login to merge, or discard this patch.
lib/public/AppFramework/Http/Template/PublicTemplateResponse.php 1 patch
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -34,125 +34,125 @@
 block discarded – undo
34 34
  */
35 35
 class PublicTemplateResponse extends TemplateResponse {
36 36
 
37
-	private $headerTitle = '';
38
-	private $headerDetails = '';
39
-	private $headerActions = [];
40
-	private $footerVisible = true;
41
-
42
-	/**
43
-	 * PublicTemplateResponse constructor.
44
-	 *
45
-	 * @param string $appName
46
-	 * @param string $templateName
47
-	 * @param array $params
48
-	 * @since 14.0.0
49
-	 */
50
-	public function __construct(string $appName, string $templateName, array $params = array()) {
51
-		parent::__construct($appName, $templateName, $params, 'public');
52
-		\OC_Util::addScript('core', 'public/publicpage');
53
-	}
54
-
55
-	/**
56
-	 * @param string $title
57
-	 * @since 14.0.0
58
-	 */
59
-	public function setHeaderTitle(string $title) {
60
-		$this->headerTitle = $title;
61
-	}
62
-
63
-	/**
64
-	 * @return string
65
-	 * @since 14.0.0
66
-	 */
67
-	public function getHeaderTitle(): string {
68
-		return $this->headerTitle;
69
-	}
70
-
71
-	/**
72
-	 * @param string $details
73
-	 * @since 14.0.0
74
-	 */
75
-	public function setHeaderDetails(string $details) {
76
-		$this->headerDetails = $details;
77
-	}
78
-
79
-	/**
80
-	 * @return string
81
-	 * @since 14.0.0
82
-	 */
83
-	public function getHeaderDetails(): string {
84
-		return $this->headerDetails;
85
-	}
86
-
87
-	/**
88
-	 * @param array $actions
89
-	 * @since 14.0.0
90
-	 * @throws InvalidArgumentException
91
-	 */
92
-	public function setHeaderActions(array $actions) {
93
-		foreach ($actions as $action) {
94
-			if ($actions instanceof IMenuAction) {
95
-				throw new InvalidArgumentException('Actions must be of type IMenuAction');
96
-			}
97
-			$this->headerActions[] = $action;
98
-		}
99
-		usort($this->headerActions, function(IMenuAction $a, IMenuAction $b) {
100
-			return $a->getPriority() > $b->getPriority();
101
-		});
102
-	}
103
-
104
-	/**
105
-	 * @return IMenuAction
106
-	 * @since 14.0.0
107
-	 * @throws \Exception
108
-	 */
109
-	public function getPrimaryAction(): IMenuAction {
110
-		if ($this->getActionCount() > 0) {
111
-			return $this->headerActions[0];
112
-		}
113
-		throw new \Exception('No header actions have been set');
114
-	}
115
-
116
-	/**
117
-	 * @return int
118
-	 * @since 14.0.0
119
-	 */
120
-	public function getActionCount(): int {
121
-		return count($this->headerActions);
122
-	}
123
-
124
-	/**
125
-	 * @return IMenuAction[]
126
-	 * @since 14.0.0
127
-	 */
128
-	public function getOtherActions(): array {
129
-		return array_slice($this->headerActions, 1);
130
-	}
131
-
132
-	/**
133
-	 * @since 14.0.0
134
-	 */
135
-	public function setFooterVisible(bool $visible = false) {
136
-		$this->footerVisible = $visible;
137
-	}
138
-
139
-	/**
140
-	 * @since 14.0.0
141
-	 */
142
-	public function getFooterVisible(): bool {
143
-		return $this->footerVisible;
144
-	}
145
-
146
-	/**
147
-	 * @return string
148
-	 * @since 14.0.0
149
-	 */
150
-	public function render(): string {
151
-		$params = array_merge($this->getParams(), [
152
-			'template' => $this,
153
-		]);
154
-		$this->setParams($params);
155
-		return  parent::render();
156
-	}
37
+    private $headerTitle = '';
38
+    private $headerDetails = '';
39
+    private $headerActions = [];
40
+    private $footerVisible = true;
41
+
42
+    /**
43
+     * PublicTemplateResponse constructor.
44
+     *
45
+     * @param string $appName
46
+     * @param string $templateName
47
+     * @param array $params
48
+     * @since 14.0.0
49
+     */
50
+    public function __construct(string $appName, string $templateName, array $params = array()) {
51
+        parent::__construct($appName, $templateName, $params, 'public');
52
+        \OC_Util::addScript('core', 'public/publicpage');
53
+    }
54
+
55
+    /**
56
+     * @param string $title
57
+     * @since 14.0.0
58
+     */
59
+    public function setHeaderTitle(string $title) {
60
+        $this->headerTitle = $title;
61
+    }
62
+
63
+    /**
64
+     * @return string
65
+     * @since 14.0.0
66
+     */
67
+    public function getHeaderTitle(): string {
68
+        return $this->headerTitle;
69
+    }
70
+
71
+    /**
72
+     * @param string $details
73
+     * @since 14.0.0
74
+     */
75
+    public function setHeaderDetails(string $details) {
76
+        $this->headerDetails = $details;
77
+    }
78
+
79
+    /**
80
+     * @return string
81
+     * @since 14.0.0
82
+     */
83
+    public function getHeaderDetails(): string {
84
+        return $this->headerDetails;
85
+    }
86
+
87
+    /**
88
+     * @param array $actions
89
+     * @since 14.0.0
90
+     * @throws InvalidArgumentException
91
+     */
92
+    public function setHeaderActions(array $actions) {
93
+        foreach ($actions as $action) {
94
+            if ($actions instanceof IMenuAction) {
95
+                throw new InvalidArgumentException('Actions must be of type IMenuAction');
96
+            }
97
+            $this->headerActions[] = $action;
98
+        }
99
+        usort($this->headerActions, function(IMenuAction $a, IMenuAction $b) {
100
+            return $a->getPriority() > $b->getPriority();
101
+        });
102
+    }
103
+
104
+    /**
105
+     * @return IMenuAction
106
+     * @since 14.0.0
107
+     * @throws \Exception
108
+     */
109
+    public function getPrimaryAction(): IMenuAction {
110
+        if ($this->getActionCount() > 0) {
111
+            return $this->headerActions[0];
112
+        }
113
+        throw new \Exception('No header actions have been set');
114
+    }
115
+
116
+    /**
117
+     * @return int
118
+     * @since 14.0.0
119
+     */
120
+    public function getActionCount(): int {
121
+        return count($this->headerActions);
122
+    }
123
+
124
+    /**
125
+     * @return IMenuAction[]
126
+     * @since 14.0.0
127
+     */
128
+    public function getOtherActions(): array {
129
+        return array_slice($this->headerActions, 1);
130
+    }
131
+
132
+    /**
133
+     * @since 14.0.0
134
+     */
135
+    public function setFooterVisible(bool $visible = false) {
136
+        $this->footerVisible = $visible;
137
+    }
138
+
139
+    /**
140
+     * @since 14.0.0
141
+     */
142
+    public function getFooterVisible(): bool {
143
+        return $this->footerVisible;
144
+    }
145
+
146
+    /**
147
+     * @return string
148
+     * @since 14.0.0
149
+     */
150
+    public function render(): string {
151
+        $params = array_merge($this->getParams(), [
152
+            'template' => $this,
153
+        ]);
154
+        $this->setParams($params);
155
+        return  parent::render();
156
+    }
157 157
 
158 158
 }
159 159
\ No newline at end of file
Please login to merge, or discard this patch.
lib/public/AppFramework/Http/Template/LinkMenuAction.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -34,33 +34,33 @@
 block discarded – undo
34 34
  */
35 35
 class LinkMenuAction extends SimpleMenuAction {
36 36
 
37
-	/**
38
-	 * LinkMenuAction constructor.
39
-	 *
40
-	 * @param string $label
41
-	 * @param string $icon
42
-	 * @param string $link
43
-	 * @since 14.0.0
44
-	 */
45
-	public function __construct(string $label, string $icon, string $link) {
46
-		parent::__construct('directLink-container', $label, $icon, $link);
47
-	}
37
+    /**
38
+     * LinkMenuAction constructor.
39
+     *
40
+     * @param string $label
41
+     * @param string $icon
42
+     * @param string $link
43
+     * @since 14.0.0
44
+     */
45
+    public function __construct(string $label, string $icon, string $link) {
46
+        parent::__construct('directLink-container', $label, $icon, $link);
47
+    }
48 48
 
49
-	/**
50
-	 * @return string
51
-	 * @since 14.0.0
52
-	 */
53
-	public function render(): string {
54
-		return '<li>' .
55
-			'<a id="directLink-container">' .
56
-			'<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' .
57
-			'<label for="directLink">' . Util::sanitizeHTML($this->getLabel()) . '</label>' .
58
-			'</a>' .
59
-			'</li>' .
60
-			'<li>' .
61
-			'<span class="menuitem">' .
62
-			'<input id="directLink" type="text" readonly="" value="' . Util::sanitizeHTML($this->getLink()) . '">' .
63
-			'</span>' .
64
-			'</li>';
65
-	}
49
+    /**
50
+     * @return string
51
+     * @since 14.0.0
52
+     */
53
+    public function render(): string {
54
+        return '<li>' .
55
+            '<a id="directLink-container">' .
56
+            '<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' .
57
+            '<label for="directLink">' . Util::sanitizeHTML($this->getLabel()) . '</label>' .
58
+            '</a>' .
59
+            '</li>' .
60
+            '<li>' .
61
+            '<span class="menuitem">' .
62
+            '<input id="directLink" type="text" readonly="" value="' . Util::sanitizeHTML($this->getLink()) . '">' .
63
+            '</span>' .
64
+            '</li>';
65
+    }
66 66
 }
Please login to merge, or discard this patch.
lib/public/AppFramework/Http/Template/ExternalShareMenuAction.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -33,45 +33,45 @@
 block discarded – undo
33 33
  */
34 34
 class ExternalShareMenuAction extends SimpleMenuAction {
35 35
 
36
-	/** @var string */
37
-	private $owner;
36
+    /** @var string */
37
+    private $owner;
38 38
 
39
-	/** @var string */
40
-	private $displayname;
39
+    /** @var string */
40
+    private $displayname;
41 41
 
42
-	/** @var string */
43
-	private $shareName;
42
+    /** @var string */
43
+    private $shareName;
44 44
 
45
-	/**
46
-	 * ExternalShareMenuAction constructor.
47
-	 *
48
-	 * @param string $label
49
-	 * @param string $icon
50
-	 * @param string $owner
51
-	 * @param string $displayname
52
-	 * @param string $shareName
53
-	 * @since 14.0.0
54
-	 */
55
-	public function __construct(string $label, string $icon, string $owner, string $displayname, string $shareName) {
56
-		parent::__construct('save', $label, $icon);
57
-		$this->owner = $owner;
58
-		$this->displayname = $displayname;
59
-		$this->shareName = $shareName;
60
-	}
45
+    /**
46
+     * ExternalShareMenuAction constructor.
47
+     *
48
+     * @param string $label
49
+     * @param string $icon
50
+     * @param string $owner
51
+     * @param string $displayname
52
+     * @param string $shareName
53
+     * @since 14.0.0
54
+     */
55
+    public function __construct(string $label, string $icon, string $owner, string $displayname, string $shareName) {
56
+        parent::__construct('save', $label, $icon);
57
+        $this->owner = $owner;
58
+        $this->displayname = $displayname;
59
+        $this->shareName = $shareName;
60
+    }
61 61
 
62
-	/**
63
-	 * @since 14.0.0
64
-	 */
65
-	public function render(): string {
66
-		return '<li>' .
67
-			'<a id="save-external-share" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' .
68
-			'<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' .
69
-			'<label for="remote_address">' . Util::sanitizeHTML($this->getLabel()) . '</label>' .
70
-			'<form class="save-form hidden" action="#">' .
71
-			'<input type="text" id="remote_address" placeholder="[email protected]">' .
72
-			'<input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' .
73
-			'</form>' .
74
-			'</a>' .
75
-			'</li>';
76
-	}
62
+    /**
63
+     * @since 14.0.0
64
+     */
65
+    public function render(): string {
66
+        return '<li>' .
67
+            '<a id="save-external-share" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' .
68
+            '<span class="icon ' . Util::sanitizeHTML($this->getIcon()) . '"></span>' .
69
+            '<label for="remote_address">' . Util::sanitizeHTML($this->getLabel()) . '</label>' .
70
+            '<form class="save-form hidden" action="#">' .
71
+            '<input type="text" id="remote_address" placeholder="[email protected]">' .
72
+            '<input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' .
73
+            '</form>' .
74
+            '</a>' .
75
+            '</li>';
76
+    }
77 77
 }
Please login to merge, or discard this patch.