/**
  * FUNCTION: vlibSearchToSQL
  *
  * vlibSearchToSQL constructor.
  *
  * @param array $options see above
  * @return boolean true/false
  * @access private
  */
 function vlibSearchToSQL($options = null)
 {
     if (is_array(vlibIni::vlibSearchToSQL())) {
         foreach (vlibIni::vlibSearchToSQL() as $name => $val) {
             $this->OPTIONS[$name] = $val;
         }
     }
     if (is_array($options)) {
         foreach ($options as $key => $val) {
             if (strtoupper($key) == 'STOP_WORDS') {
                 $this->OPTIONS['STOP_WORDS'] .= ' ' . $val;
             } else {
                 $this->OPTIONS[strtoupper($key)] = $val;
             }
         }
     }
     $this->stop_words = str_replace(' ', '|', $this->OPTIONS['STOP_WORDS']);
     if (!$this->OPTIONS['allow_wildcards']) {
         $this->escapechars .= '%_';
     }
     return true;
 }
Пример #2
0
 /**
  * vlibTemplate constructor.
  * if $tmplfile has been passed to it, it will send to $this->newTemplate()
  * @param string $tmplfile full path to template file
  * @param array $options see above
  * @return boolean true/false
  * @access private
  */
 public function __construct($tmplfile = null, $options = null)
 {
     if (is_array($tmplfile) && $options == null) {
         $options = $tmplfile;
         unset($tmplfile);
     }
     $this->VLIBTEMPLATE_ROOT = dirname(realpath(__FILE__));
     if (is_array(vlibIni::vlibTemplate())) {
         foreach (vlibIni::vlibTemplate() as $name => $val) {
             $this->OPTIONS[$name] = $val;
         }
     }
     if (is_array($options)) {
         foreach ($options as $key => $val) {
             $key = strtoupper($key);
             if ($key == 'PATH') {
                 $this->setPath($val);
             } else {
                 $this->_setOption($key, strtolower($val));
             }
         }
     }
     if ($tmplfile) {
         $this->newTemplate($tmplfile);
     }
     if ($this->OPTIONS['GLOBAL_CONTEXT_VARS']) {
         $this->setContextVars();
     }
     return true;
 }
Пример #3
0
 /** FUNCTION: vlibDate [constructor]
  *
  * This function includes the languages specfic variables for displaying
  * weekdays and months for example.
  *
  * @param string $lang language, see documentation for a list of langs.
  * @access public
  */
 function vlibDate($lang = null)
 {
     $config = vlibIni::vlibDate();
     $default_lang = $config['DEFAULT_LANG'];
     $this->setLang($lang != null ? $lang : $default_lang);
 }