Updated to simplify the configuration.

We do not need to have the extra tags and modifiers in the configuration
as a signal is taking care of that. That way we can add new tags,
modifiers without the need to update the configuration settings.
dev
Loic d'Anterroches 2008-12-05 11:53:22 +01:00
parent 6ae032df3e
commit 5bd4fed8f4
3 changed files with 26 additions and 10 deletions

View File

@ -69,6 +69,29 @@ class IDF_Middleware
$request->rights[$val] = (true === IDF_Precondition::accessTabGeneric($request, $key));
}
}
/**
* Update the template tags and modifiers to not have them in the config.
*
* This is here at the moment because we do not want to put that
* in a IDF_Template class just for one method.
*
*/
public static function updateTemplateTagsModifiers($sender, &$params)
{
$params['tags'] = array_merge($params['tags'],
array(
'hotkey' => 'IDF_Template_HotKey',
'issuetext' => 'IDF_Template_IssueComment',
'timeline' => 'IDF_Template_TimelineFragment',
'markdown' => 'IDF_Template_Markdown',
));
$params['modifiers'] = array_merge($params['modifiers'],
array(
'size' => 'IDF_Views_Source_PrettySize',
'ssize' => 'IDF_Views_Source_PrettySizeSimple',
));
}
}

View File

@ -179,16 +179,6 @@ $cfg['middleware_classes'] = array(
);
$cfg['template_context_processors'] = array('IDF_Middleware_ContextPreProcessor');
$cfg['idf_views'] = dirname(__FILE__).'/urls.php';
$cfg['template_tags'] = array(
'hotkey' => 'IDF_Template_HotKey',
'issuetext' => 'IDF_Template_IssueComment',
'timeline' => 'IDF_Template_TimelineFragment',
'markdown' => 'IDF_Template_Markdown',
);
$cfg['template_modifiers'] = array(
'size' => 'IDF_Views_Source_PrettySize',
'ssize' => 'IDF_Views_Source_PrettySizeSimple',
);
# available languages
$cfg['languages'] = array('en', 'fr');

View File

@ -39,6 +39,9 @@ $m['IDF_Review_Patch'] = array('relate_to' => array('IDF_Review', 'Pluf_User'));
$m['IDF_Review_FileComment'] = array('relate_to' => array('IDF_Review_Patch', 'Pluf_User'));
Pluf_Signal::connect('Pluf_Template_Compiler::construct_template_tags_modifiers',
array('IDF_Middleware', 'updateTemplateTagsModifiers'));
# -- Standard plugins, they will run only if configured --
#
# Subversion synchronization