Change hardcoded urls to use linkTo function
This commit is contained in:
parent
e6759a980b
commit
fe6450002d
6 changed files with 26 additions and 11 deletions
|
@ -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();
|
||||
|
|
|
@ -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&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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
10
lib/util.php
10
lib/util.php
|
@ -343,10 +343,16 @@ class OC_Util {
|
|||
$location = $_REQUEST['redirect_url'];
|
||||
}
|
||||
else if (isset(OC::$REQUESTEDAPP) && !empty(OC::$REQUESTEDAPP)) {
|
||||
$location = OC::$WEBROOT.'/?app='.OC::$REQUESTEDAPP;
|
||||
$location = OC_Helper::linkToAbsolute( OC::$REQUESTEDAPP, 'index.php' );
|
||||
}
|
||||
else {
|
||||
$location = OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', '?app=files');
|
||||
$defaultpage = OC_Appconfig::getValue('core', 'defaultpage');
|
||||
if ($defaultpage) {
|
||||
$location = OC_Helper::serverProtocol().'://'.OC_Helper::serverHost().OC::$WEBROOT.'/'.$defaultpage;
|
||||
}
|
||||
else {
|
||||
$location = OC_Helper::linkToAbsolute( 'files', 'index.php' );
|
||||
}
|
||||
}
|
||||
OC_Log::write('core', 'redirectToDefaultPage: '.$location, OC_Log::DEBUG);
|
||||
header( 'Location: '.$location );
|
||||
|
|
Loading…
Reference in a new issue