From e48f511606a1ef64aa39099055dd6ae437f45d03 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Tue, 1 May 2012 23:19:39 +0200 Subject: [PATCH] port linkto and serverHost --- apps/admin_migrate/appinfo/app.php | 2 +- apps/bookmarks/appinfo/app.php | 2 +- apps/bookmarks/templates/bookmarklet.php | 2 +- apps/calendar/appinfo/app.php | 2 +- apps/calendar/lib/calendar.php | 2 +- apps/calendar/lib/search.php | 2 +- apps/calendar/templates/calendar.php | 2 +- apps/calendar/templates/settings.php | 2 +- apps/calendar/templates/share.dropdown.php | 2 +- apps/contacts/appinfo/app.php | 2 +- apps/contacts/lib/hooks.php | 2 +- apps/contacts/lib/search.php | 2 +- apps/contacts/templates/index.php | 4 +-- apps/contacts/templates/part.contact.php | 2 +- apps/contacts/templates/part.contactphoto.php | 2 +- apps/contacts/templates/part.cropphoto.php | 4 +-- .../templates/part.importaddressbook.php | 2 +- apps/contacts/templates/settings.php | 4 +-- apps/external/appinfo/app.php | 2 +- apps/files/appinfo/app.php | 2 +- apps/files/index.php | 6 ++-- apps/files/templates/index.php | 2 +- apps/files_sharing/get.php | 6 ++-- apps/gallery/appinfo/app.php | 4 +-- apps/gallery/templates/index.php | 2 +- apps/media/appinfo/app.php | 2 +- apps/media/lib_ampache.php | 2 +- apps/media/lib_media.php | 6 ++-- apps/media/templates/settings.php | 2 +- apps/media/tomahawk.php | 2 +- apps/user_ldap/appinfo/app.php | 2 +- apps/user_migrate/appinfo/app.php | 2 +- apps/user_migrate/templates/settings.php | 2 +- apps/user_openid/appinfo/app.php | 4 +-- apps/user_openid/templates/settings.php | 2 +- apps/user_openid/user.php | 2 +- lib/public/util.php | 33 ++++++++++++++++++- 37 files changed, 79 insertions(+), 48 deletions(-) mode change 100644 => 100755 apps/admin_migrate/appinfo/app.php mode change 100644 => 100755 apps/bookmarks/templates/bookmarklet.php mode change 100644 => 100755 apps/calendar/lib/calendar.php mode change 100644 => 100755 apps/calendar/templates/settings.php mode change 100644 => 100755 apps/contacts/templates/part.contact.php mode change 100644 => 100755 apps/contacts/templates/part.contactphoto.php mode change 100644 => 100755 apps/external/appinfo/app.php mode change 100644 => 100755 apps/files/appinfo/app.php mode change 100644 => 100755 apps/files/templates/index.php mode change 100644 => 100755 apps/media/lib_ampache.php mode change 100644 => 100755 apps/media/lib_media.php mode change 100644 => 100755 apps/media/templates/settings.php mode change 100644 => 100755 apps/user_ldap/appinfo/app.php mode change 100644 => 100755 apps/user_migrate/templates/settings.php diff --git a/apps/admin_migrate/appinfo/app.php b/apps/admin_migrate/appinfo/app.php old mode 100644 new mode 100755 index e45d3f6a52..07672da6da --- a/apps/admin_migrate/appinfo/app.php +++ b/apps/admin_migrate/appinfo/app.php @@ -28,6 +28,6 @@ OC_APP::registerAdmin('admin_migrate','settings'); $entry = array( 'id' => "admin_migrate_settings", 'order'=>1, - 'href' => OC_Helper::linkTo( "admin_migrate", "settings.php" ), + 'href' => OCP\Util::linkTo( "admin_migrate", "settings.php" ), 'name' => 'Export' ); diff --git a/apps/bookmarks/appinfo/app.php b/apps/bookmarks/appinfo/app.php index d2381e3ef9..449969d8e5 100755 --- a/apps/bookmarks/appinfo/app.php +++ b/apps/bookmarks/appinfo/app.php @@ -13,7 +13,7 @@ OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php' OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' )); $l = new OC_l10n('bookmarks'); -OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OC_Helper::linkTo( 'bookmarks', 'index.php' ), 'icon' => OC_Helper::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks'))); +OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OC_Helper::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks'))); OC_App::registerPersonal('bookmarks', 'settings'); OCP\Util::addscript('bookmarks','bookmarksearch'); diff --git a/apps/bookmarks/templates/bookmarklet.php b/apps/bookmarks/templates/bookmarklet.php old mode 100644 new mode 100755 index a2ca0bba0e..1802814d4b --- a/apps/bookmarks/templates/bookmarklet.php +++ b/apps/bookmarks/templates/bookmarklet.php @@ -3,6 +3,6 @@ function createBookmarklet() { $l = OC_L10N::get('bookmarks'); echo '' . $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:') . '' - . '' + . '' . $l->t('Read later') . ''; } diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php index e42358422c..9a60aaeeb9 100755 --- a/apps/calendar/appinfo/app.php +++ b/apps/calendar/appinfo/app.php @@ -18,7 +18,7 @@ OC_App::register( array( OC_App::addNavigationEntry( array( 'id' => 'calendar_index', 'order' => 10, - 'href' => OC_Helper::linkTo( 'calendar', 'index.php' ), + 'href' => OCP\Util::linkTo( 'calendar', 'index.php' ), 'icon' => OC_Helper::imagePath( 'calendar', 'icon.svg' ), 'name' => $l->t('Calendar'))); OC_App::registerPersonal('calendar', 'settings'); diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php old mode 100644 new mode 100755 index 321f4c73ba..2aba83d32a --- a/apps/calendar/lib/calendar.php +++ b/apps/calendar/lib/calendar.php @@ -241,7 +241,7 @@ class OC_Calendar_Calendar{ public static function getEventSourceInfo($calendar){ return array( - 'url' => OC_Helper::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'], + 'url' => OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='.$calendar['id'], 'backgroundColor' => $calendar['calendarcolor'], 'borderColor' => '#888', 'textColor' => 'black', diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php index fc54431435..fae2da3b02 100755 --- a/apps/calendar/lib/search.php +++ b/apps/calendar/lib/search.php @@ -36,7 +36,7 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{ }else{ $info = $l->t('Date') . ': ' . $start_dt->format('d.m.y H:i') . ' - ' . $end_dt->format('d.m.y H:i'); } - $link = OC_Helper::linkTo('calendar', 'index.php').'?showevent='.urlencode($object['id']); + $link = OCP\Util::linkTo('calendar', 'index.php').'?showevent='.urlencode($object['id']); $results[]=new OC_Search_Result($object['summary'],$info, $link,$l->t('Cal.'));//$name,$text,$link,$type } } diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index 4a3c653d6f..f8bd91640e 100755 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -19,7 +19,7 @@ var missing_field_totime = 't('To Time')) ?>'; var missing_field_startsbeforeends = 't('The event ends before it starts')) ?>'; var missing_field_dberror = 't('There was a database fail')) ?>'; - var totalurl = '/calendars'; + var totalurl = '/calendars'; var firstDay = ''; $(document).ready(function() { t('Calendar CalDAV syncing address:');?> -
+
diff --git a/apps/calendar/templates/share.dropdown.php b/apps/calendar/templates/share.dropdown.php index cd44988af9..b11a4ef94c 100755 --- a/apps/calendar/templates/share.dropdown.php +++ b/apps/calendar/templates/share.dropdown.php @@ -73,5 +73,5 @@ echo html_select_options($allgroups, array());
>
- +
\ No newline at end of file diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php index 20dfaccde7..2c4da2fd6c 100755 --- a/apps/contacts/appinfo/app.php +++ b/apps/contacts/appinfo/app.php @@ -17,7 +17,7 @@ OC_App::register( array( OC_App::addNavigationEntry( array( 'id' => 'contacts_index', 'order' => 10, - 'href' => OC_Helper::linkTo( 'contacts', 'index.php' ), + 'href' => OCP\Util::linkTo( 'contacts', 'index.php' ), 'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ), 'name' => OC_L10N::get('contact')->t('Contacts') )); diff --git a/apps/contacts/lib/hooks.php b/apps/contacts/lib/hooks.php index 9939075a46..2e86246271 100755 --- a/apps/contacts/lib/hooks.php +++ b/apps/contacts/lib/hooks.php @@ -40,7 +40,7 @@ class OC_Contacts_Hooks{ } static public function getCalenderSources($parameters) { - $base_url = OC_Helper::linkTo('calendar', 'ajax/events.php').'?calendar_id='; + $base_url = OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id='; foreach(OC_Contacts_Addressbook::all(OCP\USER::getUser()) as $addressbook) { $parameters['sources'][] = array( diff --git a/apps/contacts/lib/search.php b/apps/contacts/lib/search.php index a53556d8bd..e2aae58189 100755 --- a/apps/contacts/lib/search.php +++ b/apps/contacts/lib/search.php @@ -18,7 +18,7 @@ class OC_Search_Provider_Contacts extends OC_Search_Provider{ $vcards = OC_Contacts_VCard::all($addressbook['id']); foreach($vcards as $vcard){ if(substr_count(strtolower($vcard['fullname']), strtolower($query)) > 0){ - $link = OC_Helper::linkTo('contacts', 'index.php').'?id='.urlencode($vcard['id']); + $link = OCP\Util::linkTo('contacts', 'index.php').'?id='.urlencode($vcard['id']); $results[]=new OC_Search_Result($vcard['fullname'],'', $link,$l->t('Contact'));//$name,$text,$link,$type } } diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index b78818c503..eb229a70a5 100755 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -1,5 +1,5 @@ @@ -16,7 +16,7 @@
- <?php echo $l->t('Add Contact'); ?> + <?php echo $l->t('Add Contact'); ?> <?php echo $l->t('Addressbooks'); ?>
diff --git a/apps/contacts/templates/part.contact.php b/apps/contacts/templates/part.contact.php old mode 100644 new mode 100755 index bbe2014332..5e0607e319 --- a/apps/contacts/templates/part.contact.php +++ b/apps/contacts/templates/part.contact.php @@ -23,7 +23,7 @@ $id = isset($_['id']) ? $_['id'] : '';
-
+
diff --git a/apps/contacts/templates/part.contactphoto.php b/apps/contacts/templates/part.contactphoto.php old mode 100644 new mode 100755 index 3c11e4d158..bddf4cc8a8 --- a/apps/contacts/templates/part.contactphoto.php +++ b/apps/contacts/templates/part.contactphoto.php @@ -10,7 +10,7 @@ $rand = isset($_['refresh'])?'&refresh='.rand():'';
  • - src="?id=" /> + src="?id=" /> diff --git a/apps/contacts/templates/part.cropphoto.php b/apps/contacts/templates/part.cropphoto.php index 2284d49aca..599951d9a9 100755 --- a/apps/contacts/templates/part.cropphoto.php +++ b/apps/contacts/templates/part.cropphoto.php @@ -38,13 +38,13 @@ OCP\Util::writeLog('contacts','templates/part.cropphoto.php: tmp_path: '.$tmp_pa return true; });*/ - + + action=""> diff --git a/apps/contacts/templates/part.importaddressbook.php b/apps/contacts/templates/part.importaddressbook.php index 45e7366f71..9a13ba1b0c 100755 --- a/apps/contacts/templates/part.importaddressbook.php +++ b/apps/contacts/templates/part.importaddressbook.php @@ -22,7 +22,7 @@ - + "> diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php index 0445f8ae49..af0c766d8e 100755 --- a/apps/contacts/templates/settings.php +++ b/apps/contacts/templates/settings.php @@ -4,9 +4,9 @@ t('CardDAV syncing addresses'); ?> (t('more info'); ?>)
    t('Primary address (Kontact et al)'); ?>
    -
    /
    +
    /
    t('iOS/OS X'); ?>
    -
    /principals//
    +
    /principals//
    Powered by geonames.org webservice diff --git a/apps/external/appinfo/app.php b/apps/external/appinfo/app.php old mode 100644 new mode 100755 index 7f8ef3043b..b69cc3b2d6 --- a/apps/external/appinfo/app.php +++ b/apps/external/appinfo/app.php @@ -31,5 +31,5 @@ OC_App::register(array('order' => 70, 'id' => 'external', 'name' => 'External')) $sites = OC_External::getSites(); for ($i = 0; $i < sizeof($sites); $i++) { OC_App::addNavigationEntry( - array('id' => 'external_index' . ($i + 1), 'order' => 80 + $i, 'href' => OC_Helper::linkTo('external', 'index.php') . '?id=' . ($i + 1), 'icon' => OC_Helper::imagePath('external', 'external.png'), 'name' => $sites[$i][0])); + array('id' => 'external_index' . ($i + 1), 'order' => 80 + $i, 'href' => OCP\Util::linkTo('external', 'index.php') . '?id=' . ($i + 1), 'icon' => OC_Helper::imagePath('external', 'external.png'), 'name' => $sites[$i][0])); } diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php old mode 100644 new mode 100755 index c4a2ee7407..40523521d9 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -5,6 +5,6 @@ $l=OC_L10N::get('files'); OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" )); -OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OC_Helper::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") )); +OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") )); OC_Search::registerProvider('OC_Search_Provider_File'); diff --git a/apps/files/index.php b/apps/files/index.php index 2d3b0a13b2..9634a72586 100755 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -74,11 +74,11 @@ foreach( explode( "/", $dir ) as $i ){ // make breadcrumb und filelist markup $list = new OC_Template( "files", "part.list", "" ); $list->assign( "files", $files ); -$list->assign( "baseURL", OC_Helper::linkTo("files", "index.php")."?dir="); -$list->assign( "downloadURL", OC_Helper::linkTo("files", "download.php")."?file="); +$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->assign( "breadcrumb", $breadcrumb ); -$breadcrumbNav->assign( "baseURL", OC_Helper::linkTo("files", "index.php")."?dir="); +$breadcrumbNav->assign( "baseURL", OCP\Util::linkTo("files", "index.php")."?dir="); $upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); $post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php old mode 100644 new mode 100755 index fc385e1ed3..2519364838 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -12,7 +12,7 @@
    - + diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index f6ae4bf075..32bca2ad6e 100755 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -52,11 +52,11 @@ if ($source !== false) { OCP\Util::addStyle("files", "files"); $breadcrumbNav = new OC_Template("files", "part.breadcrumb", ""); $breadcrumbNav->assign("breadcrumb", $breadcrumb); - $breadcrumbNav->assign("baseURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path="); + $breadcrumbNav->assign("baseURL", OCP\Util::linkTo("files_sharing", "get.php")."?token=".$token."&path="); $list = new OC_Template("files", "part.list", ""); $list->assign("files", $files); - $list->assign("baseURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path="); - $list->assign("downloadURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path="); + $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->assign("fileList", $list->fetchPage()); diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php index 3eec805957..8f65757622 100755 --- a/apps/gallery/appinfo/app.php +++ b/apps/gallery/appinfo/app.php @@ -37,7 +37,7 @@ OC_App::register(array( OC_App::addNavigationEntry( array( 'id' => 'gallery_index', 'order' => 20, - 'href' => OC_Helper::linkTo('gallery', 'index.php'), + 'href' => OCP\Util::linkTo('gallery', 'index.php'), 'icon' => OC_Helper::imagePath('core', 'places/picture.svg'), 'name' => $l->t('Pictures'))); @@ -47,7 +47,7 @@ class OC_GallerySearchProvider extends OC_Search_Provider{ $result = $stmt->execute(array(OCP\USER::getUser(),'%'.$query.'%')); $results=array(); while($row=$result->fetchRow()){ - $results[]=new OC_Search_Result($row['album_name'],'',OC_Helper::linkTo('gallery', 'index.php').'?view='.$row['album_name'],'Galleries'); + $results[]=new OC_Search_Result($row['album_name'],'',OCP\Util::linkTo('gallery', 'index.php').'?view='.$row['album_name'],'Galleries'); } return $results; } diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php index b550d262a0..c9a6fb1562 100755 --- a/apps/gallery/templates/index.php +++ b/apps/gallery/templates/index.php @@ -24,7 +24,7 @@ $l = OC_L10N::get('gallery');