示例#1
0
 /**
  * Called via WP do_action if can_edit_pages
  *
  * Show page tree
  */
 public function view_page_tree()
 {
     if (!current_user_can('edit_pages')) {
         wp_die(__('You do not have sufficient permissions to access this page. #314'));
     }
     // renamed from cookie to fix problems with mod_security
     wp_enqueue_script('jquery-cookie', $this->plugin_dir_url . $this->_find_minified('/js/jquery.biscuit.js'), array('jquery'));
     wp_enqueue_script('jquery-ui-tooltip');
     wp_enqueue_script('jquery-jstree', $this->plugin_dir_url . $this->_find_minified('/js/jquery.jstree.js'), false, $this->_plugin_version);
     wp_enqueue_script('jquery-alerts', $this->plugin_dir_url . $this->_find_minified('/js/jquery.alerts.js'), false, $this->_plugin_version);
     wp_enqueue_script('spm', $this->plugin_dir_url . $this->_find_minified('/js/swifty-page-manager.js'), false, $this->_plugin_version);
     wp_enqueue_style('jquery-alerts', $this->plugin_dir_url . '/css/jquery.alerts.css', false, $this->_plugin_version);
     wp_enqueue_style('spm-font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css', false, $this->_plugin_version);
     $oLocale = array('status_draft_ucase' => ucfirst(__('draft', 'swifty')), 'status_future_ucase' => ucfirst(__('future', 'swifty')), 'status_password_ucase' => ucfirst(__('protected', 'swifty')), 'status_pending_ucase' => ucfirst(__('pending', 'swifty')), 'status_private_ucase' => ucfirst(__('private', 'swifty')), 'status_trash_ucase' => ucfirst(__('trash', 'swifty')), 'password_protected_page' => __('Password protected page', 'swifty'), 'no_pages_found' => __('No pages found.', 'swifty'), 'hidden_page' => __('Hidden', 'swifty'), 'checking_url' => __('Checking url', 'swifty'), 'no_sub_page_when_draft' => __("Unfortunately you can not create a sub page under a page with status 'Draft' because the draft page has not yet been published and thus technically does not exist yet. For now, just create it as a regular page and later you can drag and drop it to become a sub page.", 'swifty'), 'status_published_draft_content_ucase' => ucfirst(__('published - draft content', 'swifty')));
     wp_localize_script('spm', 'spm_l10n', $oLocale);
     wp_localize_script('spm', 'spm_data', array('is_swifty_mode' => LibSwiftyPluginView::is_ss_mode()));
     /** @noinspection PhpIncludeInspection */
     require $this->plugin_dir . '/view/page_tree.php';
 }