http://forum.cmsmadesimple.org/index.ph ... 325.0.html
I came up with a 'lang' plugin, and posted on this thread, but thought that it warranted a 'tips and tricks' thread. I've expanded it a tiny bit since that post.
function.lang.php
Code: Select all
<?php
function smarty_cms_function_lang($params) {
  global $gCms;
  $cmsmodules = $gCms->modules;
  $smarty =& $gCms->GetSmarty();
  $module = $params['module'] ? $params['module'] : $smarty->get_template_vars('module');
  if (!$module) {
    return("no module specified");
  }
  return($cmsmodules[$module]['object']->Lang($params['name']));
}
?>Code: Select all
{lang module='mymodule' name='mytext'}Now templates can access Lang() without having to make changes to php code!


 It opens up new possibilities for me.
 It opens up new possibilities for me.