This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if ($noajax==1) | |
@extends('layouts.master') | |
@endif | |
@section('content') | |
//controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///EXHIBIT | |
public function medias() | |
{ | |
return $this->hasMany('Media','parent_id','exhibit_id'); | |
} | |
///ARTOBJ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//I want to know If I can make calls like this in laravel | |
<?php echo $this->App->ancestorsTree($items, array('AppHelper', 'modulesCallback'), 0, 'SystemModule', array('AppHelper', 'addSpacer')); ?> | |
<?php echo $this->requestAction(array('action' => 'search_system_modules ?>//this line is calling a php page that i pasted under this | |
/////Search system modules php page | |
<?php | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ArtObj extends Eloquent { | |
protected $table = 'art_objects'; | |
public $primaryKey = 'object_id'; | |
public $timestamps = false; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$d=''; | |
$datas = Input::get('data'); | |
$i=0; | |
foreach($datas as $data){ | |
$d += $data->index . $data->add; | |
} | |
return $d; | |
//data input example {"index":"index","add":"add","edit":"edit","delete":"delete"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$i=0; | |
$pr; | |
$user_per = new UserPermission; | |
foreach($per_data as $user_role_id => $permissions_data){ | |
$pr[$i]['user_role_id']= $user_role_id; | |
$pr[$i]['permissions']=$permissions_data; | |
$pr[$i]['module_id']=$mid; | |
$user_per->fill($pr); | |
$user_per->save($pr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected 'attributes' => | |
array (size=4) | |
'user_permission_id' => int 30 | |
'user_role_id' => int 1 | |
'module_id' => int 18 | |
'permissions_data' => string '["index","add","edit","delete"]' (length=31) | |
protected 'original' => | |
array (size=4) | |
'user_permission_id' => int 30 | |
'user_role_id' => int 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getpermissions($mid){ | |
$roleid = UserPermission::where('module_id','=',$mid)->where('user_role_id','=',Auth::user()->role_id)->first(); | |
return $roleid; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View::composer('*', function($view) | |
{ | |
$role = UserPermission::where('user_role_id','=',Auth::user()->role_id)->select('permissions_data')->get(); | |
$role->toArray(); | |
// $replace = array('"','[',']'); | |
//$data = str_replace($replace, "", $role->permissions_data); | |
//$permissions = explode(',',$data ); |
OlderNewer