?> <?php } ?> <?php } ?> <?php if (isset($files['bundles']['all'])) { ?> <?php foreach ($files['bundles']['all'] as $file) { ?> <?php echo '<li>' . Langbuilder\Utilities::link($file) . '</li>'; ?> <?php } ?> <?php } ?> </ul> <?php } ?> </div> </div>
/** * Edit a language file. */ Route::get('(:bundle)/edit', function () { $view = View::make('language-builder::layout'); if (!($translate = Input::get('translate'))) { return Redirect::to('/language-builder'); } // Now we do the comparisions $view->files = Langbuilder\Compare::files(Config::get('language-builder::builder.base_lang'), $translate); if ($location = Input::get('location') and $name = Input::get('name')) { $view->edit = Langbuilder\Utilities::get_files($name, $location, $translate); $view->lang_file = $name; } return $view; }); /** * Handle the posted edit form. */ Route::post('(:bundle)/edit', function () { $location = Input::get('location'); $name = Input::get('name'); $translate = Input::get('translate'); $file = Bundle::path($location) . 'language/' . $translate . '/' . $name . '.php'; if (is_file($file)) { $array = Langbuilder\Utilities::make_array($_POST['lang']); File::put($file, $array); return Redirect::to('/language-builder/edit?location=' . $location . '&name=' . $name . '&translate=' . $translate); } die('Something is horribly wrong'); });