Example #1
0
 /**
  * Include a set of module function used for a module. These 
  * functions will be overridden in template if they exists in a template
  * @param string $module
  * @param string $file
  * @return void
  */
 public static function includeOverrideFunctions($module, $file)
 {
     // Check for view in template
     $template = layout::getTemplateName();
     if ($template) {
         $override = conf::pathHtdocs() . "/templates/{$template}/{$module}/{$file}";
         if (is_file($override)) {
             include_once $override;
             return;
         }
     }
     include_once conf::pathModules() . "/{$module}/{$file}";
 }
Example #2
0
 /**
  * Set CSS from a module name and a CSS file. This can then be overridded
  * in a template 
  * @param   string   $module the module in context, e.g. account
  * @param   string   $css the CSS file in context, e.g. /assets/style.css
  * @param   int      $order the loading order of css 0 is first > 0 is
  *                   later.
  */
 public static function setModuleInlineCss($module, $css, $order = null, $options = array())
 {
     $module_css = conf::pathModules() . "/{$module}/{$css}";
     $template_name = layout::getTemplateName();
     $template_override = "/templates/{$template_name}/{$module}{$css}";
     if (file_exists(conf::pathHtdocs() . $template_override)) {
         self::setCss($template_override);
         return;
     }
     self::setInlineCss($module_css);
 }
Example #3
0
 /**
  * include a set of module function used for e.g. templates. These 
  * functions can be overridden in template if they exists in a template
  * @param string $module
  * @param string $file
  * @return void
  */
 public static function includeOverrideFunctions($module, $file)
 {
     // only template who has set name will be able to override this way
     // templage_name = 'clean'
     $template = layout::getTemplateName();
     if ($template) {
         $override = conf::pathHtdocs() . "/templates/{$template}/{$module}/{$file}";
         if (is_file($override)) {
             include_once $override;
             return;
         }
     }
     include_once conf::pathModules() . "/{$module}/{$file}";
 }