ported the oc_template class

This commit is contained in:
Frank Karlitschek 2012-05-06 23:00:36 +02:00
parent 5d55c709dd
commit 1945cd6946
82 changed files with 185 additions and 141 deletions

View File

@ -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();

View File

@ -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();
}

View File

@ -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();

2
apps/bookmarks/settings.php Normal file → Executable file
View File

@ -6,6 +6,6 @@
* See the COPYING-README file.
*/
$tmpl = new OC_Template( 'bookmarks', 'settings');
$tmpl = new OCP\Template( 'bookmarks', 'settings');
return $tmpl->fetchPage();

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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(),

View File

@ -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();
?>

View File

@ -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(),

View File

@ -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);

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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)){

View File

@ -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());

View File

@ -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>';

24
apps/calendar/templates/part.eventform.php Normal file → Executable file
View File

@ -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>

View File

@ -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;">

22
apps/calendar/templates/part.showevent.php Normal file → Executable file
View File

@ -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>

View File

@ -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">

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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(),

View File

@ -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();

View File

@ -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];

View File

@ -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();

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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);

View File

@ -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 )));

View File

@ -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);

View File

@ -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);

View File

@ -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(),

View File

@ -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);

2
apps/contacts/settings.php Normal file → Executable file
View File

@ -1,6 +1,6 @@
<?php
$tmpl = new OC_Template( 'contacts', 'settings');
$tmpl = new OCP\Template( 'contacts', 'settings');
return $tmpl->fetchPage();
?>

View File

@ -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();

View File

@ -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>

2
apps/contacts/templates/part.edit_address_dialog.php Normal file → Executable file
View File

@ -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>

2
apps/contacts/templates/part.edit_name_dialog.php Normal file → Executable file
View File

@ -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 }} ?>

View File

@ -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;">

View File

@ -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>

View File

@ -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();
}

View File

@ -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();
?>

2
apps/external/templates/settings.php vendored Normal file → Executable file
View File

@ -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>';
}
?>

View File

@ -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));

View File

@ -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());

View File

@ -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;
}

View File

@ -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;

View File

@ -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);

View File

@ -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();

View File

@ -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'];?>">

2
apps/files/templates/part.breadcrumb.php Normal file → Executable file
View File

@ -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;?>

8
apps/files/templates/part.list.php Normal file → Executable file
View File

@ -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; ?>

View File

@ -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);

View File

@ -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();
}

View File

@ -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();

View File

@ -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();

View File

@ -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'] ) ) {

View File

@ -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();
?>

View File

@ -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();

View File

@ -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();
?>

2
apps/media/settings.php Normal file → Executable file
View File

@ -1,6 +1,6 @@
<?php
$tmpl = new OC_Template( 'media', 'settings');
$tmpl = new OCP\Template( 'media', 'settings');
return $tmpl->fetchPage();
?>

12
apps/media/templates/music.php Normal file → Executable file
View File

@ -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">

8
apps/media/templates/player.php Normal file → Executable file
View File

@ -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>

2
apps/remoteStorage/settings.php Normal file → Executable file
View File

@ -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();
?>

2
apps/tasks/ajax/addtaskform.php Normal file → Executable file
View File

@ -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);

2
apps/tasks/ajax/edittask.php Normal file → Executable file
View File

@ -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);

2
apps/tasks/ajax/edittaskform.php Normal file → Executable file
View File

@ -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);

2
apps/tasks/ajax/getdetails.php Normal file → Executable file
View File

@ -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);

2
apps/tasks/index.php Normal file → Executable file
View File

@ -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();

2
apps/tasks/templates/part.taskform.php Normal file → Executable file
View File

@ -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()) : '' ?>">

6
apps/tasks/templates/tasks.php Normal file → Executable file
View File

@ -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'>

View File

@ -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);

View File

@ -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();
}

View File

@ -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();

View File

@ -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'].='/';
}

View File

@ -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);

2
apps/user_openid/templates/nomode.php Normal file → Executable file
View File

@ -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">

View File

@ -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 ));
}
class Template extends OC_Template {
/**
* @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 ));
}
/**
* 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 {
}
?>