Exemple #1
0
 /**
  * Wrapper for the filter_input php function which filter out any special character
  * so it can be used to specify paths
  *
  * @param int $type Type of input (see filter_input doc)
  * @param string $var Variable name (see filter_input doc)
  * @param int $filter Filter to use first (see filter_input doc)
  * @param array $options Filter options (see filter_input doc)
  *
  * @return string
  */
 public static function noPathFilterInput($type, $var, $filter = FILTER_DEFAULT, $options = null)
 {
     $data = filter_input($type, $var, $filter, $options);
     if (!empty($data)) {
         $data = StringTools::filterPath($data);
     }
     return $data;
 }
Exemple #2
0
 /**
  * Displays an action
  *
  * @param string $context Context to display it in.
  */
 public function display($context = 'boardloglist')
 {
     $context = StringTools::filterPath($context);
     $templateFilePath = __DIR__ . '/../templates/ActionLog/' . $this->type . '/' . $context . '.tpl';
     if (file_exists($templateFilePath)) {
         include $templateFilePath;
     }
 }
Exemple #3
0
 /**
  * Displays an item's infos
  *
  * @param string $context Context to display it in. 
  */
 public function display($context = 'board')
 {
     $context = StringTools::filterPath($context);
     $templateFilePath = __DIR__ . '/../templates/' . get_called_class() . '/' . $context . '.tpl';
     if (file_exists($templateFilePath)) {
         include $templateFilePath;
     }
 }
Exemple #4
0
 /**
  * Loads the language data for a controller
  *
  * @param string $controller Controller name
  */
 public function load($controller)
 {
     $controller = StringTools::filterPath($controller);
     $path = __DIR__ . '/../lang/' . $this->_languageCode . '/' . $controller . '.lang.php';
     if (!file_exists($path)) {
         throw new Exception('Language file not found (' . $path . ')');
     }
     include $path;
     $this->_lines += $lines;
 }