Dotclear

Changeset 2072:783d0619e389 for inc


Ignore:
Timestamp:
09/24/13 21:01:48 (12 years ago)
Author:
Dsls
Branch:
default
Message:

Handled in-plugin / out-plugin action pages display (dcPage.open vs direct html), tag_posts.php now works with new actions.

Location:
inc/admin/actions
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/actions/class.dcaction.php

    r2063 r2072  
    4949     /** @var string title for caller page title */ 
    5050     protected $caller_title; 
    51       
     51 
     52     /** @var boolean true if we are acting inside a plugin (different handling of begin/endpage) */ 
     53     protected $in_plugin;     
     54 
    5255    /** 
    5356     * Class constructor 
     
    7982               $this->redir_anchor=''; 
    8083          } 
     84          $u=explode('?',$_SERVER['REQUEST_URI']); 
     85          $this->in_plugin = (strpos($u[0],'plugin.php') !== false); 
    8186     } 
    8287      
  • inc/admin/actions/class.dcactioncomments.php

    r2071 r2072  
    3131      
    3232     public function beginPage($breadcrumb='',$head='') { 
    33           dcPage::open( 
    34                __('Comments'), 
    35                 
    36                dcPage::jsLoad('js/_comments_actions.js'). 
    37                $head, 
    38                $breadcrumb 
    39           );    
     33          if ($this->in_plugin) { 
     34               echo '<html><head><title>'.__('Comments').'</title>'. 
     35                    dcPage::jsLoad('js/_comments_actions.js'). 
     36                    $head. 
     37                    '</script></head><body>'. 
     38                    $breadcrumb; 
     39          } else { 
     40               dcPage::open( 
     41                    __('Comments'), 
     42                    dcPage::jsLoad('js/_comments_actions.js'). 
     43                    $head, 
     44                    $breadcrumb 
     45               );    
     46 
     47          } 
    4048          echo '<p><a class="back" href="'.$this->getRedirection(array(),true).'">'.__('Back to comments list').'</a></p>'; 
    4149     } 
  • inc/admin/actions/class.dcactionposts.php

    r2059 r2072  
    3030      
    3131     public function beginPage($breadcrumb='',$head='') { 
    32           dcPage::open( 
    33                __('Entries'), 
    34                 
    35                dcPage::jsLoad('js/_posts_actions.js'). 
    36                $head, 
    37                $breadcrumb 
    38           );    
     32          if ($this->in_plugin) { 
     33               echo '<html><head><title>'.__('Entries').'</title>'. 
     34                    dcPage::jsLoad('js/_posts_actions.js'). 
     35                    $head. 
     36                    '</script></head><body>'. 
     37                    $breadcrumb; 
     38          } else { 
     39               dcPage::open( 
     40                    __('Entries'), 
     41                    dcPage::jsLoad('js/_posts_actions.js'). 
     42                    $head, 
     43                    $breadcrumb 
     44               ); 
     45          } 
    3946          echo '<p><a class="back" href="'.$this->getRedirection(array(),true).'">'.__('Back to entries list').'</a></p>'; 
    4047     } 
    4148      
    4249     public function endPage() { 
    43           dcPage::close(); 
     50          if ($this->in_plugin) { 
     51               echo '</body></html>'; 
     52          } else { 
     53               dcPage::close(); 
     54          } 
    4455     } 
    4556      
Note: See TracChangeset for help on using the changeset viewer.

Sites map