@@ -500,21 +500,14 @@ public function getRoleUsers()
500
500
$ usersArray = $ this ->arrayToSelect ($ users , 'id ' , 'username ' , 'Select a user ' );
501
501
$ rolesArray = $ this ->arrayToSelect ($ roles , 'id ' , 'name ' , 'None ' );
502
502
503
- // Set up the one page crud
504
503
Crud::setTitle ('Role Users ' )
505
- ->setSortProperty ('username ' )
506
- ->setPaginationFlag (true )
507
- ->setMulti ($ users , 'roles ' )
508
- ->setMultiColumns (array ('Users ' , 'Roles ' ))
509
- ->setMultiDetails (array ('name ' => 'username ' , 'field ' => 'user_id ' ))
510
- ->setMultiPropertyDetails (array ('name ' => 'name ' , 'field ' => 'role_id ' ));
511
-
512
- // Add the form fields
513
- Crud::addFormField ('user_id ' , 'select ' , $ usersArray )
514
- ->addFormField ('role_id ' , 'multiselect ' , $ rolesArray );
515
-
516
- // Handle the view data
517
- Crud::make ();
504
+ ->setSortProperty ('username ' )
505
+ ->setPaginationFlag (true )
506
+ ->setUpMultiColumn ()
507
+ ->addRootColumn ('Users ' , $ users , 'username ' , 'user_id ' , $ usersArray )
508
+ ->addMultiColumn ('Roles ' , 'roles ' , 'name ' , 'role_id ' , $ rolesArray )
509
+ ->finish ()
510
+ ->make ();
518
511
}
519
512
520
513
public function postRoleUsers ()
@@ -568,23 +561,20 @@ public function postRoleUsers()
568
561
569
562
public function getActionRoles ()
570
563
{
571
- $ actions = User_Permission_Action::orderByNameAsc ()->get ();
572
564
$ roles = User_Permission_Role::orderByNameAsc ()->get ();
565
+ $ actions = User_Permission_Action::orderByNameAsc ()->get ();
566
+
567
+ $ rolesArray = $ roles ->toSelectArray ('Select a role ' );
568
+ $ actionsArray = $ actions ->toSelectArray ('None ' );
573
569
574
570
// Set up the one page crud
575
571
Crud::setTitle ('Action Roles ' )
576
- ->setSortProperty ('name ' )
577
- ->setMulti ($ roles , 'actions ' )
578
- ->setMultiColumns (array ('Roles ' , 'Actions ' ))
579
- ->setMultiDetails (array ('name ' => 'name ' , 'field ' => 'role_id ' ))
580
- ->setMultiPropertyDetails (array ('name ' => 'name ' , 'field ' => 'action_id ' ));
581
-
582
- // Add the form fields
583
- Crud::addFormField ('role_id ' , 'select ' , $ this ->arrayToSelect ($ roles , 'id ' , 'name ' , 'Select a role ' ))
584
- ->addFormField ('action_id ' , 'multiselect ' , $ this ->arrayToSelect ($ actions , 'id ' , 'name ' , 'None ' ));
585
-
586
- // Handle the view data
587
- Crud::make ();
572
+ ->setSortProperty ('name ' )
573
+ ->setUpMultiColumn ()
574
+ ->addRootColumn ('Roles ' , $ roles , 'name ' , 'role_id ' , $ rolesArray )
575
+ ->addMultiColumn ('Actions ' , 'actions ' , 'name ' , 'action_id ' , $ actionsArray )
576
+ ->finish ()
577
+ ->make ();
588
578
}
589
579
590
580
public function postActionRoles ()
@@ -712,19 +702,21 @@ public function getPreferencedelete($preferenceId)
712
702
713
703
public function getTheme ()
714
704
{
715
- $ masterLess = base_path () .'/vendor/syntax/core/public/less/master .less ' ;
705
+ $ masterLess = public_path () .'/css/colors .less ' ;
716
706
717
707
$ lines = file ($ masterLess );
718
708
709
+ // ppd($lines);
710
+
719
711
$ colors = array ();
720
712
721
- $ colors ['grey ' ] = array ('title ' => 'Background Color ' , 'hex ' => substr (explode ('@grey: ' , $ lines [4 ])[1 ], 0 , -2 ));
722
- $ colors ['primary ' ] = array ('title ' => 'Primary Color ' , 'hex ' => substr (explode ('@primaryColor: ' , $ lines [6 ])[1 ], 0 , -2 ));
723
- $ colors ['info ' ] = array ('title ' => 'Information Color ' , 'hex ' => substr (explode ('@infoColor: ' , $ lines [10 ])[1 ], 0 , -2 ));
724
- $ colors ['success ' ] = array ('title ' => 'Success Color ' , 'hex ' => substr (explode ('@successColor: ' , $ lines [13 ])[1 ], 0 , -2 ));
725
- $ colors ['warning ' ] = array ('title ' => 'Warning Color ' , 'hex ' => substr (explode ('@warningColor: ' , $ lines [16 ])[1 ], 0 , -2 ));
726
- $ colors ['error ' ] = array ('title ' => 'Error Color ' , 'hex ' => substr (explode ('@errorColor: ' , $ lines [19 ])[1 ], 0 , -2 ));
727
- $ colors ['menu ' ] = array ('title ' => 'Active Menu Link Color ' , 'hex ' => substr (explode ('@menuColor: ' , $ lines [22 ])[1 ], 0 , -2 ));
713
+ $ colors ['grey ' ] = array ('title ' => 'Background Color ' , 'hex ' => substr (explode ('@grey: ' , $ lines [0 ])[1 ], 0 , -2 ));
714
+ $ colors ['primary ' ] = array ('title ' => 'Primary Color ' , 'hex ' => substr (explode ('@primaryColor: ' , $ lines [2 ])[1 ], 0 , -2 ));
715
+ $ colors ['info ' ] = array ('title ' => 'Information Color ' , 'hex ' => substr (explode ('@infoColor: ' , $ lines [6 ])[1 ], 0 , -2 ));
716
+ $ colors ['success ' ] = array ('title ' => 'Success Color ' , 'hex ' => substr (explode ('@successColor: ' , $ lines [9 ])[1 ], 0 , -2 ));
717
+ $ colors ['warning ' ] = array ('title ' => 'Warning Color ' , 'hex ' => substr (explode ('@warningColor: ' , $ lines [12 ])[1 ], 0 , -2 ));
718
+ $ colors ['error ' ] = array ('title ' => 'Error Color ' , 'hex ' => substr (explode ('@errorColor: ' , $ lines [15 ])[1 ], 0 , -2 ));
719
+ $ colors ['menu ' ] = array ('title ' => 'Active Menu Link Color ' , 'hex ' => substr (explode ('@menuColor: ' , $ lines [18 ])[1 ], 0 , -2 ));
728
720
729
721
$ this ->setViewData ('colors ' , $ colors );
730
722
}
@@ -734,28 +726,26 @@ public function postTheme()
734
726
$ input = e_array (Input::all ());
735
727
736
728
if ($ input != null ) {
737
- $ masterLess = base_path () .'/vendor/syntax/core/public/less/master.less ' ;
738
- $ masterCss = public_path () .'/css/master.css ' ;#5097b5
729
+ $ masterLess = public_path () .'/css/colors.less ' ;
739
730
740
731
$ lines = file ($ masterLess );
741
732
742
733
// Set the new colors
743
- $ lines [4 ] = '@grey: ' . $ input ['grey ' ] ."; \n" ;
744
- $ lines [6 ] = '@primaryColor: ' . $ input ['primary ' ] ."; \n" ;
745
- $ lines [10 ] = '@infoColor: ' . $ input ['info ' ] ."; \n" ;
746
- $ lines [13 ] = '@successColor: ' . $ input ['success ' ] ."; \n" ;
747
- $ lines [16 ] = '@warningColor: ' . $ input ['warning ' ] ."; \n" ;
748
- $ lines [19 ] = '@errorColor: ' . $ input ['error ' ] ."; \n" ;
749
- $ lines [22 ] = '@menuColor: ' . $ input ['menu ' ] ."; \n" ;
734
+ $ lines [0 ] = '@grey: ' . $ input ['grey ' ] ."; \n" ;
735
+ $ lines [2 ] = '@primaryColor: ' . $ input ['primary ' ] ."; \n" ;
736
+ $ lines [6 ] = '@infoColor: ' . $ input ['info ' ] ."; \n" ;
737
+ $ lines [9 ] = '@successColor: ' . $ input ['success ' ] ."; \n" ;
738
+ $ lines [12 ] = '@warningColor: ' . $ input ['warning ' ] ."; \n" ;
739
+ $ lines [15 ] = '@errorColor: ' . $ input ['error ' ] ."; \n" ;
740
+ $ lines [18 ] = '@menuColor: ' . $ input ['menu ' ] ."; \n" ;
750
741
751
742
File::delete ($ masterLess );
752
- File::delete ($ masterCss );
753
743
754
744
File::put ($ masterLess , implode ($ lines ));
755
745
756
746
SSH ::run (array (
757
747
'cd ' . base_path (),
758
- 'lessc ' . $ masterLess . ' ' . $ masterCss
748
+ 'gulp css '
759
749
));
760
750
761
751
Ajax::setStatus ('success ' );
0 commit comments