/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('roles', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name')->unique();
         $table->string('color');
         $table->boolean('assignable');
         $table->boolean('allow_editing');
         $table->boolean('su');
         $table->timestamps();
     });
     $role = \Laralum::newRole();
     $role->name = env('ADMINISTRATOR_ROLE_NAME', 'Administrator');
     $role->color = "#DB2828";
     $role->assignable = false;
     $role->allow_editing = false;
     $role->su = true;
     $role->save();
     if (env('ADMINISTRATOR_ROLE_NAME', 'Administrator') != env('DEFAULT_ROLE_NAME', 'User')) {
         $role = \Laralum::newRole();
         $role->name = env('DEFAULT_ROLE_NAME', 'User');
         $role->color = "#000000";
         $role->assignable = true;
         $role->allow_editing = true;
         $role->su = false;
         $role->save();
     }
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('users', function (Blueprint $table) {
         $table->increments('id');
         $table->string('name');
         $table->string('email')->unique();
         $table->string('password');
         $table->boolean('active');
         $table->boolean('banned');
         $table->string('register_ip');
         $table->string('country_code');
         $table->string('locale');
         $table->string('activation_key');
         $table->boolean('su');
         $table->rememberToken();
         $table->timestamps();
     });
     $user = \Laralum::newUser();
     $user->name = env('USER_NAME', 'admin');
     $user->email = env('USER_EMAIL', '*****@*****.**');
     $user->password = bcrypt(env('USER_PASSWORD', 'admin123'));
     $user->active = true;
     $user->banned = false;
     $user->register_ip = "";
     $user->country_code = env('USER_COUNTRY_CODE', 'ES');
     $user->locale = env('USER_LOCALE', 'en');
     $user->activation_key = str_random(25);
     $user->su = true;
     $user->save();
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('role_user', function (Blueprint $table) {
         $table->increments('id');
         $table->integer('role_id');
         $table->integer('user_id');
         $table->timestamps();
     });
     $rel = new Role_User();
     $rel->user_id = \Laralum::user('email', env('USER_EMAIL', '*****@*****.**'))->id;
     $rel->role_id = \Laralum::role('name', env('ADMINISTRATOR_ROLE_NAME', 'Administrator'))->id;
     $rel->save();
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('permission_role', function (Blueprint $table) {
         $table->increments('id');
         $table->integer('permission_id');
         $table->integer('role_id');
         $table->timestamps();
     });
     foreach (Laralum::permissions() as $perm) {
         $rel = new Permission_Role();
         $rel->permission_id = \Laralum::permission('id', $perm->id)->id;
         $rel->role_id = \Laralum::role('name', env('ADMINISTRATOR_ROLE_NAME', 'Administrator'))->id;
         $rel->save();
     }
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('permissions', function (Blueprint $table) {
         $table->increments('id');
         $table->string('slug')->unique();
         $table->boolean('assignable');
         $table->boolean('su');
         $table->timestamps();
     });
     $permissions = ['laralum.access', 'laralum.users.access', 'laralum.users.create', 'laralum.users.edit', 'laralum.users.roles', 'laralum.users.delete', 'laralum.users.settings', 'laralum.roles.access', 'laralum.roles.create', 'laralum.roles.edit', 'laralum.roles.permissions', 'laralum.roles.delete', 'laralum.permissions.access', 'laralum.permissions.create', 'laralum.permissions.edit', 'laralum.permissions.delete', 'laralum.blogs.access', 'laralum.blogs.create', 'laralum.blogs.edit', 'laralum.blogs.posts', 'laralum.blogs.delete', 'laralum.posts.access', 'laralum.posts.create', 'laralum.posts.edit', 'laralum.posts.view', 'laralum.posts.comments', 'laralum.posts.graphics', 'laralum.posts.delete', 'laralum.files.access', 'laralum.files.upload', 'laralum.files.download', 'laralum.files.delete', 'laralum.documents.create', 'laralum.documents.edit', 'laralum.documents.delete', 'laralum.settings.access', 'laralum.settings.edit', 'laralum.CRUD.access'];
     foreach ($permissions as $permission) {
         $perm = \Laralum::newPermission();
         $perm->slug = $permission;
         $perm->assignable = true;
         $perm->su = true;
         $perm->save();
     }
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('users_settings', function (Blueprint $table) {
         $table->increments('id');
         $table->integer('default_role');
         $table->boolean('location')->comment = "0: off, 1: on";
         $table->boolean('register_enabled')->comment = "0: off, 1: on";
         $table->integer('default_active')->comment = "0: off, 1: email, 2: on";
         $table->boolean('welcome_email')->comment = "0: off, 1: on";
     });
     $settings = new Users_Settings();
     $settings->default_role = \Laralum::role('name', env('DEFAULT_ROLE_NAME', 'User'))->id;
     $settings->register_enabled = true;
     $settings->default_active = 2;
     $settings->welcome_email = false;
     $settings->location = false;
     $settings->save();
 }
Пример #7
0
                    <i class="frown icon"></i>
                    <div class="content">
                        <div class="header">
                            {{ trans('laralum.missing_title') }}
                        </div>
                        <p>{{ trans('laralum.missing_subtitle', ['element'  =>  "files"]) }}</p>
                    </div>
                </div>
            @else
                <div class="ui doubling stackable three column grid">
                    @foreach($files as $file)
                        <div class="column">
                            @if(Laralum::isDocument($file))

                                <?php 
$doc = Laralum::document('name', $file);
$slug = $doc->slug;
?>

                                <div class="ui fluid blue card">
                                  <div class="content">
                                    <div class="header">{{ $file }}</div>
                                    <div class="meta">{{ trans('laralum.documents_document') }}</div>
                                  </div>
                                  <div class="description">
                                      <center>
                                          <a href="{{ route('Laralum::files_download', ['file' => $file]) }}" class="ui no-disable button download">
                                              {{ trans('laralum.download') }}
                                          </a>
                                      </center>
                                  </div><br>
Пример #8
0
                                <input


                                <?php 
$disabled = false;
if (isset($role)) {
    if ($role->hasPermission($perm->slug)) {
        echo "checked='checked' ";
    }
    if ($role->su) {
        if ($perm->su) {
            $disabled = true;
        }
    }
}
if (!$disabled and (!$perm->assignable and !Laralum::loggedInUser()->su)) {
    $disabled = true;
}
if ($disabled) {
    echo "disabled ";
}
?>


                                name="{{ $perm->id }}" type="checkbox"  tabindex="0" class="@if(!$disabled) checkable @endif hidden">
                            <label>{{ Laralum::permissionName($perm->slug) }}</label>
                        </div><i data-variation="wide" data-title="{{ $perm->slug }}" data-content="{{ Laralum::permissionDescription($perm->slug) }}" data-position="right center" class="grey question pop icon"></i>
                        @if(!$perm->assignable and !Laralum::loggedInUser()->su)<i data-variation="wide" class="red lock icon pop" data-position="right center" data-title="{{ trans('laralum.unassignable_permission') }}" data-content="{{ trans('laralum.unassignable_permission_desc') }}"></i>@endif
                        @if(!$perm->assignable and Laralum::loggedInUser()->su and !$disabled)<i data-variation="wide" class="red unlock icon pop" data-position="right center" data-title="{{ trans('laralum.unassignable_permission_unlocked') }}" data-content="{{ trans('laralum.unassignable_permission_unlocked_desc') }}"></i>@endif
                        @if(Laralum::loggedInUser()->su and $disabled)<i data-variation="wide" class="red asterisk icon pop" data-position="right center" data-title="{{ trans('laralum.su_permission_and_role') }}" data-content="{{ trans('laralum.su_permission_and_role_desc') }}"></i>@endif
                    </div>
Пример #9
0
| regardless of it's differences.                            				|
|																			|
+---------------------------------------------------------------------------+
*/
include 'SimpleGet.php';
# Get the row table columns
$columns = Schema::getColumnListing($table);
# Add su_hidden to hidden if the row is su
if (Schema::hasColumn($table, 'su') and $row->su) {
    # Add the su_hidden fields to the hiden variable
    foreach ($su_hidden as $su_hid) {
        array_push($hidden, $su_hid);
    }
}
# Gets the fields available to edit / update
$final_columns = [];
foreach ($columns as $column) {
    $add = true;
    foreach ($hidden as $hide) {
        if ($column == $hide) {
            $add = false;
        }
    }
    if ($column == Laralum::allowEditingField() and !Laralum::loggedInUser()->su) {
        $add = false;
    }
    if ($add) {
        array_push($final_columns, $column);
    }
}
$fields = $final_columns;
Пример #10
0
| * Available settings:                  									|
|																			|
| table: The table name 												    +-------------+
| hidden: Columns that will not be displayed in the edit form, and they won't be updated +----------------------------+
| empty: Columns that will not have their current value when editing them (eg: password field is hidden in the model) |
| confirmed: fields that will need to be confirmed twice                                                              +-+
| encrypted: Fields that will be encrypted using: Crypt::encrypt(); when they are saved and decrypted when editing them +---------------------------+
| hashed: Fields that will be hashed when they are saved in the database, will be empty on editing, and if saved as empty they will not be modified |
| masked: Fields that will be displayed as a type='password', so their content when beeing modified won't be visible +------------------------------+
| default_random: Fields that if no data is set, they will be randomly generated (10 characters) +-------------------+
| su_hidden: Columns that will be added to the hidden array if the user is su +------------------+
| code: Fields that can be edited using a code editor                       +-+
| wysiwyg: Fields that can be edited using a wysiwyg editor                 |
| validator: validator settings when executing: $this->validate();          |
| relations: a relationship between a column and a table, or a dropdown     |
|																			|
| Note: Do not change the first index               						|
|																			|
+---------------------------------------------------------------------------+
|																			|
| This file allows you to setup all the information                         |
| to be able to manage your app without problems            				|
|																			|
+---------------------------------------------------------------------------+
*/
if (!isset($row)) {
    # the row will be the user logged in if no row is set
    $row = Auth::user();
}
$data = ['users' => ['table' => 'users', 'create' => ['hidden' => ['id', 'su', 'active', 'banned', 'register_ip', 'activation_key', 'locale', 'remember_token', 'created_at', 'updated_at'], 'default_random' => ['password'], 'confirmed' => ['password'], 'encrypted' => [], 'hashed' => ['password'], 'masked' => ['password'], 'code' => [], 'wysiwyg' => [], 'validator' => ['name' => 'required|max:255', 'email' => 'required|email|unique:users', 'password' => 'confirmed|min:6', 'country_code' => 'required']], 'edit' => ['hidden' => ['id', 'su', 'email', 'register_ip', 'activation_key', 'locale', 'remember_token', 'created_at', 'updated_at'], 'su_hidden' => ['name', 'active', 'banned', 'password', 'country_code'], 'empty' => ['password'], 'default_random' => [], 'confirmed' => ['password'], 'encrypted' => [], 'hashed' => ['password'], 'masked' => ['password'], 'code' => [], 'wysiwyg' => [], 'validator' => ['name' => 'sometimes|required|max:255', 'password' => 'sometimes|confirmed|min:6', 'country_code' => 'sometimes|required']]], 'profile' => ['table' => 'users', 'edit' => ['hidden' => ['id', 'su', 'email', 'register_ip', 'active', 'banned', 'activation_key', 'locale', 'remember_token', 'created_at', 'updated_at'], 'empty' => ['password'], 'default_random' => [], 'confirmed' => ['password'], 'encrypted' => [], 'hashed' => ['password'], 'masked' => ['password'], 'code' => [], 'wysiwyg' => [], 'validator' => ['name' => 'sometimes|required|max:255', 'password' => 'sometimes|confirmed|min:6', 'country_code' => 'sometimes|required']]], 'users_settings' => ['table' => 'users_settings', 'edit' => ['hidden' => ['id', 'created_at', 'updated_at'], 'empty' => [], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'relations' => ['default_role' => ['data' => Laralum::roles(), 'value' => 'id', 'show' => 'name'], 'default_active' => ['data' => Laralum::dropdown('users_default_active'), 'value' => 'value', 'show' => 'show']], 'validator' => ['default_role' => 'sometimes|required', 'location' => 'sometimes|required', 'register_enabled' => 'sometimes|required', 'default_active' => 'sometimes|required', 'welcome_email' => 'sometimes|required']]], 'roles' => ['table' => 'roles', 'create' => ['hidden' => ['id', 'su', 'created_at', 'updated_at'], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'relations' => ['color' => ['data' => Laralum::dropdown('colors_name'), 'value' => 'value', 'show' => 'show']], 'validator' => ['name' => 'required|unique:roles', 'color' => 'required']], 'edit' => ['hidden' => ['id', 'su', 'created_at', 'updated_at'], 'su_hidden' => ['name'], 'empty' => [], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'relations' => ['color' => ['data' => Laralum::dropdown('colors_name'), 'value' => 'value', 'show' => 'show']], 'validator' => ['name' => 'sometimes|required|unique:roles,name,' . $row->id, 'color' => 'required']]], 'permissions' => ['table' => 'permissions', 'create' => ['hidden' => ['id', 'su', 'created_at', 'updated_at'], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => ['slug' => 'required|max:255|unique:permissions']], 'edit' => ['hidden' => ['id', 'su', 'created_at', 'updated_at'], 'su_hidden' => ['slug'], 'empty' => [], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => ['slug' => 'sometimes|required|max:255|unique:permissions,slug,' . $row->id]]], 'blogs' => ['table' => 'blogs', 'create' => ['hidden' => ['id', 'user_id', 'created_at', 'updated_at'], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => ['name' => 'required|max:255|unique:blogs']], 'edit' => ['hidden' => ['id', 'user_id', 'created_at', 'updated_at'], 'empty' => [], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => ['name' => 'sometimes|required|max:255|unique:blogs,name,' . $row->id]]], 'posts' => ['table' => 'posts', 'create' => ['hidden' => ['id', 'user_id', 'edited_by', 'blog_id', 'created_at', 'updated_at'], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => ['body'], 'validator' => ['title' => 'required|max:255', 'body' => 'required']], 'edit' => ['hidden' => ['id', 'user_id', 'edited_by', 'blog_id', 'created_at', 'updated_at'], 'empty' => [], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => ['body'], 'validator' => ['title' => 'sometimes|required|max:255', 'body' => 'required']]], 'comments' => ['table' => 'post_comments', 'create' => ['hidden' => ['id', 'post_id', 'user_id', 'created_at', 'updated_at'], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => ['name' => 'sometimes|required', 'email' => 'sometimes|required', 'content' => 'required']], 'edit' => ['hidden' => ['id', 'post_id', 'user_id', 'created_at', 'updated_at'], 'empty' => [], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => ['name' => 'sometimes|required', 'email' => 'sometimes|required', 'content' => 'required']]], 'settings' => ['table' => 'settings', 'create' => ['hidden' => ['id', 'laralum_version', 'created_at', 'updated_at'], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => []], 'edit' => ['hidden' => ['id', 'laralum_version', 'created_at', 'updated_at'], 'empty' => [], 'default_random' => [], 'confirmed' => [], 'encrypted' => [], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'relations' => ['header_color' => ['data' => Laralum::dropdown('colors_hex'), 'value' => 'value', 'show' => 'show'], 'button_color' => ['data' => Laralum::dropdown('colors_name'), 'value' => 'value', 'show' => 'show'], 'pie_chart_source' => ['data' => Laralum::dropdown('settings_pie_chart_source'), 'value' => 'value', 'show' => 'show'], 'bar_chart_source' => ['data' => Laralum::dropdown('settings_bar_chart_source'), 'value' => 'value', 'show' => 'show'], 'line_chart_source' => ['data' => Laralum::dropdown('settings_line_chart_source'), 'value' => 'value', 'show' => 'show'], 'geo_chart_source' => ['data' => Laralum::dropdown('settings_geo_chart_source'), 'value' => 'value', 'show' => 'show']], 'validator' => []]], 'documents' => ['table' => 'documents', 'create' => ['hidden' => ['id', 'slug', 'downloads', 'name', 'user_id', 'created_at', 'updated_at'], 'default_random' => [], 'confirmed' => [], 'encrypted' => ['password'], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => []], 'edit' => ['hidden' => ['id', 'slug', 'downloads', 'name', 'user_id', 'created_at', 'updated_at'], 'default_random' => [], 'default_random' => [], 'confirmed' => [], 'encrypted' => ['password'], 'hashed' => [], 'masked' => [], 'code' => [], 'wysiwyg' => [], 'validator' => []]]];
Пример #11
0
?>
@foreach($roles as $role)
    <div class="inline field">
        <div class="ui slider checkbox">
            <input
            <?php 
if (isset($row)) {
    if ($row->hasRole($role->name)) {
        echo "checked='checked' ";
    }
}
$disabled = false;
if ($role->su) {
    $disabled = true;
}
if (!$role->assignable and !Laralum::loggedInUser()->su) {
    $disabled = true;
}
if ($disabled) {
    echo "disabled";
}
?>
            type="checkbox" name="{{ $role->id }}" tabindex="0" class="hidden">
            <label>{{ $role->name }}
                @if($role->su)<i class="red asterisk thin icon pop" data-variation="wide" data-position="right center" data-title="{{ trans('laralum.su_role') }}" data-content="{{ trans('laralum.su_role_desc') }}"></i>@endif
                @if(!$role->assignable and !Laralum::loggedInUser()->su)
                    <i data-variation="wide" class="red lock icon pop" data-position="right center" data-title="{{ trans('laralum.unassignable_role') }}" data-content="{{ trans('laralum.unassignable_role_desc') }}"></i>
                @endif
                @if(!$role->assignable and Laralum::loggedInUser()->su)
                    <i data-variation="wide" class="red unlock icon pop" data-position="right center" data-title="{{ trans('laralum.unassignable_role_unlocked') }}" data-content="{{ trans('laralum.unassignable_role_unlocked_desc') }}"></i>
                @endif
Пример #12
0
             } else {
                 $save = false;
             }
         }
     }
     # Check if it's an encrypted field
     foreach ($encrypted as $encrypt) {
         if ($encrypt == $field) {
             if ($value != '') {
                 $value = Crypt::encrypt($value);
             }
         }
     }
     # Check if it's a relation and if the value is on the dropdown
     if (array_key_exists($field, $relations)) {
         if ($value == "" or !Laralum::checkValueInRelation($relations[$field]['data'], $value, $relations[$field]['value'])) {
             abort(403, trans('laralum.error_relation_value', ['field' => $field]));
         }
     }
     # Save it
     if ($save) {
         $row->{$field} = $value;
     }
 } elseif ($type == 'boolean') {
     # Save it
     if ($value) {
         $row->{$field} = true;
     } else {
         $row->{$field} = false;
     }
 } else {
Пример #13
0
<?php

$includes = ['header' => "\n        <script src=" . asset(Laralum::publicPath() . '/js/jquery-3.0.0.min.js') . "></script>\n    ", 'laralum_header' => "\n        <link rel='stylesheet' type='text/css' href='" . asset(Laralum::publicPath() . '/css/semantic.min.css') . "'>\n        <link rel='stylesheet' type='text/css' href='" . asset(Laralum::publicPath() . '/sweetalert/sweetalert.css') . "'>\n        <link rel='stylesheet' type='text/css' href='" . asset(Laralum::publicPath() . '/css/style.css') . "'>\n        <script src='" . asset(Laralum::publicPath() . '/js/jquery-3.0.0.min.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/code/ace.js') . "' type='text/javascript' charset='utf-8'></script>\n        <script src='" . asset(Laralum::publicPath() . '/sweetalert/sweetalert.min.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/ckeditor/ckeditor.js') . "'></script>\n    ", 'laralum_bottom' => "\n        <script src='" . asset(Laralum::publicPath() . '/js/semantic.min.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/date/jquery.timeago.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/js/script.js') . "'></script>\n    ", 'charts' => "\n        <script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>\n        <script type='text/javascript' src='https://www.google.com/jsapi'></script>\n        <script type='text/javascript'>google.charts.load('current', {'packages':['corechart', 'geochart']});</script>\n        <script src='" . asset(Laralum::publicPath() . '/highcharts/js/highcharts.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/highcharts/js/modules/exporting.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/highmaps/js/modules/map.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/highmaps/js/modules/data.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/highmaps/maps/world.js') . "'></script>\n        <script src='" . asset(Laralum::publicPath() . '/chartjs/Chart.js') . "'></script>\n    "];
Пример #14
0
<?php

$locales = ['en' => ['name' => "English", 'type' => 'flag', 'type_data' => 'gb', 'enabled' => true, 'author' => "Èrik Campobadal Forés", 'website' => "https://erik.cat"], 'es' => ['name' => "Castellano", 'type' => 'flag', 'type_data' => 'es', 'enabled' => true, 'author' => "Aitor Riba & Xavier Jorba", 'website' => "http://aitorriba.ml"], 'ca' => ['name' => "Català", 'type' => 'image', 'type_data' => asset(Laralum::publicPath() . '/images/ca.png'), 'enabled' => true, 'author' => "Aitor Riba & Xavier Jorba", 'website' => "http://aitorriba.ml"]];
Пример #15
0
                          <tr>
                              @foreach($columns as $column)
                                  <td>@if(in_array($column,$hide))<i>HIDDEN</i>@else @if($row->$column == "")<i>EMPTY</i>@else {{ $row->$column }} @endif @endif</td>
                              @endforeach
                              @if($allow_edit and \Schema::hasColumn($name, 'id'))
                                  <td>
                                      <a href="{{ route('Laralum::CRUD_edit', ['table' => $name, 'id' => $row->id]) }}" class="ui {{ Laralum::settings()->button_color }} button">{{ trans('laralum.edit') }}</a>
                                  </td>
                              @else
                                  <td>
                                      <a class="ui disabled {{ Laralum::settings()->button_color }} button">{{ trans('laralum.edit') }}</a>
                                  </td>
                              @endif
                              <?php 
# Check if you're allowed to delete rows
require Laralum::dataPath() . '/DevData.php';
$del = true;
if (array_key_exists($name, $data)) {
    if (array_key_exists('delete', $data[$name])) {
        if (!$data[$name]['delete']) {
            $del = false;
        }
    }
}
?>
                              @if($del)
                                  <td>
                                      <a href="{{ route('Laralum::CRUD_delete', ['table' => $name, 'id' => $row->id]) }}" class="ui {{ Laralum::settings()->button_color }} button">{{ trans('laralum.delete') }}</a>
                                  </td>
                              @else
                                  <td>
Пример #16
0
@section('content')
<div class="ui doubling stackable grid container">
    <div class="four wide column"></div>
    <div class="eight wide column">
        <div class="ui segment">
            <div class="ui {{ Laralum::settings()->button_color }} ribbon label">{{ trans('laralum.avatar') }}</div>
            <br><br>
            <center>
                <img class="ui small circular image" src="{{ $user->avatar(150) }}">
            </center>
            <br><br>
            <div class="ui {{ Laralum::settings()->button_color }} ribbon label">{{ trans('laralum.information') }}</div>
            <br><br>
            <center>
                <?php 
$countries = Laralum::countries();
?>
                <div class="ui list">
                    <div class="item">
                    <div class="header">{{ trans('laralum.country') }}</div>
                        @if(in_array($user->country_code, Laralum::noFlags()))<i class="help icon"></i> {{ $countries[$user->country_code] }}@else<i class="{{ strtolower($user->country_code) }} flag"></i> {{ $countries[$user->country_code] }}@endif
                    </div>
                    <div class="item">
                        <div class="header">{{ trans('laralum.join_date') }}:</div>
                        {{ Laralum::fancyDate($user->created_at) }}
                    </div>
                    <div class="item">
                        <div class="header">{{ trans('laralum.last_updated') }}:</div>
                        {{ Laralum::fancyDate($user->updated_at) }}
                    </div>
                </div>
Пример #17
0
}
$users_country_pie_graph['title'] = trans('laralum.users_graph2');
$users_country_pie_graph['labels'] = [];
$users_country_pie_graph['data'] = [];
foreach ($g_labels as $g_label) {
    array_push($users_country_pie_graph['labels'], $countries[$g_label]);
    array_push($users_country_pie_graph['data'], count(Laralum::users('country_code', $g_label)));
}
/*
|--------------------------------------------------------------------------
| users_country_geo_graph
|--------------------------------------------------------------------------
*/
$g_labels = [];
foreach (Laralum::users() as $user) {
    $add = true;
    foreach ($g_labels as $g_label) {
        if ($g_label == $user->country_code) {
            $add = false;
        }
    }
    if ($add) {
        array_push($g_labels, $user->country_code);
    }
}
$users_country_geo_graph['title'] = trans('laralum.users_graph2');
$users_country_geo_graph['element_label'] = trans('laralum.users');
$users_country_geo_graph['data'] = [];
foreach ($g_labels as $g_label) {
    array_push($users_country_geo_graph['data'], [$g_label, count(Laralum::users('country_code', $g_label))]);
}
Пример #18
0
@section('icon', "exchange")
@section('subtitle', trans('laralum.API_subtitle'))
@section('content')
  <div class="ui one column doubling stackable grid container">
  	<div class="column">
  		<div class="ui very padded segment">
  			<table class="ui table ">
  			  <thead>
  			    <tr>
                  <th>{{ trans('laralum.API_url') }}</th>
                  <th>{{ trans('laralum.API_show') }}</th>
  			    </tr>
  			  </thead>
  			  <tbody>
                <?php 
$api = Laralum::apiData();
?>
                @foreach($api as $a => $data)
		            <tr>
        				<td>
                            @if($data['enabled'])
                                <i class="green checkmark icon"></i>
                            @else
                                <i class="red close icon"></i>
                            @endif
                            <a href="{{ route('API::show', ['table' => $a]) }}">/{{ $a }}/{accessor?}/{data?}</a>
                        </td>
                        <td>
                            @foreach($data['show'] as $d)
                                <div class="ui basic label">{{ $d }}</div>
                            @endforeach
Пример #19
0
<?php

// Operations here
require 'WidgetsOperations.php';
// Widgets here
$widgets = ['latest_users_graph' => Laralum::lineChart($latest_users_graph['title'], $latest_users_graph['element_label'], $latest_users_graph['labels'], $latest_users_graph['data']), 'latest_posts_graph' => Laralum::lineChart($latest_posts_graph['title'], $latest_posts_graph['element_label'], $latest_posts_graph['labels'], $latest_posts_graph['data']), 'users_country_pie_graph' => Laralum::pieChart($users_country_pie_graph['title'], $users_country_pie_graph['labels'], $users_country_pie_graph['data']), 'users_country_geo_graph' => Laralum::geoChart($users_country_geo_graph['title'], $users_country_geo_graph['element_label'], $users_country_geo_graph['data']), 'roles_users' => Laralum::barChart($roles_users['title'], $roles_users['element_label'], $roles_users['labels'], $roles_users['data']), 'basic_stats_1' => "\n        <div class='ui doubling stackable three column grid container'>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::users()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.users') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::roles()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.roles') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::permissions()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.permissions') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n        </div>\n    ", 'basic_stats_2' => "\n        <div class='ui doubling stackable three column grid container'>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::posts()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.posts') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::postViews()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.post_views') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::comments()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.comments') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n        </div>\n    "];
Пример #20
0
			    <div class="page-content">
					<div class="menu-pusher">
		      			@yield('content')
					</div>
				</div>
				<br><br>
				<div class="page-footer">
					<div class="ui bottom fixed padded segment">
						<div class="menu-pusher">
			      			<div class="ui container">
								<a href="{{ url('/') }}" class="ui tiny header">
									{{ Laralum::websiteTitle() }}
								</a>
									 <?php 
$locales = Laralum::locales();
if ($locale = Laralum::loggedInUser()->locale) {
    $locale = $locales[$locale];
} else {
    $locale = $locales['en'];
}
?>
								-
								<a href="{{ $locale['website'] }}" class="ui tiny header">
									{{ trans('laralum.translated_by', ['author' => $locale['author']]) }}
								</a>
								<a class="ui tiny header right floated" href='https://github.com/ConsoleTVs/Laralum'>&copy; Copyright Laralum {{ Laralum::version() }}</a>
								<a class="ui tiny header right floated" href="https://erik.cat">Author</a>
							</div>
						</div>
					</div>
				</div>