diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-05-06 23:00:36 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-05-06 23:00:36 +0200 |
commit | 1945cd694636def02a2b2d4fb36720b3f0aeeb10 (patch) | |
tree | ee041bce0aaa57f99a6680c2138c8fef00129869 | |
parent | 5d55c709dddad44984446efa49ceb7084fc16b3f (diff) | |
download | nextcloud-server-1945cd694636def02a2b2d4fb36720b3f0aeeb10.tar.gz nextcloud-server-1945cd694636def02a2b2d4fb36720b3f0aeeb10.zip |
ported the oc_template class
82 files changed, 184 insertions, 140 deletions
diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php index f4915c3d2fe..2eb20414292 100755 --- a/apps/admin_dependencies_chk/settings.php +++ b/apps/admin_dependencies_chk/settings.php @@ -21,7 +21,7 @@ * */ $l=OC_L10N::get('admin_dependencies_chk'); -$tmpl = new OC_Template( 'admin_dependencies_chk', 'settings'); +$tmpl = new OCP\Template( 'admin_dependencies_chk', 'settings'); $modules = array(); diff --git a/apps/admin_migrate/settings.php b/apps/admin_migrate/settings.php index 7d3fd041798..daa56390aff 100755 --- a/apps/admin_migrate/settings.php +++ b/apps/admin_migrate/settings.php @@ -52,6 +52,6 @@ if (isset($_POST['admin_export'])) { } else { // fill template - $tmpl = new OC_Template('admin_migrate', 'settings'); + $tmpl = new OCP\Template('admin_migrate', 'settings'); return $tmpl->fetchPage(); }
\ No newline at end of file diff --git a/apps/bookmarks/index.php b/apps/bookmarks/index.php index f545d79da61..a4ce0229876 100755 --- a/apps/bookmarks/index.php +++ b/apps/bookmarks/index.php @@ -32,6 +32,6 @@ OCP\App::setActiveNavigationEntry( 'bookmarks_index' ); OCP\Util::addscript('bookmarks','bookmarks'); OCP\Util::addStyle('bookmarks', 'bookmarks'); -$tmpl = new OC_Template( 'bookmarks', 'list', 'user' ); +$tmpl = new OCP\Template( 'bookmarks', 'list', 'user' ); $tmpl->printPage(); diff --git a/apps/bookmarks/settings.php b/apps/bookmarks/settings.php index 9d945f64dad..6db36176330 100644..100755 --- a/apps/bookmarks/settings.php +++ b/apps/bookmarks/settings.php @@ -6,6 +6,6 @@ * See the COPYING-README file. */ -$tmpl = new OC_Template( 'bookmarks', 'settings'); +$tmpl = new OCP\Template( 'bookmarks', 'settings'); return $tmpl->fetchPage(); diff --git a/apps/calendar/ajax/calendar/edit.form.php b/apps/calendar/ajax/calendar/edit.form.php index 17118c5165f..77366809311 100755 --- a/apps/calendar/ajax/calendar/edit.form.php +++ b/apps/calendar/ajax/calendar/edit.form.php @@ -12,7 +12,7 @@ OCP\JSON::checkAppEnabled('calendar'); $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); $calendar = OC_Calendar_App::getCalendar($_GET['calendarid']); -$tmpl = new OC_Template("calendar", "part.editcalendar"); +$tmpl = new OCP\Template("calendar", "part.editcalendar"); $tmpl->assign('new', false); $tmpl->assign('calendarcolor_options', $calendarcolor_options); $tmpl->assign('calendar', $calendar); diff --git a/apps/calendar/ajax/calendar/edit.php b/apps/calendar/ajax/calendar/edit.php index 17118c5165f..77366809311 100755 --- a/apps/calendar/ajax/calendar/edit.php +++ b/apps/calendar/ajax/calendar/edit.php @@ -12,7 +12,7 @@ OCP\JSON::checkAppEnabled('calendar'); $calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions(); $calendar = OC_Calendar_App::getCalendar($_GET['calendarid']); -$tmpl = new OC_Template("calendar", "part.editcalendar"); +$tmpl = new OCP\Template("calendar", "part.editcalendar"); $tmpl->assign('new', false); $tmpl->assign('calendarcolor_options', $calendarcolor_options); $tmpl->assign('calendar', $calendar); diff --git a/apps/calendar/ajax/calendar/new.form.php b/apps/calendar/ajax/calendar/new.form.php index fa30b871e42..ee46757f56b 100755 --- a/apps/calendar/ajax/calendar/new.form.php +++ b/apps/calendar/ajax/calendar/new.form.php @@ -15,7 +15,7 @@ $calendar = array( 'displayname' => '', 'calendarcolor' => '', ); -$tmpl = new OC_Template('calendar', 'part.editcalendar'); +$tmpl = new OCP\Template('calendar', 'part.editcalendar'); $tmpl->assign('new', true); $tmpl->assign('calendarcolor_options', $calendarcolor_options); $tmpl->assign('calendar', $calendar); diff --git a/apps/calendar/ajax/calendar/new.php b/apps/calendar/ajax/calendar/new.php index 4b8688e3d1d..76dbef6b9df 100755 --- a/apps/calendar/ajax/calendar/new.php +++ b/apps/calendar/ajax/calendar/new.php @@ -29,7 +29,7 @@ $calendarid = OC_Calendar_Calendar::addCalendar($userid, strip_tags($_POST['name OC_Calendar_Calendar::setCalendarActive($calendarid, 1); $calendar = OC_Calendar_Calendar::find($calendarid); -$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); +$tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields'); $tmpl->assign('calendar', $calendar); OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), diff --git a/apps/calendar/ajax/calendar/overview.php b/apps/calendar/ajax/calendar/overview.php index 586bf3db814..96312537507 100755 --- a/apps/calendar/ajax/calendar/overview.php +++ b/apps/calendar/ajax/calendar/overview.php @@ -10,6 +10,6 @@ $l10n = OC_L10N::get('calendar'); OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('calendar'); -$output = new OC_TEMPLATE("calendar", "part.choosecalendar"); +$output = new OCP\Template("calendar", "part.choosecalendar"); $output -> printpage(); ?> diff --git a/apps/calendar/ajax/calendar/update.php b/apps/calendar/ajax/calendar/update.php index 408ac900912..3b1cc32b316 100755 --- a/apps/calendar/ajax/calendar/update.php +++ b/apps/calendar/ajax/calendar/update.php @@ -30,7 +30,7 @@ OC_Calendar_Calendar::editCalendar($calendarid, strip_tags($_POST['name']), null OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']); $calendar = OC_Calendar_App::getCalendar($calendarid); -$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); +$tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields'); $tmpl->assign('calendar', $calendar); OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), diff --git a/apps/calendar/ajax/event/edit.form.php b/apps/calendar/ajax/event/edit.form.php index 91d07d3897a..f2ea84dd205 100755 --- a/apps/calendar/ajax/event/edit.form.php +++ b/apps/calendar/ajax/event/edit.form.php @@ -206,9 +206,9 @@ $repeat_byweekno_options = OC_Calendar_App::getByWeekNoOptions(); $repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions(); if($access == 'owner' || $access == 'rw'){ - $tmpl = new OC_Template('calendar', 'part.editevent'); + $tmpl = new OCP\Template('calendar', 'part.editevent'); }elseif($access == 'r'){ - $tmpl = new OC_Template('calendar', 'part.showevent'); + $tmpl = new OCP\Template('calendar', 'part.showevent'); } $tmpl->assign('eventid', $id); diff --git a/apps/calendar/ajax/event/new.form.php b/apps/calendar/ajax/event/new.form.php index 42cdb81642e..f47cb6c3e2a 100755 --- a/apps/calendar/ajax/event/new.form.php +++ b/apps/calendar/ajax/event/new.form.php @@ -43,7 +43,7 @@ $repeat_bymonth_options = OC_Calendar_App::getByMonthOptions(); $repeat_byweekno_options = OC_Calendar_App::getByWeekNoOptions(); $repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions(); -$tmpl = new OC_Template('calendar', 'part.newevent'); +$tmpl = new OCP\Template('calendar', 'part.newevent'); $tmpl->assign('access', 'owner'); $tmpl->assign('calendar_options', $calendar_options); $tmpl->assign('repeat_options', $repeat_options); diff --git a/apps/calendar/ajax/import/dialog.php b/apps/calendar/ajax/import/dialog.php index e686066a993..3be02d2a6db 100755 --- a/apps/calendar/ajax/import/dialog.php +++ b/apps/calendar/ajax/import/dialog.php @@ -9,7 +9,7 @@ OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('calendar'); -$tmpl = new OC_Template('calendar', 'part.import'); +$tmpl = new OCP\Template('calendar', 'part.import'); $tmpl->assign('path', $_POST['path']); $tmpl->assign('filename', $_POST['filename']); $tmpl->printpage(); diff --git a/apps/calendar/ajax/share/dropdown.php b/apps/calendar/ajax/share/dropdown.php index bac487f0d0b..a3b0faca4bf 100755 --- a/apps/calendar/ajax/share/dropdown.php +++ b/apps/calendar/ajax/share/dropdown.php @@ -13,6 +13,6 @@ if($calendar['userid'] != $user){ OCP\JSON::error(); exit; } -$tmpl = new OC_Template('calendar', 'share.dropdown'); +$tmpl = new OCP\Template('calendar', 'share.dropdown'); $tmpl->assign('calid', $calid); $tmpl->printPage();
\ No newline at end of file diff --git a/apps/calendar/index.php b/apps/calendar/index.php index 5aee5f6ace8..cf03a7a3cd3 100755 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -53,7 +53,7 @@ OCP\Util::addStyle('', 'jquery.multiselect'); OCP\Util::addscript('contacts','jquery.multi-autocomplete'); OCP\Util::addscript('','oc-vcategories'); OCP\App::setActiveNavigationEntry('calendar_index'); -$tmpl = new OC_Template('calendar', 'calendar', 'user'); +$tmpl = new OCP\Template('calendar', 'calendar', 'user'); $tmpl->assign('eventSources', $eventSources); $tmpl->assign('categories', $categories); if(array_key_exists('showevent', $_GET)){ diff --git a/apps/calendar/settings.php b/apps/calendar/settings.php index 981df9ffafd..a18b1ca9f42 100755 --- a/apps/calendar/settings.php +++ b/apps/calendar/settings.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -$tmpl = new OC_Template( 'calendar', 'settings'); +$tmpl = new OCP\Template( 'calendar', 'settings'); $timezone=OCP\Config::getUserValue(OCP\USER::getUser(),'calendar','timezone',''); $tmpl->assign('timezone',$timezone); $tmpl->assign('timezones',DateTimeZone::listIdentifiers()); diff --git a/apps/calendar/templates/part.choosecalendar.php b/apps/calendar/templates/part.choosecalendar.php index af3b82a48fc..a140316ea07 100755 --- a/apps/calendar/templates/part.choosecalendar.php +++ b/apps/calendar/templates/part.choosecalendar.php @@ -5,7 +5,7 @@ $option_calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); for($i = 0; $i < count($option_calendars); $i++){ echo "<tr>"; - $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields'); + $tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields'); $tmpl->assign('calendar', $option_calendars[$i]); if(OC_Calendar_Share::allUsersSharedwith($option_calendars[$i]['id'], OC_Calendar_Share::CALENDAR) == array()){ $shared = false; @@ -36,7 +36,7 @@ $count = count($share); for($i = 0; $i < $count; $i++){ $share[$i]['calendar'] = OC_Calendar_App::getCalendar($share[$i]['calendarid'], false, false); echo '<tr>'; - $tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields.shared'); + $tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields.shared'); $tmpl->assign('share', $share[$i]); $tmpl->printpage(); echo '</tr>'; diff --git a/apps/calendar/templates/part.eventform.php b/apps/calendar/templates/part.eventform.php index 9e54616190c..b3bbf7a375b 100644..100755 --- a/apps/calendar/templates/part.eventform.php +++ b/apps/calendar/templates/part.eventform.php @@ -27,7 +27,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <th width="75px"><?php echo $l->t("Category");?>:</th> <td> <input id="category" name="categories" type="text" placeholder="<?php echo $l->t('Separate categories with commas'); ?>" value="<?php echo isset($_['categories']) ? htmlspecialchars($_['categories']) : '' ?>"> - <a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a> + <a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo OCP\image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a> </td> <?php if(count($_['calendar_options']) > 1) { ?> <th width="75px"> <?php echo $l->t("Calendar");?>:</th> @@ -35,7 +35,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <select style="width:140px;" name="calendar"> <?php if (!isset($_['calendar'])) {$_['calendar'] = false;} - echo html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname')); + echo OCP\html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname')); ?> </select> </td> @@ -101,7 +101,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <td> <select id="repeat" name="repeat"> <?php - echo html_select_options($_['repeat_options'], $_['repeat']); + echo OCP\html_select_options($_['repeat_options'], $_['repeat']); ?> </select></td> <td><input type="button" style="float:right;" class="submit" value="<?php echo $l->t("Advanced"); ?>" onclick="Calendar.UI.showadvancedoptionsforrepeating();" id="advanced_options_button"></td> @@ -114,7 +114,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <td> <select id="advanced_month_select" name="advanced_month_select"> <?php - echo html_select_options($_['repeat_month_options'], $_['repeat_month']); + echo OCP\html_select_options($_['repeat_month_options'], $_['repeat_month']); ?> </select> </td> @@ -126,7 +126,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <td> <select id="advanced_year_select" name="advanced_year_select"> <?php - echo html_select_options($_['repeat_year_options'], $_['repeat_year']); + echo OCP\html_select_options($_['repeat_year_options'], $_['repeat_year']); ?> </select> </td> @@ -138,7 +138,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <td id="weekofmonthcheckbox"> <select id="weekofmonthoptions" name="weekofmonthoptions"> <?php - echo html_select_options($_['repeat_weekofmonth_options'], $_['repeat_weekofmonth']); + echo OCP\html_select_options($_['repeat_weekofmonth_options'], $_['repeat_weekofmonth']); ?> </select> </td> @@ -151,7 +151,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <select id="weeklyoptions" name="weeklyoptions[]" multiple="multiple" style="width: 150px;" title="<?php echo $l->t("Select weekdays") ?>"> <?php if (!isset($_['weekdays'])) {$_['weekdays'] = array();} - echo html_select_options($_['repeat_weekly_options'], $_['repeat_weekdays'], array('combine'=>true)); + echo OCP\html_select_options($_['repeat_weekly_options'], $_['repeat_weekdays'], array('combine'=>true)); ?> </select> </td> @@ -164,7 +164,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <select id="byyearday" name="byyearday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>"> <?php if (!isset($_['repeat_byyearday'])) {$_['repeat_byyearday'] = array();} - echo html_select_options($_['repeat_byyearday_options'], $_['repeat_byyearday'], array('combine'=>true)); + echo OCP\html_select_options($_['repeat_byyearday_options'], $_['repeat_byyearday'], array('combine'=>true)); ?> </select><?php echo $l->t('and the events day of year.'); ?> </td> @@ -177,7 +177,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <select id="bymonthday" name="bymonthday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>"> <?php if (!isset($_['repeat_bymonthday'])) {$_['repeat_bymonthday'] = array();} - echo html_select_options($_['repeat_bymonthday_options'], $_['repeat_bymonthday'], array('combine'=>true)); + echo OCP\html_select_options($_['repeat_bymonthday_options'], $_['repeat_bymonthday'], array('combine'=>true)); ?> </select><?php echo $l->t('and the events day of month.'); ?> </td> @@ -190,7 +190,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <select id="bymonth" name="bymonth[]" multiple="multiple" title="<?php echo $l->t("Select months") ?>"> <?php if (!isset($_['repeat_bymonth'])) {$_['repeat_bymonth'] = array();} - echo html_select_options($_['repeat_bymonth_options'], $_['repeat_bymonth'], array('combine'=>true)); + echo OCP\html_select_options($_['repeat_bymonth_options'], $_['repeat_bymonth'], array('combine'=>true)); ?> </select> </td> @@ -203,7 +203,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <select id="byweekno" name="byweekno[]" multiple="multiple" title="<?php echo $l->t("Select weeks") ?>"> <?php if (!isset($_['repeat_byweekno'])) {$_['repeat_byweekno'] = array();} - echo html_select_options($_['repeat_byweekno_options'], $_['repeat_byweekno'], array('combine'=>true)); + echo OCP\html_select_options($_['repeat_byweekno_options'], $_['repeat_byweekno'], array('combine'=>true)); ?> </select><?php echo $l->t('and the events week of year.'); ?> </td> @@ -222,7 +222,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid <select id="end" name="end"> <?php if($_['repeat_end'] == '') $_['repeat_end'] = 'never'; - echo html_select_options($_['repeat_end_options'], $_['repeat_end']); + echo OCP\html_select_options($_['repeat_end_options'], $_['repeat_end']); ?> </select> </td> diff --git a/apps/calendar/templates/part.import.php b/apps/calendar/templates/part.import.php index 80375c3ef78..e93ea1af4c9 100755 --- a/apps/calendar/templates/part.import.php +++ b/apps/calendar/templates/part.import.php @@ -8,7 +8,7 @@ <?php $calendar_options = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser()); $calendar_options[] = array('id'=>'newcal', 'displayname'=>$l->t('create a new calendar')); -echo html_select_options($calendar_options, $calendar_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); +echo OCP\html_select_options($calendar_options, $calendar_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); ?> </select> <div id="newcalform" style="display: none;"> diff --git a/apps/calendar/templates/part.showevent.php b/apps/calendar/templates/part.showevent.php index cad8bd27fb7..3646baf5bb7 100644..100755 --- a/apps/calendar/templates/part.showevent.php +++ b/apps/calendar/templates/part.showevent.php @@ -23,7 +23,7 @@ echo $l->t('No categories selected'); }else{ echo '<select id="category" name="categories[]" multiple="multiple" title="' . $l->t("Select category") . '">'; - echo html_select_options($_['categories'], $_['categories'], array('combine'=>true)); + echo OCP\html_select_options($_['categories'], $_['categories'], array('combine'=>true)); echo '</select>'; } ?> @@ -99,7 +99,7 @@ <td> <select id="repeat" name="repeat"> <?php - echo html_select_options(array($_['repeat_options'][$_['repeat']]), $_['repeat']); + echo OCP\html_select_options(array($_['repeat_options'][$_['repeat']]), $_['repeat']); ?> </select></td> <td><input type="button" style="float:right;" class="submit" value="<?php echo $l->t("Advanced"); ?>" onclick="Calendar.UI.showadvancedoptionsforrepeating();" id="advanced_options_button"></td> @@ -112,7 +112,7 @@ <td> <select id="advanced_month_select" name="advanced_month_select"> <?php - echo html_select_options(array($_['repeat_month_options'][$_['repeat_month']]), $_['repeat_month']); + echo OCP\html_select_options(array($_['repeat_month_options'][$_['repeat_month']]), $_['repeat_month']); ?> </select> </td> @@ -124,7 +124,7 @@ <td> <select id="advanced_year_select" name="advanced_year_select"> <?php - echo html_select_options(array($_['repeat_year_options'][$_['repeat_year']]), $_['repeat_year']); + echo OCP\html_select_options(array($_['repeat_year_options'][$_['repeat_year']]), $_['repeat_year']); ?> </select> </td> @@ -136,7 +136,7 @@ <td id="weekofmonthcheckbox"> <select id="weekofmonthoptions" name="weekofmonthoptions"> <?php - echo html_select_options(array($_['repeat_weekofmonth_options'][$_['repeat_weekofmonth']]), $_['repeat_weekofmonth']); + echo OCP\html_select_options(array($_['repeat_weekofmonth_options'][$_['repeat_weekofmonth']]), $_['repeat_weekofmonth']); ?> </select> </td> @@ -149,7 +149,7 @@ <select id="weeklyoptions" name="weeklyoptions[]" multiple="multiple" style="width: 150px;" title="<?php echo $l->t("Select weekdays") ?>"> <?php if (!isset($_['weekdays'])) {$_['weekdays'] = array();} - echo html_select_options(array($_['repeat_weekly_options'][$_['repeat_weekdays']]), $_['repeat_weekdays'], array('combine'=>true)); + echo OCP\html_select_options(array($_['repeat_weekly_options'][$_['repeat_weekdays']]), $_['repeat_weekdays'], array('combine'=>true)); ?> </select> </td> @@ -162,7 +162,7 @@ <select id="byyearday" name="byyearday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>"> <?php if (!isset($_['repeat_byyearday'])) {$_['repeat_byyearday'] = array();} - echo html_select_options(array($_['repeat_byyearday_options'][$_['repeat_byyearday']]), $_['repeat_byyearday'], array('combine'=>true)); + echo OCP\html_select_options(array($_['repeat_byyearday_options'][$_['repeat_byyearday']]), $_['repeat_byyearday'], array('combine'=>true)); ?> </select><?php echo $l->t('and the events day of year.'); ?> </td> @@ -175,7 +175,7 @@ <select id="bymonthday" name="bymonthday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>"> <?php if (!isset($_['repeat_bymonthday'])) {$_['repeat_bymonthday'] = array();} - echo html_select_options(array($_['repeat_bymonthday_options'][$_['repeat_bymonthday']]), $_['repeat_bymonthday'], array('combine'=>true)); + echo OCP\html_select_options(array($_['repeat_bymonthday_options'][$_['repeat_bymonthday']]), $_['repeat_bymonthday'], array('combine'=>true)); ?> </select><?php echo $l->t('and the events day of month.'); ?> </td> @@ -188,7 +188,7 @@ <select id="bymonth" name="bymonth[]" multiple="multiple" title="<?php echo $l->t("Select months") ?>"> <?php if (!isset($_['repeat_bymonth'])) {$_['repeat_bymonth'] = array();} - echo html_select_options(array($_['repeat_bymonth_options'][$_['repeat_bymonth']]), $_['repeat_bymonth'], array('combine'=>true)); + echo OCP\html_select_options(array($_['repeat_bymonth_options'][$_['repeat_bymonth']]), $_['repeat_bymonth'], array('combine'=>true)); ?> </select> </td> @@ -201,7 +201,7 @@ <select id="byweekno" name="byweekno[]" multiple="multiple" title="<?php echo $l->t("Select weeks") ?>"> <?php if (!isset($_['repeat_byweekno'])) {$_['repeat_byweekno'] = array();} - echo html_select_options(array($_['repeat_byweekno_options'][$_['repeat_byweekno']]), $_['repeat_byweekno'], array('combine'=>true)); + echo OCP\html_select_options(array($_['repeat_byweekno_options'][$_['repeat_byweekno']]), $_['repeat_byweekno'], array('combine'=>true)); ?> </select><?php echo $l->t('and the events week of year.'); ?> </td> @@ -220,7 +220,7 @@ <select id="end" name="end"> <?php if($_['repeat_end'] == '') $_['repeat_end'] = 'never'; - echo html_select_options(array($_['repeat_end_options'][$_['repeat_end']]), $_['repeat_end']); + echo OCP\html_select_options(array($_['repeat_end_options'][$_['repeat_end']]), $_['repeat_end']); ?> </select> </td> diff --git a/apps/calendar/templates/share.dropdown.php b/apps/calendar/templates/share.dropdown.php index b11a4ef94cf..e0dabebf257 100755 --- a/apps/calendar/templates/share.dropdown.php +++ b/apps/calendar/templates/share.dropdown.php @@ -28,7 +28,7 @@ foreach($allocusers as $ocuser){ } unset($allusers[OCP\USER::getUser()]); $allusers = array_flip($allusers); -echo html_select_options($allusers, array()); +echo OCP\html_select_options($allusers, array()); ?> </select><br> <ul id="sharewithuser_list"> @@ -54,7 +54,7 @@ $allgroups = array(); foreach($allocgroups as $ocgroup){ $allgroups[$ocgroup] = $ocgroup; } -echo html_select_options($allgroups, array()); +echo OCP\html_select_options($allgroups, array()); ?> </select><br> <ul id="sharewithgroup_list"> diff --git a/apps/contacts/ajax/addbook.php b/apps/contacts/ajax/addbook.php index 254af1c3f50..70f47cc8123 100755 --- a/apps/contacts/ajax/addbook.php +++ b/apps/contacts/ajax/addbook.php @@ -13,7 +13,7 @@ $book = array( 'id' => 'new', 'displayname' => '', ); -$tmpl = new OC_Template('contacts', 'part.editaddressbook'); +$tmpl = new OCP\Template('contacts', 'part.editaddressbook'); $tmpl->assign('new', true); $tmpl->assign('addressbook', $book); $tmpl->printPage(); diff --git a/apps/contacts/ajax/chooseaddressbook.php b/apps/contacts/ajax/chooseaddressbook.php index 2fe55606d1d..9088a4e9d7d 100755 --- a/apps/contacts/ajax/chooseaddressbook.php +++ b/apps/contacts/ajax/chooseaddressbook.php @@ -10,5 +10,5 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); -$output = new OC_TEMPLATE("contacts", "part.chooseaddressbook"); +$output = new OCP\Template("contacts", "part.chooseaddressbook"); $output -> printpage(); diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php index 93e618a0800..37d396cd83a 100755 --- a/apps/contacts/ajax/contacts.php +++ b/apps/contacts/ajax/contacts.php @@ -12,7 +12,7 @@ OCP\JSON::checkAppEnabled('contacts'); $ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser()); $contacts = OC_Contacts_VCard::all($ids); -$tmpl = new OC_TEMPLATE("contacts", "part.contacts"); +$tmpl = new OCP\Template("contacts", "part.contacts"); $tmpl->assign('contacts', $contacts); $page = $tmpl->fetchPage(); diff --git a/apps/contacts/ajax/createaddressbook.php b/apps/contacts/ajax/createaddressbook.php index 772232b67d7..af7c19eef51 100755 --- a/apps/contacts/ajax/createaddressbook.php +++ b/apps/contacts/ajax/createaddressbook.php @@ -32,7 +32,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, 1)) { //exit(); } $addressbook = OC_Contacts_App::getAddressbook($bookid); -$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); +$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), diff --git a/apps/contacts/ajax/cropphoto.php b/apps/contacts/ajax/cropphoto.php index 125dd107602..7b286dbdb52 100755 --- a/apps/contacts/ajax/cropphoto.php +++ b/apps/contacts/ajax/cropphoto.php @@ -30,7 +30,7 @@ OCP\JSON::checkAppEnabled('contacts'); $tmp_path = $_GET['tmp_path']; $id = $_GET['id']; OCP\Util::writeLog('contacts','ajax/cropphoto.php: tmp_path: '.$tmp_path.', exists: '.file_exists($tmp_path), OCP\Util::DEBUG); -$tmpl = new OC_TEMPLATE("contacts", "part.cropphoto"); +$tmpl = new OCP\Template("contacts", "part.cropphoto"); $tmpl->assign('tmp_path', $tmp_path); $tmpl->assign('id', $id); $page = $tmpl->fetchPage(); diff --git a/apps/contacts/ajax/editaddress.php b/apps/contacts/ajax/editaddress.php index 4044eb5a359..9fb35a0b5f7 100755 --- a/apps/contacts/ajax/editaddress.php +++ b/apps/contacts/ajax/editaddress.php @@ -15,7 +15,7 @@ $checksum = isset($_GET['checksum'])?$_GET['checksum']:''; $vcard = OC_Contacts_App::getContactVCard($id); $adr_types = OC_Contacts_App::getTypesOfProperty('ADR'); -$tmpl = new OC_TEMPLATE("contacts", "part.edit_address_dialog"); +$tmpl = new OCP\Template("contacts", "part.edit_address_dialog"); if($checksum) { $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); $element = $vcard->children[$line]; diff --git a/apps/contacts/ajax/editaddressbook.php b/apps/contacts/ajax/editaddressbook.php index fe1806a7b8a..7a9b757ae0d 100755 --- a/apps/contacts/ajax/editaddressbook.php +++ b/apps/contacts/ajax/editaddressbook.php @@ -10,7 +10,7 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); $addressbook = OC_Contacts_App::getAddressbook($_GET['bookid']); -$tmpl = new OC_Template("contacts", "part.editaddressbook"); +$tmpl = new OCP\Template("contacts", "part.editaddressbook"); $tmpl->assign('new', false); $tmpl->assign('addressbook', $addressbook); $tmpl->printPage(); diff --git a/apps/contacts/ajax/editname.php b/apps/contacts/ajax/editname.php index 155bee70a7f..dc64eeb5101 100755 --- a/apps/contacts/ajax/editname.php +++ b/apps/contacts/ajax/editname.php @@ -18,7 +18,7 @@ function debug($msg) { OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG); } -$tmpl = new OC_TEMPLATE("contacts", "part.edit_name_dialog"); +$tmpl = new OCP\Template("contacts", "part.edit_name_dialog"); $id = isset($_GET['id'])?$_GET['id']:''; debug('id: '.$id); diff --git a/apps/contacts/ajax/importaddressbook.php b/apps/contacts/ajax/importaddressbook.php index 66cfa4f8af4..f93bbfa4d9d 100755 --- a/apps/contacts/ajax/importaddressbook.php +++ b/apps/contacts/ajax/importaddressbook.php @@ -16,7 +16,7 @@ $freeSpace=OC_Filesystem::free_space('/'); $freeSpace=max($freeSpace,0); $maxUploadFilesize = min($maxUploadFilesize ,$freeSpace); -$tmpl = new OC_Template('contacts', 'part.importaddressbook'); +$tmpl = new OCP\Template('contacts', 'part.importaddressbook'); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->printpage(); diff --git a/apps/contacts/ajax/importdialog.php b/apps/contacts/ajax/importdialog.php index 7a564ccec83..5f8805a6106 100755 --- a/apps/contacts/ajax/importdialog.php +++ b/apps/contacts/ajax/importdialog.php @@ -9,7 +9,7 @@ OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); -$tmpl = new OC_Template('contacts', 'part.import'); +$tmpl = new OCP\Template('contacts', 'part.import'); $tmpl->assign('path', $_POST['path']); $tmpl->assign('filename', $_POST['filename']); $tmpl->printpage(); diff --git a/apps/contacts/ajax/loadcard.php b/apps/contacts/ajax/loadcard.php index 047db4d940c..4e6f2206fef 100755 --- a/apps/contacts/ajax/loadcard.php +++ b/apps/contacts/ajax/loadcard.php @@ -49,7 +49,7 @@ $adr_types = OC_Contacts_App::getTypesOfProperty('ADR'); $phone_types = OC_Contacts_App::getTypesOfProperty('TEL'); $email_types = OC_Contacts_App::getTypesOfProperty('EMAIL'); -$tmpl = new OC_Template('contacts','part.contact'); +$tmpl = new OCP\Template('contacts','part.contact'); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->assign('adr_types',$adr_types); diff --git a/apps/contacts/ajax/loadintro.php b/apps/contacts/ajax/loadintro.php index 8ad828ebba3..6e8fcc4b049 100755 --- a/apps/contacts/ajax/loadintro.php +++ b/apps/contacts/ajax/loadintro.php @@ -25,7 +25,7 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); -$tmpl = new OC_Template('contacts','part.no_contacts'); +$tmpl = new OCP\Template('contacts','part.no_contacts'); $page = $tmpl->fetchPage(); OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/loadphoto.php b/apps/contacts/ajax/loadphoto.php index 9913fe13e11..ef429e82891 100755 --- a/apps/contacts/ajax/loadphoto.php +++ b/apps/contacts/ajax/loadphoto.php @@ -53,7 +53,7 @@ foreach($vcard->children as $property){ } } -$tmpl = new OC_TEMPLATE("contacts", "part.contactphoto"); +$tmpl = new OCP\Template("contacts", "part.contactphoto"); $tmpl->assign('id', $id); if($refresh) { $tmpl->assign('refresh', 1); diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php index 5418e26cd10..cd470307125 100755 --- a/apps/contacts/ajax/savecrop.php +++ b/apps/contacts/ajax/savecrop.php @@ -101,7 +101,7 @@ if(file_exists($tmp_path)) { } unlink($tmpfname); //$result=array( "status" => "success", 'mime'=>$image->mimeType(), 'tmp'=>$tmp_path); - $tmpl = new OC_TEMPLATE("contacts", "part.contactphoto"); + $tmpl = new OCP\Template("contacts", "part.contactphoto"); $tmpl->assign('tmp_path', $tmpfname); $tmpl->assign('mime', $image->mimeType()); $tmpl->assign('id', $id); diff --git a/apps/contacts/ajax/updateaddressbook.php b/apps/contacts/ajax/updateaddressbook.php index 13f1c15ac23..19b5b3bddce 100755 --- a/apps/contacts/ajax/updateaddressbook.php +++ b/apps/contacts/ajax/updateaddressbook.php @@ -35,7 +35,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { } $addressbook = OC_Contacts_App::getAddressbook($bookid); -$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); +$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), diff --git a/apps/contacts/index.php b/apps/contacts/index.php index 69e7d57309f..74b7c43c556 100755 --- a/apps/contacts/index.php +++ b/apps/contacts/index.php @@ -58,7 +58,7 @@ OCP\Util::addStyle('contacts','jquery.combobox'); OCP\Util::addStyle('contacts','jquery.Jcrop'); OCP\Util::addStyle('contacts','contacts'); -$tmpl = new OC_Template( "contacts", "index", "user" ); +$tmpl = new OCP\Template( "contacts", "index", "user" ); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->assign('property_types', $property_types); diff --git a/apps/contacts/settings.php b/apps/contacts/settings.php index b88128823a7..c88fed0b4d6 100644..100755 --- a/apps/contacts/settings.php +++ b/apps/contacts/settings.php @@ -1,6 +1,6 @@ <?php -$tmpl = new OC_Template( 'contacts', 'settings'); +$tmpl = new OCP\Template( 'contacts', 'settings'); return $tmpl->fetchPage(); ?> diff --git a/apps/contacts/templates/part.chooseaddressbook.php b/apps/contacts/templates/part.chooseaddressbook.php index 91b2f51c3b4..a0ec053ab91 100755 --- a/apps/contacts/templates/part.chooseaddressbook.php +++ b/apps/contacts/templates/part.chooseaddressbook.php @@ -4,7 +4,7 @@ $option_addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser()); for($i = 0; $i < count($option_addressbooks); $i++){ echo "<tr>"; - $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); + $tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $option_addressbooks[$i]); $tmpl->assign('active', OC_Contacts_Addressbook::isActive($option_addressbooks[$i]['id'])); $tmpl->printpage(); diff --git a/apps/contacts/templates/part.contact.php b/apps/contacts/templates/part.contact.php index 4c23dac783b..74522be37c4 100755 --- a/apps/contacts/templates/part.contact.php +++ b/apps/contacts/templates/part.contact.php @@ -55,7 +55,7 @@ $id = isset($_['id']) ? $_['id'] : ''; <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" /> <input type="email" required="required" class="nonempty contacts_property" name="value" value="" x-moz-errormessage="<?php echo $l->t('Please specify a valid email address.'); ?>" placeholder="<?php echo $l->t('Enter email address'); ?>" /> <select class="hidden" multiple="multiple" name="parameters[TYPE][]"> - <?php echo html_select_options($_['email_types'], array()) ?> + <?php echo OCP\html_select_options($_['email_types'], array()) ?> </select> <span class="listactions"><a class="action mail" title="<?php echo $l->t('Mail to address'); ?>"></a> <a role="button" class="action delete" title="<?php echo $l->t('Delete email address'); ?>"></a></span></li> @@ -69,7 +69,7 @@ $id = isset($_['id']) ? $_['id'] : ''; <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" /> <input type="text" required="required" class="nonempty contacts_property" name="value" value="" placeholder="<?php echo $l->t('Enter phone number'); ?>" /> <select multiple="multiple" name="parameters[TYPE][]"> - <?php echo html_select_options($_['phone_types'], array()) ?> + <?php echo OCP\html_select_options($_['phone_types'], array()) ?> </select> <a role="button" class="action delete" title="<?php echo $l->t('Delete phone number'); ?>"></a></li> </ul> diff --git a/apps/contacts/templates/part.edit_address_dialog.php b/apps/contacts/templates/part.edit_address_dialog.php index 507a3acaa0c..8b3425033cc 100644..100755 --- a/apps/contacts/templates/part.edit_address_dialog.php +++ b/apps/contacts/templates/part.edit_address_dialog.php @@ -15,7 +15,7 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra </dt> <dd> <select id="adr_type" name="parameters[ADR][TYPE]" size="1"> - <?php echo html_select_options($_['adr_types'], $types) ?> + <?php echo OCP\html_select_options($_['adr_types'], $types) ?> </select> </dd> <dt> diff --git a/apps/contacts/templates/part.edit_name_dialog.php b/apps/contacts/templates/part.edit_name_dialog.php index bb774b62bd7..be45f9a5b06 100644..100755 --- a/apps/contacts/templates/part.edit_name_dialog.php +++ b/apps/contacts/templates/part.edit_name_dialog.php @@ -16,7 +16,7 @@ $addressbooks = isset($_['addressbooks'])?$_['addressbooks']:null; <dt><label for="addressbook"><?php echo $l->t('Addressbook'); ?></label></dt> <dd> <select id="aid" name="aid" size="1"> - <?php echo html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?> + <?php echo OCP\html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?> </select> </dd> <?php }} ?> diff --git a/apps/contacts/templates/part.import.php b/apps/contacts/templates/part.import.php index a2f8aefa6f4..2dac7dd0ca1 100755 --- a/apps/contacts/templates/part.import.php +++ b/apps/contacts/templates/part.import.php @@ -8,7 +8,7 @@ <?php $contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser()); $contacts_options[] = array('id'=>'newaddressbook', 'displayname'=>$l->t('create a new addressbook')); -echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); +echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); ?> </select> <div id="newaddressbookform" style="display: none;"> diff --git a/apps/contacts/templates/part.importaddressbook.php b/apps/contacts/templates/part.importaddressbook.php index 9a13ba1b0cd..a055dd60356 100755 --- a/apps/contacts/templates/part.importaddressbook.php +++ b/apps/contacts/templates/part.importaddressbook.php @@ -14,7 +14,7 @@ <select id="book" name="book" class="float"> <?php $contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser()); - echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); + echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); ?> </select> <span id="import_drop_target" class="droptarget float"><?php echo $l->t("Drop a VCF file to import contacts."); ?> (Max. <?php echo $_['uploadMaxHumanFilesize']; ?>)</span> diff --git a/apps/external/index.php b/apps/external/index.php index f1f6cbac3cf..d63be3ad1d5 100755 --- a/apps/external/index.php +++ b/apps/external/index.php @@ -35,7 +35,7 @@ if (isset($_GET['id'])) { $url = $sites[$id - 1][1]; OCP\App::setActiveNavigationEntry('external_index' . $id); - $tmpl = new OC_Template('external', 'frame', 'user'); + $tmpl = new OCP\Template('external', 'frame', 'user'); $tmpl->assign('url', $url); $tmpl->printPage(); } diff --git a/apps/external/settings.php b/apps/external/settings.php index c1a4242c333..c109733e548 100755 --- a/apps/external/settings.php +++ b/apps/external/settings.php @@ -4,7 +4,7 @@ OCP\User::checkAdminUser(); OCP\Util::addscript( "external", "admin" ); -$tmpl = new OC_Template( 'external', 'settings'); +$tmpl = new OCP\Template( 'external', 'settings'); return $tmpl->fetchPage(); ?> diff --git a/apps/external/templates/settings.php b/apps/external/templates/settings.php index a130477d465..b8139727eb6 100644..100755 --- a/apps/external/templates/settings.php +++ b/apps/external/templates/settings.php @@ -8,7 +8,7 @@ for($i = 0; $i < sizeof($sites); $i++) { echo '<li><input type="text" name="site_name[]" class="site_name" value="'.$sites[$i][0].'" placeholder="'.$l->t('Name').'" /> <input type="text" class="site_url" name="site_url[]" value="'.$sites[$i][1].'" placeholder="'.$l->t('URL').'" /> - <img class="svg action delete_button" src="'.image_path("", "actions/delete.svg") .'" title="'.$l->t("Remove site").'" /> + <img class="svg action delete_button" src="'.OCP\image_path("", "actions/delete.svg") .'" title="'.$l->t("Remove site").'" /> </li>'; } ?> diff --git a/apps/files/admin.php b/apps/files/admin.php index a59a73f0a5b..b0c2b35c696 100755 --- a/apps/files/admin.php +++ b/apps/files/admin.php @@ -51,7 +51,7 @@ $allowZipDownload = intval(OCP\Config::getSystemValue('allowZipDownload', true)) OCP\App::setActiveNavigationEntry( "files_administration" ); -$tmpl = new OC_Template( 'files', 'admin' ); +$tmpl = new OCP\Template( 'files', 'admin' ); $tmpl->assign( 'htaccessWorking', $htaccessWorking ); $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign( 'maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX)); diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 520e54e708d..ceb8d158580 100755 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -24,7 +24,7 @@ if($doBreadcrumb){ } } - $breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" ); + $breadcrumbNav = new OCP\Template( "files", "part.breadcrumb", "" ); $breadcrumbNav->assign( "breadcrumb", $breadcrumb ); $data['breadcrumb'] = $breadcrumbNav->fetchPage(); @@ -37,7 +37,7 @@ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){ $files[] = $i; } -$list = new OC_Template( "files", "part.list", "" ); +$list = new OCP\Template( "files", "part.list", "" ); $list->assign( "files", $files ); $data = array('files' => $list->fetchPage()); diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php index 36dd35cc73e..6e7ace91013 100755 --- a/apps/files/ajax/rawlist.php +++ b/apps/files/ajax/rawlist.php @@ -17,7 +17,7 @@ $mimetype = isset($_GET['mimetype']) ? $_GET['mimetype'] : ''; $files = array(); foreach( OC_Files::getdirectorycontent( $dir, $mimetype ) as $i ){ $i["date"] = OCP\Util::formatDate($i["mtime"] ); - $i['mimetype_icon'] = $i['type'] == 'dir' ? mimetype_icon('dir'): mimetype_icon($i['mimetype']); + $i['mimetype_icon'] = $i['type'] == 'dir' ? OCP\mimetype_icon('dir'): OCP\mimetype_icon($i['mimetype']); $files[] = $i; } diff --git a/apps/files/download.php b/apps/files/download.php index e98cf2ecd31..2b5d4e2d876 100755 --- a/apps/files/download.php +++ b/apps/files/download.php @@ -31,7 +31,7 @@ $filename = $_GET["file"]; if(!OC_Filesystem::file_exists($filename)){ header("HTTP/1.0 404 Not Found"); - $tmpl = new OC_Template( '', '404', 'guest' ); + $tmpl = new OCP\Template( '', '404', 'guest' ); $tmpl->assign('file',$filename); $tmpl->printPage(); exit; diff --git a/apps/files/index.php b/apps/files/index.php index e2a0eb80a03..0c439e4ae1a 100755 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -72,11 +72,11 @@ foreach( explode( "/", $dir ) as $i ){ } // make breadcrumb und filelist markup -$list = new OC_Template( "files", "part.list", "" ); +$list = new OCP\Template( "files", "part.list", "" ); $list->assign( "files", $files ); $list->assign( "baseURL", OCP\Util::linkTo("files", "index.php")."?dir="); $list->assign( "downloadURL", OCP\Util::linkTo("files", "download.php")."?file="); -$breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" ); +$breadcrumbNav = new OCP\Template( "files", "part.breadcrumb", "" ); $breadcrumbNav->assign( "breadcrumb", $breadcrumb ); $breadcrumbNav->assign( "baseURL", OCP\Util::linkTo("files", "index.php")."?dir="); @@ -88,7 +88,7 @@ $freeSpace=OC_Filesystem::free_space('/'); $freeSpace=max($freeSpace,0); $maxUploadFilesize = min($maxUploadFilesize ,$freeSpace); -$tmpl = new OC_Template( "files", "index", "user" ); +$tmpl = new OCP\Template( "files", "index", "user" ); $tmpl->assign( "fileList", $list->fetchPage() ); $tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() ); $tmpl->assign( 'dir', $dir); diff --git a/apps/files/settings.php b/apps/files/settings.php index cfadc54573d..e5a66239ebd 100755 --- a/apps/files/settings.php +++ b/apps/files/settings.php @@ -52,7 +52,7 @@ foreach( explode( "/", $dir ) as $i ){ } // return template -$tmpl = new OC_Template( "files", "index", "user" ); +$tmpl = new OCP\Template( "files", "index", "user" ); $tmpl->assign( 'files', $files ); $tmpl->assign( "breadcrumb", $breadcrumb ); $tmpl->printPage(); diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 25193648387..72e45d53275 100755 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -6,9 +6,9 @@ <div id='new' class='button'> <a><?php echo $l->t('New');?></a> <ul class="popup popupTop"> - <li style="background-image:url('<?php echo mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li> - <li style="background-image:url('<?php echo mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li> - <li style="background-image:url('<?php echo image_path('core','actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From url');?></p></li> + <li style="background-image:url('<?php echo OCP\mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li> + <li style="background-image:url('<?php echo OCP\mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li> + <li style="background-image:url('<?php echo OCP\image_path('core','actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From url');?></p></li> </ul> </div> <div class="file_upload_wrapper svg"> @@ -16,7 +16,7 @@ <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload"> <input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)"> <input type="hidden" name="dir" value="<?php echo htmlentities($_['dir']) ?>" id="dir"> - <button class="file_upload_filename"> <img class='svg action' alt="Upload" src="<?php echo image_path("core", "actions/upload.svg"); ?>" /></button> + <button class="file_upload_filename"> <img class='svg action' alt="Upload" src="<?php echo OCP\image_path("core", "actions/upload.svg"); ?>" /></button> <input class="file_upload_start" type="file" name='files[]'/> <a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a> <iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe> @@ -46,14 +46,14 @@ <?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" id="select_all" /><?php } ?> <span class='name'><?php echo $l->t( 'Name' ); ?></span> <span class='selectedActions'> - <a href="" class="share"><img class='svg' alt="Share" src="<?php echo image_path("core", "actions/share.svg"); ?>" /> <?php echo $l->t('Share')?></a> + <a href="" class="share"><img class='svg' alt="Share" src="<?php echo OCP\image_path("core", "actions/share.svg"); ?>" /> <?php echo $l->t('Share')?></a> <?php if($_['allowZipDownload']) : ?> - <a href="" class="download"><img class='svg' alt="Download" src="<?php echo image_path("core", "actions/download.svg"); ?>" /> <?php echo $l->t('Download')?></a> + <a href="" class="download"><img class='svg' alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /> <?php echo $l->t('Download')?></a> <?php endif; ?> </span> </th> <th id="headerSize"><?php echo $l->t( 'Size' ); ?></th> - <th id="headerDate"><span id="modified"><?php echo $l->t( 'Modified' ); ?></span><span class="selectedActions"><a href="" class="delete"><?php echo $l->t('Delete all')?> <img class="svg" alt="<?php echo $l->t('Delete')?>" src="<?php echo image_path("core", "actions/delete.svg"); ?>" /></a></span></th> + <th id="headerDate"><span id="modified"><?php echo $l->t( 'Modified' ); ?></span><span class="selectedActions"><a href="" class="delete"><?php echo $l->t('Delete all')?> <img class="svg" alt="<?php echo $l->t('Delete')?>" src="<?php echo OCP\image_path("core", "actions/delete.svg"); ?>" /></a></span></th> </tr> </thead> <tbody id="fileList" data-readonly="<?php echo $_['readonly'];?>"> diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php index 16da6bb97b4..41d2c5c8e76 100644..100755 --- a/apps/files/templates/part.breadcrumb.php +++ b/apps/files/templates/part.breadcrumb.php @@ -1,6 +1,6 @@ <?php for($i=0; $i<count($_["breadcrumb"]); $i++): $crumb = $_["breadcrumb"][$i]; ?> - <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo image_path('core','breadcrumb.png');?>")'> + <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'> <a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlentities($crumb["name"]); ?></a> </div> <?php endfor;?>
\ No newline at end of file diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php index b2db4cbb8df..4506630c16d 100644..100755 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -1,9 +1,9 @@ <?php foreach($_['files'] as $file): $write = ($file['writable']) ? 'true' : 'false'; - $simple_file_size = simple_file_size($file['size']); + $simple_file_size = OCP\simple_file_size($file['size']); $simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2 if($simple_size_color<0) $simple_size_color = 0; - $relative_modified_date = relative_modified_date($file['mtime']); + $relative_modified_date = OCP\relative_modified_date($file['mtime']); $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14 if($relative_date_color>200) $relative_date_color = 200; $name = str_replace('+','%20',urlencode($file['name'])); @@ -11,7 +11,7 @@ $directory = str_replace('+','%20',urlencode($file['directory'])); $directory = str_replace('%2F','/', $directory); ?> <tr data-file="<?php echo $name;?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mimetype']?>" data-size='<?php echo $file['size'];?>' data-write='<?php echo $write;?>'> - <td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mimetype']); ?>)"> + <td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo OCP\mimetype_icon('dir'); else echo OCP\mimetype_icon($file['mimetype']); ?>)"> <?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?> <a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$directory.'/'.$name; else echo $_['downloadURL'].$directory.'/'.$name; ?>" title=""> <span class="nametext"> @@ -27,7 +27,7 @@ <?php endif;?> </a> </td> - <td class="filesize" title="<?php echo human_file_size($file['size']); ?>" style="color:rgb(<?php echo $simple_size_color.','.$simple_size_color.','.$simple_size_color ?>)"><?php echo $simple_file_size; ?></td> + <td class="filesize" title="<?php echo OCP\human_file_size($file['size']); ?>" style="color:rgb(<?php echo $simple_size_color.','.$simple_size_color.','.$simple_size_color ?>)"><?php echo $simple_file_size; ?></td> <td class="date"><span class="modified" title="<?php echo $file['date']; ?>" style="color:rgb(<?php echo $relative_date_color.','.$relative_date_color.','.$relative_date_color ?>)"><?php echo $relative_modified_date; ?></span></td> </tr> <?php endforeach; ?> diff --git a/apps/files_encryption/settings.php b/apps/files_encryption/settings.php index aed9079529c..0a0d4d1abba 100755 --- a/apps/files_encryption/settings.php +++ b/apps/files_encryption/settings.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ -$tmpl = new OC_Template( 'files_encryption', 'settings'); +$tmpl = new OCP\Template( 'files_encryption', 'settings'); $blackList=explode(',',OCP\Config::getAppValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg')); $enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true'); $tmpl->assign('blacklist',$blackList); diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index de3bc5f46dc..2b2c9dd07fd 100755 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -17,7 +17,7 @@ if ($source !== false) { $source .= $subPath; if (!OC_Filesystem::file_exists($source)) { header("HTTP/1.0 404 Not Found"); - $tmpl = new OC_Template("", "404", "guest"); + $tmpl = new OCP\Template("", "404", "guest"); $tmpl->assign("file", $subPath); $tmpl->printPage(); exit; @@ -49,15 +49,15 @@ if ($source !== false) { } // Load the files we need OCP\Util::addStyle("files", "files"); - $breadcrumbNav = new OC_Template("files", "part.breadcrumb", ""); + $breadcrumbNav = new OCP\Template("files", "part.breadcrumb", ""); $breadcrumbNav->assign("breadcrumb", $breadcrumb); $breadcrumbNav->assign("baseURL", OCP\Util::linkTo("files_sharing", "get.php")."?token=".$token."&path="); - $list = new OC_Template("files", "part.list", ""); + $list = new OCP\Template("files", "part.list", ""); $list->assign("files", $files); $list->assign("baseURL", OCP\Util::linkTo("files_sharing", "get.php")."?token=".$token."&path="); $list->assign("downloadURL", OCP\Util::linkTo("files_sharing", "get.php")."?token=".$token."&path="); $list->assign("readonly", true); - $tmpl = new OC_Template("files", "index", "user"); + $tmpl = new OCP\Template("files", "index", "user"); $tmpl->assign("fileList", $list->fetchPage()); $tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage()); $tmpl->assign("readonly", true); @@ -78,7 +78,7 @@ if ($source !== false) { } } else { header("HTTP/1.0 404 Not Found"); - $tmpl = new OC_Template("", "404", "guest"); + $tmpl = new OCP\Template("", "404", "guest"); $tmpl->printPage(); die(); } diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php index 2fe6bc88e63..2fd24840d36 100755 --- a/apps/files_sharing/list.php +++ b/apps/files_sharing/list.php @@ -30,7 +30,7 @@ OCP\App::setActiveNavigationEntry("files_sharing_list"); OCP\Util::addscript("files_sharing", "list"); -$tmpl = new OC_Template("files_sharing", "list", "user"); +$tmpl = new OCP\Template("files_sharing", "list", "user"); $tmpl->assign("shared_items", OC_Share::getMySharedItems()); $tmpl->printPage(); diff --git a/apps/files_sharing/settings.php b/apps/files_sharing/settings.php index a7bdf7b9195..7b63a26515a 100755 --- a/apps/files_sharing/settings.php +++ b/apps/files_sharing/settings.php @@ -2,7 +2,7 @@ OCP\User::checkAdminUser(); OCP\Util::addscript('files_sharing', 'settings'); -$tmpl = new OC_Template('files_sharing', 'settings'); +$tmpl = new OCP\Template('files_sharing', 'settings'); $tmpl->assign('allowResharing', OCP\Config::getAppValue('files_sharing', 'resharing', 'yes')); return $tmpl->fetchPage(); diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php index eb8886239d3..4306e416400 100755 --- a/apps/files_versions/history.php +++ b/apps/files_versions/history.php @@ -24,7 +24,7 @@ require_once( '../../lib/base.php' ); OCP\User::checkLoggedIn( ); OCP\Util::addStyle('files_versions','versions'); -$tmpl = new OC_Template( 'files_versions', 'history', 'user' ); +$tmpl = new OCP\Template( 'files_versions', 'history', 'user' ); if ( isset( $_GET['path'] ) ) { diff --git a/apps/files_versions/settings.php b/apps/files_versions/settings.php index 59609de15b4..5f9e60fc589 100755 --- a/apps/files_versions/settings.php +++ b/apps/files_versions/settings.php @@ -4,7 +4,7 @@ OCP\User::checkAdminUser(); OCP\Util::addscript( 'files_versions', 'versions' ); -$tmpl = new OC_Template( 'files_versions', 'settings'); +$tmpl = new OCP\Template( 'files_versions', 'settings'); return $tmpl->fetchPage(); ?> diff --git a/apps/gallery/index.php b/apps/gallery/index.php index cf8bea14216..e47fb3db5d6 100755 --- a/apps/gallery/index.php +++ b/apps/gallery/index.php @@ -38,7 +38,7 @@ if (!isset($_GET['view'])) { while ($row = $result->fetchRow()) $r[] = $row; - $tmpl = new OC_Template( 'gallery', 'index', 'user' ); + $tmpl = new OCP\Template( 'gallery', 'index', 'user' ); $tmpl->assign('r', $r); $tmpl->printPage(); } else { @@ -48,7 +48,7 @@ if (!isset($_GET['view'])) { while ($p = $result->fetchRow()) $photos[] = $p['file_path']; - $tmpl = new OC_Template( 'gallery', 'view_album', 'user' ); + $tmpl = new OCP\Template( 'gallery', 'view_album', 'user' ); $tmpl->assign('photos', $photos); $tmpl->assign('albumName', $_GET['view']); $tmpl->printPage(); diff --git a/apps/media/index.php b/apps/media/index.php index e2911361ea2..906d7bacb6e 100755 --- a/apps/media/index.php +++ b/apps/media/index.php @@ -41,7 +41,7 @@ OCP\Util::addStyle('media','music'); OCP\App::setActiveNavigationEntry( 'media_index' ); -$tmpl = new OC_Template( 'media', 'music', 'user' ); +$tmpl = new OCP\Template( 'media', 'music', 'user' ); $tmpl->printPage(); ?> diff --git a/apps/media/settings.php b/apps/media/settings.php index 133440a9af6..227298fafec 100644..100755 --- a/apps/media/settings.php +++ b/apps/media/settings.php @@ -1,6 +1,6 @@ <?php -$tmpl = new OC_Template( 'media', 'settings'); +$tmpl = new OCP\Template( 'media', 'settings'); return $tmpl->fetchPage(); ?> diff --git a/apps/media/templates/music.php b/apps/media/templates/music.php index 3959d989472..589d6b52475 100644..100755 --- a/apps/media/templates/music.php +++ b/apps/media/templates/music.php @@ -1,11 +1,11 @@ <div class='player-controls' id="controls"> <ul class="jp-controls"> - <li><a href="#" class="jp-play action"><img class="svg" alt="<?php echo $l->t('Play');?>" src="<?php echo image_path('core', 'actions/play-big.svg'); ?>" /></a></li> - <li><a href="#" class="jp-pause action"><img class="svg" alt="<?php echo $l->t('Pause');?>" src="<?php echo image_path('core', 'actions/pause-big.svg'); ?>" /></a></li> - <li><a href="#" class="jp-previous action"><img class="svg" alt="<?php echo $l->t('Previous');?>" src="<?php echo image_path('core', 'actions/play-previous.svg'); ?>" /></a></li> - <li><a href="#" class="jp-next action"><img class="svg" alt="<?php echo $l->t('Next');?>" src="<?php echo image_path('core', 'actions/play-next.svg'); ?>" /></a></li> - <li><a href="#" class="jp-mute action"><img class="svg" alt="<?php echo $l->t('Mute');?>" src="<?php echo image_path('core', 'actions/sound.svg'); ?>" /></a></li> - <li><a href="#" class="jp-unmute action"><img class="svg" alt="<?php echo $l->t('Unmute');?>" src="<?php echo image_path('core', 'actions/sound-off.svg'); ?>" /></a></li> + <li><a href="#" class="jp-play action"><img class="svg" alt="<?php echo $l->t('Play');?>" src="<?php echo OCP\image_path('core', 'actions/play-big.svg'); ?>" /></a></li> + <li><a href="#" class="jp-pause action"><img class="svg" alt="<?php echo $l->t('Pause');?>" src="<?php echo OCP\image_path('core', 'actions/pause-big.svg'); ?>" /></a></li> + <li><a href="#" class="jp-previous action"><img class="svg" alt="<?php echo $l->t('Previous');?>" src="<?php echo OCP\image_path('core', 'actions/play-previous.svg'); ?>" /></a></li> + <li><a href="#" class="jp-next action"><img class="svg" alt="<?php echo $l->t('Next');?>" src="<?php echo OCP\image_path('core', 'actions/play-next.svg'); ?>" /></a></li> + <li><a href="#" class="jp-mute action"><img class="svg" alt="<?php echo $l->t('Mute');?>" src="<?php echo OCP\image_path('core', 'actions/sound.svg'); ?>" /></a></li> + <li><a href="#" class="jp-unmute action"><img class="svg" alt="<?php echo $l->t('Unmute');?>" src="<?php echo OCP\image_path('core', 'actions/sound-off.svg'); ?>" /></a></li> </ul> <div class="jp-progress"> <div class="jp-seek-bar"> diff --git a/apps/media/templates/player.php b/apps/media/templates/player.php index 146c743250e..4d478ec5f50 100644..100755 --- a/apps/media/templates/player.php +++ b/apps/media/templates/player.php @@ -1,7 +1,7 @@ <?php if(!isset($_)){//allow the template to be loaded standalone require_once '../../../lib/base.php'; - $tmpl = new OC_Template( 'media', 'player'); + $tmpl = new OCP\Template( 'media', 'player'); $tmpl->printPage(); exit; } @@ -10,8 +10,8 @@ if(!isset($_)){//allow the template to be loaded standalone <div class='player-controls' id="playercontrols"> <div class="player" id="jp-player"></div> <ul class="jp-controls"> - <li><a href="#" class="jp-play action"><img class="svg" alt="<?php echo $l->t('Play');?>" src="<?php echo image_path('core', 'actions/play.svg'); ?>" /></a></li> - <li><a href="#" class="jp-pause action"><img class="svg" alt="<?php echo $l->t('Pause');?>" src="<?php echo image_path('core', 'actions/pause.svg'); ?>" /></a></li> - <li><a href="#" class="jp-next action"><img class="svg" alt="<?php echo $l->t('Next');?>" src="<?php echo image_path('core', 'actions/play-next.svg'); ?>" /></a></li> + <li><a href="#" class="jp-play action"><img class="svg" alt="<?php echo $l->t('Play');?>" src="<?php echo OCP\image_path('core', 'actions/play.svg'); ?>" /></a></li> + <li><a href="#" class="jp-pause action"><img class="svg" alt="<?php echo $l->t('Pause');?>" src="<?php echo OCP\image_path('core', 'actions/pause.svg'); ?>" /></a></li> + <li><a href="#" class="jp-next action"><img class="svg" alt="<?php echo $l->t('Next');?>" src="<?php echo OCP\image_path('core', 'actions/play-next.svg'); ?>" /></a></li> </ul> </div>
\ No newline at end of file diff --git a/apps/remoteStorage/settings.php b/apps/remoteStorage/settings.php index fa85f77a535..9c48549fe6d 100644..100755 --- a/apps/remoteStorage/settings.php +++ b/apps/remoteStorage/settings.php @@ -1,7 +1,7 @@ <?php require_once('lib_remoteStorage.php'); -$tmpl = new OC_Template( 'remoteStorage', 'settings'); +$tmpl = new OCP\Template( 'remoteStorage', 'settings'); return $tmpl->fetchPage(); ?> diff --git a/apps/tasks/ajax/addtaskform.php b/apps/tasks/ajax/addtaskform.php index 20797f31aba..d86232e2da5 100644..100755 --- a/apps/tasks/ajax/addtaskform.php +++ b/apps/tasks/ajax/addtaskform.php @@ -8,7 +8,7 @@ $calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true); $category_options = OC_Calendar_App::getCategoryOptions(); $percent_options = range(0, 100, 10); $priority_options = OC_Task_App::getPriorityOptions(); -$tmpl = new OC_Template('tasks','part.addtaskform'); +$tmpl = new OCP\Template('tasks','part.addtaskform'); $tmpl->assign('calendars',$calendars); $tmpl->assign('category_options', $category_options); $tmpl->assign('percent_options', $percent_options); diff --git a/apps/tasks/ajax/edittask.php b/apps/tasks/ajax/edittask.php index 78d1f193938..edcc8a7cdcd 100644..100755 --- a/apps/tasks/ajax/edittask.php +++ b/apps/tasks/ajax/edittask.php @@ -19,7 +19,7 @@ OC_Task_App::updateVCalendarFromRequest($_POST, $vcalendar); OC_Calendar_Object::edit($id, $vcalendar->serialize()); $priority_options = OC_Task_App::getPriorityOptions(); -$tmpl = new OC_Template('tasks','part.details'); +$tmpl = new OCP\Template('tasks','part.details'); $tmpl->assign('priority_options', $priority_options); $tmpl->assign('details', $vcalendar->VTODO); $tmpl->assign('id', $id); diff --git a/apps/tasks/ajax/edittaskform.php b/apps/tasks/ajax/edittaskform.php index a439a0c0317..e5a0a7297c5 100644..100755 --- a/apps/tasks/ajax/edittaskform.php +++ b/apps/tasks/ajax/edittaskform.php @@ -12,7 +12,7 @@ $category_options = OC_Calendar_App::getCategoryOptions(); $percent_options = range(0, 100, 10); $priority_options = OC_Task_App::getPriorityOptions(); -$tmpl = new OC_Template('tasks','part.edittaskform'); +$tmpl = new OCP\Template('tasks','part.edittaskform'); $tmpl->assign('category_options', $category_options); $tmpl->assign('percent_options', $percent_options); $tmpl->assign('priority_options', $priority_options); diff --git a/apps/tasks/ajax/getdetails.php b/apps/tasks/ajax/getdetails.php index 34ddaa7791a..4ce469e0c9c 100644..100755 --- a/apps/tasks/ajax/getdetails.php +++ b/apps/tasks/ajax/getdetails.php @@ -15,7 +15,7 @@ if (!$details){ } $priority_options = OC_Task_App::getPriorityOptions(); -$tmpl = new OC_Template('tasks','part.details'); +$tmpl = new OCP\Template('tasks','part.details'); $tmpl->assign('priority_options', $priority_options); $tmpl->assign('details',$details->VTODO); $tmpl->assign('id',$id); diff --git a/apps/tasks/index.php b/apps/tasks/index.php index 8ed5f410434..5e17ca454ec 100644..100755 --- a/apps/tasks/index.php +++ b/apps/tasks/index.php @@ -28,7 +28,7 @@ OCP\App::setActiveNavigationEntry('tasks_index'); $categories = OC_Calendar_App::getCategoryOptions(); $l10n = new OC_L10N('tasks'); $priority_options = OC_Task_App::getPriorityOptions(); -$output = new OC_Template('tasks', 'tasks', 'user'); +$output = new OCP\Template('tasks', 'tasks', 'user'); $output->assign('priority_options', $priority_options); $output->assign('categories', $categories); $output -> printPage(); diff --git a/apps/tasks/templates/part.taskform.php b/apps/tasks/templates/part.taskform.php index da984d830bd..c00560903b0 100644..100755 --- a/apps/tasks/templates/part.taskform.php +++ b/apps/tasks/templates/part.taskform.php @@ -6,7 +6,7 @@ <br> <label for="categories"><?php echo $l->t('Categories'); ?></label> <input id="categories" name="categories" type="text" placeholder="<?php echo $l->t('Separate categories with commas'); ?>" value="<?php echo isset($_['categories']) ? htmlspecialchars($_['categories']) : '' ?>"> - <a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a> + <a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo OCP\image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a> <br> <label for="due"><?php echo $l->t('Due'); ?></label> <input type="text" id="due" name="due" placeholder="<?php echo $l->t('Due date') ?>" value="<?php echo isset($_['details']->DUE) ? $l->l('datetime', $_['details']->DUE[0]->getDateTime()) : '' ?>"> diff --git a/apps/tasks/templates/tasks.php b/apps/tasks/templates/tasks.php index 98698400797..ab6138b613f 100644..100755 --- a/apps/tasks/templates/tasks.php +++ b/apps/tasks/templates/tasks.php @@ -17,13 +17,13 @@ </div> <p id="task_actions_template" class="task_actions"> <!-- span class="task_star"> - <img title="<?php echo $l->t('Important') ?>" src="<?php echo image_path('core', 'actions/add.svg') ?>" class="svg"><?php echo $l->t('Important') ?> + <img title="<?php echo $l->t('Important') ?>" src="<?php echo OCP\image_path('core', 'actions/add.svg') ?>" class="svg"><?php echo $l->t('Important') ?> </span --> <span class="task_more"> - <img title="<?php echo $l->t('More') ?>" src="<?php echo image_path('core', 'actions/triangle-s.svg') ?>" class="svg"><?php echo $l->t('More') ?> + <img title="<?php echo $l->t('More') ?>" src="<?php echo OCP\image_path('core', 'actions/triangle-s.svg') ?>" class="svg"><?php echo $l->t('More') ?> </span> <span class="task_less"> - <img title="<?php echo $l->t('Less') ?>" src="<?php echo image_path('core', 'actions/triangle-n.svg') ?>" class="svg"><?php echo $l->t('Less') ?> + <img title="<?php echo $l->t('Less') ?>" src="<?php echo OCP\image_path('core', 'actions/triangle-n.svg') ?>" class="svg"><?php echo $l->t('Less') ?> </span> </p> <script type='text/javascript'> diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index 7512aa3c942..71c14aad80d 100755 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -41,7 +41,7 @@ if ($_POST) { } // fill template -$tmpl = new OC_Template( 'user_ldap', 'settings'); +$tmpl = new OCP\Template( 'user_ldap', 'settings'); foreach($params as $param){ $value = OCP\Config::getAppValue('user_ldap', $param,''); $tmpl->assign($param, $value); diff --git a/apps/user_migrate/admin.php b/apps/user_migrate/admin.php index 93f9d59aa4d..df8bff01c8d 100755 --- a/apps/user_migrate/admin.php +++ b/apps/user_migrate/admin.php @@ -38,14 +38,14 @@ if (isset($_POST['user_import'])) { if( !move_uploaded_file( $from, $to ) ){ $error = array('error'=>'Failed to move the uploaded file','hint'=>'Try checking the permissions of the '.get_temp_dir().' dir.'); OCP\Util::writeLog( 'user_migrate', "Failed to copy the uploaded file", OCP\Util::ERROR ); - $tmpl = new OC_Template('user_migrate', 'admin'); + $tmpl = new OCP\Template('user_migrate', 'admin'); $tmpl->assign('error',$error); return $tmpl->fetchPage(); } $response = json_decode( OC_Migrate::import( $to, 'user' ) ); if( !$response->success ){ $error = array('error'=>'There was an error while importing the user!','hint'=>'Please check the logs for a more detailed explaination'); - $tmpl = new OC_Template('user_migrate', 'admin'); + $tmpl = new OCP\Template('user_migrate', 'admin'); $tmpl->assign('error',$error); return $tmpl->fetchPage(); } else { @@ -64,24 +64,24 @@ if (isset($_POST['user_import'])) { if( isset( $notsupported ) || isset( $failed ) ){ if( count( $failed ) > 0 ){ $error = array('error'=>'Some app data failed to import','hint'=>'App data for: '.implode(', ', $failed).' failed to import.'); - $tmpl = new OC_Template('user_migrate', 'admin'); + $tmpl = new OCP\Template('user_migrate', 'admin'); $tmpl->assign('error',$error); return $tmpl->fetchPage(); } else if( count( $notsupported ) > 0 ){ $error = array('error'=>'Some app data could not be imported, as the apps are not installed on this instance','hint'=>'App data for: '.implode(', ', $notsupported).' failed to import as they were not found. Please install the apps and try again'); - $tmpl = new OC_Template('user_migrate', 'admin'); + $tmpl = new OCP\Template('user_migrate', 'admin'); $tmpl->assign('error',$error); return $tmpl->fetchPage(); } } else { // Went swimmingly! - $tmpl = new OC_Template('user_migrate', 'admin'); + $tmpl = new OCP\Template('user_migrate', 'admin'); return $tmpl->fetchPage(); } } } else { // fill template - $tmpl = new OC_Template('user_migrate', 'admin'); + $tmpl = new OCP\Template('user_migrate', 'admin'); return $tmpl->fetchPage(); } diff --git a/apps/user_migrate/settings.php b/apps/user_migrate/settings.php index 2994d10a1eb..8edd0353388 100755 --- a/apps/user_migrate/settings.php +++ b/apps/user_migrate/settings.php @@ -25,5 +25,5 @@ OCP\App::checkAppEnabled('user_migrate'); // fill template -$tmpl = new OC_Template('user_migrate', 'settings'); +$tmpl = new OCP\Template('user_migrate', 'settings'); return $tmpl->fetchPage();
\ No newline at end of file diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php index 21d1c0a4545..137daa485a9 100755 --- a/apps/user_openid/phpmyid.php +++ b/apps/user_openid/phpmyid.php @@ -559,7 +559,7 @@ function logout_mode () { */ function no_mode () { global $USERNAME, $profile; - $tmpl = new OC_Template( 'user_openid', 'nomode', 'guest' ); + $tmpl = new OCP\Template( 'user_openid', 'nomode', 'guest' ); if(substr($profile['req_url'],-1,1)!=='/'){//the identity should always end with a / $profile['req_url'].='/'; } diff --git a/apps/user_openid/settings.php b/apps/user_openid/settings.php index cdffab0bc25..921fa371dde 100755 --- a/apps/user_openid/settings.php +++ b/apps/user_openid/settings.php @@ -1,6 +1,6 @@ <?php -$tmpl = new OC_Template( 'user_openid', 'settings'); +$tmpl = new OCP\Template( 'user_openid', 'settings'); $identity=OCP\Config::getUserValue(OCP\USER::getUser(),'user_openid','identity',''); $tmpl->assign('identity',$identity); diff --git a/apps/user_openid/templates/nomode.php b/apps/user_openid/templates/nomode.php index 3bab4c2edd1..8952b542f00 100644..100755 --- a/apps/user_openid/templates/nomode.php +++ b/apps/user_openid/templates/nomode.php @@ -5,7 +5,7 @@ global $profile; ?> <div id="login"> - <img src="<?php echo image_path("", "logo.png"); ?>" alt="ownCloud" /> + <img src="<?php echo OCP\image_path("", "logo.png"); ?>" alt="ownCloud" /> <ul> <li class='error'> <div id="setup_form"> diff --git a/lib/public/template.php b/lib/public/template.php index eefd2a029fc..d8f70c77fb2 100644 --- a/lib/public/template.php +++ b/lib/public/template.php @@ -40,17 +40,61 @@ namespace OCP; * For further information have a look at OC_Helper::imagePath */ function image_path( $app, $image ){ - return(image_path( $app, $image )); + return(\image_path( $app, $image )); } +/** + * @brief make OC_Helper::mimetypeIcon available as a simple function + * @param $mimetype mimetype + * @returns link to the image + * + * For further information have a look at OC_Helper::mimetypeIcon + */ +function mimetype_icon( $mimetype ){ + return(\mimetype_icon( $mimetype )); +} + + +/** + * @brief make OC_Helper::humanFileSize available as a simple function + * @param $bytes size in bytes + * @returns size as string + * + * For further information have a look at OC_Helper::humanFileSize + */ +function human_file_size( $bytes ){ + return(\human_file_size( $bytes )); +} + -class Template extends OC_Template { +/** + * TODO + */ +function relative_modified_date($timestamp) { + return(\relative_modified_date($timestamp)); +} + + +/** + * TODO + */ +function simple_file_size($bytes) { + return(\simple_file_size($bytes)); +} +/** + * TODO + */ +function html_select_options($options, $selected, $params=array()) { + return(\html_select_options($options, $selected, $params=array())); +} +class Template extends \OC_Template { } + ?> |