Example #1
0
 public function delete()
 {
     if (Request::env('REQUEST')->{Admin::getInstance()->getPrimaryKey()}->val() == 1) {
         Alert::set(I18n::__('Vous ne pouvez pas supprimer cet administrateur.'));
         Http::redirect(Router::linkBack(Router::$controller));
     }
     parent::delete(new Admin());
 }
Example #2
0
 public static function model()
 {
     return Admin::getInstance();
 }
Example #3
0
<?php

use sJo\Module\Admin\Model\Admin;
use sJo\View\Helper;
use sJo\Libraries as Lib;
Helper\Panel::create(array('col' => 6, 'title' => Lib\I18n::__('List of admins'), 'class' => 'panel-primary', 'elements' => Helper\Table::create(array('tbody' => Admin::getInstance(), 'actions' => array('edit', 'delete')))))->render();
Example #4
0
<?php

use sJo\Module\Admin\Model\Admin;
use sJo\Loader\Router;
use sJo\View\Helper;
use sJo\Libraries as Lib;
Helper\Panel::create(array('col' => 6, 'title' => Admin::getInstance()->getPrimaryValue() ? Lib\I18n::__('Edit admin') : Lib\I18n::__('Create admin'), 'class' => Admin::getInstance()->getPrimaryValue() ? 'panel-primary' : 'panel-success', 'elements' => Helper\Fieldset::create(array(Helper\Token::create(Router::getToken()), Helper\Input::create(array('type' => 'email', 'name' => 'email', 'label' => Lib\I18n::__('Email address'), 'placeholder' => Lib\I18n::__('Enter email'), 'value' => Admin::getInstance()->request('email'))), Helper\Input::create(array('type' => 'text', 'name' => 'name', 'label' => Lib\I18n::__('Name'), 'placeholder' => Lib\I18n::__('Enter name'), 'value' => Admin::getInstance()->request('name'))))), 'footer' => Helper\ButtonGroup::create(array('class' => 'pull-right', 'elements' => array(Helper\Button::create(array('name' => 'saveAndStay', 'value' => Lib\I18n::__('Save and stay'))), Helper\Button::create(array('name' => 'saveAndCreate', 'value' => Lib\I18n::__('Save and create new'), 'class' => 'btn-warning')), Helper\Button::create(array('value' => Lib\I18n::__('Save and back to list'), 'class' => 'btn-primary')))))))->render();
Example #5
0
 public function update()
 {
     parent::update(Admin::logged());
 }
Example #6
0
<?php

use sJo\Loader\Router;
use sJo\Module\Admin\Model\Admin;
use sJo\View\Helper;
use sJo\Libraries as Lib;
$this->header();
Helper\Panel::create(array('col' => 6, 'title' => 'Edition', 'class' => 'panel-primary', 'elements' => Helper\Fieldset::create(array(Helper\Token::create(Router::getToken('update')), Helper\Input::create(array('type' => 'email', 'name' => 'email', 'label' => Lib\I18n::__('Email address'), 'placeholder' => Lib\I18n::__('Enter email'), 'value' => Admin::logged()->email)), Helper\Input::create(array('type' => 'text', 'name' => 'name', 'label' => Lib\I18n::__('Name'), 'placeholder' => Lib\I18n::__('Enter name'), 'value' => Admin::logged()->name)))), 'footer' => Helper\Button::create(array('class' => 'pull-right btn-primary', 'value' => Lib\I18n::__('Save')))))->render();
$this->footer();