/** * Generate an action URI by convention. * * @param string $action * @param array $parameters * @return string */ protected static function convention($action, $parameters) { list($bundle, $action) = Bundle::parse($action); $bundle = Bundle::get($bundle); // If a bundle exists for the action, we will attempt to use it's "handles" // clause as the root of the generated URL, as the bundle can only handle // URIs that begin with that string and no others. $root = $bundle['handles'] ?: ''; $parameters = implode('/', $parameters); // We'll replace both dots and @ signs in the URI since both are used // to specify the controller and action, and by convention should be // translated into URI slashes for the URL. $uri = $root . '/' . str_replace(array('.', '@'), '/', $action); $uri = static::to(str_finish($uri, '/') . $parameters); return trim($uri, '/'); }
@if(isset($modules) and !empty($modules)) <?php $installed_modules = Config::get('installed_modules'); ?> @foreach($modules as $module) <tr id="{{$module->slug}}"> <?php $bundle = \Laravel\Bundle::get($module->slug); ?> <?php $handles = isset($bundle['handles']) ? 1 : 0; ?> @if( isset($installed_modules[$module->slug]) and $module->enabled == true and $handles == 1) <td class="collapse"><a href="{{ URL::base().'/'.ADM_URI.'/'.$module->slug }}">{{ $module->name }}</a></td> @else <td class="collapse">{{ $module->name }}</td> @endif <td>{{ $module->description }}<p>{{ $module->requirements_to_string() }}</p></td> <td>{{ $module->version }}</td> <td class="action-buttons-{{$module->slug}}"> @if($module->enabled == true and isset($installed_modules[$module->slug])) <a data-verb="PUT" data-module="modules" data-title="{{ Lang::line('modules::lang.Are you sure you wanto to disable ":module_name"?', array('module_name' => $module->name))->get(ADM_LANG) }}" class="confirm btn btn-mini" href="{{ URL::base().'/'.ADM_URI.'/' }}modules/disable/{{ $module->slug }}"><i class="icon-minus"></i> {{ Lang::line('modules::lang.disable')->get(ADM_LANG) }}</a> @endif @if( $module->enabled == false and isset($installed_modules[$module->slug]) ) <a data-verb="PUT" data-module="modules" data-title="{{ Lang::line('modules::lang.Are you sure you wanto to enable ":module_name"?', array('module_name' => $module->name))->get(ADM_LANG) }}" class="confirm btn btn-mini btn-success" href="{{ URL::base().'/'.ADM_URI.'/' }}modules/enable/{{ $module->slug }}"><i class="icon-plus"></i> {{ Lang::line('modules::lang.enable')->get(ADM_LANG) }}</a> <a data-module="modules" data-verb="DELETE" data-title="{{ Lang::line('modules::lang.Are you sure you wanto to uninstall ":module_name"?', array('module_name' => $module->name))->get(ADM_LANG) }}" class="btn btn-mini btn-danger confirm" href="{{ URL::base().'/'.ADM_URI.'/' }}modules/{{ $module->slug }}"><i class="icon-remove icon-white"></i> {{ Lang::line('modules::lang.Uninstall')->get(ADM_LANG) }}</a>
protected static function convention($action, $parameters) { list($bundle, $action) = Bundle::parse($action); $bundle = Bundle::get($bundle); $root = $bundle['handles'] ?: ''; $parameters = implode('/', $parameters); $uri = $root . '/' . str_replace(array('.', '@'), '/', $action); $uri = static::to(str_finish($uri, '/') . $parameters); return trim($uri, '/'); }