示例#1
0
 private static function get_post_create_layout_archive()
 {
     $tool_admin_bar = Toolset_Admin_Bar_Menu::get_instance();
     // change name to 'home-blog' for build-in "Posts"
     $post_type = self::$post_type->name == 'post' ? 'home-blog' : self::$post_type->name;
     return $tool_admin_bar->get_edit_link('layouts', true, $post_type, 'archive', 0);
 }
示例#2
0
 private static function get_post_create_layout_archive()
 {
     if (self::$post_type_create_layout_archive === null) {
         $tool_admin_bar = Toolset_Admin_Bar_Menu::get_instance();
         self::$post_type_create_layout_archive = $tool_admin_bar->get_edit_link('layouts', true, self::$post_type->name, 'archive', 0);
     }
     return self::$post_type_create_layout_archive;
 }
            } else {
                if ('views' === $plugin && '404' != $type) {
                    if ($is_new) {
                        $edit_link = wp_nonce_url(admin_url(sprintf('admin.php?page=views_create_auto&type=%s&class=%s&post=%s', $type, $class, $post_id)), 'create_auto');
                    } else {
                        if ($post_id > 0) {
                            if ('archive' === $class) {
                                // Views' WordPress Archive editor
                                $edit_link = admin_url(sprintf('admin.php?page=view-archives-editor&view_id=%s', $post_id));
                            } else {
                                if ('page' === $class) {
                                    // Views' Content Temaplate editor
                                    //$edit_link = admin_url( sprintf( 'post.php?action=edit&post=%s', $post_id ) );
                                    $edit_link = esc_url_raw(add_query_arg(array('page' => WPV_CT_EDITOR_PAGE_NAME, 'ct_id' => esc_attr($post_id), 'action' => 'edit'), admin_url('admin.php')));
                                }
                            }
                        }
                    }
                }
            }
            return $edit_link;
        }
    }
    // We have checked if @class Toolset_Admin_Bar_Menu already existed.
    // After that, we've defined the class. Now, we instantiate it once.
    // This works lìke a singleton.
    // But the class itself is also a singleton. Using design patterns
    // clarifies and prevents against changes in future.
    global $toolset_admin_bar_menu;
    $toolset_admin_bar_menu = Toolset_Admin_Bar_Menu::get_instance();
}
示例#4
0
 public function register_inc()
 {
     $sections_loaded = self::$sections_loaded;
     if (!in_array('toolset_inc', $sections_loaded)) {
         $sections_loaded[] = 'toolset_inc';
         if (!class_exists('Toolset_Settings')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.settings.class.php';
             $this->settings = Toolset_Settings::get_instance();
         }
         if (!class_exists('Toolset_Localization')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.localization.class.php';
             $this->localization = new Toolset_Localization();
         }
         if (!class_exists('Toolset_WPLogger')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.wplogger.class.php';
         }
         if (!class_exists('Toolset_Object_Relationship')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.object.relationship.class.php';
             $this->object_relationship = Toolset_Object_Relationship::get_instance();
         }
         if (!class_exists('Toolset_Settings_Screen')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.settings.screen.class.php';
             $this->settings_screen = new Toolset_Settings_Screen();
         }
         if (!class_exists('Toolset_Export_Import_Screen')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.export.import.screen.class.php';
             $this->export_import_screen = new Toolset_Export_Import_Screen();
         }
         if (!class_exists('Toolset_Menu')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.menu.class.php';
             $this->menu = new Toolset_Menu();
         }
         if (!class_exists('Toolset_Promotion')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.promotion.class.php';
             $this->promotion = new Toolset_Promotion();
         }
         if (!class_exists('Toolset_Admin_Bar_Menu')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.admin.bar.menu.class.php';
             global $toolset_admin_bar_menu;
             $toolset_admin_bar_menu = Toolset_Admin_Bar_Menu::get_instance();
         }
         if (!class_exists('Toolset_WPML_Compatibility')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.wpml.compatibility.class.php';
             $this->wpml_compatibility = new Toolset_WPML_Compatibility();
         }
         require_once TOOLSET_COMMON_PATH . '/inc/toolset.compatibility.php';
         require_once TOOLSET_COMMON_PATH . '/inc/toolset.function.helpers.php';
         require_once TOOLSET_COMMON_PATH . '/deprecated.php';
         self::$sections_loaded = $sections_loaded;
     }
 }
 public function register_inc()
 {
     if (!$this->is_section_loaded(self::TOOLSET_INCLUDES)) {
         $this->add_section_loaded(self::TOOLSET_INCLUDES);
         if (!class_exists('Toolset_Settings')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.settings.class.php';
             $this->settings = Toolset_Settings::get_instance();
         }
         if (!class_exists('Toolset_Localization')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.localization.class.php';
             $this->localization = new Toolset_Localization();
         }
         if (!class_exists('Toolset_WPLogger')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.wplogger.class.php';
         }
         if (!class_exists('Toolset_Object_Relationship')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.object.relationship.class.php';
             $this->object_relationship = Toolset_Object_Relationship::get_instance();
         }
         if (!class_exists('Toolset_Settings_Screen')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.settings.screen.class.php';
             $this->settings_screen = new Toolset_Settings_Screen();
         }
         if (!class_exists('Toolset_Export_Import_Screen')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.export.import.screen.class.php';
             $this->export_import_screen = new Toolset_Export_Import_Screen();
         }
         if (!class_exists('Toolset_Menu')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.menu.class.php';
             $this->menu = new Toolset_Menu();
         }
         if (!class_exists('Toolset_Promotion')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.promotion.class.php';
             $this->promotion = new Toolset_Promotion();
         }
         if (!class_exists('Toolset_Admin_Bar_Menu')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.admin.bar.menu.class.php';
             global $toolset_admin_bar_menu;
             $toolset_admin_bar_menu = Toolset_Admin_Bar_Menu::get_instance();
         }
         if (!class_exists('Toolset_Internal_Compatibility')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.internal.compatibility.class.php';
             $this->internal_compatibility = new Toolset_Internal_Compatibility();
         }
         if (!class_exists('Toolset_WPML_Compatibility')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.wpml.compatibility.class.php';
             $this->wpml_compatibility = new Toolset_WPML_Compatibility();
         }
         if (!class_exists('Toolset_Relevanssi_Compatibility')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.relevanssi.compatibility.class.php';
             $this->relevanssi_compatibility = new Toolset_Relevanssi_Compatibility();
         }
         if (!class_exists('Toolset_CssComponent')) {
             require_once TOOLSET_COMMON_PATH . '/inc/toolset.css.component.class.php';
             $toolset_bs_component = Toolset_CssComponent::getInstance();
         }
         require_once TOOLSET_COMMON_PATH . '/inc/toolset.compatibility.php';
         require_once TOOLSET_COMMON_PATH . '/inc/toolset.function.helpers.php';
         require_once TOOLSET_COMMON_PATH . '/deprecated.php';
         $this->apply_filters_on_sections_loaded('toolset_register_include_section');
     }
 }