Vyvinuto a určeno pro pure-heart.zaantar.eu Version: 1.2 Author: Zaantar Author URI: http://zaantar.eu License: GPL2 */ /* Copyright 2010 Zaantar (email: zaantar@gmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* ************************************************************************* *\ WORDPRESS ADMIN \* ************************************************************************* */ add_action( 'admin_menu','atd_add_admin_menu' ); function atd_add_admin_menu() { add_options_page( __( 'Admin Temp Dir Options', ATD_TEXTDOMAIN ), __( 'Admin Temp Dir', ATD_TEXTDOMAIN ), 'manage_options', __FILE__, 'atd_options_page' ); add_submenu_page('index.php', atd_get_option( 'menu_title' ), atd_get_option( 'menu_title' ), 'read', 'temp-directory', 'atd_page'); } function atd_page() { ?>

'.printf( __( 'Please input only existing directory paths relative to %s.', ATD_TEXTDOMAIN ), ''.atd_get_base_dir().'' ).'

'; } function atd_field_admin_dir() { $options = get_option( ATD_OPTIONS ); ?> '/atd/admin', 'atd_cap_dir' => '/atd/cap', 'atd_common_dir' => '/atd/common', 'menu_title' => 'Important information', 'cap_dir_title' => '', 'cap_dir_cap' => 'special_capability' ); update_option( ATD_OPTIONS, $defaults ); } } /* __( , ATD_TEXTDOMAIN ) */ /*****************************************************************************\ I18N \*****************************************************************************/ define( 'ATD_TEXTDOMAIN', 'admin-temp-dir' ); add_action( 'init', 'atd_load_textdomain' ); function atd_load_textdomain() { $plugin_dir = basename(dirname(__FILE__)); load_plugin_textdomain( ATD_TEXTDOMAIN, false, $plugin_dir.'/languages' ); } /* ************************************************************************* *\ PRINT DIRECTORY CONTENT from http://www.liamdelahunty.com/tips/php_list_a_directory.php \* ************************************************************************* */ function atd_print_dir( $path, $url ) { // open this directory //echo $path.'
'; $myDirectory = opendir( $path ); // get each entry while($entryName = readdir($myDirectory)) { $dirArray[] = $entryName; } //print_r( $dirArray ); // close directory closedir($myDirectory); // count elements in array $indexCount = count($dirArray); //echo ("$indexCount files
\n"); // sort 'em sort($dirArray); // print 'em ?>