Exemple #1
0
     $edit_Plugin =& $admin_Plugins->get_by_ID($plugin_ID);
     load_funcs('plugins/_plugin.funcs.php');
     _set_setting_by_path($edit_Plugin, 'UserSettings', $set_path, NULL);
     $edit_Plugin->Settings->dbupdate();
     $action = 'edit';
     break;
 case 'add_settings_set':
     // delegates to edit_settings
     // Add a new set to an array type setting:
     param('plugin_ID', 'integer', true);
     param('set_path', 'string', '');
     $admin_Plugins =& get_Plugins_admin();
     $admin_Plugins->restart();
     $edit_Plugin =& $admin_Plugins->get_by_ID($plugin_ID);
     load_funcs('plugins/_plugin.funcs.php');
     _set_setting_by_path($edit_Plugin, 'UserSettings', $set_path, array());
     $edit_Plugin->Settings->dbupdate();
     $action = 'edit';
     break;
 case 'search':
     // Quick search
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('user');
     param('user_search', 'string', '');
     set_param('keywords', $user_search);
     set_param('filter', 'new');
     load_class('users/model/_userlist.class.php', 'UserList');
     $UserList = new UserList('admin', $UserSettings->get('results_per_page'), 'users_', array('join_city' => false));
     $UserList->load_from_Request();
     // Make query to get a count of users
     $UserList->query();
Exemple #2
0
     param('plugin_ID', 'integer', true);
     $admin_Plugins =& get_Plugins_admin();
     // use Plugins_admin, because a plugin might be disabled
     $Plugin =& $admin_Plugins->get_by_ID($plugin_ID);
     if (!$Plugin) {
         bad_request_die('Invalid Plugin.');
     }
     param('set_type', 'string', '');
     // "Settings" or "UserSettings"
     if ($set_type != 'Settings') {
         bad_request_die('Invalid set_type param!');
     }
     param('set_path', '/^\\w+(?:\\[\\w+\\])+$/', '');
     load_funcs('plugins/_plugin.funcs.php');
     // Init the new setting set:
     _set_setting_by_path($Plugin, $set_type, $set_path, array());
     // Get the new plugin setting set and display it with a fake Form
     $r = get_plugin_settings_node_by_path($Plugin, $set_type, $set_path, false);
     $Form = new Form();
     // fake Form to display plugin setting
     autoform_display_field($set_path, $r['set_meta'], $Form, $set_type, $Plugin, NULL, $r['set_node']);
     break;
 case 'set_object_link_position':
     // Change a position of a link on the edit item screen (fieldset "Images & Attachments")
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('link');
     // Check item/comment edit permission below after we have the $LinkOwner object ( we call LinkOwner->check_perm ... )
     param('link_ID', 'integer', true);
     param('link_position', 'string', true);
     $LinkCache =& get_LinkCache();
     if (($Link =& $LinkCache->get_by_ID($link_ID)) === false) {