/** * Edit a role */ public function edit() { $param = array('id' => 'edit-role-form', 'model' => 'Role', 'reference' => array('id' => $this->roleId), 'fieldsets' => array('form' => array('nofieldset' => true, new HiddenInput(array('field' => 'removable', 'default' => 1, 'readonly' => true)), new TextInput(array('field' => 'name', 'maxlength' => 32, 'label' => Lang::get('roles.form-name-label'), 'required' => true)), new ColorInput(array('field' => 'color', 'label' => Lang::get('roles.form-color-label'), 'default' => '#000'))), '_submits' => array(new SubmitInput(array('name' => 'valid', 'value' => Lang::get('main.valid-button'))), new DeleteInput(array('name' => 'delete', 'value' => Lang::get('main.delete-button'), 'notDisplayed' => $this->roleId == -1)), new ButtonInput(array('name' => 'cancel', 'value' => Lang::get('main.cancel-button'), 'onclick' => 'app.dialog("close")')))), 'onsuccess' => 'app.dialog("close"); app.load(app.getUri("list-roles"), {selector : "#admin-roles-tab"});'); foreach (Language::getAll() as $language) { $param['fieldsets']['form'][] = new TextInput(array('name' => "translation[{$language->tag}]", "independant" => true, 'required' => $language->tag == LANGUAGE, "label" => Lang::get("roles.role-label-label", array('lang' => $language->tag)), "default" => Lang::exists("roles.role-" . $this->roleId . "-label") ? Lang::get("roles.role-" . $this->roleId . "-label", array(), 0, $language->tag) : '')); } $form = new Form($param); if (!$form->submitted()) { return View::make(Theme::getSelected()->getView("dialogbox.tpl"), array('icon' => 'user', 'title' => Lang::get('roles.form-title'), 'page' => $form)); } else { if ($form->submitted() == "delete") { $form->delete(Form::NO_EXIT); if ($key) { $key->delete(); } return $form->response(Form::STATUS_SUCCESS); } else { if ($form->check()) { try { $roleId = $form->register(Form::NO_EXIT); // Create the language key for the translations of the role name foreach (App::request()->getBody('translation') as $tag => $translation) { Language::getByTag($tag)->saveTranslations(array('roles' => array("role-{$roleId}-label" => $translation))); } return $form->response(Form::STATUS_SUCCESS); } catch (Exception $e) { return $form->response(Form::STATUS_ERROR, DEBUG_MODE ? $e->getMessage() : ""); } } } } }
<?php echo link_to($page->slug, 'View/Edit', array('class' => 'dvs-button dvs-button-small dvs-button-secondary')); ?> @else <span class="dvs-button dvs-button-small">Not Viewable</span> @endif <?php echo link_to(URL::route('dvs-pages-edit', array($page->id)), 'Settings', array('class' => 'dvs-button dvs-button-small')); ?> <?php echo link_to(URL::route('dvs-pages-copy', array($page->id)), 'Copy', array('class' => 'dvs-button dvs-button-small')); ?> @if(!$page->dvs_admin) <?php echo Form::delete(URL::route('dvs-pages-destroy', array($page->id)), 'Delete', null, array('class' => 'dvs-button dvs-button-small dvs-button-danger')); ?> @endif </td> </tr> <tr class="dvs-page-details dvs-collapsed"> <td colspan="4"> @include('devise::admin.pages.page-versions._cards') </td> </tr> @endforeach </tbody>
<td class="dvs-stacked-col"> <div><?php echo $templateName; ?> </div> <div class="dvs-secondary-text dvs-opaque-text">Filename: <?php echo $templatePath; ?> </div> </td> <td class="dvs-tac dvs-button-group"> <?php echo link_to(URL::route('dvs-templates-edit', array($templatePath)), 'Edit', array('class' => 'dvs-button dvs-button-small')); ?> <?php echo Form::delete(URL::route('dvs-templates-destroy', array($templatePath)), 'Delete', null, array('class' => 'dvs-button dvs-button-small dvs-button-danger')); ?> </td> </tr> @endforeach </tbody> <tfoot> <tr id="pagination-links"> <td colspan="3"><?php echo $templates->appends(Input::except(['template']))->render(); ?> </td> </tr> </tfoot> </table>
echo $permissionName; ?> </td> <td> @foreach($conditions as $conditionName => $condition) <?php echo $conditionName; ?> @endforeach </td> <td class="dvs-tac dvs-button-group"> <?php echo link_to(URL::route('dvs-permissions-edit') . '?condition=' . $permissionName, 'Edit', array('class' => 'dvs-button dvs-button-small')); ?> <?php echo Form::delete(URL::route('dvs-permissions-destroy') . '?condition=' . $permissionName, 'Delete', null, array('class' => 'dvs-button dvs-button-small dvs-button-danger')); ?> </td> </tr> @endforeach </tbody> <tfoot> <tr id="pagination-links"> <td colspan="3"><?php echo $permissions->appends(Input::except(['permission']))->render(); ?> </td> </tr> </tfoot> </table>
</td> <td class="dvs-tac"><?php echo $group->name; ?> </td> <td class="dvs-tac"><?php echo date("m/d/Y", strtotime($group->created_at)); ?> </td> <td class="dvs-tac dvs-button-group"> <a class="dvs-button dvs-button-small" href="<?php echo route('dvs-groups-edit', $group->id); ?> ">Edit</a> <?php echo Form::delete(route('dvs-groups-destroy', $group->id), 'Delete', null, array('class' => 'dvs-button dvs-button-small dvs-button-danger')); ?> </td> </tr> @endforeach </tbody> <tfoot> <tr> <td colspan="4"><?php echo $groups->appends(Input::except(['page']))->render(); ?> </td> </tr> </tfoot> </table>