Dotclear

Changeset 932


Ignore:
Timestamp:
03/24/09 00:49:43 (14 years ago)
Author:
Oaz
Message:

added behaviors for external modification of the template engines (adding template search path, adding tags, ...)
The behavoirs are "publicTemplateWidgetBeforeLoad" for the public side and "adminTemplateWidgetBeforeLoad" for the admin side.

Location:
plugins/templateWidget/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/templateWidget/trunk/_public.php

    r931 r932  
    5252    global $core, $_ctx; 
    5353    $_ctx->widget = $widget; 
    54     $core->tpl->setPath(array_merge($core->tpl->getPath(),array(dirname(__FILE__).'/../default-templates'))); 
     54    $core->tpl->setPath( 
     55      $core->tpl->getPath(), 
     56      path::real(dirname(__FILE__).'/default-templates') 
     57    ); 
     58          $core->callBehavior('publicTemplateWidgetBeforeLoad',$core->tpl,$widget); 
    5559    $code = $core->tpl->getData($widget->id().'.widget.html'); 
    5660    $_ctx->widget = null; 
  • plugins/templateWidget/trunk/inc/class.WidgetBuilder.php

    r931 r932  
    4545      $core->blog->themes_path.'/'.$core->blog->settings->theme.'/tpl', 
    4646      $core->blog->themes_path.'/default/tpl', 
    47       dirname(__FILE__).'/../default-templates', 
     47      path::real(dirname(__FILE__).'/../default-templates'), 
    4848      $this->getPath() 
    4949    ); 
     
    5151          $this->remove_php = !$core->blog->settings->tpl_allow_php; 
    5252          $this->use_cache = $core->blog->settings->tpl_use_cache; 
    53            
     53 
    5454    $this->addBlock('WidgetName',array($this,'Name')); 
    5555    $this->addBlock('WidgetDescription',array($this,'Description')); 
     
    6464    $this->addBlock('WidgetComboIf',array($this,'ComboIf')); 
    6565    $this->addValue('WidgetCombo',array($this,'Combo')); 
     66 
     67          $core->callBehavior('adminTemplateWidgetBeforeLoad',$this); 
    6668  } 
    6769 
Note: See TracChangeset for help on using the changeset viewer.

Sites map