Beispiel #1
0
 /**
  * Adds all data to a single array.
  */
 function set_data()
 {
     $array['config'] = $this->set_config_data();
     $array['urls'] = pl_get_system_urls();
     $array['modelData'] = $this->factory->get_view_model();
     $array['extraData'] = array();
     return apply_filters('pl_site_json', $array);
 }
Beispiel #2
0
 function workarea_config()
 {
     global $pl_medialib, $pl_notifications;
     $a = array('siteName' => get_bloginfo('name'), 'siteDescription' => get_bloginfo('description'), 'plURL' => get_template_directory_uri(), 'siteURL' => do_shortcode('[pl_site_url]'), 'homeURL' => do_shortcode('[pl_home_url]'), 'uploadsURL' => do_shortcode('[pl_uploads_url]'), 'adminURL' => admin_url(), 'PLUI' => pl_framework_url('ui'), 'frontPage' => get_option('show_on_front', 'posts'), 'ajaxURL' => pl_ajax_url(), 'security' => wp_create_nonce('pl-ajax-nonce'), 'models' => array());
     $a['factory'] = $this->set_factory();
     // Edit current post URL
     $a['editPost'] = plns_edit_post_link();
     // Add menus URL
     $a['menus'] = admin_url("nav-menus.php");
     // Add/edit widgets URL
     $a['widgets'] = admin_url("widgets.php");
     // URL of core framework
     $a['CoreURL'] = get_template_directory_uri();
     // URL of parent theme
     $a['ParentStyleSheetURL'] = get_template_directory_uri();
     // URL of child theme, if active
     $a['ChildStyleSheetURL'] = get_stylesheet_directory_uri();
     $a['extendURL'] = function_exists('PL_Platform') ? PL_Platform()->url('extend') : '';
     // Media library link for use in iFrame
     $a['mediaLibrary'] = $pl_medialib->pl_media_library_link();
     //  Media library videos link for use in iFrame
     $a['mediaLibraryVideo'] = $pl_medialib->pl_media_library_link("video");
     // Add media link
     $a['addMediaURL'] = admin_url("media-new.php");
     // ID of the currently active user
     $a['userID'] = wp_get_current_user()->ID;
     // A cache key for various settings
     $a['CacheKey'] = pl_cache_key();
     // Is the user on localhost
     $a['LocalHost'] = pl_is_local();
     // Is developer mode activated?
     $a['debug'] = pl_dev_mode() ? 'true' : 'false';
     $a['btns'] = pl_btn_classes();
     $a['btnSizes'] = pl_button_sizes();
     $a['imgSizes'] = get_intermediate_image_sizes();
     $a['animations'] = pl_animations();
     $a['taxes'] = pl_get_taxonomies();
     $a['icons'] = pl_icons();
     $a['menus'] = pl_get_menus();
     $a['sidebars'] = pl_get_sidebars();
     $a['notifications'] = $pl_notifications;
     $a['urls'] = pl_get_system_urls();
     $a['translate'] = array();
     $a['locale'] = get_locale();
     return apply_filters('pl_workarea_json', $a);
 }