예제 #1
0
 public function plugin_deactivate($slug)
 {
     $plugin_data = Plugins::get_plugin($slug);
     $plugin = Plugin::where('slug', '=', $slug)->first();
     $plugin->active = 0;
     $plugin->save();
     return Redirect::to('admin?section=plugins')->with(array('note' => 'Successfully De-activated ' . $plugin_data['name'], 'note_type' => 'success'));
 }
 function plugin_file_shortcode($atts)
 {
     global $current_user;
     $secure = true;
     extract($atts);
     $plugin = Plugins::get_plugin($id);
     $file = array_pop($plugin->files);
     $plugin_access = get_usermeta($current_user->ID, 'plugin_access');
     $user_sites = $plugin_access[$id]['sites'];
     $has_access = false;
     $fileOptions = get_option($id);
     $groups = $fileOptions['groups'];
     foreach ($groups as $group_id) {
         if (Memberships::is_member_of_group($user->ID, $group_id)) {
             $plugin->has_access = true;
         }
     }
     include "app/views/shortcodes/plugin.php";
 }