summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-06 18:49:06 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-06 18:51:41 +0200
commitfe6450002d6059260c743f48b6f40378454fa1dc (patch)
treef373d737d78dcc7cc73a76c90db7fdfe5d9f1aa2 /apps
parente6759a980b3efe07c4a4c2e2769c2becc92df67d (diff)
downloadnextcloud-server-fe6450002d6059260c743f48b6f40378454fa1dc.tar.gz
nextcloud-server-fe6450002d6059260c743f48b6f40378454fa1dc.zip
Change hardcoded urls to use linkTo function
Diffstat (limited to 'apps')
-rw-r--r--apps/calendar/index.php13
-rw-r--r--apps/calendar/templates/part.choosecalendar.rowfields.php2
-rw-r--r--apps/calendar/templates/part.editevent.php6
-rw-r--r--apps/calendar/templates/part.newevent.php2
-rw-r--r--apps/gallery/js/pictures.js4
5 files changed, 18 insertions, 9 deletions
diff --git a/apps/calendar/index.php b/apps/calendar/index.php
index 4b871195927..cbfe0027b7b 100644
--- a/apps/calendar/index.php
+++ b/apps/calendar/index.php
@@ -24,8 +24,17 @@ foreach($calendars as $calendar){
}
}
-$eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_rw', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable'=>'true');
-$eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_r', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'false');
+$events_baseURL = OCP\Util::linkTo('calendar', 'ajax/events.php');
+$eventSources[] = array('url' => $events_baseURL.'?calendar_id=shared_rw',
+ 'backgroundColor' => '#1D2D44',
+ 'borderColor' => '#888',
+ 'textColor' => 'white',
+ 'editable'=>'true');
+$eventSources[] = array('url' => $events_baseURL.'?calendar_id=shared_r',
+ 'backgroundColor' => '#1D2D44',
+ 'borderColor' => '#888',
+ 'textColor' => 'white',
+ 'editable' => 'false');
OCP\Util::emitHook('OC_Calendar', 'getSources', array('sources' => &$eventSources));
$categories = OC_Calendar_App::getCategoryOptions();
diff --git a/apps/calendar/templates/part.choosecalendar.rowfields.php b/apps/calendar/templates/part.choosecalendar.rowfields.php
index 4492ce731c9..d29113c9a61 100644
--- a/apps/calendar/templates/part.choosecalendar.rowfields.php
+++ b/apps/calendar/templates/part.choosecalendar.rowfields.php
@@ -11,7 +11,7 @@
<a href="#" onclick="Calendar.UI.showCalDAVUrl('<?php echo OCP\USER::getUser() ?>', '<?php echo rawurlencode(html_entity_decode($_['calendar']['uri'], ENT_QUOTES, 'UTF-8')) ?>');" title="<?php echo $l->t('CalDav Link') ?>" class="action"><img class="svg action" src="<?php echo OCP\Util::imagePath('core', 'actions/public.svg') ?>"></a>
</td>
<td width="20px">
- <a href="?app=calendar&amp;getfile=export.php?calid=<?php echo $_['calendar']['id'] ?>" title="<?php echo $l->t('Download') ?>" class="action"><img class="svg action" src="<?php echo OCP\Util::imagePath('core', 'actions/download.svg') ?>"></a>
+ <a href="<?php echo OCP\Util::linkTo('calendar', 'export.php') . '?calid=' . $_['calendar']['id'] ?>" title="<?php echo $l->t('Download') ?>" class="action"><img class="svg action" src="<?php echo OCP\Util::imagePath('core', 'actions/download.svg') ?>"></a>
</td>
<td width="20px">
<a href="#" onclick="Calendar.UI.Calendar.edit(this, <?php echo $_['calendar']['id'] ?>);" title="<?php echo $l->t('Edit') ?>" class="action"><img class="svg action" src="<?php echo OCP\Util::imagePath('core', 'actions/rename.svg') ?>"></a>
diff --git a/apps/calendar/templates/part.editevent.php b/apps/calendar/templates/part.editevent.php
index 102366f8f08..ea91192cc66 100644
--- a/apps/calendar/templates/part.editevent.php
+++ b/apps/calendar/templates/part.editevent.php
@@ -5,9 +5,9 @@
<?php echo $this->inc("part.eventform"); ?>
<div style="width: 100%;text-align: center;color: #FF1D1D;" id="errorbox"></div>
<span id="actions">
- <input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('?app=calendar&getfile=ajax/event/edit.php');">
- <input type="button" class="submit" style="float: left;" name="delete" value="<?php echo $l->t("Delete");?>" onclick="Calendar.UI.submitDeleteEventForm('?app=calendar&getfile=ajax/event/delete.php');">
- <input type="button" class="submit" style="float: right;" name="export" value="<?php echo $l->t("Export");?>" onclick="window.location='?app=calendar&getfile=export.php?eventid=<?php echo $_['eventid'] ?>';">
+ <input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('<?php echo OCP\Util::linkTo('calendar', 'ajax/event/edit.php') ?>');">
+ <input type="button" class="submit" style="float: left;" name="delete" value="<?php echo $l->t("Delete");?>" onclick="Calendar.UI.submitDeleteEventForm('<?php echo OCP\Util::linkTo('calendar', 'ajax/event/delete.php') ?>');">
+ <input type="button" class="submit" style="float: right;" name="export" value="<?php echo $l->t("Export");?>" onclick="window.location='<?php echo OCP\Util::linkTo('calendar', 'export.php') ?>?eventid=<?php echo $_['eventid'] ?>';">
</span>
</form>
</div>
diff --git a/apps/calendar/templates/part.newevent.php b/apps/calendar/templates/part.newevent.php
index f4bb867b180..a4f48aecbc6 100644
--- a/apps/calendar/templates/part.newevent.php
+++ b/apps/calendar/templates/part.newevent.php
@@ -3,7 +3,7 @@
<?php echo $this->inc("part.eventform"); ?>
<div style="width: 100%;text-align: center;color: #FF1D1D;" id="errorbox"></div>
<span id="actions">
- <input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('?app=calendar&getfile=ajax/event/new.php');">
+ <input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('<?php echo OCP\Util::linkTo('calendar', 'ajax/event/new.php') ?>');">
</span>
</form>
</div>
diff --git a/apps/gallery/js/pictures.js b/apps/gallery/js/pictures.js
index 91fbf5be967..47f727e0dee 100644
--- a/apps/gallery/js/pictures.js
+++ b/apps/gallery/js/pictures.js
@@ -61,8 +61,8 @@ function deplode(element) {
function openNewGal(album_name) {
root = root + decodeURIComponent(album_name) + "/";
- var url = window.location.toString().replace(window.location.search, '');
- url = url + "?app=gallery&root="+encodeURIComponent(root);
+ var url = window.location.protocol+"//"+window.location.hostname+OC.linkTo('gallery', 'index.php');
+ url = url + "?root="+encodeURIComponent(root);
window.location = url;
}