abspath_file = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'cforms' . DIRECTORY_SEPARATOR . 'abspath.php'; $this->cforms_js_file = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'cforms' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'cforms.js'; add_action( 'admin_menu', array(&$this, 'addMenu') ); } } function addMenu() { add_options_page( __('Adv Edit Cforms', 'adv-cforms'), __('Adv Edit Cforms', 'adv-cforms'), 'manage_options', 'adv-cforms', array( &$this, 'pageOptions' ) ); } function pageOptions() { if ( isset($_POST['submit_adv_cforms']) ) { if ( !current_user_can('manage_options') ) die(__( 'You cannot edit the Advanced Cforms options.', 'adv-cforms' )); check_admin_referer( 'adv-cforms-options' ); // DB Options $current_options = get_option( $this->option_name ); $current_options = $this->array_merge_recursive_distinct( $current_options, $_POST['cforms'] ); update_option( $this->option_name, $current_options ); // File abs path if ( isset($_POST['abs-path-file']) && is_writable($this->abspath_file) ) { $_POST['abs-path-file'] = stripslashes($_POST['abs-path-file']); if ( file_get_contents( $this->abspath_file ) != $_POST['abs-path-file'] ) { file_put_contents( $this->abspath_file, $_POST['abs-path-file'] ); } } // JS File if ( isset($_POST['cforms-js-file']) && is_writable($this->cforms_js_file) ) { $new_file = array(); $_POST['cforms-js-file'] = stripslashes($_POST['cforms-js-file']); $lines = file( $this->cforms_js_file ); foreach ($lines as $line_num => $line) { if ( strpos( $line, 'var sajax_uri =' ) !== false ) { $new_file[] = $_POST['cforms-js-file']; } else { $new_file[] = $line; } } file_put_contents( $this->cforms_js_file, implode( '', $new_file ) ); } echo '

'.__('Options updated with succes !', 'adv-cforms').'

'; } clearstatcache(); $current_options = get_option( $this->option_name ); ?>

$options ) : foreach( (array) $options as $option_key => $option_value ) : if ( !in_array($option_key, $this->editables_options) ) { if ( strpos( $option_key, '_upload_dir' ) === false ) { // cforms*_upload_dir continue; } } ?>

abspath_file) ) : ?>
abspath_file) ) { echo __('File not writeable.', 'adv-cforms'). '
'; chmod( $this->abspath_file, 0644 ); } ?>
cforms_js_file) ) : ?>
cforms_js_file) ) { echo __('File not writeable.', 'adv-cforms'). '
'; chmod( $this->cforms_js_file, 0644 ); } $lines = file( $this->cforms_js_file ); $cforms_js_line = ''; foreach ($lines as $line_num => $line) { if ( strpos( $line, 'var sajax_uri =' ) !== false ) { $cforms_js_line = $line; break; } } ?>

" />

&$value ) { if ( is_array ( $value ) && isset ( $merged [$key] ) && is_array ( $merged [$key] ) ) { $merged [$key] = $this->array_merge_recursive_distinct ( $merged [$key], $value ); } else { $merged [$key] = $value; } } return $merged; } } ?>