Beispiel #1
0
 public static function replace($pattern, $replace, $string)
 {
     $error = '';
     $str = @preg_replace($pattern, $replace, $string) | $error;
     echo $error;
     if (debug::active()) {
         $error = error_get_last();
         if (strstr($error['message'], 'preg_replace')) {
             $msg = str_replace('preg_replace() [<a href=\'function.preg-replace\'>function.preg-replace</a>]:', '', $error['message']);
             debug::add($msg . ' in ' . $pattern, 'ERROR');
         }
     }
     return $str;
 }
 function get_request($arg)
 {
     if (debug::active()) {
         debug::add($arg);
     }
     $Req = '$_REQUEST' . $this->string_to_index($arg);
     if (eval("return isset({$Req});") && eval("return {$Req};") != '') {
         if (is_array(eval("return {$Req};"))) {
             return $this->get_request_array(eval("return {$Req};"));
         } else {
             return $this->filter_request(eval("return {$Req};"));
         }
     } else {
         return '';
     }
 }
Beispiel #3
0
 /**
  * init attribs
  *
  * @acess protected
  */
 function init()
 {
     parent::init();
     if ($this->disabled === true) {
         $this->_init .= ' disabled="disabled"';
     }
     if ($this->name != '') {
         $this->_init .= ' name="' . $this->name . '"';
     }
     if ($this->tabindex != '') {
         $this->_init .= ' tabindex="' . $this->tabindex . '"';
     }
     if ($this->value != '') {
         $this->_init .= ' value="' . $this->value . '"';
     }
     $this->type = strtolower($this->type);
     switch ($this->type) {
         case 'submit':
         case 'reset':
         case 'button':
             $this->_init .= ' type="' . $this->type . '"';
             break;
         default:
             $this->_init .= ' type="button"';
             if (debug::active()) {
                 debug::add('type ' . $this->type . ' not supported - type set to button', 'ERROR');
             }
             break;
     }
 }
 function get_htmlobject_object($data)
 {
     if (isset($data['object']) && isset($data['object']['type']) && isset($data['object']['attrib']) && isset($data['object']['attrib']['name'])) {
         // set vars
         $object = strtolower($data['object']['type']);
         $attribs = $data['object']['attrib'];
         $name = $data['object']['attrib']['name'];
         // build object
         switch ($object) {
             case 'htmlobject_input':
             case 'htmlobject_select':
             case 'htmlobject_textarea':
             case 'htmlobject_button':
                 $html = $this->make_htmlobject($object, $attribs);
                 break;
             default:
                 if (debug::active()) {
                     debug::add($object . ' is not supported', 'ERROR');
                 }
                 break;
         }
         // set request
         if (isset($this->request) && count($this->request) > 0) {
             $request = '$this->request' . $this->string_to_index($name);
         }
         // build return
         if (isset($request) && $request != '' && isset($html)) {
             // add request to object
             switch ($object) {
                 case 'htmlobject_input':
                     $html = $this->handle_htmlobject_input($html, $request);
                     break;
                 case 'htmlobject_select':
                     $html = $this->handle_htmlobject_select($html, $request);
                     break;
                 case 'htmlobject_textarea':
                     $html = $this->handle_htmlobject_textarea($html, $request);
                     break;
             }
             return $html;
         } elseif (isset($html)) {
             return $html;
         } else {
             return '';
         }
     }
 }