示例#1
0
/**
 * Loads and parses Neon theme config files
 * @param string $filename Absoluth path to config file
 * @return array
 */
function loadConfig($filename)
{
    $file = realpath($filename);
    if ($file === false) {
        return false;
    }
    $options = NNeon::decode(file_get_contents($file));
    return $options;
}
示例#2
0
<?php

require '../../../../../../wp-load.php';
$shortcode = $_REQUEST['plugin'];
$ver = $GLOBALS['aitThemeShortcodes'][$shortcode];
if ($ver == 1) {
    $ver = '';
}
$configFile = dirname(__FILE__) . "/{$shortcode}/config{$ver}.neon";
if (!file_exists($configFile)) {
    $configFile = dirname(__FILE__) . "/{$shortcode}/config.neon";
}
$data = NNeon::decode(file_get_contents($configFile, true));
if (isset($data['width'])) {
    $width = $data['width'];
} else {
    $width = '640';
}
if (isset($data['height'])) {
    $height = $data['height'];
} else {
    $height = '700';
}
if (isset($data['title'])) {
    $title = $data['title'];
} else {
    $title = $shortcode . ' shortcodes';
}
wp_enqueue_script('jquery');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
示例#3
0
	/**
	 * Reads configuration from NEON file.
	 * @param  string  file name
	 * @return array
	 */
	public function load($file)
	{
		return $this->process((array) NNeon::decode(file_get_contents($file)));
	}