Showing preview only (1,594K chars total). Download the full file or copy to clipboard to get everything.
Repository: vafour/vafpress-framework
Branch: master
Commit: 804a9a886779
Files: 152
Total size: 1.5 MB
Directory structure:
gitextract_z9yzb05m/
├── .gitignore
├── LICENSE
├── README.md
├── autoload.php
├── bootstrap.php
├── classes/
│ ├── control/
│ │ ├── field/
│ │ │ ├── checkbox.php
│ │ │ ├── checkimage.php
│ │ │ ├── codeeditor.php
│ │ │ ├── color.php
│ │ │ ├── date.php
│ │ │ ├── fontawesome.php
│ │ │ ├── html.php
│ │ │ ├── item/
│ │ │ │ └── generic.php
│ │ │ ├── multiselect.php
│ │ │ ├── notebox.php
│ │ │ ├── radiobutton.php
│ │ │ ├── radioimage.php
│ │ │ ├── select.php
│ │ │ ├── slider.php
│ │ │ ├── sorter.php
│ │ │ ├── textarea.php
│ │ │ ├── textbox.php
│ │ │ ├── toggle.php
│ │ │ ├── upload.php
│ │ │ └── wpeditor.php
│ │ ├── field.php
│ │ ├── fieldmulti.php
│ │ └── fieldmultiimage.php
│ ├── filesystem.php
│ ├── metabox/
│ │ ├── alchemy.php
│ │ └── depsloader.php
│ ├── metabox.php
│ ├── multiselectable.php
│ ├── option/
│ │ ├── control/
│ │ │ ├── field/
│ │ │ │ ├── impexp.php
│ │ │ │ └── restore.php
│ │ │ ├── group/
│ │ │ │ ├── menu.php
│ │ │ │ └── section.php
│ │ │ ├── group.php
│ │ │ └── set.php
│ │ ├── depsloader.php
│ │ └── parser.php
│ ├── option.php
│ ├── security.php
│ ├── shortcodegenerator.php
│ ├── site/
│ │ └── googlewebfont.php
│ ├── util/
│ │ ├── array.php
│ │ ├── config.php
│ │ ├── profiler.php
│ │ ├── reflection.php
│ │ ├── res.php
│ │ └── text.php
│ ├── view.php
│ └── wp/
│ ├── admin.php
│ ├── enqueuer.php
│ ├── loader.php
│ ├── massenqueuer.php
│ ├── user.php
│ └── util.php
├── config/
│ ├── dependencies.php
│ └── messages.php
├── constant.php
├── credits.txt
├── data/
│ ├── gwf.json
│ └── sources.php
├── includes/
│ ├── parsedown.php
│ └── wpalchemy/
│ └── MetaBox.php
├── lang/
│ ├── README.md
│ ├── de_DE.mo
│ ├── es_ES.mo
│ ├── id_ID.mo
│ ├── ja_JP.mo
│ ├── nl_NL.mo
│ ├── pl_PL.mo
│ ├── tr_TR.mo
│ └── vafpress-framework.pot
├── public/
│ ├── css/
│ │ ├── metabox.css
│ │ ├── option.css
│ │ ├── shortcode.css
│ │ └── vendor/
│ │ ├── bootstrap-colorpicker.css
│ │ ├── colorpicker.css
│ │ ├── jqueryui/
│ │ │ └── themes/
│ │ │ └── smoothness/
│ │ │ └── jquery-ui-1.9.2.custom.css
│ │ ├── reveal.css
│ │ ├── select2.css
│ │ └── tipsy.css
│ ├── font/
│ │ └── FontAwesome.otf
│ └── js/
│ ├── dummy.js
│ ├── kia-metabox.js
│ ├── metabox.js
│ ├── option.js
│ ├── shared.js
│ ├── shortcode-menu.js
│ ├── shortcode-quicktags.js
│ ├── shortcodes.js
│ └── vendor/
│ ├── ace/
│ │ ├── ace.js
│ │ ├── mode-css.js
│ │ ├── mode-html.js
│ │ ├── mode-javascript.js
│ │ ├── mode-json.js
│ │ ├── mode-markdown.js
│ │ ├── mode-php.js
│ │ ├── mode-xml.js
│ │ ├── theme-chaos.js
│ │ ├── theme-chrome.js
│ │ ├── theme-clouds.js
│ │ ├── theme-clouds_midnight.js
│ │ ├── theme-cobalt.js
│ │ ├── theme-crimson_editor.js
│ │ ├── theme-dawn.js
│ │ ├── theme-dreamweaver.js
│ │ ├── theme-eclipse.js
│ │ ├── theme-github.js
│ │ ├── theme-mono_industrial.js
│ │ ├── theme-monokai.js
│ │ ├── theme-solarized_dark.js
│ │ ├── theme-solarized_light.js
│ │ ├── theme-textmate.js
│ │ ├── theme-twilight.js
│ │ ├── worker-css.js
│ │ ├── worker-javascript.js
│ │ ├── worker-json.js
│ │ └── worker-php.js
│ ├── bootstrap-colorpicker.js
│ ├── jquery-scrollspy.js
│ ├── jquery.reveal.js
│ ├── jquery.tipsy.js
│ └── select2.sortable.js
└── views/
├── control/
│ ├── checkbox.php
│ ├── checkimage.php
│ ├── codeeditor.php
│ ├── color.php
│ ├── date.php
│ ├── fontawesome.php
│ ├── html.php
│ ├── multiselect.php
│ ├── notebox.php
│ ├── radiobutton.php
│ ├── radioimage.php
│ ├── select.php
│ ├── slider.php
│ ├── sorter.php
│ ├── template_control_foot.php
│ ├── template_control_head.php
│ ├── textarea.php
│ ├── textbox.php
│ ├── toggle.php
│ ├── upload.php
│ └── wpeditor.php
└── option/
├── impexp.php
├── menu.php
├── restore.php
├── section.php
└── set.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
build/
================================================
FILE: LICENSE
================================================
Copyright (C) 2013 Vafpress (http://vafpress.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
================================================
FILE: README.md
================================================
# Vafpress Framework
For those who need a simpler way to create their own Wordpress Theme. See the [homepage](http://vafpress.com/vafpress-framework/). Available as library and plugin, please check out those repos:
* [Vafpress Framework Plugin](https://github.com/vafour/vafpress-framework-plugin)
* [Vafpress Framework Theme Boilerplate](https://github.com/vafour/vafpress-framework-theme-boilerplate)
## Core Features
* Theme Options Builder
* Metaboxes Builder
* Shortcode Generator Builder
## Features
* Rich Set Of Fields
* Client Side Validation
* Custom Data Source
* Binding Data Source
* Fields Binding
* Fields Dependencies
* Import / Export
* Restore Options to Default
* Localization
* Wordpress 3.3++ compatibility
* New WP 3.5 Media Manager
## Field Types
* TextBox
* TextArea
* CheckBox
* CheckImage
* RadioButton
* RadioImage
* Select
* MultiSelect
* Slider
* Toggle
* Upload
* DatePicker
* ColorPicker
* CodeEditor
* NoteBox
* Fontawesome icon chooser
* WP TinyMCE Editor
## Field Validation
* alphabet
* alphanumeric
* numeric
* email
* url
* maxlength
* minlength
* maxselected
* minselected
* required
## How to Develop with Vafpress Framework
Go to our [Documentation](http://vafpress.com/documentation/vafpress-framework/), everything is there.
## Support
Please visit our support forum at http://support.vafpress.com if you need any helps.
## Contribution
We welcome to any contribution, you can:
1. Contribute to Vafpress code base.
2. Report on issue here.
3. Give us feedback via [forum](http://support.vafpress.com)
4. Helping others in forum.
5. Help us translate Vafpress Framework to your language at [Vafpress on Transifex](https://www.transifex.com/projects/p/vafpress-framework/)
## Credits
Please read credits.txt file.
================================================
FILE: autoload.php
================================================
<?php
/*
|--------------------------------------------------------------------------
| Register AutoLoader
|--------------------------------------------------------------------------
| Vafpress Framework has separated app and core directories, developers can
| put their extension code and configuration at app folder, as everything
| inside app will be loaded first and will override class with the same
| name with core classes.
*/
VP_AutoLoader::add_namespaces(VP_NAMESPACE);
VP_AutoLoader::add_directories(VP_CLASSES_DIR, VP_NAMESPACE);
VP_AutoLoader::register();
class VP_AutoLoader
{
/**
* Indicates if VP_AutoLoader has been registered.
*
* @var boolean
*/
protected static $registered = false;
/**
* The registered directories
*
* @var array
*/
protected static $directories = array();
/**
* THe registered namespaces
*
* @var array
*/
protected static $namespaces = array();
/**
* Autoloading logic
*
* @param String $class Class name
* @return Boolean Whether the loading succeded.
*/
public static function load($class)
{
clearstatcache();
// figure out namespace and halt process if not in our namespace
$namespace = self::discover_namespace($class);
if($namespace === '')
return;
$class = self::normalize_class($class, $namespace);
foreach (self::$directories[$namespace] as $dir)
{
$file = $dir . DIRECTORY_SEPARATOR . $class;
// if( $dir === end(self::$directories) )
// {
// require $file;
// return true;
// }
if (is_link($file))
{
$file = readlink($file);
}
// $real = realpath($file);
// if($real) $file = $real;
if(is_file($file))
{
require $file;
return true;
}
}
}
/**
* Discover namespace from a string
*
* @param String $key A class name or namespaced key
* @return String Namespace
*/
public static function discover_namespace($key)
{
$namespace = '';
foreach (self::$namespaces as $ns)
{
if (strpos($key, $ns) === 0)
{
$namespace = $ns;
break;
}
}
return $namespace;
}
/**
* Register autoloader
*
* @return void
*/
public static function register()
{
if(self::$registered !== TRUE)
{
spl_autoload_register(array('VP_AutoLoader', 'load'));
}
self::$registered = TRUE;
}
/**
* Add a namespace
*
* @return void
*/
public static function add_namespaces($namespaces)
{
self::$namespaces = array_merge(self::$namespaces, (array) $namespaces);
self::$namespaces = array_unique(self::$namespaces);
usort(self::$namespaces, array('self', 'sort'));
}
/**
* Sort by length
*/
private static function sort($a, $b)
{
return strlen($b) - strlen($a);
}
/**
* Add directories to the autoloader, loading process will be run in orderly fashion
* of directory addition.
*
* @param String|Array $directories
* @param String $namespace
* @return void
*/
public static function add_directories($directories, $namespace)
{
if(in_array($namespace, self::$namespaces))
{
if(!isset(self::$directories[$namespace]))
self::$directories[$namespace] = array();
self::$directories[$namespace] = array_merge(self::$directories[$namespace], (array) $directories);
self::$directories[$namespace] = array_unique(self::$directories[$namespace]);
}
}
/**
* Remove directories.
*
* @param String|Array $directories
* @return void
*/
public static function remove_directories($directories = null, $namespace)
{
// check if namespace existed
if(!in_array($namespace, self::$namespaces))
return;
// annihilate everything if none / null passed
if(is_null($directories))
{
self::$directories[$namespace] = array();
}
else
{
// prepare directories to be filtered
$directories = (array) $directories;
// do the filtering
foreach (self::$directories[$namespace] as $key => $dir)
{
if(in_array($dir, $directories))
{
unset(self::$directories[$namespace][$key]);
}
}
}
}
/**
* Normalize class to be loaded
*
* @param String $class Class name
* @return String Normalized class name
*/
public static function normalize_class($class, $namespace)
{
$class = ltrim($class, '\\');
$class = str_replace($namespace, '', $class);
$class = ltrim($class, '_');
$class = strtolower($class);
return str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
}
/**
* Get all directories
*
* @return Array
*/
public static function get_directories()
{
return self::$directories;
}
}
/**
* EOF
*/
================================================
FILE: bootstrap.php
================================================
<?php
if( defined('VP_VERSION') )
return;
//////////////////////////
// Include Constants //
//////////////////////////
require_once 'constant.php';
//////////////////////////
// Include Autoloader //
//////////////////////////
require_once 'autoload.php';
//////////////////////////
// Load Languages //
//////////////////////////
load_theme_textdomain('vp_textdomain', VP_DIR . '/lang');
//////////////////////////
// Setup FileSystem //
//////////////////////////
$vpfs = VP_FileSystem::instance();
$vpfs->add_directories('views' , VP_VIEWS_DIR);
$vpfs->add_directories('config' , VP_CONFIG_DIR);
$vpfs->add_directories('data' , VP_DATA_DIR);
$vpfs->add_directories('includes', VP_INCLUDE_DIR);
//////////////////////////
// Include Data Source //
//////////////////////////
foreach (glob(VP_DATA_DIR . "/*.php") as $datasource)
{
require_once($datasource);
}
//////////////////////////
// TGMPA Unsetting //
//////////////////////////
add_action('after_setup_theme', 'vp_tgm_ac_check');
if( !function_exists('vp_tgm_ac_check') )
{
function vp_tgm_ac_check()
{
add_action('tgmpa_register', 'vp_tgm_ac_vafpress_check');
}
}
if( !function_exists('vp_tgm_ac_vafpress_check') )
{
function vp_tgm_ac_vafpress_check()
{
if( defined('VP_VERSION') and class_exists('TGM_Plugin_Activation') )
{
foreach (TGM_Plugin_Activation::$instance->plugins as $key => &$plugin)
{
if( $plugin['name'] === 'Vafpress Framework Plugin' )
{
unset(TGM_Plugin_Activation::$instance->plugins[$key]);
}
}
}
}
}
//////////////////////////
// Ajax Definition //
//////////////////////////
add_action('wp_ajax_vp_ajax_wrapper', 'vp_ajax_wrapper');
if( !function_exists('vp_ajax_wrapper') )
{
function vp_ajax_wrapper()
{
$function = $_POST['func'];
$params = $_POST['params'];
if( VP_Security::instance()->is_function_whitelisted($function) )
{
if(!is_array($params))
$params = array($params);
try {
$result['data'] = call_user_func_array($function, $params);
$result['status'] = true;
$result['message'] = __("Successful", 'vp_textdomain');
} catch (Exception $e) {
$result['data'] = '';
$result['status'] = false;
$result['message'] = $e->getMessage();
}
}
else
{
$result['data'] = '';
$result['status'] = false;
$result['message'] = __("Unauthorized function", 'vp_textdomain');
}
if (ob_get_length()) ob_clean();
header('Content-type: application/json');
echo json_encode($result);
die();
}
}
/////////////////////////////////
// Pool and Dependencies Init //
/////////////////////////////////
add_action( 'init' , 'vp_metabox_enqueue' );
add_action( 'current_screen' , 'vp_sg_enqueue' );
add_action( 'admin_enqueue_scripts', 'vp_enqueue_scripts' );
add_action( 'current_screen' , 'vp_sg_init_buttons' );
add_filter( 'clean_url' , 'vp_ace_script_attributes', 10, 1 );
if( !function_exists('vp_ace_script_attributes') )
{
function vp_ace_script_attributes( $url )
{
if ( FALSE === strpos( $url, 'ace.js' ) )
return $url;
return "$url' charset='utf8";
}
}
if( !function_exists('vp_metabox_enqueue') )
{
function vp_metabox_enqueue()
{
if( VP_WP_Admin::is_post_or_page() and VP_Metabox::pool_can_output() )
{
$loader = VP_WP_Loader::instance();
$loader->add_main_js( 'vp-metabox' );
$loader->add_main_css( 'vp-metabox' );
}
}
}
if( !function_exists('vp_sg_enqueue') )
{
function vp_sg_enqueue()
{
if( VP_ShortcodeGenerator::pool_can_output() )
{
// enqueue dummy js
$localize = VP_ShortcodeGenerator::build_localize();
wp_register_script( 'vp-sg-dummy', VP_PUBLIC_URL . '/js/dummy.js', array(), '', false );
wp_localize_script( 'vp-sg-dummy', 'vp_sg', $localize );
wp_enqueue_script( 'vp-sg-dummy' );
$loader = VP_WP_Loader::instance();
$loader->add_main_js( 'vp-shortcode' );
$loader->add_main_css( 'vp-shortcode' );
}
}
}
add_action('admin_footer', 'vp_post_dummy_editor');
if( !function_exists('vp_post_dummy_editor') )
{
function vp_post_dummy_editor()
{
/**
* If we're in post edit page, and the post type doesn't support `editor`
* we need to echo out a dummy editor to load all necessary js and css
* to be used in our own called wp editor.
*/
$loader = VP_WP_Loader::instance();
$types = $loader->get_types();
$dummy = false;
if( VP_WP_Admin::is_post_or_page() )
{
$types = array_unique( array_merge( $types['metabox'], $types['shortcodegenerator'] ) );
if( in_array('wpeditor', $types ) )
{
if( !VP_ShortcodeGenerator::pool_supports_editor() and !VP_Metabox::pool_supports_editor() )
$dummy = true;
}
}
else
{
$types = $types['option'];
if( in_array('wpeditor', $types ) )
$dummy = true;
}
if( $dummy )
{
echo '<div style="display: none">';
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') );
wp_editor ( '', 'vp_dummy_editor' );
echo '</div>';
}
}
}
if( !function_exists('vp_sg_init_buttons') )
{
function vp_sg_init_buttons()
{
if( VP_ShortcodeGenerator::pool_can_output() )
{
VP_ShortcodeGenerator::init_buttons();
}
}
}
if( !function_exists('vp_enqueue_scripts') )
{
function vp_enqueue_scripts()
{
$loader = VP_WP_Loader::instance();
$loader->build();
}
}
/**
* Easy way to get metabox values using dot notation
* example:
*
* vp_metabox('meta_name.field_name')
* vp_metabox('meta_name.group_name')
* vp_metabox('meta_name.group_name.0.field_name')
*
*/
if( !function_exists('vp_metabox') )
{
function vp_metabox($key, $default = null, $post_id = null)
{
global $post;
$vp_metaboxes = VP_Metabox::get_pool();
if(!is_null($post_id))
{
$the_post = get_post($post_id);
if ( empty($the_post) ) $post_id = null;
}
if(is_null($post) and is_null($post_id))
return $default;
$keys = explode('.', $key);
$temp = NULL;
foreach ($keys as $idx => $key)
{
if($idx == 0)
{
if(array_key_exists($key, $vp_metaboxes))
{
$temp = $vp_metaboxes[$key];
if(!is_null($post_id))
$temp->the_meta($post_id);
else
$temp->the_meta();
}
else
{
return $default;
}
}
else
{
if(is_object($temp) and get_class($temp) === 'VP_Metabox')
{
$temp = $temp->get_the_value($key);
}
else
{
if(is_array($temp) and array_key_exists($key, $temp))
{
$temp = $temp[$key];
}
else
{
return $default;
}
}
}
}
return $temp;
}
}
/**
* Easy way to get option values using dot notation
* example:
*
* vp_option('option_key.field_name')
*
*/
if( !function_exists('vp_option') )
{
function vp_option($key, $default = null)
{
$vp_options = VP_Option::get_pool();
if(empty($vp_options))
return $default;
$keys = explode('.', $key);
$temp = NULL;
foreach ($keys as $idx => $key)
{
if($idx == 0)
{
if(array_key_exists($key, $vp_options))
{
$temp = $vp_options[$key];
$temp = $temp->get_options();
}
else
{
return $default;
}
}
else
{
if(is_array($temp) and array_key_exists($key, $temp))
{
$temp = $temp[$key];
}
else
{
return $default;
}
}
}
return $temp;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/checkbox.php
================================================
<?php
class VP_Control_Field_CheckBox extends VP_Control_FieldMulti implements VP_MultiSelectable
{
public function __construct()
{
parent::__construct();
$this->_value = array();
$this->add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/checkbox', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/checkimage.php
================================================
<?php
class VP_Control_Field_CheckImage extends VP_Control_FieldMultiImage implements VP_MultiSelectable
{
public function __construct()
{
parent::__construct();
$this->_value = array();
$this->add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/checkimage', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/codeeditor.php
================================================
<?php
class VP_Control_Field_CodeEditor extends VP_Control_Field
{
/**
* Editor's language mode
* (javascript, css, html, php, json, xml, markdown)
* @var String
*/
protected $_mode;
/**
* Editor's theme
* (chaos, chrome, clouds, clouds_midnight, cobalt, crimson_editor, dawn, dreamweaver, eclipse,
* github, mono_industrial, monokai, solarized_dark, solarized_light, textmate, twilight)
* @var String
*/
protected $_theme;
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
$instance->set_editor_mode( isset($arr['mode']) ? $arr['mode'] : '');
$instance->set_editor_theme(isset($arr['theme']) ? $arr['theme'] : 'textmate');
return $instance;
}
protected function _setup_data()
{
$opt = array(
'mode' => $this->get_editor_mode(),
'theme' => $this->get_editor_theme(),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/codeeditor', $this->get_data());
}
public function set_value($_value)
{
// normalize linebreak to \n for all saved data
if( is_string($_value) )
{
$_value = str_replace(array("\r\n", "\r"), "\n", $_value);
}
$this->_value = $_value;
return $this;
}
/**
* Get editor's language mode
*
* @return String Language mode
*/
public function get_editor_mode() {
return $this->_mode;
}
/**
* Set editor's language mode
*
* @param String $_mode Language mode
*/
public function set_editor_mode($_mode) {
$this->_mode = $_mode;
return $this;
}
/**
* Get editor's theme
*
* @return String Editor's theme
*/
public function get_editor_theme() {
return $this->_theme;
}
/**
* Set editor's theme
*
* @param String $_theme Editor's theme
*/
public function set_editor_theme($_theme) {
$this->_theme = $_theme;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/color.php
================================================
<?php
class VP_Control_Field_Color extends VP_Control_Field
{
private $_format;
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->set_format(isset($arr['format']) ? $arr['format'] : 'hex');
$instance->_basic_make($arr);
return $instance;
}
protected function _basic_make($arr)
{
parent::_basic_make($arr);
}
protected function _setup_data()
{
$opt = array(
'format' => $this->get_format(),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
$this->add_data('opt_raw', $opt);
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/color', $this->get_data());
}
/**
* Get the format value
*
* @return String
*/
public function get_format() {
return $this->_format;
}
/**
* Set the format value
*
* @param String Color format
*/
public function set_format($_format) {
$this->_format = $_format;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/date.php
================================================
<?php
class VP_Control_Field_Date extends VP_Control_Field
{
private $_min_date;
private $_max_date;
private $_format;
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
$instance->set_min_date(isset($arr['min_date']) ? $arr['min_date'] : '');
$instance->set_max_date(isset($arr['max_date']) ? $arr['max_date'] : '');
$instance->set_format(isset($arr['format']) ? $arr['format'] : 'yy-mm-dd');
return $instance;
}
protected function _setup_data()
{
$opt = array(
'minDate' => $this->get_min_date(),
'maxDate' => $this->get_max_date(),
'dateFormat' => $this->get_format(),
'value' => $this->get_value()
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
parent::_setup_data();
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/date', $this->get_data());
}
/**
* Get Minimum Date
*
* @return String Minimum Date
*/
public function get_min_date() {
return $this->_min_date;
}
/**
* Set Minimum Date
*
* @param String $_min_date Minimum Date
*/
public function set_min_date($_min_date) {
$this->_min_date = $_min_date;
return $this;
}
/**
* Get Maximum Date
*
* @return String Maximum Date
*/
public function get_max_date() {
return $this->_max_date;
}
/**
* Set Maximum Date
*
* @param String $_max_date Maximum Date
*/
public function set_max_date($_max_date) {
$this->_max_date = $_max_date;
return $this;
}
/**
* Get Date Format
*
* @return String Date format
*/
public function get_format() {
return $this->_format;
}
/**
* Set Date Format
*
* @param String $_format Date format
*/
public function set_format($_format) {
$this->_format = $_format;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/fontawesome.php
================================================
<?php
class VP_Control_Field_Fontawesome extends VP_Control_FieldMulti
{
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$arr['items']['data'][] = array(
'source' => 'function',
'value' => 'vp_get_fontawesome_icons',
);
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/fontawesome', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/html.php
================================================
<?php
class VP_Control_Field_HTML extends VP_Control_Field
{
protected $_height;
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
$instance->set_height(isset($arr['height']) ? $arr['height'] : 'auto');
return $instance;
}
protected function _setup_data()
{
$this->add_data('height', $this->get_height());
parent::_setup_data();
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/html', $this->get_data());
}
public function set_value($_value)
{
// normalize linebreak to \n for all saved data
if( is_string($_value) )
{
$_value = str_replace(array("\r\n", "\r"), "\n", $_value);
}
$this->_value = $_value;
return $this;
}
/**
* Get the Height of the Container
*
* @return String Height of the Container
*/
public function get_height() {
return $this->_height;
}
/**
* Set the Height of the Container
*
* @param String $_status Height of the Container
*/
public function set_height($_height) {
$this->_height = $_height;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/item/generic.php
================================================
<?php
/**
* Not really a class, jump simple 'struct' storing multiple choice option item.
*/
class VP_Control_Field_Item_Generic
{
public $img;
public $value;
public $label;
public function __construct(){}
public function img($img)
{
$this->img = $img;
return $this;
}
public function value($value)
{
$this->value = $value;
return $this;
}
public function label($label)
{
$this->label = $label;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/multiselect.php
================================================
<?php
class VP_Control_Field_MultiSelect extends VP_Control_FieldMulti implements VP_MultiSelectable
{
public function __construct()
{
parent::__construct();
$this->_value = array();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/multiselect', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/notebox.php
================================================
<?php
class VP_Control_Field_NoteBox extends VP_Control_Field
{
/**
* Status of message, can be one of these:
* - normal
* - info
* - warning
* - error
* - success
* @var String
*/
protected $_status;
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
protected function _basic_make($arr)
{
parent::_basic_make($arr);
$this->set_status(isset($arr['status']) ? $arr['status'] : 'normal');
}
protected function _setup_data()
{
switch ($this->get_status())
{
case 'normal':
$this->add_container_extra_classes('note-normal');
break;
case 'info':
$this->add_container_extra_classes('note-info');
break;
case 'warning':
$this->add_container_extra_classes('note-warning');
break;
case 'error':
$this->add_container_extra_classes('note-error');
break;
case 'success':
$this->add_container_extra_classes('note-success');
break;
default:
$this->add_container_extra_classes('note-normal');
break;
}
$this->add_data('status', $this->get_status());
parent::_setup_data();
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/notebox', $this->get_data());
}
/**
* Get the status of message
*
* @return String Status of message
*/
public function get_status() {
return $this->_status;
}
/**
* Set the status of message
*
* @param String $_status Status of message
*/
public function set_status($_status) {
$this->_status = $_status;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/radiobutton.php
================================================
<?php
class VP_Control_Field_RadioButton extends VP_Control_FieldMulti
{
public function __construct()
{
parent::__construct();
$this->add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/radiobutton', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/radioimage.php
================================================
<?php
class VP_Control_Field_RadioImage extends VP_Control_FieldMultiImage
{
public function __construct()
{
parent::__construct();
$this->add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/radioimage', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/select.php
================================================
<?php
class VP_Control_Field_Select extends VP_Control_FieldMulti
{
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/select', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/slider.php
================================================
<?php
class VP_Control_Field_Slider extends VP_Control_Field
{
private $_min;
private $_max;
private $_step;
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->set_min(isset($arr['min']) ? $arr['min'] : 0);
$instance->set_max(isset($arr['max']) ? $arr['max'] : 100);
$instance->set_step(isset($arr['step']) ? $arr['step'] : 1);
$instance->_basic_make($arr);
return $instance;
}
protected function _setup_data()
{
$opt = array(
'min' => $this->get_min(),
'max' => $this->get_max(),
'step' => $this->get_step(),
'value' => $this->get_value(),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
$this->add_data('opt_raw', $opt);
parent::_setup_data();
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/slider', $this->get_data());
}
protected function _basic_make($arr)
{
parent::_basic_make($arr);
$default = $this->get_default();
$default = $this->validate_value($default);
$this->set_default($default);
}
protected function validate_value($_value)
{
$out_range = (floatval($_value) < $this->get_min()) || (floatval($_value) > $this->get_max());
if (is_null($_value) || $out_range)
return $this->get_min();
else
return $_value;
}
public function set_value($_value)
{
$_value = $this->validate_value($_value);
parent::set_value($_value);
}
/**
* Get the min value
*
* @return Integer Minimum value of slider
*/
public function get_min() {
return $this->_min;
}
/**
* Set the min value
*
* @param Integer $_min Minimum value of slider
*/
public function set_min($_min) {
$this->_min = $_min;
return $this;
}
/**
* Get the max value
*
* @return Integer Maximum value of slider
*/
public function get_max() {
return $this->_max;
}
/**
* Set the max value
*
* @param Integer $_max Maximum value of slider
*/
public function set_max($_max) {
$this->_max = $_max;
return $this;
}
/**
* Get the step value
*
* @return Integer Step value of slider
*/
public function get_step() {
return $this->_step;
}
/**
* Set the step value
*
* @param Integer $_step Step value of slider
*/
public function set_step($_step) {
$this->_step = $_step;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/sorter.php
================================================
<?php
class VP_Control_Field_Sorter extends VP_Control_FieldMulti implements VP_MultiSelectable
{
private $_max_selection;
public function __construct()
{
parent::__construct();
$this->_value = array();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->set_max_selection(isset($arr['max_selection']) ? $arr['max_selection'] : false);
$instance->_basic_make($arr);
return $instance;
}
protected function _setup_data()
{
$opt = array(
'maximumSelectionSize' => $this->get_max_selection(),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
$this->add_data('opt_raw', $opt);
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/sorter', $this->get_data());
}
public function get_max_selection() {
return $this->_max_selection;
}
public function set_max_selection($_max_selection) {
$this->_max_selection = $_max_selection;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/textarea.php
================================================
<?php
class VP_Control_Field_TextArea extends VP_Control_Field
{
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/textarea', $this->get_data());
}
public function set_value($_value)
{
$this->_value = $_value;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/textbox.php
================================================
<?php
class VP_Control_Field_TextBox extends VP_Control_Field
{
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
// Setup Data
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/textbox', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/toggle.php
================================================
<?php
class VP_Control_Field_Toggle extends VP_Control_Field
{
public function __construct()
{
parent::__construct();
$this->add_container_extra_classes('vp-checked-field');
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/toggle', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/upload.php
================================================
<?php
class VP_Control_Field_Upload extends VP_Control_Field
{
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function _setup_data()
{
$preview = VP_Util_Res::get_preview_from_url($this->get_value());
$this->add_data('preview', $preview);
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/upload', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field/wpeditor.php
================================================
<?php
class VP_Control_Field_WPEditor extends VP_Control_Field
{
private $_use_external_plugins = true;
private $_disabled_externals_plugins = array();
private $_disabled_internals_plugins = array();
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$use_external_plugins = isset($arr['use_external_plugins']) ? $arr['use_external_plugins'] : 1;
$disabled_externals_plugins = array();
$disabled_internals_plugins = array();
if(isset($arr['disabled_externals_plugins']))
{
$disabled_externals_plugins = explode(',', $arr['disabled_externals_plugins']);
}
if(isset($arr['disabled_internals_plugins']))
{
$disabled_internals_plugins = explode(',', $arr['disabled_internals_plugins']);
}
$instance->use_external_plugins($use_external_plugins);
$instance->set_disabled_externals_plugins($disabled_externals_plugins);
$instance->set_disabled_internals_plugins($disabled_internals_plugins);
$instance->_basic_make($arr);
return $instance;
}
protected function _setup_data()
{
$opt = array(
'use_external_plugins' => $this->use_external_plugins(),
'disabled_externals_plugins' => implode(',', $this->get_disabled_externals_plugins()),
'disabled_internals_plugins' => implode(',', $this->get_disabled_internals_plugins()),
);
$this->add_data('opt', VP_Util_Text::make_opt($opt));
$this->add_data('opt_raw', $opt);
parent::_setup_data();
}
public function render($is_compact = false)
{
$this->_setup_data();
$this->add_data('is_compact', $is_compact);
return VP_View::instance()->load('control/wpeditor', $this->get_data());
}
public function set_value($_value)
{
$this->_value = $_value;
return $this;
}
public function use_external_plugins($use = null)
{
if(!is_null($use))
{
$this->_use_external_plugins = $use;
}
return $this->_use_external_plugins;
}
/**
* Get disable external plugins
*
* @return Array
*/
public function get_disabled_externals_plugins()
{
return $this->_disabled_externals_plugins;
}
/**
* Set disabled external plugins
*
* @param Array $_disabled_externals_plugins
*/
public function set_disabled_externals_plugins($_disabled_externals_plugins)
{
$this->_disabled_externals_plugins = $_disabled_externals_plugins;
return $this;
}
/**
* Get disabled internal plugins
*
* @return Array
*/
public function get_disabled_internals_plugins() {
return $this->_disabled_internals_plugins;
}
/**
* Set disabled internal plugins
*
* @param Array $_disabled_internals_plugins
*/
public function set_disabled_internals_plugins($_disabled_internals_plugins) {
$this->_disabled_internals_plugins = $_disabled_internals_plugins;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/field.php
================================================
<?php
/**
* The smallest unit of an option, the field it self.
*/
abstract class VP_Control_Field implements iFactory
{
/**
* Unique name of the field
* @var String
*/
protected $_name;
/**
* Label for the field
* @var String
*/
protected $_label;
/**
* Description on what the field about
* @var String
*/
protected $_description;
/**
* Validation pattern string
* @var String
*/
protected $_validation;
/**
* dependency pattern string
* @var String
*/
protected $_dependency;
/**
* binding patter string
* @var String
*/
protected $_binding;
/**
* Default value for the field
* @var String|Array
*/
protected $_default;
/**
* Maximum height of the field
* @var Integer
*/
protected $_field_max_height;
/**
* Value for the field
* @var String|Array
*/
protected $_value;
/**
* Data to be rendered
* @var Array
*/
protected $_data;
/**
* Extra Classes for the container
* @var Array
*/
protected $_container_extra_classes;
/**
* Whether to hide this control in first rendering
*/
protected $_is_hidden;
/**
* Class Constructor
*/
public function __construct()
{
$this->_data = array();
$this->_container_extra_classes = array();
}
abstract public function render();
/**
* Setup and return needed attribute as array
* @return Array Data array
*/
protected function _setup_data()
{
// Set Basic Data
$this->add_data('name', $this->get_name());
$this->add_data('default', $this->get_default());
$this->add_data('value', $this->get_value());
// Determine Type
$type = 'vp-' . strtolower(substr(get_class($this), strrpos(get_class($this), '_') + 1));
// Is hidden
if($this->is_hidden())
{
$this->add_container_extra_classes('vp-hide');
}
// Set Control Head Data
$this->add_data('head_info', array(
'name' => $this->get_name(),
'type' => $type,
'container_extra_classes' => implode(' ', $this->get_container_extra_classes()),
'is_hidden' => $this->is_hidden(),
'validation' => $this->get_validation(),
'dependency' => $this->get_dependency(),
'binding' => $this->get_binding(),
'label' => $this->get_label(),
'description' => VP_Util_Text::parse_md($this->get_description())
));
}
/**
* Basic self setup of the object
* @param Array $arr Array representation of the field
* @return VP_Control_Field Field object
*/
protected function _basic_make($arr)
{
$this->set_name(isset($arr['name']) ? $arr['name'] : '')
->set_label(isset($arr['label']) ? $arr['label'] : '')
->set_default(isset($arr['default']) ? $arr['default'] : null)
->set_description(isset($arr['description']) ? $arr['description'] : '')
->set_validation(isset($arr['validation']) ? $arr['validation'] : '');
if(isset($arr['dependency']))
{
$func = $arr['dependency']['function'];
$field = $arr['dependency']['field'];
$this->set_dependency($func . '|' . $field);
}
if(isset($arr['binding']))
{
$function = $arr['binding']['function'];
$field = $arr['binding']['field'];
$this->set_binding($function . '|' . $field);
}
return $this;
}
/**
* Add value to render data array
* @param Mixed $item Value to be added to render data arary
*/
public function add_data($key, $value)
{
$this->_data[$key] = $value;
}
/**
* Get render data
*
* @return Array Render data array
*/
public function get_data() {
return $this->_data;
}
/**
* Set render data
*
* @param Array $_data Render data array
*/
public function set_data($_data) {
$this->_data = $_data;
return $this;
}
/**
* Set single render data
*
* @param Array $_data Render data array
*/
public function set_single_data($key, $_data) {
$this->_data[$key] = $_data;
return $this;
}
/**
* Get single render data
*
* @param Array $_data Render data array
*/
public function get_single_data($key) {
return $this->_data[$key];
}
/**
* Add value to render data array
* @param Mixed $item Value to be added to render data arary
*/
public function add_single_data($p_key, $key, $value)
{
$this->_data[$p_key][$key] = $value;
}
/**
* Getter for $_name
*
* @return String unique name of the field
*/
public function get_name() {
return $this->_name;
}
/**
* Setter for $_name
*
* @param String $_name unique name of the field
*/
public function set_name($_name) {
$this->_name = $_name;
return $this;
}
/**
* Getter for $_label
*
* @return String label of the field
*/
public function get_label() {
return $this->_label;
}
/**
* Setter for $_label
*
* @param String $_label label of the field
*/
public function set_label($_label) {
$this->_label = $_label;
return $this;
}
/**
* Getter for $_description
*
* @return String description of the field
*/
public function get_description() {
return $this->_description;
}
/**
* Setter for $_description
*
* @param String $_description description of the field
*/
public function set_description($_description) {
$this->_description = $_description;
return $this;
}
/**
* Getter for $_validation
*
* @return String validation pattern in string
*/
public function get_validation() {
return $this->_validation;
}
/**
* Setter for $_validation
*
* @param String $_validation validation pattern in string
*/
public function set_validation($_validation) {
$this->_validation = $_validation;
return $this;
}
/**
* Getter for $_dependency
*
* @return String dependency pattern in string
*/
public function get_dependency() {
return $this->_dependency;
}
/**
* Setter for $_dependency
*
* @param String $_dependency dependency pattern in string
*/
public function set_dependency($_dependency) {
$this->_dependency = $_dependency;
return $this;
}
/**
* Get $_binding
*
* @return String bind rule string
*/
public function get_binding() {
return $this->_binding;
}
/**
* Set $_binding
*
* @param String $_binding bind rule string
*/
public function set_binding($_binding) {
$this->_binding = $_binding;
return $this;
}
/**
* Getter for $_default
*
* @return mixed default value of the field
*/
public function get_default() {
return $this->_default;
}
/**
* Setter for $_default
*
* @param mixed $_default default value of the field
*/
public function set_default($_default) {
$this->_default = $_default;
return $this;
}
/**
* Get field value
*
* @return String|Array Value of field
*/
public function get_value() {
return $this->_value;
}
/**
* Set field value
*
* @param String|Array $_value Value of field
*/
public function set_value($_value) {
$this->_value = $_value;
return $this;
}
/**
* Getter of $_field_max_height
*
* @return Integer Max height of the field
*/
public function get_field_max_height() {
return $this->_field_max_height;
}
/**
* Setter of $_field_max_height
*
* @param Integer $_field_max_height Max height of the field
*/
public function set_field_max_height($_field_max_height) {
$this->_field_max_height = $_field_max_height;
return $this;
}
/**
* Getter of $_container_extra_classes
*
* @return Array of Extra Classes for the container
*/
public function get_container_extra_classes() {
return $this->_container_extra_classes;
}
/**
* Setter of $_container_extra_classes
*
* @param Array $_container_extra_classes Extra Classes for the container
*/
public function set_container_extra_classes($_container_extra_classes) {
$this->_container_extra_classes = $_container_extra_classes;
return $this;
}
public function add_container_extra_classes($class)
{
if(is_array($class))
{
$this->_container_extra_classes = array_merge($this->_container_extra_classes, $class);
}
else if(!in_array($class, $this->_container_extra_classes))
{
$this->_container_extra_classes[] = $class;
}
return $this->_container_extra_classes;
}
/**
* Get is_hidden status, will set the status if a boolean passed
*
* @return bool is_hidden status
*/
public function is_hidden($_is_hidden = null) {
if(!is_null($_is_hidden))
$this->_is_hidden = (bool) $_is_hidden;
return $this->_is_hidden;
}
}
/**
* Interface to force implementation of the 'factory' pattern method for each field class
* to enable easier instantiation of each field class.
*/
interface iFactory
{
static function withArray($arr = array(), $class_name = null);
}
/**
* EOF
*/
================================================
FILE: classes/control/fieldmulti.php
================================================
<?php
/**
* The smallest unit of an item, the field it self.
*/
abstract class VP_Control_FieldMulti extends VP_Control_Field
{
protected $_items = array();
protected $_items_binding;
protected $_raw_default;
/**
* Basic self setup of the object
* @param SimpleXMLElement $simpleXML SimpleXML object representation of the field
* @return VP_Control_FieldMulti Field object
*/
protected function _basic_make($arr)
{
parent::_basic_make($arr);
if (!empty($arr['items']))
{
if(isset($arr['items']['data']) and is_array($arr['items']['data']))
{
foreach ($arr['items']['data'] as $data)
{
if($data['source'] == 'function')
{
$function = $data['value'];
$params = explode(',', !empty($data['params']) ? $data['params'] : '');
$items = call_user_func_array($function, $params);
$arr['items'] = array_merge($arr['items'], $items);
}
else if($data['source'] == 'binding')
{
$function = $data['value'];
$field = $data['field'];
$this->set_items_binding($function . '|' . $field);
}
}
unset($arr['items']['data']);
}
if(is_array($arr['items'])) foreach ($arr['items'] as $item)
{
$the_item = new VP_Control_Field_Item_Generic();
$the_item->value($item['value'])
->label($item['label']);
if( isset( $item['img'] ) )
$the_item->img($item['img']);
$this->add_item($the_item);
}
}
if (isset($arr['default']))
{
$arr['default'] = (array) $arr['default'];
if(!VP_Util_Reflection::is_multiselectable($this))
{
$arr['default'] = (array) reset($arr['default']);
}
$this->_raw_default = $arr['default'];
$this->_process_default();
}
return $this;
}
public function _process_default()
{
$defaults = array();
$items = $this->get_items();
foreach ($this->_raw_default as $def)
{
switch ($def)
{
case '{{all}}':
if(VP_Util_Reflection::is_multiselectable($this))
$defaults = array_merge($defaults, array_keys($items));
break;
case '{{first}}':
$first = VP_Util_Array::first($items);
if(!is_null($first))
$defaults[] = $first->value;
break;
case '{{last}}':
$last = end($items);
if(!is_null($last))
$defaults[] = $last->value;
break;
default:
$defaults[] = $def;
break;
}
}
$defaults = array_unique($defaults);
if(!empty($defaults))
$this->set_default($defaults);
}
protected function _setup_data()
{
parent::_setup_data();
$this->add_single_data('head_info', 'items_binding', $this->get_items_binding());
$this->add_data('items', $this->get_items());
}
/**
* Setter for $_default
*
* @param mixed $_default default value of the field
*/
public function set_default($_default) {
if(is_array($_default) and !VP_Util_Reflection::is_multiselectable($this))
$_default = VP_Util_Array::first($_default);
$this->_default = $_default;
return $this;
}
public function add_items($items)
{
$this->_items = array_merge($this->_items, $items);
}
/**
* Add single item
* @param VP_Control_Field_Item_ $opt Single item item
*/
public function add_item($opt)
{
$this->_items[$opt->value] = $opt;
}
/**
* Getter for $_items
*
* @return Array array of items {value, label}
*/
public function get_items() {
return $this->_items;
}
/**
* Setter for $_items
*
* @param Array $_items array of items
*/
public function set_items($_items) {
$this->_items = $_items;
return $this;
}
public function add_items_from_array($_items) {
if(is_array($_items))
{
foreach ($_items as $item)
{
$the_item = new VP_Control_Field_Item_Generic();
$the_item->value($item['value'])
->label($item['label']);
$this->add_item($the_item);
}
}
}
/**
* Get $_items_binding
*
* @return String bind rule string
*/
public function get_items_binding() {
return $this->_items_binding;
}
/**
* Set $_items_binding
*
* @param String $_items_binding bind rule string
*/
public function set_items_binding($_items_binding) {
$this->_items_binding = $_items_binding;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/control/fieldmultiimage.php
================================================
<?php
/**
* The smallest unit of an item, the field it self.
*/
abstract class VP_Control_FieldMultiImage extends VP_Control_FieldMulti
{
protected $_item_max_height;
protected $_item_max_width;
/**
* Basic self setup of the object
* @param SimpleXMLElement $simpleXML SimpleXML object representation of the field
* @return VP_Control_FieldMultiImage Field object
*/
protected function _basic_make($arr)
{
parent::_basic_make($arr);
$this->set_item_max_height(isset($arr['item_max_height']) ? $arr['item_max_height'] : '')
->set_item_max_width(isset($arr['item_max_width']) ? $arr['item_max_width'] : '');
return $this;
}
protected function _setup_data()
{
parent::_setup_data();
$this->add_data('item_max_height', $this->get_item_max_height());
$this->add_data('item_max_width', $this->get_item_max_width());
}
public function add_items_from_array($_items){
foreach ($_items as $item)
{
$the_item = new VP_Control_Field_Item_Generic();
$the_item->value($item['value'])
->label($item['label'])
->img($item['img']);
$this->add_item($the_item);
}
}
/**
* Get item max height
*
* @return Integer Item Max Height
*/
public function get_item_max_height() {
return $this->_item_max_height;
}
/**
* Set item max height
*
* @param Integer $_item_max_height Item Max Height
*/
public function set_item_max_height($_item_max_height) {
$this->_item_max_height = $_item_max_height;
return $this;
}
/**
* Get item max width
*
* @return Integer Item Max Width
*/
public function get_item_max_width() {
return $this->_item_max_width;
}
/**
* Set item max width
*
* @param Integer $_item_max_width Item Max Width
*/
public function set_item_max_width($_item_max_width) {
$this->_item_max_width = $_item_max_width;
return $this;
}
}
/**
* EOF
*/
================================================
FILE: classes/filesystem.php
================================================
<?php
class VP_FileSystem
{
private static $_instance = null;
private $_lookup_dirs = array();
public static function instance()
{
if(is_null(self::$_instance))
{
self::$_instance = new self();
}
return self::$_instance;
}
public function get_first_non_empty_dir($key, $name = null)
{
if(!isset($this->_lookup_dirs[$key]))
return false;
foreach ($this->_lookup_dirs[$key] as $dir)
{
if (is_link($dir))
{
$dir = readlink($dir);
}
if(!is_null($name))
{
$dir = $dir . DIRECTORY_SEPARATOR . $name;
}
if($this->dir_contains_children($dir, 'php'))
{
return $dir;
}
}
}
public function resolve_path($key, $name, $ext = 'php')
{
if(!isset($this->_lookup_dirs[$key]))
return false;
$name = $this->normalize_path($name, $ext);
foreach ($this->_lookup_dirs[$key] as $dir)
{
$file = $dir . DIRECTORY_SEPARATOR . $name;
if (is_link($file))
{
$file = readlink($file);
}
if(file_exists($file))
{
return $file;
}
}
return false;
}
public function normalize_path($path, $ext)
{
$path = trim($path, '\\/');
return $path . '.' . $ext;
}
function dir_contains_children($dir, $ext = null)
{
$result = false;
if (is_link($dir))
{
$dir = readlink($dir);
}
if($dh = opendir($dir))
{
while(!$result && ($file = readdir($dh)) !== false)
{
$result = $file !== "." && $file !== "..";
if(!is_null($ext))
{
$result = pathinfo($file, PATHINFO_EXTENSION) === $ext;
}
}
closedir($dh);
}
return $result;
}
/**
* Add directories to the autoloader, loading process will be run in orderly fashion
* of directory addition.
*
* @param String|Array $directories
* @return void
*/
public function add_directories($key, $directories)
{
if(!isset($this->_lookup_dirs[$key]))
{
$this->_lookup_dirs[$key] = array();
}
$this->_lookup_dirs[$key] = array_merge($this->_lookup_dirs[$key], (array) $directories);
$this->_lookup_dirs[$key] = array_unique($this->_lookup_dirs[$key]);
}
/**
* Remove directories.
*
* @param String|Array $directories
* @return void
*/
public function remove_directories($key, $directories = null)
{
// annihilate everything if none / null passed
if(is_null($directories))
{
$this->_lookup_dirs[$key] = array();
}
else
{
// prepare directories to be filtered
$directories = (array) $directories;
// do the filtering
foreach ($this->_lookup_dirs[$key] as $name => $dir)
{
if(in_array($dir, $directories))
{
unset($this->_lookup_dirs[$key][$name]);
}
}
}
}
/**
* Get all directories
*
* @return Array
*/
public function get_directories($key = null)
{
if(!is_null($key))
return $this->_lookup_dirs[$key];
return $this->_lookup_dirs;
}
}
================================================
FILE: classes/metabox/alchemy.php
================================================
<?php
/**
* Extended version of WPAlchemy Class
* so that it can process metabox using an array specification
* and compatible with all Vafpress Framework Option Controls.
*/
/////////////////////////////////////////
// Include original WPAlchemy Class //
/////////////////////////////////////////
if(!class_exists('WPAlchemy_MetaBox'))
{
require_once VP_FileSystem::instance()->resolve_path('includes', 'wpalchemy/MetaBox');
}
class VP_MetaBox_Alchemy extends WPAlchemy_MetaBox
{
/**
* Used to setup the meta box content template
*
* @since 1.0
* @access private
* @see _init()
*/
function _setup()
{
$this->in_template = TRUE;
// also make current post data available
global $post;
// shortcuts
$mb =& $this;
$metabox =& $this;
$id = $this->id;
$meta = $this->_meta(NULL, TRUE);
// use include because users may want to use one template for multiple meta boxes
if( !is_array($this->template) and file_exists($this->template) )
{
include $this->template;
}
else
{
$fields = $this->_enfactor($this->template);
$this->_enbind($fields);
$fields = $this->_endep($fields);
echo '<div class="vp-metabox">';
$this->_enview($fields);
echo '</div>';
}
// create a nonce for verification
echo '<input type="hidden" name="'. $this->id .'_nonce" value="' . wp_create_nonce($this->id) . '" />';
$this->in_template = FALSE;
}
// return all field types
function get_field_types()
{
$types = array();
if(!function_exists('inner_build'))
{
function inner_build($fields, &$types)
{
$rules = VP_Util_Config::instance()->load('dependencies', 'rules');
foreach ($fields as $field)
{
if($field['type'] == 'group')
{
inner_build($field['fields'], $types);
}
else
{
if( ! in_array($field['type'], $types) )
$types[] = $field['type'];
}
}
}
}
inner_build($this->template, $types);
return $types;
}
function _enfactor($arr)
{
$mb =& $this;
$fields = $arr;
$field_objects = array();
foreach ($fields as $field)
{
if($field['type'] == 'group' and $field['repeating'])
{
$field_objects[$field['name']] = $this->_enfactor_group($field, $mb, true);
}
else if($field['type'] == 'group' and !$field['repeating'])
{
$field_objects[$field['name']] = $this->_enfactor_group($field, $mb, false);
}
else
{
$field_objects[$field['name']] = $this->_enfactor_field($field, $mb);
}
}
return $field_objects;
}
function _enbind($fields)
{
foreach ($fields as $name => $field)
{
if(is_array($field))
{
foreach ($field['groups'] as $group)
{
$this->_enbind($group['childs']);
}
}
else
{
$bind = $field->get_binding();
$val = $field->get_value();
if(!empty($bind) and is_null($val))
{
$bind = explode('|', $bind);
$func = $bind[0];
$params = $bind[1];
$params = preg_split('/[\s,]+/', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$result = call_user_func_array($func, $values);
if(VP_Util_Reflection::is_multiselectable($field))
{
$result = (array) $result;
}
else
{
if(is_array($result))
{
$result = reset($result);
}
$result = (String) $result;
}
$field->set_value($result);
}
if($field instanceof VP_Control_FieldMulti)
{
$bind = $field->get_items_binding();
if(!empty($bind))
{
$bind = explode('|', $bind);
$func = $bind[0];
$params = $bind[1];
$params = explode(',', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$items = call_user_func_array($func, $values);
$field->add_items_from_array($items);
}
}
}
}
}
function _endep($fields)
{
if(!function_exists('loop_fields'))
{
function loop_fields(&$fields)
{
foreach ($fields as &$field)
{
if(is_array($field))
{
foreach ($field['groups'] as &$group)
{
loop_fields($group['childs']);
}
}
$dependency = '';
if($field instanceof VP_Control_Field)
{
$dependency = $field->get_dependency();
if(!empty($dependency))
{
$dependency = explode('|', $dependency);
$func = $dependency[0];
$params = $dependency[1];
}
}
else
{
if(isset($field['dependency']))
{
if(!empty($field['dependency']))
{
$dependency = $field['dependency'];
$func = $dependency['function'];
$params = $dependency['field'];
}
}
}
if(!empty($dependency))
{
$params = explode(',', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$result = call_user_func_array($func, $values);
if(!$result)
{
if($field instanceof VP_Control_Field)
{
$field->is_hidden(true);
if($field->is_hidden())
$field->add_container_extra_classes('vp-hide');
$field->add_container_extra_classes('vp-dep-inactive');
}
else
{
$field['is_hidden'] = true;
if($field['is_hidden'])
$field['container_extra_classes'][] = 'vp-hide';
$field['container_extra_classes'][] = 'vp-dep-inactive';
}
}
}
}
}
}
loop_fields($fields);
return $fields;
}
function _enfactor_field($field, $mb, $in_group = false)
{
$is_multi = VP_Util_Reflection::is_multiselectable($field['type']);
if( !$is_multi )
{
$mb->the_field($field['name']);
}
else
{
$mb->the_field($field['name'], WPALCHEMY_FIELD_HINT_CHECKBOX_MULTI);
}
$field['name'] = $mb->get_the_name();
// create the object
$make = VP_Util_Reflection::field_class_from_type($field['type']);
$vp_field = call_user_func("$make::withArray", $field);
// get value from mb
$value = $mb->get_the_value();
// get default from array
$default = $vp_field->get_default();
// if tocopy always assign default
if( $mb->is_parent_multi() and $mb->is_in_multi_last() )
{
$value = $default;
}
else
{
// if value is null and default exist, use default
if( is_null($value) and !is_null($default) and empty($this->meta) )
{
$value = $default;
}
// if not then set up value from mb
else
{
if( VP_Util_Reflection::is_multiselectable($field['type']) )
{
if( !is_array($value) )
$value = array( $value );
}
}
}
$vp_field->set_value($value);
if (!$in_group)
{
$vp_field->add_container_extra_classes(array('vp-meta-single'));
}
return $vp_field;
}
function _enfactor_group($field, $mb, $repeating)
{
$ignore = array('type', 'length', 'fields');
$groups = array();
$indexed_name = '';
$level = null;
if($repeating)
{
while($mb->have_fields_and_multi($field['name']))
{
if ($indexed_name === '') $indexed_name = $mb->get_the_loop_group_id();
if (is_null($level)) $level = $mb->get_the_loop_level();
$fields = array();
foreach ($field['fields'] as $f)
{
if($f['type'] === 'group')
$fields[$f['name']] = $this->_enfactor_group($f, $mb, $f['repeating']);
else
$fields[$f['name']] = $this->_enfactor_field($f, $mb, true);
}
$groups[] = array(
'name' => $mb->get_the_loop_group_name(true),
'childs' => $fields
);
}
}
else
{
$length = isset($field['length']) ? $field['length'] : 1;
while($mb->have_fields($field['name'], $length))
{
if ($indexed_name === '') $indexed_name = $mb->get_the_loop_group_id();
if (is_null($level)) $level = $mb->get_the_loop_level();
$fields = array();
foreach ($field['fields'] as $f)
{
if($f['type'] === 'group')
$fields[$f['name']] = $this->_enfactor_group($f, $mb, $f['repeating']);
else
$fields[$f['name']] = $this->_enfactor_field($f, $mb, true);
}
$groups[] = array(
'name' => $mb->get_the_loop_group_name(true),
'childs' => $fields
);
}
}
// assign groups
$group['groups'] = $groups;
$group['indexed_name'] = $indexed_name;
$group['level'] = $level;
// assign other information
$keys = array_keys($field);
foreach ($keys as $key)
{
if(!in_array($key, $ignore))
{
$group[$key] = $field[$key];
}
}
// sortable
if(isset($group['sortable']) and $group['sortable'])
$group['container_extra_classes'][] = 'vp-sortable';
return $group;
}
function _enview($fields)
{
foreach ($fields as $name => $field)
{
if( is_array($field) and $field['repeating'] )
{
echo $this->_render_repeating_group($field);
}
else if( is_array($field) and !$field['repeating'] )
{
echo $this->_render_group($field);
}
else
{
echo $this->_render_field($field);
}
}
}
function _render_field($field)
{
return $field->render();
}
function _render_group($group)
{
$name = $group['name'];
$uid = $group['indexed_name'];
$oddity = ($group['level'] % 2 === 0) ? 'even' : 'odd';
$dependency = isset($group['dependency']) ? $group['dependency']['function'] . '|' . $group['dependency']['field'] : '';
$html = '';
$html .= '<div id="wpa_loop-' . $uid
. '" class="vp-wpa-loop level-' . $oddity . ' wpa_loop wpa_loop-' . $name . ' vp-fixed-loop vp-meta-group'
. (isset($group['container_extra_classes']) ? (' ' . implode(' ', $group['container_extra_classes'])) : '')
. '"'
. VP_Util_Text::return_if_exists(isset($dependency) ? $dependency : '', 'data-vp-dependency="%s"')
. '>';
$icon = '';
if(isset($group['sortable']) and $group['sortable'])
$icon = '<i class="fa fa-move"></i> ';
foreach ($group['groups'] as $g)
{
$is_first = false;
if ($g === reset($group['groups'])){ $is_first = true;}
$html .= '<div id="'. $g['name'] .'" class="vp-wpa-group wpa_group wpa_group-' . $name . '">';
$html .= '<div class="vp-wpa-group-heading"><a href="#" class="vp-wpa-group-title">' . $icon . $group['title'] . '</a></div>';
$html .= '<div class="vp-controls' . ((!$is_first) ? ' vp-hide' : '') . '">';
foreach ($g['childs'] as $f)
{
if( is_array($f) and $f['repeating'] )
$html .= $this->_render_repeating_group($f);
else if( is_array($f) and !$f['repeating'] )
$html .= $this->_render_group($f);
else
$html .= $this->_render_field($f);
}
$html .= '</div>';
$html .= '</div>';
}
$html .= '</div>';
return $html;
}
function _render_repeating_group($group)
{
$name = $group['name'];
$uid = $group['indexed_name'];
$oddity = ($group['level'] % 2 === 0) ? 'even' : 'odd';
$dependency = isset($group['dependency']) ? $group['dependency']['function'] . '|' . $group['dependency']['field'] : '';
$html = '';
$html .= '<div id="wpa_loop-' . $uid
. '" class="vp-wpa-loop level-' . $oddity . ' wpa_loop wpa_loop-' . $name . ' vp-repeating-loop vp-meta-group'
. (isset($group['container_extra_classes']) ? (' ' . implode(' ', $group['container_extra_classes'])) : '')
. '"'
. VP_Util_Text::return_if_exists(isset($dependency) ? $dependency : '', 'data-vp-dependency="%s"')
. '>';
$icon = '';
if(isset($group['sortable']) and $group['sortable'])
$icon = '<i class="fa fa-move"></i> ';
foreach ($group['groups'] as $g)
{
$class = '';
$is_first = false;
$is_last = false;
if ($g === end($group['groups'])){ $is_last = true; $class = ' last tocopy';}
if ($g === reset($group['groups'])){ $is_first = true; $class = ' first';}
$html .= '<div id="'. $g['name'] .'" class="vp-wpa-group wpa_group wpa_group-' . $name . $class . '">';
$html .= '<div class="vp-wpa-group-heading"><a href="#" class="vp-wpa-group-title">' . $icon . $group['title'] . '</a><a href="#" class="dodelete vp-wpa-group-remove" title="'. __('Remove', 'vp_textdomain') .'"><i class="fa fa-times"></i> '. __('Remove', 'vp_textdomain') .'</a></div>';
$html .= '<div class="vp-controls' . ((!$is_first) ? ' vp-hide' : '') . '">';
if ($g === end($group['groups']))
{
$tocopy = $g['name'] . '[tocopy]';
$html .= '<input type="hidden" class="tocopy-hidden" name="' . $tocopy . '" value="1">';
}
foreach ($g['childs'] as $f)
{
if( is_array($f) and $f['repeating'] )
$html .= $this->_render_repeating_group($f);
else if( is_array($f) and !$f['repeating'] )
$html .= $this->_render_group($f);
else
$html .= $this->_render_field($f);
}
$html .= '</div>';
$html .= '</div>';
}
$html .= '<div class="vp-wpa-group-add">';
$html .= '<a href="#" class="button button-large docopy-' . $name . '">'. __('Add More', 'vp_textdomain') . '' . $group['title'] . '</a>';
$html .= '</div>';
$html .= '</div>';
return $html;
}
function _save($post_id)
{
// skip saving if dev mode is on
$dev_mode = VP_Util_Config::instance()->load('metabox', 'dev_mode');
if($dev_mode)
return;
$real_post_id = isset($_POST['post_ID']) ? $_POST['post_ID'] : NULL ;
// check autosave
if (defined('DOING_AUTOSAVE') AND DOING_AUTOSAVE AND !$this->autosave) return $post_id;
// make sure data came from our meta box, verify nonce
$nonce = isset($_POST[$this->id.'_nonce']) ? $_POST[$this->id.'_nonce'] : NULL ;
if (!wp_verify_nonce($nonce, $this->id)) return $post_id;
// check user permissions
if ($_POST['post_type'] == 'page')
{
if (!current_user_can('edit_page', $post_id)) return $post_id;
}
else
{
if (!current_user_can('edit_post', $post_id)) return $post_id;
}
// authentication passed, save data
$new_data = isset( $_POST[$this->id] ) ? $_POST[$this->id] : NULL ;
// clean to copy and reset array indexes
$this->_clean_tocopy($new_data);
if (empty($new_data))
{
$new_data = NULL;
}
// filter: save
if ($this->has_filter('save'))
{
$new_data = $this->apply_filters('save', $new_data, $real_post_id);
/**
* halt saving
* @since 1.3.4
*/
if (FALSE === $new_data) return $post_id;
$this->_clean_tocopy($new_data);
}
// get current fields, use $real_post_id (checked for in both modes)
$current_fields = get_post_meta($real_post_id, $this->id . '_fields', TRUE);
if ($this->mode == WPALCHEMY_MODE_EXTRACT)
{
$new_fields = array();
if (is_array($new_data))
{
foreach ($new_data as $k => $v)
{
$field = $this->prefix . $k;
array_push($new_fields,$field);
$new_value = $new_data[$k];
if (is_null($new_value))
{
delete_post_meta($post_id, $field);
}
else
{
update_post_meta($post_id, $field, $new_value);
}
}
}
$diff_fields = array_diff((array)$current_fields,$new_fields);
if (is_array($diff_fields))
{
foreach ($diff_fields as $field)
{
delete_post_meta($post_id,$field);
}
}
delete_post_meta($post_id, $this->id . '_fields');
if ( ! empty($new_fields))
{
add_post_meta($post_id,$this->id . '_fields', $new_fields, TRUE);
}
// keep data tidy, delete values if previously using WPALCHEMY_MODE_ARRAY
delete_post_meta($post_id, $this->id);
}
else
{
if (is_null($new_data))
{
delete_post_meta($post_id, $this->id);
}
else
{
update_post_meta($post_id, $this->id, $new_data);
}
// keep data tidy, delete values if previously using WPALCHEMY_MODE_EXTRACT
if (is_array($current_fields))
{
foreach ($current_fields as $field)
{
delete_post_meta($post_id, $field);
}
delete_post_meta($post_id, $this->id . '_fields');
}
}
// action: save
if ($this->has_action('save'))
{
$this->do_action('save', $new_data, $real_post_id);
}
return $post_id;
}
private function _clean_tocopy(&$arr)
{
if(is_array($arr))
{
foreach ($arr as $key => $value)
{
if(is_array($value))
{
$this->_clean_tocopy($arr[$key]);
if(array_key_exists('tocopy', $value))
{
unset($arr[$key]);
}
}
}
if (!count($arr))
{
$arr = array();
}
else
{
$keys = array_keys($arr);
$is_numeric = TRUE;
foreach ($keys as $key)
{
if (!is_numeric($key))
{
$is_numeric = FALSE;
break;
}
}
if ($is_numeric)
{
$arr = array_values($arr);
}
}
}
}
}
/**
* EOF
*/
================================================
FILE: classes/metabox/depsloader.php
================================================
<?php
class VP_Metabox_Depsloader
{
/**
* ARRAY OF VP_METABOX_ALCHEMY OBJECT
* @var [type]
*/
private $things;
public function __construct($things)
{
$this->things = array($things);
}
public function build()
{
$vp_metabox_used = false;
$metaboxes = $this->things;
$result = array(
'scripts' => array(),
'styles' => array(),
'localize_name' => 'vp_mb',
'localize_default' => array(),
'localize' => array(),
'use_upload' => false,
'use_new_media_upload' => false,
'main_js' => array(
'name' => 'vp-metabox',
'path' => VP_PUBLIC_URL . '/js/metabox.min.js'
),
'main_css' => array(
'name' => 'vp-metabox',
'path' => VP_PUBLIC_URL . '/css/metabox.min.css'
),
);
$script_always = VP_Util_Config::instance()->load('dependencies', 'scripts.always');
$style_always = VP_Util_Config::instance()->load('dependencies', 'styles.always');
$messages = VP_Util_Config::instance()->load('messages');
$result['localize']['val_msg'] = $messages['validation'];
if(is_array($metaboxes)) reset($metaboxes);
if(is_array($metaboxes)) foreach ($metaboxes as $key => $metabox)
{
if($metabox->can_output())
{
if(!function_exists('inner_build'))
{
function inner_build($fields, &$result)
{
$rules = VP_Util_Config::instance()->load('dependencies', 'rules');
foreach ($fields as $field)
{
if($field['type'] == 'group')
{
inner_build($field['fields'], $result);
}
else
{
if( array_key_exists($field['type'], $rules) )
{
$result['scripts'] = array_merge($result['scripts'], $rules[$field['type']]['js']);
$result['styles'] = array_merge($result['styles'], $rules[$field['type']]['css']);
}
if( $field['type'] == 'upload' )
{
$result['use_upload'] = true;
}
}
}
}
}
inner_build($metabox->template, $result);
// at least one metabox used, then let's load
$vp_metabox_used = true;
}
if($vp_metabox_used)
{
$result['scripts'] = array_merge($result['scripts'], $script_always);
$result['styles'] = array_merge($result['styles'], $style_always);
}
$result['scripts'] = array_unique($result['scripts']);
$result['styles'] = array_unique($result['styles']);
}
return $result;
}
public function can_output($hook_suffix = '')
{
if ( WPAlchemy_MetaBox::_is_post() or WPAlchemy_MetaBox::_is_page() )
return true;
return false;
}
}
================================================
FILE: classes/metabox.php
================================================
<?php
/**
* Extended version of WPAlchemy Class
* so that it can process metabox using an array specification
* and compatible with all Vafpress Framework Option Controls.
*/
/////////////////////////////////////////
// Include original WPAlchemy Class //
/////////////////////////////////////////
if(!class_exists('WPAlchemy_MetaBox'))
{
require_once VP_FileSystem::instance()->resolve_path('includes', 'wpalchemy/MetaBox');
}
class VP_Metabox extends WPAlchemy_MetaBox
{
public static $pool = array();
public $is_dev_mode = false;
function __construct($arr)
{
if( !is_array($arr) and file_exists($arr) )
{
$arr = include $arr;
}
parent::__construct($arr);
// Modify title in dev mode
if( $this->is_dev_mode )
{
$this->title = __('[Development Mode] ', 'vp_textdomain') . $this->title;
}
if ($this->can_output() and VP_WP_Admin::is_post_or_page() )
{
// make sure metabox template loaded
if( !is_array($this->template) and file_exists($this->template) )
$this->template = include $this->template;
add_action( 'init', array( $this, 'register_fields' ) );
}
self::$pool[$this->id] = $this;
}
public function register_fields()
{
$loader = VP_WP_Loader::instance();
$loader->add_types( $this->get_field_types(), 'metabox' );
}
public static function get_pool()
{
return self::$pool;
}
public static function pool_can_output()
{
foreach (self::$pool as $mb)
{
if( $mb->can_output() )
{
return true;
}
}
return false;
}
public static function pool_supports_editor()
{
foreach (self::$pool as $mb)
{
if( $mb->supports_editor() )
{
return true;
}
}
return false;
}
public function supports_editor()
{
$post_type = self::_get_current_post_type();
$has_editor = post_type_supports( $post_type, 'editor' );
return $has_editor;
}
/**
* Used to setup the meta box content template
*
* @since 1.0
* @access private
* @see _init()
*/
function _setup()
{
$this->in_template = TRUE;
// also make current post data available
global $post;
// shortcuts
$mb =& $this;
$metabox =& $this;
$id = $this->id;
$meta = $this->_meta(NULL, TRUE);
// make sure metabox template loaded
if( !is_array($this->template) and file_exists($this->template) )
{
$this->template = include $this->template;
}
else
{
$fields = $this->_enfactor($this->template);
$this->_enbind($fields);
$fields = $this->_endep($fields);
echo '<div class="vp-metabox">';
$this->_enview($fields);
echo '</div>';
}
// create a nonce for verification
echo '<input type="hidden" name="'. $this->id .'_nonce" value="' . wp_create_nonce($this->id) . '" />';
$this->in_template = FALSE;
}
// return all field types
function get_field_types()
{
$types = array();
if(!function_exists('inner_build'))
{
function inner_build($fields, &$types)
{
$rules = VP_Util_Config::instance()->load('dependencies', 'rules');
foreach ($fields as $field)
{
if($field['type'] == 'group')
{
inner_build($field['fields'], $types);
}
else
{
if( ! in_array($field['type'], $types) )
$types[] = $field['type'];
}
}
}
}
inner_build($this->template, $types);
return $types;
}
function _enfactor($arr)
{
$mb =& $this;
$fields = $arr;
$field_objects = array();
foreach ($fields as $field)
{
if($field['type'] == 'group' and $field['repeating'])
{
$field_objects[$field['name']] = $this->_enfactor_group($field, $mb, true);
}
else if($field['type'] == 'group' and !$field['repeating'])
{
$field_objects[$field['name']] = $this->_enfactor_group($field, $mb, false);
}
else
{
$field_objects[$field['name']] = $this->_enfactor_field($field, $mb);
}
}
return $field_objects;
}
function _enbind($fields)
{
foreach ($fields as $name => $field)
{
if(is_array($field))
{
foreach ($field['groups'] as $group)
{
$this->_enbind($group['childs']);
}
}
else
{
$bind = $field->get_binding();
$val = $field->get_value();
if(!empty($bind) and is_null($val))
{
$bind = explode('|', $bind);
$func = $bind[0];
$params = $bind[1];
$params = preg_split('/[\s,]+/', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$result = call_user_func_array($func, $values);
if(VP_Util_Reflection::is_multiselectable($field))
{
$result = (array) $result;
}
else
{
if(is_array($result))
{
$result = reset($result);
}
$result = (String) $result;
}
$field->set_value($result);
}
if($field instanceof VP_Control_FieldMulti)
{
$bind = $field->get_items_binding();
if(!empty($bind))
{
$bind = explode('|', $bind);
$func = $bind[0];
$params = $bind[1];
$params = preg_split('/[\s,]+/', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$items = call_user_func_array($func, $values);
$field->add_items_from_array($items);
}
}
}
}
}
function _endep($fields)
{
if(!function_exists('loop_fields'))
{
function loop_fields(&$fields)
{
foreach ($fields as &$field)
{
if(is_array($field))
{
foreach ($field['groups'] as &$group)
{
loop_fields($group['childs']);
}
}
$dependency = '';
if($field instanceof VP_Control_Field)
{
$dependency = $field->get_dependency();
if(!empty($dependency))
{
$dependency = explode('|', $dependency);
$func = $dependency[0];
$params = $dependency[1];
}
}
else
{
if(isset($field['dependency']))
{
if(!empty($field['dependency']))
{
$dependency = $field['dependency'];
$func = $dependency['function'];
$params = $dependency['field'];
}
}
}
if(!empty($dependency))
{
$params = preg_split('/[\s,]+/', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$result = call_user_func_array($func, $values);
if(!$result)
{
if($field instanceof VP_Control_Field)
{
$field->is_hidden(true);
if($field->is_hidden())
$field->add_container_extra_classes('vp-hide');
$field->add_container_extra_classes('vp-dep-inactive');
}
else
{
$field['is_hidden'] = true;
if($field['is_hidden'])
$field['container_extra_classes'][] = 'vp-hide';
$field['container_extra_classes'][] = 'vp-dep-inactive';
}
}
}
}
}
}
loop_fields($fields);
return $fields;
}
function _enfactor_field($field, $mb, $in_group = false)
{
$is_multi = VP_Util_Reflection::is_multiselectable($field['type']);
if( !$is_multi )
{
$mb->the_field($field['name']);
}
else
{
$mb->the_field($field['name'], WPALCHEMY_FIELD_HINT_CHECKBOX_MULTI);
}
$field['name'] = $mb->get_the_name();
// create the object
$make = VP_Util_Reflection::field_class_from_type($field['type']);
$vp_field = call_user_func("$make::withArray", $field);
// get value from mb
$value = $mb->get_the_value();
// get default from array
$default = $vp_field->get_default();
// if tocopy always assign default
if( $mb->is_parent_multi() and $mb->is_in_multi_last() )
{
$value = $default;
}
else
{
// if value is null and default exist, use default
if( is_null($value) and !is_null($default) and empty($this->meta) )
{
$value = $default;
}
// if not then set up value from mb
else
{
if( VP_Util_Reflection::is_multiselectable($field['type']) )
{
if( !is_array($value) and !is_null($value) )
$value = array( $value );
else if( is_null($value) )
$value = array();
}
}
}
$vp_field->set_value($value);
if (!$in_group)
{
$vp_field->add_container_extra_classes(array('vp-meta-single'));
}
return $vp_field;
}
function _enfactor_group($field, $mb, $repeating)
{
$ignore = array('type', 'length', 'fields');
$groups = array();
$indexed_name = '';
$level = null;
if($repeating)
{
while($mb->have_fields_and_multi($field['name']))
{
if ($indexed_name === '') $indexed_name = $mb->get_the_loop_group_id();
if (is_null($level)) $level = $mb->get_the_loop_level();
$fields = array();
foreach ($field['fields'] as $f)
{
if($f['type'] === 'group')
$fields[$f['name']] = $this->_enfactor_group($f, $mb, $f['repeating']);
else
$fields[$f['name']] = $this->_enfactor_field($f, $mb, true);
}
$groups[] = array(
'name' => $mb->get_the_loop_group_name(true),
'childs' => $fields
);
}
}
else
{
$length = isset($field['length']) ? $field['length'] : 1;
while($mb->have_fields($field['name'], $length))
{
if ($indexed_name === '') $indexed_name = $mb->get_the_loop_group_id();
if (is_null($level)) $level = $mb->get_the_loop_level();
$fields = array();
foreach ($field['fields'] as $f)
{
if($f['type'] === 'group')
$fields[$f['name']] = $this->_enfactor_group($f, $mb, $f['repeating']);
else
$fields[$f['name']] = $this->_enfactor_field($f, $mb, true);
}
$groups[] = array(
'name' => $mb->get_the_loop_group_name(true),
'childs' => $fields
);
}
}
// assign groups
$group['groups'] = $groups;
$group['indexed_name'] = $indexed_name;
$group['level'] = $level;
// assign other information
$keys = array_keys($field);
foreach ($keys as $key)
{
if(!in_array($key, $ignore))
{
$group[$key] = $field[$key];
}
}
// sortable
if(isset($group['sortable']) and $group['sortable'])
$group['container_extra_classes'][] = 'vp-sortable';
return $group;
}
function _enview($fields)
{
foreach ($fields as $name => $field)
{
if( is_array($field) and $field['repeating'] )
{
echo $this->_render_repeating_group($field);
}
else if( is_array($field) and !$field['repeating'] )
{
echo $this->_render_group($field);
}
else
{
echo $this->_render_field($field);
}
}
}
function _render_field($field)
{
return $field->render();
}
function _render_group($group)
{
$name = $group['name'];
$uid = $group['indexed_name'];
$oddity = ($group['level'] % 2 === 0) ? 'even' : 'odd';
$dependency = isset($group['dependency']) ? $group['dependency']['function'] . '|' . $group['dependency']['field'] : '';
$html = '';
$html .= '<div id="wpa_loop-' . $uid
. '" class="vp-wpa-loop level-' . $oddity . ' wpa_loop wpa_loop-' . $name . ' vp-fixed-loop vp-meta-group'
. (isset($group['container_extra_classes']) ? (' ' . implode(' ', $group['container_extra_classes'])) : '')
. '"'
. VP_Util_Text::return_if_exists(isset($dependency) ? $dependency : '', 'data-vp-dependency="%s"')
. '>';
$icon = '';
if(isset($group['sortable']) and $group['sortable'])
$icon = '<i class="fa fa-move"></i> ';
foreach ($group['groups'] as $g)
{
$is_first = false;
if ($g === reset($group['groups'])){ $is_first = true;}
$html .= '<div id="'. $g['name'] .'" class="vp-wpa-group wpa_group wpa_group-' . $name . '">';
$html .= '<div class="vp-wpa-group-heading"><a href="#" class="vp-wpa-group-title">' . $icon . $group['title'] . '</a></div>';
$html .= '<div class="vp-controls' . ((!$is_first) ? ' vp-hide' : '') . '">';
foreach ($g['childs'] as $f)
{
if( is_array($f) and $f['repeating'] )
$html .= $this->_render_repeating_group($f);
else if( is_array($f) and !$f['repeating'] )
$html .= $this->_render_group($f);
else
$html .= $this->_render_field($f);
}
$html .= '</div>';
$html .= '</div>';
}
$html .= '</div>';
return $html;
}
function _render_repeating_group($group)
{
$name = $group['name'];
$uid = $group['indexed_name'];
$oddity = ($group['level'] % 2 === 0) ? 'even' : 'odd';
$dependency = isset($group['dependency']) ? $group['dependency']['function'] . '|' . $group['dependency']['field'] : '';
$html = '';
$html .= '<div id="wpa_loop-' . $uid
. '" class="vp-wpa-loop level-' . $oddity . ' wpa_loop wpa_loop-' . $name . ' vp-repeating-loop vp-meta-group'
. (isset($group['container_extra_classes']) ? (' ' . implode(' ', $group['container_extra_classes'])) : '')
. '"'
. VP_Util_Text::return_if_exists(isset($dependency) ? $dependency : '', 'data-vp-dependency="%s"')
. '>';
$icon = '';
if(isset($group['sortable']) and $group['sortable'])
$icon = '<i class="fa fa-move"></i> ';
foreach ($group['groups'] as $g)
{
$class = '';
$is_first = false;
$is_last = false;
if ($g === end($group['groups'])){ $is_last = true; $class = ' last tocopy';}
if ($g === reset($group['groups'])){ $is_first = true; $class = ' first';}
$html .= '<div id="'. $g['name'] .'" class="vp-wpa-group wpa_group wpa_group-' . $name . $class . '">';
$html .= '<div class="vp-wpa-group-heading"><a href="#" class="vp-wpa-group-title">' . $icon . $group['title'] . '</a><a href="#" class="dodelete vp-wpa-group-remove" title="'. __('Remove', 'vp_textdomain') .'"><i class="fa fa-times"></i> '. __('Remove', 'vp_textdomain') .'</a></div>';
$html .= '<div class="vp-controls' . ((!$is_first) ? ' vp-hide' : '') . '">';
if ($g === end($group['groups']))
{
$tocopy = $g['name'] . '[tocopy]';
$html .= '<input type="hidden" class="tocopy-hidden" name="' . $tocopy . '" value="1">';
}
foreach ($g['childs'] as $f)
{
if( is_array($f) and $f['repeating'] )
$html .= $this->_render_repeating_group($f);
else if( is_array($f) and !$f['repeating'] )
$html .= $this->_render_group($f);
else
$html .= $this->_render_field($f);
}
$html .= '</div>';
$html .= '</div>';
}
$html .= '<div class="vp-wpa-group-add">';
$html .= '<a href="#" class="button button-large docopy-' . $name . '">'. __('Add More', 'vp_textdomain') . ' ' . $group['title'] . '</a>';
$html .= '</div>';
$html .= '</div>';
return $html;
}
function _save($post_id)
{
// skip saving if dev mode is on
if($this->is_dev_mode)
return;
$real_post_id = isset($_POST['post_ID']) ? $_POST['post_ID'] : NULL ;
// check autosave
if (defined('DOING_AUTOSAVE') AND DOING_AUTOSAVE AND !$this->autosave) return $post_id;
// make sure data came from our meta box, verify nonce
$nonce = isset($_POST[$this->id.'_nonce']) ? $_POST[$this->id.'_nonce'] : NULL ;
if (!wp_verify_nonce($nonce, $this->id)) return $post_id;
// check user permissions
if ($_POST['post_type'] == 'page')
{
if (!current_user_can('edit_page', $post_id)) return $post_id;
}
else
{
if (!current_user_can('edit_post', $post_id)) return $post_id;
}
// authentication passed, save data
$new_data = isset( $_POST[$this->id] ) ? $_POST[$this->id] : NULL ;
// clean to copy and reset array indexes
$this->_clean_tocopy($new_data);
if (empty($new_data))
{
$new_data = NULL;
}
// filter: save
if ($this->has_filter('save'))
{
$new_data = $this->apply_filters('save', $new_data, $real_post_id);
/**
* halt saving
* @since 1.3.4
*/
if (FALSE === $new_data) return $post_id;
$this->_clean_tocopy($new_data);
}
// get current fields, use $real_post_id (checked for in both modes)
$current_fields = get_post_meta($real_post_id, $this->id . '_fields', TRUE);
if ($this->mode == WPALCHEMY_MODE_EXTRACT)
{
$new_fields = array();
if (is_array($new_data))
{
foreach ($new_data as $k => $v)
{
$field = $this->prefix . $k;
array_push($new_fields,$field);
$new_value = $new_data[$k];
if (is_null($new_value))
{
delete_post_meta($post_id, $field);
}
else
{
update_post_meta($post_id, $field, $new_value);
}
}
}
$diff_fields = array_diff((array)$current_fields,$new_fields);
if (is_array($diff_fields))
{
foreach ($diff_fields as $field)
{
delete_post_meta($post_id,$field);
}
}
delete_post_meta($post_id, $this->id . '_fields');
if ( ! empty($new_fields))
{
add_post_meta($post_id,$this->id . '_fields', $new_fields, TRUE);
}
// keep data tidy, delete values if previously using WPALCHEMY_MODE_ARRAY
delete_post_meta($post_id, $this->id);
}
else
{
if (is_null($new_data))
{
delete_post_meta($post_id, $this->id);
}
else
{
update_post_meta($post_id, $this->id, $new_data);
}
// keep data tidy, delete values if previously using WPALCHEMY_MODE_EXTRACT
if (is_array($current_fields))
{
foreach ($current_fields as $field)
{
delete_post_meta($post_id, $field);
}
delete_post_meta($post_id, $this->id . '_fields');
}
}
// action: save
if ($this->has_action('save'))
{
$this->do_action('save', $new_data, $real_post_id);
}
return $post_id;
}
private function _clean_tocopy(&$arr)
{
if(is_array($arr))
{
foreach ($arr as $key => $value)
{
if(is_array($value))
{
$this->_clean_tocopy($arr[$key]);
if(array_key_exists('tocopy', $value))
{
unset($arr[$key]);
}
}
}
if (!count($arr))
{
$arr = array();
}
else
{
$keys = array_keys($arr);
$is_numeric = TRUE;
foreach ($keys as $key)
{
if (!is_numeric($key))
{
$is_numeric = FALSE;
break;
}
}
if ($is_numeric)
{
$arr = array_values($arr);
}
}
}
}
}
/**
* EOF
*/
================================================
FILE: classes/multiselectable.php
================================================
<?php
/**
* Implement this interface to state that the field control is Multi Selectable
*/
interface VP_MultiSelectable{}
/**
* EOF
*/
================================================
FILE: classes/option/control/field/impexp.php
================================================
<?php
class VP_Option_Control_Field_ImpExp extends VP_Control_Field
{
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render()
{
$this->_setup_data();
return VP_View::instance()->load('option/impexp', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/option/control/field/restore.php
================================================
<?php
class VP_Option_Control_Field_Restore extends VP_Control_Field
{
public function __construct()
{
parent::__construct();
}
public static function withArray($arr = array(), $class_name = null)
{
if(is_null($class_name))
$instance = new self();
else
$instance = new $class_name;
$instance->_basic_make($arr);
return $instance;
}
public function render()
{
$this->_setup_data();
return VP_View::instance()->load('option/restore', $this->get_data());
}
}
/**
* EOF
*/
================================================
FILE: classes/option/control/group/menu.php
================================================
<?php
class VP_Option_Control_Group_Menu extends VP_Option_Control_Group
{
/**
* Collection of $_menu
* @var VP_Option_Control_Group
*/
private $_menus;
/**
* Collection of controls
* @var VP_Control_Field
*/
private $_controls;
private $_icon;
public function __construct()
{
parent::__construct();
$this->_menus = array();
$this->_controls = array();
}
public function render($extra = array())
{
// Setup data
$this->_setup_data();
$this->add_data('menu', $this);
foreach ($extra as $key => $value)
{
$this->add_data($key, $value);
}
return VP_View::instance()->load('option/menu', $this->get_data());
}
public function add_menu($menu)
{
$this->_menus[] = $menu;
}
/**
* Getter of $_menus
*
* @return Array Collection of menus object
*/
public function get_menus() {
return $this->_menus;
}
/**
* Setter of $_menus
*
* @param Array $_menus Collection of menus object
*/
public function set_menus($_menus)
{
$this->_menus = $_menus;
return $this;
}
public function add_control($control)
{
$this->_controls[] = $control;
}
/**
* Getter of controls
*
* @return Array Collection of controls object
*/
public function get_controls()
{
return $this->_controls;
}
/**
* Setter of controls
*
* @param Array $_controls Collection of controls object
*/
public function set_controls($_controls)
{
$this->_controls = $_controls;
return $this;
}
/**
* Get menu icon
*
* @return String Icon URL
*/
public function get_icon() {
return $this->_icon;
}
/**
* Set menu icon
*
* @param String $_icon Icon URL
*/
public function set_icon($_icon) {
$this->_icon = $_icon;
return $this;
}
}
================================================
FILE: classes/option/control/group/section.php
================================================
<?php
class VP_Option_Control_Group_Section extends VP_Option_Control_Group
{
/**
* Collection of fields
* @var VP_Control_Field
*/
private $_fields;
/**
* dependency pattern string
* @var String
*/
protected $_dependency;
/**
* Whether to hide this control in first rendering
*/
protected $_is_hidden;
public function __construct()
{
parent::__construct();
$this->_fields = array();
}
public function render($extra = array())
{
// Setup data
$this->_setup_data();
if($this->is_hidden())
{
$this->add_container_extra_classes('vp-hide');
}
$this->add_data('section', $this);
$this->add_data('container_extra_classes', implode(' ', $this->get_container_extra_classes()));
foreach ($extra as $key => $value)
{
$this->add_data($key, $value);
}
return VP_View::instance()->load('option/section', $this->get_data());
}
public function add_field($field)
{
$this->_fields[] = $field;
}
/**
* Getter of fields
*
* @return Array Collection of fields object
*/
public function get_fields() {
return $this->_fields;
}
/**
* Setter of fields
*
* @param Array $_fields Collection of fields object
*/
public function set_fields($_fields) {
$this->_fields = $_fields;
return $this;
}
/**
* Getter for $_dependency
*
* @return String dependency pattern in string
*/
public function get_dependency() {
return $this->_dependency;
}
/**
* Setter for $_dependency
*
* @param String $_dependency dependency pattern in string
*/
public function set_dependency($_dependency) {
$this->_dependency = $_dependency;
return $this;
}
/**
* Get is_hidden status, will set the status if a boolean passed
*
* @return bool is_hidden status
*/
public function is_hidden($_is_hidden = null) {
if(!is_null($_is_hidden))
$this->_is_hidden = (bool) $_is_hidden;
return $this->_is_hidden;
}
}
================================================
FILE: classes/option/control/group.php
================================================
<?php
abstract class VP_Option_Control_Group
{
protected $_name;
protected $_title;
protected $_description;
protected $_data;
/**
* Extra Classes for the container
* @var Array
*/
protected $_container_extra_classes;
public function __construct()
{
$this->_container_extra_classes = array();
}
public abstract function render($extra = array());
protected function _setup_data(){}
/**
* Getter of $_name
*
* @return String Group unique name
*/
public function get_name() {
return $this->_name;
}
/**
* Setter of $_name
*
* @param String $_name Group unique name
*/
public function set_name($_name) {
$this->_name = $_name;
return $this;
}
/**
* Getter of title
*
* @return String Group title
*/
public function get_title() {
return $this->_title;
}
/**
* Setter of title
*
* @param String $_title Group title
*/
public function set_title($_title) {
$this->_title = $_title;
return $this;
}
/**
* Getter of $_description
*
* @return String Group description
*/
public function get_description() {
return $this->_description;
}
/**
* Setter of $_description
*
* @param String $_description Group description
*/
public function set_description($_description) {
$this->_description = $_description;
return $this;
}
/**
* Add value to render data array
* @param Mixed $item Value to be added to render data arary
*/
public function add_data($key, $value)
{
$this->_data[$key] = $value;
}
/**
* Get render data
*
* @return Array Render data array
*/
public function get_data() {
return $this->_data;
}
/**
* Set render data
*
* @param Array $_data Render data array
*/
public function set_data($_data) {
$this->_data = $_data;
return $this;
}
/**
* Getter of $_container_extra_classes
*
* @return Array of Extra Classes for the container
*/
public function get_container_extra_classes() {
return $this->_container_extra_classes;
}
/**
* Setter of $_container_extra_classes
*
* @param Array $_container_extra_classes Extra Classes for the container
*/
public function set_container_extra_classes($_container_extra_classes) {
$this->_container_extra_classes = $_container_extra_classes;
return $this;
}
public function add_container_extra_classes($class)
{
if(is_array($class))
{
$this->_container_extra_classes = array_merge($this->_container_extra_classes, $class);
}
else if(!in_array($class, $this->_container_extra_classes))
{
$this->_container_extra_classes[] = $class;
}
return $this->_container_extra_classes;
}
}
================================================
FILE: classes/option/control/set.php
================================================
<?php
class VP_Option_Control_Set
{
const SAVE_SUCCESS = 1;
const SAVE_NOCHANGES = 2;
const SAVE_FAILED = 3;
private $_menus;
private $_title;
private $_logo;
private $_layout;
public function __construct()
{
$this->_menus = array();
}
public function render()
{
// Setup data
$data = array('set' => $this);
return VP_View::instance()->load('option/set', $data);
}
/**
* Get Option Set Title
*
* @return String Option set title
*/
public function get_title() {
return $this->_title;
}
/**
* Set Option Set title
*
* @param String $_title Option set title
*/
public function set_title($_title) {
$this->_title = $_title;
return $this;
}
/**
* Set _layout
*
* @return String _layout
*/
public function get_layout()
{
return $this->_layout;
}
/**
* Get _layout
*
* @param String $_layout _layout
*/
public function set_layout($_layout)
{
$this->_layout = $_layout;
return $this;
}
/**
* Get logo
*
* @return String Logo URL
*/
public function get_logo() {
return $this->_logo;
}
/**
* Set logo
*
* @param String $_logo Logo URL
*/
public function set_logo($_logo) {
$this->_logo = $_logo;
return $this;
}
public function add_menu($menu)
{
$this->_menus[] = $menu;
}
/**
* Getter of $_menus
*
* @return Array Collection of menus object
*/
public function get_menus() {
return $this->_menus;
}
/**
* Setter of $_menus
*
* @param Array $_menus Collection of menus object
*/
public function set_menus($_menus) {
$this->_menus = $_menus;
return $this;
}
public function get_fields($include_section = false)
{
if(!function_exists('loop_controls'))
{
function loop_controls($menu, $include_section)
{
$fields = array();
foreach ( $menu->get_controls() as $control )
{
if( get_class($control) === 'VP_Option_Control_Group_Section' )
{
if($include_section)
{
$fields[$control->get_name()] = $control;
}
foreach ( $control->get_fields() as $field )
{
if( VP_Util_Reflection::field_type_from_class(get_class($field)) != 'impexp' )
{
$fields[$field->get_name()] = $field;
}
}
}
else
{
if( VP_Util_Reflection::field_type_from_class(get_class($control)) != 'impexp' )
{
$fields[$control->get_name()] = $control;
}
}
}
return $fields;
}
}
$fields = array();
foreach ( $this->_menus as $menu )
{
$submenus = $menu->get_menus();
if( !empty($submenus) )
{
foreach ( $submenus as $submenu )
{
$fields = array_merge($fields, loop_controls($submenu, $include_section));
}
}
else
{
$fields = array_merge($fields, loop_controls($menu, $include_section));
}
}
return $fields;
}
public function get_field_types()
{
$fields = $this->get_fields();
$types = array();
foreach ($fields as $field)
{
$type = VP_Util_Reflection::field_type_from_class(get_class($field));
if(!in_array($type, $types))
$types[] = $type;
}
return $types;
}
public function get_field($name)
{
$fields = $this->get_fields();
if(array_key_exists($name, $fields))
{
return $fields[$name];
}
return null;
}
public function process_binding()
{
$fields = $this->get_fields();
foreach ($fields as $field)
{
$bind = $field->get_binding();
$val = $field->get_value();
if(!empty($bind) and is_null($val))
{
$bind = explode('|', $bind);
$func = $bind[0];
$params = $bind[1];
$params = preg_split('/[\s,]+/', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$result = call_user_func_array($func, $values);
if(VP_Util_Reflection::is_multiselectable($field))
{
$result = (array) $result;
}
else
{
if(is_array($result))
{
$result = reset($result);
}
$result = (String) $result;
}
$field->set_value($result);
}
if($field instanceof VP_Control_FieldMulti)
{
$bind = $field->get_items_binding();
if(!empty($bind))
{
$bind = explode('|', $bind);
$func = $bind[0];
$params = $bind[1];
$params = preg_split('/[\s,]+/', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$items = call_user_func_array($func, $values);
if(is_array($items) && !empty($items))
{
$field->set_items(array());
$field->add_items_from_array($items);
}
}
}
}
}
public function process_dependencies()
{
$fields = $this->get_fields(true);
foreach ($fields as $field)
{
$dependency = $field->get_dependency();
if(!empty($dependency))
{
$dependency = explode('|', $dependency);
$func = $dependency[0];
$params = $dependency[1];
$params = preg_split('/[\s,]+/', $params);
$values = array();
foreach ($params as $param)
{
if(array_key_exists($param, $fields))
{
$values[] = $fields[$param]->get_value();
}
}
$result = call_user_func_array($func, $values);
if(!$result)
{
$field->add_container_extra_classes('vp-dep-inactive');
$field->is_hidden(true);
}
}
}
}
public function normalize_values($opt_arr)
{
$fields = $this->get_fields();
foreach ($opt_arr as $key => $value)
{
if(array_key_exists($key, $fields))
{
$is_multi = VP_Util_Reflection::is_multiselectable($fields[$key]);
if( $is_multi and !is_array($value) )
{
$opt_arr[$key] = array($value);
}
if( !$is_multi and is_array($value))
{
$opt_arr[$key] = '';
}
}
}
return $opt_arr;
}
public function get_defaults()
{
$defaults = array();
$fields = $this->get_fields();
foreach ( $fields as $field )
{
$defaults[$field->get_name()] = $field->get_default();
}
return $defaults;
}
public function get_values()
{
$values = array();
$fields = $this->get_fields();
foreach ( $fields as $field )
{
$values[$field->get_name()] = $field->get_value();
}
return $values;
}
public function setup($options)
{
// populate option to fields' values
$this->populate_values($options);
// process binding
$this->process_binding();
// process dependencies
$this->process_dependencies();
}
public function save($option_key)
{
$opt = $this->get_values();
do_action('vp_option_set_before_save', $opt);
if(update_option($option_key, $opt))
{
$result['status'] = true;
$result['code'] = self::SAVE_SUCCESS;
$result['message'] = __('Saving successful', 'vp_textdomain');
$curr_opt = get_option($option_key, array());
}
else
{
$curr_opt = get_option($option_key, array());
$changed = $opt !== $curr_opt;
if($changed)
{
$result['status'] = false;
$result['code'] = self::SAVE_FAILED;
$result['message'] = __('Saving failed', 'vp_textdomain');
}
else
{
$result['status'] = true;
$result['code'] = self::SAVE_NOCHANGES;
$result['message'] = __('No changes made', 'vp_textdomain');
}
}
do_action('vp_option_set_after_save', $curr_opt, $result['status'], $option_key);
return $result;
}
public function populate_values($opt, $force_update = false)
{
$fields = $this->get_fields();
foreach ( $fields as $field )
{
$is_multi = VP_Util_Reflection::is_multiselectable($field);
if( array_key_exists($field->get_name(), $opt) )
{
if( $is_multi and is_array($opt[$field->get_name()]) )
{
$field->set_value($opt[$field->get_name()]);
}
if( !$is_multi and !is_array($opt[$field->get_name()]) )
{
$field->set_value($opt[$field->get_name()]);
}
}
else
{
if($force_update)
{
if($is_multi)
{
$field->set_value(array());
}
else
{
$field->set_value('');
}
}
}
}
}
}
/**
* EOF
*/
================================================
FILE: classes/option/depsloader.php
================================================
<?php
class VP_Option_Depsloader
{
/**
* The VP_Option_Set object!
*/
private $things;
public function __construct($things)
{
$this->things = $things;
}
public function build()
{
$set = $this->things;
$result = array(
'scripts' => array(),
'styles' => array(),
'localize_name' => 'vp_opt',
'localize_default' => array(
'nonce', 'impexp_msg'
),
'localize' => array(
'name' => 'vpt_option'
),
'use_upload' => false,
'use_new_media_upload' => false,
'main_js' => array(
'name' => 'vp-option',
'path' => VP_PUBLIC_URL . '/js/option.min.js',
),
'main_css' => array(
'name' => 'vp-option',
'path' => VP_PUBLIC_URL . '/css/option.min.css'
),
);
$result['scripts'] = VP_Util_Config::instance()->load('dependencies', 'scripts.always');
$result['styles'] = VP_Util_Config::instance()->load('dependencies', 'styles.always');
$scripts = VP_Util_Config::instance()->load('dependencies', 'scripts.paths');
$styles = VP_Util_Config::instance()->load('dependencies', 'styles.paths');
$rules = VP_Util_Config::instance()->load('dependencies', 'rules');
$fields = $set->get_fields();
foreach ($fields as $field)
{
$type = VP_Util_Reflection::field_type_from_class(get_class($field));
if( array_key_exists($type, $rules) )
{
$result['scripts'] = array_merge($result['scripts'], $rules[$type]['js']);
$result['styles'] = array_merge($result['styles'], $rules[$type]['css']);
}
// check if using upload button
if( $type == 'upload' )
{
$result['use_upload'] = true;
}
}
$result['scripts'] = array_unique($result['scripts']);
$result['styles'] = array_unique($result['styles']);
return $result;
}
public function can_output($hook_suffix = '')
{
// if not in option page, don't load
$menu_page_slug = VP_Util_Config::instance()->load('option', 'menu_page_slug');
if( $hook_suffix == ('appearance_page_' . $menu_page_slug) )
return true;
return false;
}
}
================================================
FILE: classes/option/parser.php
================================================
<?php
class VP_Option_Parser
{
public function parse_array_options($arr, $auto_group_naming)
{
$set = new VP_Option_Control_Set();
if(empty($arr['title']))
$arr['title'] = 'Vafpress';
if(empty($arr['logo']))
$arr['logo'] = 'vp-logo.png';
$set->set_title(isset($arr['title']) ? $arr['title'] : '')
->set_logo(isset($arr['logo']) ? $arr['logo'] : '');
$auto_menu_index = 0;
$auto_menu = "the_menu_";
// Loops trough all the menus
if (!empty($arr['menus'])) foreach ($arr['menus'] as $menu)
{
// Create menu object and add to set
$vp_menu = new VP_Option_Control_Group_Menu();
if($auto_group_naming)
{
if(isset($menu['name']) and !empty($menu['name']))
{
$vp_menu->set_name($menu['name']);
}
else
{
$vp_menu->set_name($auto_menu . $auto_menu_index);
$auto_menu_index++;
}
}
$vp_menu->set_title(isset($menu['title']) ? $menu['title'] : '')
->set_icon(isset($menu['icon']) ? $menu['icon'] : '');
$set->add_menu($vp_menu);
// Loops through every submenu in each menu
if (!empty($menu['menus']) and is_array($menu['menus'])) foreach ($menu['menus'] as $submenu)
{
$vp_submenu = new VP_Option_Control_Group_Menu();
if($auto_group_naming)
{
if(isset($submenu['name']) and !empty($submenu['name']))
{
$vp_submenu->set_name($submenu['name']);
}
else
{
$vp_submenu->set_name($auto_menu . $auto_menu_index);
$auto_menu_index++;
}
}
$vp_submenu->set_title(isset($submenu['title']) ? $submenu['title'] : '')
->set_icon(isset($submenu['icon']) ? $submenu['icon'] : '');
$vp_menu->add_menu($vp_submenu);
// Loops through every control in each submenu
if (!empty($submenu['controls'])) foreach ($submenu['controls'] as $control)
{
if($control['type'] === 'section')
$control = $this->parse_section($control);
else
$control = $this->parse_field($control);
$vp_submenu->add_control($control);
}
}
else
{
// Loops through every control in each submenu
if (!empty($menu['controls']) and is_array($menu['controls'])) foreach ($menu['controls'] as $control)
{
if($control['type'] === 'section')
$control = $this->parse_section($control);
else
$control = $this->parse_field($control);
$vp_menu->add_control($control);
}
}
}
return $set;
}
private function parse_section($section)
{
$vp_sec = new VP_Option_Control_Group_Section();
$vp_sec->set_name(isset($section['name']) ? $section['name'] : '')
->set_title(isset($section['title']) ? $section['title'] : '')
->set_description(isset($section['description']) ? $section['description'] : '');
if(isset($section['dependency']))
{
$func = $section['dependency']['function'];
$field = $section['dependency']['field'];
$vp_sec->set_dependency($func . '|' . $field);
}
// Loops through every field in each submenu
if (!empty($section['fields'])) foreach ($section['fields'] as $field)
{
$vp_field = $this->parse_field($field);
$vp_sec->add_field($vp_field);
}
return $vp_sec;
}
private function parse_field($field)
{
$class = VP_Util_Reflection::field_class_from_type($field['type']);
$vp_field = call_user_func("$class::withArray", $field);
return $vp_field;
}
}
/**
* EOF
*/
================================================
FILE: classes/option.php
================================================
<?php
class VP_Option
{
private $_option_key;
private $_page_slug;
private $_template;
private $_is_dev_mode;
private $_use_util_menu;
private $_use_auto_group_naming;
private $_role;
private $_menu_page;
private $_page_title;
private $_menu_label;
private $_layout;
private $_options_set = NULL;
private $_options = NULL;
private $_hook_suffix;
public static $pool;
public function __construct(array $configs)
{
// merge configs with default value
$configs = array_merge(array(
'is_dev_mode' => false,
'use_auto_group_naming' => true,
'use_util_menu' => true,
'minimum_role' => 'edit_theme_options',
'menu_page' => 'themes.php',
'layout' => 'fixed',
'page_title' => __( 'Vafpress Options', 'vp_textdomain' ),
'menu_label' => __( 'Vafpress Options', 'vp_textdomain' ),
'priority' => 10,
), $configs);
// options config filter
$configs = apply_filters('vp_option_configuration_array' , $configs, $configs['option_key']);
$configs = apply_filters('vp_option_configuration_array-' . $configs['option_key'], $configs);
// extract the configs
extract($configs);
// check and set required configs
if(isset($option_key)) $this->set_option_key($option_key);
else throw new Exception(__( 'Option Key is required', 'vp_textdomain' ), 1);
if(isset($template)) $this->set_template($template);
else throw new Exception(__( 'Template Array/File is required', 'vp_textdomain' ), 1);
if(isset($page_slug)) $this->set_page_slug($page_slug);
else throw new Exception(__( 'Page Slug is required', 'vp_textdomain' ), 1);
// swim in the pool
self::$pool[$this->get_option_key()] = &$this;
// check and set the remaining configs
if(isset($menu_page)) $this->set_menu_page($menu_page);
if(isset($is_dev_mode)) $this->is_dev_mode($is_dev_mode);
if(isset($use_util_menu)) $this->use_util_menu($use_util_menu);
if(isset($use_auto_group_naming)) $this->use_auto_group_naming($use_auto_group_naming);
if(isset($minimum_role)) $this->set_minimum_role($minimum_role);
if(isset($page_title)) $this->set_page_title($page_title);
if(isset($layout)) $this->set_layout($layout);
if(isset($menu_label)) $this->set_menu_label($menu_label);
// add first_activation hook to save initial values to db
add_action('vp_option_first_activation', array($this, 'initial_db_setup'));
// check if option key not existed init data from default values
$options = get_option( $this->get_option_key() );
if( $options === FALSE )
{
do_action('vp_option_first_activation');
}
// init options from db and expose to the api
$this->init_options_from_db();
// setup ajax
add_action('wp_ajax_vp_ajax_' . $this->get_option_key() . '_export_option', array($this, 'ajax_export_option'));
add_action('wp_ajax_vp_ajax_' . $this->get_option_key() . '_import_option', array($this, 'ajax_import_option'));
add_action('wp_ajax_vp_ajax_' . $this->get_option_key() . '_save' , array($this, 'ajax_save'));
add_action('wp_ajax_vp_ajax_' . $this->get_option_key() . '_restore' , array($this, 'ajax_restore'));
// register menu page
add_action( 'admin_menu', array($this, 'register_menu_page'), $priority );
}
public static function get_pool()
{
return self::$pool;
}
public function init_options_from_db()
{
$options = get_option( $this->get_option_key() );
if( $options !== FALSE )
{
$this->set_options($options);
}
}
// register menu page as configured
public function register_menu_page()
{
if( is_array( $this->get_menu_page() ) )
{
$menu_page = $this->get_menu_page();
// check and set required configs
if(!isset($menu_page['icon_url'])) $menu_page['icon_url'] = '';
if(!isset($menu_page['position'])) $menu_page['position'] = null;
$hook_suffix = add_menu_page(
$this->get_page_title(),
$this->get_menu_label(),
$this->get_minimum_role(),
$this->get_page_slug(),
array($this, 'option_page_display'),
$menu_page['icon_url'],
$menu_page['position']
);
}
else
{
$hook_suffix = add_submenu_page(
$this->get_menu_page(),
$this->get_page_title(),
$this->get_menu_label(),
$this->get_minimum_role(),
$this->get_page_slug(),
array($this, 'option_page_display')
);
}
$this->set_hook_suffix($hook_suffix);
// register option page load
add_action( 'load-' . $this->get_hook_suffix(), array($this, 'setup') );
}
public function setup()
{
$this->init_options_set();
$this->init_options();
$this->enqueue_scripts_and_styles();
// show dev mode notice
if( $this->is_dev_mode() )
add_action( 'admin_notices', array( $this, 'dev_mode_notice' ) );
}
public function dev_mode_notice()
{
VP_WP_Util::admin_notice(__("Development Mode is Active, options' values won't be saved into database.", 'vp_textdomain'), false);
}
public function enqueue_scripts_and_styles()
{
$opt_loader = VP_WP_Loader::instance();
$opt_loader->add_types( $this->get_field_types(), 'option' );
$opt_loader->add_main_js( 'vp-option' );
$opt_loader->add_main_css( 'vp-option' );
$opt_loader->add_js_data( 'vp-option', 'custom_local.name', $this->_option_key );
$opt_loader->add_js_data( 'vp-option', 'custom_local.SAVE_SUCCESS', VP_Option_Control_Set::SAVE_SUCCESS );
$opt_loader->add_js_data( 'vp-option', 'custom_local.SAVE_NOCHANGES', VP_Option_Control_Set::SAVE_NOCHANGES );
$opt_loader->add_js_data( 'vp-option', 'custom_local.SAVE_FAILED', VP_Option_Control_Set::SAVE_FAILED );
}
function save_and_reinit()
{
// do saving
$result = $this->get_options_set()->save($this->get_option_key());
// re-init $opt
$this->init_options_from_db();
// get the new $opt
$opt = $this->get_options_set()->get_values();
// save and re-init action hook
do_action('vp_option_save_and_reinit', $opt, $result['status'], $this->get_option_key());
// option key specific save and re-init action hook
do_action('vp_option_save_and_reinit-' . $this->get_option_key(), $opt, $result['status']);
return $result;
}
function ajax_save()
{
$result = $this->vp_verify_nonce();
if($result['status'])
{
$this->init_options_set();
$this->init_options();
$option = $_POST['option'];
$nonce = $_POST['nonce'];
$option = VP_Util_Array::unite( $option, 'name', 'value' );
$option = $this->get_options_set()->normalize_values($option);
// stripslashes added by WP in $_GET / $_POST
$option = stripslashes_deep($option);
// get old options from set
$old_opt = $this->get_options_set()->get_values();
$this->get_options_set()->populate_values($option, true);
// get back options from set
$opt = $this->get_options_set()->get_values();
// before ajax save action hook
do_action('vp_option_before_ajax_save', $opt);
// save and re-init options
$result = $this->save_and_reinit();
// after ajax save action hook
do_action('vp_option_after_ajax_save', $opt, $old_opt, $result['status'], $this->get_option_key());
// option key specific after ajax save action hook
do_action('vp_option_after_ajax_save-' . $this->get_option_key(), $opt, $old_opt, $result['status']);
}
if (ob_get_length()) ob_clean();
header('Content-type: application/json');
echo json_encode($result);
die();
}
function ajax_restore()
{
$result = $this->vp_verify_nonce();
if( $result['status'] )
{
$this->init_options_set();
$set = $this->get_options_set();
$options = $set->get_defaults();
// get old options from set
$old_opt = $this->get_options_set()->get_values();
// set options so that default value can be accessed in binding done in `setup`
$this->set_options($options);
// setup and process values
$set->setup($options);
// before ajax save action hook
do_action('vp_option_before_ajax_restore', $options);
// save and re-init options
$result = $this->save_and_reinit();
$options = $this->get_options_set()->get_values();
// after ajax restore action hook
do_action('vp_option_after_ajax_restore', $options, $old_opt, $result['status'], $this->get_option_key());
// after ajax restore action hook
do_action('vp_option_after_ajax_restore-' . $this->get_option_key(), $options, $old_opt, $result['status']);
}
if (ob_get_length()) ob_clean();
header('Content-type: application/json');
echo json_encode($result);
die();
}
function ajax_import_option()
{
global $vp_set, $vp_config;
$options = null;
$old_opt = null;
$result = $this->vp_verify_nonce();
if($result['status'])
{
$this->init_options_set();
$this->init_options();
$option = $_POST['option'];
if(empty($option))
{
$result['status'] = false;
$result['message'] = __("Can not be empty", 'vp_textdomain');
}
else
{
$option = json_decode(stripslashes($option), true);
if( is_array($option) )
{
$set = $this->get_options_set();
// get old options from set
$old_opt = $this->get_options_set()->get_values();
// populate new values
$set->populate_values($option, false);
// save and re-init options
$result = $this->save_and_reinit();
// get new options
$options = $this->get_options_set()->get_values();
}
else
{
$result['status'] = false;
$result['message'] = __("Invalid data", 'vp_textdomain');
}
}
}
// after ajax import action hook
do_action('vp_option_after_ajax_import', $options, $old_opt, $result['status'], $this->get_option_key());
// after ajax import action hook
do_action('vp_option_after_ajax_import-' . $this->get_option_key(), $options, $old_opt, $result['status']);
if (ob_get_length()) ob_clean();
header('Content-type: application/json');
echo json_encode($result);
die();
}
function ajax_export_option()
{
global $wpdb;
$sr_options = null;
$db_options = null;
$result = $this->vp_verify_nonce();
if($result['status'])
{
$db_options = get_option($this->get_option_key());
$sr_options = json_encode($db_options);
$result = array(
'status' => true,
'message'=> __("Successful", 'vp_textdomain'),
'option' => $sr_options,
);
}
// after ajax export action hook
do_action('vp_option_after_ajax_export', $db_options, $sr_options, $result['status'], $this->get_option_key());
// after ajax export action hook
do_action('vp_option_after_ajax_export-' . $this->get_option_key(), $db_options, $sr_options, $result['status']);
if (ob_get_length()) ob_clean();
header('Content-type: application/json');
echo json_encode($result);
die();
}
function vp_verify_nonce()
{
$nonce = $_POST['nonce'];
$verify = check_ajax_referer('vafpress', 'nonce', false);
if($verify)
{
$result['status'] = true;
$result['message'] = __("Successful", 'vp_textdomain');
}
else
{
$result['status'] = false;
$result['message'] = __("Unverified Access", 'vp_textdomain');
}
return $result;
}
function initial_db_setup()
{
// init set and options
$this->init_options();
$set = $this->get_options_set();
// get baked values from options set
$opt = $set->get_values();
// before db options db action hook
do_action('vp_option_before_db_init', $opt);
// save to db
$result = $this->save_and_reinit();
// after db options db action hook
do_action('vp_option_after_db_init', $opt, $result['status'], $this->get_option_key());
do_action('vp_option_after_db_init-' . $this->get_option_key(), $opt, $result['status']);
}
public function init_options()
{
$this->init_options_set();
$set = $this->get_options_set();
// try load option from DB
$db_options = get_option($this->get_option_key());
$default = $set->get_defaults();
if (!empty($db_options))
{
// unify, preserve option from DB but appends anything new from default
$options = $db_options;
$options = $options + $default;
}
else
{
$options = $set->get_defaults();
}
// If dev mode, always use default, no db interaction
if($this->is_dev_mode())
$options = $set->get_defaults();
// set options so that default value can be accessed in binding done in `setup`
$this->set_options($options);
// setup and process values
$set->setup($options);
}
public function init_options_set()
{
if(!is_null($this->get_options_set()))
return;
if( is_string($this->get_template()) and is_file($this->get_template()) )
$template = include $this->get_template();
else if(is_array($this->get_template()))
$template = $this->get_template();
else
throw new Exception(__( 'Invalid template supplied', 'vp_textdomain' ), 1);
$parser = new VP_Option_Parser();
$set = $parser->parse_array_options($template, $this->use_auto_group_naming());
$set->set_layout($this->get_layout());
// assign set object
$this->set_options_set($set);
if( $this->use_util_menu() )
{
// setup utility menu
$util_menu = new VP_Option_Control_Group_Menu();
$util_menu->set_title(__('Utility', 'vp_textdomain'));
$util_menu->set_name('menu_util');
$util_menu->set_icon('font-awesome:fa-ambulance');
// setup restore default section
$restore_section = new VP_Option_Control_Group_Section();
$restore_section->set_title(__('Restore Default', 'vp_textdomain'));
$restore_section->set_name('section_restore');
// setup restore button
$restore_button = new VP_Option_Control_Field_Restore();
$restore_section->add_field($restore_button);
// setup exim section
$exim_section = new VP_Option_Control_Group_Section();
$exim_section->set_title(__('Export/Import', 'vp_textdomain'));
$exim_section->set_name('section_exim');
// setup exim field
$exim_field = new VP_Option_Control_Field_ImpExp();
$exim_section->add_field($exim_field);
// add exim section
$util_menu->add_control($exim_section);
$util_menu->add_control($restore_section);
$set->add_menu($util_menu);
}
}
public function option_page_display()
{
echo $this->get_options_set()->render();
}
public function get_field_types()
{
// $this->init_options_set();
return $this->get_options_set()->get_field_types();
}
// @todo return `vp_option` like function
public function create_get_option_helper()
{
}
//////////////////////////////
// GETTER AND SETTER CHUNKS //
//////////////////////////////
/**
* Get _hook_suffix
*
* @return String _hook_suffix
*/
public function get_hook_suffix()
{
return $this->_hook_suffix;
}
/**
* Set _hook_suffix
*
* @param String $_hook_suffix _hook_suffix
*/
public function set_hook_suffix($_hook_suffix)
{
$this->_hook_suffix = $_hook_suffix;
return $this;
}
/**
* Get _template
*
* @return String _template
*/
public function get_template()
{
return $this->_template;
}
/**
* Set _template
*
* @param String $_template _template
*/
public function set_template($_template)
{
$this->_template = $_template;
return $this;
}
/**
* Get _options
*
* @return String _options
*/
public function get_options()
{
return $this->_options;
}
/**
* Set _options
*
* @param String $_options _options
*/
public function set_options($_options)
{
$this->_options = $_options;
return $this;
}
/**
* Get _options_set
*
* @return String _options_set
*/
public function get_options_set()
{
return $this->_options_set;
}
/**
* Set _options_set
*
* @param String $_options_set _options_set
*/
public function set_options_set($_options_set)
{
$this->_options_set = $_options_set;
return $this;
}
/**
* Get _menu_page
*
* @return String _menu_page
*/
public function get_menu_page()
{
return $this->_menu_page;
}
/**
* Set _menu_page
*
* @param String $_menu_page _menu_page
*/
public function set_menu_page($_menu_page)
{
$this->_menu_page = $_menu_page;
return $this;
}
/**
* Set _layout
*
* @return String _layout
*/
public function get_layout()
{
return $this->_layout;
}
/**
* Get _layout
*
* @param String $_layout _layout
*/
public function set_layout($_layout)
{
$this->_layout = $_layout;
return $this;
}
/**
* Get _menu_page_slug
*
* @return String _menu_page_slug
*/
public function get_page_slug()
{
return $this->_page_slug;
}
/**
* Set _page_slug
*
* @param String $_page_slug _page_slug
*/
public function set_page_slug($_page_slug)
{
$this->_page_slug = $_page_slug;
return $this;
}
/**
* Get _menu_label
*
* @return String _menu_label
*/
public function get_menu_label()
{
return $this->_menu_label;
}
/**
* Set _menu_label
*
* @param String $_menu_label _menu_label
*/
public function set_menu_label($_menu_label)
{
$this->_menu_label = $_menu_label;
return $this;
}
/**
* Get _page_title value
*
* @return String _page_title
*/
public function get_page_title()
{
return $this->_page_title;
}
/**
* Set _page_title
*
* @param String $_page_title _page_title
*/
public function set_page_title($_page_title)
{
$this->_page_title = $_page_title;
return $this;
}
/**
* Get _minimum_role value
*
* @return String $_minimum_role
*/
public function get_minimum_role()
{
return $this->_minimum_role;
}
/**
* Set _minimum_role value
*
* @param String $_minimum_role _minimum_role
*/
public function set_minimum_role($_minimum_role)
{
$this->_minimum_role = $_minimum_role;
return $this;
}
/**
* Get _option_key value
*
* @return String $_option_key
*/
public function get_option_key()
{
return $this->_option_key;
}
/**
* Set _option_key value
*
* @param String $_option_key $_option_key
*/
public function set_option_key($_option_key)
{
$this->_option_key = $_option_key;
return $this;
}
/**
* Get/Set whether to use auto group naming or not
*
* @return bool $_use_auto_group_naming
*/
public function use_auto_group_naming($_use_auto_group_naming = NULL)
{
if(is_null($_use_auto_group_naming))
return $this->_use_auto_group_naming;
$this->_use_auto_group_naming = $_use_auto_group_naming;
}
/**
* Get/Set whether to use export import menu or not
*
* @return bool $_use_util_menu
*/
public function use_util_menu($_use_util_menu = NULL)
{
if(is_null($_use_util_menu))
return $this->_use_util_menu;
$this->_use_util_menu = $_use_util_menu;
}
/**
* Get/Set whether it's development mode or not
*
* @return bool $_dev_mode
*/
public function is_dev_mode($_dev_mode = NULL)
{
if(is_null($_dev_mode))
return $this->_dev_mode;
$this->_dev_mode = $_dev_mode;
}
}
/**
* EOF
*/
================================================
FILE: classes/security.php
================================================
<?php
class VP_Security
{
/**
* Singleton instance of the class
* @var VP_Security
*/
private static $_instance;
private $_whitelist = array();
public static function instance()
{
if (is_null(self::$_instance))
self::$_instance = new self();
return self::$_instance;
}
public function whitelist_function($name)
{
if( ! in_array($name, $this->_whitelist) )
{
$this->_whitelist[] = $name;
return $name;
}
return false;
}
public function is_function_whitelisted($name)
{
if( in_array($name, $this->_whitelist) )
return true;
return false;
}
}
/**
* EOF
*/
================================================
FILE: classes/shortcodegenerator.php
================================================
<?php
class VP_ShortcodeGenerator
{
public static $pool = array();
public $name;
public $template;
public $modal_title = '';
public $button_title = '';
public $main_image;
public $sprite_image;
public $types;
public $include_pages;
public function __construct($arr)
{
$this->main_image = VP_PUBLIC_URL . '/img/vp_shortcode_icon.png';
$this->sprite_image = VP_PUBLIC_URL . '/img/vp_shortcode_icon_sprite.png';
$this->types = array( 'post', 'page' );
$this->included_pages = array();
if (is_array($arr))
{
foreach ($arr as $n => $v)
{
$this->$n = $v;
}
if (empty($this->name)) die('Unique name required');
if (empty($this->template)) die('Template array / path required');
}
if( is_string($this->template) and is_file($this->template) )
$this->template = include $this->template;
if(!empty($this->template))
{
$this->normalize();
add_action( 'current_screen', array($this, 'init_mce_plugin') );
}
self::$pool[$this->name] = $this;
}
function init_mce_plugin()
{
if( $this->can_output() )
{
// print modal dialog dom
add_action( 'admin_footer', array($this, 'print_modal') );
// populate scripts and styles dependencies
$loader = VP_WP_Loader::instance();
$loader->add_types( $this->get_field_types(), 'shortcodegenerator' );
}
}
function normalize()
{
if(is_array($this->template)) foreach ($this->template as &$shortcode)
{
foreach ($shortcode['elements'] as &$elements)
{
if(isset($elements['attributes'])) foreach ($elements['attributes'] as &$f)
{
if( $f['type'] === 'codeeditor' )
{
$f['type'] = 'textarea';
}
}
}
}
}
function get_field_types()
{
$field_types = array();
if(is_array($this->template)) foreach ($this->template as $shortcode)
{
foreach ($shortcode['elements'] as $elements)
{
if(isset($elements['attributes'])) foreach ($elements['attributes'] as $f)
{
if( ! in_array($f['type'], $field_types) )
{
$field_types[] = $f['type'];
}
}
}
}
return $field_types;
}
public static function get_pool()
{
return self::$pool;
}
public static function pool_supports_editor()
{
foreach (self::$pool as $sg)
{
if( $sg->supports_editor() )
{
return true;
}
}
return false;
}
public function supports_editor()
{
$post_type = VP_Metabox::_get_current_post_type();
$has_editor = post_type_supports( $post_type, 'editor' );
return $has_editor;
}
public static function pool_can_output()
{
foreach (self::$pool as $sg)
{
if( $sg->can_output() )
{
return true;
}
}
return false;
}
public function can_output()
{
$screen = '';
$can = true;
if( function_exists('get_current_screen') )
{
$screen = get_current_screen();
if( !is_null($screen) )
$screen = $screen->id;
}
// if in post / page
if( VP_Metabox::_is_post_or_page() )
{
// then consider the types
if( !in_array("*", $this->types) ) // if wildcard exists, then always shows
$can &= in_array(VP_Metabox::_get_current_post_type(), $this->types);
else
$can &= true;
}
else
{
// if not, only consider the screen id
if( !empty($screen) )
{
$can &= in_array($screen, $this->included_pages);
}
else
{
if( !is_admin() )
{
$can &= false;
}
}
}
return $can;
}
public function print_modal()
{
$modal_id = $this->name . '_modal';
?>
<div id="<?php echo $modal_id; ?>" class="vp-sc-dialog reveal-modal xlarge">
<h1><?php echo $this->modal_title; ?></h1>
<div class="vp-sc-scroll-container">
<div class="vp-sc-wrapper">
<ul class="vp-sc-menu">
<?php foreach ($this->template as $title => $menu): ?>
<?php if(reset($this->template) == $menu): ?>
<li class="current"><a href="#<?php echo str_replace(' ', '_', $title); ?>"><?php echo $title ?></li></a>
<?php else: ?>
<li><a href="#<?php echo str_replace(' ', '_', $title); ?>"><?php echo $title ?></li></a>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="vp-sc-main">
<?php foreach ($this->template as $title => $menu): ?>
<?php if (reset($this->template) == $menu) : ?>
<ul class="current vp-sc-sub-menu-list vp-sc-sub-menu-<?php echo str_replace(' ', '_', $title); ?>">
<?php else : ?>
<ul class="vp-hide vp-sc-sub-menu-list vp-sc-sub-menu-<?php echo str_replace(' ', '_', $title); ?>">
<?php endif; ?>
<?php foreach ($menu['elements'] as $name => $element): ?>
<li class="vp-sc-element postbox<?php if(isset($element['attributes'])) echo ' has-options'; ?><?php if(isset($element['active']) && $element['active'] == true) echo ' active'; ?>">
<h3 class="hndle vp-sc-element-heading">
<a href="#">
<?php echo $element['title']; ?>
<?php if(isset($element['attributes'])) echo '<i class="fa fa-arrow-down"></i>'; ?>
</a>
</h3>
<div class="hidden vp-sc-code"><?php echo htmlentities($element['code']); ?></div>
<?php if(isset($element['attributes']) and !empty($element['attributes'])): ?>
<form class="vp-sc-element-form <?php if(!isset($element['active']) || isset($element['active']) && $element['active'] == false):?>vp-hide<?php endif; ?> inside">
<?php echo $this->print_form($element['attributes']); ?>
</form>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endforeach; ?>
</div>
</div>
<a class="close-reveal-modal">×</a>
</div>
</div>
<?php
}
function print_form($attributes)
{
?>
<div class="vp-sc-fields">
<?php
foreach ($attributes as $attr)
{
// create the object
$make = VP_Util_Reflection::field_class_from_type($attr['type']);
// prefix name
$attr['name'] = '_' . $attr['name'];
$field = call_user_func("$make::withArray", $attr);
$default = $field->get_default();
if(!is_null($default))
$field->set_value($default);
?>
<?php if($attr['type'] !== 'notebox'): ?>
<div class="vp-sc-field vp-<?php echo $attr['type']; ?>" data-vp-type="vp-<?php echo $attr['type']; ?>">
<div class="label"><label><?php echo $attr['label']; ?></label></div>
<div class="field"><div class="input"><?php echo $field->render(true); ?></div></div>
</div>
<?php else: ?>
<?php $status = isset($attr['status']) ? $attr['status'] : 'normal'; ?>
<div class="vp-sc-field vp-<?php echo $attr['type']; ?> note-<?php echo $status; ?>" data-vp-type="vp-<?php echo $attr['type']; ?>">
<?php echo $field->render(true); ?>
</div>
<?php endif; ?>
<?php
}
?>
</div>
<div class="vp-sc-action">
<button class="vp-sc-insert button"><?php _e('Insert', 'vp_textdomain'); ?></button>
<button class="vp-sc-cancel button"><?php _e('Cancel', 'vp_textdomain') ?></button>
</div>
<?php
}
public static function build_localize()
{
$localize = array();
foreach (self::$pool as $sg)
{
$localize[] = array(
'name' => $sg->name,
'modal_title' => $sg->modal_title,
'button_title' => $sg->button_title,
'main_image' => $sg->main_image,
'sprite_image' => $sg->sprite_image,
);
}
return $localize;
}
public static function init_buttons()
{
if( VP_Metabox::_is_post_or_page() && !current_user_can( 'edit_posts' ) &&
!current_user_can( 'edit_pages' ) && get_user_option( 'rich_editing' ) == 'true')
return;
add_filter( 'mce_external_plugins' , array(__CLASS__, 'add_buttons') );
add_filter( 'mce_buttons' , array(__CLASS__, 'register_buttons') );
add_filter( 'wp_fullscreen_buttons', array(__CLASS__, 'fullscreen_buttons') );
add_filter( 'admin_print_styles' , array(__CLASS__, 'print_styles') );
}
public static function print_styles($buttons)
{
?>
<style type="text/css">
<?php foreach (self::$pool as $sg): ?>
#qt_content_<?php echo $sg->name; ?>{
background: url('<?php echo $sg->sprite_image; ?>') 2px -21px no-repeat !important;
text-indent: -999px;
}
span.mce_<?php echo $sg->name; ?>{
background: url('<?php echo $sg->sprite_image; ?>') 0 0 no-repeat !important;
}
<?php endforeach; ?>
</style>
<?php
}
public static function register_buttons($buttons)
{
foreach (self::$pool as $sg)
{
if( $sg->can_output() )
$vp_buttons[] = $sg->name;
}
$buttons = array_merge($buttons, $vp_buttons);
return $buttons;
}
public static function add_buttons($plugin_array)
{
$plugin_array['vp_sc_button'] = VP_PUBLIC_URL .'/js/shortcodes.js';
foreach (self::$pool as $sg)
{
if( $sg->can_output() )
$plugin_array[$sg->name] = VP_PUBLIC_URL .'/js/dummy.js';
}
return $plugin_array;
}
public static function fullscreen_buttons($buttons)
{
foreach (self::$pool as $sg)
{
if( $sg->can_output() )
{
// add a separator
$buttons[] = 'separator';
// format: title, onclick, show in both editors
$buttons[$sg->name] = array(
// Title of the button
'title' => $sg->button_title,
// Command to execute
'onclick' => "tinyMCE.execCommand('{$sg->name}_cmd');",
// Show on visual AND html mode
'both' => true
);
}
}
return $buttons;
}
public function get_shortcode_tags() {
$shortcodes = $this->template;
$tags = array();
foreach ($shortcodes as $menu) {
foreach ($menu['elements'] as $sc) {
$code = $sc['code'];
preg_match('/\[(\w+).*\]/', $code, $matches);
$tags[] = $matches[1];
}
}
return $tags;
}
}
/**
* EOF
*/
================================================
FILE: classes/site/googlewebfont.php
================================================
<?php
/**
* Singleton class to manage Google Web Fonts embedding,
* add the fonts with the weight and style
*
*/
class VP_Site_GoogleWebFont
{
private $_fonts = array();
private static $_instance = null;
public static function instance()
{
if(self::$_instance == null)
{
self::$_instance = new self();
}
return self::$_instance;
}
public function add($name, $weights = 'normal', $styles = 'normal', $subsets = null)
{
if(empty($name))
return;
$weights = (array) $weights;
$styles = (array) $styles;
$subsets = !empty($subsets) ? (array) $subsets : null;
$name = str_replace(' ', '+', $name);
if(!isset($this->_fonts[$name])) {
$this->_fonts[$name] = array();
$this->_fonts[$name]['atts'] = array();
$this->_fonts[$name]['subsets'] = array('latin');
}
foreach ($weights as $weight)
{
foreach ($styles as $style)
{
// set it to empty if style is equal to normal
if($style === 'normal')
$style = '';
if($style != '')
if($weight === 'normal') $weight = '';
// skip if both are empty
if($style === '' and $weight === '')
continue;
$couple = $weight . $style;
if(!in_array($couple, $this->_fonts[$name]['atts']))
$this->_fonts[$name]['atts'][] = $couple;
}
}
if(!empty($subsets))
{
$this->_fonts[$name]['subsets'] = array_merge($this->_fonts[$name]['subsets'], $subsets);
$this->_fonts[$name]['subsets'] = array_unique($this->_fonts[$name]['subsets']);
}
}
public function register()
{
$links = $this->get_font_links();
foreach ($links as $name => $link)
{
wp_register_style( $name, $link);
}
}
public function enqueue()
{
$names = $this->get_names();
foreach ($names as $name)
{
wp_enqueue_style( $name );
}
}
public function register_and_enqueue()
{
$this->register();
$this->enqueue();
}
public function get_font_links()
{
$links = array();
foreach ($this->_fonts as $name => $font)
{
$atts = $font['atts'];
$param = implode(',', $atts);
$link = "http://fonts.googleapis.com/css?family=$name" . ($param !== '' ? ":$param" : '');
if(!empty($font['subsets']))
{
$subsets = implode(',', $font['subsets']);
$link .= '&subset=' . $subsets;
}
$links[$name] = $link;
}
return $links;
}
public function get_fonts()
{
return $this->_fonts;
}
public function get_names()
{
return array_keys($this->_fonts);
}
}
/**
* EOF
*/
================================================
FILE: classes/util/array.php
================================================
<?php
class VP_Util_Array
{
public static function first($array)
{
if( !empty($array) and !is_null($array) )
{
return reset($array);
}
return null;
}
public static function deep_values($array, $the_key)
{
$result = array();
foreach ($array as $key => $value)
{
if (is_object($value))
{
$result[] = $value->$the_key;
}
elseif (is_array($value))
{
$result[] = $value[$the_key];
}
else
{
$result[] = $value;
}
}
return $result;
}
/**
* Combine array with the same $left to single array item
* from
* array( [0] => array( "name" => "a", "value" => "1" ),
* [1] => array( "name" => "a", "value" => "2" ),
* [0] => array( "name" => "b", "value" => "3" ))
* to
* array( "a" => array( "1", "2" ),
* "b" => 3)
* @param Array $array Array to unite
* @param Mixed $left Left side array key
* @param Mixed $right Right side array key
* @return Array United Array
*/
public static function unite($array, $left, $right)
{
$result = array();
if(is_array($array))
{
foreach ($array as $item)
{
if(isset($result[$item[$left]]))
{
if(is_array($result[$item[$left]]))
$result[$item[$left]][] = $item[$right];
else
$result[$item[$left]] = array($result[$item[$left]], $item[$right]);
}
else
{
$result[$item[$left]] = $item[$right];
}
}
}
return $result;
}
public static function array_merge_recursive_all($paArray1, $paArray2)
{
if (!is_array($paArray1) or !is_array($paArray2)) { return $paArray2; }
foreach ($paArray2 AS $sKey2 => $sValue2)
{
$paArray1[$sKey2] = self::array_merge_recursive_all(@$paArray1[$sKey2], $sValue2);
}
return $paArray1;
}
public static function array_replace_recursive($array, $array1)
{
if (!function_exists('array_replace_recursive'))
{
if(!function_exists('recurse'))
{
function recurse($array, $array1)
{
foreach ($array1 as $key => $value)
{
// create new key in $array, if it is empty or not an array
if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key])))
{
$array[$key] = array();
}
// overwrite the value in the base array
if (is_array($value))
{
$value = recurse($array[$key], $value);
}
$array[$key] = $value;
}
return $array;
}
}
// handle the arguments, merge one by one
$args = func_get_args();
$array = $args[0];
if (!is_array($array))
{
return $array;
}
for ($i = 1; $i < count($args); $i++)
{
if (is_array($args[$i]))
{
$array = recurse($array, $args[$i]);
}
}
return $array;
}
else
{
return array_replace_recursive($array, $array1);
}
}
}
/**
* EOF
*/
================================================
FILE: classes/util/config.php
================================================
<?php
/**
* Config files loader
*/
class VP_Util_Config
{
private static $_instance;
private $_configs;
private function __construct()
{
$this->_configs = array();
}
public static function instance()
{
if (is_null(self::$_instance))
{
self::$_instance = new self();
}
return self::$_instance;
}
public function load($config_name, $key = '')
{
// get the config, try to get in memory cache
if (array_key_exists($config_name, $this->_configs))
{
$config = $this->_configs[$config_name];
}
else
{
if(is_file(VP_CONFIG_DIR . '/'. $config_name . '.php'))
{
$config = require VP_CONFIG_DIR . '/'. $config_name . '.php';
}
else
{
throw new Exception("$config_name file not found.\n", 1);
}
// cache 'em
$this->_configs[$config_name] = $config;
}
// if key supplied, get the specific index of config array
$temp = $config;
if($key !== '')
{
$keys = explode('.', $key);
foreach ($keys as $key)
{
$temp = $temp[$key];
}
}
return $temp;
}
}
================================================
FILE: classes/util/profiler.php
================================================
<?php
class VP_Util_Profiler
{
public static function show_memtime()
{
$time_elapsed = microtime(true) - VP_START_TIME;
$mem_usage = memory_get_peak_usage() - VP_START_MEM;
$time_elapsed = round($time_elapsed, 4);
$mem_usage = round($mem_usage / pow(1024, 2), 3);
echo "Time Elapsed: " . $time_elapsed . ' s' . "<br/>";
echo "Mem Usage : " . $mem_usage . ' mb' . "<br/>";
}
}
================================================
FILE: classes/util/reflection.php
================================================
<?php
class VP_Util_Reflection
{
public static function is_multiselectable($object)
{
if(is_object($object))
{
if($object instanceof VP_MultiSelectable)
return true;
}
elseif(is_string($object))
{
$class = self::field_class_from_type($object);
if(function_exists('class_implements'))
{
if(class_exists($class))
{
$interfaces = class_implements($class);
if(isset($interfaces['VP_MultiSelectable']))
return true;
}
else
{
return false;
}
}
else
{
$dummy = new $class;
if($dummy instanceof VP_MultiSelectable)
return true;
unset($dummy);
}
}
return false;
}
public static function field_type_from_class($class)
{
$prefix = apply_filters('vp_field_type_from_class_prefix', array('VP_Control_Field_', 'VP_Option_Control_Field_'));
return strtolower(str_replace($prefix, '', $class));
}
public static function field_class_from_type($type)
{
// default prefix
$prefix = 'VP_Control_Field_';
// special case
if($type === 'impexp')
$prefix = 'VP_Option_Control_Field_';
$prefix = apply_filters( 'vp_field_class_from_type_prefix', $prefix, $type );
$class = $prefix . $type;
return $class;
}
}
================================================
FILE: classes/util/res.php
================================================
<?php
class VP_Util_Res
{
public static function is_font_awesome($icon)
{
if (strpos($icon, 'font-awesome:') === 0)
{
return trim(str_replace('font-awesome:', '', $icon));
}
return false;
}
public static function get_preview_from_url($url)
{
$preview = '';
$images = array('jpg', 'JPG', 'jpeg', 'bmp', 'gif', 'png', 'ico');
if(filter_var($url, FILTER_VALIDATE_URL) !== FALSE)
{
// check for extension, if it has extension then use it
$info = pathinfo($url);
if(isset($info['extension']))
{
if(in_array($info['extension'], $images))
{
$preview = $url;
}
else
{
$type = wp_ext2type( $info['extension'] );
if(is_null($type))
$type = 'default';
$preview = includes_url() . 'images/crystal/' . $type . '.png';
}
}
else
{
// if no extension, try to discover from mime
$mime = wp_remote_head( $url );
if(!is_wp_error( $mime ))
{
$mime = $mime['headers']['content-type'];
if(strpos($mime, 'image') === 0)
$preview = $url;
else
$preview = wp_mime_type_icon( $mime );
}
else
{
$preview = includes_url() . 'images/crystal/' . 'default' . '.png';
}
}
}
return $preview;
}
public static function img($url)
{
// empty parameter
if (empty($url)) {
return '';
}
// if already absolute, then just return
if (parse_url($url, PHP_URL_SCHEME))
{
return $url;
}
else
{
// check if got beginning slash
if ($url[0] == '/' or $url[0] == '\\')
{
return VP_IMAGE_URL . $url;
}
return VP_IMAGE_URL . '/' . $url;
}
}
public static function img_out($img, $default)
{
if (empty($img))
echo self::img($default);
else
echo self::img($img);
}
}
================================================
FILE: classes/util/text.php
================================================
<?php
class VP_Util_Text
{
public static function parse_md($text)
{
if(!class_exists('Parsedown'))
{
$path = VP_FileSystem::instance()->resolve_path('includes', 'parsedown');
require $path;
}
return Parsedown::instance()->parse($text);
}
public static function make_opt($optArray)
{
$optString = "";
foreach ($optArray as $key => $value)
{
$optString .= "(" . $key . ":" . $value . ")";
}
return $optString;
}
public static function print_if_exists($value, $format)
{
if (!empty($value))
{
if (is_array($value))
{
$value = implode($value, ', ');
}
call_user_func('printf', $format, $value);
}
}
public static function return_if_exists($value, $format)
{
$result = '';
if (!empty($value))
{
if (is_array($value))
{
$value = implode($value, ', ');
}
$result = call_user_func('sprintf', $format, $value);
}
return $result;
}
public static function out($string, $default)
{
if( empty($string) )
echo $default;
else
echo $string;
}
public static function prefix(&$item, $key, $prefix)
{
$item = $prefix . $item;
}
public static function prefix_array($array, $prefix)
{
array_walk( $array, 'VP_Util_Text::prefix', $prefix);
return $array;
}
public static function starts_with($haystack, $needle)
{
return !strncmp($haystack, $needle, strlen($needle));
}
public static function ends_with($haystack, $needle)
{
$length = strlen($needle);
if ($length == 0)
{
return true;
}
return (substr($haystack, -$length) === $needle);
}
public static function flanked_by($haystack, $left, $right = '')
{
if( $right == '' )
$right = $left;
return (self::starts_with($haystack, $left) and self::ends_with($haystack, $right));
}
}
================================================
FILE: classes/view.php
================================================
<?php
/**
* A Singleton class for loading view template
*/
class VP_View
{
/**
* Singleton instance of the class
* @var Option_View
*/
private static $_instance;
private $_views;
private function __construct()
{
$this->_views = array();
}
public static function instance()
{
if (is_null(self::$_instance))
{
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Load view file
* @param String $field_view_file Name of the view file
* @param Array $data Array of data to be binded on the view
* @return String The result view
*/
public function load($field_view_file, $data = array())
{
if (array_key_exists('field_view_file', $data))
{
throw new Exception("Sorry 'field_view_file' variable name can't be used.");
}
$view_file = VP_FileSystem::instance()->resolve_path('views', $field_view_file);
if($view_file === false)
{
throw new Exception("View file not found.");
}
extract($data);
ob_start();
include $view_file;
return ob_get_clean();
}
}
/**
* EOF
*/
================================================
FILE: classes/wp/admin.php
================================================
<?php
class VP_WP_Admin
{
/**
* [taken from WPAlchemy Class by Dimas Begunoff]
* Used to check if creating or editing a post or page
*
* @static
* @access private
* @return string "post" or "page"
*/
public static function is_post_or_page()
{
$post_type = self::get_current_post_type();
if (isset($post_type))
{
if ('page' == $post_type)
{
return 'page';
}
else
{
return 'post';
}
}
return NULL;
}
/**
* [taken from WPAlchemy Class by Dimas Begunoff]
* Used to check for the current post type, works when creating or editing a
* new post, page or custom post type.
*
* @static
* @return string [custom_post_type], page or post
*/
public static function get_current_post_type()
{
if(!class_exists('WPAlchemy_MetaBox'))
{
require_once VP_FileSystem::instance()->resolve_path('includes', 'wpalchemy/MetaBox');
}
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : NULL ;
if ( isset( $uri ) )
{
$uri_parts = parse_url($uri);
$file = basename($uri_parts['path']);
if ($uri AND in_array($file, array('post.php', 'post-new.php')))
{
$post_id = WPAlchemy_MetaBox::_get_post_id();
$post_type = isset($_GET['post_type']) ? $_GET['post_type'] : NULL ;
$post_type = $post_id ? get_post_type($post_id) : $post_type ;
if (isset($post_type))
{
return $post_type;
}
else
{
// because of the 'post.php' and 'post-new.php' checks above, we can default to 'post'
return 'post';
}
}
}
return NULL;
}
}
================================================
FILE: classes/wp/enqueuer.php
================================================
<?php
/**
* For singleton accessor, use VP_WP_MassEnqueuer class instead.
*/
class VP_WP_Enqueuer
{
private $_loaders = array();
private $_id;
public function __construct()
{
$this->_id = spl_object_hash($this);
$loader = new VP_WP_Loader();
add_action('vp_loader_register_' . $this->_id, array($loader, 'register'), 10, 2);
}
public function add_loader($loader)
{
$this->_loaders[] = $loader;
}
public function register()
{
add_action('admin_enqueue_scripts', array($this, 'register_caller'));
}
public function register_caller($hook_suffix)
{
do_action('vp_loader_register_' . $this->_id, $this->_loaders, $hook_suffix);
}
}
================================================
FILE: classes/wp/loader.php
================================================
<?php
class VP_WP_Loader
{
private static $_instance;
private $_js_data = array();
private $_css_data = array();
private $_localize = array();
private $_scripts;
private $_styles;
private $_dependencies;
private $_use_media_upload = false;
private $_use_wp_35_media_upload = false;
private $_types;
public static function instance()
{
if (is_null(self::$_instance))
{
self::$_instance = new self();
}
return self::$_instance;
}
private function __construct()
{
$this->_dependencies = apply_filters( 'vp_dependencies_array', VP_Util_Config::instance()->load('dependencies') );
$this->_types = array(
'option' => array(),
'metabox' => array(),
'shortcodegenerator' => array(),
);
}
public function build()
{
// get scripts and styles dependencies configs
$req_scripts = $this->_dependencies['scripts']['always'];
$req_styles = $this->_dependencies['styles']['always'];
$scripts = $this->_dependencies['scripts']['paths'];
$styles = $this->_dependencies['styles']['paths'];
$rules = $this->_dependencies['rules'];
$types = $this->get_flat_types();
// for all types build required scripts and styles array
foreach ($types as $type)
{
if( array_key_exists($type, $rules) )
{
$req_scripts = array_merge($req_scripts, $rules[$type]['js']);
$req_styles = array_merge($req_styles, $rules[$type]['css']);
}
}
// also determine whether to use media upload and the WP35 version or not
if( in_array('upload', $types) )
{
global $wp_version;
$this->_use_media_upload = true;
if (!version_compare($wp_version, '3.5', '<'))
{
$this->_use_wp_35_media_upload = true;
wp_enqueue_media();
}
}
// build localize data
$this->build_localize_data();
// register all depended js
foreach ($req_scripts as $script)
{
$this->js_unit_register($script);
}
// register and add shared-js at the end of dependencies
$this->js_unit_register('shared', $req_scripts);
// register all styles
foreach ($styles as $name => $style)
{
if(in_array($name, $req_styles) and ! wp_style_is($name, 'registered'))
wp_register_style($name, $style['path'], $style['deps']);
}
// register all mains
foreach ($this->_js_data as $name => $js)
{
// build main js localize
$localize = array();
foreach ($js['local_data'] as $datum)
{
if(array_key_exists($datum, $this->_localize))
{
$localize[$datum] = $this->_localize[$datum];
}
}
if( isset($js['custom_local']) )
{
$localize = array_merge( $localize, $js['custom_local'] );
}
$deps = array();
if( isset($js['deps']) ) $deps = $js['deps'];
$deps[] = 'shared';
foreach ($deps as $dep)
{
$this->js_unit_register($dep);
}
// register, enqueue and localized scripts
wp_register_script($name, $js['path'], $deps, '', true);
wp_localize_script($name, $js['local_name'], $localize);
wp_enqueue_script($name);
}
foreach ($this->_css_data as $name => $css)
{
foreach ($css['deps'] as $dep)
{
$this->css_unit_register($dep);
}
$req_styles = array_merge($req_styles, $css['deps']);
wp_register_style($name, $css['path'], $req_styles);
wp_enqueue_style($name);
}
do_action( 'vp_after_dependencies_loader_build' );
}
public function add_localize_data($key, $value)
{
$this->_localize[$key] = $value;
}
private function build_localize_data()
{
$messages = VP_Util_Config::instance()->load('messages');
$localize = array(
'use_upload' => $this->_use_media_upload,
'use_new_media_upload' => $this->_use_wp_35_media_upload,
'public_url' => VP_PUBLIC_URL,
'wp_include_url' => includes_url(),
'nonce' => wp_create_nonce( 'vafpress' ),
'val_msg' => $messages['validation'],
'util_msg' => $messages['util'],
'ctrl_msg' => $messages['control'],
// validatable data
'alphabet_validatable' => apply_filters( 'vp_alphabet_validatable' , array( 'vp-textbox', 'vp-textarea' ) ),
'alphanumeric_validatable' => apply_filters( 'vp_alphanumeric_validatable', array( 'vp-textbox', 'vp-textarea' ) ),
'numeric_validatable' => apply_filters( 'vp_numeric_validatable' , array( 'vp-textbox', 'vp-textarea' ) ),
'email_validatable' => apply_filters( 'vp_email_validatable' , array( 'vp-textbox', 'vp-textarea' ) ),
'url_validatable' => apply_filters( 'vp_url_validatable' , array( 'vp-textbox', 'vp-textarea' ) ),
'maxlength_validatable' => apply_filters( 'vp_maxlength_validatable' , array( 'vp-toggle', 'vp-radiobutton', 'vp-radioimage', 'vp-select' ) ),
'minlength_validatable' => apply_filters( 'vp_minlength_validatable' , array( 'vp-toggle', 'vp-radiobutton', 'vp-radioimage', 'vp-select' ) ),
);
$this->_localize = array_merge($this->_localize, $localize);
}
private function js_unit_register($name, $extra_deps = null)
{
global $wp_scripts;
$scripts = $this->_dependencies['scripts']['paths'];
if( isset($scripts[$name]) )
{
$registered = wp_script_is($name, 'registered');
$is_older = false;
$script = $scripts[$name];
$override = isset($script['override']) ? $script['override'] : false;
if( $registered )
{
$is_older = version_compare($script['ver'], $wp_scripts->registered[$name]->ver) == 1;
}
if( !$registered or ($is_older and $override) )
{
if( !is_null($extra_deps) )
{
$script['deps'] = array_unique( array_merge( $script['deps'], $extra_deps ) );
}
if( !empty($script['deps']) )
{
foreach ($script['deps'] as $dep)
{
$this->js_unit_register($dep);
}
}
if( $is_older )
{
wp_deregister_script($name);
}
wp_register_script($name, $script['path'], $script['deps'], $script['ver'], true);
if(isset($script['localize']))
{
$localize = array();
foreach ($script['localize']['keys'] as $key)
{
if(array_key_exists($key, $this->_localize))
{
$localize[$key] = $this->_localize[$key];
}
}
wp_localize_script($name, $script['localize']['name'], $localize);
}
}
}
}
private function css_unit_register($name, $extra_deps = null)
{
$styles = $this->_dependencies['styles']['paths'];
if( isset($styles[$name]) )
{
$style = $styles[$name];
if( !is_null($extra_deps) )
{
$style['deps'] = array_unique( array_merge( $style['deps'], $extra_deps ) );
}
if( !empty($style['deps']) )
{
foreach ($style['deps'] as $dep)
{
$this->css_unit_register($dep);
}
}
wp_register_style($name, $style['path'], $style['deps'], isset($style['ver']) ? $style['ver'] : false);
}
}
// how to setup the localization data?
public function add_js_data($js_name, $key, $data)
{
$this->add_data($js_name, $key, $data, 'js');
}
public function add_css_data($css_name, $key, $data)
{
$this->add_data($css_name, $key, $data, 'css');
}
public function add_data($name, $key, $data, $type)
{
$array_data = array();
if( $type === 'js' )
$array_data = array('local_data');
$var_name = '_' . $type . '_data';
if( in_array($key, $array_data) )
{
if( !isset($this->{$var_name}[$name][$key]) || !is_array($this->{$var_name}[$name][$key]) )
$this->{$var_name}[$name][$key] = array();
$this->{$var_name}[$name][$key] = array_unique(
array_merge(
$this->{$var_name}[$name][$key],
(array) $data
)
);
}
else
{
$keys = explode('.', $key);
$arr = &$this->{$var_name}[$name];
foreach ($keys as $key)
{
$arr = &$arr[$key];
}
$arr = $data;
}
}
// how to setup the main js and css data?
public function add_main_css($css)
{
if( is_string($css) )
{
$css_name = $css;
$deps = $this->_dependencies['styles']['paths'];
$css = $deps[$css_name];
}
else
{
$css_name = $css['name'];
}
if( isset($css['deps']) )
$this->add_css_data($css_name, 'deps', $css['deps']);
if( isset($css['path']) )
$this->add_css_data($css_name, 'path', $css['path']);
}
public function add_main_js($js)
{
if( is_string($js) )
{
$js_name = $js;
$deps = $this->_dependencies['scripts']['paths'];
$js = $deps[$js_name];
}
else
{
$js_name = $js['name'];
}
if( isset($js['localize']) and is_array($js['localize']) )
{
if( isset($js['localize']['name']) )
$this->add_js_data($js_name, 'local_name', $js['localize']['name']);
if( isset($js['localize']['keys']) and is_array($js['localize']['keys']) )
$this->add_js_data($js_name, 'local_data', $js['localize']['keys']);
}
if( isset($js['path']) )
$this->add_js_data($js_name, 'path', $js['path']);
if( isset($js['deps']) )
$this->add_js_data($js_name, 'deps', $js['deps']);
}
// option class added their types to this
public function add_types($types, $key)
{
$types = (array) $types;
$this->_types[$key] = array_unique( array_merge( $this->_types[$key], $types ) );
}
public function get_types($key = null)
{
if( is_null($key) )
return $this->_types;
else
return $this->_types[$key];
}
public function get_flat_types()
{
$flat_types = array();
foreach ($this->_types as $types)
{
$flat_types = array_unique( array_merge( $flat_types, $types ) );
}
return $flat_types;
}
}
/**
* EOF
*/
================================================
FILE: classes/wp/massenqueuer.php
================================================
<?php
/**
* For singleton accessor, use VP_WP_MassEnqueuer class instead.
*/
class VP_WP_MassEnqueuer
{
private static $_instance = null;
public static function instance()
{
if(self::$_instance == null)
{
self::$_instance = new VP_WP_Enqueuer();
}
return self::$_instance;
}
}
================================================
FILE: classes/wp/user.php
================================================
<?php
class VP_WP_User
{
public static function get_users()
{
global $wpdb;
if(function_exists('get_users'))
{
$wp_users = get_users();
$result = array();
foreach ($wp_users as $user)
{
if( property_exists( $user, 'data' ) )
$user = $user->data;
$result[] = array('id' => $user->ID, 'display_name' => $user->display_name);
}
}
else
{
$wp_user_search = $wpdb->get_results("SELECT ID, display_name FROM $wpdb->users ORDER BY ID");
foreach ( $wp_user_search as $userid )
{
$user_id = (int) $userid->ID;
$display_name = stripslashes($userid->display_name);
$result[] = array('id' => $user_id, 'display_name' => $display_name);
}
}
return $result;
}
public static function get_editable_roles()
{
global $wp_roles;
if(!isset($wp_roles))
{
$wp_roles = new WP_Roles();
}
$all_roles = $wp_roles->roles;
$editable_roles = apply_filters('editable_roles', $all_roles);
return $editable_roles;
}
}
================================================
FILE: classes/wp/util.php
================================================
<?php
class VP_WP_Util
{
public static function kses_html($html)
{
if( function_exists('wp_kses_allowed_html') ) {
$allowed_post_html = wp_kses_allowed_html( 'post' );
}
else {
global $allowedposttags;
$allowed_post_html = $allowedposttags;
}
$allow = array_merge($allowed_post_html, array(
'link' => array(
'href' => true,
'rel' => true,
'type' => true,
),
'style' => array(
'type' => true,
),
));
return wp_kses($html, $allow);
}
public static function admin_notice($message, $is_error = false)
{
if ($is_error)
echo '<div class="error">';
else
echo '<div class="updated">';
echo "<p><strong>$message</strong></p></div>";
}
}
================================================
FILE: config/dependencies.php
================================================
<?php
return array(
////////////////////////////////////////////////
// Scripts and Styles Dependencies Definition //
////////////////////////////////////////////////
/**
* jQuery UI Theme
*/
'jqui_theme' => ($jqui_theme = 'smoothness'),
/**
* Scripts.
*/
'scripts' => array(
'always' => array('jquery', 'scrollspy', 'tipsy', 'jquery-typing'),
'paths' => array(
'jquery' => array(
'path' => '',
'deps' => array(),
'ver' => '1.8.3',
'override' => false,
),
'bootstrap-colorpicker' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/bootstrap-colorpicker.js',
'deps' => array('jquery'),
'ver' => false,
),
'tipsy' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/jquery.tipsy.js',
'deps' => array('jquery'),
'ver' => '1.0.0a'
),
'scrollspy' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/jquery-scrollspy.js',
'deps' => array('jquery'),
'ver' => false,
),
'jquery-ui-core' => array(
'path' => '',
'deps' => array(),
'ver' => '1.9.2',
),
'jquery-ui-widget' => array(
'path' => '',
'deps' => array(),
'ver' => '1.9.2',
),
'jquery-ui-mouse' => array(
'path' => '',
'deps' => array('jquery-ui-widget'),
'ver' => '1.9.2',
),
'jquery-ui-slider' => array(
'path' => '',
'deps' => array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse'),
'ver' => '1.9.2',
),
'jquery-ui-datepicker' => array(
'path' => '',
'deps' => array('jquery', 'jquery-ui-core', 'jquery-ui-widget'),
'ver' => '1.9.2',
),
'jquery-typing' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/jquery.typing-0.2.0.min.js',
'deps' => array('jquery'),
'ver' => '0.2',
),
'ace-editor' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/ace/ace.js',
'deps' => array(),
'ver' => '1.0.0',
),
'select2' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/select2.min.js',
'deps' => array('jquery'),
'ver' => '3.3.2',
'override' => true,
),
'select2-sortable' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/select2.sortable.js',
'deps' => array('jquery', 'jquery-ui-sortable', 'select2'),
'ver' => '1.0.0',
'override' => true,
),
'reveal' => array(
'path' => VP_PUBLIC_URL . '/js/vendor/jquery.reveal.js',
'deps' => array('jquery'),
'ver' => '1.0.0',
),
'kia-metabox' => array(
'path' => VP_PUBLIC_URL . '/js/kia-metabox.js',
'deps' => array('jquery', 'editor'),
'ver' => '1.0',
'override' => true,
),
'shared' => array(
'path' => VP_PUBLIC_URL . '/js/shared.min.js',
'deps' => array(),
'ver' => '1.1',
'localize' => array(
'name' => 'vp_wp',
'keys' => array(
'use_upload', 'use_new_media_upload', 'public_url', 'wp_include_url', 'val_msg', 'ctrl_msg',
'alphabet_validatable', 'alphanumeric_validatable', 'numeric_validatable', 'email_validatable',
'url_validatable', 'maxlength_validatable', 'minlength_validatable'
)
)
),
'vp-option' => array(
'path' => VP_PUBLIC_URL . '/js/option.min.js',
'deps' => array(),
'ver' => '2.0',
'localize' => array(
'name' => 'vp_opt',
'keys' => array(
'util_msg', 'nonce'
)
)
),
'vp-metabox' => array(
'path' => VP_PUBLIC_URL . '/js/metabox.min.js',
'deps' => array(),
'ver' => '2.0',
'localize' => array(
'name' => 'vp_mb',
'keys' => array(
'use_upload', 'use_new_media_upload'
)
)
),
'vp-shortcode-qt' => array(
'path' => VP_PUBLIC_URL . '/js/shortcode-quicktags.js',
'deps' => array('reveal'),
'ver' => '1.0.0',
),
'vp-shortcode' => array(
'path' => VP_PUBLIC_URL . '/js/shortcode-menu.js',
'deps' => array('reveal', 'vp-shortcode-qt'),
'ver' => '2.0',
'localize' => array(
'name' => 'vp_ext_sc',
'keys' => array(
'use_upload', 'use_new_media_upload', 'public_url'
)
)
),
),
),
/**
* Styles.
*/
'styles' => array(
'always' => array('tipsy', 'font-awesome'),
'paths' => array(
'bootstrap-colorpicker' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/bootstrap-colorpicker.css',
'deps' => array(),
),
'tipsy' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/tipsy.css',
'deps' => array(),
),
'jqui' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/jqueryui/themes/' . $jqui_theme . '/jquery-ui-1.9.2.custom.min.css',
'deps' => array(),
),
'font-awesome' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/font-awesome.min.css',
'deps' => array(),
),
'select2' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/select2.css',
'deps' => array(),
),
'reveal' => array(
'path' => VP_PUBLIC_URL . '/css/vendor/reveal.css',
'deps' => array(),
),
'vp-option' => array(
'path' => VP_PUBLIC_URL . '/css/option.min.css',
'deps' => array(),
),
'vp-metabox' => array(
'path' => VP_PUBLIC_URL . '/css/metabox.min.css',
'deps' => array(),
),
'vp-shortcode' => array(
'path' => VP_PUBLIC_URL . '/css/shortcode.min.css',
'deps' => array('reveal'),
),
),
),
/**
* Rules for dynamic loading of dependencies, load only what needed.
*/
'rules' => array(
'color' => array( 'js' => array('bootstrap-colorpicker'), 'css' => array('bootstrap-colorpicker') ),
'select' => array( 'js' => array('select2'), 'css' => array('select2') ),
'multiselect' => array( 'js' => array('select2'), 'css' => array('select2') ),
'slider' => array( 'js' => array('jquery-ui-slider'), 'css' => array('jqui') ),
'date' => array( 'js' => array('jquery-ui-datepicker'), 'css' => array('jqui') ),
'codeeditor' => array( 'js' => array('ace-editor'), 'css' => array() ),
'sorter' => array( 'js' => array('select2-sortable'), 'css' => array('select2', 'jqui') ),
'fontawesome' => array( 'js' => array('select2'), 'css' => array('select2') ),
'wpeditor' => array( 'js' => array('kia-metabox'), 'css' => array() ),
)
);
/**
* EOF
*/
================================================
FILE: config/messages.php
================================================
<?php
return array(
////////////////////////////////////////
// Localized JS Message Configuration //
////////////////////////////////////////
/**
* Validation Messages
*/
'validation' => array(
'alphabet' => __('Value needs to be Alphabet', 'vp_textdomain'),
'alphanumeric' => __('Value needs to be Alphanumeric', 'vp_textdomain'),
'numeric' => __('Value needs to be Numeric', 'vp_textdomain'),
'email' => __('Value needs to be Valid Email', 'vp_textdomain'),
'url' => __('Value needs to be Valid URL', 'vp_textdomain'),
'maxlength' => __('Length needs to be less than {0} characters', 'vp_textdomain'),
'minlength' => __('Length needs to be more than {0} characters', 'vp_textdomain'),
'maxselected' => __('Select no more than {0} items', 'vp_textdomain'),
'minselected' => __('Select at least {0} items', 'vp_textdomain'),
'required' => __('This is required', 'vp_textdomain'),
),
/**
* Import / Export Messages
*/
'util' => array(
'import_success' => __('Import succeed, option page will be refreshed..', 'vp_textdomain'),
'import_failed' => __('Import failed', 'vp_textdomain'),
'export_success' => __('Export succeed, copy the JSON formatted options', 'vp_textdomain'),
'export_failed' => __('Export failed', 'vp_textdomain'),
'restore_success' => __('Restoration succeed, option page will be refreshed..', 'vp_textdomain'),
'restore_nochanges' => __('Options identical to default', 'vp_textdomain'),
'restore_failed' => __('Restoration failed', 'vp_textdomain'),
),
/**
* Control Fields String
*/
'control' => array(
// select2 select box
'select2_placeholder' => __('Select option(s)', 'vp_textdomain'),
// fontawesome chooser
'fac_placeholder' => __('Select an Icon', 'vp_textdomain'),
),
);
/**
* EOF
*/
================================================
FILE: constant.php
================================================
<?php
/*
|--------------------------------------------------------------------------
| Vafpress Framework Constants
|--------------------------------------------------------------------------
*/
defined('VP_VERSION') or define('VP_VERSION' , '2.0-beta');
defined('VP_NAMESPACE') or define('VP_NAMESPACE' , 'VP_');
defined('VP_DIR') or define('VP_DIR' , untrailingslashit(dirname(__FILE__)));
defined('VP_DIR_NAME') or define('VP_DIR_NAME' , basename(VP_DIR));
defined('VP_IMAGE_DIR') or define('VP_IMAGE_DIR' , VP_DIR . '/public/img');
defined('VP_CONFIG_DIR') or define('VP_CONFIG_DIR' , VP_DIR . '/config');
defined('VP_DATA_DIR') or define('VP_DATA_DIR' , VP_DIR . '/data');
defined('VP_CLASSES_DIR') or define('VP_CLASSES_DIR', VP_DIR . '/classes');
defined('VP_VIEWS_DIR') or define('VP_VIEWS_DIR' , VP_DIR . '/views');
defined('VP_INCLUDE_DIR') or define('VP_INCLUDE_DIR', VP_DIR . '/includes');
// get and normalize framework dirname
$dirname = str_replace('\\' ,'/', dirname(__FILE__)); // standardize slash
$dirname = preg_replace('|/+|', '/', $dirname); // normalize duplicate slash
// get and normalize WP content directory
$wp_content_dir = str_replace( '\\', '/', WP_CONTENT_DIR ); // standardize slash
// build relative url
$relative_url = str_replace($wp_content_dir, "", $dirname);
// finally framework base url
$vp_url = content_url() . $relative_url;
defined('VP_URL') or define('VP_URL' , untrailingslashit($vp_url));
defined('VP_PUBLIC_URL') or define('VP_PUBLIC_URL' , VP_URL . '/public');
defined('VP_IMAGE_URL') or define('VP_IMAGE_URL' , VP_PUBLIC_URL . '/img');
defined('VP_INCLUDE_URL') or define('VP_INCLUDE_URL', VP_URL . '/includes');
// Get the start time and memory usage for profiling
defined('VP_START_TIME') or define('VP_START_TIME', microtime(true));
defined('VP_START_MEM') or define('VP_START_MEM', memory_get_usage());
/**
* EOF
*/
================================================
FILE: credits.txt
================================================
Metabox Support:
- WPAlchemy MetaBox PHP Class
by Dimas Begunoff
http://www.farinspace.com/wpalchemy-metabox/
- Multiple WYSIWYG
by Kathy (helgatheviking)
http://www.kathyisawesome.com/426/multiple-wordpress-wysiwyg-visual-editors/
Icons:
- FontAwesome
by Dave Gandy
http://fortawesome.github.com/Font-Awesome/
================================================
FILE: data/gwf.json
================================================
{"ABeeZee":{"weights":["normal"],"styles":["normal","italic"],"subsets":["latin"]},"Abel":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Abril Fatface":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Aclonica":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Acme":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Actor":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Adamina":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Advent Pro":{"weights":["normal","100","200","300","500","600","700"],"styles":["normal"],"subsets":["greek","latin-ext","latin"]},"Aguafina Script":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Akronim":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Aladin":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Aldrich":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Alef":{"weights":["normal","700"],"styles":["normal"],"subsets":["latin"]},"Alegreya":{"weights":["normal","700","900"],"styles":["normal","italic"],"subsets":["latin-ext","latin"]},"Alegreya SC":{"weights":["normal","700","900"],"styles":["normal","italic"],"subsets":["latin-ext","latin"]},"Alegreya Sans":{"weights":["normal","100","300","500","700","800","900"],"styles":["normal","italic"],"subsets":["latin-ext","vietnamese","latin"]},"Alegreya Sans SC":{"weights":["normal","100","300","500","700","800","900"],"styles":["normal","italic"],"subsets":["latin-ext","vietnamese","latin"]},"Alex Brush":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Alfa Slab One":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Alice":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Alike":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Alike Angular":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Allan":{"weights":["normal","700"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Allerta":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Allerta Stencil":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Allura":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Almendra":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["latin-ext","latin"]},"Almendra Display":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Almendra SC":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Amarante":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Amaranth":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["latin"]},"Amatic SC":{"weights":["normal","700"],"styles":["normal"],"subsets":["latin"]},"Amethysta":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Anaheim":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Andada":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Andika":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","cyrillic","latin","cyrillic-ext"]},"Angkor":{"weights":["normal"],"styles":["normal"],"subsets":["khmer"]},"Annie Use Your Telescope":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Anonymous Pro":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["greek","greek-ext","latin-ext","cyrillic","latin","cyrillic-ext"]},"Antic":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Antic Didone":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Antic Slab":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Anton":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Arapey":{"weights":["normal"],"styles":["normal","italic"],"subsets":["latin"]},"Arbutus":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Arbutus Slab":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Architects Daughter":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Archivo Black":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Archivo Narrow":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["latin-ext","latin"]},"Arimo":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["greek","greek-ext","latin-ext","cyrillic","vietnamese","latin","cyrillic-ext"]},"Arizonia":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Armata":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Artifika":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Arvo":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["latin"]},"Asap":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["latin-ext","latin"]},"Asset":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Astloch":{"weights":["normal","700"],"styles":["normal"],"subsets":["latin"]},"Asul":{"weights":["normal","700"],"styles":["normal"],"subsets":["latin"]},"Atomic Age":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Aubrey":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Audiowide":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Autour One":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Average":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Average Sans":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Averia Gruesa Libre":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Averia Libre":{"weights":["normal","300","700"],"styles":["normal","italic"],"subsets":["latin"]},"Averia Sans Libre":{"weights":["normal","300","700"],"styles":["normal","italic"],"subsets":["latin"]},"Averia Serif Libre":{"weights":["normal","300","700"],"styles":["normal","italic"],"subsets":["latin"]},"Bad Script":{"weights":["normal"],"styles":["normal"],"subsets":["cyrillic","latin"]},"Balthazar":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Bangers":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Basic":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Battambang":{"weights":["normal","700"],"styles":["normal"],"subsets":["khmer"]},"Baumans":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Bayon":{"weights":["normal"],"styles":["normal"],"subsets":["khmer"]},"Belgrano":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Belleza":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"BenchNine":{"weights":["normal","300","700"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Bentham":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Berkshire Swash":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Bevan":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Bigelow Rules":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Bigshot One":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Bilbo":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Bilbo Swash Caps":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Bitter":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["latin-ext","latin"]},"Black Ops One":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Bokor":{"weights":["normal"],"styles":["normal"],"subsets":["khmer"]},"Bonbon":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Boogaloo":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Bowlby One":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Bowlby One SC":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Brawler":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Bree Serif":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Bubblegum Sans":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Bubbler One":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Buda":{"weights":["normal","300"],"styles":["normal"],"subsets":["latin"]},"Buenard":{"weights":["normal","700"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Butcherman":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Butterfly Kids":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Cabin":{"weights":["normal","500","600","700"],"styles":["normal","italic"],"subsets":["latin"]},"Cabin Condensed":{"weights":["normal","500","600","700"],"styles":["normal"],"subsets":["latin"]},"Cabin Sketch":{"weights":["normal","700"],"styles":["normal"],"subsets":["latin"]},"Caesar Dressing":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Cagliostro":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Calligraffitti":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Cambo":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Candal":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Cantarell":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["latin"]},"Cantata One":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Cantora One":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Capriola":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Cardo":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["greek","greek-ext","latin-ext","latin"]},"Carme":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Carrois Gothic":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Carrois Gothic SC":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Carter One":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Caudex":{"weights":["normal","700"],"styles":["normal","italic"],"subsets":["greek","greek-ext","latin-ext","latin"]},"Cedarville Cursive":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Ceviche One":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Changa One":{"weights":["normal"],"styles":["normal","italic"],"subsets":["latin"]},"Chango":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Chau Philomene One":{"weights":["normal"],"styles":["normal","italic"],"subsets":["latin-ext","latin"]},"Chela One":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Chelsea Market":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Chenla":{"weights":["normal"],"styles":["normal"],"subsets":["khmer"]},"Cherry Cream Soda":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Cherry Swash":{"weights":["normal","700"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Chewy":{"weights":["normal"],"styles":["normal"],"subsets":["latin"]},"Chicle":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Chivo":{"weights":["normal","900"],"styles":["normal","italic"],"subsets":["latin"]},"Cinzel":{"weights":["normal","700","900"],"styles":["normal"],"subsets":["latin"]},"Cinzel Decorative":{"weights":["normal","700","900"],"styles":["normal"],"subsets":["latin"]},"Clicker Script":{"weights":["normal"],"styles":["normal"],"subsets":["latin-ext","latin"]},"Coda":{"weights":["normal","800"],"styles":["normal"],"subsets":["latin"]},"Coda Caption":{"weights":["normal","800"],"styles":["normal"],"subsets":["latin"]},"Codystar":{"weights":["normal","300"],
gitextract_z9yzb05m/
├── .gitignore
├── LICENSE
├── README.md
├── autoload.php
├── bootstrap.php
├── classes/
│ ├── control/
│ │ ├── field/
│ │ │ ├── checkbox.php
│ │ │ ├── checkimage.php
│ │ │ ├── codeeditor.php
│ │ │ ├── color.php
│ │ │ ├── date.php
│ │ │ ├── fontawesome.php
│ │ │ ├── html.php
│ │ │ ├── item/
│ │ │ │ └── generic.php
│ │ │ ├── multiselect.php
│ │ │ ├── notebox.php
│ │ │ ├── radiobutton.php
│ │ │ ├── radioimage.php
│ │ │ ├── select.php
│ │ │ ├── slider.php
│ │ │ ├── sorter.php
│ │ │ ├── textarea.php
│ │ │ ├── textbox.php
│ │ │ ├── toggle.php
│ │ │ ├── upload.php
│ │ │ └── wpeditor.php
│ │ ├── field.php
│ │ ├── fieldmulti.php
│ │ └── fieldmultiimage.php
│ ├── filesystem.php
│ ├── metabox/
│ │ ├── alchemy.php
│ │ └── depsloader.php
│ ├── metabox.php
│ ├── multiselectable.php
│ ├── option/
│ │ ├── control/
│ │ │ ├── field/
│ │ │ │ ├── impexp.php
│ │ │ │ └── restore.php
│ │ │ ├── group/
│ │ │ │ ├── menu.php
│ │ │ │ └── section.php
│ │ │ ├── group.php
│ │ │ └── set.php
│ │ ├── depsloader.php
│ │ └── parser.php
│ ├── option.php
│ ├── security.php
│ ├── shortcodegenerator.php
│ ├── site/
│ │ └── googlewebfont.php
│ ├── util/
│ │ ├── array.php
│ │ ├── config.php
│ │ ├── profiler.php
│ │ ├── reflection.php
│ │ ├── res.php
│ │ └── text.php
│ ├── view.php
│ └── wp/
│ ├── admin.php
│ ├── enqueuer.php
│ ├── loader.php
│ ├── massenqueuer.php
│ ├── user.php
│ └── util.php
├── config/
│ ├── dependencies.php
│ └── messages.php
├── constant.php
├── credits.txt
├── data/
│ ├── gwf.json
│ └── sources.php
├── includes/
│ ├── parsedown.php
│ └── wpalchemy/
│ └── MetaBox.php
├── lang/
│ ├── README.md
│ ├── de_DE.mo
│ ├── es_ES.mo
│ ├── id_ID.mo
│ ├── ja_JP.mo
│ ├── nl_NL.mo
│ ├── pl_PL.mo
│ ├── tr_TR.mo
│ └── vafpress-framework.pot
├── public/
│ ├── css/
│ │ ├── metabox.css
│ │ ├── option.css
│ │ ├── shortcode.css
│ │ └── vendor/
│ │ ├── bootstrap-colorpicker.css
│ │ ├── colorpicker.css
│ │ ├── jqueryui/
│ │ │ └── themes/
│ │ │ └── smoothness/
│ │ │ └── jquery-ui-1.9.2.custom.css
│ │ ├── reveal.css
│ │ ├── select2.css
│ │ └── tipsy.css
│ ├── font/
│ │ └── FontAwesome.otf
│ └── js/
│ ├── dummy.js
│ ├── kia-metabox.js
│ ├── metabox.js
│ ├── option.js
│ ├── shared.js
│ ├── shortcode-menu.js
│ ├── shortcode-quicktags.js
│ ├── shortcodes.js
│ └── vendor/
│ ├── ace/
│ │ ├── ace.js
│ │ ├── mode-css.js
│ │ ├── mode-html.js
│ │ ├── mode-javascript.js
│ │ ├── mode-json.js
│ │ ├── mode-markdown.js
│ │ ├── mode-php.js
│ │ ├── mode-xml.js
│ │ ├── theme-chaos.js
│ │ ├── theme-chrome.js
│ │ ├── theme-clouds.js
│ │ ├── theme-clouds_midnight.js
│ │ ├── theme-cobalt.js
│ │ ├── theme-crimson_editor.js
│ │ ├── theme-dawn.js
│ │ ├── theme-dreamweaver.js
│ │ ├── theme-eclipse.js
│ │ ├── theme-github.js
│ │ ├── theme-mono_industrial.js
│ │ ├── theme-monokai.js
│ │ ├── theme-solarized_dark.js
│ │ ├── theme-solarized_light.js
│ │ ├── theme-textmate.js
│ │ ├── theme-twilight.js
│ │ ├── worker-css.js
│ │ ├── worker-javascript.js
│ │ ├── worker-json.js
│ │ └── worker-php.js
│ ├── bootstrap-colorpicker.js
│ ├── jquery-scrollspy.js
│ ├── jquery.reveal.js
│ ├── jquery.tipsy.js
│ └── select2.sortable.js
└── views/
├── control/
│ ├── checkbox.php
│ ├── checkimage.php
│ ├── codeeditor.php
│ ├── color.php
│ ├── date.php
│ ├── fontawesome.php
│ ├── html.php
│ ├── multiselect.php
│ ├── notebox.php
│ ├── radiobutton.php
│ ├── radioimage.php
│ ├── select.php
│ ├── slider.php
│ ├── sorter.php
│ ├── template_control_foot.php
│ ├── template_control_head.php
│ ├── textarea.php
│ ├── textbox.php
│ ├── toggle.php
│ ├── upload.php
│ └── wpeditor.php
└── option/
├── impexp.php
├── menu.php
├── restore.php
├── section.php
└── set.php
SYMBOL INDEX (811 symbols across 73 files)
FILE: autoload.php
class VP_AutoLoader (line 16) | class VP_AutoLoader
method load (line 46) | public static function load($class)
method discover_namespace (line 89) | public static function discover_namespace($key)
method register (line 108) | public static function register()
method add_namespaces (line 122) | public static function add_namespaces($namespaces)
method sort (line 132) | private static function sort($a, $b)
method add_directories (line 146) | public static function add_directories($directories, $namespace)
method remove_directories (line 163) | public static function remove_directories($directories = null, $namesp...
method normalize_class (line 196) | public static function normalize_class($class, $namespace)
method get_directories (line 210) | public static function get_directories()
FILE: bootstrap.php
function vp_tgm_ac_check (line 45) | function vp_tgm_ac_check()
function vp_tgm_ac_vafpress_check (line 53) | function vp_tgm_ac_vafpress_check()
function vp_ajax_wrapper (line 75) | function vp_ajax_wrapper()
function vp_ace_script_attributes (line 120) | function vp_ace_script_attributes( $url )
function vp_metabox_enqueue (line 131) | function vp_metabox_enqueue()
function vp_sg_enqueue (line 144) | function vp_sg_enqueue()
function vp_post_dummy_editor (line 165) | function vp_post_dummy_editor()
function vp_sg_init_buttons (line 204) | function vp_sg_init_buttons()
function vp_enqueue_scripts (line 215) | function vp_enqueue_scripts()
function vp_metabox (line 234) | function vp_metabox($key, $default = null, $post_id = null)
function vp_option (line 302) | function vp_option($key, $default = null)
FILE: classes/control/field.php
class VP_Control_Field (line 6) | abstract class VP_Control_Field implements iFactory
method __construct (line 83) | public function __construct()
method render (line 89) | abstract public function render();
method _setup_data (line 95) | protected function _setup_data()
method _basic_make (line 130) | protected function _basic_make($arr)
method add_data (line 159) | public function add_data($key, $value)
method get_data (line 169) | public function get_data() {
method set_data (line 178) | public function set_data($_data) {
method set_single_data (line 188) | public function set_single_data($key, $_data) {
method get_single_data (line 198) | public function get_single_data($key) {
method add_single_data (line 206) | public function add_single_data($p_key, $key, $value)
method get_name (line 216) | public function get_name() {
method set_name (line 225) | public function set_name($_name) {
method get_label (line 235) | public function get_label() {
method set_label (line 244) | public function set_label($_label) {
method get_description (line 254) | public function get_description() {
method set_description (line 263) | public function set_description($_description) {
method get_validation (line 273) | public function get_validation() {
method set_validation (line 282) | public function set_validation($_validation) {
method get_dependency (line 292) | public function get_dependency() {
method set_dependency (line 301) | public function set_dependency($_dependency) {
method get_binding (line 311) | public function get_binding() {
method set_binding (line 320) | public function set_binding($_binding) {
method get_default (line 330) | public function get_default() {
method set_default (line 339) | public function set_default($_default) {
method get_value (line 349) | public function get_value() {
method set_value (line 358) | public function set_value($_value) {
method get_field_max_height (line 368) | public function get_field_max_height() {
method set_field_max_height (line 377) | public function set_field_max_height($_field_max_height) {
method get_container_extra_classes (line 387) | public function get_container_extra_classes() {
method set_container_extra_classes (line 396) | public function set_container_extra_classes($_container_extra_classes) {
method add_container_extra_classes (line 401) | public function add_container_extra_classes($class)
method is_hidden (line 420) | public function is_hidden($_is_hidden = null) {
type iFactory (line 432) | interface iFactory
method withArray (line 434) | static function withArray($arr = array(), $class_name = null);
FILE: classes/control/field/checkbox.php
class VP_Control_Field_CheckBox (line 3) | class VP_Control_Field_CheckBox extends VP_Control_FieldMulti implements...
method __construct (line 6) | public function __construct()
method withArray (line 13) | public static function withArray($arr = array(), $class_name = null)
method render (line 23) | public function render($is_compact = false)
FILE: classes/control/field/checkimage.php
class VP_Control_Field_CheckImage (line 3) | class VP_Control_Field_CheckImage extends VP_Control_FieldMultiImage imp...
method __construct (line 6) | public function __construct()
method withArray (line 13) | public static function withArray($arr = array(), $class_name = null)
method render (line 23) | public function render($is_compact = false)
FILE: classes/control/field/codeeditor.php
class VP_Control_Field_CodeEditor (line 3) | class VP_Control_Field_CodeEditor extends VP_Control_Field
method __construct (line 21) | public function __construct()
method withArray (line 26) | public static function withArray($arr = array(), $class_name = null)
method _setup_data (line 40) | protected function _setup_data()
method render (line 50) | public function render($is_compact = false)
method set_value (line 57) | public function set_value($_value)
method get_editor_mode (line 73) | public function get_editor_mode() {
method set_editor_mode (line 82) | public function set_editor_mode($_mode) {
method get_editor_theme (line 93) | public function get_editor_theme() {
method set_editor_theme (line 102) | public function set_editor_theme($_theme) {
FILE: classes/control/field/color.php
class VP_Control_Field_Color (line 3) | class VP_Control_Field_Color extends VP_Control_Field
method __construct (line 8) | public function __construct()
method withArray (line 13) | public static function withArray($arr = array(), $class_name = null)
method _basic_make (line 24) | protected function _basic_make($arr)
method _setup_data (line 29) | protected function _setup_data()
method render (line 39) | public function render($is_compact = false)
method get_format (line 51) | public function get_format() {
method set_format (line 60) | public function set_format($_format) {
FILE: classes/control/field/date.php
class VP_Control_Field_Date (line 3) | class VP_Control_Field_Date extends VP_Control_Field
method __construct (line 12) | public function __construct()
method withArray (line 17) | public static function withArray($arr = array(), $class_name = null)
method _setup_data (line 30) | protected function _setup_data()
method render (line 42) | public function render($is_compact = false)
method get_min_date (line 55) | public function get_min_date() {
method set_min_date (line 64) | public function set_min_date($_min_date) {
method get_max_date (line 74) | public function get_max_date() {
method set_max_date (line 83) | public function set_max_date($_max_date) {
method get_format (line 94) | public function get_format() {
method set_format (line 103) | public function set_format($_format) {
FILE: classes/control/field/fontawesome.php
class VP_Control_Field_Fontawesome (line 3) | class VP_Control_Field_Fontawesome extends VP_Control_FieldMulti
method __construct (line 6) | public function __construct()
method withArray (line 11) | public static function withArray($arr = array(), $class_name = null)
method render (line 27) | public function render($is_compact = false)
FILE: classes/control/field/html.php
class VP_Control_Field_HTML (line 3) | class VP_Control_Field_HTML extends VP_Control_Field
method __construct (line 8) | public function __construct()
method withArray (line 13) | public static function withArray($arr = array(), $class_name = null)
method _setup_data (line 24) | protected function _setup_data()
method render (line 30) | public function render($is_compact = false)
method set_value (line 38) | public function set_value($_value)
method get_height (line 55) | public function get_height() {
method set_height (line 64) | public function set_height($_height) {
FILE: classes/control/field/item/generic.php
class VP_Control_Field_Item_Generic (line 6) | class VP_Control_Field_Item_Generic
method __construct (line 15) | public function __construct(){}
method img (line 17) | public function img($img)
method value (line 23) | public function value($value)
method label (line 29) | public function label($label)
FILE: classes/control/field/multiselect.php
class VP_Control_Field_MultiSelect (line 3) | class VP_Control_Field_MultiSelect extends VP_Control_FieldMulti impleme...
method __construct (line 6) | public function __construct()
method withArray (line 12) | public static function withArray($arr = array(), $class_name = null)
method render (line 23) | public function render($is_compact = false)
FILE: classes/control/field/notebox.php
class VP_Control_Field_NoteBox (line 3) | class VP_Control_Field_NoteBox extends VP_Control_Field
method __construct (line 17) | public function __construct()
method withArray (line 22) | public static function withArray($arr = array(), $class_name = null)
method _basic_make (line 32) | protected function _basic_make($arr)
method _setup_data (line 38) | protected function _setup_data()
method render (line 65) | public function render($is_compact = false)
method get_status (line 78) | public function get_status() {
method set_status (line 87) | public function set_status($_status) {
FILE: classes/control/field/radiobutton.php
class VP_Control_Field_RadioButton (line 3) | class VP_Control_Field_RadioButton extends VP_Control_FieldMulti
method __construct (line 6) | public function __construct()
method withArray (line 12) | public static function withArray($arr = array(), $class_name = null)
method render (line 23) | public function render($is_compact = false)
FILE: classes/control/field/radioimage.php
class VP_Control_Field_RadioImage (line 3) | class VP_Control_Field_RadioImage extends VP_Control_FieldMultiImage
method __construct (line 6) | public function __construct()
method withArray (line 12) | public static function withArray($arr = array(), $class_name = null)
method render (line 23) | public function render($is_compact = false)
FILE: classes/control/field/select.php
class VP_Control_Field_Select (line 3) | class VP_Control_Field_Select extends VP_Control_FieldMulti
method __construct (line 6) | public function __construct()
method withArray (line 11) | public static function withArray($arr = array(), $class_name = null)
method render (line 22) | public function render($is_compact = false)
FILE: classes/control/field/slider.php
class VP_Control_Field_Slider (line 3) | class VP_Control_Field_Slider extends VP_Control_Field
method __construct (line 12) | public function __construct()
method withArray (line 17) | public static function withArray($arr = array(), $class_name = null)
method _setup_data (line 30) | protected function _setup_data()
method render (line 43) | public function render($is_compact = false)
method _basic_make (line 51) | protected function _basic_make($arr)
method validate_value (line 59) | protected function validate_value($_value)
method set_value (line 69) | public function set_value($_value)
method get_min (line 80) | public function get_min() {
method set_min (line 89) | public function set_min($_min) {
method get_max (line 99) | public function get_max() {
method set_max (line 108) | public function set_max($_max) {
method get_step (line 118) | public function get_step() {
method set_step (line 127) | public function set_step($_step) {
FILE: classes/control/field/sorter.php
class VP_Control_Field_Sorter (line 3) | class VP_Control_Field_Sorter extends VP_Control_FieldMulti implements V...
method __construct (line 8) | public function __construct()
method withArray (line 14) | public static function withArray($arr = array(), $class_name = null)
method _setup_data (line 26) | protected function _setup_data()
method render (line 36) | public function render($is_compact = false)
method get_max_selection (line 43) | public function get_max_selection() {
method set_max_selection (line 47) | public function set_max_selection($_max_selection) {
FILE: classes/control/field/textarea.php
class VP_Control_Field_TextArea (line 3) | class VP_Control_Field_TextArea extends VP_Control_Field
method __construct (line 6) | public function __construct()
method withArray (line 11) | public static function withArray($arr = array(), $class_name = null)
method render (line 21) | public function render($is_compact = false)
method set_value (line 28) | public function set_value($_value)
FILE: classes/control/field/textbox.php
class VP_Control_Field_TextBox (line 3) | class VP_Control_Field_TextBox extends VP_Control_Field
method __construct (line 6) | public function __construct()
method withArray (line 11) | public static function withArray($arr = array(), $class_name = null)
method render (line 21) | public function render($is_compact = false)
FILE: classes/control/field/toggle.php
class VP_Control_Field_Toggle (line 3) | class VP_Control_Field_Toggle extends VP_Control_Field
method __construct (line 6) | public function __construct()
method withArray (line 12) | public static function withArray($arr = array(), $class_name = null)
method render (line 22) | public function render($is_compact = false)
FILE: classes/control/field/upload.php
class VP_Control_Field_Upload (line 3) | class VP_Control_Field_Upload extends VP_Control_Field
method __construct (line 6) | public function __construct()
method withArray (line 11) | public static function withArray($arr = array(), $class_name = null)
method _setup_data (line 21) | public function _setup_data()
method render (line 28) | public function render($is_compact = false)
FILE: classes/control/field/wpeditor.php
class VP_Control_Field_WPEditor (line 3) | class VP_Control_Field_WPEditor extends VP_Control_Field
method __construct (line 12) | public function __construct()
method withArray (line 17) | public static function withArray($arr = array(), $class_name = null)
method _setup_data (line 45) | protected function _setup_data()
method render (line 57) | public function render($is_compact = false)
method set_value (line 64) | public function set_value($_value)
method use_external_plugins (line 70) | public function use_external_plugins($use = null)
method get_disabled_externals_plugins (line 84) | public function get_disabled_externals_plugins()
method set_disabled_externals_plugins (line 94) | public function set_disabled_externals_plugins($_disabled_externals_pl...
method get_disabled_internals_plugins (line 106) | public function get_disabled_internals_plugins() {
method set_disabled_internals_plugins (line 115) | public function set_disabled_internals_plugins($_disabled_internals_pl...
FILE: classes/control/fieldmulti.php
class VP_Control_FieldMulti (line 6) | abstract class VP_Control_FieldMulti extends VP_Control_Field
method _basic_make (line 20) | protected function _basic_make($arr)
method _process_default (line 70) | public function _process_default()
method _setup_data (line 103) | protected function _setup_data()
method set_default (line 115) | public function set_default($_default) {
method add_items (line 122) | public function add_items($items)
method add_item (line 131) | public function add_item($opt)
method get_items (line 141) | public function get_items() {
method set_items (line 150) | public function set_items($_items) {
method add_items_from_array (line 155) | public function add_items_from_array($_items) {
method get_items_binding (line 173) | public function get_items_binding() {
method set_items_binding (line 182) | public function set_items_binding($_items_binding) {
FILE: classes/control/fieldmultiimage.php
class VP_Control_FieldMultiImage (line 6) | abstract class VP_Control_FieldMultiImage extends VP_Control_FieldMulti
method _basic_make (line 18) | protected function _basic_make($arr)
method _setup_data (line 28) | protected function _setup_data()
method add_items_from_array (line 35) | public function add_items_from_array($_items){
method get_item_max_height (line 51) | public function get_item_max_height() {
method set_item_max_height (line 60) | public function set_item_max_height($_item_max_height) {
method get_item_max_width (line 70) | public function get_item_max_width() {
method set_item_max_width (line 79) | public function set_item_max_width($_item_max_width) {
FILE: classes/filesystem.php
class VP_FileSystem (line 3) | class VP_FileSystem
method instance (line 10) | public static function instance()
method get_first_non_empty_dir (line 19) | public function get_first_non_empty_dir($key, $name = null)
method resolve_path (line 41) | public function resolve_path($key, $name, $ext = 'php')
method normalize_path (line 63) | public function normalize_path($path, $ext)
method dir_contains_children (line 69) | function dir_contains_children($dir, $ext = null)
method add_directories (line 99) | public function add_directories($key, $directories)
method remove_directories (line 115) | public function remove_directories($key, $directories = null)
method get_directories (line 143) | public function get_directories($key = null)
FILE: classes/metabox.php
class VP_Metabox (line 17) | class VP_Metabox extends WPAlchemy_MetaBox
method __construct (line 24) | function __construct($arr)
method register_fields (line 49) | public function register_fields()
method get_pool (line 55) | public static function get_pool()
method pool_can_output (line 60) | public static function pool_can_output()
method pool_supports_editor (line 72) | public static function pool_supports_editor()
method supports_editor (line 84) | public function supports_editor()
method _setup (line 98) | function _setup()
method get_field_types (line 134) | function get_field_types()
method _enfactor (line 163) | function _enfactor($arr)
method _enbind (line 188) | function _enbind($fields)
method _endep (line 258) | function _endep($fields)
method _enfactor_field (line 340) | function _enfactor_field($field, $mb, $in_group = false)
method _enfactor_group (line 397) | function _enfactor_group($field, $mb, $repeating)
method _enview (line 466) | function _enview($fields)
method _render_field (line 485) | function _render_field($field)
method _render_group (line 490) | function _render_group($group)
method _render_repeating_group (line 538) | function _render_repeating_group($group)
method _save (line 596) | function _save($post_id)
method _clean_tocopy (line 726) | private function _clean_tocopy(&$arr)
FILE: classes/metabox/alchemy.php
class VP_MetaBox_Alchemy (line 17) | class VP_MetaBox_Alchemy extends WPAlchemy_MetaBox
method _setup (line 27) | function _setup()
method get_field_types (line 63) | function get_field_types()
method _enfactor (line 92) | function _enfactor($arr)
method _enbind (line 117) | function _enbind($fields)
method _endep (line 187) | function _endep($fields)
method _enfactor_field (line 269) | function _enfactor_field($field, $mb, $in_group = false)
method _enfactor_group (line 324) | function _enfactor_group($field, $mb, $repeating)
method _enview (line 393) | function _enview($fields)
method _render_field (line 412) | function _render_field($field)
method _render_group (line 417) | function _render_group($group)
method _render_repeating_group (line 465) | function _render_repeating_group($group)
method _save (line 523) | function _save($post_id)
method _clean_tocopy (line 654) | private function _clean_tocopy(&$arr)
FILE: classes/metabox/depsloader.php
class VP_Metabox_Depsloader (line 3) | class VP_Metabox_Depsloader
method __construct (line 12) | public function __construct($things)
method build (line 17) | public function build()
method can_output (line 93) | public function can_output($hook_suffix = '')
FILE: classes/multiselectable.php
type VP_MultiSelectable (line 6) | interface VP_MultiSelectable{}
FILE: classes/option.php
class VP_Option (line 3) | class VP_Option
method __construct (line 36) | public function __construct(array $configs)
method get_pool (line 103) | public static function get_pool()
method init_options_from_db (line 108) | public function init_options_from_db()
method register_menu_page (line 118) | public function register_menu_page()
method setup (line 155) | public function setup()
method dev_mode_notice (line 165) | public function dev_mode_notice()
method enqueue_scripts_and_styles (line 170) | public function enqueue_scripts_and_styles()
method save_and_reinit (line 182) | function save_and_reinit()
method ajax_save (line 202) | function ajax_save()
method ajax_restore (line 247) | function ajax_restore()
method ajax_import_option (line 287) | function ajax_import_option()
method ajax_export_option (line 348) | function ajax_export_option()
method vp_verify_nonce (line 382) | function vp_verify_nonce()
method initial_db_setup (line 399) | function initial_db_setup()
method init_options (line 419) | public function init_options()
method init_options_set (line 450) | public function init_options_set()
method option_page_display (line 503) | public function option_page_display()
method get_field_types (line 508) | public function get_field_types()
method create_get_option_helper (line 515) | public function create_get_option_helper()
method get_hook_suffix (line 529) | public function get_hook_suffix()
method set_hook_suffix (line 539) | public function set_hook_suffix($_hook_suffix)
method get_template (line 550) | public function get_template()
method set_template (line 560) | public function set_template($_template)
method get_options (line 571) | public function get_options()
method set_options (line 581) | public function set_options($_options)
method get_options_set (line 592) | public function get_options_set()
method set_options_set (line 602) | public function set_options_set($_options_set)
method get_menu_page (line 613) | public function get_menu_page()
method set_menu_page (line 623) | public function set_menu_page($_menu_page)
method get_layout (line 634) | public function get_layout()
method set_layout (line 644) | public function set_layout($_layout)
method get_page_slug (line 655) | public function get_page_slug()
method set_page_slug (line 665) | public function set_page_slug($_page_slug)
method get_menu_label (line 676) | public function get_menu_label()
method set_menu_label (line 686) | public function set_menu_label($_menu_label)
method get_page_title (line 697) | public function get_page_title()
method set_page_title (line 707) | public function set_page_title($_page_title)
method get_minimum_role (line 718) | public function get_minimum_role()
method set_minimum_role (line 728) | public function set_minimum_role($_minimum_role)
method get_option_key (line 739) | public function get_option_key()
method set_option_key (line 749) | public function set_option_key($_option_key)
method use_auto_group_naming (line 760) | public function use_auto_group_naming($_use_auto_group_naming = NULL)
method use_util_menu (line 772) | public function use_util_menu($_use_util_menu = NULL)
method is_dev_mode (line 784) | public function is_dev_mode($_dev_mode = NULL)
FILE: classes/option/control/field/impexp.php
class VP_Option_Control_Field_ImpExp (line 3) | class VP_Option_Control_Field_ImpExp extends VP_Control_Field
method __construct (line 6) | public function __construct()
method withArray (line 11) | public static function withArray($arr = array(), $class_name = null)
method render (line 21) | public function render()
FILE: classes/option/control/field/restore.php
class VP_Option_Control_Field_Restore (line 3) | class VP_Option_Control_Field_Restore extends VP_Control_Field
method __construct (line 6) | public function __construct()
method withArray (line 11) | public static function withArray($arr = array(), $class_name = null)
method render (line 21) | public function render()
FILE: classes/option/control/group.php
class VP_Option_Control_Group (line 3) | abstract class VP_Option_Control_Group
method __construct (line 22) | public function __construct()
method render (line 27) | public abstract function render($extra = array());
method _setup_data (line 29) | protected function _setup_data(){}
method get_name (line 36) | public function get_name() {
method set_name (line 45) | public function set_name($_name) {
method get_title (line 55) | public function get_title() {
method set_title (line 64) | public function set_title($_title) {
method get_description (line 75) | public function get_description() {
method set_description (line 84) | public function set_description($_description) {
method add_data (line 93) | public function add_data($key, $value)
method get_data (line 103) | public function get_data() {
method set_data (line 112) | public function set_data($_data) {
method get_container_extra_classes (line 122) | public function get_container_extra_classes() {
method set_container_extra_classes (line 131) | public function set_container_extra_classes($_container_extra_classes) {
method add_container_extra_classes (line 136) | public function add_container_extra_classes($class)
FILE: classes/option/control/group/menu.php
class VP_Option_Control_Group_Menu (line 3) | class VP_Option_Control_Group_Menu extends VP_Option_Control_Group
method __construct (line 20) | public function __construct()
method render (line 27) | public function render($extra = array())
method add_menu (line 39) | public function add_menu($menu)
method get_menus (line 49) | public function get_menus() {
method set_menus (line 58) | public function set_menus($_menus)
method add_control (line 64) | public function add_control($control)
method get_controls (line 74) | public function get_controls()
method set_controls (line 84) | public function set_controls($_controls)
method get_icon (line 95) | public function get_icon() {
method set_icon (line 104) | public function set_icon($_icon) {
FILE: classes/option/control/group/section.php
class VP_Option_Control_Group_Section (line 3) | class VP_Option_Control_Group_Section extends VP_Option_Control_Group
method __construct (line 23) | public function __construct()
method render (line 29) | public function render($extra = array())
method add_field (line 49) | public function add_field($field)
method get_fields (line 59) | public function get_fields() {
method set_fields (line 68) | public function set_fields($_fields) {
method get_dependency (line 78) | public function get_dependency() {
method set_dependency (line 87) | public function set_dependency($_dependency) {
method is_hidden (line 97) | public function is_hidden($_is_hidden = null) {
FILE: classes/option/control/set.php
class VP_Option_Control_Set (line 3) | class VP_Option_Control_Set
method __construct (line 20) | public function __construct()
method render (line 25) | public function render()
method get_title (line 37) | public function get_title() {
method set_title (line 46) | public function set_title($_title) {
method get_layout (line 56) | public function get_layout()
method set_layout (line 66) | public function set_layout($_layout)
method get_logo (line 77) | public function get_logo() {
method set_logo (line 86) | public function set_logo($_logo) {
method add_menu (line 91) | public function add_menu($menu)
method get_menus (line 101) | public function get_menus() {
method set_menus (line 110) | public function set_menus($_menus) {
method get_fields (line 115) | public function get_fields($include_section = false)
method get_field_types (line 170) | public function get_field_types()
method get_field (line 183) | public function get_field($name)
method process_binding (line 193) | public function process_binding()
method process_dependencies (line 261) | public function process_dependencies()
method normalize_values (line 293) | public function normalize_values($opt_arr)
method get_defaults (line 315) | public function get_defaults()
method get_values (line 326) | public function get_values()
method setup (line 337) | public function setup($options)
method save (line 349) | public function save($option_key)
method populate_values (line 385) | public function populate_values($opt, $force_update = false)
FILE: classes/option/depsloader.php
class VP_Option_Depsloader (line 3) | class VP_Option_Depsloader
method __construct (line 11) | public function __construct($things)
method build (line 16) | public function build()
method can_output (line 71) | public function can_output($hook_suffix = '')
FILE: classes/option/parser.php
class VP_Option_Parser (line 3) | class VP_Option_Parser
method parse_array_options (line 6) | public function parse_array_options($arr, $auto_group_naming)
method parse_section (line 96) | private function parse_section($section)
method parse_field (line 119) | private function parse_field($field)
FILE: classes/security.php
class VP_Security (line 3) | class VP_Security
method instance (line 14) | public static function instance()
method whitelist_function (line 22) | public function whitelist_function($name)
method is_function_whitelisted (line 32) | public function is_function_whitelisted($name)
FILE: classes/shortcodegenerator.php
class VP_ShortcodeGenerator (line 3) | class VP_ShortcodeGenerator
method __construct (line 24) | public function __construct($arr)
method init_mce_plugin (line 53) | function init_mce_plugin()
method normalize (line 65) | function normalize()
method get_field_types (line 82) | function get_field_types()
method get_pool (line 101) | public static function get_pool()
method pool_supports_editor (line 106) | public static function pool_supports_editor()
method supports_editor (line 118) | public function supports_editor()
method pool_can_output (line 125) | public static function pool_can_output()
method can_output (line 137) | public function can_output()
method print_modal (line 176) | public function print_modal()
method print_form (line 226) | function print_form($attributes)
method build_localize (line 266) | public static function build_localize()
method init_buttons (line 282) | public static function init_buttons()
method print_styles (line 294) | public static function print_styles($buttons)
method register_buttons (line 311) | public static function register_buttons($buttons)
method add_buttons (line 322) | public static function add_buttons($plugin_array)
method fullscreen_buttons (line 333) | public static function fullscreen_buttons($buttons)
method get_shortcode_tags (line 355) | public function get_shortcode_tags() {
FILE: classes/site/googlewebfont.php
class VP_Site_GoogleWebFont (line 8) | class VP_Site_GoogleWebFont
method instance (line 14) | public static function instance()
method add (line 23) | public function add($name, $weights = 'normal', $styles = 'normal', $s...
method register (line 70) | public function register()
method enqueue (line 79) | public function enqueue()
method register_and_enqueue (line 88) | public function register_and_enqueue()
method get_font_links (line 94) | public function get_font_links()
method get_fonts (line 113) | public function get_fonts()
method get_names (line 118) | public function get_names()
FILE: classes/util/array.php
class VP_Util_Array (line 3) | class VP_Util_Array
method first (line 6) | public static function first($array)
method deep_values (line 15) | public static function deep_values($array, $the_key)
method unite (line 50) | public static function unite($array, $left, $right)
method array_merge_recursive_all (line 73) | public static function array_merge_recursive_all($paArray1, $paArray2)
method array_replace_recursive (line 83) | public static function array_replace_recursive($array, $array1)
FILE: classes/util/config.php
class VP_Util_Config (line 7) | class VP_Util_Config
method __construct (line 14) | private function __construct()
method instance (line 19) | public static function instance()
method load (line 29) | public function load($config_name, $key = '')
FILE: classes/util/profiler.php
class VP_Util_Profiler (line 3) | class VP_Util_Profiler
method show_memtime (line 6) | public static function show_memtime()
FILE: classes/util/reflection.php
class VP_Util_Reflection (line 3) | class VP_Util_Reflection
method is_multiselectable (line 6) | public static function is_multiselectable($object)
method field_type_from_class (line 41) | public static function field_type_from_class($class)
method field_class_from_type (line 47) | public static function field_class_from_type($type)
FILE: classes/util/res.php
class VP_Util_Res (line 3) | class VP_Util_Res
method is_font_awesome (line 6) | public static function is_font_awesome($icon)
method get_preview_from_url (line 15) | public static function get_preview_from_url($url)
method img (line 60) | public static function img($url)
method img_out (line 83) | public static function img_out($img, $default)
FILE: classes/util/text.php
class VP_Util_Text (line 3) | class VP_Util_Text
method parse_md (line 6) | public static function parse_md($text)
method make_opt (line 16) | public static function make_opt($optArray)
method print_if_exists (line 26) | public static function print_if_exists($value, $format)
method return_if_exists (line 38) | public static function return_if_exists($value, $format)
method out (line 52) | public static function out($string, $default)
method prefix (line 60) | public static function prefix(&$item, $key, $prefix)
method prefix_array (line 65) | public static function prefix_array($array, $prefix)
method starts_with (line 71) | public static function starts_with($haystack, $needle)
method ends_with (line 76) | public static function ends_with($haystack, $needle)
method flanked_by (line 86) | public static function flanked_by($haystack, $left, $right = '')
FILE: classes/view.php
class VP_View (line 6) | class VP_View
method __construct (line 17) | private function __construct()
method instance (line 22) | public static function instance()
method load (line 37) | public function load($field_view_file, $data = array())
FILE: classes/wp/admin.php
class VP_WP_Admin (line 3) | class VP_WP_Admin
method is_post_or_page (line 14) | public static function is_post_or_page()
method get_current_post_type (line 41) | public static function get_current_post_type()
FILE: classes/wp/enqueuer.php
class VP_WP_Enqueuer (line 6) | class VP_WP_Enqueuer
method __construct (line 13) | public function __construct()
method add_loader (line 20) | public function add_loader($loader)
method register (line 25) | public function register()
method register_caller (line 30) | public function register_caller($hook_suffix)
FILE: classes/wp/loader.php
class VP_WP_Loader (line 3) | class VP_WP_Loader
method instance (line 26) | public static function instance()
method __construct (line 35) | private function __construct()
method build (line 45) | public function build()
method add_localize_data (line 145) | public function add_localize_data($key, $value)
method build_localize_data (line 150) | private function build_localize_data()
method js_unit_register (line 174) | private function js_unit_register($name, $extra_deps = null)
method css_unit_register (line 227) | private function css_unit_register($name, $extra_deps = null)
method add_js_data (line 251) | public function add_js_data($js_name, $key, $data)
method add_css_data (line 256) | public function add_css_data($css_name, $key, $data)
method add_data (line 261) | public function add_data($name, $key, $data, $type)
method add_main_css (line 297) | public function add_main_css($css)
method add_main_js (line 318) | public function add_main_js($js)
method add_types (line 349) | public function add_types($types, $key)
method get_types (line 355) | public function get_types($key = null)
method get_flat_types (line 363) | public function get_flat_types()
FILE: classes/wp/massenqueuer.php
class VP_WP_MassEnqueuer (line 6) | class VP_WP_MassEnqueuer
method instance (line 10) | public static function instance()
FILE: classes/wp/user.php
class VP_WP_User (line 3) | class VP_WP_User
method get_users (line 6) | public static function get_users()
method get_editable_roles (line 33) | public static function get_editable_roles()
FILE: classes/wp/util.php
class VP_WP_Util (line 3) | class VP_WP_Util
method kses_html (line 6) | public static function kses_html($html)
method admin_notice (line 28) | public static function admin_notice($message, $is_error = false)
FILE: data/sources.php
function vp_get_categories (line 8) | function vp_get_categories()
function vp_get_users (line 20) | function vp_get_users()
function vp_get_posts (line 32) | function vp_get_posts()
function vp_get_pages (line 46) | function vp_get_pages()
function vp_get_tags (line 58) | function vp_get_tags()
function vp_get_roles (line 69) | function vp_get_roles()
function vp_get_gwf_family (line 82) | function vp_get_gwf_family()
function vp_get_gwf_weight (line 99) | function vp_get_gwf_weight($face)
function vp_get_gwf_style (line 120) | function vp_get_gwf_style($face)
function vp_get_gwf_subset (line 141) | function vp_get_gwf_subset($face)
function vp_get_social_medias (line 160) | function vp_get_social_medias() {
function vp_get_fontawesome_icons (line 194) | function vp_get_fontawesome_icons()
function vp_dep_boolean (line 218) | function vp_dep_boolean($value)
FILE: includes/parsedown.php
class Parsedown (line 16) | class Parsedown
method setBreaksEnabled (line 34) | function setBreaksEnabled($breaksEnabled)
method set_breaks_enabled (line 46) | function set_breaks_enabled($breaks_enabled)
method parse (line 57) | function parse($text)
method findBlocks (line 87) | private function findBlocks(array $lines, $blockContext = null)
method compile (line 858) | private function compile(array $blocks)
method parseLine (line 937) | private function parseLine($text, $markers = array(" \n", '![', '&', ...
method instance (line 1290) | static function instance($name = 'default')
FILE: includes/wpalchemy/MetaBox.php
class WPAlchemy_MetaBox (line 61) | class WPAlchemy_MetaBox
method WPAlchemy_MetaBox (line 453) | function WPAlchemy_MetaBox($arr)
method _import (line 525) | function _import($post_id, $key, $value)
method _init (line 562) | function _init()
method _head (line 639) | function _head()
method _foot (line 678) | function _foot()
method _setup (line 817) | function _setup()
method _get_filter_tag (line 848) | function _get_filter_tag($tag)
method add_filter (line 864) | function add_filter($tag, $function_to_add, $priority = 10, $accepted_...
method has_filter (line 877) | function has_filter($tag, $function_to_check = FALSE)
method apply_filters (line 890) | function apply_filters($tag, $value)
method remove_filter (line 904) | function remove_filter($tag, $function_to_remove, $priority = 10, $acc...
method _get_action_tag (line 919) | function _get_action_tag($tag)
method add_action (line 935) | function add_action($tag, $function_to_add, $priority = 10, $accepted_...
method has_action (line 948) | function has_action($tag, $function_to_check = FALSE)
method remove_action (line 961) | function remove_action($tag, $function_to_remove, $priority = 10, $acc...
method do_action (line 973) | function do_action($tag, $arg = '')
method _is_post (line 989) | static function _is_post()
method _is_page (line 1008) | static function _is_page()
method _is_post_or_page (line 1027) | static function _is_post_or_page()
method _get_current_post_type (line 1054) | static function _get_current_post_type()
method _get_post_id (line 1094) | static function _get_post_id()
method can_output (line 1117) | function can_output()
method _global_head (line 1354) | static function _global_head()
method _global_foot (line 1544) | static function _global_foot()
method the_meta (line 1572) | function the_meta($post_id = NULL)
method _meta (line 1590) | function _meta($post_id = NULL, $internal = FALSE)
method the_id (line 1642) | function the_id()
method get_the_id (line 1651) | function get_the_id()
method the_field (line 1660) | function the_field($n, $hint = NULL)
method have_value (line 1670) | function have_value($n = NULL)
method the_value (line 1681) | function the_value($n = NULL)
method get_the_value (line 1686) | function get_the_value($n = NULL, $collection = FALSE)
method the_name (line 1761) | function the_name($n = NULL)
method get_the_name (line 1770) | function get_the_name($n = NULL)
method the_index (line 1812) | function the_index()
method get_the_index (line 1821) | function get_the_index()
method is_first (line 1830) | function is_first()
method is_last (line 1841) | function is_last()
method is_value (line 1858) | function is_value($n, $v = NULL)
method is_selected (line 1887) | function is_selected($n, $v = NULL)
method the_checkbox_state (line 1922) | function the_checkbox_state($n, $v = NULL)
method get_the_checkbox_state (line 1938) | function get_the_checkbox_state($n, $v = NULL)
method the_radio_state (line 1953) | function the_radio_state($n, $v = NULL)
method get_the_radio_state (line 1969) | function get_the_radio_state($n, $v = NULL)
method the_select_state (line 1984) | function the_select_state($n, $v = NULL)
method get_the_select_state (line 2000) | function get_the_select_state($n, $v = NULL)
method the_group_open (line 2009) | function the_group_open($t = 'div')
method get_the_group_open (line 2018) | function get_the_group_open($t = 'div')
method the_group_close (line 2063) | function the_group_close()
method get_the_group_close (line 2072) | function get_the_group_close()
method have_fields_and_multi (line 2090) | function have_fields_and_multi($n, $options = NULL)
method have_fields_and_one (line 2122) | function have_fields_and_one($n)
method have_fields (line 2134) | function have_fields($n,$length=NULL)
method _loop (line 2147) | function _loop($n,$length=NULL,$and_one=0)
method _save (line 2203) | function _save($post_id)
method clean (line 2350) | static function clean(&$arr)
method push_loop (line 2409) | function push_loop($name, $length, $type)
method push_or_set_current_loop (line 2421) | function push_or_set_current_loop($name, $length, $type)
method set_current_loop (line 2431) | function set_current_loop($name)
method next_loop (line 2441) | function next_loop()
method prev_loop (line 2446) | function prev_loop()
method get_the_current_group_length (line 2460) | function get_the_current_group_length()
method get_the_current_group_current (line 2465) | function get_the_current_group_current()
method set_the_current_group_length (line 2470) | function set_the_current_group_length($length)
method set_the_current_group_current (line 2475) | function set_the_current_group_current($current)
method get_the_loop_collection (line 2480) | function get_the_loop_collection($name = null)
method get_the_loop_group_name (line 2508) | function get_the_loop_group_name($with_id = false)
method get_the_loop_level (line 2526) | function get_the_loop_level()
method get_the_loop_group_id (line 2542) | function get_the_loop_group_id()
method get_the_loop_group_name_array (line 2571) | function get_the_loop_group_name_array($with_id = false)
method get_the_dotted_loop_group_name (line 2594) | function get_the_dotted_loop_group_name($with_id = false)
method get_meta_by_dotted (line 2611) | function get_meta_by_dotted($dotted)
method get_meta_by_array (line 2629) | function get_meta_by_array($arr)
method get_the_current_group_count (line 2650) | function get_the_current_group_count()
method increment_current_loop (line 2660) | function increment_current_loop()
method get_the_current_loop (line 2665) | function get_the_current_loop()
method is_in_multi_last (line 2670) | function is_in_multi_last()
method is_in_loop (line 2682) | function is_in_loop()
method is_parent_multi (line 2689) | function is_parent_multi()
method the_copy_button_class (line 2701) | function the_copy_button_class()
class WPA_Loop (line 2709) | class WPA_Loop
method __construct (line 2722) | function __construct($name, $length, $type)
method the_indexed_name (line 2729) | function the_indexed_name()
method get_the_indexed_name (line 2734) | function get_the_indexed_name()
method is_first (line 2739) | function is_first()
method is_last (line 2746) | function is_last()
FILE: public/js/metabox.js
function vp_init_fields (line 61) | function vp_init_fields($elements)
function vp_init_groups (line 97) | function vp_init_groups($elements)
function vp_mb_sortable (line 113) | function vp_mb_sortable()
function process_binding (line 234) | function process_binding(bindings)
function process_items_binding (line 263) | function process_items_binding(items_binding)
function process_dependency (line 292) | function process_dependency(dependencies)
FILE: public/js/shared.js
function theValidate (line 853) | function theValidate(elem, options, $slider)
function get_url_info (line 983) | function get_url_info(html)
FILE: public/js/shortcode-menu.js
function decodeHTMLEntities (line 37) | function decodeHTMLEntities (str) {
FILE: public/js/shortcodes.js
function create (line 2) | function create(sg)
FILE: public/js/vendor/ace/ace.js
function o (line 1) | function o(e){var i=function(e,t){return r("",e,t)},s=t;e&&(t[e]||(t[e]=...
function o (line 1) | function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline...
function u (line 1) | function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(v...
function r (line 1) | function r(){}
function w (line 1) | function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentine...
function j (line 1) | function j(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-...
function F (line 1) | function F(e){var t=typeof e;return e===null||t==="undefined"||t==="bool...
function I (line 1) | function I(e){var t,n,r;if(F(e))return e;n=e.valueOf;if(typeof n=="funct...
function e (line 1) | function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}
function o (line 1) | function o(e,t,n){var s=0;!i.isOpera||"KeyboardEvent"in window||!i.isMac...
function s (line 1) | function s(o){n(o),i||(i=!0,r(o)),t.removeListener(e,"mousemove",n),t.re...
function r (line 1) | function r(e){t&&t(e),n&&n(e),document.removeEventListener("mousemove",t...
function b (line 1) | function b(e){if(h)return;var t=e?2:1,r=2;try{n.setSelectionRange(t,r)}c...
function w (line 1) | function w(){if(h)return;n.value=a,i.isWebKit&&y.schedule()}
function B (line 1) | function B(){setTimeout(function(){p&&(n.style.cssText=p,p=""),t.rendere...
function o (line 1) | function o(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler(...
function u (line 1) | function u(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}
function a (line 1) | function a(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.colum...
function s (line 1) | function s(e){function f(){u=r.createElement("div"),u.className="ace_gut...
function r (line 1) | function r(e){e.on("click",function(t){var n=t.getDocumentPosition(),r=e...
function g (line 1) | function g(e){return e<4352?!1:e>=4352&&e<=4447||e>=4515&&e<=4519||e>=46...
function r (line 1) | function r(e){var n=e.action=="insertText"||e.action=="insertLines";retu...
function u (line 1) | function u(t){var r=e.slice(i,t),o=r.length;r.join("").replace(/12/g,fun...
function f (line 1) | function f(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCas...
function r (line 1) | function r(e){var n=/\w{4}/g;for(var r in e)t.packages[r]=e[r].replace(n...
function u (line 1) | function u(){this.getFoldAt=function(e,t,n){var r=this.getFoldLine(e);if...
function i (line 1) | function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.fol...
function s (line 1) | function s(){this.findMatchingBracket=function(e,t){if(e.column==0)retur...
function i (line 1) | function i(e,t){this.platform=t,this.commands={},this.commmandKeyBinding...
function s (line 1) | function s(e,t){return{win:e,mac:t}}
function r (line 1) | function r(e){i.importCssString(e.cssText,e.cssClass,t.container.ownerDo...
function i (line 1) | function i(e,t,n){var i=0,s=0;while(s+e[i].value.length<t){s+=e[i].value...
function h (line 1) | function h(e,t,n){return c.$options.wrap=!0,c.$options.needle=t,c.$optio...
function v (line 1) | function v(e,t){return e.row==t.row&&e.column==t.column}
function m (line 1) | function m(e){e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$on...
function g (line 1) | function g(e){function i(){n&&(r.style.cursor="",n=!1)}var t=e.textInput...
function o (line 1) | function o(e){return a.stringRepeat(" ",e)}
function u (line 1) | function u(e){return e[2]?o(r)+e[2]+o(i-e[2].length+s)+e[4].replace(/^([...
function f (line 1) | function f(e){return e[2]?o(r+i-e[2].length)+e[2]+o(s," ")+e[4].replace(...
function l (line 1) | function l(e){return e[2]?o(r)+e[2]+o(s)+e[4].replace(/^([=:])\s+/,"$1 "...
function i (line 1) | function i(e,t){return e.row==t.row&&e.column==t.column}
function s (line 1) | function s(e){var t=e.domEvent,n=t.altKey,s=t.shiftKey,o=e.getAccelKey()...
FILE: public/js/vendor/ace/mode-html.js
function r (line 1) | function r(e){return[{token:"string",regex:'"',next:e+"_qqstring"},{toke...
function i (line 1) | function i(e,t){return[{token:"string",regex:e,next:t},{token:"constant....
function a (line 1) | function a(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.for...
function u (line 1) | function u(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.for...
FILE: public/js/vendor/ace/mode-markdown.js
function r (line 1) | function r(e){return[{token:"string",regex:'"',next:e+"_qqstring"},{toke...
function i (line 1) | function i(e,t){return[{token:"string",regex:e,next:t},{token:"constant....
function u (line 1) | function u(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.for...
function a (line 1) | function a(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.for...
function f (line 1) | function f(e,t){return{token:"support.function",regex:"^```"+e+"\\s*$",n...
function l (line 1) | function l(t){return f=e.getTokens(t)[0],f&&f.type.lastIndexOf(c,0)===0}
function h (line 1) | function h(){var e=f.value[0];return e=="="?6:e=="-"?5:7-f.value.search(...
FILE: public/js/vendor/ace/mode-php.js
function r (line 1) | function r(e){return[{token:"string",regex:'"',next:e+"_qqstring"},{toke...
function i (line 1) | function i(e,t){return[{token:"string",regex:e,next:t},{token:"constant....
FILE: public/js/vendor/ace/mode-xml.js
function r (line 1) | function r(e){return[{token:"string",regex:'"',next:e+"_qqstring"},{toke...
function i (line 1) | function i(e,t){return[{token:"string",regex:e,next:t},{token:"constant....
function u (line 1) | function u(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.for...
FILE: public/js/vendor/ace/worker-css.js
function initBaseUrls (line 1) | function initBaseUrls(e){require.tlns=e}
function initSender (line 1) | function initSender(){var e=require(null,"ace/lib/event_emitter").EventE...
function o (line 1) | function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline...
function u (line 1) | function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(v...
function r (line 1) | function r(){}
function w (line 1) | function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentine...
function j (line 1) | function j(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-...
function F (line 1) | function F(e){var t=typeof e;return e===null||t==="undefined"||t==="bool...
function I (line 1) | function I(e){var t,n,r;if(F(e))return e;n=e.valueOf;if(typeof n=="funct...
function e (line 1) | function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}
function Reporter (line 1) | function Reporter(e,t){this.messages=[],this.stats=[],this.lines=e,this....
function e (line 1) | function e(){this._listeners={}}
function t (line 1) | function t(e){this._input=e.replace(/\n\r?/g,"\n"),this._line=1,this._co...
function n (line 1) | function n(e,t,n){this.col=n,this.line=t,this.message=e}
function r (line 1) | function r(e,t,n,r){this.col=n,this.line=t,this.text=e,this.type=r}
function i (line 1) | function i(e,n){this._reader=e?new t(e.toString()):null,this._token=null...
function Combinator (line 1) | function Combinator(e,t,n){SyntaxUnit.call(this,e,t,n,Parser.COMBINATOR_...
function MediaFeature (line 1) | function MediaFeature(e,t){SyntaxUnit.call(this,"("+e+(t!==null?":"+t:""...
function MediaQuery (line 1) | function MediaQuery(e,t,n,r,i){SyntaxUnit.call(this,(e?e+" ":"")+(t?t+" ...
function Parser (line 1) | function Parser(e){EventTarget.call(this),this.options=e||{},this._token...
function PropertyName (line 1) | function PropertyName(e,t,n,r){SyntaxUnit.call(this,e,n,r,Parser.PROPERT...
function PropertyValue (line 1) | function PropertyValue(e,t,n){SyntaxUnit.call(this,e.join(" "),t,n,Parse...
function PropertyValueIterator (line 1) | function PropertyValueIterator(e){this._i=0,this._parts=e.parts,this._ma...
function PropertyValuePart (line 1) | function PropertyValuePart(text,line,col){SyntaxUnit.call(this,text,line...
function Selector (line 1) | function Selector(e,t,n){SyntaxUnit.call(this,e.join(" "),t,n,Parser.SEL...
function SelectorPart (line 1) | function SelectorPart(e,t,n,r,i){SyntaxUnit.call(this,n,r,i,Parser.SELEC...
function SelectorSubPart (line 1) | function SelectorSubPart(e,t,n,r){SyntaxUnit.call(this,e,n,r,Parser.SELE...
function Specificity (line 1) | function Specificity(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}
function isHexDigit (line 1) | function isHexDigit(e){return e!==null&&h.test(e)}
function isDigit (line 1) | function isDigit(e){return e!==null&&/\d/.test(e)}
function isWhitespace (line 1) | function isWhitespace(e){return e!==null&&/\s/.test(e)}
function isNewLine (line 1) | function isNewLine(e){return e!==null&&nl.test(e)}
function isNameStart (line 1) | function isNameStart(e){return e!==null&&/[a-z_\u0080-\uFFFF\\]/i.test(e)}
function isNameChar (line 1) | function isNameChar(e){return e!==null&&(isNameStart(e)||/[0-9\-\\]/.tes...
function isIdentStart (line 1) | function isIdentStart(e){return e!==null&&(isNameStart(e)||/\-\\/.test(e))}
function mix (line 1) | function mix(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}
function TokenStream (line 1) | function TokenStream(e){TokenStreamBase.call(this,e,Tokens)}
function ValidationError (line 1) | function ValidationError(e,t,n){this.col=n,this.line=t,this.message=e}
function u (line 1) | function u(e){var t,n,r,a,f=e.elementName?e.elementName.text:"",l;f&&f.c...
function u (line 1) | function u(){s={},o=!1}
function a (line 1) | function a(){var e,u;if(!o){if(s.height)for(e in i)i.hasOwnProperty(e)&&...
function s (line 1) | function s(e,s,o){i[e]&&(typeof r[e]!="string"||i[e].value.toLowerCase()...
function o (line 1) | function o(){i={}}
function u (line 1) | function u(){var e=i.display?i.display.value:null;if(e)switch(e){case"in...
function s (line 1) | function s(e){r={}}
function o (line 1) | function o(e){s={},r=null}
function i (line 1) | function i(e){e.selectors?r={line:e.line,col:e.col,selectors:e.selectors...
function s (line 1) | function s(e){r&&r.outline&&(r.selectors.toString().toLowerCase().indexO...
function f (line 1) | function f(e){u={}}
function l (line 1) | function l(e){var r,i,s,o;for(r in a)if(a.hasOwnProperty(r)){o=0;for(i=0...
function s (line 1) | function s(e){r=!1,i="inherit"}
function o (line 1) | function o(e){r&&i!="ltr"&&t.report("Negative text-indent doesn't work w...
function o (line 1) | function o(){r={},i=1}
function u (line 1) | function u(e){var i,o,u,a,f,l,c=[];for(i in r)s[i]&&c.push({actual:i,nee...
FILE: public/js/vendor/ace/worker-javascript.js
function initBaseUrls (line 1) | function initBaseUrls(e){require.tlns=e}
function initSender (line 1) | function initSender(){var e=require(null,"ace/lib/event_emitter").EventE...
function o (line 1) | function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline...
function u (line 1) | function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(v...
function r (line 1) | function r(){}
function w (line 1) | function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentine...
function j (line 1) | function j(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-...
function F (line 1) | function F(e){var t=typeof e;return e===null||t==="undefined"||t==="bool...
function I (line 1) | function I(e){var t,n,r;if(F(e))return e;n=e.valueOf;if(typeof n=="funct...
function e (line 1) | function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}
function startRegex (line 1) | function startRegex(e){return RegExp("^("+e.join("|")+")")}
function ot (line 1) | function ot(){}
function ut (line 1) | function ut(e,t){return Object.prototype.hasOwnProperty.call(e,t)}
function at (line 1) | function at(e,t){i[e]===undefined&&n[e]===undefined&&bt("Bad option: '"+...
function ft (line 1) | function ft(e){return Object.prototype.toString.call(e)==="[object Strin...
function lt (line 1) | function lt(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"}
function ct (line 1) | function ct(e){return e>="0"&&e<="9"}
function ht (line 1) | function ht(e,t){return e?!e.identifier||e.value!==t?!1:!0:!1}
function pt (line 1) | function pt(e,t){return e.replace(/\{([^{}]*)\}/g,function(e,n){var r=t[...
function dt (line 1) | function dt(e,t){var n;for(n in t)ut(t,n)&&!ut(r.blacklist,n)&&(e[n]=t[n])}
function vt (line 1) | function vt(){Object.keys(r.blacklist).forEach(function(e){delete O[e]})}
function mt (line 1) | function mt(){A.couch&&dt(O,a),A.rhino&&dt(O,H),A.prototypejs&&dt(O,D),A...
function gt (line 1) | function gt(e,t,n){var r=Math.floor(t/E.length*100);throw{name:"JSHintEr...
function yt (line 1) | function yt(e,t,n,i){return r.undefs.push([e,t,n,i])}
function bt (line 1) | function bt(e,t,n,i,s,o){var u,a,f;return t=t||C,t.id==="(end)"&&(t=z),a...
function wt (line 1) | function wt(e,t,n,r,i,s,o){return bt(e,{line:t,from:n},r,i,s,o)}
function Et (line 1) | function Et(e,t,n,r,i,s){bt(e,t,n,r,i,s)}
function St (line 1) | function St(e,t,n,r,i,s,o){return Et(e,{line:t,from:n},r,i,s,o)}
function xt (line 1) | function xt(e,t){var n;return n={id:"(internal)",elem:e,value:t},r.inter...
function Nt (line 1) | function Nt(e,t,n){e==="hasOwnProperty"&&bt("'hasOwnProperty' is a reall...
function Ct (line 1) | function Ct(){var e=C,t=e.value,i=A.quotmark,u={},a,l,c,p,d,v,m;switch(t...
function kt (line 1) | function kt(e){var t=e||0,n=0,r;while(n<=t)r=S[n],r||(r=S[n]=Tt.token())...
function Lt (line 1) | function Lt(t,n){switch(z.id){case"(number)":C.id==="."&&bt("A dot follo...
function At (line 1) | function At(t,n){var r,i=!1,s=!1;C.id==="(end)"&&Et("Unexpected early en...
function Ot (line 1) | function Ot(e,t){e=e||z,t=t||C,A.white&&e.character!==t.from&&e.line===t...
function Mt (line 1) | function Mt(e,t){e=e||z,t=t||C,A.white&&(e.character!==t.from||e.line!==...
function _t (line 1) | function _t(e,t){e=e||z,t=t||C,A.white&&!e.comment&&e.line===t.line&&Ot(...
function Dt (line 1) | function Dt(e,t){if(A.white){e=e||z,t=t||C;if(e.value===";"&&t.value==="...
function Pt (line 1) | function Pt(e,t){e=e||z,t=t||C,!A.laxbreak&&e.line!==t.line?bt("Bad line...
function Ht (line 1) | function Ht(e){var t;A.white&&C.id!=="(end)"&&(t=y+(e||0),C.from!==t&&bt...
function Bt (line 1) | function Bt(e){e=e||z,e.line!==C.line&&bt("Line breaking error '{a}'.",e...
function jt (line 1) | function jt(){z.line!==C.line?A.laxcomma||(jt.first&&(bt("Comma warnings...
function Ft (line 1) | function Ft(e,t){var n=R[e];if(!n||typeof n!="object")R[e]=n={id:e,lbp:t...
function It (line 1) | function It(e){return Ft(e,0)}
function qt (line 1) | function qt(e,t){var n=It(e);return n.identifier=n.reserved=!0,n.fud=t,n}
function Rt (line 1) | function Rt(e,t){var n=qt(e,t);return n.block=!0,n}
function Ut (line 1) | function Ut(e){var t=e.id.charAt(0);if(t>="a"&&t<="z"||t>="A"&&t<="Z")e....
function zt (line 1) | function zt(e,t){var n=Ft(e,150);return Ut(n),n.nud=typeof t=="function"...
function Wt (line 1) | function Wt(e,t){var n=It(e);return n.type=e,n.nud=t,n}
function Xt (line 1) | function Xt(e,t){var n=Wt(e,t);return n.identifier=n.reserved=!0,n}
function Vt (line 1) | function Vt(e,t){return Xt(e,function(){return typeof t=="function"&&t(t...
function $t (line 1) | function $t(e,t,n,r){var i=Ft(e,n);return Ut(i),i.led=function(i){return...
function Jt (line 1) | function Jt(e,t){var n=Ft(e,100);return n.led=function(e){Pt(_,z),Dt(z,C...
function Kt (line 1) | function Kt(e){return e&&(e.type==="(number)"&&+e.value===0||e.type==="(...
function Qt (line 1) | function Qt(e){return Ft(e,20).exps=!0,$t(e,function(e,t){t.left=e,O[e.v...
function Gt (line 1) | function Gt(e,t,n){var r=Ft(e,n);return Ut(r),r.led=typeof t=="function"...
function Yt (line 1) | function Yt(e){return Ft(e,20).exps=!0,$t(e,function(e,t){A.bitwise&&bt(...
function Zt (line 1) | function Zt(e){var t=Ft(e,150);return t.led=function(e){return A.plusplu...
function en (line 1) | function en(e){if(C.identifier)return Lt(),z.reserved&&!A.es5&&(!e||z.va...
function tn (line 1) | function tn(e){var t=en(e);if(t)return t;z.id==="function"&&C.id==="("?b...
function nn (line 1) | function nn(e){var t=0,n;if(C.id!==";"||L)return;for(;;){n=kt(t);if(n.re...
function rn (line 1) | function rn(e){var t=y,n,r=B,i=C;if(i.id===";"){Lt(";");return}i.identif...
function sn (line 1) | function sn(e){var t=[],n;while(!C.reach&&C.id!=="(end)")C.id===";"?(n=k...
function on (line 1) | function on(){var e,t,n;for(;;){if(C.id==="(string)"){t=kt(0);if(t.id===...
function un (line 1) | function un(e,t,n){var r,i=g,s=y,o,u=B,a,f,l;g=e;if(!e||!A.funcscope)B=O...
function an (line 1) | function an(e){T&&typeof T[e]!="boolean"&&bt("Unexpected /*member '{a}'....
function fn (line 1) | function fn(e){var t=e.value,n=e.line,r=m[t];typeof r=="function"&&(r=!1...
function ln (line 1) | function ln(){var e=en(!0);return e||(C.id==="(string)"?(e=C.value,Lt())...
function cn (line 1) | function cn(){var e=C,t=[],n;Lt("("),_t();if(C.id===")"){Lt(")");return}...
function hn (line 1) | function hn(t,n){var r,i=A,s=B;return A=Object.create(A),B=Object.create...
function pn (line 1) | function pn(e){return{statementCount:0,nestedBlockDepth:-1,ComplexityCou...
function dn (line 1) | function dn(){h["(metrics)"].ComplexityCount+=1}
function mn (line 1) | function mn(){function e(){var e={},t=C;Lt("{");if(C.id!=="}")for(;;){if...
function s (line 1) | function s(){var e,n,s;return r>=E.length?!1:(t=1,i=E[r],r+=1,A.smarttab...
function o (line 1) | function o(e,i){function u(e){if(!A.proto&&e==="__proto__"){wt("The '{a}...
function E (line 1) | function E(e){var r=e.exec(i),s;if(r)return p=r[0].length,s=r[1],u=s.cha...
function S (line 1) | function S(e){function c(e){var n=parseInt(i.substr(a+1,e),16);a+=e,n>=3...
function o (line 1) | function o(e,t){s[e]&&ut(s,e)?bt("Duplicate member '{a}'.",C,n):s[e]={},...
function u (line 1) | function u(e,t){s[e]&&ut(s,e)?(s[e].basic||s[e].setter)&&bt("Duplicate m...
function a (line 1) | function a(e){s[e]&&ut(s,e)?(s[e].basic||s[e].getter)&&bt("Duplicate mem...
function t (line 1) | function t(){var e=B,t;Lt("catch"),Dt(z,C),Lt("("),B=Object.create(e),t=...
FILE: public/js/vendor/ace/worker-json.js
function initBaseUrls (line 1) | function initBaseUrls(e){require.tlns=e}
function initSender (line 1) | function initSender(){var e=require(null,"ace/lib/event_emitter").EventE...
function o (line 1) | function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline...
function u (line 1) | function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(v...
function r (line 1) | function r(){}
function w (line 1) | function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentine...
function j (line 1) | function j(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-...
function F (line 1) | function F(e){var t=typeof e;return e===null||t==="undefined"||t==="bool...
function I (line 1) | function I(e){var t,n,r;if(F(e))return e;n=e.valueOf;if(typeof n=="funct...
function e (line 1) | function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}
FILE: public/js/vendor/ace/worker-php.js
function initBaseUrls (line 1) | function initBaseUrls(e){require.tlns=e}
function initSender (line 1) | function initSender(){var e=require(null,"ace/lib/event_emitter").EventE...
function o (line 1) | function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline...
function u (line 1) | function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(v...
function r (line 1) | function r(){}
function w (line 1) | function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentine...
function j (line 1) | function j(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-...
function F (line 1) | function F(e){var t=typeof e;return e===null||t==="undefined"||t==="bool...
function I (line 1) | function I(e){var t,n,r;if(F(e))return e;n=e.valueOf;if(typeof n=="funct...
function e (line 1) | function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}
FILE: public/js/vendor/jquery.reveal.js
function unlockModal (line 150) | function unlockModal() {
function lockModal (line 153) | function lockModal() {
FILE: public/js/vendor/jquery.tipsy.js
function maybeCall (line 8) | function maybeCall(thing, ctx) {
function isElementInDOM (line 12) | function isElementInDOM(ele) {
function Tipsy (line 19) | function Tipsy(element, options) {
function get (line 144) | function get(ele) {
function enter (line 153) | function enter() {
function leave (line 164) | function leave() {
Condensed preview — 152 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,664K chars).
[
{
"path": ".gitignore",
"chars": 6,
"preview": "build/"
},
{
"path": "LICENSE",
"chars": 662,
"preview": "Copyright (C) 2013 Vafpress (http://vafpress.com)\n\nThis program is free software: you can redistribute it and/or modify\n"
},
{
"path": "README.md",
"chars": 1772,
"preview": "# Vafpress Framework\n\nFor those who need a simpler way to create their own Wordpress Theme. See the [homepage](http://va"
},
{
"path": "autoload.php",
"chars": 4587,
"preview": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Register AutoLoader\n|-----------"
},
{
"path": "bootstrap.php",
"chars": 7358,
"preview": "<?php\n\nif( defined('VP_VERSION') )\n\treturn;\n\n//////////////////////////\n// Include Constants //\n/////////////////////"
},
{
"path": "classes/control/field/checkbox.php",
"chars": 686,
"preview": "<?php\n\nclass VP_Control_Field_CheckBox extends VP_Control_FieldMulti implements VP_MultiSelectable\n{\n\n\tpublic function _"
},
{
"path": "classes/control/field/checkimage.php",
"chars": 695,
"preview": "<?php\n\nclass VP_Control_Field_CheckImage extends VP_Control_FieldMultiImage implements VP_MultiSelectable\n{\n\n\tpublic fun"
},
{
"path": "classes/control/field/codeeditor.php",
"chars": 2191,
"preview": "<?php\n\nclass VP_Control_Field_CodeEditor extends VP_Control_Field\n{\n\n\t/**\n\t * Editor's language mode\n\t * (javascript, cs"
},
{
"path": "classes/control/field/color.php",
"chars": 1224,
"preview": "<?php\n\nclass VP_Control_Field_Color extends VP_Control_Field\n{\n\n\tprivate $_format;\n\n\tpublic function __construct()\n\t{\n\t\t"
},
{
"path": "classes/control/field/date.php",
"chars": 2077,
"preview": "<?php\n\nclass VP_Control_Field_Date extends VP_Control_Field\n{\n\n\tprivate $_min_date;\n\n\tprivate $_max_date;\n\n\tprivate $_fo"
},
{
"path": "classes/control/field/fontawesome.php",
"chars": 690,
"preview": "<?php\n\nclass VP_Control_Field_Fontawesome extends VP_Control_FieldMulti\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::_"
},
{
"path": "classes/control/field/html.php",
"chars": 1366,
"preview": "<?php\n\nclass VP_Control_Field_HTML extends VP_Control_Field\n{\n\n\tprotected $_height;\n\n\tpublic function __construct()\n\t{\n\t"
},
{
"path": "classes/control/field/item/generic.php",
"chars": 464,
"preview": "<?php\n\n/**\n * Not really a class, jump simple 'struct' storing multiple choice option item.\n */\nclass VP_Control_Field_I"
},
{
"path": "classes/control/field/multiselect.php",
"chars": 637,
"preview": "<?php\n\nclass VP_Control_Field_MultiSelect extends VP_Control_FieldMulti implements VP_MultiSelectable\n{\n\n\tpublic functio"
},
{
"path": "classes/control/field/notebox.php",
"chars": 1854,
"preview": "<?php\n\nclass VP_Control_Field_NoteBox extends VP_Control_Field\n{\n\n\t/**\n\t * Status of message, can be one of these:\n\t * -"
},
{
"path": "classes/control/field/radiobutton.php",
"chars": 638,
"preview": "<?php\n\nclass VP_Control_Field_RadioButton extends VP_Control_FieldMulti\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::_"
},
{
"path": "classes/control/field/radioimage.php",
"chars": 639,
"preview": "<?php\n\nclass VP_Control_Field_RadioImage extends VP_Control_FieldMultiImage\n{\n\n\tpublic function __construct()\n\t{\n\t\tparen"
},
{
"path": "classes/control/field/select.php",
"chars": 568,
"preview": "<?php\n\nclass VP_Control_Field_Select extends VP_Control_FieldMulti\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::__cons"
},
{
"path": "classes/control/field/slider.php",
"chars": 2567,
"preview": "<?php\n\nclass VP_Control_Field_Slider extends VP_Control_Field\n{\n\n\tprivate $_min;\n\n\tprivate $_max;\n\n\tprivate $_step;\n\n\tpu"
},
{
"path": "classes/control/field/sorter.php",
"chars": 1177,
"preview": "<?php\n\nclass VP_Control_Field_Sorter extends VP_Control_FieldMulti implements VP_MultiSelectable\n{\n\n\tprivate $_max_selec"
},
{
"path": "classes/control/field/textarea.php",
"chars": 652,
"preview": "<?php\n\nclass VP_Control_Field_TextArea extends VP_Control_Field\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::__constru"
},
{
"path": "classes/control/field/textbox.php",
"chars": 581,
"preview": "<?php\n\nclass VP_Control_Field_TextBox extends VP_Control_Field\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::__construc"
},
{
"path": "classes/control/field/toggle.php",
"chars": 620,
"preview": "<?php\n\nclass VP_Control_Field_Toggle extends VP_Control_Field\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::__construct"
},
{
"path": "classes/control/field/upload.php",
"chars": 733,
"preview": "<?php\n\nclass VP_Control_Field_Upload extends VP_Control_Field\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::__construct"
},
{
"path": "classes/control/field/wpeditor.php",
"chars": 2929,
"preview": "<?php\n\nclass VP_Control_Field_WPEditor extends VP_Control_Field\n{\n\n\tprivate $_use_external_plugins = true;\n\n\tpriva"
},
{
"path": "classes/control/field.php",
"chars": 8716,
"preview": "<?php\n\n/**\n * The smallest unit of an option, the field it self.\n */\nabstract class VP_Control_Field implements iFactory"
},
{
"path": "classes/control/fieldmulti.php",
"chars": 4204,
"preview": "<?php\n\n/**\n * The smallest unit of an item, the field it self.\n */\nabstract class VP_Control_FieldMulti extends VP_Contr"
},
{
"path": "classes/control/fieldmultiimage.php",
"chars": 1874,
"preview": "<?php\n\n/**\n * The smallest unit of an item, the field it self.\n */\nabstract class VP_Control_FieldMultiImage extends VP_"
},
{
"path": "classes/filesystem.php",
"chars": 2826,
"preview": "<?php\n\nclass VP_FileSystem\n{\n\n\tprivate static $_instance = null;\n\n\tprivate $_lookup_dirs = array();\n\n\tpublic static func"
},
{
"path": "classes/metabox/alchemy.php",
"chars": 16867,
"preview": "<?php\n\n/**\n * Extended version of WPAlchemy Class\n * so that it can process metabox using an array specification\n * and "
},
{
"path": "classes/metabox/depsloader.php",
"chars": 2614,
"preview": "<?php\n\nclass VP_Metabox_Depsloader\n{\n\n\t/**\n\t * ARRAY OF VP_METABOX_ALCHEMY OBJECT\n\t * @var [type]\n\t */\n\tprivate $things;"
},
{
"path": "classes/metabox.php",
"chars": 18243,
"preview": "<?php\n\n/**\n * Extended version of WPAlchemy Class\n * so that it can process metabox using an array specification\n * and "
},
{
"path": "classes/multiselectable.php",
"chars": 141,
"preview": "<?php\n\n/**\n * Implement this interface to state that the field control is Multi Selectable\n */\ninterface VP_MultiSelecta"
},
{
"path": "classes/option/control/field/impexp.php",
"chars": 503,
"preview": "<?php\n\nclass VP_Option_Control_Field_ImpExp extends VP_Control_Field\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::__co"
},
{
"path": "classes/option/control/field/restore.php",
"chars": 505,
"preview": "<?php\n\nclass VP_Option_Control_Field_Restore extends VP_Control_Field\n{\n\n\tpublic function __construct()\n\t{\n\t\tparent::__c"
},
{
"path": "classes/option/control/group/menu.php",
"chars": 1745,
"preview": "<?php\n\nclass VP_Option_Control_Group_Menu extends VP_Option_Control_Group\n{\n\n\t/**\n\t * Collection of $_menu\n\t * @var VP_O"
},
{
"path": "classes/option/control/group/section.php",
"chars": 1913,
"preview": "<?php\n\nclass VP_Option_Control_Group_Section extends VP_Option_Control_Group\n{\n\n\t/**\n\t * Collection of fields\n\t * @var V"
},
{
"path": "classes/option/control/group.php",
"chars": 2646,
"preview": "<?php\n\nabstract class VP_Option_Control_Group\n{\n\n\n\tprotected $_name;\n\n\tprotected $_title;\n\n\tprotected $_description;\n\n\tp"
},
{
"path": "classes/option/control/set.php",
"chars": 8150,
"preview": "<?php\n\nclass VP_Option_Control_Set\n{\n\n\tconst SAVE_SUCCESS = 1;\n\n\tconst SAVE_NOCHANGES = 2;\n\n\tconst SAVE_FAILED = 3;"
},
{
"path": "classes/option/depsloader.php",
"chars": 2068,
"preview": "<?php\n\nclass VP_Option_Depsloader\n{\n\n\t/**\n\t * The VP_Option_Set object!\n\t */\n\tprivate $things;\n\n\tpublic function __const"
},
{
"path": "classes/option/parser.php",
"chars": 3404,
"preview": "<?php\n\nclass VP_Option_Parser\n{\n\n\tpublic function parse_array_options($arr, $auto_group_naming)\n\t{\n\n\t\t$set = new VP_Opti"
},
{
"path": "classes/option.php",
"chars": 18875,
"preview": "<?php\n\nclass VP_Option\n{\n\n\tprivate $_option_key;\n\n\tprivate $_page_slug;\n\n\tprivate $_template;\n\n\tprivate $_is_dev_mode;\n\n"
},
{
"path": "classes/security.php",
"chars": 611,
"preview": "<?php\n\nclass VP_Security\n{\n\n\t/**\n\t * Singleton instance of the class\n\t * @var VP_Security\n\t */\n\tprivate static $_instanc"
},
{
"path": "classes/shortcodegenerator.php",
"chars": 9677,
"preview": "<?php\n\nclass VP_ShortcodeGenerator\n{\n\n\tpublic static $pool = array();\n\n\tpublic $name;\n\n\tpublic $template;\n\n\tpublic $moda"
},
{
"path": "classes/site/googlewebfont.php",
"chars": 2471,
"preview": "<?php\n\n/**\n * Singleton class to manage Google Web Fonts embedding,\n * add the fonts with the weight and style\n * \n */\nc"
},
{
"path": "classes/util/array.php",
"chars": 2799,
"preview": "<?php\n\nclass VP_Util_Array\n{\n\n\tpublic static function first($array)\n\t{\n\t\tif( !empty($array) and !is_null($array) )\n\t\t{\n\t"
},
{
"path": "classes/util/config.php",
"chars": 1046,
"preview": "<?php\n\n/**\n * Config files loader\n */\n\nclass VP_Util_Config\n{\n\n\tprivate static $_instance;\n\n\tprivate $_configs;\n\n\tprivat"
},
{
"path": "classes/util/profiler.php",
"chars": 401,
"preview": "<?php\n\nclass VP_Util_Profiler\n{\n\n\tpublic static function show_memtime()\n\t{\n\t\t$time_elapsed = microtime(true) - VP_START_"
},
{
"path": "classes/util/reflection.php",
"chars": 1230,
"preview": "<?php\n\nclass VP_Util_Reflection\n{\n\n\tpublic static function is_multiselectable($object)\n\t{\n\t\tif(is_object($object))\n\t\t{\n\t"
},
{
"path": "classes/util/res.php",
"chars": 1753,
"preview": "<?php\n\nclass VP_Util_Res\n{\n\n\tpublic static function is_font_awesome($icon)\n\t{\n\t\tif (strpos($icon, 'font-awesome:') === 0"
},
{
"path": "classes/util/text.php",
"chars": 1763,
"preview": "<?php\n\nclass VP_Util_Text\n{\n\n\tpublic static function parse_md($text)\n\t{\n\t\tif(!class_exists('Parsedown'))\n\t\t{\n\t\t\t$path = "
},
{
"path": "classes/view.php",
"chars": 1060,
"preview": "<?php\n\n/**\n * A Singleton class for loading view template\n */\nclass VP_View\n{\n\n\t/**\n\t * Singleton instance of the class\n"
},
{
"path": "classes/wp/admin.php",
"chars": 1569,
"preview": "<?php\n\nclass VP_WP_Admin\n{\n\n\t/**\n\t * [taken from WPAlchemy Class by Dimas Begunoff]\n\t * Used to check if creating or edi"
},
{
"path": "classes/wp/enqueuer.php",
"chars": 665,
"preview": "<?php\n\n/**\n * For singleton accessor, use VP_WP_MassEnqueuer class instead.\n */\nclass VP_WP_Enqueuer\n{\n\n\tprivate $_loade"
},
{
"path": "classes/wp/loader.php",
"chars": 9515,
"preview": "<?php\n\nclass VP_WP_Loader\n{\n\n\tprivate static $_instance;\n\n\tprivate $_js_data = array();\n\n\tprivate $_css_data = array();\n"
},
{
"path": "classes/wp/massenqueuer.php",
"chars": 296,
"preview": "<?php\n\n/**\n * For singleton accessor, use VP_WP_MassEnqueuer class instead.\n */\nclass VP_WP_MassEnqueuer\n{\n\tprivate stat"
},
{
"path": "classes/wp/user.php",
"chars": 993,
"preview": "<?php\n\nclass VP_WP_User\n{\n\n\tpublic static function get_users()\n\t{\n\t\tglobal $wpdb;\n\t\tif(function_exists('get_users'))\n\t\t{"
},
{
"path": "classes/wp/util.php",
"chars": 702,
"preview": "<?php\n\nclass VP_WP_Util\n{\n\n\tpublic static function kses_html($html)\n\t{\n\t\tif( function_exists('wp_kses_allowed_html') ) {"
},
{
"path": "config/dependencies.php",
"chars": 6357,
"preview": "<?php\n\nreturn array(\n\n\t////////////////////////////////////////////////\n\t// Scripts and Styles Dependencies Definition /"
},
{
"path": "config/messages.php",
"chars": 1848,
"preview": "<?php\n\nreturn array(\n\n\t////////////////////////////////////////\n\t// Localized JS Message Configuration //\n\t/////////////"
},
{
"path": "constant.php",
"chars": 1991,
"preview": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Vafpress Framework Constants\n|--"
},
{
"path": "credits.txt",
"chars": 326,
"preview": "Metabox Support:\n\n- WPAlchemy MetaBox PHP Class\n by Dimas Begunoff\n http://www.farinspace.com/wpalchemy-metabox/\n\n- Mu"
},
{
"path": "data/gwf.json",
"chars": 58068,
"preview": "{\"ABeeZee\":{\"weights\":[\"normal\"],\"styles\":[\"normal\",\"italic\"],\"subsets\":[\"latin\"]},\"Abel\":{\"weights\":[\"normal\"],\"styles\""
},
{
"path": "data/sources.php",
"chars": 5461,
"preview": "<?php\n\n/**\n * Here is the place to put your own defined function that serve as\n * datasource to field with multiple opti"
},
{
"path": "includes/parsedown.php",
"chars": 39568,
"preview": "<?php\n\n#\n#\n# Parsedown\n# http://parsedown.org\n#\n# (c) Emanuil Rusev\n# http://erusev.com\n#\n# For the full license informa"
},
{
"path": "includes/wpalchemy/MetaBox.php",
"chars": 59776,
"preview": "<?php\n\n/**\n * @author\t\tDimas Begunoff\n * @copyright\tCopyright (c) 2009, Dimas Begunoff, http://farinspace.com\n * @licens"
},
{
"path": "lang/README.md",
"chars": 784,
"preview": "# Vafpress Framework I18n\n\nHelp us translating the framework:\n\nhttps://www.transifex.com/projects/p/vafpress-framework/\n"
},
{
"path": "lang/vafpress-framework.pot",
"chars": 6198,
"preview": "# LANGUAGE (LOCALE) translation for Vafpress Framework.\n# Copyright (C) 2013 Vafpress.com\n# Translators:\nmsgid \"\"\nmsgstr"
},
{
"path": "public/css/metabox.css",
"chars": 13179,
"preview": ".vp-metabox *,.vp-metabox *:before,.vp-metabox *:after {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n"
},
{
"path": "public/css/option.css",
"chars": 20700,
"preview": "/* General\n * ==================================================== */\n.vp-wrap .vp-option-panel a:hover,.vp-wrap .vp-opt"
},
{
"path": "public/css/shortcode.css",
"chars": 12558,
"preview": ".vp-sc-wrapper {\n\tdisplay: table;\n\twidth: 100%;\n\tpadding-top: 10px;\n\ttable-layout: fixed;\n\theight: 100%;\n}\n.vp-sc-wrappe"
},
{
"path": "public/css/vendor/bootstrap-colorpicker.css",
"chars": 2422,
"preview": " /*\n\tColorpicker for Bootstrap\n\tCopyright 2012 Stefan Petre \n\tLicensed under the Apache License v2.0\n\thttp://www.apache."
},
{
"path": "public/css/vendor/colorpicker.css",
"chars": 3183,
"preview": ".colorpicker {\n\twidth: 356px;\n\theight: 176px;\n\toverflow: hidden;\n\tposition: absolute;\n\tbackground: url(../../img/colorpi"
},
{
"path": "public/css/vendor/jqueryui/themes/smoothness/jquery-ui-1.9.2.custom.css",
"chars": 32278,
"preview": "/*! jQuery UI - v1.9.2 - 2012-11-28\n* http://jqueryui.com\n* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquer"
},
{
"path": "public/css/vendor/reveal.css",
"chars": 1657,
"preview": "/*\t--------------------------------------------------\n\tReveal Modals\n\t--------------------------------------------------"
},
{
"path": "public/css/vendor/select2.css",
"chars": 19586,
"preview": "/*\nVersion: 3.3.2 Timestamp: Mon Mar 25 12:14:18 PDT 2013\n*/\n.select2-container {\n position: relative;\n display: i"
},
{
"path": "public/css/vendor/tipsy.css",
"chars": 2186,
"preview": ".tipsy { font-size: 11px; line-height: 1.4em; position: absolute; padding: 5px; z-index: 100000; }\n .tipsy-inner { back"
},
{
"path": "public/js/dummy.js",
"chars": 1,
"preview": ";"
},
{
"path": "public/js/kia-metabox.js",
"chars": 5955,
"preview": "/*-----------------------------------------------------------------------------------*/\n/* KIA Metabox scripts\n/*\n/* upl"
},
{
"path": "public/js/metabox.js",
"chars": 9754,
"preview": ";(function($) {\n\n\t\"use strict\";\n\n\tvar validation = [];\n\tvar bindings = [];\n\tvar items_binding = [];\n\tvar depende"
},
{
"path": "public/js/option.js",
"chars": 11004,
"preview": ";(function($) {\n\n\t\"use strict\";\n\n\t// jQuery hacks\n\tvar _addClass = $.fn.addClass;\n\t$.fn.addClass = function() {\n\t\tvar re"
},
{
"path": "public/js/shared.js",
"chars": 32619,
"preview": "/* =============================================================\n * JQuery or Other Extension\n * ======================="
},
{
"path": "public/js/shortcode-menu.js",
"chars": 6731,
"preview": "(function($){\n\t$(document).ready(function(){\n\t\tif(!jQuery.fn.insertAtCaret)\n\t\t{\n\t\t\tjQuery.fn.insertAtCaret = function(te"
},
{
"path": "public/js/shortcode-quicktags.js",
"chars": 327,
"preview": "(function($){\n\n\tif( typeof QTags !== 'undefined' )\n\t{\n\t\tvar qt_cb = function(name){\n\t\t\treturn function(){\n\t\t\t\ttinyMCE.ex"
},
{
"path": "public/js/shortcodes.js",
"chars": 1377,
"preview": "(function($){\n\tfunction create(sg)\n\t{\n\t\ttinymce.create('tinymce.plugins.' + sg.name, {\n\t\t\tinit: function(ed, url) {\n\t\t\t\t"
},
{
"path": "public/js/vendor/ace/ace.js",
"chars": 283163,
"preview": "(function(){function o(e){var i=function(e,t){return r(\"\",e,t)},s=t;e&&(t[e]||(t[e]={}),s=t[e]);if(!s.define||!s.define."
},
{
"path": "public/js/vendor/ace/mode-css.js",
"chars": 18326,
"preview": "ace.define(\"ace/mode/css\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/tokenizer\",\"ace/mode/css_high"
},
{
"path": "public/js/vendor/ace/mode-html.js",
"chars": 41592,
"preview": "ace.define(\"ace/mode/html\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/javascript\",\"ace/mode/c"
},
{
"path": "public/js/vendor/ace/mode-javascript.js",
"chars": 19596,
"preview": "ace.define(\"ace/mode/javascript\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/tokenizer\",\"ace/mode/j"
},
{
"path": "public/js/vendor/ace/mode-json.js",
"chars": 9145,
"preview": "ace.define(\"ace/mode/json\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/tokenizer\",\"ace/mode/json_hi"
},
{
"path": "public/js/vendor/ace/mode-markdown.js",
"chars": 48578,
"preview": "ace.define(\"ace/mode/markdown\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/javascript\",\"ace/mo"
},
{
"path": "public/js/vendor/ace/mode-php.js",
"chars": 141891,
"preview": "ace.define(\"ace/mode/php\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/tokenizer\",\"ace/mode/php_high"
},
{
"path": "public/js/vendor/ace/mode-xml.js",
"chars": 12429,
"preview": "ace.define(\"ace/mode/xml\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/tokenizer\",\"ace/mode/xml_high"
},
{
"path": "public/js/vendor/ace/theme-chaos.js",
"chars": 2657,
"preview": "ace.define(\"ace/theme/chaos\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!0,t.cssClass=\"ace-ch"
},
{
"path": "public/js/vendor/ace/theme-chrome.js",
"chars": 2848,
"preview": "ace.define(\"ace/theme/chrome\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssClass=\"ace-c"
},
{
"path": "public/js/vendor/ace/theme-clouds.js",
"chars": 2322,
"preview": "ace.define(\"ace/theme/clouds\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssClass=\"ace-c"
},
{
"path": "public/js/vendor/ace/theme-clouds_midnight.js",
"chars": 2703,
"preview": "ace.define(\"ace/theme/clouds_midnight\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!0,t.cssCla"
},
{
"path": "public/js/vendor/ace/theme-cobalt.js",
"chars": 2535,
"preview": "ace.define(\"ace/theme/cobalt\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!0,t.cssClass=\"ace-c"
},
{
"path": "public/js/vendor/ace/theme-crimson_editor.js",
"chars": 2985,
"preview": "ace.define(\"ace/theme/crimson_editor\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssText"
},
{
"path": "public/js/vendor/ace/theme-dawn.js",
"chars": 2436,
"preview": "ace.define(\"ace/theme/dawn\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssClass=\"ace-daw"
},
{
"path": "public/js/vendor/ace/theme-dreamweaver.js",
"chars": 3244,
"preview": "ace.define(\"ace/theme/dreamweaver\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssClass=\""
},
{
"path": "public/js/vendor/ace/theme-eclipse.js",
"chars": 2052,
"preview": "ace.define(\"ace/theme/eclipse\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssText='.ace-"
},
{
"path": "public/js/vendor/ace/theme-github.js",
"chars": 2457,
"preview": "ace.define(\"ace/theme/github\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssClass=\"ace-g"
},
{
"path": "public/js/vendor/ace/theme-mono_industrial.js",
"chars": 3059,
"preview": "ace.define(\"ace/theme/mono_industrial\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!0,t.cssCla"
},
{
"path": "public/js/vendor/ace/theme-monokai.js",
"chars": 2476,
"preview": "ace.define(\"ace/theme/monokai\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!0,t.cssClass=\"ace-"
},
{
"path": "public/js/vendor/ace/theme-solarized_dark.js",
"chars": 2577,
"preview": "ace.define(\"ace/theme/solarized_dark\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!0,t.cssClas"
},
{
"path": "public/js/vendor/ace/theme-solarized_light.js",
"chars": 2618,
"preview": "ace.define(\"ace/theme/solarized_light\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssCla"
},
{
"path": "public/js/vendor/ace/theme-textmate.js",
"chars": 2723,
"preview": "ace.define(\"ace/theme/textmate\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!1,t.cssClass=\"ace"
},
{
"path": "public/js/vendor/ace/theme-twilight.js",
"chars": 2695,
"preview": "ace.define(\"ace/theme/twilight\",[\"require\",\"exports\",\"module\",\"ace/lib/dom\"],function(e,t,n){t.isDark=!0,t.cssClass=\"ace"
},
{
"path": "public/js/vendor/ace/worker-css.js",
"chars": 121155,
"preview": "\"no use strict\";function initBaseUrls(e){require.tlns=e}function initSender(){var e=require(null,\"ace/lib/event_emitter\""
},
{
"path": "public/js/vendor/ace/worker-javascript.js",
"chars": 81510,
"preview": "\"no use strict\";function initBaseUrls(e){require.tlns=e}function initSender(){var e=require(null,\"ace/lib/event_emitter\""
},
{
"path": "public/js/vendor/ace/worker-json.js",
"chars": 30751,
"preview": "\"no use strict\";function initBaseUrls(e){require.tlns=e}function initSender(){var e=require(null,\"ace/lib/event_emitter\""
},
{
"path": "public/js/vendor/ace/worker-php.js",
"chars": 132190,
"preview": "\"no use strict\";function initBaseUrls(e){require.tlns=e}function initSender(){var e=require(null,\"ace/lib/event_emitter\""
},
{
"path": "public/js/vendor/bootstrap-colorpicker.js",
"chars": 18009,
"preview": "/* =========================================================\n * bootstrap-colorpicker.js \n * http://www.eyecon.ro/bootst"
},
{
"path": "public/js/vendor/jquery-scrollspy.js",
"chars": 3251,
"preview": "/*!\n * jQuery Scrollspy Plugin\n * Author: @sxalexander\n * Licensed under the MIT license\n */\n\n\n;(function ( $, window, d"
},
{
"path": "public/js/vendor/jquery.reveal.js",
"chars": 4850,
"preview": "/*\n * jQuery Reveal Plugin 1.0\n * www.ZURB.com\n * Copyright 2010, ZURB\n * Free to use under the MIT license.\n * http://w"
},
{
"path": "public/js/vendor/jquery.tipsy.js",
"chars": 9787,
"preview": "// tipsy, facebook style tooltips for jquery\n// version 1.0.0a\n// (c) 2008-2010 jason frame [jason@onehackoranother.com]"
},
{
"path": "public/js/vendor/select2.sortable.js",
"chars": 3413,
"preview": "/**\n * jQuery Select2 Sortable\n * - enable select2 to be sortable via normal select element\n * \n * author : Vafour\n"
},
{
"path": "views/control/checkbox.php",
"chars": 550,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<?php foreach ($"
},
{
"path": "views/control/checkimage.php",
"chars": 842,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<?php foreach ($"
},
{
"path": "views/control/codeeditor.php",
"chars": 377,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<textarea class="
},
{
"path": "views/control/color.php",
"chars": 493,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<label class=\"in"
},
{
"path": "views/control/date.php",
"chars": 322,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<input <?php ech"
},
{
"path": "views/control/fontawesome.php",
"chars": 523,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<select name=\"<?"
},
{
"path": "views/control/html.php",
"chars": 870,
"preview": "<?php extract($head_info); ?>\n\n<div class=\"vp-field <?php echo $type; ?><?php echo !empty($container_extra_classes) ? ('"
},
{
"path": "views/control/multiselect.php",
"chars": 502,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<select multiple"
},
{
"path": "views/control/notebox.php",
"chars": 1085,
"preview": "<?php extract($head_info); ?>\n\n<?php if(!$is_compact): ?>\n<div class=\"vp-field <?php echo $type; ?><?php echo !empty($co"
},
{
"path": "views/control/radiobutton.php",
"chars": 539,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<?php foreach ($"
},
{
"path": "views/control/radioimage.php",
"chars": 831,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<?php foreach ($"
},
{
"path": "views/control/select.php",
"chars": 504,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<select name=\"<?"
},
{
"path": "views/control/slider.php",
"chars": 514,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<input type=\"tex"
},
{
"path": "views/control/sorter.php",
"chars": 702,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<select multiple"
},
{
"path": "views/control/template_control_foot.php",
"chars": 201,
"preview": "\t\t</div>\n\t\t<div class=\"vp-js-bind-loader vp-field-loader vp-hide\"><img src=\"<?php VP_Util_Res::img_out('ajax-loader.gif'"
},
{
"path": "views/control/template_control_head.php",
"chars": 814,
"preview": "<div class=\"vp-field <?php echo $type; ?><?php echo !empty($container_extra_classes) ? (' ' . $container_extra_classes) "
},
{
"path": "views/control/textarea.php",
"chars": 293,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<textarea class="
},
{
"path": "views/control/textbox.php",
"chars": 313,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<input type=\"tex"
},
{
"path": "views/control/toggle.php",
"chars": 385,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<label>\n\t<input "
},
{
"path": "views/control/upload.php",
"chars": 625,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<input class=\"vp"
},
{
"path": "views/control/wpeditor.php",
"chars": 829,
"preview": "<?php if(!$is_compact) echo VP_View::instance()->load('control/template_control_head', $head_info); ?>\n\n<?php\n\t// prepar"
},
{
"path": "views/option/impexp.php",
"chars": 1699,
"preview": "<div class=\"vp-field vp-textarea\" data-vp-type=\"vp-textarea\">\n\t<div class=\"label\">\n\t\t<label>\n\t\t\t<?php _e('Import', 'vp_t"
},
{
"path": "views/option/menu.php",
"chars": 676,
"preview": "<?php $submenus = $menu->get_menus(); ?>\n<?php if (!empty($submenus)): ?>\n\t<?php foreach ($submenus as $submenu): ?>\n\t<?"
},
{
"path": "views/option/restore.php",
"chars": 972,
"preview": "<div class=\"vp-field\">\n\t<div class=\"label\">\n\t\t<label>\n\t\t\t<?php _e('Restore Default Options', 'vp_textdomain') ?>\n\t\t</lab"
},
{
"path": "views/option/section.php",
"chars": 660,
"preview": "<div <?php VP_Util_Text::print_if_exists($section->get_name(), 'id=\"%s\" '); ?>\n\tclass=\"vp-section<?php echo !empty($cont"
},
{
"path": "views/option/set.php",
"chars": 4404,
"preview": "<div class=\"wrap\">\n\t<h2><?php echo $set->get_title(); ?></h2>\n\t<div id=\"vp-wrap\" class=\"vp-wrap\">\n\t\t<div id=\"vp-option-p"
}
]
// ... and 8 more files (download for full content)
About this extraction
This page contains the full source code of the vafour/vafpress-framework GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 152 files (1.5 MB), approximately 487.2k tokens, and a symbol index with 811 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.