File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 6
6
* @author Julio Montoya <[email protected] >
7
7
*/
8
8
9
+ use Chamilo \CoreBundle \Entity \AccessUrl ;
9
10
use Chamilo \CoreBundle \Enums \ActionIcon ;
10
11
use Chamilo \CoreBundle \Framework \Container ;
11
12
use Symfony \Component \HttpFoundation \Request as HttpRequest ;
44
45
// If we're still with localhost (should only happen at the very beginning)
45
46
// offer the current URL by default. Once this has been saved, no more
46
47
// magic will happen, ever.
47
- if ($ url_data ['id ' ] === 1 && $ url_data ['url ' ] === ' http://localhost/ ' ) {
48
+ if ($ url_data ['id ' ] === 1 && $ url_data ['url ' ] === AccessUrl:: DEFAULT_ACCESS_URL ) {
48
49
$ https = api_is_https () ? 'https:// ' : 'http:// ' ;
49
50
$ url_data ['url ' ] = $ https .$ _SERVER ['HTTP_HOST ' ].'/ ' ;
50
51
}
Original file line number Diff line number Diff line change 111
111
}
112
112
113
113
// 1) Find the default URL (ID = 1)
114
- $ defaultUrl = ' http://localhost/ ' ;
114
+ $ defaultUrl = AccessUrl:: DEFAULT_ACCESS_URL ;
115
115
foreach ($ url_list as $ u ) {
116
116
if ($ u ->getId () === 1 ) {
117
117
$ defaultUrl = trim ($ u ->getUrl ());
121
121
122
122
// 2) Tooltip message (in English, per spec)
123
123
$ tooltip = 'Adding new URLs requires you to first set the first URL to a value different than localhost. ' ;
124
- $ isLocalhost = ($ defaultUrl === ' http://localhost/ ' );
124
+ $ isLocalhost = ($ defaultUrl === AccessUrl:: DEFAULT_ACCESS_URL );
125
125
126
126
// 3) Decide link href and base attributes
127
127
$ attributes = ['id ' => 'add-url-button ' ];
You can’t perform that action at this time.
0 commit comments