Dotclear


Ignore:
Timestamp:
08/16/13 15:48:37 (12 years ago)
Author:
Dsls
Branch:
twig
Message:
  • reworked breadcrumb
  • tuned checkboxes (need to see if it works for multiple values)
  • magic methods for dcForm are more intuitive now, getField method added
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/class.dc.admincontext.php

    r1319 r1414  
    354354      
    355355     /** 
    356      Fill the page title 
     356     Add a section to the breadcrumb 
    357357      
    358358     $title can be:  
     
    365365     @return object self 
    366366     */ 
    367      public function fillPageTitle($title,$url='') 
    368      { 
    369           if (is_bool($title)) { 
    370                $this->protected_globals['page_global'] = $title; 
    371           } 
    372           elseif (null === $title) { 
    373                $this->protected_globals['page_global'] = false; 
    374                $this->protected_globals['page_title'] = array(); 
    375           } 
    376           else { 
    377                $this->protected_globals['page_title'][] = array( 
    378                     'title' => $title, 
    379                     'link' => $url 
    380                ); 
     367     public function appendBreadCrumbItem($title,$url='',$class='') 
     368     { 
     369          $this->protected_globals['page_title'][] = array( 
     370               'title' => $title, 
     371               'link' => $url, 
     372               'class' => $class 
     373          ); 
     374     } 
     375      
     376     /** 
     377     Fill the page title 
     378      
     379     $title can be:  
     380     a string for page title part or  
     381     TRUE to add blog name at the begining of title or 
     382     NULL to empty/reset title 
     383      
     384     @param mixed $title A title part 
     385     @param boolean $url Link of the title part 
     386     @return object self 
     387     */ 
     388     public function setBreadCrumb($breadcrumb, $with_home_link=true) 
     389     { 
     390          if ($with_home_link) { 
     391               $this->appendBreadCrumbItem('<img src="style/dashboard.png" alt="" />','index.php','go_home'); 
     392          } else { 
     393               $this->appendBreadCrumbItem('<img src="style/dashboard-alt.png" alt="" />'.$breadcrumb); 
     394               return $this; 
     395          } 
     396          if (is_array($breadcrumb)) { 
     397               foreach ($breadcrumb as $title => $bc) { 
     398                    $this->appendBreadCrumbItem($title,$bc); 
     399               } 
     400          } else { 
     401               $this->appendBreadcrumbItem($breadcrumb); 
    381402          } 
    382403          return $this; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map