Skip to content

Commit c14dad9

Browse files
authored
Merge pull request #7857 from nextcloud/dep_template
Remove deprecated template functions from OCP directly
2 parents bf680ad + 4b9890f commit c14dad9

2 files changed

Lines changed: 1 addition & 114 deletions

File tree

apps/files/templates/simplelist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<span class="selectedActions"><a href="" class="delete-selected">
3131
<?php p($l->t('Delete'))?>
3232
<img class="svg" alt=""
33-
src="<?php print_unescaped(OCP\image_path("core", "actions/delete.svg")); ?>" />
33+
src="<?php print_unescaped(OCP\Template::image_path("core", "actions/delete.svg")); ?>" />
3434
</a></span>
3535
</th>
3636
</tr>

lib/public/Template.php

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -28,121 +28,8 @@
2828
*
2929
*/
3030

31-
/**
32-
* Public interface of ownCloud for apps to use.
33-
* Template Class
34-
*
35-
*/
36-
37-
// use OCP namespace for all classes that are considered public.
38-
// This means that they should be used by apps instead of the internal ownCloud classes
3931
namespace OCP;
4032

41-
42-
/**
43-
* Make OC_Helper::imagePath available as a simple function
44-
* @param string $app
45-
* @param string $image
46-
* @return string to the image
47-
*
48-
* @see \OCP\IURLGenerator::imagePath
49-
* @deprecated 8.0.0 Use \OCP\Template::image_path() instead
50-
* @suppress PhanDeprecatedFunction
51-
*/
52-
function image_path($app, $image) {
53-
return \image_path($app, $image);
54-
}
55-
56-
57-
/**
58-
* Make OC_Helper::mimetypeIcon available as a simple function
59-
* @param string $mimetype
60-
* @return string to the image of this file type.
61-
* @deprecated 8.0.0 Use \OCP\Template::mimetype_icon() instead
62-
* @suppress PhanDeprecatedFunction
63-
*/
64-
function mimetype_icon($mimetype) {
65-
return \mimetype_icon($mimetype);
66-
}
67-
68-
/**
69-
* Make preview_icon available as a simple function
70-
* @param string $path path to file
71-
* @return string to the preview of the image
72-
* @deprecated 8.0.0 Use \OCP\Template::preview_icon() instead
73-
* @suppress PhanDeprecatedFunction
74-
*/
75-
function preview_icon($path) {
76-
return \preview_icon($path);
77-
}
78-
79-
/**
80-
* Make publicpreview_icon available as a simple function
81-
* Returns the path to the preview of the image.
82-
* @param string $path of file
83-
* @param string $token
84-
* @return string link to the preview
85-
* @deprecated 8.0.0 Use \OCP\Template::publicPreview_icon() instead
86-
* @suppress PhanDeprecatedFunction
87-
*/
88-
function publicPreview_icon($path, $token) {
89-
return \publicPreview_icon($path, $token);
90-
}
91-
92-
/**
93-
* Make OC_Helper::humanFileSize available as a simple function
94-
* Example: 2048 to 2 kB.
95-
* @param int $bytes in bytes
96-
* @return string size as string
97-
* @deprecated 8.0.0 Use \OCP\Template::human_file_size() instead
98-
* @suppress PhanDeprecatedFunction
99-
*/
100-
function human_file_size($bytes) {
101-
return \human_file_size($bytes);
102-
}
103-
104-
105-
/**
106-
* Return the relative date in relation to today. Returns something like "last hour" or "two month ago"
107-
* @param int $timestamp unix timestamp
108-
* @param boolean $dateOnly
109-
* @return string human readable interpretation of the timestamp
110-
*
111-
* @deprecated 8.0.0 Use \OCP\Template::relative_modified_date() instead
112-
* @suppress PhanDeprecatedFunction
113-
* @suppress PhanTypeMismatchArgument
114-
*/
115-
function relative_modified_date($timestamp, $dateOnly = false) {
116-
return \relative_modified_date($timestamp, null, $dateOnly);
117-
}
118-
119-
120-
/**
121-
* Return a human readable outout for a file size.
122-
* @param integer $bytes size of a file in byte
123-
* @return string human readable interpretation of a file size
124-
* @deprecated 8.0.0 Use \OCP\Template::human_file_size() instead
125-
* @suppress PhanDeprecatedFunction
126-
*/
127-
function simple_file_size($bytes) {
128-
return \human_file_size($bytes);
129-
}
130-
131-
132-
/**
133-
* Generate html code for an options block.
134-
* @param array $options the options
135-
* @param mixed $selected which one is selected?
136-
* @param array $params the parameters
137-
* @return string html options
138-
* @deprecated 8.0.0 Use \OCP\Template::html_select_options() instead
139-
* @suppress PhanDeprecatedFunction
140-
*/
141-
function html_select_options($options, $selected, $params=array()) {
142-
return \html_select_options($options, $selected, $params);
143-
}
144-
145-
14633
/**
14734
* This class provides the template system for owncloud. You can use it to load
14835
* specific templates, add data and generate the html code

0 commit comments

Comments
 (0)