Ejemplo n.º 1
0
 public function initialize()
 {
     require_once dirname(__FILE__) . '/lib/class_upfront_posts_model.php';
     require_once dirname(__FILE__) . '/lib/class_upfront_posts_data.php';
     require_once dirname(__FILE__) . '/lib/class_upfront_posts_posts_view.php';
     require_once dirname(__FILE__) . '/lib/class_upfront_posts_post_view.php';
     require_once dirname(__FILE__) . '/lib/class_upfront_posts_frontend_view.php';
     upfront_add_layout_editor_entity('uposts', upfront_relative_element_url('js/posts-list', __FILE__));
     upfront_add_element_style('upfront-posts', array('css/public.css', __FILE__));
     if (Upfront_Permissions::current(Upfront_Permissions::BOOT)) {
         upfront_add_element_style('upfront-posts-editor', array('css/editor.css', __FILE__));
     }
     add_filter('upfront_data', array('Upfront_Posts_PostsData', 'add_js_defaults'));
     add_filter('upfront_l10n', array('Upfront_Posts_PostsData', 'add_l10n_strings'));
     upfront_add_ajax('upfront_posts-load', array($this, "load_posts"));
     upfront_add_ajax('upfront_posts-data', array($this, "load_data"));
     upfront_add_ajax('upfront_posts-terms', array($this, "load_terms"));
     upfront_add_ajax('upfront_posts-list_meta', array($this, "load_meta"));
     if (Upfront_Permissions::current(Upfront_Permissions::BOOT)) {
         add_action('wp_footer', array($this, 'pickle_query'), 99);
     }
     // Handle legacy element parsing
     add_filter('upfront-virtual_region-object_defaults-fallback', array($this, 'handle_legacy_data'), 10, 2);
     add_filter('upfront-output-get_markup-fallback', array($this, 'handle_legacy_output'), 10, 2);
     // Force out the 404 handling for archives
     add_action('parse_request', array($this, 'force_wp_archive_limit'));
 }
Ejemplo n.º 2
0
function utext_init()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/upfront_text.php';
    add_filter('upfront_l10n', array('Upfront_PlainTxtView', 'add_l10n_strings'));
    add_filter('upfront-export-plaintxt-object_content', array('Upfront_PlainTxtView', 'export_content'));
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('utext', upfront_relative_element_url('js/utext', __FILE__));
}
Ejemplo n.º 3
0
/**
 * 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__));
}
Ejemplo n.º 4
0
/**
 * This is the entity entry point, where we inform Upfront of our existence.
 */
function this_page_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/this_page.php';
    // Add element defaults to data object
    add_action('upfront_data', array('Upfront_ThisPageView', 'add_js_defaults'));
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('this_page', upfront_relative_element_url('js/this_page', __FILE__));
    add_filter('upfront_l10n', array('Upfront_ThisPageView', 'add_l10n_strings'));
}
Ejemplo n.º 5
0
function ubutton_init()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/upfront_button.php';
    require_once dirname(__FILE__) . '/lib/class_upfront_button_presets_server.php';
    add_filter('upfront_l10n', array('Upfront_ButtonView', 'add_l10n_strings'));
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('ubutton', upfront_relative_element_url('js/ubutton', __FILE__));
    add_action('wp_enqueue_scripts', array('Upfront_ButtonView', 'add_styles_scripts'));
}
Ejemplo n.º 6
0
/**
 * This is the entity entry point, where we inform Upfront of our existence.
 */
function ucomment_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/upfront_comment.php';
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('ucomment', upfront_relative_element_url('js/ucomment', __FILE__));
    // Add element defaults to data object
    add_action('upfront_data', array('Upfront_UcommentView', 'add_js_defaults'));
    add_filter('upfront_l10n', array('Upfront_UcommentView', 'add_l10n_strings'));
    add_action('wp_enqueue_scripts', array('Upfront_UcommentView', 'add_public_script'));
}
Ejemplo n.º 7
0
function upfront_like_box_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/upfront-like-box.php';
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('upfront-like-box', upfront_relative_element_url('js/upfront-like-box', __FILE__));
    //Add defaults
    add_action('upfront_data', array('Upfront_LikeBoxView', 'add_js_defaults'));
    add_filter('upfront_l10n', array('Upfront_LikeBoxView', 'add_l10n_strings'));
    // Add the public stylesheet
    add_action('wp_enqueue_scripts', array('Upfront_LikeBoxView', 'add_public_style'));
}
Ejemplo n.º 8
0
/**
 * This is the entity entry point, where we inform Upfront of our existence.
 */
function usearch_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/upfront_search.php';
    // Add element defaults to data object
    add_action('upfront_data', array('Upfront_UsearchView', 'add_js_defaults'));
    add_filter('upfront_l10n', array('Upfront_UsearchView', 'add_l10n_strings'));
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('usearch', upfront_relative_element_url('js/usearch', __FILE__));
    // Add styles and dependencies
    add_action('wp_enqueue_scripts', array('Upfront_UsearchView', 'add_frontend_dependencies'));
}
Ejemplo n.º 9
0
/**
 * Registers the element in Upfront
 */
function uyoutube_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/uyoutube.php';
    add_filter('upfront_l10n', array('Upfront_UyoutubeView', 'add_l10n_strings'));
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('uyoutube', upfront_relative_element_url('js/uyoutube', __FILE__));
    // Add element defaults to data object
    $uyoutube = new Upfront_UyoutubeView(array());
    add_action('upfront_data', array($uyoutube, 'add_js_defaults'));
    // Add the public stylesheet
    add_action('wp_enqueue_scripts', array('Upfront_UyoutubeView', 'add_styles_scripts'));
}
Ejemplo n.º 10
0
function upfront_social_media_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/upfront-social-media.php';
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('upfront-social_media', upfront_relative_element_url('js/upfront-social-media', __FILE__));
    // Add the public stylesheet
    add_action('wp_enqueue_scripts', array('Upfront_SocialMediaView', 'add_public_style'));
    add_action('upfront_data', array('Upfront_SocialMediaView', 'add_upfront_data'));
    add_filter('upfront_l10n', array('Upfront_SocialMediaView', 'add_l10n_strings'));
    //Add social to the posts
    Upfront_SocialMedia_Setting::add_post_filters();
}
Ejemplo n.º 11
0
/**
 * This is the entity entry point, where we inform Upfront of our existence.
 */
function this_post_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/this_post.php';
    // Add element defaults to data object
    add_action('upfront_data', array('Upfront_ThisPostView', 'add_js_defaults'));
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('this_post', upfront_relative_element_url('js/this_post', __FILE__));
    add_filter('upfront_l10n', array('Upfront_ThisPostView', 'add_l10n_strings'));
    // Define fallback selectors, if nothing else got in
    add_action('upfront_post_selectors', array('Upfront_ThisPostView', 'add_fallback_selectors'), 999);
    // <-- register late
}
Ejemplo n.º 12
0
/**
 * This is the entity entry point, where we inform Upfront of our existence.
 */
function uwidget_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/class_upfront_widget_view.php';
    require_once dirname(__FILE__) . '/lib/class_upfront_widget.php';
    require_once dirname(__FILE__) . '/lib/class_upfront_widget_server.php';
    // Add element defaults to data object
    add_action('upfront_data', array('Upfront_UwidgetView', 'add_js_defaults'));
    add_filter('upfront_l10n', array('Upfront_UwidgetView', 'add_l10n_strings'));
    add_filter('upfront_data', array('Upfront_UwidgetView', 'add_data'));
    add_filter('wp_enqueue_scripts', array('Upfront_UwidgetView', 'add_dependencies'));
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('uwidget', upfront_relative_element_url('js/uwidget', __FILE__));
}
Ejemplo n.º 13
0
/**
 * Registers the element in Upfront
 */
function ugallery_initialize()
{
    // Include the backend support stuff
    $domain = 'ugallery';
    require_once dirname(__FILE__) . '/lib/' . $domain . '.php';
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('' . $domain . '', upfront_relative_element_url('js/' . $domain . '', __FILE__));
    // Add element defaults to data object
    $ugallery = new Upfront_UgalleryView(array());
    add_action('upfront_data', array($ugallery, 'add_js_defaults'));
    add_filter('upfront_l10n', array('Upfront_UgalleryView', 'add_l10n_strings'));
    add_filter('upfront-export-ugallery-object_content', array('Upfront_UgalleryView', 'export_content'), 10, 2);
    // Add the public stylesheet
    add_action('wp_enqueue_scripts', array('Upfront_' . ucwords($domain) . 'View', 'add_styles_scripts'));
}
Ejemplo n.º 14
0
/**
 * This is the entity entry point, where we inform Upfront of our existence.
 */
function unewnavigation_initialize()
{
    // Include the backend support stuff
    require_once dirname(__FILE__) . '/lib/unewnavigation.php';
    // Include the backend support stuff
    require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
    // Add element defaults to data object
    add_action('upfront_data', array('Upfront_UnewnavigationView', 'add_js_defaults'));
    add_filter('upfront_l10n', array('Upfront_UnewnavigationView', 'add_l10n_strings'));
    // Expose our JavaScript definitions to the Upfront API
    upfront_add_layout_editor_entity('unewnavigation', upfront_relative_element_url('js/unewnavigation', __FILE__));
    add_action('wp_enqueue_scripts', array('Upfront_UnewnavigationView', 'add_styles_scripts'));
    // Add the public stylesheet
    //    add_action('wp_enqueue_scripts', array('Upfront_UnewnavigationView', 'add_public_dependencies'));
}
Ejemplo n.º 15
0
function upfront_maps_add_context_menu($paths)
{
    $paths['maps_context_menu'] = upfront_relative_element_url('js/ContextMenu', dirname(__FILE__));
    return $paths;
}