<?php
/*
Plugin Name: Code
Plugin URI: http://premium.wpmudev.org/project/upfront
Description: Upfront element for custom code (css/js/html)
Version: 0.1
Text Domain: ufcode
Author: WPMU DEV
Author URI: http://premium.wpmudev.org

Copyright 2009-2013 Incsub (http://incsub.com)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License (Version 2 - GPLv2) as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/**
 * Registers the element in Upfront
 */
function ufcode_initialize () {
	// Include the backend support stuff
	require_once (dirname(__FILE__) . '/lib/upfront_code.php');

	add_filter('upfront_l10n', array('Upfront_CodeView', 'add_l10n_strings'));
	add_filter('upfront_data', array('Upfront_CodeView', 'add_js_defaults'));

	// Expose our JavaScript definitions to the Upfront API
	upfront_add_layout_editor_entity('upfront_code', upfront_relative_element_url('js/upfront_code', __FILE__));
}

//Hook it when Upfront is ready
add_action('upfront-core-initialized', 'ufcode_initialize');