port linkto and serverHost

This commit is contained in:
Frank Karlitschek 2012-05-01 23:19:39 +02:00
parent 31e32e3c10
commit e48f511606
37 changed files with 79 additions and 48 deletions

2
apps/admin_migrate/appinfo/app.php Normal file → Executable file
View File

@ -28,6 +28,6 @@ OC_APP::registerAdmin('admin_migrate','settings');
$entry = array( $entry = array(
'id' => "admin_migrate_settings", 'id' => "admin_migrate_settings",
'order'=>1, 'order'=>1,
'href' => OC_Helper::linkTo( "admin_migrate", "settings.php" ), 'href' => OCP\Util::linkTo( "admin_migrate", "settings.php" ),
'name' => 'Export' 'name' => 'Export'
); );

View File

@ -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' )); OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' ));
$l = new OC_l10n('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'); OC_App::registerPersonal('bookmarks', 'settings');
OCP\Util::addscript('bookmarks','bookmarksearch'); OCP\Util::addscript('bookmarks','bookmarksearch');

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

@ -3,6 +3,6 @@
function createBookmarklet() { function createBookmarklet() {
$l = OC_L10N::get('bookmarks'); $l = OC_L10N::get('bookmarks');
echo '<small>' . $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:') . '</small>' echo '<small>' . $l->t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage quickly:') . '</small>'
. '<a class="button bookmarklet" href="javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open(\'' . OC_Helper::linkToAbsolute('bookmarks', 'addBm.php') . '?output=popup&url=\'+c(b.location),\'bkmk_popup\',\'left=\'+((a.screenX||a.screenLeft)+10)+\',top=\'+((a.screenY||a.screenTop)+10)+\',height=230px,width=230px,resizable=1,alwaysRaised=1\');a.setTimeout(function(){d.focus()},300);})();">' . '<a class="button bookmarklet" href="javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open(\'' . OCP\Util::linkToAbsolute('bookmarks', 'addBm.php') . '?output=popup&url=\'+c(b.location),\'bkmk_popup\',\'left=\'+((a.screenX||a.screenLeft)+10)+\',top=\'+((a.screenY||a.screenTop)+10)+\',height=230px,width=230px,resizable=1,alwaysRaised=1\');a.setTimeout(function(){d.focus()},300);})();">'
. $l->t('Read later') . '</a>'; . $l->t('Read later') . '</a>';
} }

View File

@ -18,7 +18,7 @@ OC_App::register( array(
OC_App::addNavigationEntry( array( OC_App::addNavigationEntry( array(
'id' => 'calendar_index', 'id' => 'calendar_index',
'order' => 10, 'order' => 10,
'href' => OC_Helper::linkTo( 'calendar', 'index.php' ), 'href' => OCP\Util::linkTo( 'calendar', 'index.php' ),
'icon' => OC_Helper::imagePath( 'calendar', 'icon.svg' ), 'icon' => OC_Helper::imagePath( 'calendar', 'icon.svg' ),
'name' => $l->t('Calendar'))); 'name' => $l->t('Calendar')));
OC_App::registerPersonal('calendar', 'settings'); OC_App::registerPersonal('calendar', 'settings');

2
apps/calendar/lib/calendar.php Normal file → Executable file
View File

@ -241,7 +241,7 @@ class OC_Calendar_Calendar{
public static function getEventSourceInfo($calendar){ public static function getEventSourceInfo($calendar){
return array( 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'], 'backgroundColor' => $calendar['calendarcolor'],
'borderColor' => '#888', 'borderColor' => '#888',
'textColor' => 'black', 'textColor' => 'black',

View File

@ -36,7 +36,7 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{
}else{ }else{
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.y H:i') . ' - ' . $end_dt->format('d.m.y H:i'); $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 $results[]=new OC_Search_Result($object['summary'],$info, $link,$l->t('Cal.'));//$name,$text,$link,$type
} }
} }

View File

@ -19,7 +19,7 @@
var missing_field_totime = '<?php echo addslashes($l->t('To Time')) ?>'; var missing_field_totime = '<?php echo addslashes($l->t('To Time')) ?>';
var missing_field_startsbeforeends = '<?php echo addslashes($l->t('The event ends before it starts')) ?>'; var missing_field_startsbeforeends = '<?php echo addslashes($l->t('The event ends before it starts')) ?>';
var missing_field_dberror = '<?php echo addslashes($l->t('There was a database fail')) ?>'; var missing_field_dberror = '<?php echo addslashes($l->t('There was a database fail')) ?>';
var totalurl = '<?php echo OC_Helper::linkToAbsolute('calendar', 'caldav.php'); ?>/calendars'; var totalurl = '<?php echo OCP\Util::linkToAbsolute('calendar', 'caldav.php'); ?>/calendars';
var firstDay = '<?php echo (OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>'; var firstDay = '<?php echo (OC_Preferences::getValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0'); ?>';
$(document).ready(function() { $(document).ready(function() {
<?php <?php

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

@ -47,6 +47,6 @@
</table> </table>
<?php echo $l->t('Calendar CalDAV syncing address:');?> <?php echo $l->t('Calendar CalDAV syncing address:');?>
<code><?php echo OC_Helper::linkToAbsolute('calendar', 'caldav.php'); ?></code><br /> <code><?php echo OCP\Util::linkToAbsolute('calendar', 'caldav.php'); ?></code><br />
</fieldset> </fieldset>
</form> </form>

View File

@ -73,5 +73,5 @@ echo html_select_options($allgroups, array());
</ul> </ul>
<div id="public"> <div id="public">
<input type="checkbox" id="publish" <?php echo ($public['share'])?'checked="checked"':'' ?>><label for="publish"><?php echo $l->t('make public'); ?></label><br> <input type="checkbox" id="publish" <?php echo ($public['share'])?'checked="checked"':'' ?>><label for="publish"><?php echo $l->t('make public'); ?></label><br>
<input type="text" id="public_token" value="<?php echo OC_Helper::linkToAbsolute('apps/calendar', 'share.php?t=' . $public['share'], null, true) ; ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>"> <input type="text" id="public_token" value="<?php echo OCP\Util::linkToAbsolute('apps/calendar', 'share.php?t=' . $public['share'], null, true) ; ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>">
</div> </div>

View File

@ -17,7 +17,7 @@ OC_App::register( array(
OC_App::addNavigationEntry( array( OC_App::addNavigationEntry( array(
'id' => 'contacts_index', 'id' => 'contacts_index',
'order' => 10, 'order' => 10,
'href' => OC_Helper::linkTo( 'contacts', 'index.php' ), 'href' => OCP\Util::linkTo( 'contacts', 'index.php' ),
'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ), 'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ),
'name' => OC_L10N::get('contact')->t('Contacts') )); 'name' => OC_L10N::get('contact')->t('Contacts') ));

View File

@ -40,7 +40,7 @@ class OC_Contacts_Hooks{
} }
static public function getCalenderSources($parameters) { 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) { foreach(OC_Contacts_Addressbook::all(OCP\USER::getUser()) as $addressbook) {
$parameters['sources'][] = $parameters['sources'][] =
array( array(

View File

@ -18,7 +18,7 @@ class OC_Search_Provider_Contacts extends OC_Search_Provider{
$vcards = OC_Contacts_VCard::all($addressbook['id']); $vcards = OC_Contacts_VCard::all($addressbook['id']);
foreach($vcards as $vcard){ foreach($vcards as $vcard){
if(substr_count(strtolower($vcard['fullname']), strtolower($query)) > 0){ 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 $results[]=new OC_Search_Result($vcard['fullname'],'', $link,$l->t('Contact'));//$name,$text,$link,$type
} }
} }

View File

@ -1,5 +1,5 @@
<script type='text/javascript'> <script type='text/javascript'>
var totalurl = '<?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/addressbooks'; var totalurl = '<?php echo OCP\Util::linkToAbsolute('contacts', 'carddav.php'); ?>/addressbooks';
var categories = <?php echo json_encode($_['categories']); ?>; var categories = <?php echo json_encode($_['categories']); ?>;
var lang = '<?php echo OC_Preferences::getValue(OCP\USER::getUser(), 'core', 'lang', 'en'); ?>'; var lang = '<?php echo OC_Preferences::getValue(OCP\USER::getUser(), 'core', 'lang', 'en'); ?>';
</script> </script>
@ -16,7 +16,7 @@
</div> </div>
<div id="bottomcontrols"> <div id="bottomcontrols">
<form> <form>
<img class="svg" id="contacts_newcontact" src="<?php echo OC_Helper::linkTo('contacts', 'img/contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" title="<?php echo $l->t('Add Contact'); ?>" /> <img class="svg" id="contacts_newcontact" src="<?php echo OCP\Util::linkTo('contacts', 'img/contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" title="<?php echo $l->t('Add Contact'); ?>" />
<img class="svg" id="chooseaddressbook" src="core/img/actions/settings.svg" alt="<?php echo $l->t('Addressbooks'); ?>" title="<?php echo $l->t('Addressbooks'); ?>" /> <img class="svg" id="chooseaddressbook" src="core/img/actions/settings.svg" alt="<?php echo $l->t('Addressbooks'); ?>" title="<?php echo $l->t('Addressbooks'); ?>" />
</form> </form>
</div> </div>

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

@ -23,7 +23,7 @@ $id = isset($_['id']) ? $_['id'] : '';
<div id="contact_photo" class="contactsection"> <div id="contact_photo" class="contactsection">
<form class="float" id="file_upload_form" action="<?php echo OC_Helper::linkTo('contacts', 'ajax/uploadphoto.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target"> <form class="float" id="file_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadphoto.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target">
<div class="tip propertycontainer" id="contacts_details_photo_wrapper" title="<?php echo $l->t('Click or drop to upload picture'); ?> (max <?php echo $_['uploadMaxHumanFilesize']; ?>)" data-element="PHOTO"> <div class="tip propertycontainer" id="contacts_details_photo_wrapper" title="<?php echo $l->t('Click or drop to upload picture'); ?> (max <?php echo $_['uploadMaxHumanFilesize']; ?>)" data-element="PHOTO">
<!-- img style="padding: 1em;" id="contacts_details_photo" alt="Profile picture" src="photo.php?id=<?php echo $_['id']; ?>" / --> <!-- img style="padding: 1em;" id="contacts_details_photo" alt="Profile picture" src="photo.php?id=<?php echo $_['id']; ?>" / -->
<progress id="contacts_details_photo_progress" style="display:none;" value="0" max="100">0 %</progress> <progress id="contacts_details_photo_progress" style="display:none;" value="0" max="100">0 %</progress>

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

@ -10,7 +10,7 @@ $rand = isset($_['refresh'])?'&refresh='.rand():'';
<li><a class="svg upload" title="<?php echo $l->t('Upload new photo'); ?>"></a></li> <li><a class="svg upload" title="<?php echo $l->t('Upload new photo'); ?>"></a></li>
<li><a class="svg cloud" title="<?php echo $l->t('Select photo from ownCloud'); ?>"></a></li> <li><a class="svg cloud" title="<?php echo $l->t('Select photo from ownCloud'); ?>"></a></li>
</ul> </ul>
<img class="loading" id="contacts_details_photo" <?php echo $wattr; ?> <?php echo $hattr; ?> src="<?php echo OC_Helper::linkToAbsolute('contacts', 'photo.php'); ?>?id=<?php echo $id.$rand; ?>" /> <img class="loading" id="contacts_details_photo" <?php echo $wattr; ?> <?php echo $hattr; ?> src="<?php echo OCP\Util::linkToAbsolute('contacts', 'photo.php'); ?>?id=<?php echo $id.$rand; ?>" />
<progress id="contacts_details_photo_progress" style="display:none;" value="0" max="100">0 %</progress> <progress id="contacts_details_photo_progress" style="display:none;" value="0" max="100">0 %</progress>

View File

@ -38,13 +38,13 @@ OCP\Util::writeLog('contacts','templates/part.cropphoto.php: tmp_path: '.$tmp_pa
return true; return true;
});*/ });*/
</script> </script>
<img id="cropbox" src="<?php echo OC_Helper::linkToAbsolute('contacts', 'dynphoto.php'); ?>?tmp_path=<?php echo urlencode($tmp_path); ?>" /> <img id="cropbox" src="<?php echo OCP\Util::linkToAbsolute('contacts', 'dynphoto.php'); ?>?tmp_path=<?php echo urlencode($tmp_path); ?>" />
<form id="cropform" <form id="cropform"
class="coords" class="coords"
method="post" method="post"
enctype="multipart/form-data" enctype="multipart/form-data"
target="crop_target" target="crop_target"
action="<?php echo OC_Helper::linkToAbsolute('contacts', 'ajax/savecrop.php'); ?>"> action="<?php echo OCP\Util::linkToAbsolute('contacts', 'ajax/savecrop.php'); ?>">
<input type="hidden" id="id" name="id" value="<?php echo $id; ?>" /> <input type="hidden" id="id" name="id" value="<?php echo $id; ?>" />
<input type="hidden" id="tmp_path" name="tmp_path" value="<?php echo $tmp_path; ?>" /> <input type="hidden" id="tmp_path" name="tmp_path" value="<?php echo $tmp_path; ?>" />

View File

@ -22,7 +22,7 @@
</td> </td>
</tr> </tr>
</table> </table>
<form id="import_upload_form" action="<?php echo OC_Helper::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target"> <form id="import_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input id="import_upload_start" type="file" accept="text/*" name="importfile" /> <input id="import_upload_start" type="file" accept="text/*" name="importfile" />
<input id="close_button" style="float: left;" type="button" onclick="Contacts.UI.Addressbooks.cancel(this);" value="<?php echo $l->t("Cancel"); ?>"> <input id="close_button" style="float: left;" type="button" onclick="Contacts.UI.Addressbooks.cancel(this);" value="<?php echo $l->t("Cancel"); ?>">

View File

@ -4,9 +4,9 @@
<?php echo $l->t('CardDAV syncing addresses'); ?> (<a href="http://owncloud.org/synchronisation/" target="_blank"><?php echo $l->t('more info'); ?></a>) <?php echo $l->t('CardDAV syncing addresses'); ?> (<a href="http://owncloud.org/synchronisation/" target="_blank"><?php echo $l->t('more info'); ?></a>)
<dl> <dl>
<dt><?php echo $l->t('Primary address (Kontact et al)'); ?></dt> <dt><?php echo $l->t('Primary address (Kontact et al)'); ?></dt>
<dd><code><?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/</code></dd> <dd><code><?php echo OCP\Util::linkToAbsolute('contacts', 'carddav.php'); ?>/</code></dd>
<dt><?php echo $l->t('iOS/OS X'); ?></dt> <dt><?php echo $l->t('iOS/OS X'); ?></dt>
<dd><code><?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/principals/<?php echo OCP\USER::getUser(); ?></code>/</dd> <dd><code><?php echo OCP\Util::linkToAbsolute('contacts', 'carddav.php'); ?>/principals/<?php echo OCP\USER::getUser(); ?></code>/</dd>
</dl> </dl>
Powered by <a href="http://geonames.org/" target="_blank">geonames.org webservice</a> Powered by <a href="http://geonames.org/" target="_blank">geonames.org webservice</a>
</fieldset> </fieldset>

2
apps/external/appinfo/app.php vendored Normal file → Executable file
View File

@ -31,5 +31,5 @@ OC_App::register(array('order' => 70, 'id' => 'external', 'name' => 'External'))
$sites = OC_External::getSites(); $sites = OC_External::getSites();
for ($i = 0; $i < sizeof($sites); $i++) { for ($i = 0; $i < sizeof($sites); $i++) {
OC_App::addNavigationEntry( 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]));
} }

2
apps/files/appinfo/app.php Normal file → Executable file
View File

@ -5,6 +5,6 @@ $l=OC_L10N::get('files');
OC_App::register( array( "order" => 2, "id" => "files", "name" => "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'); OC_Search::registerProvider('OC_Search_Provider_File');

View File

@ -74,11 +74,11 @@ foreach( explode( "/", $dir ) as $i ){
// make breadcrumb und filelist markup // make breadcrumb und filelist markup
$list = new OC_Template( "files", "part.list", "" ); $list = new OC_Template( "files", "part.list", "" );
$list->assign( "files", $files ); $list->assign( "files", $files );
$list->assign( "baseURL", OC_Helper::linkTo("files", "index.php")."?dir="); $list->assign( "baseURL", OCP\Util::linkTo("files", "index.php")."?dir=");
$list->assign( "downloadURL", OC_Helper::linkTo("files", "download.php")."?file="); $list->assign( "downloadURL", OCP\Util::linkTo("files", "download.php")."?file=");
$breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" ); $breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $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')); $upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); $post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));

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

@ -12,7 +12,7 @@
</ul> </ul>
</div> </div>
<div class="file_upload_wrapper svg"> <div class="file_upload_wrapper svg">
<form data-upload-id='1' class="file_upload_form" action="<?php echo OC_Helper::linkto('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1"> <form data-upload-id='1' class="file_upload_form" action="<?php echo OCP\Util::linkTo('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload"> <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" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo htmlentities($_['dir']) ?>" id="dir"> <input type="hidden" name="dir" value="<?php echo htmlentities($_['dir']) ?>" id="dir">

View File

@ -52,11 +52,11 @@ if ($source !== false) {
OCP\Util::addStyle("files", "files"); OCP\Util::addStyle("files", "files");
$breadcrumbNav = new OC_Template("files", "part.breadcrumb", ""); $breadcrumbNav = new OC_Template("files", "part.breadcrumb", "");
$breadcrumbNav->assign("breadcrumb", $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 = new OC_Template("files", "part.list", "");
$list->assign("files", $files); $list->assign("files", $files);
$list->assign("baseURL", 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", OC_Helper::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); $list->assign("readonly", true);
$tmpl = new OC_Template("files", "index", "user"); $tmpl = new OC_Template("files", "index", "user");
$tmpl->assign("fileList", $list->fetchPage()); $tmpl->assign("fileList", $list->fetchPage());

View File

@ -37,7 +37,7 @@ OC_App::register(array(
OC_App::addNavigationEntry( array( OC_App::addNavigationEntry( array(
'id' => 'gallery_index', 'id' => 'gallery_index',
'order' => 20, 'order' => 20,
'href' => OC_Helper::linkTo('gallery', 'index.php'), 'href' => OCP\Util::linkTo('gallery', 'index.php'),
'icon' => OC_Helper::imagePath('core', 'places/picture.svg'), 'icon' => OC_Helper::imagePath('core', 'places/picture.svg'),
'name' => $l->t('Pictures'))); 'name' => $l->t('Pictures')));
@ -47,7 +47,7 @@ class OC_GallerySearchProvider extends OC_Search_Provider{
$result = $stmt->execute(array(OCP\USER::getUser(),'%'.$query.'%')); $result = $stmt->execute(array(OCP\USER::getUser(),'%'.$query.'%'));
$results=array(); $results=array();
while($row=$result->fetchRow()){ 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; return $results;
} }

View File

@ -24,7 +24,7 @@ $l = OC_L10N::get('gallery');
</div> </div>
</div> </div>
<div id="g-album-loading" class="crumb" style="display:none"> <div id="g-album-loading" class="crumb" style="display:none">
<img src="<?php echo OC_Helper::linkto('gallery', 'img/loading.gif'); ?>"> <img src="<?php echo OCP\Util::linkTo('gallery', 'img/loading.gif'); ?>">
</div> </div>
</div> </div>
<div id="gallery_list"> <div id="gallery_list">

View File

@ -29,6 +29,6 @@ OC_APP::registerPersonal('media','settings');
OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' )); OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo('media', 'index.php'), 'icon' => OC_Helper::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music'))); OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OC_Helper::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
OC_Search::registerProvider('OC_MediaSearchProvider'); OC_Search::registerProvider('OC_MediaSearchProvider');

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

@ -207,7 +207,7 @@ class OC_MEDIA_AMPACHE{
echo("\t\t<title>$name</title>\n"); echo("\t\t<title>$name</title>\n");
echo("\t\t<artist id='$artist'>$artistName</artist>\n"); echo("\t\t<artist id='$artist'>$artistName</artist>\n");
echo("\t\t<album id='$album'>$albumName</album>\n"); echo("\t\t<album id='$album'>$albumName</album>\n");
$url=OC_Helper::linkToAbsolute('media', 'server/xml.server.php')."?action=play&song=$id&auth={$_GET['auth']}"; $url=OCP\Util::linkToAbsolute('media', 'server/xml.server.php')."?action=play&song=$id&auth={$_GET['auth']}";
$url=self::fixXmlString($url); $url=self::fixXmlString($url);
echo("\t\t<url>$url</url>\n"); echo("\t\t<url>$url</url>\n");
echo("\t\t<time>{$song['song_length']}</time>\n"); echo("\t\t<time>{$song['song_length']}</time>\n");

6
apps/media/lib_media.php Normal file → Executable file
View File

@ -90,18 +90,18 @@ class OC_MediaSearchProvider extends OC_Search_Provider{
$songs=OC_MEDIA_COLLECTION::getSongs(0,0,$query); $songs=OC_MEDIA_COLLECTION::getSongs(0,0,$query);
$results=array(); $results=array();
foreach($artists as $artist){ foreach($artists as $artist){
$results[]=new OC_Search_Result($artist['artist_name'],'',OC_Helper::linkTo( 'media', 'index.php').'#artist='.urlencode($artist['artist_name']),'Music'); $results[]=new OC_Search_Result($artist['artist_name'],'',OCP\Util::linkTo( 'media', 'index.php').'#artist='.urlencode($artist['artist_name']),'Music');
} }
foreach($albums as $album){ foreach($albums as $album){
$artist=OC_MEDIA_COLLECTION::getArtistName($album['album_artist']); $artist=OC_MEDIA_COLLECTION::getArtistName($album['album_artist']);
$results[]=new OC_Search_Result($album['album_name'],'by '.$artist,OC_Helper::linkTo( 'media', 'index.php').'#artist='.urlencode($artist).'&album='.urlencode($album['album_name']),'Music'); $results[]=new OC_Search_Result($album['album_name'],'by '.$artist,OCP\Util::linkTo( 'media', 'index.php').'#artist='.urlencode($artist).'&album='.urlencode($album['album_name']),'Music');
} }
foreach($songs as $song){ foreach($songs as $song){
$minutes=floor($song['song_length']/60); $minutes=floor($song['song_length']/60);
$secconds=$song['song_length']%60; $secconds=$song['song_length']%60;
$artist=OC_MEDIA_COLLECTION::getArtistName($song['song_artist']); $artist=OC_MEDIA_COLLECTION::getArtistName($song['song_artist']);
$album=OC_MEDIA_COLLECTION::getalbumName($song['song_album']); $album=OC_MEDIA_COLLECTION::getalbumName($song['song_album']);
$results[]=new OC_Search_Result($song['song_name'],"by $artist, in $album $minutes:$secconds",OC_Helper::linkTo( 'media', 'index.php').'#artist='.urlencode($artist).'&album='.urlencode($album).'&song='.urlencode($song['song_name']),'Music'); $results[]=new OC_Search_Result($song['song_name'],"by $artist, in $album $minutes:$secconds",OCP\Util::linkTo( 'media', 'index.php').'#artist='.urlencode($artist).'&album='.urlencode($album).'&song='.urlencode($song['song_name']),'Music');
} }
return $results; return $results;
} }

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

@ -2,6 +2,6 @@
<fieldset class="personalblock"> <fieldset class="personalblock">
<strong>Media</strong><br /> <strong>Media</strong><br />
Ampache address: Ampache address:
<code><?php echo OC_Helper::linkToAbsolute('media', ''); ?></code><br /> <code><?php echo OCP\Util::linkToAbsolute('media', ''); ?></code><br />
</fieldset> </fieldset>
</form> </form>

View File

@ -58,7 +58,7 @@ $album=OC_MEDIA_COLLECTION::getAlbumId($album,$artist);
$songs=OC_MEDIA_COLLECTION::getSongs($artist,$album,$song); $songs=OC_MEDIA_COLLECTION::getSongs($artist,$album,$song);
$baseUrl=OC_Util::getServerURL().OC_Helper::linkTo('media','tomahawk.php'); $baseUrl=OC_Util::getServerURL().OCP\Util::linkTo('media','tomahawk.php');
$results=array(); $results=array();
foreach($songs as $song) { foreach($songs as $song) {

2
apps/user_ldap/appinfo/app.php Normal file → Executable file
View File

@ -41,7 +41,7 @@ OC_Group::useBackend( new OC_GROUP_LDAP() );
$entry = array( $entry = array(
'id' => 'user_ldap_settings', 'id' => 'user_ldap_settings',
'order'=>1, 'order'=>1,
'href' => OC_Helper::linkTo( 'user_ldap', 'settings.php' ), 'href' => OCP\Util::linkTo( 'user_ldap', 'settings.php' ),
'name' => 'LDAP' 'name' => 'LDAP'
); );
// OC_App::addNavigationSubEntry( "core_users", $entry); // OC_App::addNavigationSubEntry( "core_users", $entry);

View File

@ -29,7 +29,7 @@ OCP\Util::addscript( 'user_migrate', 'export');
$entry = array( $entry = array(
'id' => "user_migrate_settings", 'id' => "user_migrate_settings",
'order'=>1, 'order'=>1,
'href' => OC_Helper::linkTo( "user_migrate", "admin.php" ), 'href' => OCP\Util::linkTo( "user_migrate", "admin.php" ),
'name' => 'Import' 'name' => 'Import'
); );
?> ?>

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

@ -2,5 +2,5 @@
<legend><strong><?php echo $l->t('Export your user account');?></strong></legend> <legend><strong><?php echo $l->t('Export your user account');?></strong></legend>
<p><?php echo $l->t('This will create a compressed file that contains your ownCloud account.');?> <p><?php echo $l->t('This will create a compressed file that contains your ownCloud account.');?>
</p> </p>
<button id="exportbtn">Export<img style="display: none;" class="loading" src="<?php echo OC_Helper::linkTo('core', 'img/loading.gif'); ?>" /></button> <button id="exportbtn">Export<img style="display: none;" class="loading" src="<?php echo OCP\Util::linkTo('core', 'img/loading.gif'); ?>" /></button>
</fieldset> </fieldset>

View File

@ -14,8 +14,8 @@ if(strpos($_SERVER["REQUEST_URI"],'?') and !strpos($_SERVER["REQUEST_URI"],'='))
} }
} }
OCP\Util::addHeader('link',array('rel'=>'openid.server', 'href'=>OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName)); OCP\Util::addHeader('link',array('rel'=>'openid.server', 'href'=>OCP\Util::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName));
OCP\Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName)); OCP\Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>OCP\Util::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName));
OC_APP::registerPersonal('user_openid','settings'); OC_APP::registerPersonal('user_openid','settings');

View File

@ -1,7 +1,7 @@
<form id="openidform"> <form id="openidform">
<fieldset class="personalblock"> <fieldset class="personalblock">
<strong>OpenID</strong> <strong>OpenID</strong>
<?php echo ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http').'://'.OC_Helper::serverHost().OC::$WEBROOT.'/?'; echo OCP\USER::getUser(); ?><br /><em><?php echo $l->t('you can authenticate to other sites with this address');?></em><br /> <?php echo ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http').'://'.OCP\Util::getServerHost().OC::$WEBROOT.'/?'; echo OCP\USER::getUser(); ?><br /><em><?php echo $l->t('you can authenticate to other sites with this address');?></em><br />
<label for="identity"><?php echo $l->t('Authorized OpenID provider');?></label> <label for="identity"><?php echo $l->t('Authorized OpenID provider');?></label>
<input type="text" name="identity" id="identity" value="<?php echo $_['identity']; ?>" placeholder="<?php echo $l->t('Your address at Wordpress, Identi.ca, &hellip;');?>" /><span class="msg"></span> <input type="text" name="identity" id="identity" value="<?php echo $_['identity']; ?>" placeholder="<?php echo $l->t('Your address at Wordpress, Identi.ca, &hellip;');?>" /><span class="msg"></span>
</fieldset> </fieldset>

View File

@ -43,7 +43,7 @@ if(!OCP\User::userExists($USERNAME)){
OCP\Util::writeLog('user_openid',$USERNAME.' doesn\'t exist',OCP\Util::WARN); OCP\Util::writeLog('user_openid',$USERNAME.' doesn\'t exist',OCP\Util::WARN);
$USERNAME=''; $USERNAME='';
} }
$IDENTITY=OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$USERNAME; $IDENTITY=OCP\Util::linkToAbsolute( "user_openid", "user.php" ).'/'.$USERNAME;
require_once 'phpmyid.php'; require_once 'phpmyid.php';

View File

@ -122,10 +122,41 @@ class Util {
/**
* @brief Creates an absolute url
* @param $app app
* @param $file file
* @returns the url
*
* Returns a absolute url to the given app and file.
*/
public static function linkToAbsolute( $app, $file ) {
return(\OC_Helper::linkToAbsolute( $app, $file ));
}
/**
* @brief Creates an url
* @param $app app
* @param $file file
* @returns the url
*
* Returns a url to the given app and file.
*/
public static function linkTo( $app, $file ){
return(\OC_Helper::linkTo( $app, $file ));
}
/**
* @brief Returns the server host
* @returns the server host
*
* Returns the server host, even if the website uses one or more
* reverse proxies
*/
public static function getServerHost() {
return(\OC_Helper::severHost());
}