diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php
index f4915c3d2fe7c7871c4d8e047a06723796d638f5..2eb20414292b110f49858ccd062c2f9cf6396c76 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 7d3fd0417986c30bcf1a2ebaa0d82c8c272162f4..daa56390aff2a253b6f34557ee461132809f38a2 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 f545d79da61cea2355fdbeb332e65cbf0d880dd3..a4ce02298767909d31324256185b5f711c28921d 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
old mode 100644
new mode 100755
index 9d945f64dadc0a20ac8b011240c3bd543e30a34e..6db361763301e7ec36180aea4d8407236dca6d8c
--- 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 17118c5165f5987f64e28d2dc2fcfc1e3eedd838..77366809311ced6709508d3b0f0372eaccf2fc16 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 17118c5165f5987f64e28d2dc2fcfc1e3eedd838..77366809311ced6709508d3b0f0372eaccf2fc16 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 fa30b871e42611a35aa581fcecfaf932449dc4b8..ee46757f56b24325e65bc45dd535e6cbc0215abc 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 4b8688e3d1d2dd792bd4db78e29e9c6c45ca6210..76dbef6b9df16fc02f286ab5b73b20e3cc195732 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 586bf3db814681c34ae58f976ec798d0fdb5c9e5..96312537507caf41410b6c7cd5e791d427cb96a4 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 408ac9009127e946f6514b0e2c75e4f6333b12ab..3b1cc32b3165bfc7cf2d5c4e2c9e6d3f8e5459ef 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 91d07d3897a11f1b809a8aab8d8bad6879dfc79d..f2ea84dd205f30641aeeba24dc207f4c53fc9e57 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 42cdb81642e298925013594a61d74384381fabf9..f47cb6c3e2ae0a6b225571601a2839a07e90fd49 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 e686066a993a852b884366dba56c1823a8d0105f..3be02d2a6dbf32b907ac82045b448c8a7e744391 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 bac487f0d0bf6c267d4cad9e11276476feb8a7d3..a3b0faca4bf171341e9f49a89dce7373d52d577d 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 5aee5f6ace81be3842263e268d94fb8b34ff6e8b..cf03a7a3cd33786bd7acf0569835aa44a406045a 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 981df9ffafdd58e0af6324c08e9a98ae9937f216..a18b1ca9f422fd3174f4f275448c77d6a30d687f 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 af3b82a48fc553d44a83439b623b2cafb86c36a9..a140316ea07863ab96c7173ed0d22a998cdfaba1 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
old mode 100644
new mode 100755
index 9e54616190c2278e7e553ed9cf5fc5eb0f46587b..b3bbf7a375b5ab2461dc6d0b66493b8c6a0f968a
--- 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">&nbsp;&nbsp;&nbsp;<?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 80375c3ef785ec0650cfbe011b88f1f6e4ff1616..e93ea1af4c934760ec43106ab498023309622bdf 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
old mode 100644
new mode 100755
index cad8bd27fb76041cd1f7a54866bfad643af83acf..3646baf5bb775048028d4b938da73f48dcd88935
--- 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 b11a4ef94cf98628c1bc3e9630b825c474bbb263..e0dabebf257426cdacc7591711f1f47382aedd8f 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 254af1c3f50fef55158bc23b110672351bb696eb..70f47cc81231245c66c2924a0d546d46e232176d 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 2fe55606d1d8df714a6c618ea69dbd800e727d5b..9088a4e9d7d72a115d85fa28854d9e397f418384 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 93e618a08007cd1626522c9183310810fede50e1..37d396cd83a1bbca67fc83b6c8ad65e498b0026b 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 772232b67d7382f9a6ca25c4d8b0316f5950acc6..af7c19eef519f2aed3300022fdf351c43c204fe6 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 125dd1076022643b752e79c4e97dd5d262305f38..7b286dbdb5283adf8a07a0fca54a70d8384e8a71 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 4044eb5a359ffb1e4a5b28bab729a3059ea13706..9fb35a0b5f7127744473ecc8910431a098bf2aed 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 fe1806a7b8a6be532cff50fa68b3867c042d2148..7a9b757ae0db4c51921e4f663cb255c7daf91b33 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 155bee70a7f2e5aa0ef91cc5dc12fe6622acb2e4..dc64eeb5101d39a1fcf19fee3fdb2d769a7336ab 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 66cfa4f8af4362b7a1acc794999024da3a43143c..f93bbfa4d9dd2649a852511ba6589267e1e3462b 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 7a564ccec8339e3ea3e70dcf8cf9b13a0c7689e5..5f8805a6106e9c87f5cb5597f02653f14586c913 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 047db4d940c7f26a0ac101dffb9c389a52f3c291..4e6f2206fef455ab41ed49f61f8024800a8cd846 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 8ad828ebba34ebbea7abc45241e95c5ff71f17a6..6e8fcc4b04903769f8b41374263ca921af2c5391 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 9913fe13e11fa8eeaa80d667e3731a271daf3658..ef429e82891c6fea9c8d96ea02457e01166b513c 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 5418e26cd1048311ea431a676f78ec8f7b003c5d..cd4703071255264ac64de650a25b255dc66c550a 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 13f1c15ac2333fc144fed1ed06b31b07039863e1..19b5b3bddce55ed9f0e299ed4bb1282778b1bb14 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 69e7d57309f6d52f17f526900f3dd980efca335e..74b7c43c556c19f53256c433170ad8fbbc5a18af 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
old mode 100644
new mode 100755
index b88128823a7306d5556c880ce088ecb389a43f47..c88fed0b4d6c1882bd81cc2c88fedf77c3315907
--- 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 91b2f51c3b43d7ad9b3fb6048d61fd08bdab8916..a0ec053ab9169a3046214cd407c5d7ae71ec32f5 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 4c23dac783bf91b53c16ff0c027661877c41c7cc..74522be37c41333712fd7f618547e01cf0e307a1 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
old mode 100644
new mode 100755
index 507a3acaa0c89b17bc336771316ac1d423838881..8b3425033cc079b7925a0e6860ec111d28cc3d23
--- 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
old mode 100644
new mode 100755
index bb774b62bd7c04b8c487c1ecea71705d6add154d..be45f9a5b0668f9482bf4534f10016d88beff8a7
--- 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 a2f8aefa6f447416f00da515e38089ead3ef3f6c..2dac7dd0ca14fdd171c50a48f86fc80801996227 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 9a13ba1b0cdfab2dd6947762976a6e450e817497..a055dd6035603ecacc04dc2e25bc201e667ce9fa 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 f1f6cbac3cf2948ca2ef8d42085e2915ad5670a2..d63be3ad1d5e1de5a48c9114c1f0826dc796dffc 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 c1a4242c3336dbff1f147408a1346d7b0b99f06c..c109733e54824b76494d47eea7b8d3472a97a45e 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
old mode 100644
new mode 100755
index a130477d465223e8049ee36ee40d323150eef419..b8139727eb6f98ab39595aec40a78ef94e63ff23
--- 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 a59a73f0a5b2667f1b719d7a0724a8eec799f90d..b0c2b35c6966ed59b70f8b605b6f4c2c63a6e53e 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 520e54e708d9869e0966a2ab3feda971ac89ecb1..ceb8d158580a45255f5b5cb9d4db899a13cf7d31 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 36dd35cc73e86d4b196798092cd5615d450653de..6e7ace91013f7161a771bd849427aeacceb87a87 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 e98cf2ecd312037b13c839e0512ae3d0e3cfa2bf..2b5d4e2d8768a718b971209a47f0b2a9779f20cb 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 e2a0eb80a03e9b4751dee1e6130aaf2237220431..0c439e4ae1afb6a437af70f4b17e7f4153553799 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 cfadc54573da05e68d062926418add71fe531d32..e5a66239ebd39de6b628637811684b197f73f2ba 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 251936483877edf24b8f9cf69c7b529822d1ee30..72e45d5327561a9a7c0579b4a8e2be6a6664cb7a 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">&nbsp;<img class='svg action' alt="Upload" src="<?php echo image_path("core", "actions/upload.svg"); ?>" /></button>
+					<button class="file_upload_filename">&nbsp;<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
old mode 100644
new mode 100755
index 16da6bb97b418e3fb6277d1413bcebb235e5ec9b..41d2c5c8e765a6d62348235d88d4614a90e5e108
--- 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
old mode 100644
new mode 100755
index b2db4cbb8df00127ae7d5e6236500705a6af7e40..4506630c16d7e63c40925bef00b12b1acd81755b
--- 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 aed9079529c1a67dc5137ee90db1391c4d70448a..0a0d4d1abbad68c0e32eba71ee2e471d4cc3d4d5 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 de3bc5f46dcfbbdd4b83c77ec8a2eac734140ea4..2b2c9dd07fd0bb6a80029bd78b8c56150a926a82 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 2fe6bc88e63f1622a1251d7023b552e7bbeed93c..2fd24840d36359043e57041ec32f2a0800622a59 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 a7bdf7b91957da07a08f439f4ba15f4b79b27764..7b63a26515a312749b4cd8c560a36e93b18bf7ea 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 eb8886239d31717f0365ac138ee4224f7422d37a..4306e41640004b15186238bc7c91adb5bf92602e 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 59609de15b4e8c3e37542326c0ea40c95cae9510..5f9e60fc589b56c5795d4c5597909f6a8669ab84 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 cf8bea142164d307c11123ee92e18f36dfbe5117..e47fb3db5d6726275074d1b9e6dffb2057ea3fd6 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 e2911361ea2065110c9a61eb5b6321d9d3b09163..906d7bacb6e24ff6dfb7d3080443a67f1e3a6000 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
old mode 100644
new mode 100755
index 133440a9af65a9d4ed34a2bf707a9ceed1bf5de8..227298fafecaa7ec5f17fba5d8aa2d0ae5086da5
--- 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
old mode 100644
new mode 100755
index 3959d98947226af9c8ee6bf43baf5b5dddbdade1..589d6b524755ef52854087b974cedc1dfbb7873f
--- 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
old mode 100644
new mode 100755
index 146c743250e9ff127bdfedee136ad5d9c9cedc2a..4d478ec5f5093a929f5fb01852c002f4beba7db1
--- 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
old mode 100644
new mode 100755
index fa85f77a535dae8bf9608c1297fcec2e464916cd..9c48549fe6d4ab17a983f2485b736345f4ccabf4
--- 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
old mode 100644
new mode 100755
index 20797f31aba122ff914adb1372820fc5a884de5e..d86232e2da5a74132a0b91c50e8b512bdc693635
--- 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
old mode 100644
new mode 100755
index 78d1f19393854c3aec5839e77697b9ebb5883d61..edcc8a7cdcda2240a4e04d5ada7596cda781f34c
--- 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
old mode 100644
new mode 100755
index a439a0c031728a1720fb87fcef1c7a135587afaf..e5a0a7297c56908f419dddaa5e3911b5b12b6115
--- 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
old mode 100644
new mode 100755
index 34ddaa7791a24dcd7df8bcd613a5c34dcb88736f..4ce469e0c9ccf71fcd9eec1d885d6082bcd6cae9
--- 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
old mode 100644
new mode 100755
index 8ed5f4104345fbc822503097229d11182f5ab348..5e17ca454ec1fe9dbaedc71088286d58971e13a7
--- 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
old mode 100644
new mode 100755
index da984d830bd646c96470cceb7b604b4c9fecd441..c00560903b016a769b98665ecf74cec055f97b1c
--- 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
old mode 100644
new mode 100755
index 9869840079762d3600bb3c833fe405e7186bf61c..ab6138b613ff5c334b40202d18337c6759a045bc
--- 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 7512aa3c94262ed768b232b35a948e7dfd3d3ad4..71c14aad80dbd714176c8439abab31b5ab437b3b 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 93f9d59aa4df37da062c025834e2f6e6affc517a..df8bff01c8d369b6598e97b26cf90ed428401ed8 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 2994d10a1eb7320b891c048d6dbffdf05723efbd..8edd035338859f8dc3c45e3e8138e7ec3a2a229f 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 21d1c0a45459cd9f0eeb0b75e8ab1e6e448ee027..137daa485a90378f2974f3198604458f66766df3 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 cdffab0bc25b95687adc2132819ce786327aaf57..921fa371dde88b4b71cfbb4eccbf6bf588d4e366 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
old mode 100644
new mode 100755
index 3bab4c2edd18b0889dfcbffbd58d1ee05d527e55..8952b542f00a0ce7a5f3fb34a26b074fa5dd104f
--- 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 eefd2a029fcfdd4784d13b47815ebb712ac0fce4..d8f70c77fb2996bb615e96cd9ef974829b30c248 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 {
 
 }
 
+
 ?>