Example #1
0
 public static function getApplicationUrl($domain = '', $folder = '', $getFromSession = true, $setSession = true)
 {
     //dd($_SERVER['SERVER_NAME']);
     if (!$domain) {
         $domain = ApplicationUrl::getDomain();
     }
     if (!$folder) {
         $folder = ApplicationUrl::getFolder();
     }
     $applicationUrl = ApplicationUrl::with('application', 'application.setting', 'application.languages', 'application.plugins')->where('domain', '=', "{$domain}")->where('folder', 'LIKE', "{$folder}")->first();
     if ($setSession && !Session::get('application_url' . $folder)) {
         Session::put('application_url' . $folder, $applicationUrl);
     }
     return $applicationUrl;
 }
Example #2
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
//TODO: sort this out a bit - we need to use these globals or get rid.
if (@$_SERVER['HTTP_HOST']) {
    $applicationurl = ApplicationUrl::getApplicationUrl();
    if (!@$applicationurl->application) {
        App::abort(404, "No Application found at url");
        //chuck 404 - we can't find the app
    }
    $application = $applicationurl->application;
    $GLOBALS['applicationurl'] = serialize($applicationurl);
    $GLOBALS['application'] = serialize($application);
    //I don't like doing this but meh. Laravel likes it's
    //collections serialized for some reason.
} else {
    $application = '';
    $applicationurl = '';
}
Route::group(array('prefix' => @$applicationurl->folder), function () use($application, $applicationurl) {
    //dd(Request::path());
    $languages = array('en');
Example #3
0
            $model->push($flds);
        }
        $fields = $model->groupBy('name');
    }
}
?>
    <div class="tab-pane {{$i==0?'active in':''}} fade edit-content-tab" id="tab-{{$key}}">
        <ul>
            @if($key == 'Advanced')

                <li class="form-group">
                    {{ Form::label('slug', 'Slug:') }}
                    <div class="input-group">
                        <?php 
$niceFullSlug = "http://" . ApplicationUrl::getApplicationUrl()->domain;
$niceFullSlug .= ApplicationUrl::getApplicationUrl()->folder == '/' ? '' : ApplicationUrl::getApplicationUrl()->folder;
?>
                        <span class="input-group-addon">{{$niceFullSlug}}</span>
                    {{ Form::text('slug', null, $fieldArray) }}
                    </div>
                </li>

                <li class="form-group">
                    {{ Form::label('identifier', 'Identifier:') }}
                    {{ Form::input('identifier', 'identifier', null, $fieldArray) }}
                </li>

                <li class="form-group">
                    {{ Form::label('parent_id', 'Parent_id:') }}
                    {{ Form::input('number', 'parent_id', null, $fieldArray) }}
                </li>