| [ Index ] |
PHP Cross Reference of GlotPress |
[Summary view] [Print] [Text view]
1 <?php 2 require_once dirname( dirname( __FILE__ ) ) . '/gp-load.php'; 3 4 class GP_Script_Upgrade_Permissions extends GP_CLI { 5 6 function run() { 7 $permissions = GP::$permission->find_many( array( 'object_type' => 'translation-set', 'action' => 'approve' ) ); 8 foreach( $permissions as $permission ) { 9 $set = GP::$translation_set->get( $permission->object_id ); 10 $project = GP::$project->get( $set->project_id ); 11 GP::$permission->create( array( 12 'user_id' => $permission->user_id, 13 'action' => 'approve', 14 'object_type' => 'project|locale|set-slug', 15 'object_id' => $project->id.'|'.$set->locale.'|'.$set->slug, 16 ) ); 17 } 18 } 19 } 20 $gp_script_upgrade_permissions = new GP_Script_Upgrade_Permissions; 21 $gp_script_upgrade_permissions->run();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu May 24 03:59:35 2012 | Hosted by follow the white rabbit. |