function dfcg_setup() { dfcg_load_textdomain(); if (current_user_can('manage_options') && function_exists('add_options_page')) { add_options_page('Dynamic Content Gallery Options', 'Dynamic Content Gallery', 'manage_options', 'dynamic-gallery-plugin.php', 'dfcg_options_page'); add_filter('plugin_action_links', 'dfcg_filter_plugin_actions', 10, 2); dfcg_set_gallery_options(); } }
<?php /* This file is part of the DYNAMIC CONTENT GALLERY Plugin Version 2.2 ********************************************************************** Copyright 2008 Ade WALKER (email : info@studiograsshopper.ch) Options Page for WordPress MU */ dfcg_load_textdomain(); // Handle the updating of options if (isset($_POST['info_update'])) { // Is the user allowed to do this? if (function_exists('current_user_can') && !current_user_can('manage_options')) { die(__('Sorry. You do not have permission to do this.')); } // check the nonce check_admin_referer('dfcg-update'); // build the array from input $updated_options = $_POST['dfcg']; // trim whitespace within the array values foreach ($updated_options as $key => $value) { $updated_options[$key] = trim($value); } // deal with the MOOTOOLS checkbox $onoff_opts = array('mootools'); foreach ($onoff_opts as $key) { $updated_options[$key] = $updated_options[$key] ? '1' : '0'; } // deal with the RESET checkbox $bool_opts = array('reset'); foreach ($bool_opts as $key) {